/* Gemini for healthcare:病歷表單。印刷藍的格線、龍膽紫的填寫字跡、紅藥水色的限制標記 */

:root {
  color-scheme: light dark;
  --desk: #dfe8ef;        /* 桌面:頁面底色 */
  --paper: #f9fcfe;       /* 表單紙 */
  --ink: #14263a;         /* 內文 */
  --ink-soft: #4a5f73;    /* 次要文字 */
  --print: #0b6a94;       /* 印刷藍:格線、欄位名稱、表頭 */
  --print-soft: #d3e6ef;  /* 淡印刷藍:底塊 */
  --print-on: #f4fbff;    /* 表頭上的字 */
  --rule: #9cc3d6;        /* 格線 */
  --pen: #53399a;         /* 龍膽紫:填上去的內容 */
  --flag: #ad2946;        /* 紅藥水:限制、唯讀 */
  --flag-soft: #f7e3e7;

  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --label: "IBM Plex Sans Condensed", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #060e15;
    --paper: #0d1b27;
    --ink: #dce8f1;
    --ink-soft: #9db2c4;
    --print: #62c1e6;
    --print-soft: #15303f;
    --print-on: #06131c;
    --rule: #2a5469;
    --pen: #bba8f5;
    --flag: #f58aa0;
    --flag-soft: #3a1820;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.85;
}

a { color: var(--print); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--pen); }

:focus-visible {
  outline: 3px solid var(--pen);
  outline-offset: 2px;
}

p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--print-soft);
  padding: 0.05em 0.35em;
}

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page { width: min(100% - 1.5rem, 64rem); margin-inline: auto; }

/* ── 頁首 ── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0 0.8rem;
  font-size: 0.95rem;
}
.home { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--print); }
.home:hover { color: var(--print); }
.top-date { color: var(--ink-soft); font-family: var(--label); font-variant-numeric: tabular-nums; }

/* ── 表單紙 ── */
.sheet {
  background: var(--paper);
  border: 1.5px solid var(--print);
  margin-bottom: 1.75rem;
}

.sheet-head {
  background: var(--print);
  color: var(--print-on);
  padding: 0.55rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
}
.sheet-head h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.sheet-body { padding: 1.75rem 1.25rem 1.25rem; }
.prose { max-width: 40rem; }

.src {
  margin: 1.75rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--rule);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.count {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  margin-left: 0.3em;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--label);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  vertical-align: 0.1em;
}

.ro {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0 0.4em;
  border: 1.5px solid var(--flag);
  color: var(--flag);
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* 空白欄位:一條待填的底線 */
.blank {
  display: inline-block;
  width: 4.5rem;
  border-bottom: 1.5px solid var(--ink);
  margin-right: 0.5rem;
  vertical-align: baseline;
  height: 1em;
}
.unfilled { color: var(--flag); font-weight: 700; }

/* ── 基本資料表 ── */
.intake-title { padding: 2rem 1.25rem 1.5rem; }

h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.2rem, 8.2vw, 5.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--pen);
  text-wrap: balance;
}
h1 [lang="en"] { display: inline-block; }

.sub { max-width: 38rem; margin: 1.25rem 0 0.75rem; font-size: 1.125rem; }
.notice {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.7rem;
  background: var(--print-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.fields {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1.5px solid var(--print);
}
.f {
  padding: 0.45rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.f-2 { grid-column: span 2; }
.f-3 { grid-column: span 3; }
.f dt, .specs dt, .order dt {
  font-family: var(--label);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--print);
  letter-spacing: 0.04em;
}
.f dd {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--pen);
}

/* 勾選框 */
.cb { display: inline-block; margin-right: 1.1rem; white-space: nowrap; color: var(--ink-soft); }
.cb::before {
  content: "";
  display: inline-block;
  width: 0.85em; height: 0.85em;
  margin-right: 0.4em;
  border: 1.5px solid var(--print);
  vertical-align: -0.08em;
}
.cb.on { color: var(--pen); }
.cb.on::before {
  background:
    linear-gradient(45deg, transparent 44%, var(--pen) 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--pen) 44% 56%, transparent 56%);
}

.intake > .src { margin: 0; padding: 0.6rem 1.25rem; border-top: 0; }

/* 病歷夾的索引標籤 */
.tabs-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.35rem;
  padding: 0.9rem 1.25rem 0;
  border-top: 1.5px solid var(--print);
  background: var(--print-soft);
}
.tabs-index a {
  padding: 0.3rem 0.8rem 0.35rem;
  background: var(--paper);
  border: 1.5px solid var(--print);
  border-bottom: 0;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.tabs-index a:hover { background: var(--print); color: var(--print-on); }

/* ── 三個數字 ── */
.vitals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
  margin-top: 2rem;
}
.vitals figcaption { grid-column: 1 / -1; margin-bottom: 1rem; font-weight: 500; max-width: 40rem; }
.vital { border-top: 3px solid var(--print); padding-top: 0.6rem; }
.vital-n {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  line-height: 1.2;
  color: var(--pen);
  margin: 0 0 0.6rem;
}
.vital-n small { font-family: var(--sans); font-size: 0.4em; font-weight: 500; margin-left: 0.15em; }
.hours, .meter {
  height: 0.9rem;
  border: 1px solid var(--print);
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 7 - 1px), var(--rule) calc(100% / 7 - 1px) calc(100% / 7));
}
.meter { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--rule) calc(10% - 1px) 10%); }
.hours-fill, .meter span { display: block; height: 100%; background: var(--pen); }
.hours-fill { width: 16.667%; } /* 28 / 168 */
.vital-d { margin: 0.7rem 0 0.2rem; font-size: 0.98rem; line-height: 1.7; }
.vital-s { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }

/* ── 結構圖 ── */
.stack { margin-top: 1.5rem; }
.stack-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
}
.stack-label { margin: 0; font-family: var(--label); font-weight: 600; font-size: 0.9rem; color: var(--print); }
.stack-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack-chips li { padding: 0.15rem 0.7rem; background: var(--print-soft); font-size: 0.95rem; }

.stack-link {
  position: relative;
  margin: 0 0 0 2.5rem;
  padding: 0.7rem 0 0.7rem 1.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--print);
}
.stack-link::after {
  content: "";
  position: absolute;
  left: -6px; bottom: -1px;
  border: 5px solid transparent;
  border-top: 7px solid var(--print);
  border-bottom: 0;
}

.stack-core { border: 2.5px solid var(--pen); }
.stack-core-name {
  margin: 0;
  padding: 0.4rem 1rem;
  background: var(--pen);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.15rem;
}
.stack-parts { display: grid; grid-template-columns: repeat(4, 1fr); }
.part { padding: 0.9rem 1rem 1rem; border-right: 1px solid var(--rule); }
.part:last-child { border-right: 0; }
.part h3, .stack-base h3 { font-size: 1.05rem; line-height: 1.5; color: var(--pen); margin-bottom: 0.3rem; }
.part p, .stack-base p { margin: 0; font-size: 0.93rem; line-height: 1.7; }
.stack-base {
  padding: 0.9rem 1rem 1rem;
  border-top: 2.5px solid var(--pen);
  background:
    repeating-linear-gradient(-45deg, transparent 0 7px, var(--print-soft) 7px 8px);
}
.stack-base p { max-width: 44rem; }
.stack figcaption { margin-top: 0.8rem; font-size: 0.875rem; color: var(--ink-soft); }

/* ── Skills ── */
.skills { margin-top: 1.5rem; border: 1.5px solid var(--print); }
.skill-tabs { display: none; }
.js .skill-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--print-soft);
  border-bottom: 1.5px solid var(--print);
}
.skill-tabs button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  min-width: 0;
}
.skill-tabs button:last-child { border-right: 0; }
.skill-tabs small { display: block; margin-top: 0.2rem; font-family: var(--label); font-size: 0.8rem; font-weight: 600; color: var(--print); }
.skill-tabs button:hover { background: var(--paper); }
.skill-tabs button[aria-selected="true"] { background: var(--pen); color: var(--paper); }
.skill-tabs button[aria-selected="true"] small { color: inherit; }
.skill-tabs button:focus-visible { outline-offset: -4px; outline-color: var(--flag); }

.order { padding: 1.25rem; }
.order + .order { border-top: 1px solid var(--rule); }
.js .order + .order { border-top: 0; }
.order[hidden] { display: none; }
.order h3 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.25;
  color: var(--pen);
  margin-bottom: 0.9rem;
}
.h3-note { font-family: var(--sans); font-size: 0.5em; font-weight: 500; color: var(--ink-soft); margin-left: 0.4em; }
.order dl { display: grid; grid-template-columns: 8rem 1fr 1fr; gap: 0 1.5rem; }
.order dl > div { border-top: 1px solid var(--rule); padding-top: 0.4rem; }
.order dd { font-size: 1rem; line-height: 1.75; }
.order .rx { color: var(--ink-soft); }

/* 對照表:像給藥紀錄單的格子 */
.mar { margin-top: 2rem; }
.mar figcaption { max-width: 40rem; margin-bottom: 0.8rem; font-size: 0.95rem; }
.mar-scroll { overflow-x: auto; }
.mar-table { border-collapse: collapse; width: 100%; max-width: 44rem; font-size: 0.92rem; }
.mar-table th, .mar-table td { border: 1px solid var(--rule); }
.mar-corner { text-align: left; vertical-align: bottom; padding: 0.4rem 0.6rem; font-family: var(--label); color: var(--print); font-weight: 600; }
.mar-skill { padding: 0; width: 13%; vertical-align: bottom; }
.mar-skill button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
  min-height: 9.5rem;
  padding: 0.5rem 0.2rem;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 0.1rem;
}
.mar-skill-name, .mar-skill-side { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; line-height: 1.2; }
.mar-skill-name { font-weight: 700; }
.mar-skill-side { font-family: var(--label); font-size: 0.8rem; font-weight: 600; color: var(--print); }
.mar-skill button:focus-visible { outline-offset: -3px; }
.mar-conn { text-align: left; font-weight: 500; padding: 0.3rem 0.6rem; line-height: 1.4; }
.mar-table td { text-align: center; padding: 0.3rem 0; }
.dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: middle; }
.yes .dot { background: var(--ink-soft); }
.no .dot { width: 0.3rem; height: 0.3rem; background: var(--rule); }

.mar-table[data-active="0"] :is(th, td):nth-child(2),
.mar-table[data-active="1"] :is(th, td):nth-child(3),
.mar-table[data-active="2"] :is(th, td):nth-child(4),
.mar-table[data-active="3"] :is(th, td):nth-child(5),
.mar-table[data-active="4"] :is(th, td):nth-child(6) { background: var(--print-soft); }
.mar-table[data-active="0"] td:nth-child(2).yes .dot,
.mar-table[data-active="1"] td:nth-child(3).yes .dot,
.mar-table[data-active="2"] td:nth-child(4).yes .dot,
.mar-table[data-active="3"] td:nth-child(5).yes .dot,
.mar-table[data-active="4"] td:nth-child(6).yes .dot { background: var(--pen); transform: scale(1.25); }

/* ── Connectors:藥櫃的格子 ── */
.shelf {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.bin { border: 1px solid var(--rule); border-top: 4px solid var(--print); padding: 0.6rem 0.8rem 0.8rem; min-width: 0; }
.bin h3 { font-size: 1rem; line-height: 1.5; color: var(--print); margin-bottom: 0.5rem; }
.bin li { padding: 0.3rem 0; border-top: 1px dashed var(--rule); font-size: 0.95rem; font-weight: 500; line-height: 1.5; }
.bin i { display: block; font-style: normal; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }

.remarks { margin-top: 1.5rem; max-width: 44rem; }
.remarks li { position: relative; padding-left: 1.2rem; margin-bottom: 0.5rem; font-size: 0.98rem; }
.remarks li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 0.5rem; height: 0.5rem; background: var(--print); }

/* ── 界線 ── */
.split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 1.5rem; border: 1.5px solid var(--print); }
.split-col { padding: 1rem 1.25rem 1.1rem; }
.split-col h3 { font-family: var(--serif); font-weight: 900; font-size: 1.25rem; margin-bottom: 0.6rem; }
.does h3 { color: var(--pen); }
.keeps { background: var(--flag-soft); border-left: 1.5px solid var(--print); }
.keeps h3 { color: var(--flag); }
.split li { position: relative; padding: 0.3rem 0 0.3rem 1.7rem; border-top: 1px dashed var(--rule); font-size: 0.98rem; line-height: 1.65; }
.split li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 0.85rem; height: 0.85rem;
  border: 1.5px solid var(--pen);
  background:
    linear-gradient(45deg, transparent 44%, var(--pen) 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--pen) 44% 56%, transparent 56%);
}
.keeps li::before { border-color: var(--flag); background: none; }

.sub-h { font-family: var(--serif); font-weight: 900; font-size: 1.35rem; margin: 2.5rem 0 0.8rem; color: var(--ink); }

.specs { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); border-right: 0; margin-bottom: 1.25rem; }
.specs > div { padding: 0.4rem 0.8rem 0.7rem; border-right: 1px solid var(--rule); min-width: 0; }
.specs dd { font-size: 0.95rem; line-height: 1.6; color: var(--pen); font-weight: 500; }

/* 檢驗報告式的表格 */
.lab { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.lab caption { text-align: left; font-size: 0.9rem; color: var(--ink-soft); padding-bottom: 0.4rem; }
.lab thead th {
  text-align: left;
  font-family: var(--label);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--print);
  padding: 0.3rem 0.8rem;
  border-top: 2px solid var(--print);
  border-bottom: 2px solid var(--print);
}
.lab tbody th { text-align: left; font-weight: 700; width: 11rem; vertical-align: top; }
.lab tbody th, .lab td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--rule); line-height: 1.7; }
.lab tbody tr:nth-child(even) { background: color-mix(in srgb, var(--print-soft) 45%, transparent); }

.nope { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nope li { padding: 0 0.55rem; border: 1px solid var(--flag); color: var(--flag); font-size: 0.9rem; font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }

/* ── 客戶 ── */
.quotes tbody th { width: 12rem; }
.quotes td:nth-child(2) { width: 15rem; font-size: 0.92rem; color: var(--ink-soft); }
.tone { display: inline-block; padding: 0 0.6rem; font-size: 0.88rem; font-weight: 700; white-space: nowrap; border: 1.5px dashed var(--flag); color: var(--flag); }
.tone.t-now { border: 1.5px solid var(--pen); color: var(--pen); }

.rosters { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; margin-top: 2rem; }
.rosters h3 { font-size: 1.05rem; color: var(--print); margin-bottom: 0.5rem; }
.plain li { padding: 0.3rem 0; border-top: 1px dashed var(--rule); font-size: 0.98rem; }
.roster { margin: 0; font-size: 0.98rem; border-top: 1px dashed var(--rule); padding-top: 0.3rem; }
.after { margin: 1.5rem 0 0; max-width: 40rem; }

/* ── 時間軸 ── */
.course { display: grid; grid-template-columns: repeat(4, 1fr); }
.course li { position: relative; padding: 1.6rem 1rem 0 0; border-top: 3px solid var(--print); }
.course li.todo { border-top-style: dashed; border-top-color: var(--rule); }
.course li::before {
  content: "";
  position: absolute;
  left: 0; top: -0.55rem;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: var(--print);
  box-shadow: 0 0 0 4px var(--paper);
}
.course li.now::before { background: var(--pen); width: 1.3rem; height: 1.3rem; top: -0.72rem; }
.course li.todo::before { background: var(--paper); border: 2px solid var(--print); }
.course time, .course .when {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--pen);
  font-variant-numeric: tabular-nums;
}
.course .todo .when { color: var(--ink-soft); }
.course .when .blank { width: 2.5rem; }
.course p { margin: 0.3rem 0 0; font-size: 0.96rem; line-height: 1.7; }

/* ── 未公布 ── */
.blanks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; margin-top: 1.25rem; }
.blanks > div { padding: 0.9rem 0 1rem; border-top: 1px solid var(--rule); }
.blanks dt { font-weight: 700; font-size: 1.05rem; line-height: 1.5; }
.blanks dd { margin-top: 0.5rem; }
.blanks .blank { width: 6rem; }
.blanks small { display: block; margin-top: 0.3rem; font-size: 0.875rem; color: var(--ink-soft); line-height: 1.6; }

/* ── Reference、頁尾 ── */
.refs h3 { font-size: 1rem; color: var(--print); margin: 1.25rem 0 0.4rem; }
.refs ol { list-style: decimal; padding-left: 1.6rem; font-size: 0.98rem; }
.refs li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }
.refs li::marker { font-family: var(--label); color: var(--print); font-weight: 600; }
.refs li:target { background: var(--print-soft); }
.ref-note { max-width: 40rem; color: var(--ink-soft); font-size: 0.95rem; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 0.5rem 0 3rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.foot a { font-weight: 700; }

/* ── 中等寬度 ── */
@media (max-width: 900px) {
  .shelf { grid-template-columns: repeat(2, 1fr); }
  .stack-parts { grid-template-columns: 1fr 1fr; }
  .part:nth-child(2) { border-right: 0; }
  .part:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .specs { grid-template-columns: 1fr 1fr; }
  .specs > div { border-bottom: 1px solid var(--rule); }
  .specs > div:last-child { border-bottom: 0; }
  .order dl { grid-template-columns: 1fr; gap: 0.8rem; }
  .js .skill-tabs { grid-template-columns: repeat(3, 1fr); }
  .skill-tabs button { border-bottom: 1px solid var(--rule); }
}

/* ── 手機 ── */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .sheet-head, .sheet-body, .intake-title, .f, .tabs-index, .intake > .src { padding-inline: 0.9rem; }
  .sheet-head { flex-wrap: wrap; gap: 0 1rem; }
  .fields { grid-template-columns: 1fr 1fr; }
  .f-2 { grid-column: span 1; }
  .f-3, .f-w { grid-column: span 2; }
  .f dd { font-size: 1.05rem; }
  .cb { margin-right: 0.6rem; }
  .vitals { grid-template-columns: 1fr; gap: 1.5rem; }
  .vitals figcaption { margin-bottom: 0; }
  .stack-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .stack-link { margin-left: 1.25rem; }
  .stack-parts { grid-template-columns: 1fr; }
  .part { border-right: 0; border-bottom: 1px solid var(--rule); }
  .part:last-child { border-bottom: 0; }
  .js .skill-tabs { grid-template-columns: 1fr 1fr; }
  .order { padding: 1rem 0.9rem; }
  .mar-table { font-size: 0.85rem; }
  .mar-conn { padding: 0.3rem 0.4rem; }
  .shelf { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .keeps { border-left: 0; border-top: 1.5px solid var(--print); }
  .specs { grid-template-columns: 1fr; }
  .lab tbody th { width: 6.5rem; }
  .lab tbody th, .lab td, .lab thead th { padding-inline: 0.5rem; }

  .quotes thead { display: none; }
  .quotes, .quotes tbody, .quotes tr, .quotes th, .quotes td { display: block; width: auto; }
  .quotes tbody th, .quotes td:nth-child(2) { width: auto; }
  .quotes tr { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--rule); }
  .quotes tbody th, .quotes td { border: 0; padding: 0.1rem 0; }
  .quotes td::before { content: attr(data-l) "\FF1A"; font-family: var(--label); font-size: 0.82rem; font-weight: 600; color: var(--print); margin-right: 0.3rem; }

  .rosters { grid-template-columns: 1fr; gap: 1.5rem; }
  .course { grid-template-columns: 1fr; }
  .course li { border-top: 0; border-left: 3px solid var(--print); padding: 0 0 1.5rem 1.4rem; }
  .course li.todo { border-left-style: dashed; border-left-color: var(--rule); }
  .course li::before { left: -0.6rem; top: 0.45rem; }
  .course li.now::before { left: -0.75rem; top: 0.35rem; }
  .course li:last-child { padding-bottom: 0; }
  .blanks { grid-template-columns: 1fr; }
  .foot { flex-direction: column; }
}

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