:root {
  --paper: #edf0ea;
  --ink: #111718;
  --line: rgba(17, 23, 24, 0.18);
  --blue: #2459d5;
  --green: #1f6a53;
  --violet: #70518d;
  --panel: #f8f7f0;
  --font-jp: Helvetica, "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "BIZ UDPMincho", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font-jp); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.skip-link { position: fixed; z-index: 10; left: 1rem; top: -4rem; padding: .7rem 1rem; background: #111; color: #fff; }
.skip-link:focus { top: 1rem; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1.25rem, 5vw, 5rem); border-bottom: 1px solid var(--line); }
.wordmark, .topbar p, .kicker, .section-title span, .lane span, .lane h2, .assignment-cards small, .assignment-cards strong, footer p:last-child { font-family: Helvetica, sans-serif; letter-spacing: .13em; }
.wordmark { display: flex; align-items: center; gap: 1rem; font-size: .82rem; }
.wordmark-icon { display: block; width: 40px; height: 40px; object-fit: cover; border-radius: 10px; }
.topbar p { display: flex; align-items: center; gap: .6rem; font-size: .68rem; }
.topbar p span, .result-note span { width: 8px; height: 8px; border-radius: 50%; background: #35a478; box-shadow: 0 0 0 6px rgba(53,164,120,.1); }
main { max-width: 1500px; margin: 0 auto; }
.intro { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 6rem); padding: clamp(3.5rem, 7vw, 7rem) clamp(1.25rem, 5vw, 5rem); }
.kicker { color: var(--blue); font-size: .72rem; font-weight: 700; }
.intro h1 { margin: 1.2rem 0 1.5rem; font-weight: 500; line-height: 1.17; font-size: clamp(2.8rem, 5vw, 5.8rem); letter-spacing: -.055em; }
.intro h1 em { color: var(--blue); font-style: normal; }
.intro-copy > p:last-child { max-width: 650px; font-size: clamp(1rem, 1.3vw, 1.22rem); line-height: 2; }
.agent-lanes { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.lane { min-width: 0; min-height: 320px; padding: 2rem 1.4rem; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.lane-aria { background: var(--ink); }
.lane-stella { background: var(--violet); min-height: 280px; }
.lane-nox { background: var(--green); min-height: 240px; }
.lane span { opacity: .7; font-size: .62rem; }
.lane h2 { margin: 1rem 0 .6rem; font-size: clamp(1.5rem, 2.5vw, 2.7rem); letter-spacing: -.04em; }
.lane p { margin: 0; line-height: 1.7; font-size: .88rem; }
.diagnosis-shell { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.router-form, .result-panel { padding: clamp(2rem, 5vw, 5rem); min-width: 0; }
.router-form { background: var(--panel); }
.result-panel { background: #d9e4dc; }
.section-title { display: flex; gap: 1.1rem; align-items: baseline; margin-bottom: 2rem; }
.section-title span { font-size: .64rem; color: var(--blue); font-weight: 700; }
.section-title h2 { margin: 0; font-size: clamp(2rem, 3vw, 3.5rem); font-weight: 500; }
label { display: grid; gap: .55rem; font-size: .95rem; line-height: 1.4; }
label small { color: var(--blue); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.65); color: var(--ink); padding: .9rem 1rem; min-height: 50px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(36,89,213,.35); outline-offset: 2px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.4rem 0; }
.wide-field { margin: 1.4rem 0; }
.form-actions, .result-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }
button { min-height: 48px; border: 1px solid var(--ink); background: transparent; padding: .8rem 1.15rem; cursor: pointer; }
.diagnose-button, #copy-button { background: var(--ink); color: #fff; }
button:hover { transform: translateY(-1px); }
.assignment-cards { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-bottom: 1.4rem; }
.assignment-cards > article { min-height: 150px; background: rgba(255,255,255,.55); border: 1px solid rgba(17,23,24,.15); padding: 1.3rem; }
.assignment-cards > span { font-family: Helvetica, sans-serif; font-size: 1.8rem; }
.assignment-cards small { font-size: .6rem; }
.assignment-cards strong { display: block; margin: 1.2rem 0 .5rem; font-size: clamp(1.7rem, 3vw, 3rem); letter-spacing: -.04em; }
.assignment-cards p { margin: 0; line-height: 1.5; }
.result-note { display: flex; align-items: center; gap: .7rem; margin: 1.5rem 0 .8rem; font-size: .78rem; }
#result { margin: 0; padding: 1.5rem; min-height: 570px; max-height: 700px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid rgba(17,23,24,.16); font-family: var(--font-jp); font-size: .92rem; line-height: 1.8; }
#copy-feedback, #form-error { min-height: 1.5em; color: #174f3f; }
[hidden] { display: none !important; }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 1.5rem clamp(1.25rem, 5vw, 5rem); border-top: 1px solid var(--line); font-size: .78rem; }

@media (max-width: 980px) {
  .intro, .diagnosis-shell { grid-template-columns: 1fr; }
  .agent-lanes { min-height: 0; }
  .lane, .lane-stella, .lane-nox { min-height: 220px; }
}

@media (max-width: 620px) {
  .topbar { min-height: 58px; padding: 0 1rem; }
  .wordmark b { font-size: .64rem; }
  .topbar p { display: none; }
  .intro { padding: 3rem 1rem; }
  .intro h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .agent-lanes { grid-template-columns: 1fr; }
  .lane, .lane-stella, .lane-nox { min-height: 0; padding: 1.3rem; }
  .lane h2 { margin: .6rem 0 .25rem; }
  .router-form, .result-panel { padding: 2.4rem 1rem; }
  .field-grid { grid-template-columns: 1fr; }
  .assignment-cards { grid-template-columns: 1fr; }
  .assignment-cards > span { transform: rotate(90deg); text-align: center; }
  .assignment-cards > article { min-height: 125px; }
  #result { min-height: 480px; font-size: .86rem; }
  .result-actions button, .form-actions button { flex: 1 1 100%; }
  footer { flex-direction: column; padding: 1.2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button:hover { transform: none; }
}

.tools-return{display:inline-flex;align-items:center;gap:.35rem;color:inherit;font-size:.78rem;font-weight:700;text-decoration:none}
.tools-return:hover,.tools-return:focus-visible{text-decoration:underline}
.ai-secretary-note{max-width:46rem;margin-top:1rem;padding:.8rem 1rem;border-left:3px solid currentColor;font-size:.84rem;line-height:1.7;opacity:.8}
.related-exit{display:grid;gap:.7rem;margin-top:1.5rem;padding:1.2rem;border:1px solid currentColor}
.related-exit[hidden]{display:none!important}
.related-exit p{margin:0;font-weight:700}
.related-exit a{color:inherit;font-weight:700;text-underline-offset:.25em}
@media(max-width:620px){.tools-return{font-size:.72rem}.related-exit{padding:1rem}}
