:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #20203a;
  background: #f8f9fd;
  --ink: #181932;
  --muted: #596078;
  --line: #e2e5f0;
  --blue: #3545ed;
  --blue-dark: #2635cc;
  --blue-soft: #eef0ff;
  --white: #fff;
  --coral: #ffab98;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100svh; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.12; }
p { line-height: 1.55; }
:focus-visible { outline: 3px solid #6873f4; outline-offset: 3px; }

.page-width { width: min(100% - clamp(2rem, 7vw, 7rem), 76rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: var(--white); }
.topbar-inner { min-height: 4.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; flex: 0 1 auto; min-width: 0; }
.brand img { display: block; width: 10.5rem; max-width: 100%; height: auto; }
.environment { white-space: nowrap; border: 1px solid #dfe3ff; border-radius: 999px; padding: .42rem .72rem; color: #303b9a; background: var(--blue-soft); font-size: .78rem; font-weight: 700; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 2.25rem; border-top: 1px solid var(--line); padding-block: 1rem 1.5rem; color: var(--muted); font-size: .8rem; }

.access { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2.5rem, 6vw, 7rem); align-items: center; padding-block: clamp(2.3rem, 6.5vh, 4rem) 0; }
.access-copy { width: 100%; max-width: 29rem; justify-self: center; padding-block: 2rem; }
.eyebrow { color: #3441bc; font-weight: 750; letter-spacing: .095em; font-size: .72rem; text-transform: uppercase; margin-bottom: .85rem; }
.access h1 { font-size: clamp(2.7rem, 5.1vw, 4.5rem); font-weight: 760; letter-spacing: -.072em; line-height: 1.02; }
.access-intro { margin-top: 1.05rem; margin-bottom: 2rem; color: var(--muted); font-size: clamp(.98rem, 1.3vw, 1.08rem); }
#login-form { display: grid; gap: .5rem; }
#login-form input { margin-bottom: .7rem; }
.sign-in-button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: .3rem; }
.sign-in-button span { font-size: 1.3rem; line-height: 1; }
.access-note { color: var(--muted); font-size: .82rem; margin-top: 1rem; }
.access-visual { position: relative; min-width: 0; aspect-ratio: 1.02; min-height: 31rem; max-height: 37.5rem; isolation: isolate; overflow: hidden; border-radius: 1.5rem; background: #161c41; }
.access-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 61% 48%; }
.access-visual::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(180deg, transparent, rgb(13 18 48 / .85)); }
.access-visual figcaption { position: absolute; z-index: 1; display: grid; gap: .38rem; inset: auto 1.65rem 1.85rem; color: white; font-size: clamp(1.55rem, 3vw, 2.5rem); font-weight: 760; line-height: 1.1; letter-spacing: -.045em; }
.access-visual .visual-kicker { width: fit-content; border-left: 3px solid var(--coral); padding-left: .65rem; color: #eef0ff; font-size: .76rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }

label { font-size: .88rem; font-weight: 680; line-height: 1.35; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; min-height: 2.95rem; border: 1px solid #cbd1e1; border-radius: .62rem; background: var(--white); padding: .68rem .78rem; color: var(--ink); }
input::placeholder { color: #6d748c; }
input:disabled, select:disabled, textarea:disabled { background: #f6f7fb; color: #555d75; opacity: 1; }
textarea { resize: vertical; }
button { min-height: 2.7rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: .65rem; cursor: pointer; font-size: .87rem; font-weight: 700; line-height: 1.3; }
button:disabled { cursor: not-allowed; opacity: .55; }
.primary { background: var(--blue); color: var(--white); }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: var(--white); color: #31384e; border-color: #d6daea; }
.secondary:hover:not(:disabled) { background: #f3f5fb; border-color: #aab5eb; }
.notice:empty { display: none; }
.notice { color: #313d8c; background: var(--blue-soft); border-radius: .65rem; padding: .7rem .85rem; font-size: .87rem; margin-block: .75rem; }

.workspace { padding-top: clamp(2rem, 6vw, 3.6rem); }
.workspace-head, .consultations-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.workspace h1 { font-size: clamp(2.05rem, 4.5vw, 3.55rem); letter-spacing: -.065em; overflow-wrap: anywhere; }
.areas { margin-top: 1.35rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.area { display: grid; gap: .2rem; min-width: 0; padding: .65rem .9rem; background: white; border: 1px solid var(--line); border-radius: .72rem; }
.area dt { color: var(--muted); font-size: .78rem; }
.area dd { font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.consultations { margin-top: 2rem; border: 1px solid var(--line); border-radius: 1.1rem; background: white; overflow: clip; }
.consultations-head { padding: 1.2rem clamp(1rem, 3vw, 1.6rem); border-bottom: 1px solid var(--line); }
.consultations-head h2 { font-size: 1.45rem; letter-spacing: -.04em; }
.consultations-head p { margin-top: .25rem; color: var(--muted); font-size: .86rem; }
.consultations-layout { display: grid; grid-template-columns: minmax(15rem, 30%) minmax(0, 1fr); }
.queue { min-width: 0; background: #fafbfe; border-right: 1px solid var(--line); padding: clamp(.9rem, 2.5vw, 1.35rem); }
.queue label { display: block; margin-bottom: .4rem; }
#draft-list { display: grid; gap: .45rem; padding: 0; margin-block: 1rem .75rem; list-style: none; }
.queue-item { width: 100%; display: grid; gap: .4rem; padding: .74rem; background: var(--white); border-color: var(--line); color: var(--ink); text-align: left; }
.queue-item:hover, .queue-item[aria-pressed=true] { background: #f0f2ff; border-color: #aeb8fa; }
.queue-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; }
.queue-item strong { overflow-wrap: anywhere; }
.queue-item-detail, .empty-queue { font-size: .8rem; font-weight: 500; color: var(--muted); }
.status { width: fit-content; white-space: nowrap; border-radius: 999px; padding: .22rem .48rem; color: #70441d; background: #fff0dc; font-weight: 750; font-size: .72rem; }
.status.sent { color: #3d3da3; background: #e9eaff; }
.editor { min-width: 0; padding: clamp(1rem, 3.5vw, 2.25rem); }
.editor form, .editor-fields { display: grid; gap: 1.05rem; }
.editor-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .25rem; }
.editor-head h3 { font-size: 1.4rem; letter-spacing: -.04em; }
.editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor label { display: grid; gap: .42rem; }
.editor .check-label { display: flex; align-items: start; gap: .59rem; padding: .76rem; background: #f7f8fe; border: 1px solid var(--line); border-radius: .65rem; }
.check-label input { width: 1.05rem; height: 1.05rem; margin: 0; flex-shrink: 0; accent-color: var(--blue); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.conflict, .history { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.conflict p { margin-bottom: .8rem; }
.history ol { padding-left: 1.35rem; }
.history ol li { margin-block: .6rem; overflow-wrap: anywhere; }
.history p { color: var(--muted); font-size: .87rem; margin-top: .45rem; }

.wizard-heading { display: flex; align-items: start; justify-content: space-between; gap: .55rem; }
.mock-label { margin-top: .35rem; color: var(--muted); font-size: .8rem; }
#save-state { padding: .35rem .55rem; color: #3344a8; background: var(--blue-soft); border-radius: .5rem; font-size: .76rem; font-weight: 700; }
#save-state[data-tone=done] { background: #e9f6f0; color: #17634a; }
#save-state[data-tone=error] { background: #fff1e5; color: #863e15; }
.wizard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .44rem; padding: .38rem; background: #f3f4fc; border-radius: .8rem; }
.wizard-steps button { display: flex; justify-content: center; align-items: center; gap: .4rem; min-width: 0; padding: .44rem .35rem; background: transparent; color: #454a67; }
.wizard-steps button[aria-current=step] { background: white; border-color: #d7dbff; color: #2e3bc3; }
.wizard-steps button span { flex: 0 0 1.23rem; height: 1.23rem; border-radius: 50%; display: grid; place-items: center; background: #e3e6fb; color: #3b4281; font-size: .72rem; }
.wizard-steps button[aria-current=step] span { background: var(--blue); color: white; }
.wizard-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; }
.case-summary { padding: .65rem .85rem; background: #f6f7fc; border: 1px solid var(--line); border-radius: .7rem; }
.case-summary dl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .65rem; }
.case-summary dd { overflow-wrap: anywhere; font-size: .84rem; font-weight: 700; }
.case-summary dt { color: var(--muted); font-size: .72rem; margin-bottom: .15rem; }
.wizard-page { display: grid; gap: 1rem; }
.wizard-page h4 { margin: 0; color: var(--ink); font-size: 1.08rem; }
.wizard-page fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
.wizard-page legend { padding: 0; margin-bottom: .5rem; color: var(--ink); font-weight: 700; font-size: .91rem; }
.choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.editor .choices label { position: relative; display: flex; justify-content: center; align-items: center; min-height: 44px; min-width: 44px; padding: .52rem .72rem; text-align: center; border: 1px solid #d1d6e8; border-radius: .65rem; cursor: pointer; background: white; }
.editor .choices input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.editor .choices label:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); color: #2636c4; box-shadow: inset 0 0 0 1px var(--blue); }
.editor .choices label:has(input:focus-visible) { outline: 3px solid #6873f4; outline-offset: 2px; }
.editor .choices label:has(input:disabled) { cursor: default; background: #f8f9fd; }
.editor .choices label:has(input:checked:disabled) { background: var(--blue-soft); }
.editor .symptoms label { flex: 1 1 6rem; }
.scale-labels { display: flex; justify-content: space-between; gap: .5rem; margin-top: .45rem; color: var(--muted); font-size: .75rem; }
.review { padding: .65rem .85rem; border: 1px solid var(--line); border-radius: .65rem; background: #f6f7fc; }
.review h5 { margin: 0 0 .3rem; font-size: .87rem; }
.review p { color: var(--muted); font-size: .84rem; }
.wizard-actions { position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: space-between; gap: .55rem; border-top: 1px solid var(--line); padding-block: .7rem max(.6rem, env(safe-area-inset-bottom)); background: white; }
.wizard-actions > :last-child { justify-content: end; }

@media (min-width: 1120px) {
  .wizard-body { grid-template-columns: minmax(0, 1fr) minmax(7.5rem, .28fr); }
  .case-summary { grid-column: 2; grid-row: 1; align-self: start; }
  .case-summary dl { grid-template-columns: 1fr; }
  .wizard-content { grid-column: 1; grid-row: 1; }
}

@media (max-width: 850px) {
  .access { gap: 2rem; }
  .access-visual { min-height: 25rem; }
  .consultations-layout { grid-template-columns: minmax(12rem, 33%) minmax(0, 1fr); }
  .editor-fields { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar-inner { min-height: 4.1rem; }
  .brand img { width: 8.65rem; }
  .environment { font-size: .69rem; padding: .35rem .52rem; }
  .access { grid-template-columns: 1fr; gap: 1.45rem; padding-top: 1.65rem; }
  .access-copy { max-width: 100%; padding-block: .8rem 0; }
  .access h1 { font-size: clamp(2.65rem, 9vw, 3.6rem); }
  .access-intro { margin-bottom: 1.35rem; }
  .access-visual { aspect-ratio: 1.8; min-height: 0; max-height: 18rem; border-radius: 1rem; }
  .access-visual img { object-position: 58% 46%; }
  .access-visual figcaption { inset: auto 1.1rem 1.1rem; }
  .consultations-layout { grid-template-columns: 1fr; }
  .queue { border-right: 0; border-bottom: 1px solid var(--line); }
  #draft-list { max-height: 13rem; overflow-y: auto; padding: .2rem; }
  .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-steps button { justify-content: start; padding-inline: .55rem; }
  .wizard-actions { flex-wrap: wrap; }
}
