/* Virtual Shake Table — lab layout, results and A4 report pages */
.st-lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
.st-panel { border: 1px solid var(--ink); background: var(--surface); min-width: 0; }
.st-lab > * { min-width: 0; }
.st-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ink); }
.st-tabs button { border: 0; background: var(--bg); padding: 12px 8px; min-height: 52px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: left; }
.st-tabs button + button { border-left: 1px solid var(--line); }
.st-tabs button b { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border: 1px solid currentColor; font-weight: 500; }
.st-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--yellow); }
.st-tabs button[aria-selected="true"] b { background: var(--yellow); border-color: var(--ink); }
.st-pane { padding: 18px 18px 22px; }
.st-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-card { text-align: left; border: 1px solid var(--line-strong); background: var(--bg); padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-height: 92px; font: inherit; color: inherit; }
.st-card b { font-family: var(--font-display); font-size: 14px; line-height: 1.2; letter-spacing: -0.01em; }
.st-card span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.st-card em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--blue); margin-top: auto; }
.st-card:hover { border-color: var(--ink); }
.st-card.is-on { border-color: var(--ink); background: var(--surface); box-shadow: inset 4px 0 0 var(--yellow); }
.st-basis { font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; padding: 9px 12px; background: var(--bg); border-left: 3px solid var(--blue); }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 14px; }
.st-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-f > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.st-f > span i { font-style: normal; font-family: var(--font-mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.st-f input, .st-f select { width: 100%; min-height: 40px; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 10px; font: inherit; font-size: 14px; color: var(--ink); border-radius: 0; }
.st-f input:focus, .st-f select:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.st-f small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.st-wide { grid-column: 1 / -1; }
.st-c { display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; align-items: start; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; grid-column: 1 / -1; }
.st-c input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); }
.st-c small { grid-column: 2; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.st-link { border: 0; background: none; padding: 0; margin-right: 8px; color: var(--blue); font: inherit; font-size: 11.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.st-set { border: 1px solid var(--line); margin: 16px 0 0; padding: 10px 14px 14px; }
.st-set legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.st-set legend .st-c { display: inline-grid; }
.st-sub[hidden], .st-set[hidden] { display: none; }
.st-modal { margin-top: 16px; }
.st-modal h4 { font-size: 14px; margin-bottom: 6px; }
.st-modal h4 small { font-family: var(--font-mono); font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 6px; }
.st-modal table, .st-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-modal th, .st-modal td, .st-tbl th, .st-tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.st-modal th, .st-tbl th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; border-bottom-color: var(--ink); }
.st-modal tr.is-1 td { color: var(--blue); font-weight: 700; }
.st-tbl { margin-top: 10px; }
.st-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.st-btn-s { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.st-run { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.st-status { font-size: 12.5px; color: var(--muted); flex-basis: 100%; margin: 0; min-height: 1.2em; }

/* stage */
.st-stage { position: sticky; top: 84px; border: 1px solid var(--ink); background: var(--surface); }
.st-hud { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--ink); background: var(--dark); color: var(--on-dark); min-height: 54px; }
.st-hud span { flex: 1 1 0; min-width: 96px; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; font-size: 13px; }
.st-hud span + span { border-left: 1px solid rgba(255,255,255,.12); }
.st-hud i { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #a3abb6; }
.st-hud b { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; color: #fff; }
.st-canvas { display: block; width: 100%; height: 460px; }
.st-play { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg); }
.st-play input[type=range] { flex: 1; accent-color: var(--blue); min-width: 60px; }
.st-play select { min-height: 36px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 12.5px; padding: 4px 6px; }
.st-pbtn { width: 40px; height: 36px; border: 1px solid var(--ink); background: var(--yellow); font-size: 14px; cursor: pointer; flex: none; }
.st-live { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.st-live canvas { width: 100%; height: 130px; display: block; }
.st-live canvas + canvas { border-left: 1px solid var(--line); }

/* results */
.st-results { margin-top: clamp(32px, 5vw, 56px); }
.st-rhead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: end; margin-bottom: 18px; }
.st-kpi { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--surface); }
.st-kpi div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.st-kpi span { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.st-kpi b { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; }
.st-kpi .ok b { color: var(--blue); } .st-kpi .warn b { color: #b45309; } .st-kpi .bad b { color: #b42318; }
.st-verdict { margin: 14px 0 0; padding: 12px 16px; font-size: 14.5px; border-left: 4px solid var(--blue); background: var(--surface); }
.st-verdict.bad { border-left-color: #b42318; background: #fdf1ef; }
.st-rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.st-rc { border: 1px solid var(--ink); background: var(--surface); padding: 16px 16px 18px; min-width: 0; }
.st-rc h3 { font-size: 17px; margin-bottom: 10px; }
.st-ch { display: block; width: 100%; }
.st-ch + .st-ch { margin-top: 6px; }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-rfoot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.st-theory { columns: 2 380px; column-gap: 40px; }
.st-theory section { break-inside: avoid; margin-bottom: 22px; }
.st-theory h3 { font-size: 18px; margin-bottom: 6px; }
.st-theory p { color: var(--ink-2); font-size: 15px; }
.st-eq { font-family: var(--font-mono); font-size: 14px; background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; margin: 8px 0; overflow-x: auto; }
.st-refs { font-size: 13.5px; color: var(--ink-2); padding-left: 20px; }
.st-refs li { margin-bottom: 4px; }

@media (max-width: 1100px) { .st-lab { grid-template-columns: minmax(0, 1fr); } .st-stage { position: static; } .st-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .st-cards { grid-template-columns: 1fr 1fr; }
  .st-tabs { grid-template-columns: 1fr 1fr; } .st-tabs button:nth-child(3) { border-left: 0; } .st-tabs button:nth-child(n+3) { border-top: 1px solid var(--line); }
  .st-grid, .st-rgrid, .st-two, .st-rhead { grid-template-columns: 1fr; }
  .st-canvas { height: 380px; } .st-kpi { grid-template-columns: 1fr 1fr; } .st-hud span { min-width: 33%; flex: 1 1 33%; }
  .st-hud span:nth-child(4) { border-left: 0; }
}
@media (max-width: 420px) { .st-cards { grid-template-columns: 1fr; } }

/* A4 report pages (rendered off-screen, captured page by page) */
.rp-wrap { position: absolute; left: -12000px; top: 0; width: 794px; }
.rp-page { position: relative; width: 794px; height: 1123px; overflow: hidden; background: #fff; color: #0f1216; padding: 92px 48px 60px; font-family: Inter, system-ui, sans-serif; font-size: 11px; line-height: 1.45; }
.rp-wm { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(-32deg); white-space: nowrap; font-family: "Inter Tight", Inter, sans-serif; font-weight: 800; font-size: 44px; letter-spacing: .04em; color: rgba(28,63,196,.055); pointer-events: none; }
.rp-hd { position: absolute; left: 48px; right: 48px; top: 26px; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid #0f1216; }
.rp-hd div b { display: block; font-family: "Inter Tight", Inter, sans-serif; font-size: 14px; letter-spacing: -0.01em; }
.rp-hd div span { display: block; font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #5b636e; }
.rp-hd .rp-hr { margin-left: auto; text-align: right; }
.rp-hd .rp-hr b { font-size: 12px; }
.rp-ft { position: absolute; left: 48px; right: 48px; bottom: 22px; display: flex; justify-content: space-between; border-top: 1px solid #0f1216; padding-top: 7px; font-family: "JetBrains Mono", monospace; font-size: 8.5px; letter-spacing: .04em; color: #5b636e; }
.rp-ft::before { content: ""; position: absolute; right: 0; top: -1px; width: 60px; height: 3px; background: #f5c22b; }
.rp-h { font-family: "Inter Tight", Inter, sans-serif; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 12px; }
.rp-page h3 { font-family: "Inter Tight", Inter, sans-serif; font-size: 13.5px; margin: 14px 0 6px; }
.rp-page canvas { display: block; margin: 4px 0 8px; border: 1px solid #e4e1d8; }
.rp-t { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 10.5px; }
.rp-t th, .rp-t td { text-align: left; padding: 4px 7px; border-bottom: 1px solid #e4e1d8; vertical-align: top; }
.rp-t th { font-family: "JetBrains Mono", monospace; font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; color: #5b636e; font-weight: 500; border-bottom: 1.5px solid #0f1216; }
.rp-t td:first-child { font-weight: 600; }
.rp-p { margin: 6px 0; color: #2a3038; }
.rp-p.eq { font-family: "JetBrains Mono", monospace; font-size: 11px; background: #f5f4ef; padding: 7px 10px; color: #0f1216; }
.rp-cover { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: center; margin-bottom: 10px; }
.rp-cover h1 { font-family: "Inter Tight", Inter, sans-serif; font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; margin: 6px 0 8px; }
.rp-cover p { color: #5b636e; font-size: 12px; }
.rp-k { font-family: "JetBrains Mono", monospace; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #1c3fc4; }
.rp-box { margin: 8px 0; padding: 8px 12px; border-left: 4px solid #1c3fc4; background: #f5f4ef; font-size: 11.5px; }
.rp-box.bad { border-left-color: #b42318; background: #fdf1ef; } .rp-box.warn { border-left-color: #d97706; background: #fdf3e3; }
.rp-2 { display: flex; gap: 14px; }
.rp-ref { padding-left: 16px; font-size: 10px; color: #2a3038; }

/* refresh controls */
.st-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--ink); background: var(--surface); }
.st-auto { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.st-auto input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.st-rfbtn { margin-left: auto; min-height: 36px; padding: 6px 14px; border: 1px solid var(--ink); background: var(--bg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.st-rfbtn:hover, .st-rfbtn.is-hot { background: var(--yellow); }
.st-rfbtn.is-hot { animation: st-pulse 1.4s ease-in-out infinite; }
@keyframes st-pulse { 50% { box-shadow: 0 0 0 4px rgba(245,194,43,.45); } }
.st-stale { flex-basis: 100%; font-size: 12px; color: #b45309; font-family: var(--font-mono); }
.st-rf { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; vertical-align: -5px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--blue); font-size: 13px; line-height: 1; cursor: pointer; border-radius: 50%; transition: background .15s, transform .3s; }
.st-rf:hover, .st-rf:focus-visible { background: var(--yellow); color: var(--ink); border-color: var(--ink); transform: rotate(180deg); }
.st-c > span .st-rf { margin-left: 6px; }
.st-results.is-stale .st-rgrid, .st-results.is-stale .st-kpi { opacity: .45; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .st-rfbtn.is-hot { animation: none; } .st-rf { transition: none; } }
