/* Hallmark · packing · Almanac tokens, editorial checklist.
 * Shared by /packing/ (EN) and /zh/packing/ (繁中) — one stylesheet, two shells.
 * Accent (California Gold) stays under 5% of viewport: tier chips carry STATE hues,
 * which the token file explicitly permits as semantic, not accent.
 */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; overflow-x: clip;
  background: var(--color-paper); color: var(--color-ink);
  font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
:lang(zh-Hant) body, html[lang^="zh"] body { line-height: 1.7; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3.5vw, 30px); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
b { font-weight: 650; }
a { color: inherit; }

/* ---------- masthead (N9, matches the command centre) ---------- */
.mast { border-bottom: var(--rule-hair) solid var(--color-rule); background: var(--color-paper); position: sticky; top: 0; z-index: 40; }
.mast .wrap { display: flex; align-items: baseline; gap: var(--space-sm); padding: var(--space-xs) clamp(16px,3.5vw,30px); }
.mast-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -.01em; white-space: nowrap; }
.mast-title small { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--color-ink-3); margin-left: var(--space-2xs); }
.mast nav { margin-left: auto; display: flex; align-items: baseline; gap: var(--space-xs); }
.mast nav a { color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; padding-bottom: 2px; transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.mast nav a:hover { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.theme { width: 26px; height: 26px; cursor: pointer; flex: none; background: transparent; color: var(--color-ink-3); border: var(--rule-hair) solid var(--color-rule); border-radius: 0; font-size: var(--text-sm); line-height: 1; }
.theme:hover { color: var(--color-ink); border-color: var(--color-accent); }
@media (max-width: 820px) { .mast nav a:not(.keep) { display: none; } .mast-title small { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: var(--space-xl) var(--space-md); }
.hero-grid { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: clamp(24px,3vw,48px); align-items: end; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0,1fr); align-items: start; } }
h1 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.04; font-size: var(--text-display); text-wrap: balance; }
h1 u { text-decoration: none; box-shadow: inset 0 -.26em 0 var(--color-accent); }
.hero-sub { margin: var(--space-sm) 0 0; color: var(--color-ink-2); max-width: 52ch; }

/* the one card: what the flat already has */
.has { border: var(--rule-hair) solid var(--color-ink); background: var(--color-paper-2); }
.has-h { padding: var(--space-xs) var(--space-sm) var(--space-3xs); border-bottom: var(--rule-thick) solid var(--color-accent); font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }
.has ul { list-style: none; margin: 0; padding: var(--space-2xs) 0; }
/* NOT flex: a flex container promotes every inline <b> to its own flex item,
   which shatters CJK line-breaking. Block + absolute marker keeps text as text. */
.has li { position: relative; padding: 4px var(--space-sm) 4px calc(var(--space-sm) + 16px); font-size: var(--text-sm); color: var(--color-ink-2); }
.has li::before { content: "✓"; position: absolute; left: var(--space-sm); top: 4px; color: var(--color-low); font-weight: 700; }
.has li b { color: var(--color-ink); }
.has-foot { padding: var(--space-2xs) var(--space-sm) var(--space-xs); border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-xs); color: var(--color-ink-3); }

/* ---------- status band ---------- */
.status { border-top: var(--rule-hair) solid var(--color-rule); border-bottom: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); }
.status .wrap { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding-top: var(--space-2xs); padding-bottom: var(--space-2xs); }
.status .cell { padding: var(--space-2xs) var(--space-xs) var(--space-2xs) 0; }
.status .cell + .cell { border-left: var(--rule-hair) solid var(--color-rule); padding-left: var(--space-xs); }
.status .k { font-size: var(--text-xs); color: var(--color-ink-3); font-weight: 600; }
.status .v { font-size: var(--text-sm); font-weight: 650; margin-top: 1px; }
.status .v .mono { font-size: var(--text-lg); }
@media (max-width: 760px) {
  .status .wrap { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .status .cell:nth-child(3) { border-left: none; padding-left: 0; }
  .status .cell:nth-child(1), .status .cell:nth-child(2) { border-bottom: var(--rule-hair) solid var(--color-rule); }
}

/* ---------- progress ---------- */
.prog { height: 4px; background: var(--color-rule-soft); }
.prog i { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width var(--dur-mid) var(--ease-out); }

/* ---------- controls ---------- */
.controls { position: sticky; top: 47px; z-index: 30; background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
.controls .wrap { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-xs); align-items: center; padding-top: var(--space-2xs); padding-bottom: var(--space-2xs); }
.grp { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.grp-k { font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-ink-3); margin-right: 2px; }
.chip {
  font: inherit; font-size: var(--text-xs); font-weight: 650; cursor: pointer;
  padding: 4px 9px; border: var(--rule-hair) solid var(--color-rule); border-radius: 0;
  background: transparent; color: var(--color-ink-2); white-space: nowrap;
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.chip:hover { border-color: var(--color-ink-3); color: var(--color-ink); }
.chip[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); border-color: var(--color-ink); }
.chip .n { opacity: .65; margin-left: 4px; font-family: var(--font-mono); }
.search { font: inherit; font-size: var(--text-sm); padding: 5px 9px; min-width: 170px; flex: 1 1 170px; max-width: 280px;
  border: var(--rule-hair) solid var(--color-rule); border-radius: 0; background: var(--color-paper-2); color: var(--color-ink); }
.controls .right { margin-left: auto; display: flex; gap: 5px; }
.controls .right #reset { margin-left: 14px; }
/* On a phone the filter bar used to wrap to four rows, so it was left unsticky and
   went out of reach a screen into a 20,000px list. One nowrap row that scrolls
   sideways docks under the nav bar instead, and the chips get thumb-sized. */
@media (max-width: 700px) {
  .mast { position: static; }
  .controls { position: sticky; top: var(--sn-bar, 52px); z-index: 50; }
  .controls .wrap { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    gap: var(--space-2xs); padding-top: 6px; padding-bottom: 6px; }
  .grp { flex-wrap: nowrap; gap: 8px; }
  .grp-k { white-space: nowrap; }
  .chip { padding: 9px 12px; font-size: var(--text-sm); }
  .search { min-width: 132px; flex: 0 0 132px; }
  .controls .right { margin-left: 0; gap: 8px; }
}

/* ---------- category sections ---------- */
.cat { padding: var(--space-lg) 0 var(--space-2xs); }
.cat + .cat { border-top: var(--rule-hair) solid var(--color-rule); }
.cat-h { display: flex; align-items: baseline; gap: var(--space-2xs); flex-wrap: wrap; }
.cat-n { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; letter-spacing: .14em; color: var(--color-accent-ink); }
h2 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; font-size: var(--text-xl); }
.cat-meta { margin-left: auto; font-size: var(--text-xs); color: var(--color-ink-3); font-family: var(--font-mono); }

/* ---------- rows ---------- */
.rows { margin-top: var(--space-xs); border-top: var(--rule-hair) solid var(--color-rule); }
.row {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto;
  gap: var(--space-2xs) var(--space-xs); align-items: start;
  padding: var(--space-xs) 0 var(--space-xs) var(--space-2xs);
  border-bottom: var(--rule-hair) solid var(--color-rule-soft);
  border-left: var(--rule-thick) solid transparent;
}
.row.t-must    { border-left-color: var(--color-hi); }
.row.t-should  { border-left-color: var(--color-mid); }
.row.t-depends { border-left-color: var(--color-ink-3); }
.row.t-skip    { border-left-color: var(--color-rule); }
.row.done { opacity: .42; }
.row.done .r-name { text-decoration: line-through; }
.row.t-skip .r-name { text-decoration: line-through; text-decoration-color: var(--color-ink-3); }

.row input[type=checkbox] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--color-blue); cursor: pointer; }
.r-main { display: block; min-width: 0; }
.r-name { display: block; font-weight: 650; font-size: var(--text-md); }
.r-note { display: block; margin-top: 3px; color: var(--color-ink-2); font-size: var(--text-sm); max-width: 74ch; }
.r-note b { color: var(--color-ink); }
.r-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; white-space: nowrap; }
.tag.tier-must    { color: var(--color-hi);  background: var(--color-hi-bg); }
.tag.tier-should  { color: var(--color-mid); background: var(--color-mid-bg); }
.tag.tier-depends { color: var(--color-ink-2); background: var(--color-rule-soft); }
.tag.tier-skip    { color: var(--color-ink-3); background: transparent; border: var(--rule-hair) solid var(--color-rule); }
.tag.where { color: var(--color-ink-3); background: transparent; border: var(--rule-hair) solid var(--color-rule); }
.tag.verify { color: var(--color-accent-ink); background: var(--color-mid-bg); }
.r-cost { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-2); white-space: nowrap; padding-top: 1px; }
.r-cost.free { color: var(--color-ink-3); font-weight: 400; }
@media (max-width: 620px) {
  .row { grid-template-columns: 22px minmax(0,1fr); }
  .r-cost { grid-column: 2; padding-top: 0; }
}

.empty { padding: var(--space-lg) 0; color: var(--color-ink-3); font-size: var(--text-sm); }

/* ---------- 48 hours + shops ---------- */
.band { border-top: var(--rule-thick) solid var(--color-ink); background: var(--color-paper-2); padding: var(--space-xl) 0; }
.band h2 { font-size: var(--text-2xl); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(24px,3vw,44px); margin-top: var(--space-md); }
@media (max-width: 800px) { .two { grid-template-columns: minmax(0,1fr); } }
.sub-h { margin: 0 0 var(--space-2xs); font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; border-top: var(--rule-hair) solid var(--color-rule); }
ol.steps li { counter-increment: s; position: relative; padding: var(--space-2xs) 0 var(--space-2xs) 24px; border-bottom: var(--rule-hair) solid var(--color-rule-soft); font-size: var(--text-sm); }
ol.steps li::before { content: counter(s) "."; position: absolute; left: 0; top: var(--space-2xs); font-family: var(--font-mono); font-weight: 700; color: var(--color-accent-ink); }
table.shops { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.shops th, table.shops td { text-align: left; padding: 6px var(--space-2xs) 6px 0; border-bottom: var(--rule-hair) solid var(--color-rule-soft); vertical-align: top; }
table.shops th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-3); }
table.shops td:last-child { color: var(--color-ink-2); }
@media (max-width: 640px) {
  /* keep "~30 min / bus" on one line instead of breaking it over three */
  table.shops td:nth-child(2) { white-space: nowrap; width: 1%; }
  table.shops td:first-child { min-width: 10ch; }
}

.warn { border-left: var(--rule-thick) solid var(--color-hi); background: var(--color-hi-bg); padding: var(--space-xs) var(--space-sm); margin-top: var(--space-md); font-size: var(--text-sm); }
.warn b { color: var(--color-hi); }

footer { border-top: var(--rule-hair) solid var(--color-rule); padding: var(--space-md) 0 var(--space-xl); font-size: var(--text-xs); color: var(--color-ink-3); }
footer div + div { margin-top: var(--space-2xs); }
footer a { color: var(--color-ink-2); }

/* ---------- print: this is the page mum takes to Target ---------- */
@media print {
  .mast, .controls, .prog, .theme { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .row { break-inside: avoid; border-left-width: 2px; }
  .cat { break-inside: auto; padding-top: 14pt; }
  .row.done { opacity: 1; }
  .hero { padding: 0 0 10pt; }
  h1 { font-size: 20pt; }
  .band { break-before: page; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Phone: a 17px checkbox is a poor thumb target on an 83-item list.
   Lives at the end of the file so it wins over the base .row rule above. */
@media (max-width: 700px) {
  .row input[type=checkbox] { width: 22px; height: 22px; margin-top: 1px; }
}
