/* Reinc Planner. Tokens first (light, then dark twice: the system's choice unless the page's
   toggle says light, and the toggle's dark), then layout, then components. The accent is the
   logo's indigo; its gold marks what changed (lit numbers, change chips, the active tab). Breakpoints:
   1200px summary column vs bottom sheet; 600px phone. The Guilds & skills tab goes by its own
   width (container queries): guild rows and the skills table side by side from 880px (guilds.js),
   the skills table as cards below 980px of its own column. */

:root {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f0f3f7; --surface-3: #e4e9f0;
  --border: #d9dfe7; --border-strong: #b8c1ce; --field-border: #7d8898;  /* fields: 3:1 against the card */
  --text: #19212d; --muted: #586474; --faint: #6b7685;
  --accent: #3d3497; --accent-hover: #2f2878; --accent-soft: #ecebfa; --on-accent: #ffffff;   /* 9.8:1 on white, 8.4:1 on the soft */
  --gold: #e9b13b; --gold-ink: #94650a; --on-gold: #1d1640;   /* gold is a fill or a mark; as text on light only the ink */
  --ok: #18733f; --ok-soft: #e2f3e9; --warn: #9a5b00; --warn-soft: #fcf0d9; --err: #bf3328; --err-soft: #fbe7e5; --on-err: #ffffff;
  --info: #335f96; --info-soft: #e8f0fa;
  --lit: #fbe3a6; --chip-up: var(--gold); --chip-text: var(--on-gold); --chip-down: #3d3497; --chip-down-text: #ffffff;
  --focus: #3d3497;
  /* guild colours of the levels bar: white numbers on them need 4.5:1 */
  --g0: #3a6cc6; --g1: #1f7a6e; --g2: #9a5c17; --g3: #8a4ca6; --g4: #b83f58; --g5: #3f7a26; --g6: #5759c4; --g7: #85661a;
  --g-rebirth: #6b7584; --g-race: #5c6b80; --g-free: #e4e9f0;
  /* surfaces: a two-step shadow (contact, then a soft indigo lift), a 1px inner highlight, a faint wash at the top of the page */
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px -6px rgba(39, 32, 89, .14);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .2);
  --hilite: inset 0 1px 0 rgba(255, 255, 255, .9);
  --glow-gold: 0 0 0 3px rgba(233, 177, 59, .2), 0 3px 14px -2px rgba(233, 177, 59, .45);
  --wash: radial-gradient(70% 460px at 18% -120px, rgba(61, 52, 151, .045), transparent 72%),
    radial-gradient(55% 380px at 88% -100px, rgba(233, 177, 59, .05), transparent 70%);
  --rule-gold: color-mix(in srgb, var(--gold) 70%, var(--border));   /* both themes: it mixes the theme's own values */
  --radius: 10px; --radius-sm: 6px;
  /* Inter (brand.css @font-face, self-hosted): a face made for screens, clear at small sizes, its digits easy to tell apart;
     the system face until it loads, or without it */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sum-w: 340px; --top-h: 96px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131a; --surface: #161d26; --surface-2: #1c2430; --surface-3: #263142;
    --border: #2a3442; --border-strong: #3c495b; --field-border: #64728a;
    --text: #e5eaf1; --muted: #9ba7b7; --faint: #808c9c;
    --accent: #8b83f0; --accent-hover: #a59cff; --accent-soft: #1f1b45; --on-accent: #0f0b2b;   /* 5.3:1 on the card, 5.1:1 on the soft */
    --gold: #e9b13b; --gold-ink: #f1c35a; --on-gold: #1d1640;
    --ok: #4fc887; --ok-soft: #14301f; --warn: #f1b252; --warn-soft: #352710; --err: #ff7e72; --err-soft: #3a1815; --on-err: #1a0a08;
    --info: #86b5ee; --info-soft: #172a41;
    --lit: #47380f; --chip-up: var(--gold); --chip-text: var(--on-gold); --chip-down: #8b83f0; --chip-down-text: #0f0b2b;
    --focus: #a59cff;
    --g-rebirth: #5d6878; --g-race: #5c6b80; --g-free: #263142;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
    --hilite: inset 0 1px 0 rgba(255, 255, 255, .05);
    --glow-gold: 0 0 0 3px rgba(233, 177, 59, .16), 0 3px 16px -2px rgba(233, 177, 59, .3);
    --wash: radial-gradient(70% 460px at 18% -120px, rgba(139, 131, 240, .07), transparent 72%),
      radial-gradient(55% 380px at 88% -100px, rgba(233, 177, 59, .04), transparent 70%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131a; --surface: #161d26; --surface-2: #1c2430; --surface-3: #263142;
  --border: #2a3442; --border-strong: #3c495b; --field-border: #64728a;
  --text: #e5eaf1; --muted: #9ba7b7; --faint: #808c9c;
  --accent: #8b83f0; --accent-hover: #a59cff; --accent-soft: #1f1b45; --on-accent: #0f0b2b;   /* 5.3:1 on the card, 5.1:1 on the soft */
  --gold: #e9b13b; --gold-ink: #f1c35a; --on-gold: #1d1640;
  --ok: #4fc887; --ok-soft: #14301f; --warn: #f1b252; --warn-soft: #352710; --err: #ff7e72; --err-soft: #3a1815; --on-err: #1a0a08;
  --info: #86b5ee; --info-soft: #172a41;
  --lit: #47380f; --chip-up: var(--gold); --chip-text: var(--on-gold); --chip-down: #8b83f0; --chip-down-text: #0f0b2b;
  --focus: #a59cff;
  --g-rebirth: #5d6878; --g-race: #5c6b80; --g-free: #263142;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  --hilite: inset 0 1px 0 rgba(255, 255, 255, .05);
  --glow-gold: 0 0 0 3px rgba(233, 177, 59, .16), 0 3px 16px -2px rgba(233, 177, 59, .3);
  --wash: radial-gradient(70% 460px at 18% -120px, rgba(139, 131, 240, .07), transparent 72%),
    radial-gradient(55% 380px at 88% -100px, rgba(233, 177, 59, .04), transparent 70%);
  color-scheme: dark;
}
@media (min-width: 1700px) { :root { --sum-w: 380px; } }

/* ---- base ------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--wash), var(--bg); background-repeat: no-repeat; color: var(--text); font: 15px/1.45 var(--font); overflow-x: hidden; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14.5px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
a .ico { vertical-align: -2px; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.warn-text { color: var(--warn); }
.okline { color: var(--ok); display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13.5px; }
.over { color: var(--err); font-size: 13.5px; font-weight: 600; }
.empty { color: var(--muted); padding: 16px 0; margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ico { flex: none; }
.pre { white-space: pre-line; }
.numc { text-align: right; font-variant-numeric: tabular-nums; }
.zero { color: var(--faint); }
.boot { display: flex; align-items: center; gap: 10px; justify-content: center; min-height: 60vh; color: var(--muted); font-size: 16px; padding: 16px; }
.boot.err { flex-direction: column; color: var(--text); text-align: center; }

/* ---- form controls ---------------------------------------------------------------------- */
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); padding: 5px 8px; min-height: 34px; max-width: 100%; min-width: 0;
}
select { padding-right: 22px; cursor: pointer; }
select:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
textarea { width: 100%; resize: vertical; line-height: 1.4; }
input[aria-invalid="true"] { border-color: var(--err); }
.bad-hint { display: block; font-size: 12.5px; color: var(--err); margin-top: 2px; }
.pick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; max-width: 100%; }
.pick > select { min-width: 0; max-width: 100%; }
.pick > .hint { margin: 0; }
.termbtn { all: unset; cursor: help; border-bottom: 1px dotted var(--faint); }
.termbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; align-content: start; }
.field > label, .flabel { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > select, .field > input, .field > textarea { width: 100%; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.check { display: inline-flex; align-items: flex-start; gap: 7px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.btn.warnbtn { color: var(--warn); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--err); border-color: var(--err); color: var(--on-err); }
.btn.sm { min-height: 28px; padding: 3px 8px; font-size: 13px; }
.btn.icon { padding: 5px; min-width: 34px; justify-content: center; }
.btn.icon.sm { min-width: 26px; min-height: 26px; padding: 3px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 2px 4px; min-height: 0; text-decoration: underline; text-underline-offset: 2px;
  white-space: normal; text-align: left; }
.btn.link:hover:not(:disabled) { background: none; color: var(--accent-hover); }
.btn.fix { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); background: var(--accent-soft); white-space: normal; text-align: left; }
.btn .cost { color: var(--muted); font-size: 12px; font-weight: 400; }
.btn .cost::before { content: "· "; }
.btn.fix { align-items: flex-start; }
.btn.fix .ico { margin-top: 2px; }
.fix-text { display: grid; gap: 1px; }
.fix-text .cost::before { content: none; }
/* press feedback: a button gives a little under the hand (transform only, nothing around it moves), a quick-target button fills while pressed */
.btn, .qb, .tab, .ef-chip, .seg-opt span, .choice { transition-property: transform; transition-duration: .08s; transition-timing-function: ease-out; }
.btn:active:not(:disabled):not([aria-disabled="true"]), .qb:active, .tab:active, .ef-chip:active, .seg-opt:active span { transform: scale(.97); }
.qb:active { background: var(--accent); color: var(--on-accent); }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--field-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); max-width: 100%; }
.seg-opt { position: relative; display: block; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 5px 12px; font-size: 14px; border-right: 1px solid var(--border); white-space: nowrap; }
.seg-opt:last-child span { border-right: 0; }
.seg-opt.on span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg-opt.dis span { color: var(--faint); background: var(--surface-2); }
.seg-opt.dis input { cursor: not-allowed; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

.stepper { display: inline-flex; align-items: center; gap: 3px; }
.stepper .btn.icon { min-width: 30px; font-size: 17px; padding: 3px; }
.stepper select { min-width: 62px; }

.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; line-height: 1.3; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap; border: 0; font-family: inherit; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); white-space: normal; }
.badge.info { background: var(--info-soft); color: var(--info); cursor: pointer; }
.badge.new { background: var(--accent); color: var(--on-accent); margin-left: 6px; }

/* ---- page frame ------------------------------------------------------------------------- */
/* the app bar ends in a gold hairline (on phones and short screens the change strip, which is then the sticky top) */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--rule-gold); box-shadow: var(--shadow); }
.appbar { display: flex; align-items: center; gap: 8px 14px; padding: 8px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; margin: 0; line-height: 1.2; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px; }
.plan-name { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.plan-name input { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 600; border-color: transparent; background: transparent;
  border-bottom: 1px dashed var(--border-strong); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.plan-name input:hover { border-color: var(--border); }
.plan-name input:focus { border-color: var(--accent); background: var(--surface); }
.state { font-size: 12.5px; white-space: nowrap; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.state.saved { color: var(--ok); background: var(--ok-soft); }
.state.changed { color: var(--warn); background: var(--warn-soft); }
.bar-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bar-narrow { display: none; }
/* the More menu (appbar.js MoreMenu) */
.more-pop { min-width: 230px; padding: 6px; }
.more-list { display: grid; }
.more-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.more-item:hover { background: var(--surface-2); }
.more-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.more-sec { border-top: 1px solid var(--border); margin-top: 6px; padding: 8px 10px 4px; display: grid; gap: 6px; font-size: 13.5px; }
.more-h { font-size: 12px; color: var(--muted); }
.more-theme { display: flex; gap: 4px; }
.more-theme .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.more-credit { font-size: 13px; color: var(--accent); }
.more-sites { font-size: 13px; }
.more-sites a { color: var(--accent); }
.more-sites .sl-sep { color: var(--faint); white-space: pre; }
.more-pop .bar-narrow { display: none; }

/* wide screens: one app bar row (name, the change line with Undo, the buttons) over the source banner.
   Only from 1600px: the row needs ~1500px with Windows fonts and more with a Mac's, and below that the
   pieces overlapped (a MacBook Air at 1440). Narrower windows keep the wrapping bar with the strip under it. */
@media (min-width: 1600px) and (min-height: 501px) {
  .top { display: grid; grid-template-columns: auto minmax(160px, 300px) minmax(0, 1fr) auto; grid-template-areas: "brand name strip acts" "src src src src";
    align-items: center; column-gap: 14px; }
  .top > .appbar { display: contents; }
  .top .brand { grid-area: brand; padding: 7px 0 7px 16px; }
  .top .plan-name { grid-area: name; }
  .top .bar-acts { grid-area: acts; padding-right: 16px; flex-wrap: nowrap; }
  .top .srcbar { grid-area: src; }
  .top .strip { grid-area: strip; background: none; border: 0; padding: 0; min-height: 0; min-width: 0; }
  .top .strip-text { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
  .top .strip-text.full { border-radius: var(--radius-sm); }
}
/* Undo / Redo as icons in the one-row bar until it has room for their words (their titles name them) */
@media (min-width: 1600px) and (max-width: 1999px) and (min-height: 501px) { .top .strip .btn span { display: none; } }
.strip { display: flex; align-items: center; gap: 8px; padding: 3px 16px; background: var(--surface-2); border-top: 1px solid var(--border); min-height: 36px; font-size: 13.5px; }
.strip-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.strip-text.full { white-space: normal; overflow: visible; }
.strip-btn { font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 2px 0; cursor: pointer; border-radius: 4px; }
.strip-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.banner { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 12px 16px 0; padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font-size: 14px; animation: slidein .25s ease-out; }
.banner > span:first-child { flex: 1 1 320px; }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.banner-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pname { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dlg .banner, .card .banner { margin: 8px 0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--sum-w); gap: 16px; padding: 12px 16px 24px; align-items: start; max-width: 2600px; margin: 0 auto; }
/* the Routes tab: the map takes the summary's column too (the summary is about the plan) */
@media (min-width: 1200px) { .layout.no-sum { grid-template-columns: minmax(0, 1fr); } .layout.no-sum > .summary { display: none; } }
.main { min-width: 0; outline: none; }
.panel { min-width: 0; }
/* a tab's panel fades in and rises 4px when the tab changes (main.js keys it by the tab); `both` leaves no transform behind, so sticky parts work */
.panel-enter { animation: panel-in .16s ease-out backwards; }   /* not "both": a kept opacity animation makes a stacking context that traps popovers under the summary */
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }
.foot { margin-top: 16px; border-top: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.foot-bar { max-width: 2600px; margin: 0 auto; padding: 9px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.foot-name { color: var(--text); }
.foot-credit a, .foot-more a { color: inherit; }
.foot-local { margin-right: auto; }
.foot-toggle { background: none; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 12px; font: inherit; color: var(--text); cursor: pointer; }
.foot-toggle:hover { border-color: var(--accent); color: var(--accent); }
.foot-more { max-width: 2600px; margin: 0 auto; padding: 0 16px 14px; }
.foot-more p { max-width: 110ch; margin: 4px 0; }
@media (max-width: 599px) {
  .foot-sub, .foot-local { display: none; }
  .foot-bar { gap: 4px 12px; }
}

.tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 14px; padding: 2px 2px 8px; scrollbar-width: thin; }
/* the gold mark under the active pill (main.js Tabs sets its left and width; it slides once placed) */
.tab-mark { position: absolute; left: 0; bottom: 0; width: 0; height: 2px; border-radius: 2px; background: var(--gold); pointer-events: none;
  box-shadow: 0 0 6px rgba(233, 177, 59, .45); }
.tab-mark.slide { transition: transform .18s ease-out, width .18s ease-out; }
/* the planner's tab list (main.js Tabs) in two rows: the plan's own tabs, then the guides, smaller */
.tabs-box { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs-box > .tabs { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px; }
.tabs-guides { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 0 2px 8px; }
.tabs-lab { margin: 0 6px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.tab.tab-guide { padding: 3px 11px 3px 8px; font-size: 13.5px; gap: 6px; border-radius: 8px; }
/* pill tabs (main.js Tabs): icon, name with the problem count, one line of what is in it */
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; padding: 6px 13px 6px 10px; font: inherit;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 10px; text-align: left; line-height: 1.2; }
.tab .ico { flex: none; opacity: .8; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.on { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tab.on .ico { opacity: 1; }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.tab-txt { display: grid; }
.tab-name { display: flex; align-items: center; }
.tab-sub { font-size: 11.5px; font-weight: 500; color: var(--faint); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.tab.on .tab-sub { color: color-mix(in srgb, var(--accent) 75%, var(--muted)); }
.tab-cnt { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; text-align: center; }
.tab-cnt.err { background: var(--err); color: var(--on-err); }
/* a count that changed pops once (main.js TabCount; not on the first paint) */
.tab-cnt.popped { animation: cnt-pop .2s ease-out; }
@keyframes cnt-pop { 50% { transform: scale(1.15); } }
/* section headings: an icon tile before the title (common.js HIcon) */
.htile { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; margin-right: 10px; border-radius: 8px; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent); }
h2:has(> .htile) { display: flex; align-items: center; }
.tl-short { display: none; }
/* more tabs than fit: the cut edge fades (set by main.js Tabs) */
.tabs.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tabs.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.tabs.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--hilite), var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head > .muted, .card-head > span { font-size: 13.5px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cols { display: grid; gap: 16px; align-items: start; }
.cols-char { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-stats { grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); }
.cols-tax { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.err-box { border-color: var(--err); }
.flash-target { animation: flashout 1.6s ease-out; border-radius: var(--radius-sm); }
@keyframes flashout { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

details.more { margin: 6px 0; font-size: 13.5px; }
details.more > summary { cursor: pointer; color: var(--accent); width: fit-content; }
details.more[open] > summary { margin-bottom: 6px; }
.inline-help { display: inline; }
.inline-help[open] { display: block; }
.helptext { max-height: 360px; overflow: auto; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--text); }
.notes { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.notes li { margin: 2px 0; }

/* ---- numbers that light up -------------------------------------------------------------- */
.num { position: relative; font-variant-numeric: tabular-nums; white-space: nowrap; border-radius: 3px; }
.num.lit { animation: lit 2.5s ease-out; }
@keyframes lit { 0%, 55% { background: var(--lit); } 100% { background: transparent; } }
.chip { position: absolute; right: -6px; bottom: calc(100% - 3px); font-size: 10.5px; line-height: 1; padding: 2px 5px; border-radius: 999px;
  background: var(--chip-up); color: var(--chip-text); font-weight: 700; white-space: nowrap; pointer-events: none; z-index: 4;
  animation: chip 2.5s ease-out forwards; font-family: var(--font); letter-spacing: 0; }
.chip.down { background: var(--chip-down); color: var(--chip-down-text); }
@keyframes chip { 0% { opacity: 0; transform: translateY(3px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
/* right-aligned numbers: the chip sits to their left, where there is room */
.kv dd .chip { right: calc(100% + 4px); bottom: auto; top: 50%; margin-top: -8px; animation-name: chipfade; }
@keyframes chipfade { 0% { opacity: 0; } 8%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---- summary ------------------------------------------------------------------------------ */
.summary { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; overflow-x: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--hilite), var(--shadow); overscroll-behavior: contain; }
.sheet-bar { display: none; }
.sum-body { padding: 14px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sum-body > * { min-width: 0; }
.lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.kv { margin: 0; display: grid; gap: 2px; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; min-width: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv.two { grid-template-columns: 1fr 1fr; column-gap: 18px; }
.kv.inline { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-bottom: 10px; }
.kv.inline > div { justify-content: flex-start; }
.sec-h { font-size: 14px; margin: 0 0 8px; }

.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.issue { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 13.5px; }
.issue > .ico { margin-top: 2px; }
.issue.error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.issue.error > .ico { color: var(--err); }
.issue.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.issue.warn > .ico { color: var(--warn); }
.issue.info { background: var(--surface-2); }
.issue.info > .ico { color: var(--info); }
/* an issue on its way out fades, then folds its height away (common.js useCollapseOut sets the height, padding and margin), so the list below glides up instead of jumping */
.issue.leaving { opacity: 0; transition: opacity .16s ease-in, height .22s ease-in .04s, padding .22s ease-in .04s, margin .22s ease-in .04s, border-width .22s ease-in .04s; }
.issue-body { min-width: 0; overflow-wrap: anywhere; }
.issue-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.issue-acts:empty { display: none; }
.sec-h[tabindex]:focus { outline: none; }
.sec-h[tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.next-steps { display: grid; gap: 8px; justify-items: start; font-size: 13.5px; }
.steps { margin: 0; padding-left: 20px; }
@keyframes slideout { to { opacity: 0; transform: translateY(-4px); } }   /* slidein (from above) is in views.css */

/* ---- character ---------------------------------------------------------------------------- */
.racecard, .bgcard { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; font-size: 14px; }
.racecard-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 15px; }
.racestats { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 13.5px; }
.racestats caption { caption-side: bottom; text-align: left; padding-top: 4px; }
.racestats th { text-align: left; font-weight: 500; color: var(--muted); width: 1%; white-space: nowrap; padding: 1px 10px 1px 0; }
.racestats .numc { width: 1%; padding-right: 10px; font-weight: 600; }
.barc { width: 100%; }
.bar { display: block; height: 7px; border-radius: 4px; background: var(--accent); opacity: .75; min-width: 2px; }
.raceslots { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0; }
.raceslots .odd { color: var(--warn); font-weight: 600; }
.traits { display: flex; flex-wrap: wrap; gap: 4px; }
.facts { margin: 6px 0; padding-left: 18px; }

/* ---- guilds ------------------------------------------------------------------------------- */
.levels .card-head { margin-bottom: 10px; }
.ascexp { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ascexp .muted { font-weight: 400; }
.lvbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--g-free); font-size: 12px; font-weight: 700; color: #fff; }
.lvbar > span { display: grid; place-items: center; min-width: 0; overflow: hidden; border-right: 1px solid var(--surface); flex-basis: 0; transition: flex-grow .3s; }
.lvbar > span:last-child { border-right: 0; }
.lvbar .seg-free { color: var(--muted); }
.lvlegend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.lvlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.seg-rebirth { background: var(--g-rebirth); } .seg-race { background: var(--g-race); } .seg-free { background: var(--g-free); border: 1px solid var(--border); }
.seg-g0 { background: var(--g0); } .seg-g1 { background: var(--g1); } .seg-g2 { background: var(--g2); } .seg-g3 { background: var(--g3); }
.seg-g4 { background: var(--g4); } .seg-g5 { background: var(--g5); } .seg-g6 { background: var(--g6); } .seg-g7 { background: var(--g7); }

/* Guilds & skills (guilds.js): wide = the guild rows in a left column that stays in view, the
   skills table beside it; narrow = one column, each guild row opens its trainables inline.
   guilds.js picks the layout from the panel's own width (880px). */
.gs { min-width: 0; }
.gs.wide { display: grid; grid-template-columns: minmax(330px, 384px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1800px) { .gs.wide { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); } }
.gs-left, .gs-right { display: grid; gap: 16px; align-content: start; min-width: 0; }
.gs.wide .gs-left { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; border-radius: var(--radius); }
.gs.wide .gs-left > .card { box-shadow: none; }
.gs.narrow .gs-left { display: grid; gap: 16px; }

.hm-character { display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; margin:16px 0; }
.hm-character h3 { margin:0 0 6px; }
.hm-character input { max-width:100%; width:200px; padding:8px 10px; border:1px solid var(--field-border); border-radius:6px; background:var(--surface); color:var(--text); font:inherit; }
.hm-character form { flex-wrap:wrap; }
.grows { list-style: none; margin: 0; padding: 0; }
.grow-item { border-top: 1px solid var(--border); padding: 6px; margin: 0 -6px; border-radius: var(--radius-sm); scroll-margin-top: calc(var(--top-h) + 12px); }
.grow-item.inactive .gname, .grow-item.inactive .gnums { opacity: .6; }
.grow-item.has-err { box-shadow: inset 3px 0 0 var(--err); }
.grow-item.sel { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.grow-item.sel.has-err { box-shadow: inset 3px 0 0 var(--err); }
.grow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "no name acts" ". level level"; gap: 4px 8px; align-items: center; }
.grow > .rowno { grid-area: no; } .grow > .gname { grid-area: name; } .grow > .glevel { grid-area: level; } .grow > .acts { grid-area: acts; }
.rowno { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; }
.gname { display: grid; gap: 2px; min-width: 0; }
.gname select { width: 100%; }
.glevel { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.maxl { white-space: nowrap; }
.gnums { display: inline-flex; flex-wrap: wrap; gap: 2px 14px; margin-left: auto; font-size: 13.5px; }
.gnum { white-space: nowrap; }
.gnum .lbl { margin-right: 2px; }
.gnum.tot { font-weight: 700; }
.acts { display: flex; gap: 0; justify-content: flex-end; align-items: center; }
.acts .btn.icon { min-width: 30px; min-height: 30px; padding: 4px; }
.rowhint { font-size: 12.5px; color: var(--muted); padding: 3px 0 0 36px; }
.rowissues { padding: 4px 0 0 36px; }
.rowdetails { margin: 6px 0 0 36px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13.5px; }
.rowtrain-head { padding: 4px 0 0 36px; display: grid; gap: 4px; }
.rowtrain-head .nothing { margin: 0; }
.rowshow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* a guild's quick targets (All · Core) and its train / study commands (skills.js GuildQuick): one tight line under its heading */
.guildquick { display: flex; flex-wrap: wrap; gap: 3px 14px; align-items: center; }
.guildquick .qline { grid-template-columns: 52px auto auto; gap: 6px; }
.guildquick .qb, .copycmd .qb { min-height: 22px; padding: 1px 7px; font-size: 12px; }
.sk-ghead .guildquick { flex-basis: 100%; padding-left: 19px; }
.guildquick:empty { display: none; }
.rowtrain .guildquick { padding: 2px 0 4px 12px; }   /* in line with the tables' headings (.skt) */
.copycmd { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.guildquick .copycmd { margin-left: auto; }      /* the copy at the right end of the guild's line (alone on its own line too) */
.copycmd .lbl { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.rowsub { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 13px; }
.rsub { white-space: nowrap; }
.rsub .lbl { margin-right: 2px; }
/* the change chips of a guild row's numbers sit in the line after the number: the left column
   clips what sticks out, and the lines above and below are close */
.grow-item .gnum .chip, .grow-item .rsub .chip { position: static; display: inline-block; margin-left: 4px; vertical-align: 1px; animation-name: chipfade; }
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rowtrain { margin: 2px 0 4px; padding: 4px 8px 6px; background: var(--surface-2); border-radius: var(--radius-sm); container: sk / inline-size; }
.rowtrain .empty { padding: 8px 0; }
.also { margin: 6px 0 4px; }
.addguild { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; }
.addguild select { min-width: 0; width: 100%; max-width: 420px; }
.addguild .pick { flex: 1 1 260px; }

/* quick targets for sets of trainables (skills.js QuickGrid): Min · Race · 80 · Max per line, with the line's exp */
.qgrid { position: relative; display: grid; gap: 3px; min-width: 0; }
.qline { display: grid; grid-template-columns: 70px auto minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.qlabel { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qlabel .muted { font-weight: 400; }
.qbtns { display: inline-flex; }
.qb { font: inherit; font-size: 12.5px; line-height: 1.2; min-height: 26px; padding: 2px 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; }
.qb + .qb { border-left: 0; }
.qb:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qb:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qb:hover { background: var(--surface-2); }
.qb.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.qb:focus-visible { position: relative; z-index: 1; }
.qexp { font-size: 12.5px; white-space: nowrap; }
.qfoot { grid-template-columns: 1fr; }
/* what a button would change: a bubble under the grid (no layout shift while the pointer moves over the buttons) */
.qhint { position: absolute; top: calc(100% + 3px); left: 0; z-index: 6; max-width: min(520px, 100%); font-size: 12px; line-height: 1.35; padding: 3px 8px;
  border-radius: 5px; background: var(--text); color: var(--surface); pointer-events: none; }
.qhint:empty { display: none; }
.racemax { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.racemax b { color: var(--text); }

/* ---- skills ------------------------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; }
.search { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: 0 0 0 8px; background: var(--surface); color: var(--muted); }
.search input { border: 0; min-width: 210px; background: transparent; outline: none; }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.sk-panel { container: sk / inline-size; scroll-margin-top: calc(var(--top-h) + 12px); }
.train-tools { margin-bottom: 4px; }
.gs.narrow .train-tools { border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 0; }
.chipbtn { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 999px; }
/* the tables: per guild row (or all) skills | spells side by side where the column has room
   (container "sk": the tables' card in the wide layout, a guild row's inline list in one column) */
.sk-tables { display: grid; gap: 14px; }
.sk-group { display: grid; gap: 6px; border-radius: var(--radius-sm); scroll-margin-top: calc(var(--top-h) + 12px); }
.sk-ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 5px 8px; background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 13.5px; scroll-margin-top: calc(var(--top-h) + 12px); }
.sk-group.sel .sk-ghead { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
/* selected: a mark on the left only (no padding: the tables keep their width, so their rows do not reflow) */
.sk-group.sel .skt { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.grp-name { all: unset; cursor: pointer; font-weight: 700; margin-right: 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
/* folding (skills.js): the chevron points right when folded */
.grp-name .ico { transition: transform .15s; color: var(--muted); }
.sk-group.folded .grp-name .ico { transform: rotate(-90deg); }
.sk-pair.folded .skt-head { padding-bottom: 0; }
.sk-group.folded { gap: 2px; }
.foldall { display: inline-flex; gap: 2px; margin-left: auto; }
.rowtrain.folded { padding: 2px 8px 4px; }
.grp-name:hover { color: var(--accent); }
.grp-name:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.grp-name .muted { font-weight: 400; }
.grp-meta { margin-right: auto; font-weight: 400; }
.sk-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 18px; align-items: start; }
/* side by side only where each table keeps its rows on one line (about 600px each) */
@container sk (min-width: 1220px) { .sk-pair.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.skt { container: skt / inline-size; min-width: 0; padding-left: 12px; }   /* room between the selected-guild line and the headings */
/* one table alone in a wide column (about 1080px at 2000x853) keeps its rows together; two side by side would wrap them */
.sk-pair > .skt { max-width: 880px; }
.skt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 2px 0 4px; }
.skt-title { font-size: 13.5px; margin: 0; }
.skt-title .muted { font-weight: 400; }
.qgrid.bare .qline { grid-template-columns: auto auto; }

.tt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tt thead th { position: sticky; top: var(--top-h); z-index: 3; background: var(--surface); text-align: left; font-size: 11.5px; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border-strong); padding: 5px 6px; white-space: nowrap; }
.tt thead th.numc { text-align: right; }
.sortbtn { all: unset; cursor: pointer; }
.sortbtn:focus-visible { outline: 3px solid var(--focus); }
.tt td, .tt tbody th { padding: 4px 5px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; font-weight: 400; }
.tt td.numc { text-align: right; }
.tt tbody tr:not(.tdet):hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tt tr.held > :first-child { box-shadow: inset 3px 0 0 var(--err); }
.tt tr.open > * { border-bottom-color: transparent; }
.c-name { min-width: 110px; }
.rnote { display: block; font-size: 12px; font-weight: 600; color: var(--accent); }
/* change chips in the table: beside cap and you-get (left of the right-aligned number), none on exp (the strip and subtotals say it) */
.tt .c-cap .num .chip, .tt .c-eff .num .chip { right: calc(100% + 3px); bottom: auto; top: 50%; margin-top: -8px; animation-name: chipfade; }
.tt .c-exp .num .chip { display: none; }
.c-tgt { width: 1%; }
.c-exp { white-space: nowrap; }
.namebtn { all: unset; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; border-radius: 3px; overflow-wrap: anywhere; }
.namebtn .ico { color: var(--faint); }
.namebtn:hover { color: var(--accent); }
.namebtn:hover .ico { color: var(--accent); }
.namebtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
/* core trainables (the Build advisor's skill map): a green edge on the row and a small badge */
tr.core > th.c-name { box-shadow: inset 3px 0 0 var(--ok); }
.badge.core-mark { background: var(--ok-soft); color: var(--ok); font-weight: 600; margin-left: 4px; cursor: help; }
.nbadges { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 5px; vertical-align: 1px; }
.nbadges .badge { padding: 0 5px; font-size: 11px; }
.nbadges button.badge { cursor: pointer; font: inherit; font-size: 11px; }
.badge.bg { background: var(--ok-soft); color: var(--ok); }
.tdet td { padding: 2px 6px 10px; background: var(--surface-2); }
.det { display: grid; gap: 4px; font-size: 13px; max-width: 72ch; }
.det p { margin: 0; }
.det .held { color: var(--err); }
.det-held { display: grid; gap: 4px; justify-items: start; }
.err-text { color: var(--err); }
.det-help { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 2px; color: var(--muted); }
.tgt { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.tgt input { width: 42px; text-align: right; padding-left: 3px; padding-right: 5px; min-height: 28px; flex: none; }
.tgt input::placeholder { color: var(--faint); font-style: italic; opacity: 1; font-size: 11px; letter-spacing: -.02em; }
@container skt (min-width: 600px) { .tgt { flex-wrap: nowrap; } }
/* the target track (skills.js TRow): 0-100 %, filled to the target; past the cap is out of reach */
.trk { display: grid; width: 190px; flex: none; padding: 0 6px; }
.trk-hit { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.trk-bar { position: relative; display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); }
.trk-bar i { position: absolute; top: 0; bottom: 0; display: block; }
.trk-out { right: 0; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(135deg, var(--surface-3) 0 3px, var(--border-strong) 3px 4px); opacity: .7; }
.trk-fill { left: 0; border-radius: 3px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.trk-fill.drag { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.trk-eff { left: 0; border-radius: 3px; background: var(--accent); }
.trk-tick { width: 2px; top: -3px !important; bottom: -3px !important; margin-left: -1px; background: var(--border-strong); border-radius: 1px; }
.trk-thumb { width: 12px; height: 12px; top: -3px !important; margin-left: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); transition: transform .1s ease-out; }
/* the thumb turns gold while its row's field has focus or it is dragged, and grows under the finger */
.tgt:focus-within .trk-thumb, .trk-fill.drag ~ .trk-thumb { background: var(--gold); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(233, 177, 59, .35); }
.trk-fill.drag ~ .trk-thumb { transform: scale(1.35); }
.trk-hit:hover .trk-bar { background: color-mix(in srgb, var(--accent) 12%, var(--surface-3)); }
.trk-lbls { position: relative; height: 16px; }
.trk-l { position: absolute; top: 0; transform: translateX(-50%); font: inherit; font-size: 11px; line-height: 16px; padding: 0 3px; border: 0; border-radius: 4px;
  background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.trk-l:hover { color: var(--text); background: var(--surface-2); }
.trk-l.on { color: var(--accent); font-weight: 700; }
/* the words under the tracks (Min · 80 · Race·Max) stay on a table's first row and on the row under the hand or with focus; the other
   rows keep the ticks (their titles hold the words, the buttons still take a click), so a table of 46 rows is not 46 legends.
   Touch screens, where nothing hovers, keep every label. */
@media (hover: hover) and (pointer: fine) {
  .trk-l { transition: opacity .15s ease-out; }
  .tt tbody tr:not(:first-child):not(:hover):not(:focus-within) .trk-l { opacity: 0; }
}
.tgt-hint { position: absolute; top: calc(100% + 2px); left: 0; z-index: 5; white-space: nowrap; font-size: 12px; padding: 2px 7px; border-radius: 5px;
  background: var(--text); color: var(--surface); pointer-events: none; }
.tt tr:not(:hover):not(:focus-within) .tgt-hint:not(.note) { display: none; }
.tt tr .tgt-hint.pin { display: block; }
.tip { display: inline; }
.tipbtn { all: unset; cursor: pointer; }
.infobtn { all: unset; cursor: pointer; color: var(--muted); display: inline-flex; padding: 2px; border-radius: 4px; }
.infobtn:hover { color: var(--accent); }
.infobtn:focus-visible { outline: 3px solid var(--focus); }

/* ---- popovers, dialogs -------------------------------------------------------------------- */
.pop { position: fixed; z-index: 60; max-width: min(440px, calc(100vw - 16px)); max-height: min(60vh, 520px); overflow: auto; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 13.5px; text-align: left; white-space: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
.tiptext h3 { font-size: 15px; margin-bottom: 6px; }
.tiptext .pre { margin-bottom: 8px; }
.dlg { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.dlg::backdrop { background: rgba(10, 16, 26, .45); }
.dlg-in { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 14px 16px 18px; overflow: auto; }
.dlg-foot { padding: 10px 16px 14px; border-top: 1px solid var(--border); margin: 0; }
/* the prerequisites dialog (main.js AutoNoteDialog) */
.unlock-list { margin: 6px 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.unlock-list.held { list-style: none; padding-left: 0; }
.unlock-fix { margin-top: 4px; }
.dlg.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); border-radius: 0; }
.dlg.drawer .dlg-in { height: 100%; max-height: 100vh; max-height: 100dvh; }
.linkbox { margin-bottom: 14px; }
.linkbox > label, .linkbox > b { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.linkrow { display: flex; gap: 6px; }
.linkrow input { flex: 1; font-size: 13px; }
.store-switch { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.plans-top, .row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.plans { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 8px; }
.plan-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; display: grid; gap: 6px; }
.plan-item.cur { border-color: var(--accent); }
.plan-open { all: unset; display: grid; gap: 1px; cursor: pointer; border-radius: 4px; }
.plan-open:disabled { cursor: default; }
.plan-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.plan-open:hover:not(:disabled) b { color: var(--accent); text-decoration: underline; }
.plan-acts, .confirm, .rename { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }
.rename input { flex: 1 1 200px; }
.plans-io h3 { margin-top: 8px; }

/* ---- stats & boons ------------------------------------------------------------------------ */
.tablewrap { overflow-x: auto; margin-bottom: 12px; }
.nt { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.nt th, .nt td { padding: 4px 7px; border-bottom: 1px solid var(--border); text-align: left; }
.nt thead th { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.nt thead th.numc, .nt td.numc { text-align: right; }
.nt tbody th { font-weight: 600; white-space: nowrap; }
.nt-grid { display: flex; flex-wrap: wrap; gap: 0 22px; }
.nt-grid > .tablewrap { flex: 1 1 auto; }
.nt-grid .nt th, .nt-grid .nt td { padding: 4px 5px; }
.grid5 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.grid7 { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.specials { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 0 10px; padding: 8px 12px 10px; }
.specials legend { font-weight: 700; padding: 0 4px; font-size: 14px; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; align-items: start; }
.spec-grid .field { margin: 0; }
.boon-group { margin-top: 12px; }
.boon-group h3 { font-size: 13.5px; color: var(--muted); }
.stats-wide .nt { width: auto; min-width: min(100%, 440px); }
.stats-wide .nt th, .stats-wide .nt td { padding-left: 14px; }
.stat-lines { display: none; list-style: none; margin: 0 0 12px; padding: 0; font-size: 13.5px; }
.stat-lines li { padding: 3px 0; border-bottom: 1px solid var(--border); }
.boon-search { margin: 4px 0 2px; }
.boon-search input { min-width: 260px; }
.boons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.boon { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 4px 12px; align-items: start; font-size: 13.5px; min-width: 0;
  padding: 6px 0; border-top: 1px solid var(--border); }
.boon-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; padding-top: 6px; }
.boon-code { display: block; font-size: 11px; }
.boon.on .boon-name .namebtn { color: var(--accent); }
/* the size chips (stats.js Boon): None · Tiny · Small · Medium · Full, each with its bonus and task points */
.boon-pick { display: grid; gap: 4px; min-width: 0; }
.boon-pick .seg { display: grid; grid-template-columns: .8fr repeat(4, 1fr); width: 100%; }
.boon-pick .seg-opt > span { display: block; padding: 3px 4px; font-size: 12.5px; line-height: 1.3; text-align: center; height: 100%; box-sizing: border-box; }
.boon-pick .seg-opt b { font-weight: 600; }
.boon-pick .seg-opt > span span { display: inline; padding: 0; border: 0; background: none; box-shadow: none; }
.boon-pick .seg-opt > span .bc-tp { display: block; }
.bc-val { font-size: 11.5px; color: var(--muted); }
.bc-tp { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.boon-pick .seg-opt.on > span { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.boon-pick .seg-opt.on .bc-val, .boon-pick .seg-opt.on .bc-tp { color: var(--accent); }
.boon-pick .seg-opt:not(.on):hover > span { background: var(--surface-2); }
.boon-banes { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 12.5px; min-height: 1.4em; }
.boon-banes .check { font-size: 12.5px; }
.addboon { max-width: 360px; margin-top: 8px; }

/* ---- quests, abilities -------------------------------------------------------------------- */
.qgroup { margin-top: 14px; }
.qgroup h3 { display: flex; align-items: center; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.qlist, .ablist { list-style: none; margin: 0; padding: 0; columns: 300px; column-gap: 28px; }
.qlist li, .ablist li { break-inside: avoid; display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; font-size: 13.5px; }
.qlist li .check, .ablist li .check { flex: 1 1 auto; font-size: 13.5px; }
.qlist li.gated .check > span { color: var(--muted); }
.qlv { display: inline-block; min-width: 26px; font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.qmeta { font-size: 12px; white-space: nowrap; }
/* by type (quests.js): each quest says its difficulty */
.qdiff { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; background: var(--surface-2); color: var(--muted); }
.qdiff.d6 { background: var(--info-soft); color: var(--info); }
.qdiff.d8 { background: var(--warn-soft); color: var(--warn); }
.qdiff.d10 { background: var(--err-soft); color: var(--err); }
.grp-check span { font-weight: 700; }

/* ---- equipment ---------------------------------------------------------------------------- */
/* eq finder (ui/eqfinder.js) */
.ef-top { display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: flex-start; }
.ef-stats { flex: 1 1 380px; }
.ef-h { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.ef-chip { font: inherit; font-size: 13px; padding: 3px 11px; margin: 0 5px 5px 0; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.ef-chip:hover { color: var(--text); }
.ef-chip.w1 { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); font-weight: 600; }
.ef-chip.w2 { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.ef-w { font-size: 11.5px; opacity: .85; }
.ef-rules { display: grid; gap: 3px; font-size: 13.5px; }
.ef-burden { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin: 12px 0 6px; font-size: 13px; }
.ef-burden .burden { margin: 0; max-width: none; height: 8px; }
.eftable { font-size: 13px; }
.eftable th[scope="row"] { color: var(--muted); font-weight: 600; white-space: nowrap; vertical-align: top; }
.eftable td { vertical-align: top; }
.eftable td:nth-child(2) { max-width: 0; width: 100%; }
.eftable tr.locked .ef-name { color: var(--accent); font-weight: 600; }
.ef-name { font-weight: 500; }
.ef-kg { display: none; }
.ef-alts { font-size: 12px; color: var(--muted); }
.ef-alts .btn.link { font-size: 12px; padding: 0; min-height: 0; }
.ef-spec { font-size: 12px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60ch; }
.ef-adds { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ef-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 13.5px; }
.ef-fill { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ef-fill select { width: auto; }
@media (max-width: 599px) {
  /* phones: each pick as a small card: slot, the item and its others, then what it adds and its weight */
  .eftable thead { display: none; }
  .eftable, .eftable tbody { display: block; }
  .eftable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .eftable tr > * { border: 0; padding: 0; }
  .eftable th[scope="row"], .eftable td:nth-child(2) { grid-column: 1 / -1; max-width: none; width: auto; }
  .ef-adds { white-space: normal; }
  .ef-spec { max-width: 100%; }
  .ef-fill { margin-left: 0; }
  .ef-kg { display: inline; }
}
.eq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 16px; align-items: start; }
.eqsets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
/* one set at a time (the switch above), the others kept in the page for jumps */
.eqsets[data-show="0"] > .eqset:not([data-set="0"]), .eqsets[data-show="1"] > .eqset:not([data-set="1"]),
.eqsets[data-show="2"] > .eqset:not([data-set="2"]) { display: none; }
.set-switch { margin-top: 8px; }
.eqset .slots { display: block; columns: 290px 2; column-gap: 20px; }
.eqset .slots .slot { break-inside: avoid; margin-bottom: 3px; }
.eq-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.eq-compare { position: sticky; top: calc(var(--top-h) + 12px); }
.eq-compare h2 { font-size: 15px; margin: 0 0 8px; }
.eqcmp { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.eqcmp th, .eqcmp td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.eqcmp .numc { text-align: right; }
.eqcmp tbody th { font-weight: 500; color: var(--muted); }
.eqcmp-set { font: inherit; font-weight: 600; border: 1px solid transparent; background: none; border-radius: 5px; padding: 1px 6px; cursor: pointer; color: var(--muted); }
.eqcmp-set:hover { color: var(--text); background: var(--surface-2); }
.eqcmp-set.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.eqfilters { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.eqfilters legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.eqfilters .check { font-size: 13px; }
.eqfilters .hint { flex-basis: 100%; }
.slots { display: grid; gap: 3px; }
.slot { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.slot .combo input { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
.slot > label { color: var(--muted); font-weight: 600; }
.combo { position: relative; min-width: 0; }
.combo input { width: 100%; font-size: 13px; text-overflow: ellipsis; padding-right: 28px; }
.combo-clear { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.combo-list { position: absolute; z-index: 50; top: calc(100% + 2px); left: 0; right: 0; min-width: 280px; max-height: 320px; overflow: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.combo-list li { padding: 5px 10px; font-size: 13px; cursor: pointer; }
.combo-list li[aria-selected="true"] { background: var(--accent-soft); }
.combo-list li.cur { font-weight: 700; }
.combo-list li.more { color: var(--muted); cursor: default; font-style: italic; }
.eqtotals { border-bottom: 1px solid var(--border); margin-bottom: 10px; padding-bottom: 6px; font-size: 13.5px; min-height: 2.4em; }
.dateline { display: flex; gap: 6px; align-items: center; }
/* Character tab: the batracker.net lookup (ui/batracker.js) */
.bt-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bt-line input { flex: 1 1 10em; min-width: 0; max-width: 16em; }
.bt-card { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--surface)); }
.bt-card p { margin: 0 0 4px; font-size: 13.5px; }
.bt-card .hint { margin: 6px 0 0; }
.bt-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.bt-inuse { display: inline-flex; gap: 5px; align-items: center; font-size: 13.5px; }

/* ---- the summary as a bottom sheet (no side column below 1200px) --------------------------- */
@media (max-width: 1199px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 12px; }
  .foot { padding-bottom: 84px; }
  .summary { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; max-height: 56px; overflow: hidden; border-radius: 14px 14px 0 0;
    border-bottom: 0; box-shadow: var(--shadow-lg); transition: max-height .25s ease; }
  /* open, it stops below the sticky header (on phones the change strip, with Undo), so a fix pressed here shows what it changed */
  .summary.open { max-height: min(82vh, calc(100vh - var(--strip-b, var(--top-h)) - 8px)); max-height: min(82dvh, calc(100dvh - var(--strip-b, var(--top-h)) - 8px)); overflow: auto; }
  .sheet-bar { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; background: var(--surface); color: var(--text);
    font: inherit; font-size: 15px; cursor: pointer; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); }
  .sheet-bar > span:first-child { flex: 1; text-align: left; }
  .sheet-bar b { font-size: 18px; margin-left: 6px; }
  .summary:not(.open) .sum-body { display: none; }
  .sheet-counts { display: flex; gap: 6px; }
  .cnt { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
  .cnt.error { background: var(--err); color: var(--on-err); }
  .cnt.warn { background: var(--warn-soft); color: var(--warn); }
  .cnt.ok { background: var(--ok-soft); color: var(--ok); }
  .sum-body { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .sum-issues { grid-column: 1 / -1; }
  .gs.wide .gs-left { max-height: calc(100vh - var(--top-h) - 24px - 60px); }    /* clear of the bottom sheet's bar */
}

/* guild rows in a narrow column or on a phone: the actions get a line of their own when the
   name would be squeezed (the guild card's width, not the window's) */
#sec-guilds { container: guilds / inline-size; }
@container guilds (max-width: 400px) {
  .qline { grid-template-columns: 58px auto minmax(0, 1fr); gap: 6px; }
  .qb { padding: 2px 7px; }
  .acts .btn.icon { min-width: 28px; padding: 3px; }
}

/* a table narrower than ~460px (container "skt", one table): each trainable as a small card,
   name on top, the target controls, then cap · you get · exp */
@container skt (max-width: 459px) {
  .skt .tt thead { display: none; }
  .skt .tt, .skt .tt tbody { display: block; }
  .skt .tt tr:not(.tdet) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "name name name" "tgt tgt tgt" "cap eff exp";
    gap: 4px 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
  .skt .tt tr.open:not(.tdet) { border-bottom-color: transparent; }
  .skt .tt tr:not(.tdet) > * { border: 0; padding: 0; min-width: 0; }
  .skt .trk { flex: 1 1 160px; width: auto; }
  .skt .tt tr.held:not(.tdet) { box-shadow: inset 3px 0 0 var(--err); padding-left: 8px; }
  .skt .tt tr.held > :first-child { box-shadow: none; }
  .skt .tt .c-name { grid-area: name; } .skt .tt .c-tgt { grid-area: tgt; width: auto; }
  .skt .tt td.c-cap { grid-area: cap; text-align: left; } .skt .tt td.c-eff { grid-area: eff; text-align: left; } .skt .tt td.c-exp { grid-area: exp; text-align: left; }
  .skt .tt .c-cap::before, .skt .tt .c-eff::before, .skt .tt .c-exp::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; font-weight: 400; }
  .skt .tt tr.tdet { display: block; }
  .skt .tt tr.tdet td { display: block; border-bottom: 1px solid var(--border); padding: 0 6px 8px; }
  .skt .tt tr:not(:hover):not(:focus-within) .tgt-hint { display: block; position: static; background: none; color: var(--muted); padding: 0; }
  .skt .tgt-hint { position: static; flex-basis: 100%; background: none; color: var(--muted); padding: 0; white-space: normal; line-height: 1.45; }
  /* the hint's line is kept free, so the first tap's hint does not push the table down */
  .skt .tgt::after { content: ""; flex-basis: 100%; height: calc(12px * 1.45); }
  .skt .tgt:has(.tgt-hint)::after { display: none; }
  .skt .tt tbody tr:last-child { border-bottom: 0; }
}

@media (max-width: 899px) {
  .eq-layout { grid-template-columns: minmax(0, 1fr); }
  .eq-compare { position: static; }
  .cols-stats, .cols-tax { grid-template-columns: minmax(0, 1fr); }
}

/* phones */
@media (max-width: 599px) {
  body { font-size: 14.5px; }
  /* only the change strip (with Undo) stays on top; the app bar scrolls away (main.js measures --top-h from the strip) */
  .top { display: contents; }
  .appbar { padding: 6px 10px; gap: 6px 8px; background: var(--surface); }
  .strip { position: sticky; top: 0; z-index: 30; box-shadow: var(--shadow); border-bottom: 1px solid var(--rule-gold); }
  .state { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
  /* one row: logo, site name, Save, More; the plan name under it (My plans and Share are in More) */
  .plan-name { flex-basis: 100%; order: 1; }
  .bar-wide { display: none; }
  .more-pop .more-item.bar-narrow { display: flex; }
  .more-pop .more-sec.bar-narrow { display: grid; }
  .strip { padding: 3px 10px; }
  .strip .btn span { display: none; }
  .strip-text { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 13px; line-height: 1.3; }
  .strip-text.full { display: block; -webkit-line-clamp: unset; line-clamp: none; }
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tl-long { display: none; }
  .tl-short { display: inline; }
  .sk-tools-toggle { display: inline-flex; }
  .sk-tools:not(.open) { display: none; }
  .stats-wide { display: none; }
  .stat-lines { display: block; }
  .boon-search input { min-width: 0; }
  .layout { padding: 10px 10px 84px; gap: 12px; }
  .banner { margin: 10px 10px 0; }
  .card { padding: 12px; border-radius: 8px; }
  .cols-char, .cols-stats, .cols-tax { grid-template-columns: minmax(0, 1fr); }
  .tab { padding: 6px 11px 6px 8px; font-size: 14px; gap: 6px; }
  .tab-sub { display: none; }
  .htile { width: 26px; height: 26px; margin-right: 8px; }
  .search input { min-width: 0; width: 100%; }
  .search { flex: 1 1 100%; }
  .kv.two { grid-template-columns: 1fr; }
  .rowhint, .rowissues, .rowtrain-head { padding-left: 0; }
  .rowdetails { margin-left: 0; }
  .rowtrain { margin-left: -6px; margin-right: -6px; padding: 2px 6px 4px; }
  .boon { grid-template-columns: minmax(0, 1fr); }
  .boon-name { padding-top: 0; }
  .seg-opt span { padding: 5px 9px; }
  .addguild select { min-width: 0; width: 100%; }
  .linkrow { flex-direction: column; }
  .slot { grid-template-columns: 66px minmax(0, 1fr); }
  .combo-list { min-width: 0; }
  .dlg { width: calc(100vw - 12px); }
  .foot { padding: 8px 10px 90px; }
}
/* short screens (landscape phones, short windows): the whole header would take ~40% of the height,
   so here too only the change strip stays on top (main.js STRIP_ONLY measures --top-h from it) */
@media (max-height: 500px) {
  .top { display: contents; }
  .appbar { background: var(--surface); }
  .strip { position: sticky; top: 0; z-index: 30; box-shadow: var(--shadow); border-bottom: 1px solid var(--rule-gold); }
}

/* touch screens: small buttons (bat.org notes, info, tooltips) get a tap height of at least 24px */
@media (pointer: coarse) {
  .badge.info, .infobtn, .termbtn, .namebtn { min-height: 24px; display: inline-flex; align-items: center; }
  .badge.info { padding: 3px 9px; }
  .qb, .guildquick .qb, .copycmd .qb { min-height: 32px; }
  .trk-hit { height: 30px; }
  .trk-lbls { height: 24px; }
  .trk-l { line-height: 24px; padding: 0 5px; }
  .btn.sm { min-height: 36px; }
  .btn.icon.sm { min-width: 36px; min-height: 36px; justify-content: center; }
  .strip .btn { min-width: 40px; min-height: 40px; justify-content: center; }
}
@media (pointer: coarse) { .no-touch { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .num.lit { background: var(--lit); }
  .chip { animation: none !important; opacity: 1; }
  .tab-mark.slide { transition: none; }
  .tab-cnt.popped { animation: none; }
  .panel-enter { animation: none; }
  .btn:active:not(:disabled):not([aria-disabled="true"]), .qb:active, .tab:active, .ef-chip:active, .seg-opt:active span, .trk-fill.drag ~ .trk-thumb { transform: none; }
  .issue.leaving { transition: none; }
  .trk-l { transition: none; }
}
@media print {
  /* the credit prints: the source banner (brand.css) and the footer; the controls do not */
  .appbar, .strip, .tabs, .tabs-box, .summary .sheet-bar, .toolbar, .acts, .train-tools, .qgrid, .rowshow, .tgt .trk { display: none !important; }
  .top { position: static; box-shadow: none; border: 0; }
  .gs.wide { display: block; }
  .gs.wide .gs-left { position: static; max-height: none; overflow: visible; }
  .layout { display: block; }
  .summary { position: static; max-height: none; box-shadow: none; }
}

/* ---- the two views (appbar.js): Reinc planner | Route planner, beside the site name ------------- */
.app-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.app-sw { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 4px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.app-sw:hover { color: var(--text); }
.app-sw.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.app-sw:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.app-sw .tl-short { display: none; }
/* the tools, then the stats (Players, History, Battle): a thin rule between the two groups */
.app-sw.grp { position: relative; margin-left: 7px; }
.app-sw.grp::before { content: ''; position: absolute; left: -5px; top: 22%; bottom: 22%; width: 1px; background: var(--border-strong); }
.more-sec.first { border-top: 0; margin-top: 0; }
.plan-name:empty { visibility: hidden; flex: 1 1 0; }      /* out of the planner: only the room left, so the views and the menu stay on one row */
@media (max-width: 599px) { .plan-name:empty { display: none; } }
@media (min-width: 1600px) and (min-height: 501px) {
  .top { grid-template-columns: auto auto minmax(200px, 300px) minmax(0, 1fr) auto; grid-template-areas: "brand switch name strip acts" "src src src src src"; }
  .top .app-switch { grid-area: switch; }
}
/* the short view names up to 1599px (seven views), so the bar (brand, views, name, buttons) stays one row down to ~1330px */
@media (max-width: 1599px) { .app-sw .tl-long { display: none; } .app-sw .tl-short { display: inline; } }
@media (max-width: 599px) {
  .app-switch { order: 1; flex: 1 1 100%; }
  .appbar .plan-name { order: 2; }
  .app-sw { flex: 1 1 0; justify-content: center; padding: 6px 8px; }
}

/* ---- Build advisor: the skill map (assets/js/ui/advisor.js) ---- */
.adv { display: grid; gap: 12px; min-width: 0; }
.adv h2, .adv h3 { margin: 0 0 6px; }
.adv-controls { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: end; }
.adv-controls .field { margin-bottom: 0; }
.adv-controls select { min-width: 220px; max-width: 100%; }
.adv-controls .search input { min-width: 0; width: 200px; }
.adv-sub { font-size: 13px; font-weight: 400; }
.adv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.adv-conf { font-size: 13px; margin: 4px 0 0; }
.adv-picks { margin-top: 8px; display: grid; gap: 4px; font-size: 14px; }
.adv-pick { display: inline-block; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; margin: 2px 0; }
.adv-sec > summary { cursor: pointer; list-style: none; }
.adv-sec > summary::-webkit-details-marker { display: none; }
.adv-sec > summary h3::before { content: '▸ '; color: var(--muted); }
.adv-sec[open] > summary h3::before { content: '▾ '; }
.adv-sec h3 { font-size: 15px; font-weight: 600; }
.adv-sec h3 .muted { font-weight: 400; font-size: 13px; }
.adv-tier { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 13px; }
.adv-t-core { background: var(--ok-soft); color: var(--ok); }
.adv-t-useful { background: var(--info-soft); color: var(--info); }
.adv-t-situational { background: var(--surface-3); color: var(--text); }
.adv-t-prereq { background: var(--warn-soft); color: var(--warn); }
.adv-t-filler { background: var(--surface-2); color: var(--muted); }
.adv-tablewrap { overflow-x: auto; margin-top: 6px; }
.adv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adv-table th, .adv-table td { text-align: left; vertical-align: top; padding: 5px 8px; border-top: 1px solid var(--border); }
.adv-table thead th { border-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.adv-table tbody th { font-weight: 600; white-space: nowrap; }
.adv-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adv-kind { font-size: 12px; font-weight: 400; }
.adv-src { font-size: 12px; color: var(--muted); white-space: nowrap; }
.adv-src-default, .adv-src-rule { color: var(--warn); }
.adv-credit { font-size: 12.5px; margin: 0; }
@media (max-width: 599px) {
  .adv-table tbody th { white-space: normal; }
  .adv-controls select, .adv-controls .search input { width: 100%; min-width: 0; }
  .adv-controls .field { flex: 1 1 100%; }
}
.adv-views { display: flex; gap: 6px; flex-wrap: wrap; }
.adv-form { display: grid; gap: 8px; }
.adv-wish input { width: 100%; font-size: 16px; }
.adv-read { align-items: center; }
.adv-row { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: start; }
.adv-row .field { margin-bottom: 0; min-width: 150px; }
.adv-row input[type="text"], .adv-row input[type="number"] { width: 150px; }
.adv-go { align-self: center; padding-top: 6px; }
.adv-bad { color: var(--err); }
.adv-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.adv-link:hover { color: var(--accent-hover); }
.adv-results { display: grid; gap: 12px; }
.adv-note { display: flex; gap: 8px; align-items: flex-start; background: var(--info-soft); color: var(--text); }
.adv-build-meta { margin: 0 0 6px; color: var(--muted); }
.adv-rows { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; padding-left: 20px; }
.adv-why { margin: 0 0 8px; padding-left: 20px; }
.adv-why li { margin: 2px 0; }
.adv-build p { margin: 4px 0; }
.adv-build .row-btns { margin: 8px 0 0; }
.adv-vitals { font-size: 14px; font-variant-numeric: tabular-nums; }
.adv-races summary { cursor: pointer; color: var(--muted); font-size: 14px; margin: 4px 0; }
.adv-chosen th, .adv-chosen td { background: var(--accent-soft); }
.adv-tips { margin: 6px 0 8px; padding: 8px 12px; border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; }
.adv-tips ul { margin: 4px 0 0; padding-left: 18px; }
.adv-tips li { margin: 3px 0; }
.adv-src-links { font-size: 12.5px; color: var(--muted); }
.adv-src-links a { color: var(--muted); }
.adv-race-note { font-size: 12.5px; color: var(--muted); min-width: 180px; }
.adv-races .adv-table { max-width: 820px; }
@media (max-width: 599px) {
  .adv-row .field, .adv-row input[type="text"], .adv-row input[type="number"], .adv-row select { width: 100%; flex: 1 1 100%; }
}

/* ---- Guild map (assets/js/ui/guildmap.js) ---- */
.gm { display: grid; gap: 12px; min-width: 0; }
.gm h2, .gm h3 { margin: 0 0 6px; }
.gm-controls { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: end; }
.gm-controls .field { margin-bottom: 0; }
.gm-ex { padding-bottom: 6px; }
.gm-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.gm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gm-key { display: inline-block; width: 18px; height: 12px; border-radius: 3px; border: 2px solid var(--accent); background: var(--accent-soft); }
.gm-info p { margin: 4px 0; }
.gm-info .row-btns { margin: 8px 0 0; }
.gm-wrap { overflow-x: auto; padding: 10px; }
.gm-svg { display: block; max-width: none; font-family: var(--font); }
.gm-band-bg { fill: var(--surface-2); stroke: var(--border); }
.gm-band.mine .gm-band-bg { stroke: var(--accent); stroke-width: 2; }
.gm-band-label { font-size: 15px; font-weight: 700; fill: var(--text); }
.gm-band-sub { font-size: 12px; fill: var(--muted); }
.gm-node { cursor: pointer; outline: none; }
.gm-node rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.gm-node .gm-name { font-size: 13px; font-weight: 600; fill: var(--text); }
.gm-node .gm-max { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.gm-node.mine rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.gm-node:hover rect { stroke: var(--accent); }
.gm-node:focus-visible rect { stroke: var(--focus); stroke-width: 3; }
.gm-node.sel rect { fill: var(--accent); stroke: var(--accent); }
.gm-node.sel .gm-name, .gm-node.sel .gm-max { fill: var(--on-accent); }
.gm-node.rel rect { stroke: var(--accent); stroke-width: 2.5; }
.gm-node.dim { opacity: .35; }
.gm-e-all, .gm-e-any { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.gm-e-any { stroke-dasharray: 5 4; }
.gm-e-all.on, .gm-e-any.on { stroke: var(--accent); stroke-width: 2.5; }
.gm-e-all.dim, .gm-e-any.dim { opacity: .2; }
.gm-arrowhead { fill: var(--muted); }
.gm-e-ex { fill: none; stroke: var(--err); stroke-width: 1.4; stroke-dasharray: 2 4; opacity: .8; }
.gm-legend line { stroke-width: 2; }
/* the tabs' hover: a lift, the icon's tilt, a gold line growing from the middle (the open tab keeps its sliding mark) */
.tab { position: relative; transition: background-color .15s ease, color .15s ease, transform .18s ease, box-shadow .18s ease; }
.tab .ico { transition: transform .22s cubic-bezier(.2, 1.6, .4, 1), color .15s ease; }
.tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold);
  transform: scaleX(0); transition: transform .22s ease; pointer-events: none; }
.tab:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .35); }
.tab:hover .ico { transform: scale(1.15) rotate(-8deg); color: var(--accent); }
.tab:not(.on):hover::after { transform: scaleX(1); }
.tab:active { transform: translateY(0); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .tab, .tab .ico, .tab::after { transition: none; } .tab:hover { transform: none; } .tab:hover .ico { transform: none; } }
/* five views on a narrow phone: each button's icon over its short name, so all fit in a row */
@media (max-width: 480px) {
  .app-sw { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 11.5px; min-width: 0; }
  .app-sw .tl-short { white-space: nowrap; }
}
