/* ACG Test Tracker — shared styles.
   Flat, typographic, neutral. One muted accent (links + the primary action only).
   Two weights (400/600). Type scale is strict. Borders are 1px hairlines. */

:root {
  --bg: #fbfbf9; --bg2: #f3f3ee; --fg: #1b1b19; --mut: #65655f; --line: #d8d8d0;
  --acc: #2d5a7b; --acc-fg: #ffffff; --inv-bg: #1b1b19; --inv-fg: #fbfbf9;
  --green: #1f8a4c; --scale: 1;
  --t-xs: .75rem; --t-sm: .8125rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.75rem;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2.5rem; --s7: 4rem;
  --measure: 68ch;
}
:root[data-theme="dark"] {
  --bg: #121211; --bg2: #1b1b19; --fg: #ececE6; --mut: #9d9d95; --line: #353531;
  --acc: #8fb6d4; --acc-fg: #10202c; --inv-bg: #ececE6; --inv-fg: #121211; --green: #4cc27e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #121211; --bg2: #1b1b19; --fg: #ececE6; --mut: #9d9d95; --line: #353531;
    --acc: #8fb6d4; --acc-fg: #10202c; --inv-bg: #ececE6; --inv-fg: #121211; --green: #4cc27e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 1rem/1.55 system-ui, "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0 0 var(--s3); }
h1 { font-size: var(--t-xl); letter-spacing: -.01em; }
h2 { font-size: var(--t-lg); margin-top: var(--s6); }
h3 { font-size: var(--t-md); margin-top: var(--s5); }
h4 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }
p { margin: 0 0 var(--s3); max-width: var(--measure); }
small, .small { font-size: var(--t-sm); }
.mut { color: var(--mut); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono, code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: .875em; }
code { background: var(--bg2); padding: .05em .35em; border: 1px solid var(--line); }
pre { background: var(--bg2); border: 1px solid var(--line); padding: var(--s3) var(--s4); overflow: auto; margin: var(--s3) 0; line-height: 1.5; white-space: pre; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
ul, ol { padding-left: 1.3rem; margin: 0 0 var(--s3); max-width: var(--measure); }
li { margin-bottom: var(--s1); }

a { color: var(--acc); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: .15em; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--inv-bg); color: var(--inv-fg); padding: var(--s2) var(--s3); z-index: 1000; }
.skip:focus { left: 0; }

/* external links: Wikipedia-style marker */
a.ext::after { content: "\2197"; display: inline-block; font-size: .8em; margin-left: .2em; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* layout */
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--s5); }
main { flex: 1; padding: var(--s5) 0 var(--s7); }
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--acc); z-index: 900; }

/* header + footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 800; }
.hdr-row { display: flex; align-items: center; gap: var(--s5); min-height: 3.25rem; flex-wrap: wrap; padding-top: var(--s2); padding-bottom: var(--s2); }
.brand { font-weight: 600; letter-spacing: .01em; margin-right: auto; }
.site-header nav { display: flex; gap: var(--s4); flex-wrap: wrap; }
.site-header nav a { color: var(--fg); padding: var(--s1) 0; border-bottom: 1px solid transparent; }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--fg); font-weight: 600; }
.site-header nav a:hover { text-decoration: none; border-bottom-color: var(--mut); }
.hdr-tools, .ftr-tools { display: flex; gap: var(--s3); align-items: center; font-size: var(--t-sm); }
.site-footer { border-top: 1px solid var(--line); padding: var(--s5) 0 var(--s6); font-size: var(--t-sm); color: var(--mut); }
.ftr-row { display: flex; flex-direction: column; gap: var(--s3); align-items: center; text-align: center; }
.ftr-tools { flex-wrap: wrap; justify-content: center; }
.credit a { position: relative; color: var(--fg); font-weight: 600; padding-bottom: 2px; }
.credit a::before { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--green); transition: width .28s ease; }
.credit a:hover::before, .credit a:focus-visible::before { width: 100%; }
.credit a:hover { text-decoration: none; }
.fs-btns button { padding: 0 var(--s2); }

/* buttons + inputs */
button { font: inherit; color: inherit; cursor: pointer; }
.btn, .linkbtn, .icon-btn { font-size: var(--t-sm); }
.btn {
  background: transparent; border: 1px solid var(--fg); color: var(--fg);
  padding: .4rem .8rem; border-radius: 2px; line-height: 1.3;
}
.btn:hover { background: var(--bg2); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: var(--line); color: var(--fg); }
.btn.danger { border-style: dashed; }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--acc); padding: 0; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: .15em; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

label, .label { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: var(--s1); }
.label .opt { font-weight: 400; color: var(--mut); }
.req::after { content: " *"; font-weight: 600; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: var(--t-sm); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 2px; padding: .45rem .55rem; line-height: 1.35;
}
textarea { resize: vertical; min-height: 4.5rem; }
input:hover, select:hover, textarea:hover { border-color: var(--mut); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: var(--acc); }
input[readonly], textarea[readonly], input:disabled, select:disabled { background: var(--bg2); color: var(--mut); }
input[type=checkbox], input[type=radio] { accent-color: var(--acc); margin-right: .4rem; }
.check { display: flex; align-items: flex-start; gap: .4rem; font-size: var(--t-sm); font-weight: 400; margin: 0 0 var(--s1); cursor: pointer; }
.check input { margin: .25rem 0 0; }
.field { margin-bottom: var(--s4); }
.field .hint { font-size: var(--t-xs); color: var(--mut); margin-top: var(--s1); }
.field .err, .err { font-size: var(--t-xs); font-weight: 600; margin-top: var(--s1); padding-left: var(--s2); border-left: 2px solid var(--fg); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--fg); border-width: 2px; padding: calc(.45rem - 1px) calc(.55rem - 1px); }
.warn { font-size: var(--t-xs); color: var(--mut); padding-left: var(--s2); border-left: 2px dotted var(--mut); margin-top: var(--s1); }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inline { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }

/* info button + popover */
.info {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 1.15rem; height: 1.15rem; margin-left: .35rem; padding: 0; line-height: 1;
  border: 1px solid var(--mut); border-radius: 50%; background: transparent; color: var(--mut);
  font: 600 .7rem/1 Georgia, "Times New Roman", serif; font-style: italic;
}
.info:hover, .info[aria-expanded="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
#info-pop {
  position: absolute; z-index: 2000; width: min(26rem, calc(100vw - 1.5rem));
  background: var(--bg); border: 1px solid var(--fg); padding: var(--s4); font-size: var(--t-sm); line-height: 1.5;
  animation: fade .12s ease;
}
#info-pop[hidden] { display: none; }
#info-pop .ip-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s2); }
#info-pop .ip-title { font-weight: 600; font-size: var(--t-md); }
#info-pop .ip-x { border: 1px solid var(--line); background: none; width: 1.6rem; height: 1.6rem; line-height: 1; font-size: 1.1rem; flex: none; }
#info-pop .ip-x:hover { background: var(--fg); color: var(--bg); }
#info-pop .ip-body p { margin: 0 0 var(--s2); }
#info-pop .ip-body ul { margin: 0 0 var(--s2); padding-left: 1.1rem; }
#info-pop .ip-links { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
#info-pop .ip-links h5 { margin: 0 0 var(--s1); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--mut); font-weight: 600; }
#info-pop .ip-links ul { list-style: none; padding: 0; margin: 0; }
#info-pop .ip-hint { margin-top: var(--s2); font-size: var(--t-xs); color: var(--mut); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) { #info-pop { left: .75rem !important; right: .75rem; width: auto; } }

/* modal + toast */
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1500; display: flex; align-items: flex-start; justify-content: center; padding: var(--s5) var(--s3); overflow: auto; }
.modal { background: var(--bg); border: 1px solid var(--fg); width: min(44rem, 100%); padding: var(--s5); margin: auto; }
.modal.wide { width: min(64rem, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); }
.modal-head h2 { margin: 0; font-size: var(--t-lg); }
.modal-x { border: 1px solid var(--line); background: none; width: 1.8rem; height: 1.8rem; font-size: 1.2rem; line-height: 1; flex: none; }
.modal-x:hover { background: var(--fg); color: var(--bg); }
.modal-foot { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); flex-wrap: wrap; }
#toasts { position: fixed; left: var(--s4); bottom: var(--s4); z-index: 2500; display: flex; flex-direction: column; gap: var(--s2); max-width: min(26rem, calc(100vw - 2rem)); }
.toast { background: var(--inv-bg); color: var(--inv-fg); padding: var(--s2) var(--s3); font-size: var(--t-sm); animation: fade .15s ease; }

/* pills / chips / badges */
.pills { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pill, .chip {
  border: 1px solid var(--mut); background: transparent; color: var(--fg); border-radius: 999px;
  padding: .3rem .85rem; font-size: var(--t-sm); line-height: 1.3;
}
.pill:hover, .chip:hover { background: var(--bg2); }
.pill[aria-pressed="true"], .pill[aria-checked="true"], .chip[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); font-weight: 600; }
.chip { padding: .35rem .9rem; }
.badge { display: inline-block; border: 1px solid var(--mut); padding: 0 .45rem; font-size: var(--t-xs); line-height: 1.5; white-space: nowrap; border-radius: 2px; }
.badge.fail { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); font-weight: 600; }
.badge.pass { font-weight: 600; }
.badge.none { color: var(--mut); border-style: dashed; }
.badge.soft { border-style: dotted; color: var(--mut); }
.seg { display: inline-flex; border: 1px solid var(--mut); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .3rem .8rem; font-size: var(--t-sm); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--inv-bg); color: var(--inv-fg); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; border: 1px solid var(--line); padding: .25rem; border-radius: 2px; }
.tags:focus-within { outline: 2px solid var(--acc); border-color: var(--acc); }
.tags input { flex: 1; min-width: 8rem; border: 0; padding: .25rem; background: transparent; }
.tags input:focus { outline: 0; }
.tag { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--mut); padding: 0 .25rem 0 .5rem; font-size: var(--t-xs); }
.tag button { border: 0; background: none; padding: 0 .25rem; font-size: 1rem; line-height: 1; }
.rating { display: inline-flex; gap: var(--s1); align-items: center; }
.rating button { width: 1.9rem; height: 1.9rem; border: 1px solid var(--mut); background: transparent; border-radius: 2px; font-size: var(--t-sm); }
.rating button[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-fg); font-weight: 600; }

/* tables */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); max-height: 72vh; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { position: sticky; top: 0; background: var(--bg2); z-index: 2; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--fg); }
thead th button { background: none; border: 0; padding: 0; font-weight: 600; font-size: inherit; }
thead th button:hover { text-decoration: underline; }
thead th[aria-sort="ascending"] button::after { content: " \2191"; }
thead th[aria-sort="descending"] button::after { content: " \2193"; }
tbody tr:hover { background: var(--bg2); }
tbody tr.clickable { cursor: pointer; }
tbody tr.sel { background: var(--bg2); box-shadow: inset 2px 0 0 var(--fg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-note { font-size: var(--t-xs); color: var(--mut); margin: var(--s2) 0; }
caption { text-align: left; padding: var(--s2) 0; font-weight: 600; caption-side: top; }

/* page bits */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.page-head h1 { margin: 0; }
.sub { color: var(--mut); margin: var(--s1) 0 0; max-width: var(--measure); }
.notice { border: 1px solid var(--mut); border-left-width: 3px; padding: var(--s3) var(--s4); margin: 0 0 var(--s4); font-size: var(--t-sm); max-width: none; background: var(--bg2); }
.notice p { margin: 0 0 var(--s1); max-width: none; }
.notice p:last-child { margin: 0; }
.tabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); flex-wrap: wrap; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: var(--s2) 0; color: var(--fg); font-size: var(--t-md); }
.tabs a:hover { text-decoration: none; border-bottom-color: var(--mut); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { border-bottom-color: var(--fg); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; border: 1px solid var(--line); margin-bottom: var(--s5); }
.stat { padding: var(--s3) var(--s4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stat h4 { margin: 0 0 var(--s1); }
.stat .big { font-size: var(--t-xl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat button.line { display: block; background: none; border: 0; padding: 0; text-align: left; color: var(--fg); font-size: var(--t-sm); }
.stat button.line:hover { text-decoration: underline; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--s3); align-items: end; margin-bottom: var(--s3); }
.filters .field { margin: 0; }
.kv { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: var(--s1) var(--s4); font-size: var(--t-sm); margin: 0; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; }
.kv .def { color: var(--mut); }
.sec { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s5); }
.sec > h2, .sec > h3 { margin-top: 0; }
.panel { border: 1px solid var(--line); padding: var(--s4); margin-bottom: var(--s4); }
.bar { height: 6px; background: var(--bg2); border: 1px solid var(--line); min-width: 5rem; }
.bar i { display: block; height: 100%; background: var(--fg); }
.diff { background: transparent; box-shadow: inset 3px 0 0 var(--fg); }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--mut); border: 1px dashed var(--line); }

/* wizard-style stepper (case editor) */
.editor { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 17rem; gap: var(--s5); align-items: start; }
.rail { position: sticky; top: 4.5rem; }
.rail ol { list-style: none; padding: 0; margin: 0; }
.rail li { margin: 0; }
.rail button { width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid var(--line); padding: var(--s2) var(--s3); font-size: var(--t-sm); display: flex; justify-content: space-between; gap: var(--s2); }
.rail button:hover { background: var(--bg2); }
.rail button[aria-current="step"] { border-left-color: var(--fg); font-weight: 600; }
.rail .st { color: var(--mut); font-weight: 400; font-size: var(--t-xs); }
.summary-side { position: sticky; top: 4.5rem; font-size: var(--t-sm); }
.summary-side h4 { margin-top: var(--s3); }
.summary-side ul { list-style: none; padding: 0; margin: 0 0 var(--s2); }
.savebar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--fg); padding: var(--s3) 0; margin-top: var(--s5); display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; z-index: 5; }
.radio-card { display: block; border: 1px solid var(--line); padding: var(--s2) var(--s3); margin-bottom: var(--s2); font-weight: 400; font-size: var(--t-sm); cursor: pointer; }
.radio-card:hover { background: var(--bg2); }
.radio-card.on { border-color: var(--fg); box-shadow: inset 2px 0 0 var(--fg); }
.radio-card input { margin-right: var(--s2); }

/* Ask ACG inbox */
.inbox { display: grid; grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr); border: 1px solid var(--line); min-height: 60vh; }
.inbox-list { border-right: 1px solid var(--line); max-height: 78vh; overflow: auto; }
.inbox-pane { padding: var(--s4) var(--s5); max-height: 78vh; overflow: auto; min-width: 0; }
.trow { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); font-size: var(--t-sm); }
.trow:hover { background: var(--bg2); }
.trow[aria-current="true"] { background: var(--bg2); box-shadow: inset 3px 0 0 var(--fg); }
.trow .l1 { display: flex; justify-content: space-between; gap: var(--s2); }
.trow .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .when { color: var(--mut); font-size: var(--t-xs); white-space: nowrap; text-align: right; }
.trow .snip { margin: var(--s1) 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trow .meta { color: var(--mut); font-size: var(--t-xs); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.qa { border-top: 1px solid var(--line); padding: var(--s4) 0; }
.qa .q, .qa .a { white-space: pre-wrap; max-width: 75ch; margin: 0 0 var(--s2); }
.qa .q { font-weight: 600; }
.qa-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--s3) var(--s4); margin-top: var(--s3); }
.asof { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--fg); }
.asof label { margin: 0; }
.asof input { width: auto; }
.pair-card { border: 1px solid var(--line); padding: var(--s4); margin-bottom: var(--s3); }
.pair-card > header { display: flex; justify-content: space-between; gap: var(--s2); align-items: center; margin-bottom: var(--s3); flex-wrap: wrap; }
details > summary { cursor: pointer; font-size: var(--t-sm); color: var(--acc); }
details[open] > summary { margin-bottom: var(--s3); }
.timepair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.timepair .utc { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--mut); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(46rem, 100%); background: var(--bg); border-left: 1px solid var(--fg); z-index: 1400; overflow: auto; padding: var(--s5); }
.kbd { font-family: ui-monospace, Consolas, monospace; border: 1px solid var(--mut); padding: 0 .35rem; font-size: var(--t-xs); }

/* back to top + ring */
#totop { position: fixed; right: var(--s4); bottom: var(--s4); width: 2.9rem; height: 2.9rem; border: 0; background: var(--bg); padding: 0; z-index: 700; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
#totop.show { opacity: 1; pointer-events: auto; }
#totop svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#totop circle { fill: none; stroke-width: 2; }
#totop .tr { stroke: var(--line); }
#totop .pg { stroke: var(--fg); stroke-dasharray: 125.66; stroke-dashoffset: 125.66; }
#totop span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--t-sm); }

.rv { opacity: 1; }
.js .rv { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.js .rv.in { opacity: 1; transform: none; }

/* guide (docs) */
.doc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s6); align-items: start; }
.toc { position: sticky; top: 4.5rem; font-size: var(--t-sm); max-height: calc(100vh - 6rem); overflow: auto; }
.toc ol { list-style: none; padding: 0; margin: 0; max-width: none; }
.toc a { display: block; padding: var(--s1) var(--s3); color: var(--mut); border-left: 2px solid var(--line); }
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.active { color: var(--fg); font-weight: 600; border-left-color: var(--fg); }
.toc-toggle { display: none; }
.doc-body { min-width: 0; }
.doc-body h2 { padding-top: var(--s3); border-top: 1px solid var(--line); }
.doc-body h2:first-child { border-top: 0; margin-top: 0; }
.doc-body table { margin: var(--s3) 0 var(--s4); }
.doc-body .tbl-wrap { max-height: none; margin: var(--s3) 0 var(--s4); }
.step { border-left: 2px solid var(--fg); padding: 0 0 0 var(--s4); margin: var(--s4) 0; }
.step h3 { margin-top: 0; }
.callout { border: 1px solid var(--mut); padding: var(--s3) var(--s4); margin: var(--s3) 0; font-size: var(--t-sm); max-width: var(--measure); }
.callout strong:first-child { display: block; margin-bottom: var(--s1); }
.tab-panel[hidden] { display: none; }
html:not(.js) .tab-panel[hidden] { display: block; }
html:not(.js) .tabs { display: none; }
html:not(.js) #panel-detailed { border-top: 1px solid var(--fg); margin-top: var(--s6); padding-top: var(--s5); }

@media (max-width: 1180px) {
  .editor { grid-template-columns: 13rem minmax(0, 1fr); }
  .summary-side { display: none; }
}
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .toc { position: static; max-height: none; border: 1px solid var(--line); padding: var(--s2); }
  .toc-toggle { display: inline-block; }
  .toc:not(.open) ol { display: none; }
  .toc.collapsed ol { display: none; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 var(--s4); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .rail ol { display: flex; overflow-x: auto; }
  .rail button { border-left: 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
  .rail button[aria-current="step"] { border-bottom-color: var(--fg); }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { border-right: 0; max-height: none; }
  .inbox.has-sel .inbox-list { display: none; }
  .inbox:not(.has-sel) .inbox-pane { display: none; }
  .inbox-pane { max-height: none; padding: var(--s4); }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: var(--s2); }
}
@media (max-width: 640px) {
  :root { --s5: 1.25rem; --s6: 2rem; }
  .g2, .g3, .g4, .timepair { grid-template-columns: minmax(0, 1fr); }
  .hdr-row { gap: var(--s3); }
  .site-header nav { order: 3; width: 100%; }
  .modal { padding: var(--s4); }
  h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) { .wrap { padding: 0 var(--s3); } .stat .big { font-size: 1.4rem; } }
@media (max-width: 360px) { .btn { padding: .4rem .6rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; transform: none; }
}
@media print { .site-header, .site-footer, #totop, #progress, .savebar { display: none; } body { background: #fff; color: #000; } }
