/* Study 03 composes the accepted optical material; shared material.css is intact. */
.review-main { max-width: 1512px; padding: 24px 32px 20px; }
.study-header, .study-title, .study-header nav { display: flex; align-items: center; gap: 16px; }
.study-header { justify-content: space-between; }
.study-title > .icon { width: 25px; height: 25px; color: var(--muted); }
.study-title h1 { font-size: 20px; letter-spacing: -.025em; }
.eyebrow { display: block; font-size: 11px; font-weight: 450; color: var(--muted); letter-spacing: .015em; margin-bottom: 3px; }
.quiet-button, .quiet-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-decoration: none; }
.quiet-link { border-color: transparent; color: var(--muted); }
.quiet-button:hover, .quiet-link:hover { background: var(--field); }
.quiet-button:active { background: var(--accent-wash); }
.layout-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; max-width: 930px; }
.layout-choices button { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; background: transparent; text-align: left; }
.layout-choices strong { font-size: 14px; font-weight: 550; display: block; }
.layout-choices small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.layout-choices .selection-mark { margin-left: auto; flex: 0 0 16px; }
.layout-choices button[aria-pressed='true'] { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--field)); box-shadow: inset 0 1px 0 var(--reflection); }
.study-instruction { margin: 12px 0 18px; font-size: 13px; color: var(--ink); }
.study-instruction span { color: var(--muted); margin-left: 4px; }
.workspace { position: relative; height: clamp(560px, calc(100svh - 270px), 780px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--canvas); }
.workflow-bar { position: absolute; z-index: 3; inset: 14px 14px auto; display: flex; gap: 22px; align-items: center; padding: 12px 16px; border-radius: 11px; }
.workflow-heading h2 { font-size: 15px; font-weight: 550; letter-spacing: -.015em; }
.run-state { margin-left: auto; white-space: nowrap; }
.workflow-bar .quiet-button { flex-shrink: 0; }
.graph-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: pan-y; }
.graph-viewport.dragging { cursor: grabbing; }
.review-canvas { position: absolute; width: 1232px; height: 460px; transform-origin: 0 0; will-change: transform; }
.review-canvas.moving { transition: transform 300ms cubic-bezier(.2,.8,.25,1); }
.review-connections { position: absolute; inset: 0; width: 1232px; height: 460px; stroke: var(--line); stroke-width: 1.3; fill: none; }
.review-connections > path { marker-end: url(#review-arrow); }
.review-connections > path[data-state='done'] { stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.review-node { gap: 9px; }
.review-node .node-kind { font-size: 10px; gap: 7px; }
.review-node .node-kind code { font-size: 10px; }
.review-node:hover { border-color: var(--muted); }
.review-node.selected { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.canvas-controls { position: absolute; z-index: 2; bottom: 14px; left: 14px; display: flex; align-items: center; padding: 3px; border-radius: 9px; }
.canvas-controls button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 6px; font-size: 19px; }
.canvas-controls button:hover { background: var(--field); }
.canvas-controls output { width: 45px; text-align: center; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.canvas-controls > span { height: 18px; width: 1px; background: var(--line); margin: 0 4px; }
.graph-caption { position: absolute; bottom: 24px; right: 24px; font-size: 12px; color: var(--muted); max-width: 46ch; text-align: right; pointer-events: none; }
.detail { position: absolute; inset: 99px 14px 72px auto; margin: 0; padding: 0; width: 360px; height: calc(100% - 171px); max-width: calc(100% - 28px); max-height: none; border-radius: 13px; color: var(--ink); overflow: hidden; z-index: 4; }
.detail[open] { display: flex; flex-direction: column; }
body[data-layout='inline'] .detail { width: min(660px, 62%); }
.detail::backdrop { background: rgb(10 20 30 / .16); }
.detail-head { display: flex; flex-shrink: 0; align-items: center; gap: 12px; justify-content: space-between; padding: 14px 12px 8px 20px; }
.detail-head h2 { font-size: 17px; font-weight: 550; }
.detail-head .icon-button { width: 40px; height: 40px; }
.detail-meta { display: flex; flex-shrink: 0; gap: 12px; align-items: center; justify-content: space-between; padding: 0 20px 14px; }
#detail-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.detail-tabs { display: flex; flex-shrink: 0; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.detail-tabs button { position: relative; border: 0; padding: 10px 10px 12px; min-height: 44px; font-size: 13px; background: transparent; color: var(--muted); }
.detail-tabs button[aria-selected='true'] { color: var(--ink); }
.detail-tabs button[aria-selected='true']::after { content: ''; position: absolute; height: 2px; background: var(--accent); inset: auto 10px 0; border-radius: 2px; }
.detail-body { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tab-pane:focus-visible, .reading-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.article-summary { padding: 22px 22px 24px; }
.article-summary h3 { font-size: 23px; line-height: 1.2; letter-spacing: -.035em; font-weight: 550; margin: 12px 0; max-width: 14ch; }
.article-summary > p { font-size: 13px; line-height: 1.65; color: var(--muted); }
.summary-rule { width: 32px; height: 1px; background: var(--line); margin: 22px 0; }
.article-summary ol { padding-left: 18px; margin: 10px 0 22px; color: var(--muted); font-size: 12px; }
.article-summary li + li { margin-top: 8px; }
.detail-read { flex: 0 0 auto; padding: 12px 18px; border-top: 1px solid var(--line); }
.detail-read .read-button { background: var(--field); min-height: 44px; }
.document-tools { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px; font-size: 11px; color: var(--muted); }
.article-copy { background: var(--paper); color: var(--ink); padding: 30px 32px 36px; }
.article-copy .article-eyebrow { margin: 0 0 16px; font-size: 11px; color: var(--muted); }
.article-copy h2 { font-size: 32px; font-weight: 550; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 22px; max-width: 20ch; }
.article-copy h3 { font-size: 19px; font-weight: 550; letter-spacing: -.02em; line-height: 1.3; margin: 32px 0 14px; }
.article-copy p { font-size: 15px; line-height: 1.8; margin: 12px 0; }
.article-copy .article-lead { color: var(--muted); font-size: 17px; line-height: 1.7; margin-bottom: 26px; }
.article-copy .article-note { margin: 24px 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--line); }
.article-note strong { font-size: 13px; font-weight: 550; }
.article-note p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 8px 0; }
.article-steps { list-style: decimal-leading-zero; padding-left: 30px; margin: 22px 0 28px; }
.article-steps li { padding-left: 8px; margin: 18px 0; }
.article-steps li::marker { font-size: 12px; color: var(--muted); }
.article-steps strong { display: block; font-size: 14px; font-weight: 550; margin-bottom: 5px; }
.article-steps span { font-size: 14px; line-height: 1.65; color: var(--muted); }
.input-list { padding: 22px; margin: 0; }
.input-list > div + div { margin-top: 23px; }
.input-list dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.input-list dd { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.log-description { padding: 20px 22px 10px; color: var(--muted); font-size: 12px; }
.event-log { list-style: none; padding: 0 22px 22px; margin: 0; }
.event-log li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.event-log time { color: var(--muted); font: 11px ui-monospace, monospace; line-height: 1.8; }
.other-result { padding: 24px 22px; }
.other-result h3 { font-size: 21px; letter-spacing: -.025em; font-weight: 550; line-height: 1.25; margin-bottom: 14px; }
.other-result p { line-height: 1.7; font-size: 14px; margin-bottom: 15px; }
.other-result .result-footnote { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 24px; }
.decision-footer { flex: 0 0 auto; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.decision-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 10px; }
.decision-buttons { display: flex; gap: 10px; }
.decision-buttons > button { flex: 1; min-height: 44px; }
.scenario-strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 10px 0 40px; }
.scenario-strip p { font-size: 12px; color: var(--muted); max-width: 65ch; }
.scenario-actions { display: flex; gap: 8px; flex-shrink: 0; }
.scenario-actions .quiet-button { color: var(--muted); }
#step-select { display: none; font: inherit; font-size: 16px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--field); min-width: 0; }
.study-feedback { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.study-feedback > div:first-child { max-width: 46ch; grid-row: span 2; }
.study-feedback h2 { font-size: 18px; margin: 6px 0 12px; }
.study-feedback p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.study-feedback textarea { display: block; width: 100%; min-height: 96px; border: 1px solid var(--line); background: var(--field); color: var(--ink); border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.6; resize: vertical; }
.study-feedback textarea::placeholder { color: var(--muted); }
.study-feedback .feedback-actions { margin: 0; flex-wrap: wrap; gap: 10px; }
.study-feedback .feedback-actions span { font-size: 11px; }
#review-copy-fallback { grid-column: 2; }
.study-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.study-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); text-decoration: none; }
.study-footer .icon { width: 15px; height: 15px; }
.reading { position: fixed; inset: 0; margin: auto; width: min(800px, calc(100vw - 48px)); height: min(900px, calc(100dvh - 48px)); max-height: none; max-width: none; padding: 0; border-radius: 15px; overflow: hidden; color: var(--ink); }
.reading[open] { display: flex; flex-direction: column; }
.reading::backdrop { background: rgb(7 15 23 / .35); }
.reading-head { display: flex; align-items: center; gap: 20px; padding: 14px 16px 14px 26px; flex-shrink: 0; }
.reading-head h2 { font-size: 15px; }
.reading-head > .state { margin-left: auto; font-size: 11px; }
.reading-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; margin: 0 8px; border-radius: 9px; background: var(--paper); scrollbar-width: thin; }
.reading .article-copy { max-width: 690px; padding: 40px 36px 48px; margin: auto; }
.reading .article-copy h2 { font-size: 38px; }
.reading .article-copy p { font-size: 16px; }
.reading .article-copy .article-lead { font-size: 18px; }
.reading .decision-footer { padding: 12px 24px; display: flex; align-items: center; gap: 24px; border-top: 0; }
.reading .decision-note { margin: 0; flex: 1; }
.reading .decision-buttons { min-width: 260px; }
.reading.entering, .reading.leaving { animation-name: rise; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body:has(dialog:modal) { overflow: hidden; }
@media (max-width: 1000px) {
  .review-main { padding: 20px; }
  .workflow-bar { gap: 12px; }
  .workflow-heading h2 { font-size: 14px; }
  .workflow-bar #open-review { padding: 8px; font-size: 12px; }
  .run-state .state { font-size: 11px; }
  body[data-layout='inline'] .detail { width: 57%; }
  .article-copy { padding: 24px; }
  .article-copy h2 { font-size: 28px; }
  .graph-caption { max-width: 29ch; }
  .study-header nav { gap: 4px; }
}
@media (max-width: 760px), (max-width: 1024px) and (max-height: 540px) {
  .review-main { padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .study-header { flex-wrap: wrap; gap: 6px; }
  .study-title { gap: 8px; }
  .study-title > .icon { width: 20px; height: 20px; }
  .study-title h1 { font-size: 18px; }
  .study-header nav { width: 100%; justify-content: space-between; }
  .study-header .quiet-link { font-size: 12px; padding-left: 0; }
  #theme { border: 0; font-size: 12px; padding-right: 0; }
  .layout-choices { gap: 8px; margin-top: 10px; }
  .layout-choices button { align-items: flex-start; gap: 8px; padding: 10px; position: relative; min-height: 76px; }
  .layout-choices .choice-letter { font-size: 11px; margin-top: 1px; }
  .layout-choices strong { font-size: 13px; font-weight: 500; padding-right: 14px; }
  .layout-choices small { font-size: 11px; line-height: 1.4; margin-top: 6px; }
  .layout-choices .selection-mark { position: absolute; right: 6px; top: 10px; width: 12px; height: 12px; }
  .study-instruction { font-size: 12px; margin: 12px 0; line-height: 1.6; }
  .study-instruction span { display: block; margin: 2px 0 0; }
  .workspace { height: clamp(350px, 55svh, 460px); border-radius: 12px; }
  .workflow-bar { inset: 8px 8px auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; border-radius: 9px; }
  .workflow-heading { flex: 1 1 100%; }
  .workflow-heading h2 { font-size: 13px; }
  .workflow-heading .eyebrow { font-size: 10px; }
  .run-state { margin-left: 0; margin-right: auto; }
  .workflow-bar #open-review { min-height: 44px; border: 0; padding: 0 3px; font-size: 12px; }
  .canvas-controls { bottom: 10px; left: 10px; }
  .canvas-controls button { width: 44px; height: 44px; }
  .graph-caption { display: none; }
  .detail, body[data-layout='inline'] .detail { position: fixed; inset: auto 8px max(8px, env(safe-area-inset-bottom)); margin: 0; width: calc(100vw - 16px); max-width: none; height: min(560px, 82dvh); max-height: calc(100dvh - 24px - env(safe-area-inset-top)); border-radius: 15px; }
  body[data-layout='inline'] .detail { height: min(860px, 89dvh); }
  .detail.entering, .detail.leaving { animation-name: rise; }
  .detail-head { padding: 10px 10px 6px 18px; }
  .detail-head .icon-button { width: 44px; height: 44px; }
  .detail-head h2 { font-size: 16px; }
  .detail-meta { padding: 0 18px 10px; }
  .detail-tabs { padding: 0 10px; }
  .detail-tabs button { font-size: 14px; padding: 10px 12px; }
  .article-summary { padding: 20px 18px; }
  .article-summary h3 { font-size: 25px; max-width: 18ch; }
  .article-summary p { font-size: 14px; }
  .article-summary ol { font-size: 13px; }
  .article-copy { padding: 24px 20px; }
  .article-copy h2 { font-size: 30px; }
  .article-copy p { font-size: 16px; line-height: 1.7; }
  .article-copy .article-lead { font-size: 17px; }
  .article-copy h3 { font-size: 20px; }
  .article-steps span { font-size: 15px; }
  .document-tools { padding: 2px 12px 2px 18px; }
  .decision-footer { padding: 10px 16px 14px; }
  .decision-note { font-size: 11px; }
  .decision-buttons > button { font-size: 14px; }
  .scenario-strip { display: block; margin: 12px 0 32px; }
  .scenario-strip p { font-size: 12px; min-height: 36px; margin-bottom: 10px; }
  .scenario-actions { display: flex; width: 100%; }
  #step-select { display: block; flex: 1; width: 0; }
  .scenario-actions #restart { flex: 0 0 44px; width: 44px; padding: 0; font-size: 0; }
  #restart .icon { width: 18px; height: 18px; }
  .study-feedback { display: block; padding-top: 22px; }
  .study-feedback h2 { font-size: 19px; line-height: 1.4; }
  .study-feedback textarea { margin-top: 16px; font-size: 16px; }
  .study-feedback .feedback-actions { margin-top: 12px; }
  .study-feedback .feedback-actions span { font-size: 12px; }
  .study-footer { flex-direction: column; align-items: flex-start; gap: 8px; line-height: 1.6; }
  .reading { inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); margin: 0; width: calc(100vw - 16px); height: auto; border-radius: 13px; }
  .reading-head { padding: 8px 8px 8px 16px; gap: 10px; }
  .reading-head .state { display: none; }
  .reading-head .icon-button { margin-left: auto; }
  .reading-head h2 { font-size: 14px; }
  .reading-scroll { margin: 0 5px; border-radius: 7px; }
  .reading .article-copy { padding: 24px 18px 32px; }
  .reading .article-copy h2 { font-size: 32px; }
  .reading .article-copy .article-lead { font-size: 17px; }
  .reading .decision-footer { padding: 10px 14px 12px; display: block; }
  .reading .decision-note { margin-bottom: 8px; }
  .reading .decision-buttons { min-width: 0; }
}
@media (max-width: 360px) { .study-title > .icon { display: none; } .layout-choices button { padding: 10px 8px; gap: 5px; } .layout-choices strong { font-size: 12px; } .layout-choices small { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .review-canvas.moving { transition: none; } }
