/* Sarian PHP port — front-end styles (Stage 5).
   Layout language follows the hub: dark sidebar + black game area,
   gold plaque buttons, Cinzel display type (loaded from Google
   Fonts in index.php) with the system sans for UI text. */

:root {
  --gold: #c9a227;
  --gold-bright: #f0cd55;
  /* The hub's secondary-button surfaces (cleanup 11): the
     dark-scheme equivalents of its surface-raised /
     border-strong / text tokens. */
  --surface-raised: #272b20;
  --border-strong: #666856;
  --btn-text: #f3ecd9;
  --ink: #0b0e13;
  --panel: #161c26;
  --panel-2: #1e2634;
  --line: #33405a;
  --thumb: #2F4D7D;
  --text: #e8e2d0;
  --dim: #9aa3b2;
  --red: #e5484d;
  --green: #57ab5a;
  --cyan: #37c8d9;
  /* The hub's UI text stack (cleanup 2): vital labels/values,
     the plate's Level line and money line, and the phone readout
     render in the system sans — NOT the Georgia body serif the
     port inherited before, whose bold read visibly heavier than
     the hub's amounts. */
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Port wave (font standardization, user directive): the whole
   front end standardizes on the Skill detail screen's type
   roles — its body/description/label/value text is the --sans
   stack, its display titles are ui-serif, its panel titles
   and action buttons are Cinzel. The base font therefore
   becomes the reference's body role (--sans); every element
   that deliberately carries a serif or display face already
   declares its own family (Cinzel headings, ui-serif detail
   titles, plaque buttons, the title form), so nothing that
   was meant to be serif changes — only the surfaces that
   silently inherited the old Georgia base pick up the
   standard. */
html, body { margin: 0; padding: 0; background: #000; color: var(--text);
  font-family: var(--sans); }
h1, h2, h3, .plaque-btn, .side-head { font-family: 'Cinzel', Georgia, serif; }
button { cursor: pointer; font-family: inherit; }
img { user-select: none; }
.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ---------- Title & menu ---------- */
#screen-title, #screen-menu {
  background: #000 url('../assets/title_bg.jpg') center / cover no-repeat fixed;
  display: flex; flex-direction: column; align-items: center;
}
.title-inner, .menu-inner { display: flex; flex-direction: column; align-items: center;
  padding: 6vh 16px 40px; width: 100%; max-width: 560px; }
.title-logo { width: min(680px, 92vw, 76dvh); max-height: 40dvh; object-fit: contain; height: auto; }
.title-logo.small { width: min(520px, 92vw, 48dvh); }
.title-buttons { display: flex; flex-direction: column; gap: clamp(6px, 1.4dvh, 16px); margin-top: clamp(6px, 2.2dvh, 34px); width: min(430px, 86vw); }
.plaque-btn {
  position: relative; z-index: 0; background: none;
  border: none; color: #fdf6dd; font-size: clamp(19px, 2.6vw + 10px, 27px); font-weight: 600;
  letter-spacing: 0.04em; padding: 6px 18px; text-shadow: 0 1px 2px rgba(0,0,0,.55);
  aspect-ratio: 5.3 / 1; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.plaque-btn::before { content: ""; position: absolute; left: 0; top: 50%; width: 100%;
  aspect-ratio: 2172 / 724; transform: translateY(-50%); z-index: -1;
  background: url('../assets/btn_blue.png') center / 100% 100% no-repeat; }
.plaque-btn:hover { color: #F2C41C; transform: scale(1.08); }
.plaque-btn:hover::before { background-image: url('../assets/btn_gold.png'); }
.plaque-btn.small { font-size: 15px; padding: 4px 14px; height: 48px; aspect-ratio: 3 / 1; flex: none; }
.plaque-btn:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
.version-line { margin-top: auto; align-self: flex-start; padding: 10px 14px;
  color: var(--dim); font-size: 13px; }
.title-form { background: rgba(6, 22, 36, 0.78); border: 1px solid rgba(240, 192, 0, 0.38);
  border-radius: 14px; padding: clamp(14px, 2.4dvh, 22px) 20px clamp(16px, 2.6dvh, 24px);
  margin-top: clamp(6px, 2dvh, 30px); width: min(430px, 92vw);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; gap: clamp(9px, 1.5dvh, 14px); }
.title-form h2 { margin: 0 0 4px; color: #fdf6dd; font-size: 26px; font-weight: 700;
  letter-spacing: 0.04em; text-align: center; }
.title-form label { display: flex; flex-direction: column; gap: 6px;
  font-family: 'Cinzel', Georgia, serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; color: #f3d98b; }
.title-form input, .title-form select { padding: 10px 12px; font-size: 16px; min-height: 46px;
  border-radius: 8px; border: 1px solid rgba(255, 226, 160, 0.45);
  background: rgba(255, 250, 235, 0.96); color: #171813; }
.title-form input::placeholder { color: #8a8474; }
.title-form input:focus, .title-form select:focus { outline: 3px solid rgba(255, 214, 120, 0.85); }
.form-row { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.title-form .plaque-btn.small { width: min(360px, 100%); height: auto; aspect-ratio: 5.3 / 1; flex: none;
  font-size: clamp(19px, 2.6vw + 10px, 27px); }
@media (max-height: 820px) {
  .title-form input, .title-form select { min-height: 40px; }
  .form-row { gap: 2px; }
  .title-form .plaque-btn.small { width: min(300px, 100%); }
}
.form-error { color: var(--red); min-height: 18px; margin: 0; font-size: 14px; }
.signed-in { display: inline-block; border: 1px solid rgba(240, 192, 0, 0.38); border-radius: 999px;
  background: rgba(6, 22, 36, 0.68); color: #fdf6dd; padding: 7px 16px;
  font-family: 'Cinzel', Georgia, serif; font-size: 14px; margin: 18px 0 0; }
/* Admin gear (Admin Stage A): admins only (the .hidden class
   does the gating, driven from the session's is_admin). Desktop:
   fixed bottom-right. Phone: the <=719px block at the end of
   this file moves it in-flow at the top of the screen. */
.admin-gear { position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(6, 22, 36, 0.85); border: 1px solid rgba(240, 192, 0, 0.5);
  color: var(--gold-bright); font-size: 30px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.admin-gear:hover { color: #F2C41C; border-color: #F2C41C; transform: scale(1.08); }
#menu-username { color: #F2C41C; font-weight: 700; }
#screen-menu .title-logo.small { width: min(620px, 92vw, 60dvh); }
.plaque-btn.greyed { opacity: 0.55; filter: grayscale(1); color: #b9b4a6; }
.plaque-btn.greyed:hover { transform: none; color: #b9b4a6; }
.plaque-btn.greyed:hover::before { background-image: url('../assets/btn_blue.png'); }
.menu-characters { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; width: min(360px, 88vw); }
/* Hub 7.18: the card itself is the button — one click target for
   the whole row (portrait, name/level, background, plaque). The
   button resets keep the Stage 5 card look; hover/focus/active
   follow the menu buttons' gold treatment. */
.char-card { display: flex; align-items: center; gap: 12px; background: rgba(10,12,18,.92);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
  width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.char-card:hover { border-color: var(--gold); background: rgba(18,22,30,.95); }
.char-card:active { transform: scale(.99); }
.char-card:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.char-card img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.char-card .grow { flex: 1; min-width: 0; }
.char-card .cname { display: block; }
.char-card .lvl { display: block; color: var(--dim); font-size: 13px; }
/* The card's Continue plaque is purely visual (hub 7.18): the
   same blue/gold art construction as .plaque-btn, enlarged to a
   177px box with an 18px label. pointer-events: none — clicks
   pass to the card button, so the action fires exactly once. */
.char-plaque { position: relative; z-index: 0; flex: none; width: 177px; aspect-ratio: 3 / 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', Georgia, serif; font-size: 18px; font-weight: 600;
  letter-spacing: 0.04em; color: #fdf6dd; text-shadow: 0 1px 2px rgba(0,0,0,.55);
  pointer-events: none; }
.char-plaque::before { content: ""; position: absolute; left: 0; top: 50%; width: 100%;
  aspect-ratio: 2172 / 724; transform: translateY(-50%); z-index: -1;
  background: url('../assets/btn_blue.png') center / 100% 100% no-repeat; }
.char-card:hover .char-plaque { color: #F2C41C; }
.char-card:hover .char-plaque::before { background-image: url('../assets/btn_gold.png'); }
/* Hub 7.89: the cards region's loading row — the game's gold
   waiting ring at 22px beside the text, in a card-shaped box.
   It reserves exactly one card's height so the menu does not
   shift when the cards replace it: a card is its plaque
   (177px wide at a 3/1 aspect = 59px) + 20px of vertical
   padding + 2px of border = 81px, hence min-height 81px on
   the border box. The phone block below steps it to 74px
   with the 156px plaque (52px + 22px). */
.char-loading { display: flex; align-items: center; gap: 10px;
  box-sizing: border-box; min-height: 81px; padding: 10px 14px;
  background: rgba(10,12,18,.92); border: 1px solid var(--line); border-radius: 8px;
  color: var(--dim); font-size: 15px; }
.waiting-spinner.small { width: 22px; height: 22px; border-width: 3px; flex: none; }

/* ---------- Game layout ---------- */
#screen-game { height: 100vh; height: 100dvh; }
#game-layout { display: flex; height: 100vh; height: 100dvh; }
#sidebar { width: min(280px, 42vw); flex: 0 0 min(280px, 42vw); background: #0d141b;
  border-right: 1px solid rgba(240, 192, 0, 0.3); display: flex; flex-direction: column; }
#sidebar-scrollwrap { position: relative; flex: 1; min-height: 0; display: flex; }
#sidebar-scroll { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 32px 16px 10px; scrollbar-width: none; }
#sidebar-scroll::-webkit-scrollbar { display: none; }
/* Sidebar custom scrollbar (cleanup 2, the hub's construction):
   the native bar is hidden (above) and a DOM column 24px wide
   sits at the right edge of the scroll region — up/down END
   BUTTONS holding the blue-and-gold arrow <img>s, a draggable
   thumb of solid #2F4D7D (16px, rounded) over a faint gold
   track groove. The column exists only while the content
   overflows (the client toggles [hidden]); the content keeps
   its 32px right gutter so nothing slides under the bar. */
.ssb { position: absolute; top: 0; right: 0; bottom: 0; width: 24px; display: flex; flex-direction: column; z-index: 6; }
.ssb[hidden] { display: none; }
.ssb-arrow { flex: 0 0 28px; width: 24px; height: 28px; padding: 0; background: none; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ssb-arrow img { display: block; width: 22px; height: 28px; object-fit: contain; pointer-events: none; }
.ssb-track { flex: 1; position: relative; width: 16px; margin: 2px auto;
  background: rgba(243, 217, 139, 0.10); border-radius: 8px; }
.ssb-thumb { position: absolute; left: 0; top: 0; width: 16px; background: var(--thumb);
  border-radius: 8px; cursor: grab; touch-action: none; }
.ssb-thumb:active { cursor: grabbing; }
/* The pinned Main Menu button takes the shared sidebar
   button rule (cleanup 4); in the sidebar's flex column its
   width is the stretch width between its own margins, not the
   class's 100%. */
#btn-main-menu { margin: 8px 10px 10px; width: auto; align-self: stretch; }
#main-panel { flex: 1; background: #000; overflow-y: auto; position: relative; }
#view-root { padding: 16px 18px 40px; max-width: 560px; margin: 0 auto; }
#view-root.panel-wide { max-width: 680px; }
#view-root.panel-full { max-width: none; }

/* ---------- Sidebar plate ---------- */
#plate { display: flex; gap: 10px; align-items: center; padding: 4px 2px 10px; }
#plate img.portrait { width: 69px; height: 69px; object-fit: cover; }
/* Portrait change triggers (cleanup 4, hub behaviour since
   2.1): the sidebar plate portrait and the Character sheet
   portrait are FRAMELESS buttons — the image itself is the
   button, opening the Change Portrait gallery. The button
   renders only while the character HAS a portrait (hub
   parity: no placeholder behaviour). */
.portrait-btn { padding: 0; border: 0; background: transparent; cursor: pointer;
  display: block; line-height: 0; flex: none; }
.portrait-btn:hover img, .portrait-btn:focus-visible img { filter: brightness(1.08); }
.portrait-btn:focus-visible { outline: 2px solid rgba(255, 214, 120, 0.85); outline-offset: 3px; }
#plate .pname { font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif; font-size: 22px; font-weight: 700; letter-spacing: 0.03em; color: #fdf6dd; }
#plate .plevel { color: var(--dim); font-size: 13px; margin-top: 2px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.level-bar { height: 8px; background: #0d1118; border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.level-bar > div { height: 100%; background: var(--gold); }
.level-bar > span { display: block; height: 100%; background: var(--gold); }
/* The shared LevelProgressBar (hub values, cleanup 11): a
   24px pill track (gold-tinted border, faint white fill) with
   the gold gradient fill, the progress text written ON the
   bar in white, and the NEXT level in a 32px gold-ringed
   circle at the right end. Used by the profession page,
   the All Professions cards and the skill detail XP bar;
   the plain 8px .level-bar above is unchanged. */
.lvlbar { display: flex; align-items: center; gap: 10px; }
.lvlbar-track { flex: 1; height: 24px; position: relative; border: 1px solid rgba(240,192,0,0.35);
  border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.lvlbar-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #b97f1e, #F2C41C);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.lvlbar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.65);
  font-variant-numeric: tabular-nums; pointer-events: none; }
.lvlbar-circle { flex: 0 0 32px; width: 32px; height: 32px; border: 2px solid #F2C41C; border-radius: 999px;
  background: rgba(0,0,0,0.45); display: inline-flex; align-items: center; justify-content: center;
  color: #F2C41C; font-size: 14px; font-weight: 800; }
.money-line { cursor: pointer; color: var(--gold-bright); font-size: 15px; margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  background: none; border: none; padding: 0; font-family: var(--sans); text-align: left; width: 100%; }
.coin-ic { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Sidebar sections ---------- */
.side-section { border-top: 1px solid var(--line); margin-top: 8px; }
/* Sidebar section headings (front-end cleanup 1, the hub's
   values): Cinzel 13px / 700 / uppercase / 0.14em on #f3d98b,
   and the collapse toggle is the hub's 28×28 box — gold-tinted
   border, 7px radius — carrying a minus glyph while the section
   is expanded and a plus while collapsed (the vertical stroke
   only renders under .closed). */
.side-head { width: 100%; background: none; border: none; color: #f3d98b;
  font-family: 'Cinzel', Georgia, serif; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; padding: 9px 2px 5px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.side-toggle { flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid rgba(240, 192, 0, 0.45);
  border-radius: 7px; background: rgba(255, 250, 235, 0.06);
  display: inline-flex; align-items: center; justify-content: center; }
.side-toggle svg { width: 16px; height: 16px; }
.side-toggle path { stroke: var(--gold-bright); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.side-toggle .tg-v { display: none; }
.side-section.closed .side-toggle .tg-v { display: block; }
.side-section.closed .side-body { display: none; }
.side-body { padding: 2px 0 8px; }

/* Vital rows (front-end cleanup 1, the hub's geometry; the
   icon size is cleanup 3's deliberate port-only revision —
   see the end of this comment): each entry is a label row
   over a full-width bar. The stat icon is absolutely
   positioned, frameless, overlapping the bar's left end; the
   label row is padded left for it and carries the abbreviation,
   then the amounts bold and right-aligned. On the AP row the
   BARE reset countdown sits centred between the two (no
   ellipsis clipping — the hub dropped the "Reset" prefix
   here because it overflowed onto the amounts). The bar is 8px
   with a gold-tinted border and runs behind the icon.
   Toxicity never renders as a row; while it is above 0 the
   Sustenance bar carries a green overlay segment (.vtox) and
   its maximum renders green via .toxmax. Temperature's lower
   element is the blue → white → red gauge with its marker.
   Values render exactly as delivered (never clamped here);
   the fill width is a display ratio only (the in-game fix
   pass's item C/E2 history stands: text first, no clipping).
   Cleanup 2: the row's text is the hub's system sans stack
   (labels and values), and the AP row's middle zone has a
   floor — the abbreviation and the amounts are flex:none and
   the countdown's zone can never shrink below 54px + its
   padding, so at the widest realistic values ("06:23:49"
   beside "1,000 / 1,000") the centred countdown keeps a clear
   gap and never touches the amounts.
   Cleanup 3 (user-directed, PORT-ONLY — an intentional
   divergence from the hub on this one measurement): cleanup 1
   transcribed the hub's icon at 125% of the entry's height,
   top −12.5%. A port entry is ≈35px tall (2px top padding +
   ≈17px label line + 3px bar margin + 8px bar + 5px bottom
   padding; Temperature ≈37px with its 10px gauge) and rows
   sit flush with no gap, so the 125% icon (≈44px, spanning
   ≈−4.4px to ≈+39.2px of its entry) spilled ≈4.4px into the
   rows above and below and consecutive icons collided. The
   icon now renders at exactly 100% of the entry's height,
   top 0: its box IS its entry's band, so no overlap of
   adjacent rows is possible, on the sidebar and on the
   Character sheet alike (both render through the one
   .vital-row rule). It stays frameless at left: 0 with
   width: auto (undistorted), still overlapping the bar's
   left end horizontally. For the game's square stat art the
   icon is now ≈35px wide, so the label pad went 58px → 46px
   (≈11px clearance) to keep the label attached to its icon;
   the rest of the label row is unchanged. */
.vital-row { position: relative; padding: 2px 0 5px; font-size: 14px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.vital-row .vicon { position: absolute; left: 0; top: 0; height: 100%; width: auto; z-index: 2; pointer-events: none; }
.vital-row .vlabel { display: flex; align-items: baseline; gap: 8px; padding-left: 46px; }
.vital-row .vname { color: var(--dim); flex: none; }
.vital-row .vnums { margin-left: auto; white-space: nowrap; font-weight: 700; flex: none; }
.vital-row .reset-cd { flex: 1 1 auto; min-width: 54px; padding: 0 4px; text-align: center; color: var(--dim); font-size: 12px; white-space: nowrap; }
.vital-row .vbar { position: relative; height: 8px; margin-top: 3px; background: #0d1118; border: 1px solid rgba(240, 192, 0, 0.4); border-radius: 4px; overflow: hidden; }
.vital-row .vbar .vfill { display: block; height: 100%; background: linear-gradient(90deg, #b97f1e, #F2C41C); }
.vital-row.vg-hp .vbar .vfill { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.vital-row.vg-mp .vbar .vfill { background: linear-gradient(90deg, #4f46e5, #6C6CE5); }
.vital-row.vg-ap .vbar .vfill { background: linear-gradient(90deg, #eab308, #FFD21F); }
.vital-row.vg-stm .vbar .vfill { background: linear-gradient(90deg, #15803d, #22c55e); }
.vital-row.vg-hyd .vbar .vfill { background: linear-gradient(90deg, #0e9a97, #12B5B0); }
.vital-row .vbar .vtox { position: absolute; top: 0; height: 100%; background: #4ADE80; }
.temp-gauge { position: relative; height: 10px; margin-top: 3px; border-radius: 5px; border: 1px solid rgba(240, 192, 0, 0.4); background: linear-gradient(90deg, #2563eb, #f8fafc, #dc2626); }
.temp-marker { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: #0b0e13; border: 1px solid #fdf6dd; border-radius: 2px; }
.toxmax { color: var(--green); font-weight: 700; }
.tox-tag { color: var(--green); font-weight: 700; white-space: nowrap; }
.clickable { cursor: pointer; }
.clickable:hover { background: rgba(255,255,255,.05); }

/* Buff/debuff cards (cleanup 12 — the hub's shared buff-row
   treatment): a flex-column shell; the name in the page sans
   at 14px semibold on its own row with the remaining time
   right-aligned, bold and tabular; a body row seating the
   buff's own 36px image (or the placeholder mark box) beside
   the text column — condition line, modifier parts line,
   then one icon line per special case. The sidebar variant
   takes the tighter padding, and the sidebar list is a flex
   column with an 8px gap (its rows carry no margin). */
.buff-row { display: flex; flex-direction: column; gap: 6px; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 12px; margin: 5px 0; background: rgba(255,255,255,0.05); font-family: var(--sans); }
.buff-row .bname { display: flex; align-items: baseline; gap: 8px; }
.buff-row .bname .btitle { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9); }
.buff-row .bdur { margin-left: auto; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.6); white-space: nowrap; }
.buff-row .bbody { display: flex; align-items: center; gap: 10px; }
.buff-row .buff-ic { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,0.2); flex: none; }
.buff-row .active-buff-mark { background: rgba(255,255,255,0.08); }
.buff-row .btext { flex: 1; min-width: 0; }
.buff-row .bcond { font-size: 12px; color: rgba(255,255,255,0.6); overflow-wrap: break-word; }
.buff-row .bmods { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; overflow-wrap: break-word; }
.buff-row .bline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; overflow-wrap: break-word; }
.buff-row .buff-case-ic { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,0.2); flex: none; }
.buff-row.inactive { opacity: .55; }
[data-body="buffs"] { display: flex; flex-direction: column; gap: 8px; }
[data-body="buffs"] .buff-row { margin: 0; padding: 6px 10px; }
.empty-note { color: var(--dim); font-size: 13px; padding: 2px; }

/* Sidebar buttons (front-end cleanup 4 — the hub's
   .game-side-button rule, inspection 349d36f6, transcribed):
   ONE bordered button treatment for the Screens buttons, the
   Professions rows (the port's separate .prof-row construction
   takes the same class), and the pinned Main Menu button.
   Before this batch the port's rows were borderless (no
   border, no background) and the selected screen showed as
   gold text only. The hub's selected state is
   aria-pressed="true" — a translucent gold wash, NOT a solid
   fill; the client emits aria-pressed on every sidebar button
   and keeps the .active class in sync alongside it (the view
   router's bookkeeping reads the class). */
.game-side-button { width: 100%; min-height: 46px; border: 1px solid rgba(240, 192, 0, 0.4);
  border-radius: 9px; background: rgba(255, 250, 235, 0.06); color: #fdf6dd;
  padding: 10px 14px; font-family: 'Cinzel', Georgia, serif; font-size: 15px;
  font-weight: 600; letter-spacing: 0.04em; cursor: pointer; text-align: left;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }
.game-side-button:hover, .game-side-button:focus-visible { border-color: rgba(240, 192, 0, 0.8);
  background: rgba(240, 192, 0, 0.16); color: #F2C41C; }
.game-side-button[aria-pressed="true"] { border-color: #F2C41C;
  background: rgba(240, 192, 0, 0.22); color: #F2C41C; }
/* The Screens list (and, by the same treatment, the
   Professions list) is a flex column with the hub's 10px gap;
   the collapsed-section display:none outranks these rules on
   specificity, so collapse behaviour is unchanged. */
.side-body[data-body="screens"], .side-body[data-body="professions"] { display: flex; flex-direction: column; gap: 10px; }
/* Hub 7.52: the CLASSES sidebar list takes the same flex column as Screens/Professions. */
.side-body[data-body="classes"] { display: flex; flex-direction: column; gap: 10px; }
.screen-row, .prof-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; position: relative; }
/* Screens button icons (cleanup 4, hub geometry): 36x36 with
   -6px vertical margins inside the 46px-minimum button; the
   Character button's portrait is a cover crop in a 5px-radius
   frame, every other icon is contained. */
.screen-row .side-ic { width: 36px; height: 36px; margin: -6px 0; flex-shrink: 0; }
.screen-row .side-ic.cover { object-fit: cover; border-radius: 5px; }
.screen-row .side-ic.contain { object-fit: contain; }
.prof-row img { width: 36px; height: 36px; margin: -8px 0; flex-shrink: 0; }
/* Hub 7.19: the profession rows' internal gap narrows to 8px
   so the longest name (Stoneworking) fits in full beside the
   level readout; the readout is "Lv. N" at the row's right
   edge, grey (the sidebar's white/60 muted tone) at 12px in
   every state — the name keeps the button's colour (gold when
   pressed). When the unspent-points badge rides the row, the
   readout gains a 24px right margin so it ends clear of the
   badge's footprint (4px offset + 18px wide). */
/* Room for the longest names (user, 2026-12-01: Weaponsmithing
   left its button): the rows take a 6px gap, 10px side padding
   and 14px type with tighter tracking, and the name span may
   shrink (min-width: 0) so a still-longer name wraps inside
   the button instead of spilling out of it. Supersedes the
   hub 7.19 8px gap, which was sized for Stoneworking. */
.prof-row { gap: 6px; padding-left: 10px; padding-right: 10px; font-size: 14px; letter-spacing: 0.02em; }
.prof-row .pname { min-width: 0; }
.prof-row .plvl { margin-left: auto; color: rgba(255, 255, 255, 0.6); font-size: 12px;
  white-space: nowrap; flex-shrink: 0; }
.prof-row .plvl.with-bang { margin-right: 24px; }
.bang { color: #fff; background: var(--red); border-radius: 50%; width: 17px; height: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; font-style: normal; flex: 0 0 17px; }
.screen-row .bang { margin-left: auto; }
/* Not-ready sidebar screens (Home, user 2026-11-30): the
   button stays visible but greyed out and inactive. */
.screen-row.not-ready { opacity: .45; cursor: default; }
.screen-row.not-ready .side-ic { filter: grayscale(1); }
/* All Items (user, 2026-11-30): the Inventory screen's
   All Items button row, the catalogue grid, and the
   Crafting Tree's component rows (buttons that walk the
   tree down into the component's own page). */
.all-items-row { margin: 10px 0 2px; }
.item-head { display: flex; align-items: center; gap: 10px; }
/* The item detail page's header icon runs at double the
   standard icon size (user, 2026-12-03). */
.item-head .item-ic { width: 68px; height: 68px; }
/* The detail page's Back button (component navigation,
   user 2026-12-03): a simple text button at the very top. */
.item-back { background: none; border: none; color: var(--gold, #e8b64c);
  cursor: pointer; font: inherit; padding: 0 0 8px; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, 110px); gap: 8px; margin-top: 10px; }
.ai-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 110px; height: 110px; padding: 8px 6px; text-align: center;
  background: var(--panel2, #171d29); border: 1px solid #232c3d; border-radius: 8px;
  color: inherit; cursor: pointer; font: inherit; }
.ai-card .ai-ic { width: 46px; height: 46px; object-fit: contain; }
.ai-card span { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tree-comp { width: calc(100% - 30px); background: none; border: none; border-bottom: 1px solid #232c3d;
  color: inherit; cursor: pointer; font: inherit; text-align: left; margin-left: 30px; }
/* All Items Reorder Mode (admin, user 2026-12-01): the
   gear in the header's upper right, and the draggable
   tile treatment while the mode is on. */
.ai-gear { margin-left: auto; align-self: flex-start; background: var(--panel2, #171d29);
  border: 1px solid #232c3d; border-radius: 8px; color: var(--dim); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 6px 9px; }
.ai-gear.active { color: var(--gold, #e8b64c); border-color: var(--gold, #e8b64c); }
/* The gear's tool menu (user, 2026-12-03): Reorder Mode and
   the no-known-source highlight are independent toggles
   behind the one gear. */
.ai-gear-wrap { position: relative; margin-left: auto; align-self: flex-start; }
.ai-gear-wrap .ai-gear { margin-left: 0; }
.ai-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--panel2, #171d29); border: 1px solid #232c3d; border-radius: 8px;
  padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 250px; }
.ai-menu[hidden] { display: none; }
.ai-menu button { background: none; border: none; color: inherit; cursor: pointer;
  font: inherit; text-align: left; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.ai-menu button:hover { background: rgba(255, 255, 255, .06); }
/* No-known-source highlight (user, 2026-12-03): the loose
   ends turn red so they can be tied up. */
.stat-row.stat-drag, .vital-row.stat-drag { cursor: grab; }
.stat-row.dragging, .vital-row.dragging { opacity: .45; }
.ai-card.no-source { border-color: #d33; background: rgba(211, 51, 51, .16); }
.ai-card.no-source span { color: #ff7b7b; }
.ai-card.reorder { cursor: grab; }
.ai-card.dragging { opacity: .45; }
/* Skill page Recipes list (user, 2026-12-01): every recipe
   of a 2+-recipe skill, seated between the detail rows and
   the use block. */
.recipe-block { border-top: 1px solid #232c3d; padding: 8px 2px; }
.recipe-name { font-weight: 700; margin-bottom: 2px; }

/* ---------- Banner / toasts ---------- */
#banner { background: #4a1420; border-bottom: 1px solid var(--red); color: #ffd7d9;
  padding: 10px 16px; font-size: 15px; position: sticky; top: 0; z-index: 30; }
#banner .rest-link, .dlg .rest-link { color: var(--gold-bright); font-weight: 700; text-decoration: underline; cursor: pointer; }
#toast-root { position: fixed; right: 14px; bottom: 14px; z-index: 80; display: flex;
  flex-direction: column; gap: 8px; max-width: min(360px, 90vw); }
.toast { background: var(--panel-2); border: 1px solid var(--gold); border-radius: 6px;
  padding: 9px 12px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.6); }

/* ---------- Generic view furniture ---------- */
.view-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
/* Screen panel head icon slot (cleanup 6): the hub's
   DoubleHeightHead — a square, frameless slot whose img fills
   it (absolute inset 0, contain). Its size is set by
   fitScreenHeads() in game.js: twice the rendered text block
   (title + subtitle), capped at 168px on desktop; on phone the
   title line only, 40px floor / 64px cap (see the 719px block).
   The 48px default below is the pre-measurement fallback (the
   old fixed view-head size). */
.panel-head-icon { position: relative; flex: none; align-self: center; aspect-ratio: 1 / 1;
  min-width: 40px; width: 48px; height: 48px; }
.panel-head-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Port wave: the panel-title role — the Skill detail's
   profession head (.prof-head-name: Cinzel 24px, weight 700,
   letter-spacing 0.03em, #fdf6dd), which the Quests panel
   title, the Location head and the Inventory head already
   carried; the remaining screen heads now join them. */
.view-head h2 { margin: 0; color: #fdf6dd; font-size: 24px; font-weight: 700; letter-spacing: 0.03em; }
.view-head .sub { color: var(--dim); font-size: 14px; }
/* Port wave: the lore control's icon-only seat (its markup is
   the book icon now, no .btn chrome). */
.lore-btn-icon { margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; padding: 4px; flex: none; align-self: center; }
/* Port wave: the description role — the Skill detail's
   .skill-desc (sans, 14px on a 24px line, white at 80%). */
.view-desc { white-space: pre-wrap; max-width: 70ch;
  font-family: var(--sans); font-size: 14px; line-height: 24px; color: rgba(255,255,255,0.80); }
/* Button standardization (2026-11-12, the user's
   directive): EVERY .btn renders as the hub's shared gold
   action button — the .eat-button spec below (flat
   translucent gold wash, gold Cinzel caps text, gold
   border) — so the interface's buttons all read as the
   Drink button does. The old port .btn (panel fill, white
   text) and its solid-gold .btn.gold are retired; the
   variant classes below survive as aliases on the unified
   base, and .btn.small / .btn.map-btn keep only their size
   and layout extras. Labels uppercase through the
   transform (the templates' short action labels read as
   the target's caps: DRINK, ACCEPT, EXPLORE). */
.btn { background: rgba(240, 192, 0, 0.16); color: #F2C41C;
  font-family: 'Cinzel', Georgia, serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; line-height: 1.3; border: 1px solid rgba(240, 192, 0, 0.7);
  border-radius: 8px; padding: 7px 14px; min-width: 56px; min-height: 38px;
  text-transform: uppercase; cursor: pointer; }
.btn:hover:not(:disabled), .btn:focus-visible:not(:disabled) { background: rgba(240, 192, 0, 0.3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; background: rgba(240, 192, 0, 0.05); }
@media (max-width: 560px) { .btn { min-width: 46px; min-height: 36px; padding: 6px 8px; font-size: 13px; } }
.btn.gold { background: rgba(240, 192, 0, 0.16); color: #F2C41C; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: rgba(240, 192, 0, 0.16); color: #F2C41C; }
.btn.greyed { filter: grayscale(.85); opacity: .5; }
.stam-short { color: #ffb3b5; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.mut { color: var(--dim); }
.gold { color: var(--gold-bright); }
.item-ic { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; }
.item-ic.sm { width: 20px; height: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Dialogs ---------- */
/* Scroll-aware centering: a dialog centers on the visible view
   when it fits (its auto margins absorb the overlay's free
   space) and the overlay scrolls when it runs taller than the
   view. Every dialog opens through openDialog — skill
   confirmations and results, and since hub 7.07 the Eat/Drink
   confirmations too (inventory Eat/Drink and container-contents
   Eat/Drink, slider forms included) — so they all center the
   same way. */
.dlg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 50;
  display: flex; overflow-y: auto; padding: 12px 10px; }
.dlg-overlay.high { z-index: 60; }
.dlg-overlay.shop { z-index: 70; }
/* The lore reading dialog scrolls with the shared custom
   scrollbar — the sidebar's language (24px, blue/gold arrows,
   solid #2F4D7D thumb) on the dialog's own #0d141b ground. */
.dlg-overlay.lore .dlg { scrollbar-color: var(--thumb) #0d141b; }
.dlg-overlay.lore .dlg::-webkit-scrollbar { width: 24px; }
.dlg-overlay.lore .dlg::-webkit-scrollbar-track { background: #0d141b; }
.dlg-overlay.lore .dlg::-webkit-scrollbar-thumb { background: var(--thumb); border: 2px solid #0d141b; border-radius: 12px; }
.dlg-overlay.lore .dlg::-webkit-scrollbar-button:single-button:vertical:decrement {
  background: #0d141b url('../assets/scrollbar_up.png') center / 20px no-repeat; height: 24px; }
.dlg-overlay.lore .dlg::-webkit-scrollbar-button:single-button:vertical:increment {
  background: #0d141b url('../assets/scrollbar_down.png') center / 20px no-repeat; height: 24px; }
.dlg { position: relative; margin: auto; background: #0d141b; border: 1px solid rgba(240, 192, 0, 0.45); border-radius: 10px;
  width: min(420px, 92%); padding: 18px 20px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.8); }
/* Hub 7.27/7.28: the skill waiting state — rendered as the
   sequence dialog's contents while an attempt is in flight
   (the confirmation dialog swapped in place, or a dialog in
   the same frame). One default animation for every skill:
   a gold spinner ring with a soft pulse, pure CSS, no image
   assets. A future per-skill animation replaces the
   .waiting-anim node's contents. */
.skill-waiting { text-align: center; padding: 18px 6px 10px; }
.waiting-text { font-size: 17px; color: #fdf6dd; margin: 0 0 14px; }
.waiting-anim { display: flex; justify-content: center; align-items: center; gap: 14px; }
/* Hub 7.31: the skill's own icon beside the spinner. */
.waiting-icon { width: 56px; height: 56px; object-fit: contain; }
.waiting-spinner { width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid rgba(240, 192, 0, 0.22); border-top-color: #F2C41C;
  animation: waiting-spin 0.85s linear infinite, waiting-pulse 1.7s ease-in-out infinite; }
@keyframes waiting-spin { to { transform: rotate(360deg); } }
@keyframes waiting-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 196, 28, 0); opacity: 1; }
  50% { box-shadow: 0 0 14px 2px rgba(242, 196, 28, 0.35); opacity: 0.75; } }
.dlg .ready-bang { position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; font-size: 15px; }
/* Port wave: the detail-title role — the Skill detail's
   display title (.skill-head-name: ui-serif, 24px, weight
   700, white). Dialog titles across the front end take it;
   the skill confirmation's own title keeps its centred 26px
   rule (.dlg h3.confirm-title below, the reference itself). */
.dlg h3 { margin: 0 0 10px; color: #fff; font-size: 24px; font-weight: 700;
  font-family: ui-serif, Georgia, 'Times New Roman', serif; }
.dlg .dlg-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.dlg .dlg-actions .spacer { flex: 1; }
/* Cleanup 15: the skill confirmation takes the hub's shape —
   a serif title-case title (the skill detail name's treatment,
   not the Cinzel caps of the shared .dlg h3), the produced
   item's image in a small rounded frame centred under the
   title, the label/value rows and component lines in the sans
   stack (the dialog otherwise inherits the body's serif), and
   the Use Skill / Cancel pair centred in that order. */
.dlg h3.confirm-title { font-family: ui-serif, Georgia, 'Times New Roman', serif;
  font-size: 26px; font-weight: 700; color: #fff; text-align: center; margin: 0 0 12px; }
.confirm-img { display: block; width: 104px; height: 104px; object-fit: contain;
  margin: 0 auto 4px; border: 1px solid rgba(240, 192, 0, 0.35); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); }
.confirm-body { font-family: var(--sans); }
.confirm-rows { margin-top: 12px; }
.dlg .dlg-actions.confirm-actions { justify-content: center; }
/* Quest Completed report (hub shape, user 2026-11-16): the
   completion sentence centers, and the received items sit
   under it as a centered row of icon chips. */
.dlg .quest-completed-msg { text-align: center; }
.dlg .quest-completed-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; }
.dlg .quest-chip { display: inline-flex; align-items: center; gap: 6px; }
.quest-chip { display: inline-flex; align-items: center; gap: 6px; }
/* Community Board (hub shape, user 2026-11-16): the Daily
   Bounties section under the screen head — blurb, amber
   status lines (acceptance + the at-cap announcement),
   and full bounty cards. */
.board-sec { border-top: 1px solid rgba(255,255,255,.08); margin-top: 18px; padding-top: 6px; }
.board-h { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 12px 0 6px; }
.board-blurb { line-height: 1.55; }
.board-note { color: #f3d27a; font-weight: 600; margin-top: 10px; }
.board-card-top { display: flex; align-items: flex-start; gap: 10px; }
.board-card-top .quest-row-title { flex: 1; min-width: 0; }
.board-desc { margin-top: 6px; line-height: 1.55; }
.board-line { margin-top: 4px; }
.eat-button:disabled { opacity: .45; cursor: default; }
/* Hub 7.11: the New Game dialog rides the shared overlay, but its
   panel is the auth-style .title-form, not the .dlg frame — so the
   frame chrome comes off and the form's own panel shows. */
.dlg-overlay.newchar .dlg { background: none; border: none; box-shadow: none;
  padding: 0; width: auto; max-height: none; overflow: visible; }
.title-form.in-dialog { margin-top: 0; }
/* Hub New Game panel width: min(560px, 94vw) — wider than the
   auth panels' min(430px, 92vw), scoped to this dialog only via
   the .dlg-overlay.newchar hook so login/signup keep 430px. */
.dlg-overlay.newchar .title-form { width: min(560px, 94vw); }
.portrait-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.portrait-cell { padding: 0; line-height: 0; cursor: pointer; border-radius: 8px;
  background: rgba(255, 250, 235, 0.08); border: 2px solid rgba(255, 226, 160, 0.25); }
.portrait-cell img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; }
.portrait-cell:hover { border-color: rgba(242, 196, 28, 0.8); }
.portrait-cell.sel { border-color: #F2C41C; box-shadow: 0 0 10px rgba(242, 196, 28, 0.75); }
/* Change Portrait overlay (cleanup 4, mirroring the hub's
   ChangePortraitOverlay): the wide panel (min(560px, 94vw),
   at most 90dvh tall) over a dimmed backdrop. Unlike the New
   Game picker above, this gallery has NO pre-selection and
   NO selected highlight — the hub deliberately passes no
   selectedPortraitId here, because a pick applies immediately
   (no confirm step) and Cancel simply closes. */
.dlg-overlay.portrait-pick { background: rgba(0, 0, 0, 0.6); }
.dlg-overlay.portrait-pick .dlg { width: min(560px, 94vw); max-height: 90dvh; }
.cp-title { font-family: 'Cinzel', Georgia, serif; font-size: 26px; font-weight: 700;
  letter-spacing: 0.04em; color: #fdf6dd; text-align: center; margin: 0 0 14px; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.cp-cell { padding: 0; line-height: 0; cursor: pointer; border: 2px solid rgba(240, 192, 0, 0.35);
  border-radius: 12px; background: rgba(255, 250, 235, 0.06); }
.cp-cell:hover { border-color: rgba(240, 192, 0, 0.8); }
.cp-cell img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; display: block; }
.cp-actions { display: flex; justify-content: center; margin-top: 16px; }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row output { min-width: 90px; text-align: right; font-size: 16px; }

/* Results dialog (hub 7.01 shape) */
.result-img { display: block; margin: 0 auto 8px; max-width: 160px; max-height: 160px; }
.outcome { text-align: center; font-size: 22px; font-weight: 900; margin: 4px 0 8px; }
.outcome.ok { color: var(--green); }
.outcome.bad { color: var(--red); }
/* Port wave: gain rows take the reference's body role
   (sans 14px) instead of the old inherited serif at 15.5px. */
.gain-line { display: flex; align-items: center; gap: 8px; padding: 3px 0;
  font-family: var(--sans); font-size: 14px; }
/* Hub 7.16: wherever an item name renders together with a "× n"
   quantity suffix, the name and the suffix are SEPARATE elements —
   the name truncates with an ellipsis inside its own flex space
   (.nm) and the suffix (.qty-sfx) is a non-shrinking element that
   is always fully visible. .nm-line turns a name/suffix group into
   a flex row; .contents-line and .inv-target are the same split
   for filled-container contents lines and quest item chips. */
.nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty-sfx { flex: none; white-space: nowrap; }
.nm-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.contents-line { display: flex; align-items: center; gap: 6px; }
.inv-target { display: flex; align-items: center; gap: 5px; min-width: 0; }
.paid-line { text-align: center; color: var(--dim); margin: 8px 0; }
/* Results dialog (2026-11-11, hub parity from the user's
   side-by-side): the results are centred — gain rows centre
   as a group, item names bold, gain icons take the framed
   34px treatment; "Go to Skill" is an underlined gold link;
   OK is a centred gold-outline button. Scoped to
   .results-dlg so no other dialog moves. */
.results-dlg .gain-line { justify-content: center; }
.results-dlg h4 { text-align: center; }
/* The embedded level-up block centres like the rest of
   the dialog (user cleanup, 2026-11-13): icon over text,
   stacked and centred, instead of the side-by-side
   left-anchored block. */
.results-dlg .levelup-block { flex-direction: column; justify-content: center; text-align: center; }
.results-dlg .levelup-block [data-gotoskill] { margin-left: auto; margin-right: auto; }
.results-dlg .gain-line .nm { font-weight: 700; }
.results-dlg .gain-line img.item-ic { width: 34px; height: 34px;
  border: 1px solid rgba(240, 192, 0, 0.35); border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); }
.linklike { background: none; border: none; padding: 0; color: var(--gold);
  font: inherit; text-decoration: underline; cursor: pointer; }
/* Button standardization (2026-11-12): the dialog pair
   collapses onto the unified .btn — the cancel's grey
   border and the ok's bare outline are gone; both keep
   only their shared 130px seat width. */
.btn.dlg-ok { min-width: 130px; }
.btn.dlg-cancel { min-width: 130px; }
.levelup-block { display: flex; gap: 12px; align-items: center; background: var(--panel-2);
  border: 1px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.levelup-block img.prof-ic { width: 96px; height: 96px; object-fit: contain; flex: 0 0 96px; }
/* The queued level-up popup centers its content (user
   directive 2026-11-13, hub as reference): the block
   stacks its icon over the text, centered, and the
   actions row centers with it — the spacer is dropped
   in this scope. The inline results rendering keeps the
   side-by-side block untouched. */
.dlg-overlay.levelup-ov .levelup-block { flex-direction: column; justify-content: center; text-align: center; }
.dlg-overlay.levelup-ov .levelup-block [data-gotoskill] { margin-left: auto; margin-right: auto; }
.dlg-overlay.levelup-ov .dlg-actions { justify-content: center; }
.dlg-overlay.levelup-ov .dlg-actions .spacer { display: none; }
.discovered-line { background: #12303a; border: 1px solid var(--cyan); color: #bfeef5;
  border-radius: 6px; padding: 8px 12px; margin: 10px 0; text-align: center; }
.discovery-icon { display: block; margin: 6px auto 0; max-width: 96px; max-height: 96px;
  object-fit: contain; }

/* ---------- Location ---------- */
/* Hub: the header section is a FIXED height (256px; 300px at
   <=560px wide) and the selected-cell details scroll internally,
   so the map never shifts when the selection changes. */
.loc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; height: 256px; }
@media (max-width: 560px) { .loc-head { height: 300px; } }
.loc-head-left { display: flex; gap: 12px; align-items: center; min-height: 0; }
/* Port wave (g) — user-approved fold-in: the legacy
   .loc-head-left img rule (a fixed 56px square) that stood
   here is REMOVED. Cleanup 14's note below once claimed
   the fitted slot's img rule "outranks" it — that was wrong
   as a matter of cascade: .loc-head-left img and
   .panel-head-icon img have EQUAL specificity (0,1,1) and the
   legacy rule came LATER, so it won, pinning the Location
   head's artwork at 56px (40px on phone, from the same legacy
   rule's ≤719px sibling — also removed) while fitScreenHeads
   sized the slot itself to the DoubleHeightHead dimensions.
   With both legacy rules gone, the shared slot rule
   (.panel-head-icon img — absolute inset 0, 100% × 100%,
   object-fit: contain, above) governs the Location head like
   every other screen's. The only other img under
   .loc-head-left, the standing Location's row icon, carries
   its own .item-ic sizing and never relied on the legacy
   rule. */
/* Cleanup 14: the head is the Location Screen record's head
   (the shared .view-head / DoubleHeightHead treatment — the
   record's artwork rides the fitted .panel-head-icon slot).
   The title takes the panel-title treatment (cleanup 13's
   values): cream Cinzel. */
.loc-head .view-head { margin-bottom: 0; }
.loc-head-left h2 { margin: 0; color: #fdf6dd; font-family: 'Cinzel', Georgia, serif;
  font-size: 24px; font-weight: 700; letter-spacing: 0.03em; }
.loc-head-left .sub { color: var(--dim); font-size: 14px; }
/* Current-location block (this batch): the .loc-head left
   column stacks the view-head block over the standing cell's
   Location block (icon + name + Go button, then the
   "You are now in ..." line). */
.loc-head-col { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 0; }
.loc-current-row { display: flex; align-items: center; gap: 8px; }
.loc-current-name { font-weight: 700; color: var(--text); }
.loc-current-line { color: var(--dim); font-size: 14px; margin-top: 4px; }
.loc-current [data-act] { margin: 3px 4px 3px 0; white-space: normal; }
.cell-details { border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 10px 12px; overflow-y: auto; min-height: 0; }
/* Cell-details custom scrollbar: same language as the sidebar
   (24px, blue/gold arrows, solid #2F4D7D thumb). */
.cell-details::-webkit-scrollbar { width: 24px; }
.cell-details::-webkit-scrollbar-track { background: var(--panel); }
.cell-details::-webkit-scrollbar-thumb { background: var(--thumb); border: 2px solid var(--panel); border-radius: 12px; }
.cell-details::-webkit-scrollbar-button:single-button:vertical:decrement {
  background: var(--panel) url('../assets/scrollbar_up.png') center / 20px no-repeat; height: 24px; }
.cell-details::-webkit-scrollbar-button:single-button:vertical:increment {
  background: var(--panel) url('../assets/scrollbar_down.png') center / 20px no-repeat; height: 24px; }
.cell-details { scrollbar-color: var(--thumb) var(--panel); }
.cell-details h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.cell-details .btn { margin: 3px 4px 3px 0; white-space: normal; }
/* Cleanup 14: the panel's action buttons (every one carries
   data-act) keep the same spacing under the gold treatment. */
.cell-details [data-act] { margin: 3px 4px 3px 0; white-space: normal; }
/* The movement cost line sits inline after its button; keep a
   gap before whatever follows it (Atlas walk, 2026-11-15: the
   line ran tight into the next section button). */
.cell-details .travel-cost { margin-right: 8px; }
/* Cleanup 14: the panel's state lines ("Explored" / "You are
   here.") and its section heading ("Gathering"). */
.cell-line { font-size: 13px; color: rgba(255, 255, 255, .75); margin: 0 0 2px; }
.cell-sec { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6); margin: 8px 0 4px; }
.loc-map-wrap { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000;
  height: max(320px, calc(100dvh - 360px)); position: relative; cursor: grab; touch-action: none;
  min-width: 0;
  -webkit-user-drag: none; user-select: none; }
.loc-map-wrap:active { cursor: grabbing; }
/* Cleanup 14: no cover-fit background — the area image is an
   <img class="loc-map-img"> seated by mapImageRect (game.js),
   registered to the hex grid; the controls sit bottom-right
   over the wrap, clear of the pan/zoom surface. */
.loc-map { position: relative; margin: 0 auto; transform-origin: 0 0; }
.loc-map-img { position: absolute; pointer-events: none; }
/* Tile map canvas (front-end tile maps, 2026-11-18). */
.loc-tile-canvas { display: block; }
.loc-map-controls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 6; }
.loc-map-controls .map-btn.wide { width: auto; min-width: 42px; padding: 0 10px; font-size: 14px; }
.loc-map.grid-hidden .hex { outline: none; box-shadow: none; }
.loc-map.grid-hidden .hex-border, .loc-map.grid-hidden .hex-selected { display: none; }
.hex { position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  display: flex; align-items: center; justify-content: center; }
.hex.fog-adj { background: rgba(0,0,0,.9); }
.hex.fog-far { background: #000; }
.hex.fog-rim { pointer-events: none; }
.hex.explored { background: transparent; }
.hex:hover { outline: 1px solid rgba(255,255,255,.35); }
.hex-border { position: absolute; pointer-events: none; }
/* Cleanup 14 fix: the hub's current-cell marker is a THIN
   cyan edge drawn INSIDE the hex with a faint blue cover over
   the cell — the old rule (stroke-width 4 in the 100-unit
   viewBox, no fill) rendered ~8px of bare stroke straddling
   the hex edge at field sizes. The polygon points are inset
   in game.js to match. Cleanup 15: the fill is aligned to the
   hub 7.44 overlay value rgba(34, 211, 238, 0.12) exactly
   (was rgba(55, 200, 217, .13) — the same cyan family, now
   the hub's number). */
.hex-border polygon { fill: rgba(34, 211, 238, 0.12); stroke: var(--cyan); stroke-width: 1.1; }
/* Cleanup 15 (hub 7.44): the selected cell's marker — the
   same inset hex construction in orange, fill
   rgba(249, 115, 22, 0.12), stroke #f97316. It replaces the
   old solid-gold .hex.selected-ring slab that hid the
   terrain; game.js emits it BEFORE the current-cell border
   so a cell that is both selected and current shows the
   cyan treatment on top. */
.hex-selected { position: absolute; pointer-events: none; }
.hex-selected polygon { fill: rgba(249, 115, 22, 0.12); stroke: #f97316; stroke-width: 1.1; }
.gather-btn.on-cooldown { filter: grayscale(1); }

/* ---------- Character / professions ---------- */
.char-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.char-portrait { width: 170px; height: 170px; object-fit: cover; flex: 0 0 170px; }
/* Port wave: the panel-title role (see .view-head h2). */
.char-head h2 { margin: 0; color: #fdf6dd; font-size: 24px; font-weight: 700; letter-spacing: 0.03em; }
.char-head .sub { color: var(--dim); font-size: 14px; }
/* Port wave: the section-label role — the Skill detail's
   .section-label (sans, 12px, weight 700, uppercase,
   letter-spacing 0.14em, white at 60%) — for the Character
   screen's stat-group headings, replacing the old gold
   Cinzel treatment. FLAGGED in the wave deploy note as a
   closest-role mapping (the reference screen has no stat
   groups of its own), reversible on request. */
.stat-group h3 { font-family: var(--sans); color: rgba(255,255,255,0.60);
  letter-spacing: 0.14em; font-size: 12px; font-weight: 700;
  text-transform: uppercase; margin: 16px 0 6px; }
.stat-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px solid #232c3d; font-size: 15px; }
.stat-row img { width: 20px; height: 20px; }
.stat-row .sname { flex: 1; }
.stat-row .sval { font-weight: 700; }
/* Cleanup 7 — the Character sheet's stat-row format (the hub's
   one format for every sheet group): a 28px rounded icon, the
   name truncated into its own flex space, and the amber
   abbreviation pill beside it. Scoped to sheet rows so the
   skill-detail .stat-row lines keep their 20px icons. */
.stat-row.sheet-stat img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.stat-row.sheet-stat .sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abbr-pill { flex: none; border-radius: 999px; background: rgba(255, 255, 255, 0.1); padding: 2px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .025em; color: #fde68a; white-space: nowrap; }
/* Cleanup 7 — the sheet's vital rows: the icon sits IN FLOW at
   28px rounded inside its trigger wrapper (the sidebar's
   absolute, row-height icon treatment is untouched — a
   separate modifier class carries these overrides), the label
   row loses its sidebar icon pad, and the name never truncates
   (the hub's vital-row rule). */
.vital-row.sheet .vlabel { padding-left: 0; align-items: center; }
.vital-row.sheet .svicon { display: inline-flex; flex: none; line-height: 0; }
.vital-row.sheet .vicon { position: static; width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.vital-row.sheet .sname { flex: none; white-space: nowrap; font-size: 15px; }
.vital-row.sheet [data-tip-stat], .vital-row.sheet [data-tip-tox],
.stat-row.sheet-stat [data-tip-stat] { cursor: help; }
/* Cleanup 7 — the stat description tooltip: one fixed box,
   stat name as its heading, the configured Description as its
   body (multi-line in full). Clicks pass through it; dismissal
   is the wiring's pointer-down / Escape rule. */
.stat-tip { position: fixed; z-index: 90; max-width: 300px; padding: 10px 12px; pointer-events: none;
  background: #141a26; border: 1px solid rgba(240, 192, 0, 0.45); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-family: var(--sans); }
.stat-tip-title { font-weight: 700; color: var(--gold-bright); font-size: 14px; margin-bottom: 4px; }
.stat-tip-body { font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
/* Hub 7.30: a sheet stat value whose AP-tick application is
   altered by an active debuff renders red, and its tooltip
   names each altering debuff under the description. */
.sval.tick-altered, .vnums.tick-altered { color: #fca5a5; }
.stat-tip-alters { font-size: 13px; line-height: 1.45; color: #fca5a5; }
.stat-tip-alters:not(:empty) { margin-top: 4px; }
/* Hub 7.31: component status lines under the skill-use
   control. Cleanup 11: the seat in the skill detail's costs
   column takes the hub's in-column sizing (12px lines, 20px
   icons); the Screen skill panel keeps the original sizing
   (.in-panel) — its seat under the Use button is unchanged. */
.comp-statuses { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
/* Results dialog (user, 2026-12-01): the component status
   lines beside the Try Again button, left-aligned in the
   actions row. */
.retry-comps { text-align: left; }
/* The cooled-down success's faded Try Again (user,
   2026-12-03): the button and its daily-reset note stack
   in a small column inside the actions row, so the note
   tucks under the button while OK stays on its line. */
.again-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.again-note { font-size: 12px; color: rgba(255, 255, 255, 0.70); text-align: left; }
/* Results button pairs (user, 2026-12-04): Try Again and OK
   are the exact same size, next to each other — OK's 130px
   minimum otherwise leaves it wider than Try Again, and the
   row's stretch alignment makes it taller than the wrapped
   Try Again + note column. Each takes half the row; OK aligns
   to the top so its height matches the button's, and the note
   stays tucked under Try Again. */
.again-wrap { flex: 1 1 0; }
.again-wrap .btn { width: 100%; }
.again-wrap + .dlg-ok { flex: 1 1 0; align-self: flex-start; }
.dlg-actions [data-retry] { flex: 1 1 0; }
.dlg-actions [data-retry] + .dlg-ok { flex: 1 1 0; }
.comp-status { display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: rgba(255,255,255,0.70); font-variant-numeric: tabular-nums; }
.comp-status .comp-ic { width: 20px; height: 20px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.20); }
.comp-status.missing { color: #f87171; font-weight: 600; }
.comp-status.comp-link { background: none; border: 0; padding: 0; font: inherit;
  color: inherit; cursor: pointer; text-align: left; }
.comp-status.comp-link:hover { text-decoration: underline; }
.comp-statuses.in-panel { gap: 0; }
.comp-statuses.in-panel .comp-status { padding: 2px 0; font-size: 15px; color: var(--text);
  font-variant-numeric: normal; }
.comp-statuses.in-panel .comp-status .comp-ic { width: 20px; height: 20px; border-radius: 6px;
  object-fit: contain; box-shadow: none; }
.comp-statuses.in-panel .comp-status.missing { color: var(--red); font-weight: 400; }
/* Button standardization (2026-11-12): the plus seat
   keeps its compact 24px circle geometry (the unified
   spec's padding/min-height would wreck the stat row) but
   takes the standard's colours — gold wash, gold border,
   gold glyph — in place of the solid fill. */
.stat-row .plus-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(240, 192, 0, 0.7);
  background: rgba(240, 192, 0, 0.16); color: #F2C41C; font-weight: 900; line-height: 1; cursor: pointer; }
.skill-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid #232c3d; color: var(--text);
  padding: 6px; font-size: 15px; position: relative; }
.skill-row:hover { background: rgba(255,255,255,.05); }
.skill-row img { width: 26px; height: 26px; }
.skill-row .grow { flex: 1; }
/* All Professions index (hub 7.17): the whole card navigates to
   the profession's page; its skills sit behind the card's own
   maximize toggle — the cleanup-1 toggle box, showing a plus
   while the skills are collapsed and a minus while they are
   open (the sidebar's own sections run the same glyph the other
   way, keyed on .closed). */
.prof-skills { margin-top: 8px; }
#sec-professions .side-title { cursor: pointer; }
.xp-bar { height: 6px; background: #0d1118; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.xp-bar > div { height: 100%; background: #7d9c46; }
.bonus-line { font-size: 13.5px; color: var(--dim); padding-left: 34px; }

/* ---------- Inventory ---------- */
/* Inventory header (cleanup 4): the Carry Capacity icon —
   the same icon the sidebar Inventory button carries (the
   hub's rule for both) — sits left of the title + weight
   lines. Cleanup 6: the icon now sits in the shared
   .panel-head-icon slot and is sized by the hub's
   DoubleHeightHead rule (twice the text block, 168px cap;
   title-line only on phone), superseding cleanup 4's fixed
   two-line height. Before cleanup 4 the header showed the
   Inventory Screens record's own icon at the generic 48px
   view-head size and the weight line sat below the coins
   section. Cleanup 8: the title takes the hub's
   .game-panel-title values (Cinzel 24px/700, #fdf6dd,
   letter-spacing 0.03em, title case — not the port's all-caps
   gold), and the line beneath reads "WEIGHT {carried} /
   {capacity}": a small muted WEIGHT label, white tabular
   numbers. */
.inv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.inv-head h2 { margin: 0; color: #fdf6dd; font-size: 24px; font-weight: 700; letter-spacing: 0.03em; }
.inv-head .sub { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.inv-head .sub .wlabel { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: rgba(245, 238, 218, 0.6); }
.inv-head .lore-btn { margin-left: auto; font-size: 17px; line-height: 1; padding: 5px 9px; }
/* Cleanup 8: the whole Inventory screen renders in the hub's
   sans stack (transcribed verbatim, as cleanup 6 did for the
   Equipment panel); Cinzel survives only on the panel title
   and the .eat-button actions. Before this batch the screen
   inherited the port's Georgia body serif for item names. */
.inv-screen { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
/* Cleanup 8: the hub's .coins-section — a bordered panel
   (replacing the port's one-line coin bar): the COINS label,
   EVERY denomination with its coin icon (zeros included),
   then the carried/capacity line. */
.coins-section { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); padding: 10px 12px; margin: 8px 0; }
.coins-label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(245, 238, 218, 0.6); }
.coins-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px;
  font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
.coins-capacity { font-size: 13px; color: rgba(245, 238, 218, 0.65); margin-top: 4px; }
.inv-math { font-size: 12px; color: rgba(245, 238, 218, 0.55); margin-top: 2px; }
/* Consume confirmation (2026-11-12, hub layout): the From
   line centred under the framed image, the How-many line
   over a full-width slider, and the effect rows — stat icon
   + name left, value right-aligned and bold. */
.consume-from { text-align: center; margin: 6px 0 2px; }
.consume-how { font-weight: 700; margin: 12px 0 4px; }
.consume-slider input[type="range"] { flex: 1 1 auto; width: 100%; }
.consume-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-family: var(--sans); }
.consume-row img.consume-ic { width: 22px; height: 22px; }
.consume-row .consume-val { margin-left: auto; font-weight: 700; }
/* Cleanup 8: the hub's inventory grid — ITEM / WEIGHT column
   headers over rows laid out as minmax(0,1fr) 58px 72px
   (name cell / weight / actions), replacing the port's slate
   flex cards. The weight is its own right-aligned column
   (.inv-num: 14px/700 tabular white, no "Weight" prefix);
   durability and the EQUIPPED marker are small sub-lines
   under the name. */
.inv-grid-head, .inv-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px 72px; gap: 8px; align-items: center; }
.inv-grid-head { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); padding: 0 12px; margin: 12px 0 4px; }
.inv-grid-head .inv-wh { text-align: right; }
.inv-row { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
  background: rgba(255, 255, 255, 0.05); padding: 8px 12px; margin: 7px 0; cursor: pointer; }
.inv-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inv-main .inv-ic { flex: none; }
.inv-txt { flex: 1; min-width: 0; }
.inv-row .iname { display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 15px; font-weight: 700; color: #fff; }
.inv-row .qty-sfx { color: rgba(255, 255, 255, 0.6); font-size: 13px; font-weight: 600; }
.inv-sep { color: rgba(255, 255, 255, 0.4); flex: none; }
.inv-row .imeta { color: rgba(255, 255, 255, 0.6); font-size: 12.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.inv-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: #fff; }
.inv-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
/* Variable-durability grouping (2026-11-16): the expanded
   stacks indent under their group row; the expand/minimize
   button keeps a steady square shape. */
.inv-row.inv-sub { margin-left: 18px; }
.inv-expand { min-width: 42px; font-weight: 700; }
/* Item Details: the skill buttons collapse behind the
   "Used by skills" toggle (2026-11-16). */
.use-skills { margin-top: 10px; }
.use-skills-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.use-skills-list[hidden] { display: none; }
/* One skill per line, icon first (user, 2026-11-17). */
.use-skill-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
/* Cleanup 8: the equipped marker is a small GOLD uppercase
   sub-line (was cyan, with a "(Main Hand)" suffix). */
.equipped-tag { color: #F2C41C; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; margin-top: 2px; }
/* Cleanup 8 phone: the grid columns tighten at <=560px (the
   .eat-button phone rule by the Equipment panel applies to
   this screen's buttons too). */
@media (max-width: 560px) {
  .inv-grid-head, .inv-row { grid-template-columns: minmax(0, 1fr) 46px 64px; }
  .inv-grid-head { padding: 0 10px; }
  .inv-row { padding: 8px 10px; }
}

/* ---------- Equipment ---------- */
/* Cleanup 5: the stage is the bundled paper-doll art
   (assets/paper_doll.png), width 100% capped at 560px with its
   natural aspect — never the Equipment Screen record's image,
   which is only the header icon (in the shared panel-head
   slot since cleanup 6 — see .panel-head-icon). Frames carry
   the hub's exact rectangles (% of the stage); an occupied
   frame covers the art's baked-in pictogram with a chamfered
   #161c20 panel inset 9% and centres the item icon over it at
   max 76%; an empty frame renders nothing inside. */
.equip-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
/* Port wave: the panel-title role (see .view-head h2). */
.equip-head h2 { margin: 0; color: #fdf6dd; font-size: 24px; font-weight: 700; letter-spacing: 0.03em; }
.equip-head .sub { color: var(--dim); font-size: 14px; }
.equip-head .lore-btn { margin-left: auto; font-size: 17px; line-height: 1; padding: 5px 9px; }
.equip-stage { position: relative; width: min(560px, 100%); margin: 0 auto; }
.equip-doll { display: block; width: 100%; height: auto; }
.equip-frame { position: absolute; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.equip-frame:hover { background: rgba(255, 255, 255, 0.15); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); }
.equip-frame.selected { background: rgba(252, 211, 77, 0.25); box-shadow: 0 0 0 2px #FCD34D; }
.equip-frame.inert { cursor: default; }
.equip-cover { position: absolute; inset: 9%; background: #161c20;
  clip-path: polygon(16% 0%, 84% 0%, 100% 16%, 100% 84%, 84% 100%, 16% 100%, 0% 84%, 0% 16%); }
.equip-ic { position: relative; max-width: 76%; max-height: 76%; object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); pointer-events: none; }
/* Selected-frame panel (cleanup 5): hub shape — rounded panel,
   frame-label heading with the " · Equips To: {slot}" span, the
   occupied block, then the always-present Equip section. */
/* Cleanup 6 typography: everything in the panel and the
   candidate rows renders in the hub's body SANS stack — serif
   survives only on the frame h3 and the Equip/Unequip buttons
   (.eat-button below). Before this batch the panel inherited
   the port's Georgia body serif. */
.equip-panel { margin-top: 16px; background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 16px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.equip-panel h3 { font-family: 'Cinzel', Georgia, serif; font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.equip-to { font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 0.6); }
.equip-occ { display: flex; gap: 12px; align-items: flex-start; }
.equip-occ .grow { flex: 1; }
.equip-occ-ic { width: 56px; height: 56px; object-fit: cover; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2); flex: none; }
.equip-name { font-weight: 600; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.equip-mods { font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.equip-mods.none { color: rgba(255, 255, 255, 0.5); }
.equip-dmg { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.6); }
.equip-dur { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.6); }
.equip-cmp { font-size: 12px; }
/* Cleanup 6 colour coding, scoped to the panel: comparison
   delta spans and the equipped item's own modifier spans are
   semibold emerald / red in the hub's exact tones (NOT the
   port's --green / --red, which stay for other screens); a
   damage change whose sums are equal reads white at 80%. Zero
   per-stat deltas are omitted by the renderer, never shown. */
.equip-panel .delta-up { color: #6ee7b7; font-weight: 600; }
.equip-panel .delta-down { color: #fca5a5; font-weight: 600; }
.equip-panel .delta-flat { color: rgba(255, 255, 255, 0.8); font-weight: 600; }
.equip-nochg { color: rgba(255, 255, 255, 0.5); }
.equip-h { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.6); margin: 14px 0 8px; }
.equip-none { font-size: 14px; color: rgba(255, 255, 255, 0.6); margin: 4px 0; }
.equip-cand { display: flex; gap: 12px; align-items: flex-start; background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 8px 12px; margin: 7px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.equip-cand .grow { flex: 1; }
.equip-cand .qty-sfx { color: rgba(255, 255, 255, 0.6); font-size: 14px; font-weight: 600; }
/* The hub's .eat-button cooldown variant (cleanup 11): the
   grey treatment for a disabled use control whose gate is a
   cooldown or a component shortfall — it overrides the plain
   disabled dimming, hover included. */
.eat-button.eat-button-cooldown, .eat-button.eat-button-cooldown:disabled,
.eat-button.eat-button-cooldown:hover:not(:disabled), .eat-button.eat-button-cooldown:focus-visible:not(:disabled) {
  border-color: rgba(156,163,175,0.55); background: rgba(156,163,175,0.14); color: #9CA3AF; opacity: 1; }

/* ---------- Cleanup 11: Professions + Skill detail ---------- */
/* The hub's .secondary-button (both Back buttons). */
.secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 16px; border-radius: 9px; font-size: 14px; font-weight: 750;
  border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--btn-text);
  cursor: pointer; margin-bottom: 16px; font-family: var(--sans); }
.secondary-button:hover { background: #343829; }
/* The hub's .game-panel shell for the profession / skill
   surfaces (the view column itself caps at 560px). */
.game-panel { border: 1px solid rgba(255,255,255,0.18); border-radius: 12px;
  background: rgba(255,255,255,0.04); padding: 20px; margin: 10px 0; }
/* Section labels ("Skills", "Upgrade Options"). */
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.60); font-family: var(--sans); }
.empty-note { font-size: 14px; color: rgba(255,255,255,0.70); margin-top: 8px; font-family: var(--sans); }
/* Profession page header: frameless DoubleHeight icon, Cinzel
   name, two-line-clamped description. */
.prof-head { display: flex; align-items: stretch; gap: 14px; margin-bottom: 14px; overflow: hidden; }
.prof-head-icon { align-self: flex-start; }
.prof-head-text { flex: 1; min-width: 0; }
.prof-head-name { font-family: 'Cinzel', Georgia, serif; font-size: 24px; font-weight: 700;
  letter-spacing: 0.03em; color: #fdf6dd; margin: 0 0 6px; }
.prof-head-desc { font-size: 14px; line-height: 20px; color: rgba(255,255,255,0.70);
  font-family: var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prof-full-desc { font-size: 14px; line-height: 24px; color: rgba(255,255,255,0.80);
  margin: 0 0 16px; font-family: var(--sans); }
/* The page's bonus lines take the CARD indentation
   (cleanup 11, as redirected: the page matches the cards). */
.prof-bonus-line { margin-top: 4px; margin-left: 20px; font-size: 14px; color: rgba(255,255,255,0.70); font-family: var(--sans); }
.prof-bonus-ic { width: 22px; height: 22px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2); display: inline-block;
  margin-right: 8px; vertical-align: -6px; }
/* Profession page skill list — the rows themselves take the
   cards' expanded-row treatment (.pcard-skill-* classes). */
.prof-skill-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.bang.lg { width: 20px; height: 20px; font-size: 13px; font-weight: 800; background: #d92d20; flex: none; }
/* The page rows seat the badge beside the level text. */
.pcard-skill-top .bang.lg { margin-left: 8px; }
/* All Professions index cards (their own rendering). */
.pcard { position: relative; border: 1px solid rgba(255,255,255,0.14); border-radius: 12px;
  background: rgba(255,255,255,0.04); padding: 14px 16px; margin: 10px 0; cursor: pointer; }
.pcard:hover { background: rgba(255,255,255,0.08); border-color: rgba(240,192,0,0.45); }
.pcard .prof-toggle { position: absolute; top: 10px; right: 10px; padding: 0; cursor: pointer; }
.pcard .prof-toggle .tg-v { display: block; }
.pcard .prof-toggle.open .tg-v { display: none; }
.pcard .prof-skills { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
/* The display:flex above would override the hidden
   attribute's UA display:none, leaving the card's skills
   permanently visible and the maximize/minimize toggle
   dead (user report, 2026-11-20) — the same guard the
   other toggled boxes (.ssb, .use-skills-list) carry. */
.pcard .prof-skills[hidden] { display: none; }
.pcard-head { display: flex; align-items: center; gap: 10px; }
.pcard-ic { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.pcard-name { font-family: 'Cinzel', Georgia, serif; font-size: 20px; font-weight: 700; color: #fdf6dd; }
.pcard-level { margin-left: 8px; font-size: 15px; font-weight: 400; color: rgba(255,255,255,0.6);
  font-family: var(--sans); }
.pcard-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.75);
  font-family: var(--sans); }
.pcard .lvlbar { margin-top: 10px; }
.pcard-prog-line { margin-top: 8px; font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,0.85); font-family: var(--sans); }
.pcard-bonus-line { margin-top: 4px; margin-left: 20px; font-size: 14px;
  color: rgba(255,255,255,0.7); font-family: var(--sans); }
.pcard-skill-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 10px;
  background: rgba(255,255,255,0.05); padding: 8px 10px; color: var(--text); cursor: pointer;
  font-family: var(--sans); }
.pcard-skill-row .grow { flex: 1; min-width: 0; }
.pcard-skill-ic { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; }
.pcard-skill-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  background: none; border: none; padding: 0; color: inherit; font: inherit;
  text-align: left; cursor: pointer; }
.pcard-skill-row.is-locked .pcard-skill-main { opacity: .5; filter: grayscale(.55); }
.skill-unlock-btn { display: inline-flex; align-items: center; gap: 6px; flex: none;
  margin-left: 10px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7); font-family: var(--sans); font-size: 12.5px;
  font-weight: 600; cursor: pointer; }
.skill-unlock-btn:disabled { opacity: .5; cursor: default; }
.skill-unlock-btn:not(:disabled) { border-color: rgba(240,192,0,0.6);
  color: #f0c000; background: rgba(240,192,0,0.12); }
.skill-unlock-btn .lock-ic { flex: none; }
.pcard-skill-top { display: flex; align-items: baseline; gap: 8px; }
.pcard-skill-name { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-skill-level { margin-left: auto; font-size: 13px; color: rgba(255,255,255,0.65);
  font-variant-numeric: tabular-nums; flex: none; }
.slimbar { display: block; height: 8px; margin-top: 4px; border: 1px solid rgba(240,192,0,0.35);
  border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.slimbar > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #b97f1e, #F2C41C);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
/* Skill detail. */
.skill-head { display: flex; align-items: center; gap: 12px; }
.skill-head-ic { width: 56px; height: 56px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.20); flex: none; }
.skill-head-name { font-family: ui-serif, Georgia, 'Times New Roman', serif; font-size: 24px;
  line-height: 32px; font-weight: 700; color: #fff; }
.skill-desc { margin: 12px 0 0; font-size: 14px; line-height: 24px;
  color: rgba(255,255,255,0.80); font-family: var(--sans); white-space: pre-wrap; }
.skill-statboxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.skill-statbox { border-radius: 12px; background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10); padding: 12px 8px; text-align: center;
  font-family: var(--sans); }
.sb-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.50); }
.sb-value { margin-top: 4px; font-size: 18px; line-height: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #fff; }
.sb-value.gold { color: #fcd34d; }
.skill-xpbar { margin-top: 12px; }
.detail-rows { margin-top: 16px; display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; font-family: var(--sans); }
.detail-row { display: flex; justify-content: space-between; gap: 16px; }
.dr-label { color: rgba(255,255,255,0.60); }
.dr-value { font-weight: 600; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.90); text-align: right; }
.dr-value.plain { font-variant-numeric: normal; }
.use-block { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.use-costs { font-family: var(--sans); }
.costs-line { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.60); }
.use-note { margin: 8px 0 0; font-size: 14px; line-height: 24px;
  color: rgba(255,255,255,0.75); font-family: var(--sans); }
.upgrade-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.upgrade-row { display: flex; align-items: center; gap: 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  padding: 8px 12px; font-family: var(--sans); }
.upgrade-ic { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.upgrade-row .grow { flex: 1; min-width: 0; }
.upgrade-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.90); }
.upgrade-desc { font-size: 12px; color: rgba(255,255,255,0.60); }
.upgrade-mods { display: block; font-size: 12px; color: rgba(255,255,255,0.60); }
.spend-msg { margin-top: 12px; font-size: 14px; font-weight: 600; color: #fde68a; font-family: var(--sans); }
.skill-footer { margin: 8px 0 0; font-size: 12px; color: rgba(255,255,255,0.50); font-family: var(--sans); }
@media (max-width: 719px) {
  /* Cleanup 11: phone — the profession title rendered at the
     clamped size on ONE line, truncating with an ellipsis
     (the DoubleHeight fitter caps the icon at 64px off the
     title line there). Hub 7.66: page titles WRAP instead of
     truncating — the title takes as many lines as it needs
     and the fitter measures the wrapped block. */
  .prof-head-name { font-size: clamp(19px, 6vw, 24px); white-space: normal;
    overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  .prof-head-icon { max-width: 64px; max-height: 64px; }
}
/* The hub's .eat-button — the shared gold action button:
   a FLAT translucent gold wash with gold Cinzel text; no
   gradient, no box-shadow, no :active rule. Replaces the
   port's solid-gold .btn, which was wrong on fill, text
   colour, and border. (Not the grey cooldown variant.) */
.eat-button { background: rgba(240, 192, 0, 0.16); color: #F2C41C;
  font-family: 'Cinzel', Georgia, serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; line-height: 1.3; border: 1px solid rgba(240, 192, 0, 0.7);
  border-radius: 8px; padding: 7px 14px; min-width: 56px; min-height: 38px; cursor: pointer; }
.eat-button:hover:not(:disabled), .eat-button:focus-visible:not(:disabled) { background: rgba(240, 192, 0, 0.3); }
.eat-button:disabled { opacity: 0.45; cursor: not-allowed; background: rgba(240, 192, 0, 0.05); }
@media (max-width: 560px) { .eat-button { min-width: 46px; min-height: 36px; padding: 6px 8px; font-size: 13px; } }
.equip-cand-ic { width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2); flex: none; }
.equip-badge { color: #FBBF24; font-size: 12px; font-weight: 700; }
.candidate-row { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #232c3d; padding: 7px 2px; }
.candidate-row .grow { flex: 1; }
/* Recipe picker rows (user, 2026-11-29): the recipe name,
   the Makes line and each component stack on their own
   lines — item names wrap to a new line instead of
   truncating with an ellipsis. */
.candidate-row.recipe-row { align-items: flex-start; }
.recipe-lines { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.recipe-lines .nm { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }

/* ---------- Quests (cleanup 13: the hub's QuestsPanel
   treatment — the .game-panel shell seats the view; rows are
   the shared row treatment mirrored from cleanup #11's
   .upgrade-row pattern) ---------- */
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-row { position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; border-radius: 12px; background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10); padding: 8px 12px;
  text-align: left; font-family: var(--sans); }
.quest-row[data-qbox] { cursor: pointer; }
.quest-row[data-qbox]:hover { background: rgba(255,255,255,0.10); }
.quest-ic { width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.20); flex: none; }
.quest-row-main { flex: 1; min-width: 0; }
.quest-row-title { display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9); }
.quest-line-name { display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12px; color: rgba(255,255,255,0.55); }
.quest-row-desc { display: block; font-size: 12px; color: rgba(255,255,255,0.55);
  white-space: pre-wrap; margin-top: 2px; }
.quest-chevron { flex: none; color: rgba(255,255,255,0.5); font-size: 18px; line-height: 1; }
.quest-ready-badge { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  border-radius: 50%; background: #d92d20; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; z-index: 1; }
.quest-row-actions { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
/* Cleanup 16 (hub 7.42): the Daily row's Abandon seat — its own
   flex child at the row's right side, inside the box; the
   row's align-items: center centres it vertically against the
   text column. */
.quest-row-side { flex: none; margin-left: auto; }
.quest-section-title { font-family: var(--sans); font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.8);
  margin: 20px 0 0; }
.quest-section-desc { font-size: 14px; color: rgba(255,255,255,0.6);
  font-family: var(--sans); margin: 4px 0 10px; }
.view-head h2.quest-panel-title { font-family: 'Cinzel', Georgia, serif; font-size: 24px;
  font-weight: 700; letter-spacing: 0.03em; color: #fdf6dd; margin: 0 0 6px; }
.quest-panel-sub { font-size: 14px; color: rgba(255,255,255,0.6); font-family: var(--sans); }
.bounty-reward-line { display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: rgba(255,255,255,0.55); margin-top: 4px; min-width: 0; }
.bounty-reward-ic { width: 16px; height: 16px; object-fit: contain; flex: none; }
.bounty-reward-line .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bounty-reward-line .qty-sfx { flex: none; }
/* The goal/progress line: ONE amber line (cleanup 13 — goal
   and progress segments alike), tabular numbers. The inline
   goal-target icons keep the port's existing 22px goal-line
   seat (the hub's exact size was not extracted). */
/* Port wave (quest detail parity + font standardization):
   the detail's category line takes the micro-label role (the
   Skill detail's .sb-label: sans, 11px, weight 700, uppercase,
   letter-spacing 0.12em, white at 50%); the "Goal:",
   "Goal Type:" and "Turn In Location:" lines take the body
   role (sans 14px on a 24px line, white at 80%). */
.quest-category { font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.50); margin: 2px 0 6px; }
.quest-detail-line { font-family: var(--sans); font-size: 14px; line-height: 24px;
  color: rgba(255,255,255,0.80); margin: 2px 0; white-space: pre-wrap; }
/* Port wave (Screen gather panel parity): the Recent Gains
   cards — a bordered row in the quest-row family carrying
   the item's icon, its name over the gain's date (the meta
   role: sans 12px, white at 60%), and the ×n at the right
   (the 7.16 quantity rule: the name truncates in its column,
   the suffix always stays in full). */
.gain-cards { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gain-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(255,255,255,0.05); border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  font-family: var(--sans); }
.gain-card-ic { width: 40px; height: 40px; flex: none; object-fit: contain; }
.gain-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.gain-card-main .nm { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.90);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gain-card-date { font-size: 12px; color: rgba(255,255,255,0.60); }
.gain-card .qty-sfx { flex: none; font-weight: 600; color: rgba(255,255,255,0.90); }
.goal-line { display: block; margin-top: 4px; font-size: 12px; line-height: 20px;
  font-variant-numeric: tabular-nums; color: rgba(252,211,77,0.9); font-family: var(--sans); }
.goal-line .item-ic { width: 22px; height: 22px; vertical-align: -6px; }
.progress-text { color: inherit; }
.inv-line { color: var(--dim); font-size: 13.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
/* The quest back button (the detail's "← All Quests").
   Button standardization (2026-11-12): its colours, border,
   radius and type join the unified action-button spec; it
   keeps its own seat (44px min-height, inline-flex with
   the arrow gap, its padding). */
.quest-back-btn { min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; border: 1px solid rgba(240,192,0,0.7);
  border-radius: 8px; background: rgba(240,192,0,0.16); color: #F2C41C;
  font-family: 'Cinzel', Georgia, serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 9px 16px 9px 12px; cursor: pointer; }
.quest-back-btn:hover { background: rgba(240,192,0,0.30); }
/* The welcome-ok action (Complete Quest / Accept Quest).
   Button standardization (2026-11-12): it already sat on
   the spec tint; its type, padding and height now match
   the unified spec exactly, keeping its inline-flex
   centring and 120px seat width. */
.game-welcome-ok { min-width: 120px; min-height: 38px; display: inline-flex;
  align-items: center; justify-content: center; border: 1px solid rgba(240,192,0,0.7);
  border-radius: 8px; background: rgba(240,192,0,0.16); color: #F2C41C;
  font-family: 'Cinzel', Georgia, serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 7px 14px; cursor: pointer; }
.game-welcome-ok:hover:not(:disabled) { background: rgba(240,192,0,0.30); }
.game-welcome-ok:disabled { opacity: 0.45; cursor: not-allowed; background: rgba(240, 192, 0, 0.05); }

/* ---------- Shops / inns ---------- */
.tabs { display: flex; gap: 8px; margin: 10px 0; }
.tabs .btn.active { background: var(--gold); color: #241a02; font-weight: 700; }
.shop-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #232c3d; padding: 7px 2px; cursor: pointer; }
.shop-row:hover { background: rgba(255, 255, 255, .045); }
.shop-row .grow { flex: 1; }
.room-card.greyed { opacity: .5; }
.room-card .purchased { color: var(--green); font-weight: 700; }

/* ---------- Bank (modal rebuild 2026-11-13 — single copper pool) ---------- */
/* The Bank is a modal over the Location screen: two windows
   side by side inside .bank-layout (total min(1040px, 100%),
   centred, gap 18px; each window flex 1 1 320px, max-width
   500px). The Bank window has NO height cap — the overlay
   scrolls — while the Inventory window keeps a capped height
   with internal scroll (hub: "the shop-view cap" carried
   over; 600px here). */
.dlg-overlay.bank .dlg, .dlg-overlay.invest .dlg { width: min(1060px, 96%); max-width: 1060px; }
.dlg-overlay.invest { z-index: 60; }
.bank-layout { display: flex; gap: 18px; align-items: flex-start; justify-content: center; width: min(1040px, 100%); margin: 0 auto; }
.bank-window { flex: 1 1 320px; max-width: 500px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: rgba(255, 255, 255, .03); }
.bank-loc-img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 2px solid #d4a017; margin: 0 auto 6px; }
.bank-title { font-family: Cinzel, serif; font-size: 28px; text-align: center; margin: 0 0 10px; }
/* The top row: the balance block beside the coin-button
   column, EVEN 50/50 (hub 7.79's rule carried into the modal;
   the phone block below keeps them side by side too — only
   the two windows stack). */
.bank-top-row { display: flex; gap: 16px; align-items: flex-start; }
.bank-balances { flex: 1 1 0; min-width: 0; }
.bank-coin-btns { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bank-line-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9aa7bd; margin: 6px 0 2px; }
.bank-amounts { font-size: 16px; }
.bank-capacity { font-size: 12px; color: #9aa7bd; }
.bank-interest { font-size: 12px; color: #9aa7bd; margin: 6px 0 0; }
.bank-coin-btn { width: 100%; justify-content: flex-start; }
/* Hub 7.78: the INVESTMENTS button is full-width, directly
   beneath the balances / coin-buttons block. */
.bank-invest-btn { display: block; width: 100%; margin: 10px 0 8px; }
/* Hub 7.81: the Bank buttons' art (assets/bank_*.png) sits
   beside the label — 34px on the coin buttons, 44px on the
   full-width INVESTMENTS button. The files are RGBA with
   real transparency and render as-is: no background, no
   frame. A disabled button dims its image with it. */
.bank-btn-img { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.bank-invest-btn .bank-btn-img { width: 44px; height: 44px; }
.btn:disabled .bank-btn-img, .eat-button:disabled .bank-btn-img { opacity: .45; }
.bank-slots-head { margin: 10px 0 6px; }
.bank-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 4px; }
.bank-slot-buy { justify-content: center; border-style: dashed; background: rgba(212, 160, 23, .14); }
.bank-slot-buy:disabled { opacity: .45; cursor: default; }
.bank-slot-buy-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #d4a017; }
.bank-slot-buy-price { font-size: 13px; font-weight: 700; color: #f3e2ac; display: inline-flex; align-items: center; gap: 4px; }
.bank-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 76px;
  border: 1px solid #d4a017; border-radius: 6px; padding: 8px 4px; cursor: pointer; text-align: center;
  background: rgba(212, 160, 23, .08); color: inherit; font: inherit; }
.bank-slot:hover { background: rgba(255, 255, 255, .045); }
.bank-slot-img { width: 36px; height: 36px; object-fit: contain; }
.bank-slot-qty { position: absolute; top: 4px; right: 6px; color: #d4a017; font-weight: 700; font-size: 12px; }
.bank-slot.empty { border: 1px dashed var(--line); background: transparent; cursor: default; justify-content: center; }
.bank-slot-empty-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9aa7bd; }
.bank-msg { min-height: 18px; margin: 6px 0; font-size: 14px; }
.bank-msg.ok { color: var(--green); }
.bank-msg.err { color: var(--red); }
.bank-close { width: 100%; }
/* The Current Inventory window: capped height, internal scroll. */
.bank-inv { max-height: 600px; overflow-y: auto; }
.bank-inv h3 { margin: 0 0 6px; }
.bank-inv-note { font-size: 13px; color: #9aa7bd; margin: 0 0 4px; }
.bank-inv-weight-line { font-size: 13px; color: #9aa7bd; margin: 0 0 6px; }
.bank-inv-row { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid #232c3d; }
.bank-inv-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.bank-inv-img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.bank-inv-txt { display: flex; flex-direction: column; min-width: 0; }
.bank-inv-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-inv-sub { font-size: 12px; color: #9aa7bd; }
.bank-inv-sub.equipped { text-transform: uppercase; font-weight: 700; color: #f0b429; }
.bank-inv-qty { margin-left: auto; }
.bank-inv-weight { min-width: 34px; text-align: right; }
.bank-store-btn { flex: none; }
/* The Store/Withdrawal Coins slider dialog, and the item
   popup's in-popup slider rows. */
.bank-coin-row { margin: 10px 0; }
.bank-coin-row input[type="range"] { width: 100%; }
.bank-coin-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bank-dlg-msg { min-height: 18px; margin: 6px 0 0; }
.bank-dlg-total { align-self: center; }

.bank-wd-label, .bank-store-label { display: block; margin-bottom: 4px; }
/* Hub 7.76: investment entries (offer cards + active rows)
   highlight the same way Bank item slots do — the slot's own
   frame tokens (1px var(--line) border, 6px radius) and its
   exact hover tint above. */
.inv-offer, .inv-active { border: 1px solid var(--line); border-radius: 6px; }
.inv-offer:hover, .inv-active:hover { background: rgba(255, 255, 255, .045); }
/* Hub 7.84: the pointer belongs to the clickable offer
   cards alone — scoped to the offer form (.inv-offer),
   never the shared .shop-row rule: the Active Investments
   holding rows (.inv-active) are not clickable and keep
   the DEFAULT cursor, overriding the pointer .shop-row
   would otherwise give them. Both rules stand after
   .shop-row so they win at equal specificity. The rows'
   own controls (Invest, Back to Bank, the confirmation's
   Cancel/Invest) are native buttons — the global button
   rule already gives them the pointer, and .btn:disabled
   keeps its default cursor, both untouched. */
.inv-offer { cursor: pointer; }
.inv-active { cursor: default; }
/* Hub 7.77 fold-in (user directive, 2026-11-09): investment
   images render ENLARGED and WITHOUT their framing box —
   the raw image, no border, no background, no radius —
   replacing the 34px item-ic thumbnails on the cards/rows
   and the framed confirm-img in the purchase confirmation.
   Sizes are the hub's as built (hub 7.77): 84px on the
   offer cards and active rows, 160px centred in the
   confirmation dialog. */
.inv-img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.inv-img.lg { display: block; width: 160px; height: 160px; margin: 0 auto 4px; }
/* Investments screen, hub shape (user, 2026-11-16): plain
   section labels, muted term labels without colons, and
   the status line colours. */
.inv-sec { color: var(--dim); margin: 16px 0 6px; }
.inv-term { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.inv-lab { color: var(--dim); }
.inv-status { font-weight: 600; margin-top: 2px; }
.inv-failed { color: var(--red); font-weight: 800; }
.inv-success { color: var(--green); }
.inv-desc { color: var(--dim); margin: 2px 0 4px; }
.inv-cannot { color: var(--red); }
.inv-daily { margin-top: 12px; }
/* Hub 7.82: the Investments screen is headed by the same
   scroll art its Bank button carries — the raw image at
   120px, no border, no background, no radius, centred
   above the "Investments" title. */
.invest-head-img { display: block; width: 120px; height: 120px; object-fit: contain; margin: 0 auto 6px; }
.bank-slot .nm { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 719px) {
  /* Bank modal on the phone (2026-11-13 rebuild): the two
     windows STACK (Bank first, Inventory beneath), each full
     width, the overlay scrolls. The top row does NOT stack —
     it stays 50/50 with a tighter gap and button padding,
     labels wrapping. The five slots stay five across on
     shrinkable tracks (hub 7.78's directive carried over),
     and item names WORD WRAP inside their slot instead of
     truncating. */
  .bank-layout { flex-direction: column; }
  .bank-window { flex: 1 1 auto; width: 100%; max-width: none; }
  .bank-top-row { gap: 10px; }
  .bank-coin-btn { padding: 6px 8px; }
  .bank-slots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bank-slot { min-width: 0; }
  .bank-slot .nm { white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }
}

/* ---------- University (hub 7.72; grouped by profession 7.80) ---------- */
/* Hub 7.80: the trainable skills sit in one group per
   profession under an expandable header — profession name,
   the level this university trains it to (its Max Level
   cap), the group's skill count, and a gold chevron that
   turns as the group opens. A closed group hides its body;
   the header toggles it in place. No height or overflow cap
   anywhere in this block: the screen rides #main-panel's
   scroll like every full screen, so a fully expanded
   screen stays reachable end to end. */
.uni-group { margin: 10px 0; }
.uni-group-head { display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
/* Hub 7.82: the header's two text lines (the name line,
   now carrying the character's level in the profession,
   and the trains-to line) stack in their own column, and
   the profession's icon — when it has one — stands at
   40px unframed beside them, spanning both lines. A
   profession without an image renders no image element
   at all. */
.uni-group-ic { width: 40px; height: 40px; object-fit: contain; flex: none; }
.uni-group-text { display: flex; flex-direction: column; gap: 2px; }
.uni-group-name { font-weight: 700; }
.uni-group-meta { color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.uni-chevron { margin-left: auto; color: var(--gold-bright); font-size: 22px; line-height: 1;
  transition: transform 0.15s ease; }
.uni-group:not(.closed) .uni-chevron { transform: rotate(90deg); }
.uni-group.closed .uni-group-body { display: none; }

/* ---------- Combat ---------- */
.combat-enemy { display: block; margin: 0 auto; width: 192px; height: 192px; object-fit: contain; }
.combat-log { background: #05070a; border: 1px solid var(--line); border-radius: 6px;
  height: 170px; overflow-y: auto; padding: 8px 10px; font-size: 14px; line-height: 1.45; margin: 10px 0; }
.hp-bar { height: 12px; background: #0d1118; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.hp-bar > div { height: 100%; background: #b03a3e; }

/* ---------- Home ---------- */
.home-wrap { position: relative; width: min(100%, max(200px, calc(100dvh - 264px))); aspect-ratio: 1; margin: 0 auto; border: 1px solid var(--line); }
.map-btn { width: 42px; height: 42px; min-width: 42px; padding: 0; font-size: 19px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.map-btn.active { background: var(--gold); color: #241a02; font-weight: 700; }
.home-wrap canvas.ground { width: 100%; height: 100%; display: block; }
.home-grid-overlay { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(255,255,255,.28) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,.28) 1px, transparent 1px);
  background-size: calc(100% / 32) calc(100% / 32); }
.home-click { position: absolute; inset: 0; cursor: crosshair; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.palette button { border: 2px solid var(--line); background: var(--panel); border-radius: 6px; padding: 3px; }
.palette button.selected { border-color: var(--gold-bright); }
.palette img { width: 40px; height: 40px; object-fit: cover; display: block; }

/* ---------- Rest dialog (root-level fixed overlay) ---------- */
#rest-root .dlg-overlay { z-index: 55; }
.rest-maxed { text-align: center; font-weight: 600; margin: 14px 0 4px; }
.rest-head { display: flex; align-items: center; gap: 14px; }
.rest-head img { width: 150px; max-width: 40%; height: auto; }
/* Rest dialog, hub shape (2026-11-13): icon stat rows with
   the value seated right, a label + full-width slider with
   min/max scale labels, and the stacked centred actions. */
.rest-stat { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--line); }
.rest-stat b { margin-left: auto; }
.rest-slider-label { color: var(--dim); font-size: 13px; margin: 14px 0 4px; }
.rest-slider-scale { display: flex; justify-content: space-between;
  color: var(--dim); font-size: 13px; margin-top: 2px; }

/* ---------- Phone bar ---------- */
#phone-bar { display: none; }
@media (max-width: 719px) {
  #game-layout { flex-direction: column; }
  #sidebar { width: 100%; flex: 1; border-right: none; }
  body.showing-main #sidebar { display: none; }
  body:not(.showing-main) #main-panel { display: none; }
  /* Hub: the back bar sits at z-30, pinned flush to the top of
     the screen behind an opaque cover strip sized from the
     screen's top padding + the safe-area inset. The port's bar
     is the panel's first in-flow child (top padding 0), so the
     strip folds into the bar itself: its opaque background runs
     to the very top and its top padding grows by the safe-area
     inset so the contents clear a notch/status bar. */
  #phone-bar { display: flex; align-items: flex-start; gap: 7px; background: var(--panel);
    border-bottom: 1px solid var(--gold); padding: 5px 8px; position: sticky; top: 0; z-index: 30;
    padding-top: calc(5px + env(safe-area-inset-top, 0px)); }
  #phone-back { background: none; border: 1px solid var(--gold); color: var(--gold-bright);
    border-radius: 5px; padding: 5px 9px; font-size: 14px; white-space: nowrap; }
  /* Hub 7.87: the Back button's column carries the active
     buff/debuff icon row under the button. Port shape call:
     the hub's header is tall (a five-line readout), so its
     row spends slack that already exists; the port's bar is
     compact, so the row's 20px slot is RESERVED in the
     column at all times (visibility toggles with the buff
     list) — the bar's height is thereby identical with no
     buffs and with buffs, and a buff appearing or expiring
     mid-play never moves the layout. The row is exactly the
     button's width (width: 0 + min-width: 100% keeps the
     icons' own width from widening the column) and scrolls
     sideways when the icons overflow it. */
  #phone-left { display: flex; flex-direction: column; gap: 2px; flex: none; }
  #phone-buffs { display: flex; gap: 4px; align-items: center; height: 20px;
    width: 0; min-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .phone-buff-btn { background: none; border: none; padding: 0; line-height: 0; flex: none; cursor: pointer; }
  .phone-buff-btn.inactive { opacity: .55; }
  .phone-buff-ic { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; display: block;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.2); }
  span.phone-buff-ic.active-buff-mark { background: rgba(255,255,255,0.08); }
  #phone-portrait { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
  /* Phone header vitals (2026-11-11, the user's hub-vs-port
     side-by-side): the readout is the hub's two-column grid,
     not a single scrolling row — the renderer's emit order
     (AP, Reset, STM, MP, HP, SUST, HYD, TEMP) pairs into
     AP|Reset, STM|MP, HP|SUST, HYD|TEMP rows, all visible at
     once; the old flex row ran off the screen edge (STM was
     already cut off in the user's shot). */
  #phone-readout { display: grid; grid-template-columns: max-content max-content; column-gap: 12px; row-gap: 3px; flex: 1 1 auto; min-width: 0; font-size: 13px; align-items: center; font-family: var(--sans); }
  #phone-readout .pr-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
  #phone-readout img { width: 16px; height: 16px; }
  #phone-readout .reset-cd { color: var(--dim); font-size: 11px; }
  #view-root { padding: 12px 10px 34px; }
  /* The Location screen fits the screen exactly and never
     scrolls (user directive, 2026-11-13): the panel becomes
     a flex column — phone bar, then the view — with its own
     scroll locked off, and the location view fills its share
     as a flex column whose map wrap takes whatever height
     is left after the head. Before this, the wrap's fixed
     height formula (100dvh - 360px) under-budgeted the
     phone bar + head + paddings by ~80px, so the panel
     scrolled and the map controls rode off the bottom.
     Tall cell panels still scroll INSIDE their card
     (.cell-details has overflow-y: auto). Other screens
     keep the panel's scroll; desktop untouched. */
  #main-panel.no-scroll { display: flex; flex-direction: column; overflow-y: hidden; }
  /* Status bar lock (user report 2026-11-19: the bar could be
     scrolled mostly off the page): at phone widths the panel
     is ALWAYS a flex column - the bar and the banner are
     fixed rows and only #view-root scrolls, so the bar can
     never be scrolled away; and while in game the game
     screen is pinned to the viewport, so the page itself
     cannot scroll the shell up either. */
  #main-panel { display: flex; flex-direction: column; overflow: hidden; }
  #phone-bar { flex: 0 0 auto; }
  #banner { flex: 0 0 auto; }
  #view-root { flex: 1 1 auto; min-height: 0; min-width: 0; margin-left: 0; margin-right: 0; overflow-y: auto; }
  body.showing-main #screen-game { position: fixed; inset: 0; }
  #view-root.panel-loc { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0;
    margin-left: 0; margin-right: 0; max-width: 100%;
    box-sizing: border-box; padding-bottom: 10px; overflow-y: hidden; }
  #view-root.panel-loc .loc-head { flex: 0 0 auto; }
  #view-root.panel-loc .loc-map-wrap { flex: 1 1 auto; min-height: 160px; height: auto; min-width: 0; }
  /* Hub (pre-7.66): panel titles rendered on ONE line at this
     size on phone. Hub 7.66: page titles WRAP at word
     boundaries instead of running on one line — the header
     row grows with a wrapped title, the head icon stays
     centred (align-items: center) and capped (the 64px slot
     cap below), and the description still sits under the
     title. Font, stepped-down size and colours unchanged. */
  .view-head h2, .char-head h2, .inv-head h2, .equip-head h2, .view-head h2.quest-panel-title { font-size: clamp(19px, 6vw, 24px); white-space: normal;
    overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  /* Cleanup 6: on phone the head icon slot is capped at 64px
     (fitScreenHeads also sizes it off the title line only). */
  .view-head .panel-head-icon, .equip-head .panel-head-icon, .inv-head .panel-head-icon { max-width: 64px; max-height: 64px; }
  /* Hub: the Location header band stays two columns on phone,
     capped at 42dvh (over batch 2's fixed heights); the grid's
     stretch keeps the cell-details column — and its scrollbar —
     at exactly the left column's height. */
  .loc-head { grid-template-columns: 1fr 1fr; gap: 8px; max-height: 42dvh; }
  .loc-head-left h2 { font-size: 19px; }
  /* Port wave (g): the legacy 40px .loc-head-left img rule
     that stood here is removed with its base rule — the
     fitted slot caps at 64px on phone via the
     .panel-head-icon rule above, like every other screen. */
  .dlg { padding: 14px; }
  /* Admin gear on phone (hub rule): out of the fixed corner and
     into the screen's own flow — the first element above the
     logo, right-aligned, 56px. */
  .admin-gear { position: static; align-self: flex-end; flex: none; margin-bottom: 10px; }
  /* Hub 7.18: the card plaque steps down on phone so typical
     character names stay on one line. */
  .char-plaque { width: 156px; }
  /* Hub 7.89: the loading row's reserved height follows the
     card's phone height (156px plaque = 52px + 22px). */
  .char-loading { min-height: 74px; }
  /* Cleanup 16 (hub 7.42's narrow stacking): the Daily row's
     Abandon seat drops to a full-width row of its own, still
     INSIDE the quest box, and its button stretches with it. */
  .quest-row { flex-wrap: wrap; }
  .quest-row-side { flex: 1 1 100%; margin-left: 0; margin-top: 8px; }
  .quest-row-side .eat-button { width: 100%; }
  /* Hub 7.90: the Explore map's control row (zoom out,
     zoom in, Reset, Hide grid, Center Map) is anchored to
     the map window's right edge by its base rule and
     nothing capped its width: from the shipped values
     (two fixed 42px zoom buttons, three labelled buttons
     at 14px with 10px side padding, 6px gaps) the row
     runs ~340-356px depending on the platform font,
     against ~350px of inner window on a 390px phone and
     ~320px on a 360px phone — so it spilled past the
     window's LEFT edge and the wrap's overflow:hidden
     clipped the zoom-out button, worst on narrower
     phones. Phone only: the row is capped to the
     window's inner width (the 10px right anchor plus a
     matching 10px on the left), its buttons cannot
     shrink below their labels, the labelled buttons
     take slightly smaller type and padding, and a row
     that still cannot fit wraps WHOLE buttons onto a
     second line inside the window (right-aligned like
     the row itself, stacked upward from the bottom
     anchor). Desktop rules untouched.
     SUPERSEDED in part (user directive, 2026-11-13, with
     a phone screenshot of the wrapped row — CENTER MAP
     pushed to a second line and clipped at the screen
     edge): "They should be a single line with no wrap
     without leaving the screen." The row now NEVER
     wraps: gaps tighten to 4px, the zoom pair holds its
     42px, and the labelled buttons take 12px type with
     6px side padding and may shrink (min-width: 0),
     their labels held on one line and ellipsised rather
     than ever pushing the row off-screen. The width cap
     and right alignment stand. */
  .loc-map-controls { max-width: calc(100% - 20px); flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
  .loc-map-controls .map-btn { flex: 0 0 auto; }
  .loc-map-controls .map-btn.wide { flex: 0 1 auto; min-width: 0; font-size: 12px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Phone: the game shell runs underneath the system
     navigation bar — the bottom-anchored map controls were
     clipped by it (user screenshot 2026-11-13). Two-part
     fix: the shell itself is now sized in dvh (see the
     #screen-game / #game-layout rules — 100vh kept as the
     fallback line), so the layout's bottom tracks the
     visible viewport instead of the full screen height;
     and the row is lifted by a full navigation bar's
     height PLUS the device's own bottom safe-area inset
     where it reports one — the first lift (26px) proved
     short on the user's phone, whose browser reports a
     zero inset while its bar is ~48px (user screenshot,
     same day: the row still sat half under the bar).
     Where the inset IS reported the row simply floats a
     little higher inside the map. Phones only; the base
     rule's bottom: 10px stands on desktop. */
  .loc-map-controls { bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
}
