/* ─── ui/kit.css ───────────────────────────────────────────────────────────────
   The shared UI kit (docs/ui_design_bible.md §8, built 2026-10-17, step 2).
   Palette and fonts come from the tokens in index.html (styleguide.md); this file
   adds what a phone needs: touch sizes, a type floor, and the parts every screen
   reuses: buttons, the sheet, the top bar, rows, the segmented switch, chips, the
   status strip and the tab bar. Kit classes start with `k-`, shell parts `tw-`.
   ────────────────────────────────────────────────────────────────────────────── */

:root {
  --tap: 44px;               /* smallest thing a finger presses */
  --gap-tap: 6px;            /* space between neighbouring targets */
  --fs-body: 15px;           /* reading text floor */
  --fs-label: 12px;          /* labels and chips; nothing goes below 11px */
  --fs-small: 11px;
  --strip-h: 56px;
  --tabs-h: 60px;
  --rail-w: 84px;
  --brass: #b98a35;
  --brass-hi: #e7bf62;
  --mana: #6fa8dc;
  --gp: #e0b860;
  --hp: #5ab06a;
  --hp-mid: #d0a040;
  --hp-low: #d04a3a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── The frame: strip on top, screen in the middle, tabs at the bottom ───────── */
/* (A rail down the left on a wide screen.) Hidden parts collapse their tracks. */
body.tw-framed {
  display: grid;
  grid-template-areas: "strip" "root" "tabs";
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
@supports (height: 100dvh) { html, body.tw-framed { height: 100dvh; } }
/* No stacking layer of its own, so an overlay inside it (settings, a dialogue)
   can rise over the strip and the tabs. */
body.tw-framed #screen-root { grid-area: root; height: auto; min-height: 0; min-width: 0; z-index: auto; }
body.tw-framed .tw-strip { grid-area: strip; }
body.tw-framed .tw-tabs  { grid-area: tabs; }
@media (min-width: 900px) {
  body.tw-framed {
    grid-template-areas: "strip strip" "tabs root";
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: auto minmax(0, 1fr);
  }
}
.tw-strip[hidden], .tw-tabs[hidden] { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
/* Reset the game-wide brass `button` look, then three kinds (bible §8). */
.k-btn {
  min-height: var(--tap); padding: 0 16px; border-radius: 8px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: none; box-shadow: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.k-btn:disabled { opacity: .45; cursor: default; }
.k-btn-pri   { background: linear-gradient(var(--brass-hi), var(--brass)); color: #1b1006; border: 1px solid #f0d080; }
.k-btn-sec   { background: transparent; color: var(--gold); border: 1px solid var(--brass); }
.k-btn-quiet { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.k-btn-wide  { width: 100%; }
.k-why { font-family: var(--font-body); font-style: italic; font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── Top bar: one kind of back (bible §3) ──────────────────────────────────── */
.k-topbar {
  display: flex; align-items: center; gap: 8px; min-height: var(--strip-h);
  padding: var(--safe-top) 8px 0 4px;
  background: linear-gradient(#2a180c, #1d1109); border-bottom: 1px solid var(--brass);
  position: relative; z-index: 5;
}
.k-back {
  width: var(--tap); height: var(--tap); flex: none; border-radius: 50%;
  background: transparent; border: none; box-shadow: none; color: var(--gold);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.k-back svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.k-topbar-title { font-family: var(--font-ui); font-size: 16px; color: var(--light); letter-spacing: .04em; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-topbar-right { font-family: var(--font-mono); font-size: 13px; color: var(--gold); flex: none; }

/* ── Sheet: slides up from the bottom; swipe down, Close, outside or back ────── */
.k-sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; opacity: 0; transition: opacity .2s ease; }
.k-sheet-backdrop.open { opacity: 1; }
.k-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; max-height: 85dvh; overflow-y: auto;
  background: linear-gradient(#2a180c, #1d1109); border-top: 1px solid var(--brass); border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + var(--safe-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.6);
  transform: translateY(105%); transition: transform .22s ease;
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--text);
}
@media (min-width: 900px) { .k-sheet { left: 50%; right: auto; width: 520px; margin-left: -260px; } }
.k-sheet.open { transform: none; }
.k-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--dim); margin: 2px auto 10px; }
.k-sheet h3 { font-family: var(--font-ui); font-size: 17px; color: var(--light); letter-spacing: .03em; margin: 0 0 6px; }
.k-sheet p { margin: 0 0 10px; line-height: 1.45; }
.k-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.k-sheet-actions .k-btn { flex: 1 1 auto; }

/* ── Rows, switch, chips, toast ──────────────────────────────────────────────── */
.k-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid #3a2414; cursor: pointer; }
.k-row .k-row-tx { flex: 1; min-width: 0; }
.k-row b { display: block; font-family: var(--font-ui); font-size: 14px; color: var(--light); font-weight: 600; }
.k-row span { display: block; font-size: 14px; color: var(--muted); }
.k-seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.k-seg > button { flex: 1; min-height: 40px; background: transparent; border: none; box-shadow: none; color: var(--muted);
  font-family: var(--font-ui); font-size: 13px; text-transform: none; letter-spacing: .02em; }
.k-seg > button.on { background: #3a2414; color: var(--light); }
.k-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  font-family: var(--font-ui); font-size: var(--fs-small); color: var(--text); white-space: nowrap; }
.k-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 16px + var(--safe-bottom)); z-index: 950;
  background: rgba(26,15,7,.94); border: 1px solid var(--brass); border-radius: 10px; padding: 10px 14px; max-width: min(92vw, 420px);
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--light); box-shadow: 0 4px 14px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.k-toast.show { opacity: 1; }

/* ── Status strip (bible §2) ─────────────────────────────────────────────────── */
.tw-strip {
  display: flex; align-items: center; gap: 10px; min-height: var(--strip-h);
  padding: calc(4px + var(--safe-top)) 6px 4px 8px;
  background: linear-gradient(#2a180c, #1d1109); border-bottom: 1px solid var(--brass);
  position: relative; z-index: 20;
}
.tw-who { display: flex; align-items: center; gap: 8px; min-height: var(--tap); flex: none; max-width: 38%;
  background: transparent; border: none; box-shadow: none; padding: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.tw-face { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid var(--gold); background: #2e1b10 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-ui); color: var(--gold); font-size: 16px; overflow: hidden; }
.tw-who-tx { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.15; }
.tw-who-tx b { font-family: var(--font-ui); font-size: 14px; color: var(--light); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-who-tx small { font-family: var(--font-ui); font-size: var(--fs-small); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-meters { flex: 1; min-width: 0; max-width: 380px; display: flex; flex-direction: column; gap: 3px; }
.tw-strip-extra, .tw-gear { margin-left: auto; }
.tw-strip-extra + .tw-gear { margin-left: 0; }
.tw-meter { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.tw-meter > span:first-child { font-family: var(--font-ui); font-size: var(--fs-small); color: var(--muted); }
.tw-meter > i { display: block; height: 6px; border-radius: 3px; background: #120a05; overflow: hidden; }
.tw-meter > i > b { display: block; height: 100%; border-radius: 3px; }
.tw-meter > em { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--text); min-width: 38px; text-align: right; }
.tw-meter.hp > i > b { background: var(--hp); }
.tw-meter.hp.mid > i > b { background: var(--hp-mid); }
.tw-meter.hp.low > i > b { background: var(--hp-low); }
.tw-meter.mp > i > b { background: var(--mana); }
.tw-meter.gp > i > b { background: var(--gp); }
.tw-strip-extra { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; flex: none; }
.tw-strip-extra:empty { display: none; }
.tw-gear { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; padding: 0;
  background: transparent; border: none; box-shadow: none; color: var(--gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.tw-gear svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ── Tab bar (bible §2); a left rail on wide screens ───────────────────────────── */
.tw-tabs {
  display: flex; min-height: var(--tabs-h); padding-bottom: var(--safe-bottom);
  background: linear-gradient(#24150b, #170d06); border-top: 1px solid var(--brass);
  position: relative; z-index: 20;
}
.tw-tab {
  flex: 1; min-width: 0; min-height: var(--tabs-h); padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border: none; box-shadow: none; border-radius: 0; cursor: pointer;
  color: var(--muted); font-family: var(--font-ui); font-size: var(--fs-small); font-weight: 400;
  letter-spacing: .02em; text-transform: none; -webkit-tap-highlight-color: transparent;
}
.tw-tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tw-tab.on { color: var(--gold); }
.tw-tab.on svg { filter: drop-shadow(0 0 4px rgba(225,184,90,.5)); }
.tw-tab:hover:not(.on) { color: var(--text); background: transparent; }
@media (min-width: 900px) {
  .tw-tabs { flex-direction: column; justify-content: flex-start; width: var(--rail-w); min-height: 0; padding: 8px 0;
    border-top: none; border-right: 1px solid var(--brass); }
  .tw-tab { flex: none; min-height: 72px; }
}

/* ── Pages: the character sheet as the Character and Pack tabs ──────────────── */
.cs-page { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cs-page .tw-modal { width: min(640px, 100%); max-height: none; height: auto; margin: 0 auto;
  border: none; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
.cs-page .tw-modal-body { overflow: visible; padding: 14px 16px 24px; font-size: var(--fs-body); }
.cs-page .tw-modal-tabs { position: sticky; top: 0; z-index: 2; background: rgba(24,14,8,.96); padding-top: 10px; }
.cs-page .tw-modal-tab { min-height: 40px; font-size: 13px; padding: 8px 16px; }

/* ── A screen that opens on top: its top bar, then its body filling the rest ─── */
.k-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.k-page > .k-topbar { flex: none; }
.k-page > :not(.k-topbar) { flex: 1 1 auto; min-height: 0; height: auto !important; overflow-y: auto; }

/* ── State reset ──────────────────────────────────────────────────────────────
   The game-wide `button`, `button:hover`, `button:active` and `button.on` rules
   paint brass gradients, shadows and a purple glow. Kit and shell buttons keep
   their own look in every state. */
.tw-tab, .tw-tab:hover, .tw-tab:active, .tw-tab.on,
.tw-who, .tw-who:hover, .tw-who:active,
.tw-gear, .tw-gear:hover, .tw-gear:active,
.k-back, .k-back:hover, .k-back:active,
.k-seg > button, .k-seg > button:hover, .k-seg > button:active {
  background: transparent; border: none; box-shadow: none;
}
.k-seg > button.on, .k-seg > button.on:hover { background: #3a2414; color: var(--light); }
.k-btn-pri, .k-btn-pri:hover, .k-btn-pri:active { background: linear-gradient(var(--brass-hi), var(--brass)); box-shadow: none; color: #1b1006; }
.k-btn-pri:active { filter: brightness(.9); }
.k-btn-sec, .k-btn-sec:hover, .k-btn-quiet, .k-btn-quiet:hover { background: transparent; box-shadow: none; }
.k-btn-sec:active, .k-btn-quiet:active, .tw-tab:active, .k-back:active, .tw-gear:active { background: rgba(225,184,90,.08); }
.tw-tab.on { color: var(--gold); }

/* ── Weather (light plan phase 5, weather.js) ──────────────────────────────────
   Drawn over the map or the field, under the controls: rain and a wet sheen,
   drifting fog, wind, snow, and a storm's flash. Still under reduced motion.
   The rain and the snow themselves fall on a canvas (engine/ui/weather_fx.js),
   each drop and flake its own; here only their tint. */
.wx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
.wx-layer[hidden] { display: none; }
.wx-layer::before, .wx-layer::after { content: ''; position: absolute; pointer-events: none; }
.wx-rain, .wx-storm { background: rgba(38, 50, 68, 0.12); }
.wx-storm { background: rgba(28, 34, 52, 0.2); }
.wx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wx-fog { background: rgba(196, 202, 208, 0.16); }
.wx-fog::before, .wx-fog::after {
  inset: -40%;
  background: radial-gradient(40% 28% at 30% 40%, rgba(226, 229, 233, 0.5), transparent 70%),
              radial-gradient(34% 24% at 72% 66%, rgba(226, 229, 233, 0.42), transparent 70%);
  animation: wx-drift 42s ease-in-out infinite alternate;
}
.wx-fog::after { opacity: 0.7; animation-duration: 57s; animation-direction: alternate-reverse; }
@keyframes wx-drift { to { transform: translate(16%, 7%); } }
.wx-wind::before {
  inset: -20%; transform: rotate(-4deg);
  background-image: radial-gradient(26px 1px at 30% 40%, rgba(236, 230, 206, 0.26), transparent),
                    radial-gradient(18px 1px at 70% 80%, rgba(236, 230, 206, 0.18), transparent),
                    radial-gradient(34px 1px at 10% 15%, rgba(236, 230, 206, 0.14), transparent);
  background-size: 173px 61px, 229px 97px, 311px 139px;
  animation: wx-gust 1.6s linear infinite;
}
@keyframes wx-gust { to { background-position: 173px 4px, 229px 9px, 311px 3px; } }
.wx-snow { background: rgba(228, 234, 244, 0.1); }
.wx-flash::after { inset: 0; background: rgba(232, 238, 255, 0.8); animation: wx-flash 0.6s ease-out forwards; }
@keyframes wx-flash { 0% { opacity: 0.9; } 15% { opacity: 0.15; } 25% { opacity: 0.7; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wx-layer::before, .wx-layer::after { animation: none; }
  .wx-flash::after { opacity: 0; }
}

/* A one-field sheet (openNameSheet). 16px so a phone does not zoom on focus. */
.k-input { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 4px; padding: 10px 12px;
  font-family: var(--font-body); font-size: 16px; color: var(--text);
  background: rgba(0,0,0,.28); border: 1px solid var(--dim); border-radius: 6px; }
.k-input:focus { outline: none; border-color: var(--brass); }

/* ── The party's goods (Pack → Inventory, 2026-10-30; character_sheet.js) ──── */
.pg-loads { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 0 0 10px; }
.pg-load { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.pg-load-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pg-load-name { font: 700 13px var(--font-ui); color: var(--light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-load-n { font: 400 12px var(--font-ui); color: var(--muted); white-space: nowrap; }
.pg-bar { height: 6px; border-radius: 3px; background: var(--raised); margin-top: 6px; overflow: hidden; }
.pg-bar-fill { height: 100%; border-radius: 3px; background: var(--hp); }
.pg-over { color: var(--hp-low) !important; }
.pg-bar-fill.pg-over { background: var(--hp-low); }
.pg-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin: 0 0 10px;
           border: 1px solid var(--brass); border-radius: var(--radius-lg); background: var(--surface);
           color: var(--light); font-size: var(--fs-body); }
.pg-warn > span { flex: 1 1 200px; }
.pg-filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 6px; padding-bottom: 2px; }
.pg-filters button { flex: 0 0 auto; min-height: var(--tap); padding: 0 12px; }
.pg-list { display: flex; flex-direction: column; }
.pg-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 2px;
          border: 0; border-bottom: 1px solid var(--raised); background: transparent; color: inherit;
          font: inherit; text-align: left; cursor: pointer; }
.pg-row:hover { background: rgba(225, 184, 90, 0.05); }
.pg-row-main { flex: 1; min-width: 0; }
.pg-row-name { font: 700 14px var(--font-ui); color: var(--light); }
.pg-row-w { font: 400 12px var(--font-ui); color: var(--muted); white-space: nowrap; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pg-chip { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font: 400 12px var(--font-ui); color: var(--text); }
.pg-chip-you { border-color: var(--gold); color: var(--gold); }
.pg-chip-companion { border-color: #8bdad0; color: #8bdad0; }
.pg-chip-chest { border-color: var(--muted); color: var(--muted); }
.pg-sheet { display: flex; flex-direction: column; gap: 4px; }
.pg-sheet-desc { color: var(--muted); font-size: var(--fs-body); line-height: 1.35; margin: 0 0 6px; }
.pg-hold { display: flex; align-items: center; gap: 8px; min-height: 52px; border-top: 1px solid var(--raised); }
.pg-hold-who { flex: 1; min-width: 0; }
.pg-hold-name { font: 700 14px var(--font-ui); color: var(--light); }
.pg-hold-note { font-size: var(--fs-label); color: var(--muted); }
.pg-step { width: var(--tap); height: var(--tap); border-radius: var(--radius-lg); border: 1px solid var(--border);
           background: var(--raised); color: var(--brass-hi); font: 700 20px var(--font-ui); }
.pg-step:disabled { opacity: .35; }
.pg-n { width: 34px; text-align: center; font: 700 17px var(--font-ui); color: var(--light); }
.pg-all { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.pg-mine { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 4px; }
/* The rows and steppers keep their own look in every state (see State reset). */
.pg-row, .pg-row:hover, .pg-row:active, .pg-row.on {
  background: transparent; box-shadow: none; border: 0; border-bottom: 1px solid var(--raised);
  border-radius: 0; text-transform: none; letter-spacing: normal; padding: 8px 2px; color: inherit; }
.pg-row:hover { background: rgba(225, 184, 90, 0.05); }
.pg-row:active { background: rgba(225, 184, 90, 0.08); }
.pg-step, .pg-step:hover, .pg-step:active {
  background: var(--raised); box-shadow: none; border: 1px solid var(--border); padding: 0;
  text-transform: none; letter-spacing: 0; color: var(--brass-hi); }
.pg-step:active:not(:disabled) { background: #3a2414; }
.pg-row-name { text-transform: none; letter-spacing: normal; }
.pg-chip { text-transform: none; letter-spacing: normal; }
/* Your row in the goods sheet: the sheet already names the piece. */
.pg-mine .tw-row-label, .pg-mine .tw-row-label + .tw-row-sub:not(.inv-prof):not(.inv-kits) { display: none; }

/* ── The camp (rest_screen.js, 2026-10-30: the user's design from the mock-ups) ── */
.cp-screen { display: flex; flex-direction: column; gap: 10px; height: 100%; overflow-y: auto; box-sizing: border-box;
  padding: 14px 16px 24px; background: var(--bg); color: var(--text); font-family: var(--font-body); max-width: 640px; margin: 0 auto; }
.cp-screen > * { flex: none; }
.cp-head { display: flex; flex-direction: column; }
.cp-place { font: 700 17px var(--font-ui); color: var(--light); }
.cp-sub, .cp-note { font-size: var(--fs-body); color: var(--muted); }
.cp-note { margin-top: -4px; }
.cp-tabs > button { min-height: var(--tap); font: 400 14px var(--font-ui); }
.cp-tabs > button.on { font-weight: 700; color: #1b1006; background: var(--gold); }
.cp-party { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cp-mate { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cp-face { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--brass); background: var(--raised) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font: 700 15px var(--font-ui); color: var(--gold); overflow: hidden; }
.cp-face img { width: 100%; height: 100%; object-fit: cover; }
.cp-mate-name { font: 700 13px var(--font-ui); color: var(--light); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.cp-bar > span { display: block; height: 100%; }
.cp-mate-hp { font: 400 var(--fs-small) var(--font-ui); color: var(--muted); }
.cp-mate-note { font-size: 14px; line-height: 1.15; color: var(--muted); text-align: center; }
.cp-mate-note.warn { color: #f0b49a; }
.cp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-row { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 60px;
  padding: 8px 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cp-wide { width: 100%; border-color: var(--brass); background: var(--raised); }
.cp-cards { border-style: dashed; background: transparent; flex-direction: row; align-items: center; justify-content: space-between; min-height: 48px; }
.cp-t { font: 700 14px var(--font-ui); color: var(--light); }
.cp-s { font: 400 var(--fs-body) var(--font-body); color: var(--muted); line-height: 1.2; }
.cp-rest { margin-top: 6px; min-height: 52px; font-size: 16px; }
.cp-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--brass); border-radius: var(--radius-lg); background: var(--surface); }
.cp-p { margin: 0; font-size: 16px; line-height: 1.35; }
.cp-gives { margin: 0; padding-left: 18px; font-size: var(--fs-body); line-height: 1.3; }
.cp-tiers { display: flex; flex-direction: column; gap: 8px; }
.cp-tier { padding: 8px 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.cp-tier-now { border: 2px solid var(--gold); background: var(--raised); }
.cp-tier-next { border: 1px dashed var(--brass); background: var(--surface); }
.cp-tier-later, .cp-tier-past { color: var(--muted); }
.cp-tier-later .cp-t { color: var(--muted); }
.cp-tier-head { display: flex; justify-content: space-between; align-items: baseline; }
.cp-tag { font: 400 var(--fs-label) var(--font-ui); color: var(--brass-hi); }
.cp-raise { min-height: 52px; }
.cp-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cp-line { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px; text-align: left; width: 100%; }
.cp-line + .cp-line { border-top: 1px solid var(--raised); }
.cp-line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-go { font: 700 var(--fs-label) var(--font-ui); color: var(--brass-hi); white-space: nowrap; }
.cp-sheet { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.cp-label { font: 400 var(--fs-label) var(--font-ui); color: var(--muted); margin-top: 4px; }
.cp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.cp-stats > div { padding: 8px 4px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.cp-stats b { font: 700 16px var(--font-ui); color: var(--light); }
.cp-stats span { font-size: 14px; color: var(--muted); }
.cp-pick { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 12px; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: transparent; }
.cp-pick.on { border: 2px solid var(--gold); background: var(--raised); }
.cp-dot { width: 18px; height: 18px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--border); }
.cp-pick.on .cp-dot { border: 5px solid var(--gold); }
.cp-check .cp-dot { border-radius: 4px; }
.cp-check.on .cp-dot { border: 0; background: var(--gold); }
.cp-seg > button { min-height: var(--tap); font: 400 13px var(--font-ui); }
.cp-seg > button.on { background: var(--gold); color: #1b1006; font-weight: 700; }
.cp-summary { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.cp-ledger { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; padding: 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.cp-ledger b { font: 700 13px var(--font-ui); color: var(--light); text-align: right; }
.cp-ledger b.dim { color: var(--muted); font-weight: 400; }
.cp-ledger i { border-top: 1px solid var(--raised); }
/* The camp's own buttons keep their look in every state (see State reset). */
.cp-row, .cp-row:hover, .cp-row:active, .cp-line, .cp-line:hover, .cp-line:active,
.cp-pick, .cp-pick:hover, .cp-pick:active {
  box-shadow: none; text-transform: none; letter-spacing: normal; color: inherit; font-family: inherit; }
.cp-row, .cp-row:hover { background: var(--surface); border: 1px solid var(--border); padding: 8px 12px; }
.cp-wide, .cp-wide:hover { background: var(--raised); border-color: var(--brass); }
.cp-cards, .cp-cards:hover { background: transparent; border: 1px dashed var(--border); }
.cp-row:active:not(:disabled), .cp-line:active, .cp-pick:active:not(:disabled) { background: #3a2414; }
.cp-row:disabled, .cp-pick:disabled { opacity: .4; cursor: default; }
.cp-line, .cp-line:hover { background: transparent; border: 0; border-radius: 0; padding: 6px 12px; }
.cp-line + .cp-line, .cp-line + .cp-line:hover { border-top: 1px solid var(--raised); }
.cp-pick, .cp-pick:hover { background: transparent; border: 1px solid var(--border); padding: 6px 12px; }
.cp-pick.on, .cp-pick.on:hover { background: var(--raised); border: 2px solid var(--gold); }
.cp-tabs > button.on, .cp-tabs > button.on:hover, .cp-seg > button.on, .cp-seg > button.on:hover { background: var(--gold); color: #1b1006; box-shadow: none; }

/* Sneaking on the map (2026-10-31, the user's ask): you and the companions with
   you go translucent while you move low (explore.js markSneaking). One left
   waiting at a hold is not sneaking. No transition here: the tokens' own carries
   their walk (left, top), and figures.js reads it. */
.screen-explore.explore-sneaking #etoken-pc,
.screen-explore.explore-sneaking [id^="etoken-follow-"] { opacity: .5; }

/* Dead ground at camp (2026-10-31): what a night there withholds, said plainly. */
.cp-warn { padding: 8px 12px; border: 1px solid rgba(214, 150, 70, .45); border-left-width: 3px; border-radius: 8px;
  background: rgba(214, 150, 70, .08); color: #e8d6b4; font-size: var(--fs-body); line-height: 1.35; }
.cp-rest { flex-direction: column; gap: 2px; }
.cp-rest-sub { display: block; font-size: 12px; font-weight: 400; opacity: .8; text-transform: none; letter-spacing: 0; }
