:root {
  --bg: #ffffff;
  --z50: #fafafa;
  --z100: #f4f4f5;
  --z200: #e4e4e7;
  --z300: #d4d4d8;
  --z400: #a1a1aa;
  --z500: #71717a;
  --z600: #52525b;
  --z700: #3f3f46;
  --z800: #27272a;
  --z900: #18181b;
  --brand: #c2410c;
  --brand-bg: #fff7ed;
  --brand-bd: #fed7aa;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-bd: #fef3c7;
  --positive: #059669;
  --negative: #dc2626;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Code", ui-monospace, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--z900);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--brand-bd);
  outline-offset: 3px;
}

.site-nav {
  border-bottom: 1px solid var(--z200);
  background: rgba(255, 255, 255, 0.97);
}

.site-nav-inner {
  width: min(1040px, calc(100% - 48px));
  height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--z800);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--z200);
  border-radius: 6px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.nav-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.nav-version,
.nav-link {
  color: var(--z500);
  font-size: 12px;
  white-space: nowrap;
}

.nav-link {
  text-decoration: none;
}

.nav-link:hover {
  color: var(--z900);
}

.wrap {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.head {
  max-width: 1040px;
  padding-bottom: 28px;
}

.eyebrow,
.section-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.htitle {
  max-width: 1040px;
  margin-top: 10px;
  color: var(--z900);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 740;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hone {
  max-width: 760px;
  margin-top: 14px;
  color: var(--z600);
  font-size: 17px;
  line-height: 1.75;
}

.hone > span {
  display: block;
}

.hone strong {
  color: var(--z900);
  font-weight: 700;
}

.disclaimer {
  margin-top: 8px;
  color: var(--z400);
  font-size: 12px;
}

#downloads,
#studies {
  scroll-margin-top: 24px;
}

#studies {
  margin-top: 42px;
}

.discovery {
  min-height: 104px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--z200);
  border-radius: 9px;
  background: #fff;
}

.discovery-copy h2,
.research-heading h2,
.backtest-copy h2,
.materials-head h2 {
  color: var(--z900);
  font-weight: 700;
  line-height: 1.35;
}

.discovery-copy h2 {
  margin-top: 3px;
  font-size: 19px;
}

.discovery-copy > p:last-child {
  margin-top: 4px;
  color: var(--z600);
  font-size: 13px;
}

.workflow-section {
  margin-top: 28px;
}

.workflow-section-head {
  padding-inline: 22px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.workflow-section-head h2 {
  color: var(--z900);
  font-size: 18px;
  font-weight: 700;
}

.workflow-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.workflow-card {
  min-width: 0;
  min-height: 258px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--z200);
  border-radius: 9px;
  background: #fff;
}

.workflow-copy {
  margin-top: 12px;
}

.workflow-copy h2 {
  color: var(--z900);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.35;
}

.workflow-copy p {
  min-height: 52px;
  margin-top: 7px;
  color: var(--z600);
  font-size: 13px;
  line-height: 1.7;
}

.workflow-result {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--z100);
  color: var(--z600);
  font-size: 12px;
}

.workflow-result span {
  margin-right: 8px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.workflow-actions {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.workflow-actions .btn {
  width: auto;
  min-width: 220px;
}

.workflow-actions .text-action,
.workflow-actions .muted {
  font-size: 11px;
}

.materials {
  margin-top: 20px;
}

.materials-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.materials-head h2 {
  font-size: 16px;
}

.text-button {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--z500);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--brand);
}

.material-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  overflow: hidden;
  border: 1px solid var(--z200);
  border-radius: 8px;
}

.material-grid li {
  min-width: 0;
  min-height: 78px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--z50);
}

.material-grid li + li {
  border-left: 1px solid var(--z200);
}

.material-grid strong {
  color: var(--z800);
  font-size: 14px;
  font-weight: 700;
}

.material-grid span {
  margin-top: 3px;
  color: var(--z500);
  font-size: 11px;
}

.research-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--z200);
  border-radius: 9px;
  background: #fff;
}

.research-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.panel-labels {
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.panel-mode {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.research-heading h2 {
  margin-top: 7px;
  font-size: 21px;
}

.research-heading > div > p {
  margin-top: 5px;
  color: var(--z600);
  font-size: 13px;
}

.prompt-details {
  min-width: 144px;
}

.prompt-details summary,
.package-details summary {
  cursor: pointer;
  color: var(--z500);
  font-size: 12px;
  font-weight: 650;
}

.prompt-details summary:hover,
.package-details summary:hover {
  color: var(--z900);
}

.prompt-details ul {
  margin: 10px 0 0 18px;
  color: var(--z500);
  font-size: 11px;
  line-height: 1.8;
}

.research-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.btn {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  border-color: var(--z900);
  background: var(--z900);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--z700);
  background: var(--z700);
}

.btn-secondary {
  border-color: var(--z200);
  background: #fff;
  color: var(--z800);
}

.btn-secondary:hover {
  border-color: var(--z400);
  background: var(--z50);
}

.output-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.output-tags li {
  min-height: 28px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--z200);
  border-radius: 5px;
  background: var(--z50);
  color: var(--z600);
  font-size: 11px;
  white-space: nowrap;
}

.package-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--z100);
}

.package-details-body {
  padding: 12px 0 2px;
  color: var(--z500);
  font-size: 12px;
}

.package-details-body ol {
  margin: 10px 0 0 20px;
  line-height: 1.75;
}

.package-row {
  margin-top: 12px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--z100);
  color: var(--z400);
  font-size: 11px;
}

.text-action {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-action:hover {
  color: #9a3412;
}

.muted {
  color: var(--z400);
}

.backtest-row {
  min-height: 104px;
  margin-top: 18px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 224px;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--z200);
  border-radius: 9px;
  background: #fff;
}

.backtest-copy h2 {
  margin-top: 3px;
  font-size: 18px;
}

.backtest-copy p {
  margin-top: 4px;
  color: var(--z600);
  font-size: 12px;
}

.requirement {
  min-height: 40px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--z200);
  border-radius: 6px;
  background: var(--z50);
  color: var(--z600);
  font-size: 11px;
  white-space: nowrap;
}

.requirement span {
  margin-right: 5px;
  color: var(--z400);
}

.requirement strong {
  margin-left: 4px;
  color: var(--brand);
  font-weight: 700;
}

.chip,
.study-kind {
  display: inline-flex;
  min-height: 22px;
  padding: 2px 7px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chip.warn {
  border-color: var(--amber-bd);
  background: var(--amber-bg);
  color: var(--amber);
}

.chip.ok {
  border-color: var(--brand-bd);
  background: var(--brand-bg);
  color: var(--brand);
}

.copy-status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--z900);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-status:not(:empty) {
  opacity: 1;
  transform: translate(-50%, 0);
}

.section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--z200);
}

.section-head-simple {
  padding-inline: 22px;
}

.sec-h {
  margin-top: 3px;
  color: var(--z900);
  font-size: 20px;
  font-weight: 700;
}

.study-list {
  margin-top: 14px;
  list-style: none;
}

.study-list li + li {
  margin-top: 8px;
}

.study-list a {
  min-height: 104px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1.2fr 1.15fr 1.55fr auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--z200);
  border-radius: 8px;
  text-decoration: none;
}

.study-list a:hover {
  border-color: var(--z400);
}

.study-tags {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow: hidden;
}

.study-kind {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--z100);
  color: var(--z600);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-identity {
  min-width: 0;
}

.study-title {
  margin-top: 4px;
  color: var(--z900);
  font-size: 16px;
  font-weight: 700;
}

.study-date {
  margin-top: 2px;
  color: var(--z400);
  font-size: 11px;
}

.study-scope {
  margin-top: 3px;
  color: var(--z500);
  font-size: 10px;
  line-height: 1.45;
}

.study-label {
  color: var(--z400);
  font-size: 10px;
  font-weight: 700;
}

.study-status {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 20px;
  padding: 2px 6px;
  align-items: center;
  border: 1px solid var(--amber-bd);
  border-radius: 4px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.study-sum {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--z600);
  max-height: 3.2em;
  overflow: hidden;
}

.study-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.study-metric {
  min-width: 0;
}

.study-metric dt {
  overflow: hidden;
  color: var(--z400);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-metric dd {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.study-metric dd.plain {
  color: var(--z700);
}

.study-metric dd.pos {
  color: var(--positive);
}

.study-metric dd.neg {
  color: var(--negative);
}

.study-metric small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--z400);
  font-size: 9px;
  text-overflow: clip;
  white-space: nowrap;
}

.study-metrics-empty {
  color: var(--z400);
  font-size: 11px;
}

.study-action {
  color: var(--z700);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.study-more {
  min-height: 38px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--z200);
  border-radius: 6px;
  background: #fff;
  color: var(--z600);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.study-more:hover {
  border-color: var(--z400);
  color: var(--z900);
}

.empty-panel {
  margin-top: 18px;
  padding: 24px 0;
  color: var(--z400);
  font-size: 14px;
}

.foot {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--z200);
  color: var(--z400);
  font-size: 11px;
}

.foot p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.foot b {
  color: var(--z600);
  font-weight: 650;
}

.banner {
  color: var(--amber);
  font-size: 13px;
}

.guide-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  margin: auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--z200);
  border-radius: 10px;
  background: #fff;
  color: var(--z900);
}

.guide-dialog::backdrop {
  background: rgba(24, 24, 27, 0.5);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.dialog-head h2 {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.35;
}

.dialog-close {
  min-width: 64px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--z200);
  border-radius: 6px;
  background: #fff;
  color: var(--z600);
  cursor: pointer;
  font-size: 12px;
}

.dialog-close:hover {
  border-color: var(--z400);
  color: var(--z900);
}

.guide-columns {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--z200);
  border-radius: 8px;
  overflow: hidden;
}

.guide-columns section {
  min-width: 0;
  min-height: 176px;
  padding: 18px;
}

.guide-columns section + section {
  border-left: 1px solid var(--z200);
}

.guide-columns span,
.install-target {
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.guide-columns h3 {
  margin-top: 8px;
  font-size: 15px;
}

.guide-columns p {
  margin-top: 7px;
  color: var(--z600);
  font-size: 12px;
  line-height: 1.7;
}

.composer-field {
  margin-top: 22px;
}

.composer-field label,
.install-section-head h3,
.agent-handoff h3 {
  color: var(--z800);
  font-size: 13px;
  font-weight: 700;
}

.composer-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.composer-label-row .text-action {
  font-size: 11px;
  white-space: nowrap;
}

.composer-field textarea {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--z200);
  border-radius: 7px;
  background: var(--z50);
  color: var(--z800);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.composer-field textarea::placeholder {
  color: var(--z400);
}

.composer-note {
  margin-top: 8px;
  color: var(--z500);
  font-size: 11px;
}

.composer-note[data-material-kind]:not([data-material-kind="empty"]) {
  color: var(--brand);
  font-weight: 650;
}

.composer-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dialog-download {
  margin-top: 16px;
  display: inline-block;
  color: var(--z500);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.dialog-download:hover {
  color: var(--brand);
}

.setup-strip {
  margin-top: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--z200);
  border-radius: 7px;
  background: var(--z50);
}

.setup-strip span {
  display: block;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.setup-strip strong {
  display: block;
  margin-top: 2px;
  color: var(--z800);
  font-size: 13px;
}

.setup-strip p {
  color: var(--z500);
  font-size: 11px;
  white-space: nowrap;
}

.package-download {
  margin-top: 14px;
}

.agent-install,
.agent-handoff {
  margin-top: 22px;
}

.install-section-head,
.install-command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.install-section-head span {
  color: var(--z400);
  font-size: 11px;
}

.agent-tabs {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--z200);
  border-radius: 7px;
}

.agent-tabs button {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: #fff;
  color: var(--z500);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.agent-tabs button + button {
  border-left: 1px solid var(--z200);
}

.agent-tabs button[aria-selected="true"] {
  background: var(--z900);
  color: #fff;
}

.agent-panel {
  margin-top: 10px;
}

.install-command-head {
  min-height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--z200);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #fff;
  color: var(--z600);
  font-size: 11px;
  font-weight: 650;
}

.install-command-head button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--z200);
  border-radius: 5px;
  background: #fff;
  color: var(--z700);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.install-command {
  min-width: 0;
  max-height: 168px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--z200);
  border-radius: 0 0 7px 7px;
  background: var(--z50);
  color: var(--z600);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agent-handoff {
  padding: 14px;
  border: 1px solid var(--z200);
  border-radius: 7px;
  background: var(--z50);
}

.agent-handoff .install-command-head {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.agent-handoff p {
  margin-top: 10px;
  color: var(--z700);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-note {
  margin-top: 14px;
  color: var(--z400);
  font-size: 11px;
  line-height: 1.65;
}

/* Learning page */
.study-page .wrap {
  width: min(760px, calc(100% - 40px));
  padding-top: 38px;
}

.back-link {
  color: var(--z500);
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--z900);
}

.study-head {
  margin-top: 30px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--z200);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-t {
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--z100);
  color: var(--z500);
  font-size: 10px;
  font-weight: 650;
}

.study-page .htitle {
  margin-top: 15px;
  font-size: 34px;
}

.study-page .hone {
  margin-top: 10px;
  font-size: 16px;
}

.identity-line {
  margin-top: 13px;
  color: var(--z400);
  font-size: 11px;
}

.learning-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--z200);
}

.learning-section h2 {
  color: var(--z900);
  font-size: 19px;
  font-weight: 680;
}

.section-intro {
  margin-top: 8px;
  color: var(--z500);
  font-size: 13px;
  line-height: 1.75;
}

.concept-figure {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--z200);
  border-radius: 8px;
  background: var(--z50);
}

.concept-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.concept-caption {
  margin-top: 8px;
  color: var(--z400);
  font-size: 11px;
  text-align: center;
}

.signal-flow {
  margin-top: 18px;
  list-style: none;
}

.signal-flow li {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
}

.signal-flow li + li {
  border-top: 1px solid var(--z100);
}

.flow-label {
  color: var(--z500);
  font-size: 11px;
  font-weight: 700;
}

.flow-text {
  color: var(--z700);
  font-size: 13px;
  line-height: 1.7;
}

.spec-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--z200);
  border-radius: 8px;
  background: var(--z200);
}

.spec-item {
  min-height: 86px;
  padding: 15px;
  background: #fff;
}

.spec-label {
  color: var(--z400);
  font-size: 10px;
  font-weight: 700;
}

.spec-value {
  margin-top: 5px;
  color: var(--z700);
  font-size: 13px;
  line-height: 1.65;
}

.audit-list {
  margin-top: 18px;
  list-style: none;
}

.audit-list li {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 16px;
}

.audit-list li + li {
  border-top: 1px solid var(--z100);
}

.audit-status {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.audit-text {
  color: var(--z600);
  font-size: 13px;
  line-height: 1.7;
}

.formula {
  margin-top: 16px;
  padding: 14px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--z50);
  color: var(--z700);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.note {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 2px solid var(--amber-bd);
  color: var(--z500);
  font-size: 12px;
  line-height: 1.7;
}

.next-list {
  margin: 16px 0 0 20px;
  color: var(--z600);
  font-size: 13px;
  line-height: 1.8;
}

.source-details {
  margin-top: 18px;
  border: 1px solid var(--z200);
  border-radius: 8px;
}

.source-details summary {
  padding: 13px 15px;
  cursor: pointer;
  color: var(--z600);
  font-size: 12px;
  font-weight: 650;
}

.source-details pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border-top: 1px solid var(--z200);
  background: var(--z50);
  color: var(--z700);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.study-foot {
  padding-top: 24px;
  color: var(--z400);
  font-size: 11px;
}

@media (max-width: 860px) {
  .discovery {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .backtest-row {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .requirement {
    grid-column: 1 / 2;
    grid-row: 2;
    width: fit-content;
  }

  .backtest-row > .btn {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .study-list a {
    grid-template-columns: 0.85fr 1.25fr 1.4fr;
  }

  .study-action {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .site-nav-inner,
  .wrap {
    width: min(calc(100% - 32px), 1040px);
  }

  .site-nav-inner {
    height: 54px;
  }

  .nav-version {
    display: none;
  }

  .wrap {
    padding-top: 34px;
  }

  .head {
    padding-bottom: 26px;
  }

  .htitle {
    font-size: 34px;
  }

  .hone {
    font-size: 15px;
    line-height: 1.7;
  }

  .discovery {
    padding: 18px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .workflow-section-head {
    padding-inline: 18px;
  }

  .discovery-action {
    width: 100%;
  }

  .workflow-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-card {
    min-height: 0;
  }

  .workflow-copy p {
    min-height: 0;
  }

  .material-grid li {
    min-height: 72px;
    padding: 12px;
  }

  .research-panel {
    padding: 20px;
  }

  .research-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .prompt-details {
    min-width: 0;
  }

  .research-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-actions > :first-child {
    grid-column: 1 / -1;
  }

  .backtest-row {
    padding: 18px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .requirement,
  .backtest-row > .btn {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .requirement {
    justify-content: center;
  }

  .study-list a {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 14px;
  }

  .study-metrics {
    grid-column: 1 / -1;
  }

  .study-action {
    grid-column: 2;
    justify-self: end;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .study-page .wrap {
    width: min(calc(100% - 28px), 760px);
  }

  .study-page .htitle {
    font-size: 28px;
  }
}

@media (max-width: 520px) {
  .site-nav-inner,
  .wrap {
    width: calc(100% - 28px);
  }

  .nav-meta .chip {
    display: none;
  }

  .wrap {
    padding-top: 24px;
    padding-bottom: 44px;
  }

  .eyebrow {
    display: none;
  }

  .head {
    padding-bottom: 20px;
  }

  .htitle {
    margin-top: 0;
    font-size: 29px;
    line-height: 1.22;
  }

  .hone > span {
    display: inline;
  }

  .hone {
    margin-top: 10px;
    line-height: 1.6;
  }

  .disclaimer {
    margin-top: 6px;
  }

  .discovery {
    padding: 14px;
    gap: 10px;
  }

  .workflow-section-head {
    padding-inline: 14px;
  }

  .discovery-copy h2 {
    font-size: 17px;
  }

  .discovery-copy > p:last-child {
    font-size: 12px;
    line-height: 1.55;
  }


  .workflow-section {
    margin-top: 22px;
  }

  .workflow-card {
    padding: 18px;
  }

  .workflow-copy h2 {
    font-size: 20px;
  }

  .workflow-actions {
    padding-top: 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .workflow-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .research-panel {
    margin-top: 16px;
    padding: 16px;
  }

  .research-heading h2 {
    font-size: 19px;
  }

  .research-actions {
    gap: 8px;
  }

  .research-actions .btn {
    min-height: 44px;
    padding: 0 8px;
    font-size: 11px;
  }

  .research-actions > :first-child {
    font-size: 13px;
  }

  .output-tags {
    gap: 6px;
  }

  .output-tags li {
    padding: 3px 8px;
    font-size: 10px;
  }

  .package-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-list a {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-principle,
  .study-metrics {
    grid-column: 1 / -1;
  }

  .study-metrics {
    padding-top: 10px;
    border-top: 1px solid var(--z100);
  }

  .study-action {
    display: none;
  }

  .foot p {
    flex-direction: column;
    gap: 4px;
  }

  .guide-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px;
  }

  .dialog-head h2 {
    font-size: 19px;
  }

  .composer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .composer-actions > :first-child {
    grid-column: 1 / -1;
  }

  .composer-actions .btn {
    min-height: 44px;
    padding: 0 8px;
    font-size: 11px;
  }

  .composer-actions > :first-child {
    font-size: 13px;
  }

  .setup-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .setup-strip p {
    white-space: normal;
  }

  .agent-tabs button {
    padding: 0 5px;
    font-size: 11px;
  }

  .install-command-head {
    align-items: flex-start;
  }

  .agent-handoff .install-command-head {
    align-items: center;
  }

  .install-command {
    align-items: stretch;
    flex-direction: column;
  }

  .install-command code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .install-command button {
    width: 100%;
  }
}

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

  .copy-status {
    transition: none;
  }
}
