.studies-view { max-width: 1240px; }
.study-intro { max-width: 56ch; color: var(--ink-soft); font-size: 16px; margin: 8px 0 26px; }
.study-create { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 20px; background: var(--surface); margin-bottom: 28px; }
.study-create summary { cursor: pointer; font-weight: 650; }
.study-create form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 22px; margin-top: 18px; }
.study-create label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.study-create input { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--ink); }
.study-create form p { grid-column: 1 / -1; margin: 0; }
.study-create form button { justify-self: start; }
.studies-layout { display: grid; grid-template-columns: minmax(180px, 235px) minmax(0, 1fr); gap: 34px; align-items: start; }
.study-index h2 { font-size: 14px; margin: 0 0 14px; color: var(--muted); }
.study-index > a { display: grid; gap: 5px; padding: 15px 13px; margin: 0 0 7px; border-left: 3px solid transparent; color: var(--ink-soft); overflow-wrap: anywhere; }
.study-index > a strong { color: var(--ink); font-size: 13px; }
.study-index > a small { color: var(--muted); }
.study-index > a[aria-current] { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.study-detail { min-width: 0; padding: 24px 29px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.study-detail h2 { margin: 8px 0 14px; font-size: 23px; line-height: 1.5; }
.study-detail h3 { font-size: 16px; margin: 0 0 12px; }
.study-detail h4 { font-size: 15px; line-height: 1.7; }
.study-detail p { max-width: 74ch; overflow-wrap: anywhere; }
.study-scope { color: var(--muted); font-size: 12px; }
.study-seed-link { font-size: 13px; }
.study-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 20px; padding: 21px 0; margin: 20px 0; border-top: 2px solid var(--accent); border-bottom: 1px solid var(--line); }
.study-next > p { grid-column: 1 / -1; margin: 0; }
.study-next div p { font-size: 13px; margin: 5px 0; }
.study-next button { background: var(--accent); color: var(--color-primary-content); border-color: var(--accent); }
.study-next button:disabled { background: var(--surface-muted); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.study-coverage { display: flex; flex-wrap: wrap; gap: 9px 22px; color: var(--ink-soft); font-size: 12px; margin: 22px 0; font-variant-numeric: tabular-nums; }
.study-tabs { display: flex; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 23px; }
.study-tabs button { border-color: transparent; background: transparent; }
.study-tabs button[aria-current] { color: var(--accent-strong); background: var(--accent-soft); }
.study-dependencies { padding-left: 22px; }
.study-dependencies > li { padding: 6px 0 24px 5px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.study-dependencies .tag { margin-left: 9px; }
.study-detail details { margin: 13px 0; }
.study-detail summary { cursor: pointer; color: var(--ink-soft); }
.study-detail dl { margin: 17px 0; }
.study-detail dt { font-weight: 650; font-size: 13px; margin-top: 15px; color: var(--ink-soft); }
.study-detail dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.study-missing { color: var(--danger); font-weight: 600; }
.study-source-window { margin-top: 12px; padding: 14px; background: var(--surface-muted); border-radius: 6px; }
.study-source-window pre { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; font: 12px/1.7 var(--font-mono); }
.study-check, .study-transfer { padding: 0 0 20px; margin: 20px 0; border-bottom: 1px solid var(--line); }
.study-reference-list { padding-left: 24px; }
.study-reference-list > li { padding: 5px 0 13px 7px; border-bottom: 1px solid var(--line); }
.study-placeholder { color: var(--muted); padding: 30px 0; }
.study-agent-packet { margin: 16px 0; }
.study-packet-content { padding: 4px 0 12px; }
.study-packet-content textarea { display: block; width: 100%; margin-top: 12px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--ink); font: 12px/1.6 var(--font-mono); }
.study-check > .acts { margin-top: 12px; }
.study-check-history { padding: 1px 18px 12px; margin-top: 16px; background: var(--surface-muted); border-left: 3px solid var(--accent); }
.study-check-history h5 { font-size: 14px; margin: 19px 0 8px; }
.study-answer { white-space: pre-wrap; }
.study-evidence { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; font: 12px/1.7 var(--font-mono); }
.study-agent-packet button:focus-visible, .study-check button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) {
  .studies-layout { grid-template-columns: 1fr; gap: 20px; }
  .study-index { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; }
  .study-index h2 { display: none; }
  .study-index > a { min-width: 200px; border-left-width: 0; border-bottom: 3px solid transparent; }
  .study-detail { padding: 19px 16px; }
  .study-detail h2 { font-size: 20px; }
  .study-create form { grid-template-columns: 1fr; }
  .study-next { grid-template-columns: 1fr; }
}
