/*
 * style.css - ZugBoard dashboard styles.
 *
 * Dark, night-friendly theme for a 2560x1440 second monitor that still works
 * at 1920x1080 and down to 1280 px wide. Type scales with the window width
 * (root font size), so every size below is in rem.
 *
 * Color roles:
 *   --m-*   chart marks (validated as a set for color-blind separation on the
 *           #161a20 panel: XP, rested, gold, gathering, loss, quest)
 *   --t-*   brighter text and icon versions of the same roles
 *   --q0-5  WoW item quality colors (rare and epic brightened for contrast)
 *   --coin-* gold, silver and copper unit letters in money amounts
 *   --accent the selected character's class color, set by app.js
 *
 * Sections: tokens, base, header and tabs, banner, layout, panels, XP hero,
 *   ... and last, the guild board (guild.html): class color tokens, the three
 *   freshness steps, chips, the milestone list and the profession cards.
 * stat tiles, road to 60, gathering and money, feed, charts, tables, meters,
 * character, legacy, log, setup, utilities, responsive, reduced motion.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;

  --bg: #0f1216;
  --bg-head: #12161b;
  --panel: #171b22;
  --panel-head: #1b2028;
  --panel-line: #2c333d;
  --raised: #1c2129;
  --inset: #0b0e12;
  --line: #262c35;
  --line-2: #333a45;

  --ink: #ebe9e4;
  --ink-2: #b3b1aa;
  --ink-3: #878c96;
  --ink-4: #6b707a;

  --accent: #c69b6d;

  --m-xp: #b553f9;
  --m-rested: #2b6cab;
  --m-gold: #bd8a0a;
  --m-gather: #1ea87b;
  --m-loss: #cc3143;
  --m-quest: #327ca9;

  --t-xp: #c992ff;
  --t-rested: #6ea8ff;
  --t-gold: #e8b85a;
  --t-gather: #3fc99a;
  --t-quest: #6eb0e0;
  --t-loss: #f2716a;
  --t-live: #4fd283;
  --t-warn: #f0a73c;

  --coin-g: #e8b85a;
  --coin-s: #c9cdd4;
  --coin-c: #d48c56;

  --q0: #9d9d9d;
  --q1: #ffffff;
  --q2: #1eff00;
  --q3: #3d95ff;
  --q4: #b55cf7;
  --q5: #ff8000;

  --grid: #232831;
  --axis: #3a414c;

  --r-lg: 10px;
  --r: 7px;
  --r-sm: 5px;

  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-big: "Segoe UI Variable Display", "Segoe UI", "Inter Display", "Inter", system-ui, -apple-system, Arial, sans-serif;
  --font-code: "Cascadia Mono", Consolas, "DejaVu Sans Mono", ui-monospace, monospace;

  --gap: 1.25rem;
  --pad: 1.25rem;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* 14 px at 1280 wide, about 16.7 px at 1920, about 19.4 px at 2560. */
  font-size: clamp(14px, 0.42vw + 8.6px, 20px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

code, kbd.cmd {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  color: var(--ink);
}

/* ------------------------------------------------------- header and tabs */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-head);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 1rem 2.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 2rem 0.4rem;
}

.who { min-width: 0; }

.who-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.who-name {
  font: 600 1.7rem/1.1 var(--font-big);
  color: var(--accent);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.who-level {
  font: 600 1rem/1 var(--font);
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-variant-numeric: tabular-nums;
}

.who-sub {
  margin-top: 0.2rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  white-space: nowrap;
}

.who-sub .guild { color: var(--ink); margin-left: 0.6rem; }
.who-sub .rank { color: var(--ink-3); margin-left: 0.35rem; }

.where {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
  padding-left: 2.75rem;
  border-left: 1px solid var(--line);
}

.where-icon { font-size: 1.2rem; margin-top: 0.2rem; color: var(--ink-3); }
.where-zone { font-size: 1.25rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.where-sub { color: var(--ink-2); font-size: 0.95rem; white-space: nowrap; display: flex; gap: 0.6rem; align-items: center; }

.inst-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--t-warn);
  border: 1px solid color-mix(in srgb, var(--t-warn) 45%, transparent);
  border-radius: 999px;
  padding: 0 0.55rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.status-live {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.status-note { color: var(--ink-3); margin-left: -0.35rem; }
.status-note .icon { font-size: 1rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.85rem 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
}

.pill-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.pill-live { color: var(--t-live); background: color-mix(in srgb, var(--t-live) 12%, transparent); border-color: color-mix(in srgb, var(--t-live) 50%, transparent); }
.pill-idle { color: var(--t-warn); background: color-mix(in srgb, var(--t-warn) 10%, transparent); border-color: color-mix(in srgb, var(--t-warn) 45%, transparent); }
.pill-off { color: var(--ink-3); background: transparent; border-color: var(--line-2); }
.pill-warn { color: var(--t-warn); background: color-mix(in srgb, var(--t-warn) 10%, transparent); border-color: color-mix(in srgb, var(--t-warn) 45%, transparent); }
.pill-sample { color: var(--t-rested); background: color-mix(in srgb, var(--t-rested) 10%, transparent); border-color: color-mix(in srgb, var(--t-rested) 45%, transparent); }

.pill-live .pill-dot { animation: pulse 2.4s ease-in-out infinite; }
.pill-warn .pill-dot { display: none; }
.pill .icon { font-size: 0.95rem; }
.pill-warn .icon { animation: spin 1.6s linear infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  50% { box-shadow: 0 0 0 0.3rem color-mix(in srgb, currentColor 0%, transparent); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.mini { display: flex; flex-direction: column; line-height: 1.2; }
.mini-label { color: var(--ink-3); font-size: 0.78rem; }
.mini-value { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-sub { color: var(--ink-3); font-size: 0.78rem; white-space: nowrap; }

/* Last sync: the time the board's numbers are from, so it is the biggest number up here. */
.mini-sync {
  padding: 0.3rem 0.8rem 0.3rem 0.75rem;
  border-left: 3px solid var(--t-live);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: color-mix(in srgb, var(--t-live) 7%, transparent);
}
.mini-sync { min-width: 8.6rem; }
.mini-sync .mini-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-sync.is-nudge { border-left-color: var(--t-warn); background: color-mix(in srgb, var(--t-warn) 9%, transparent); }
.mini-sync.is-nudge .mini-value, .mini-sync.is-nudge .mini-sub { color: var(--t-warn); }

/* The board's own refresh, small by the tabs: a dot (green while the stream is up) and the age. */
.conn { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-4); font-size: 0.78rem; white-space: nowrap; }
.conn-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--ink-4); }
.conn.is-live .conn-dot { background: var(--t-live); }

.char-switch { display: flex; flex-direction: column; line-height: 1.2; gap: 0.15rem; }

.char-switch select {
  appearance: none;
  background-color: var(--raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23b3b1aa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0.35rem 2rem 0.35rem 0.7rem;
  font-size: 0.95rem;
  min-width: 12rem;
  cursor: pointer;
}

.char-switch select:hover { border-color: var(--ink-4); }
.char-switch option { background: var(--panel); color: var(--ink); }

.tabs {
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0 1.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.tab kbd {
  font: 500 0.72rem/1.35 var(--font);
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  min-width: 1.25rem;
  padding: 0 0.3rem;
  text-align: center;
}

.tab[aria-selected="true"] kbd { color: var(--ink-2); border-color: var(--ink-4); }

.tabs-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  padding: 0 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge-demo {
  color: var(--t-warn);
  border-color: color-mix(in srgb, var(--t-warn) 55%, transparent);
  background: color-mix(in srgb, var(--t-warn) 10%, transparent);
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------- banner */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 1.1rem 2rem 0;
  padding: 0.75rem 0.9rem 0.75rem 1rem;
  background: color-mix(in srgb, var(--t-warn) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--t-warn) 40%, var(--line));
  border-radius: var(--r);
  color: var(--ink);
}

.banner-icon { color: var(--t-warn); font-size: 1.15rem; margin-top: 0.12rem; }
.banner-list { flex: 1; display: grid; gap: 0.25rem; }

.icon-btn {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  padding: 0.25rem;
  line-height: 0;
  cursor: pointer;
}

.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn .icon { font-size: 1.05rem; }

/* ---------------------------------------------------------------- layout */
main { padding: 1.15rem 2rem 1.6rem; }

/* Panels in the same row share one height. */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ---------------------------------------------------------------- panels */
/* Cards: a step lighter than the page, their own border, and a title band with an
   accent bar in the character's class color (test 4: titles did not stand out). */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem 1rem;
  flex-wrap: wrap;
  padding: 0.75rem var(--pad) 0.7rem;
  margin-bottom: 0.4rem;
  background: var(--panel-head);
  border-bottom: 1px solid var(--panel-line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.panel-head h2::before {
  content: "";
  width: 0.24rem;
  height: 1.05em;
  border-radius: 2px;
  background: var(--accent);
}

.panel-meta { color: var(--ink-3); font-size: 0.88rem; }

.link-btn {
  margin-left: auto;
  appearance: none;
  background: none;
  border: 0;
  color: var(--ink-3);
  font-size: 0.85rem;
  padding: 0.1rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 0.2em;
}

.link-btn:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

.panel-body { padding: 0.5rem var(--pad) var(--pad); }
.panel-body.flush { padding: 0.25rem 0 0.5rem; }

/* Chart panels grow to their row's height; the chart box takes what is left. */
.panel-col { display: flex; flex-direction: column; }

.chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.6rem var(--pad) var(--pad) calc(var(--pad) - 0.25rem);
}

.chart-box { position: relative; flex: 1; min-height: 15rem; }
.chart-box.short { min-height: 11rem; }
.chart-box > .ch, .chart-box > .chart-empty { position: absolute; left: 0; top: 0; }
.chart-box > .chart-empty { right: 0; bottom: 0; height: auto !important; }
.chart-table { padding: 0 var(--pad) var(--pad); max-height: 24rem; overflow: auto; }

.empty {
  color: var(--ink-3);
  font-size: 0.95rem;
  padding: 0.4rem 0 0.2rem;
}

.empty strong { color: var(--ink-2); font-weight: 600; }

.footnote {
  margin-top: 1rem;
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------- XP hero */
.xp-hero { padding: 0.2rem 0 1.15rem; }

.xp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.xp-head-left { display: flex; align-items: baseline; gap: 0.4rem 1.3rem; flex-wrap: wrap; }

.xp-pct {
  font: 600 3.6rem/0.95 var(--font-big);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.xp-of { color: var(--ink-2); font-size: 1.15rem; }
.xp-of b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.xp-eta { text-align: right; }
.xp-eta-main { font: 600 1.85rem/1.1 var(--font-big); color: var(--ink); }
.xp-eta-main .tnum { color: var(--ink); }
.xp-eta-sub { color: var(--ink-2); font-size: 1rem; margin-top: 0.2rem; }

.xp-track-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem 1.1rem;
}

.xp-lvl {
  font: 300 2.5rem/1 var(--font-big);
  color: var(--ink);
  min-width: 2.2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.xp-lvl.next { color: var(--ink-3); }

.xp-wrap { position: relative; }

.xp-bar {
  position: relative;
  height: 2.75rem;
  background: var(--inset);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
}

.xp-fill,
.xp-rested {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.xp-fill { background: var(--m-xp); }

/* A faint top sheen, the way the in-game bar catches light. */
.xp-fill::after {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
}

.xp-rested { background: var(--m-rested); }

.xp-rested-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #eaf2ff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.6rem;
  pointer-events: none;
}

/* Twenty bubbles: a dark notch every 5 percent. */
.xp-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to right,
    transparent 0, transparent calc(5% - 1px),
    rgba(0, 0, 0, 0.55) calc(5% - 1px), rgba(0, 0, 0, 0.55) 5%);
}

.xp-bar.is-max .xp-fill { background: var(--m-gold); }

.xp-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 2.2rem;
  color: var(--ink-2);
  font-size: 1.02rem;
}

.xp-foot b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.swatch {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 2px;
  margin-right: 0.45rem;
  vertical-align: -0.05em;
}

.swatch-xp { background: var(--m-xp); }
.swatch-rested { background: var(--m-rested); }

/* ----------------------------------------------------------- stat tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--panel-line);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Inside the "At a glance" card the card draws the frame and the title band. */
.kpi-panel { overflow: hidden; }
.kpi-panel .panel-head { margin-bottom: 0; }
.kpi-panel .kpis { border: 0; border-radius: 0; box-shadow: none; }

.kpi {
  background: var(--panel);
  padding: 0.8rem var(--pad) 0.75rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.kpi-label .icon { font-size: 0.95rem; }

.kpi-value {
  font: 600 2.35rem/1.12 var(--font-big);
  letter-spacing: -0.015em;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value .unit { font-size: 0.5em; font-weight: 500; color: var(--ink-3); margin-left: 0.3rem; letter-spacing: 0; }
.kpi-sub { color: var(--ink-3); font-size: 0.88rem; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { color: var(--ink-2); font-weight: 600; }
.kpi-spark { height: 2.3rem; margin-top: 0.45rem; }
.kpi.no-spark .kpi-spark { display: none; }

.kpi-xp .kpi-label .icon { color: var(--t-xp); }
.kpi-gold .kpi-label .icon { color: var(--t-gold); }
.kpi-gather .kpi-label .icon { color: var(--t-gather); }
.kpi-kill .kpi-label .icon { color: var(--ink-2); }
.kpi-death .kpi-label .icon { color: var(--t-loss); }

/* ---------------------------------------------------------- road to 60 */
.road-panel { margin-top: var(--gap); }

.road { margin-top: 0.15rem; }

.road-line {
  position: relative;
  padding: 0 calc(var(--pad) + 0.5rem);
}

.road-nums { position: relative; height: 1.25rem; }

.road-num {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.road-num.is-start { font-weight: 400; color: var(--ink-4); }
.road-num.is-next { color: var(--ink); }
.road-num.is-done { color: var(--accent); }

.road-rail {
  position: relative;
  height: 1.7rem;
}

.road-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.42rem;
  transform: translateY(-50%);
  background: var(--raised);
  border-radius: 999px;
}

.road-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 0.42rem;
  transform: translateY(-50%);
  background: var(--m-xp);
  border-radius: 999px;
}

.road-tick {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 0.9rem;
  transform: translate(-50%, -50%);
  background: var(--line-2);
}

.road-you {
  position: absolute;
  top: 50%;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--m-xp);
  box-shadow: 0 0 0 3px var(--panel);
}

.road-mark {
  position: absolute;
  top: 50%;
  width: 0.95rem;
  height: 0.95rem;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid var(--ink-2);
  background: var(--panel);
  border-radius: 2px;
}

.road-mark.is-done { background: var(--accent); border-color: var(--accent); }
.road-mark.is-next { border-color: var(--ink); }

/* Milestone strip under the track: one cell per milestone, hairline dividers. */
.road-cells {
  display: grid;
  margin-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.road-cell {
  min-width: 0;
  padding: 0.6rem var(--pad) 0.75rem;
  border-left: 1px solid var(--line);
}

.road-cell:first-child { border-left: 0; }

.rc-top { display: flex; align-items: baseline; gap: 0.55rem; min-width: 0; }
.rc-lv { font: 600 1.3rem/1.1 var(--font-big); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rc-what { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-eta { margin-left: auto; padding-left: 0.5rem; font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.rc-sub { color: var(--ink-3); font-size: 0.86rem; margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.road-cell.is-next .rc-lv, .road-cell.is-next .rc-what { color: var(--ink); }
.road-cell.is-next .rc-sub { color: var(--ink-2); }
.road-cell.is-done .rc-lv { color: var(--accent); }
.road-cell.is-done .rc-eta { color: var(--t-live); }

/* ------------------------------------------------ gathering and money */
.live-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.skill-row { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.skill-row:last-child { margin-bottom: 0; }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.skill-name { font-weight: 600; }
.skill-rank { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.skill-rank b { color: var(--ink); font-weight: 600; }
.skill-extra { color: var(--ink-3); font-size: 0.88rem; margin-left: 0.75rem; }

/* Four facts in a row when the panel is wide enough, otherwise two by two. */
#live-gather { container-type: inline-size; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

@container (min-width: 34rem) {
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.fact { display: flex; flex-direction: column; min-width: 0; }
.fact-label { color: var(--ink-3); font-size: 0.85rem; }
.fact-value { font-size: 1.2rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; margin-bottom: 0.5rem; padding-bottom: 0.45rem; border-bottom: 1px solid var(--line); }
.flow-title { color: var(--ink-2); }
.flow-total { font-size: 1.2rem; font-weight: 600; white-space: nowrap; }
.flow-row { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.22rem 0; }
.flow-row .src { color: var(--ink-2); }
.flow-row .money { font-variant-numeric: tabular-nums; }
.flow-net { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); color: var(--ink-2); display: flex; justify-content: space-between; gap: 1rem; }
.flow-net .money { font-weight: 600; }

/* ------------------------------------------------------------------ feed */
.feed-panel { display: flex; flex-direction: column; min-height: 0; }

.feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.2rem 0 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.feed-item {
  display: grid;
  grid-template-columns: 4.9rem 1.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 0.6rem;
  padding: 0.6rem var(--pad);
  border-top: 1px solid var(--line);
}

.feed-item:first-child { border-top-color: transparent; }

.feed-when { display: flex; flex-direction: column; line-height: 1.25; font-variant-numeric: tabular-nums; }
.feed-when .clock { color: var(--ink-2); font-size: 0.92rem; white-space: nowrap; }
.feed-when .rel { color: var(--ink-4); font-size: 0.8rem; white-space: nowrap; }

.feed-icon {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 0.95rem;
  margin-top: 0.05rem;
}

.feed-text { color: var(--ink); overflow-wrap: anywhere; line-height: 1.35; padding-top: 0.08rem; }

/* Rows and slots with an item tooltip respond to hover and keyboard focus. */
.feed-item[data-item-tip]:hover,
.dslot[data-item-tip]:hover,
.wskill[data-item-tip]:hover,
.tbl tr[data-item-tip]:hover { background: rgba(255, 255, 255, 0.035); }
.feed-item[data-item-tip]:focus-visible,
.dslot[data-item-tip]:focus-visible,
.wskill[data-item-tip]:focus-visible,
.tbl tr[data-item-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* Item names that link out (only when the server has an item link template). */
.item-link { text-decoration: none; }
.item-link:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.feed-text b { font-weight: 600; }

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--t-live);
  font-size: 0.78rem;
  font-weight: 600;
  padding-top: 0.2rem;
  white-space: nowrap;
}

.live-tag::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.t-xp { color: var(--t-xp); }
.t-level { color: var(--t-xp); }
.t-money { color: var(--t-gold); }
.t-gather, .t-skill { color: var(--t-gather); }
.t-quest { color: var(--t-quest); }
.t-death { color: var(--t-loss); }
.t-loot, .t-equip { color: var(--ink-2); }
.t-zone, .t-instance, .t-session, .t-note, .t-other { color: var(--ink-3); }

.feed-item.is-level { background: color-mix(in srgb, var(--m-xp) 9%, transparent); }
.feed-item.is-level .feed-text { font-weight: 600; }
.feed-item.is-death { background: color-mix(in srgb, var(--m-loss) 8%, transparent); }

.feed-empty { padding: 1rem var(--pad); color: var(--ink-3); }

/* ---------------------------------------------------------------- charts */
.ch { display: block; overflow: visible; font-family: var(--font); }
.ch-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ch-base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ch-tick { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ch-ylabel, .ch-xlabel { fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.ch-marker { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.ch-marker-label { fill: var(--ink-2); font-weight: 600; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill-opacity: 0.12; stroke: none; }
.ch-dot { stroke: var(--panel); stroke-width: 2; }
.ch-endlabel { fill: var(--ink); font-weight: 600; }
.ch-cross { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.ch-hit { fill: transparent; pointer-events: all; }
.ch-time { outline: none; }
.ch-time:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ch-bar-label { fill: var(--ink-2); }
.ch-bar-value { fill: var(--ink); font-weight: 600; }
.ch-bar { transition: opacity 120ms ease; }
.ch-bars .ch-bar-row { outline: none; cursor: default; }
.ch-bars .ch-bar-row.is-hover .ch-bar,
.ch-bars .ch-bar-row:focus-visible .ch-bar { opacity: 0.78; }
.ch-bars .ch-bar-row:focus-visible .ch-bar-label { fill: var(--ink); }
.ch-spark-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch .cu-g { fill: var(--coin-g); }
.ch .cu-s { fill: var(--coin-s); }
.ch .cu-c { fill: var(--coin-c); }

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 5rem;
  color: var(--ink-3);
  font-size: 0.95rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  text-align: center;
  padding: 1rem;
}

.chart-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: #0d1015;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.7rem 0.5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  max-width: 22rem;
}

.tip-value { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1rem; color: var(--ink); white-space: nowrap; }
.tip-key { width: 0.85rem; height: 2px; border-radius: 1px; flex: none; }
.tip-label { color: var(--ink-3); font-size: 0.82rem; margin-top: 0.1rem; }

/* ---------------------------------------------------------------- tables */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--pad); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--pad); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-compact td { padding-top: 0.32rem; padding-bottom: 0.32rem; }
.tbl-compact th:first-child, .tbl-compact td:first-child { padding-left: 0; }
.tbl-compact th:last-child, .tbl-compact td:last-child { padding-right: 0; }
.tbl tr.is-current td { color: var(--ink-2); }
.tbl tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 600; }

.sort-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sort-btn:hover { color: var(--ink); }
.sort-btn .icon { font-size: 0.85rem; opacity: 0; }
.sort-btn.is-sorted { color: var(--ink); }
.sort-btn.is-sorted .icon { opacity: 1; }
.sort-btn.is-asc .icon { transform: rotate(180deg); }

/* ---------------------------------------------------------------- meters */
.meter {
  --c: var(--ink-2);
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 20%, var(--panel));
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--c);
  border-radius: 999px;
}

.skill-group-title { color: var(--ink-3); font-size: 0.85rem; margin: 1.1rem 0 0.55rem; }
.skill-group-title:first-child { margin-top: 0.2rem; }

/* ------------------------------------------------------------------ stats */
.stat-list { display: grid; gap: 0; }

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.stat-line:last-child { border-bottom: 0; }
.stat-line .k { color: var(--ink-2); }
.stat-line .k small { display: block; color: var(--ink-3); font-size: 0.82rem; }
.stat-line .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.stat-line .v.big { font-size: 1.35rem; }

.hero-stat { padding-bottom: 0.9rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.hero-stat-value { font: 600 2.6rem/1.1 var(--font-big); letter-spacing: -0.015em; }
.hero-stat-label { color: var(--ink-2); margin-top: 0.15rem; }

.stepper { display: inline-flex; align-items: center; gap: 0.35rem; }

.stepper button {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.stepper button:hover { border-color: var(--ink-4); }
.stepper .val { min-width: 2.6rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- milestones */
.ms-list { display: grid; }

.ms {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.ms:last-child { border-bottom: 0; }
.ms-lv { font: 600 1.45rem/1 var(--font-big); font-variant-numeric: tabular-nums; }
.ms-what { color: var(--ink); }
.ms-when { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms-sub { grid-column: 2 / 4; color: var(--ink-3); font-size: 0.85rem; }
.ms.is-done .ms-lv { color: var(--accent); }
.ms.is-done .ms-when { color: var(--t-live); }

/* -------------------------------------------------------------- character */
/* Laid out like the in-game character pane: equipment beside the stat sheet,
   then weapon skills beside the attack table. Rows share a height. */
.char-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

.char-doll { grid-column: span 7; }
.char-stats { grid-column: span 5; }
.char-skills { grid-column: span 7; }
.char-table { grid-column: span 5; }

/* Equipment: slot columns either side of the character's summary, weapons below. */
.doll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 0.6fr) minmax(0, 1fr);
  grid-template-areas: "left center right" "weapons weapons weapons";
  gap: 0 0.8rem;
  padding: 0.3rem var(--pad) var(--pad);
}

.doll-left { grid-area: left; }
.doll-right { grid-area: right; }
.doll-col { display: flex; flex-direction: column; gap: 0.15rem; }

.doll-center {
  grid-area: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.3rem;
  padding: 1rem 0.5rem;
  text-align: center;
  border-radius: var(--r);
  background: radial-gradient(closest-side circle at 50% 45%, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
}

.doll-who { line-height: 1.25; }
.doll-name { font: 600 1.3rem/1.2 var(--font-big); color: var(--accent); overflow-wrap: anywhere; }
.doll-what { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.15rem; }
.doll-center .hero-stat { padding: 0; margin: 0; border: 0; }
.doll-center .hero-stat-value { font-size: 2.2rem; }
.doll-center .hero-stat-label { font-size: 0.88rem; }

.doll-weapons {
  grid-area: weapons;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

/* One slot: the item picture with a quality-colored frame, then name, slot and item level, durability. */
.dslot {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  align-items: center;
  gap: 0 0.7rem;
  min-height: 3.45rem;
  padding: 0.3rem 0.35rem;
  border-radius: var(--r-sm);
}

/* The right column mirrors the left: text first, picture on the outside edge. */
.dslot-right { grid-template-columns: minmax(0, 1fr) 2.7rem; text-align: right; }
.dslot-right .dslot-icon { grid-column: 2; grid-row: 1; }
.dslot-right .dslot-text { grid-column: 1; grid-row: 1; }
.dslot-right .dslot-meta { justify-content: flex-end; }

.dslot-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 2px solid var(--line-2);
  border-radius: 6px;
  background: var(--inset);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.dslot-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dslot-icon.is-empty { border-style: dashed; border-color: var(--line); background: transparent; box-shadow: none; }
.dslot-initial { font: 600 1.15rem/1 var(--font-big); color: var(--ink-3); }

/* Frame colors by item quality (common keeps the plain frame, like the game). */
.qb0 { border-color: color-mix(in srgb, var(--q0) 60%, transparent); }
.qb1 { border-color: var(--line-2); }
.qb2 { border-color: color-mix(in srgb, var(--q2) 75%, transparent); }
.qb3 { border-color: color-mix(in srgb, var(--q3) 85%, transparent); }
.qb4 { border-color: color-mix(in srgb, var(--q4) 85%, transparent); }
.qb5 { border-color: color-mix(in srgb, var(--q5) 85%, transparent); }

.dslot-text { min-width: 0; line-height: 1.25; }
.dslot-name { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dslot-name.is-empty { color: var(--ink-4); }
.dslot-meta { display: flex; gap: 0.55rem; color: var(--ink-3); font-size: 0.8rem; white-space: nowrap; overflow: hidden; }
.dslot-ilvl { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dslot .dura { margin-top: 0.12rem; }
.dslot.is-empty .dslot-meta { color: var(--ink-4); }

/* Per-item durability: a thin bar and the percentage. Gray when fine, amber under 50%, red under 20%. */
.dura { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dura-bar { width: 2.8rem; height: 0.25rem; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.dura-fill { display: block; height: 100%; border-radius: inherit; background: var(--ink-3); }
.dura-pct { min-width: 2.6em; text-align: right; }
.dura-warn { color: var(--t-warn); }
.dura-warn .dura-fill { background: var(--t-warn); }
.dura-low { color: var(--t-loss); }
.dura-low .dura-fill { background: var(--t-loss); }

.gear-dura.dura-warn .hero-stat-value { color: var(--t-warn); }
.gear-dura.dura-low .hero-stat-value { color: var(--t-loss); }
.gear-dura .hero-stat-label { color: var(--ink-2); }
.repair-hint { color: var(--t-warn); margin-top: 0.3rem; font-size: 0.92rem; }

/* Saved gear could not be read: one calm line instead of nineteen empty slots. */
.gear-empty { display: flex; align-items: center; gap: 0.9rem; padding: 1.4rem var(--pad); color: var(--ink-2); }
.gear-empty .icon { font-size: 1.5rem; color: var(--ink-3); }

/* Stat sheet: Forever's categories in two columns. */
.stat-group-title { color: var(--ink-3); font-size: 0.85rem; margin: 1rem 0 0.1rem; }
.stat-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.6rem; }
.stat-cols > div > .stat-group:first-child .stat-group-title { margin-top: 0.3rem; }

/* Weapon skills: learned ones with a rank bar, the rest greyed (hover says where to learn). */
.wskills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.6rem; }

.wskill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-height: 3.2rem;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.wskill-top { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.wskill-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wskill-rank { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wskill-rank b { color: var(--ink); font-weight: 600; }
.wskill-where { color: var(--ink-3); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wskill.is-base .wskill-name { color: var(--ink-2); }
.wskill.is-missing { cursor: help; }
.wskill.is-missing .wskill-name { color: var(--ink-3); }

/* Getting hit: the attack table against your level and a boss. */
.hit-table th:first-child, .hit-table td:first-child { padding-left: 0; }
.hit-table th:last-child, .hit-table td:last-child { padding-right: 0; }
.hit-table tr.is-bad td:first-child { color: var(--t-loss); }
.hit-table tr.is-hit td { font-weight: 600; }
.hit-table td.pushed { color: var(--ink-4); }
.hit-note { margin-top: 0.85rem; color: var(--ink-2); font-size: 0.92rem; }

/* ----------------------------------------------------------------- legacy */
.legacy-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 2.5rem;
  align-items: center;
  padding: 1.2rem 1.5rem;
}

.legacy-count { font: 600 3.4rem/1 var(--font-big); letter-spacing: -0.02em; }
.legacy-count small { font-size: 0.45em; color: var(--ink-3); font-weight: 500; letter-spacing: 0; margin-left: 0.3rem; }
.legacy-desc { color: var(--ink-2); margin-bottom: 0.7rem; }
.legacy-top .meter { height: 0.75rem; }

.legacy-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: stretch;
}

.lg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.55rem; }
.lg-title { font-size: 1.08rem; font-weight: 600; }
.lg-count { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-count b { color: var(--ink); }
.lg-items { margin-top: 0.9rem; display: grid; }

.lg-item {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.lg-item .icon { font-size: 1.1rem; color: var(--ink-4); margin-top: 0.12rem; }
.lg-item.is-done .icon { color: var(--t-live); }
.lg-item.is-done .lg-label { color: var(--ink-2); }
.lg-label { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; }
.lg-when { color: var(--ink-3); font-size: 0.85rem; white-space: nowrap; }
.lg-prog { display: flex; align-items: center; gap: 0.5rem; min-width: 7rem; }
.lg-prog .meter { flex: 1; height: 0.4rem; }
.lg-prog-num { color: var(--ink-3); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-item[title] { cursor: help; }

/* Legacy summary from the game: earned (big), then the smaller numbers in a row. */
.legacy-info { min-width: 0; }
.lg-facts { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; margin-bottom: 0.8rem; }
.lg-fact-value { font: 600 1.5rem/1.15 var(--font-big); font-variant-numeric: tabular-nums; }
.lg-fact-label { color: var(--ink-3); font-size: 0.85rem; }
.lg-fact.is-ready .lg-fact-value { color: var(--t-live); }
.lg-fact.is-tree .lg-fact-value { color: var(--ink-2); }
.legacy-extra { color: var(--ink-3); font-size: 0.9rem; margin-bottom: 0.8rem; }
.lg-ch .lg-head { margin-bottom: 0.4rem; }
.lg-ch-label { color: var(--ink-2); }
.legacy-desc .tag { margin-right: 0.35rem; }

.tag {
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 0 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  white-space: nowrap;
}

.tag-auto { color: var(--t-gather); border-color: color-mix(in srgb, var(--t-gather) 40%, transparent); }
.tag-pvp { color: var(--t-loss); border-color: color-mix(in srgb, var(--t-loss) 45%, transparent); display: inline-flex; gap: 0.25rem; align-items: center; }
.tag-live { color: var(--t-live); border-color: color-mix(in srgb, var(--t-live) 45%, transparent); }

/* -------------------------------------------------------------------- log */
.log-list { display: grid; }

.log-item {
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.log-item:first-child { border-top: 0; padding-top: 0.2rem; }
.log-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.log-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.log-text { overflow-wrap: anywhere; }
.log-meta { color: var(--ink-3); font-size: 0.86rem; margin-top: 0.15rem; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.log-side { color: var(--ink-2); font-size: 0.9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.9rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: 0.92rem;
}

.hint .icon { color: var(--t-gold); font-size: 1.05rem; }

.summary-line { color: var(--ink-2); margin-bottom: 0.7rem; }
.summary-line b { color: var(--ink); font-weight: 600; }

.src-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.4rem 2rem;
}

.src-block h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; display: flex; gap: 0.6rem; align-items: center; }
.src-path {
  font-family: var(--font-code);
  font-size: 0.82rem;
  color: var(--ink-2);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.55rem;
  overflow-wrap: anywhere;
  margin-bottom: 0.5rem;
}

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.3rem 1rem; font-size: 0.92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd.err { color: var(--t-loss); }
.auto-failed { color: var(--t-loss); margin-top: 0.2rem; }
.ok-yes { color: var(--t-live); font-weight: 600; }
.ok-no { color: var(--t-loss); font-weight: 600; }
.ok-off { color: var(--ink-3); font-weight: 600; }
.calm { color: var(--ink-2); }
.api-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; }
.api-list li { font-size: 0.82rem; line-height: 1.5; padding: 0 0.45rem; border: 1px solid var(--line-2); border-radius: 4px; }
.api-list .api-name { color: var(--ink); }
.api-list .api-via { color: var(--ink-3); }
.blocked-list { display: grid; gap: 0.2rem; color: var(--t-loss); }
.src-notes { margin-top: 0.7rem; display: grid; gap: 0.25rem; color: var(--ink-3); font-size: 0.86rem; }

/* ------------------------------------------------------- setup and conn */
.setup {
  max-width: 62rem;
  margin: 2.5rem auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2rem 2.2rem 2.2rem;
}

.setup h1 { font: 600 1.9rem/1.2 var(--font-big); margin-bottom: 0.5rem; }
.setup-lead { color: var(--ink-2); font-size: 1.05rem; max-width: 46rem; }

.steps { counter-reset: step; margin: 1.6rem 0 1.8rem; display: grid; gap: 0.9rem; }

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.15rem);
}

.steps .step-title { font-weight: 600; }
.steps .step-text { color: var(--ink-2); }

.setup h2 { font-size: 1.1rem; font-weight: 600; margin: 1.4rem 0 0.7rem; }
.setup .note { color: var(--ink-3); font-size: 0.92rem; margin-top: 1rem; }
.setup .src-grid { margin-top: 0.4rem; }

.char-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.char-link {
  appearance: none;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  text-align: left;
}

.char-link:hover { border-color: var(--ink-4); }
.char-link .muted { display: block; font-size: 0.85rem; }

/* -------------------------------------------------------------- utilities */
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.money .cu { font-weight: 600; margin-left: 0.04em; }
.money .cu-g { color: var(--coin-g); }
.money .cu-s { color: var(--coin-s); }
.money .cu-c { color: var(--coin-c); }
.money.neg { color: var(--t-loss); }
.money.na { color: var(--ink-3); }
.kpi-value .money .cu, .hero-stat-value .money .cu { font-size: 0.62em; margin-left: 0.06em; margin-right: 0.04em; }

.q0 { color: var(--q0); }
.q1 { color: var(--q1); }
.q2 { color: var(--q2); }
.q3 { color: var(--q3); }
.q4 { color: var(--q4); }
.q5 { color: var(--q5); }
.qbg0 { background: var(--q0) !important; }
.qbg1 { background: var(--q1) !important; }
.qbg2 { background: var(--q2) !important; }
.qbg3 { background: var(--q3) !important; }
.qbg4 { background: var(--q4) !important; }
.qbg5 { background: var(--q5) !important; }

.na { color: var(--ink-3); }

/* ------------------------------------------------- WoW-style item tooltip */
/* Drawn by tooltip.js. Fixed colors on purpose: it looks the same in any page theme. */
.wow-tip {
  position: fixed;
  z-index: 70;
  max-width: 330px;
  min-width: 13rem;
  max-height: calc(100vh - 16px);
  overflow: hidden;
  padding: 0.55em 0.8em 0.65em;
  background: rgba(5, 8, 20, 0.97);
  border: 1px solid #6b7180;
  border-radius: 4px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-family: var(--font);
  font-size: clamp(13px, 0.85rem, 16px);
  font-weight: 400;
  line-height: 1.38;
  text-align: left;
  pointer-events: none;
}

.wow-tip .tt-line { display: flex; align-items: baseline; gap: 1.4em; }
.wow-tip .tt-l { flex: 1 1 auto; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.wow-tip .tt-r { flex: 0 0 auto; white-space: pre-line; text-align: right; }
.wow-tip .tt-first .tt-l { font-size: 1.1em; font-weight: 600; line-height: 1.3; }
.wow-tip .tt-blank { height: 0.6em; }
.wow-tip .tt-note { margin-top: 0.4em; color: #8a8f99; font-size: 0.88em; }
.wow-tip .tt-money { white-space: nowrap; }

.wow-tip .tt-coin {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin: 0 0.3em 0 0.14em;
  border-radius: 50%;
  vertical-align: -0.06em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.wow-tip .tt-coin-g { background: radial-gradient(circle at 35% 30%, #fff1a8, #e0a82e 55%, #a8731a); }
.wow-tip .tt-coin-s { background: radial-gradient(circle at 35% 30%, #ffffff, #c4c9d1 55%, #8b919b); }
.wow-tip .tt-coin-c { background: radial-gradient(circle at 35% 30%, #ffd2a8, #c8763a 55%, #8a4a1f); }

/* ------------------------------------------------------------- responsive */

/* Wide screens: the activity list becomes a full-height column on the right. */
@media (min-width: 1600px) {
  .live-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(26rem, 27vw, 38rem);
    gap: var(--gap);
    align-items: stretch;
  }

  .live-main { display: flex; flex-direction: column; min-width: 0; }
  .live-pair { flex: 1; }

  /* Size the feed from the left column, then scroll inside it. */
  .feed-panel { contain: size; min-height: 20rem; }
}

@media (max-width: 1599.98px) {
  .live-grid { display: grid; gap: var(--gap); }
  .feed-panel { max-height: 34rem; }
  .span-8 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  .span-6 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  /* Equipment and weapon skills full width; stats and the attack table share a row. */
  .char-doll, .char-skills { grid-column: span 12; }
  .char-stats, .char-table { grid-column: span 6; }
  .char-table { order: 1; }
  .char-skills { order: 2; }
  .legacy-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Re-pair half-width panels so none sits alone on a row. */
  .o-lv-xp { order: 1; }
  .o-lv-level { order: 2; }
  .o-lv-eta { order: 3; }
  .o-lv-ms { order: 4; }
  #view-leveling .span-6 { order: 5; }
  #view-leveling .span-3 { order: 6; }
  .o-gd-wallet { order: 2; }
  .o-gd-prof { order: 3; }
  .o-gd-in { order: 4; }
  .o-gd-out { order: 5; }
  .o-gd-nodes { order: 6; grid-column: span 12; }
  .o-gd-items { order: 7; }
}

@media (max-width: 1400px) {
  .topbar-row { padding-left: 1.4rem; padding-right: 1.4rem; gap: 0.8rem 2rem; }
  .where { padding-left: 2rem; }
  main { padding: 1.2rem 1.4rem 2rem; }
  .banner { margin-left: 1.4rem; margin-right: 1.4rem; }
  .tabs { padding: 0 0.8rem; }
  .status { gap: 0.8rem 1.4rem; }
}

@media (max-width: 1100px) {
  .where { padding-left: 0; border-left: 0; }
  .status { margin-left: 0; width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-pair { grid-template-columns: minmax(0, 1fr); }
  .span-4, .span-3 { grid-column: span 12; }
  .src-grid { grid-template-columns: minmax(0, 1fr); }
  .char-stats, .char-table { grid-column: span 12; }
  .doll { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "center center" "left right" "weapons weapons"; }
  .doll-center { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0.8rem 2.5rem; margin-bottom: 0.6rem; }
  .doll-weapons { grid-template-columns: minmax(0, 1fr); }
  .legacy-groups { grid-template-columns: minmax(0, 1fr); }
  .road-cells { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .road-cell:nth-child(odd) { border-left: 0; }
  .road-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .doll { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "left" "right" "weapons"; }
  .dslot-right { grid-template-columns: 2.7rem minmax(0, 1fr); text-align: left; }
  .dslot-right .dslot-icon { grid-column: 1; }
  .dslot-right .dslot-text { grid-column: 2; }
  .dslot-right .dslot-meta { justify-content: flex-start; }
  .wskills, .stat-cols { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pill-live .pill-dot, .pill-warn .icon { animation: none; }
  .ch-bar { transition: none; }
}


/* ====================================================================== */
/* Guild board (guild.html). Everything here is prefixed .g- except the    */
/* --class-* tokens, which both pages can use.                            */
/* ====================================================================== */

/* The nine Forever classes. Same values as CLASS_COLORS in app.js; kept here as
   tokens so guild.js holds no second copy of the palette to drift from. */
:root {
  --class-warrior: #c69b6d;
  --class-paladin: #f48cba;
  --class-hunter:  #aad372;
  --class-rogue:   #fff468;
  --class-priest:  #f2f2f2;
  --class-shaman:  #3a8fea;
  --class-mage:    #3fc7eb;
  --class-warlock: #8788ee;
  --class-druid:   #ff7c0a;
}

.g-char { font-weight: 600; color: var(--ink); }
.g-char[data-class="WARRIOR"] { color: var(--class-warrior); }
.g-char[data-class="PALADIN"] { color: var(--class-paladin); }
.g-char[data-class="HUNTER"]  { color: var(--class-hunter); }
.g-char[data-class="ROGUE"]   { color: var(--class-rogue); }
.g-char[data-class="PRIEST"]  { color: var(--class-priest); }
.g-char[data-class="SHAMAN"]  { color: var(--class-shaman); }
.g-char[data-class="MAGE"]    { color: var(--class-mage); }
.g-char[data-class="WARLOCK"] { color: var(--class-warlock); }
.g-char[data-class="DRUID"]   { color: var(--class-druid); }

/* Freshness. Three steps down the ink scale, nothing else: a guildmate who synced
   three days ago is not a warning, so this is never red and never hides a row.
   The class sits on the row, so the whole line recedes together. */
.g-fresh { color: var(--ink); }
.g-stale { color: var(--ink-3); }
.g-cold  { color: var(--ink-4); }
.g-stale .g-char, .g-cold .g-char { filter: saturate(0.55); }
.g-cold .g-char { filter: saturate(0.3); }

/* A guild table is wider than one character's, so it scrolls sideways rather than
   squeezing the Synced column off the end. */
.g-scroll { overflow-x: auto; }
.g-table { min-width: 100%; white-space: nowrap; }

.g-th { cursor: pointer; user-select: none; }
.g-th:hover { color: var(--ink); }
.g-th:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 3px; }
.g-sorted { color: var(--ink); }

.g-realm { color: var(--ink-4); font-size: 0.82rem; margin-left: 0.45rem; }

/* Chips say something about the data, never about the person. */
.g-chip {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
  vertical-align: 0.08em;
}

.g-home {
  color: var(--ink-3);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}
.g-home:hover { color: var(--ink); border-color: var(--ink-4); }

.g-note { margin-top: 0.7rem; font-size: 0.85rem; }

.g-code {
  margin: 0.6rem 0;
  padding: 0.7rem 0.85rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre;
}

/* The record book. A cabinet of cards rather than a table of twenty rows, because a
   table of twenty rows is exactly as dull as the single level ladder this replaced.
   Each card is one trophy: who holds it, the number, what the number means, and
   underneath in small type the two things that stop it being an argument -- who came
   second, and how many characters were in the running. */
.g-trophies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--gap);
}

.g-trophy {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0.75rem 0.85rem 0.7rem;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.g-trophy-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.g-trophy-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.g-trophy-holder { font-size: 1.05rem; margin-top: 0.35rem; }
/* The number is the point of the card, so it gets the weight and the tabular figures
   that keep a column of them from looking ragged. */
.g-trophy-value {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.g-trophy-blurb { color: var(--ink-3); font-size: 0.85rem; }

.g-trophy-foot {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-4);
}
.g-trophy-runner { color: var(--ink-3); }
.g-trophy-basis { white-space: nowrap; }

/* An unclaimed record, which is half of what makes this a cabinet rather than a
   scoreboard: the empty shelves are the things somebody can go and win this week.
   Dashed, dimmer, and deliberately the same size as a held one, so a category does
   not visibly reshuffle itself the day a record is finally taken. */
.g-trophy.is-open,
.g-trophy.is-locked {
  border-style: dashed;
  background: none;
}
.g-trophy.is-open .g-trophy-title,
.g-trophy.is-locked .g-trophy-title { color: var(--ink-4); }
.g-trophy-none { color: var(--ink-4); font-weight: 400; }

/* Shelves. One per category, so twenty-odd cards read as a cabinet instead of a wall. */
.g-cabinet { display: grid; gap: 1.4rem; }
.g-shelf-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.g-shelf-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
}
.g-shelf-blurb { color: var(--ink-4); font-size: 0.85rem; }

/* Professions: one card per skill, one row per character who has it. */
.g-prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.9rem;
}
.g-prof-card { background: var(--raised); border: 1px solid var(--line); border-radius: 7px; padding: 0.7rem 0.8rem; }
.g-prof-name { font-weight: 650; margin-bottom: 0.45rem; }
.g-prof-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name rank" "bar bar";
  gap: 0.15rem 0.6rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.g-prof-row .g-char { grid-area: name; font-size: 0.92rem; }
.g-prof-rank { grid-area: rank; color: var(--ink-3); font-size: 0.85rem; }
.g-prof-bar {
  grid-area: bar;
  height: 0.3rem;
  border-radius: 2px;
  background: var(--inset);
  overflow: hidden;
}
.g-prof-fill { display: block; height: 100%; background: var(--m-gather); border-radius: 2px; }
.g-stale .g-prof-fill, .g-cold .g-prof-fill { opacity: 0.55; }

/* Notes: anomalies and unreadable files. Plain rows, no alarm colors. */
.g-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.g-notes li { display: grid; grid-template-columns: minmax(6rem, auto) minmax(5rem, auto) 1fr; gap: 0.7rem; align-items: baseline; }
.g-note-kind { color: var(--ink-3); font-size: 0.82rem; }
.g-note-detail { color: var(--ink-2); font-size: 0.88rem; white-space: normal; }

@media (max-width: 900px) {
  .g-notes li { grid-template-columns: 1fr; gap: 0.1rem; }
  .g-prof-grid { grid-template-columns: 1fr; }
}

/* ===================================================================== admin
 *
 * The owner's page. One person looks at this, on a desktop, deliberately -- so it is
 * laid out for reading a table and pressing a thing next to it, not for glanceability
 * like the boards. The only colour that carries meaning here is the red on the delete,
 * because that is the one control that cannot be taken back.
 */

.a-people tbody tr { cursor: pointer; }
.a-people tbody tr:hover { background: var(--raised); }
.a-people tbody tr.is-picked { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.a-name { display: block; color: var(--ink); }
.a-slug { display: block; color: var(--ink-4); font-size: 0.78rem; }

/* A state word, not a button: shared/private, revoked, how many tokens. */
.a-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 0.78rem;
  white-space: nowrap;
}
.a-tag-on { color: var(--t-live); border-color: color-mix(in srgb, var(--t-live) 45%, transparent); }
.a-tag-off { color: var(--ink-4); }

/* One concern per block, with its own heading and its own consequences spelled out. */
.a-block { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.a-block:first-child { border-top: 0; padding-top: 0; }
.a-h3 { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--ink); font-weight: 600; }

.a-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin: 0.5rem 0; }
.a-field { display: grid; gap: 0.2rem; }
.a-label { color: var(--ink-4); font-size: 0.76rem; }

.a-input {
  min-width: 11rem;
  padding: 0.35rem 0.5rem;
  background: var(--inset);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink);
}
.a-input:focus { outline: none; border-color: var(--accent); }

.a-btn {
  padding: 0.38rem 0.8rem;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink-2);
  cursor: pointer;
}
.a-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-4); }
.a-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.a-btn-go { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.a-btn-quiet { padding: 0.2rem 0.55rem; font-size: 0.82rem; }
.a-btn-danger { color: var(--t-loss); border-color: color-mix(in srgb, var(--t-loss) 50%, transparent); }
.a-btn-danger:hover:not(:disabled) { color: var(--t-loss); background: color-mix(in srgb, var(--t-loss) 12%, transparent); }

/* While a write is in flight nothing else may be pressed: the second click on Forget
 * is the one you do not want to have been possible. */
.a-busy .a-btn { pointer-events: none; opacity: 0.6; }

.a-danger { border-top-color: color-mix(in srgb, var(--t-loss) 35%, transparent); }

/* The token, shown once. Bordered in accent so it is obviously the thing to act on. */
.a-secret { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.a-token { user-select: all; font-size: 0.95rem; word-break: break-all; }
.a-said { color: var(--t-live); font-size: 0.82rem; }

.a-dim td { opacity: 0.55; }
.a-reason { color: var(--ink-2); font-size: 0.84rem; white-space: normal; }

@media (max-width: 900px) {
  .a-actions { flex-direction: column; align-items: stretch; }
  .a-input { min-width: 0; width: 100%; }
}
