/* Whoa Adventure build guide.
   Dark first (a companion to a game played in the evening on a phone or second monitor), light follows the system.
   Neutrals are tinted towards the current class hue (--h); one accent per class carries selection and data marks. */

:root {
  --h: 255;
  --c: 0.03;
  color-scheme: dark;

  --bg: oklch(0.165 0.012 var(--h));
  --surface: oklch(0.205 0.015 var(--h));
  --raised: oklch(0.255 0.017 var(--h));
  --line: oklch(0.33 0.018 var(--h));
  --line-soft: oklch(0.27 0.016 var(--h));
  --text: oklch(0.955 0.008 var(--h));
  --text-2: oklch(0.81 0.014 var(--h));
  --text-3: oklch(0.69 0.016 var(--h));
  --warn: oklch(0.86 0.1 80);
  --over: oklch(0.76 0.13 28);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.28), 0 14px 32px -14px oklch(0 0 0 / 0.5);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: 32px;
  --f-micro: 0.6875rem;
  --f-small: 0.75rem;
  --f-label: 0.8125rem;
  --f-body: 0.875rem;
  --f-name: 0.9375rem;
  --f-title: 1.375rem;
}

/* Accent tokens are resolved wherever --h / --c are set, so a compare row can carry its own class colour. */
:root, .tinted {
  --accent: oklch(0.82 var(--c) var(--h));
  --accent-ink: oklch(0.2 0.03 var(--h));
  --accent-soft: oklch(0.82 var(--c) var(--h) / 0.13);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: oklch(0.966 0.006 var(--h));
    --surface: oklch(0.995 0.003 var(--h));
    --raised: oklch(0.94 0.009 var(--h));
    --line: oklch(0.84 0.014 var(--h));
    --line-soft: oklch(0.9 0.011 var(--h));
    --text: oklch(0.21 0.02 var(--h));
    --text-2: oklch(0.36 0.02 var(--h));
    --text-3: oklch(0.47 0.02 var(--h));
    --warn: oklch(0.47 0.11 65);
    --over: oklch(0.5 0.16 28);
    --shadow: 0 1px 2px oklch(0.3 0.02 var(--h) / 0.07), 0 14px 32px -16px oklch(0.3 0.02 var(--h) / 0.2);
  }
  :root:not([data-theme="dark"]), :root:not([data-theme="dark"]) .tinted {
    --accent: oklch(0.5 calc(var(--c) * 1.15) var(--h));
    --accent-ink: oklch(0.99 0 0);
    --accent-soft: oklch(0.5 calc(var(--c) * 1.15) var(--h) / 0.1);
  }
}
/* the viewer's explicit light choice overrides a dark system setting (same values as above) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.966 0.006 var(--h));
  --surface: oklch(0.995 0.003 var(--h));
  --raised: oklch(0.94 0.009 var(--h));
  --line: oklch(0.84 0.014 var(--h));
  --line-soft: oklch(0.9 0.011 var(--h));
  --text: oklch(0.21 0.02 var(--h));
  --text-2: oklch(0.36 0.02 var(--h));
  --text-3: oklch(0.47 0.02 var(--h));
  --warn: oklch(0.47 0.11 65);
  --over: oklch(0.5 0.16 28);
  --shadow: 0 1px 2px oklch(0.3 0.02 var(--h) / 0.07), 0 14px 32px -16px oklch(0.3 0.02 var(--h) / 0.2);
}
:root[data-theme="light"], :root[data-theme="light"] .tinted {
  --accent: oklch(0.5 calc(var(--c) * 1.15) var(--h));
  --accent-ink: oklch(0.99 0 0);
  --accent-soft: oklch(0.5 calc(var(--c) * 1.15) var(--h) / 0.1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-color: var(--line) var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--f-body)/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

::selection { background: oklch(0.82 var(--c) var(--h) / 0.32); color: var(--text); }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 30; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--text); }
.skip:focus { top: 8px; }
.none { color: var(--text-3); font-size: var(--f-label); }

.glyph { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- icons: real game art, never drawn above its own pixel size ---------- */

.ico {
  --s: 40px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: min(var(--s), var(--nat, 999px));
  height: min(var(--s), var(--nat, 999px));
  border-radius: 22%;
  user-select: none;
}
.ico img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ico--round { border-radius: 50%; }
.ico--blank { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); }
.ico-initials { font-size: calc(var(--s) * 0.34); font-weight: 650; line-height: 1; letter-spacing: 0.02em; }

.ico-roleclass { --s: 24px; }
.ico-title { --s: 64px; }
.ico-rank { --s: 26px; }
.ico-gear { --s: 64px; }
.ico-mini { --s: 40px; }
.ico-skill { --s: 88px; }
.ico-pip { --s: 22px; }
.ico-alt { --s: 28px; }
.ico-pet { --s: 84px; }
.ico-insc { --s: 36px; }
.ico-spec { --s: 52px; }
.ico-ev { --s: 28px; }
.ico-ev--small { --s: 20px; }
.ico-src { --s: 28px; }
.ico-stat { --s: 28px; }
.ico-scene { --s: 24px; }

/* ---------- header: the four guides and the level ruler ---------- */

.top {
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "brand roles info about" "level level level level";
  align-items: center;
  gap: 8px 28px;
  padding-block: 10px 8px;
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 1021px) and (min-height: 860px) { .top { position: sticky; top: env(safe-area-inset-top, 0px); } }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.brand { grid-area: brand; display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; justify-content: start; }
.brand-name { font-size: var(--f-name); font-weight: 650; letter-spacing: -0.005em; white-space: nowrap; }
.brand-sub { grid-row: 2; font-size: var(--f-small); color: var(--text-3); }
.brand-link { margin-left: 6px; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.brand-link:hover { color: var(--text); }
.sample-flag { grid-row: 1 / span 2; grid-column: 2; padding: 3px 8px; border: 1px solid color-mix(in oklch, var(--warn) 60%, transparent); border-radius: 999px; color: var(--warn); font-size: var(--f-small); font-weight: 600; white-space: nowrap; }
.sample-flag[hidden] { display: none; }

.roles { grid-area: roles; display: flex; min-width: 0; padding: 3px; gap: 2px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.role-btn {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: var(--f-label);
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, transform 0.1s var(--ease);
}
.role-btn:hover:not(:disabled) { color: var(--text); }
.role-btn[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 650; box-shadow: 0 1px 2px oklch(0 0 0 / 0.18); }
.role-btn[aria-pressed="true"] .glyph { color: var(--accent); }
.role-btn:disabled { color: var(--text-3); opacity: 0.45; }
.role-btn:active:not(:disabled), .about-btn:active { transform: scale(0.97); }
.role-short { display: none; }
.role-class { display: grid; }
.role-class:empty { display: none; }

.about-btn { grid-area: about; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-soft); border-radius: 50%; color: var(--text-2); transition: background-color 0.15s, transform 0.1s var(--ease); }
.about-btn:hover { background: var(--surface); color: var(--text); }

/* Level ruler: a native range input (drag, click, arrow keys) laid over a drawn scale. */
.level { grid-area: level; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "now ruler"; align-items: center; column-gap: 20px; min-width: 0; }
.level-now { grid-area: now; display: grid; justify-items: start; min-width: 3.5rem; line-height: 1; cursor: default; }
.level-word { font-size: var(--f-small); color: var(--text-3); }
.level-num { font: inherit; font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; width: 3.4ch; padding: 2px 4px; margin-left: -4px; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; -moz-appearance: textfield; appearance: textfield; }
.level-num::-webkit-outer-spin-button, .level-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.level-num:hover { border-color: var(--line); }
.level-num:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--raised); }
.ruler-row { grid-area: ruler; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; min-width: 0; }
.level-step { width: 36px; height: 36px; margin-top: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.level-step:hover:not(:disabled) { border-color: var(--text-2); }
.level-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.level-step:disabled { opacity: 0.35; cursor: default; }
.level-hint { display: none; font-size: var(--f-micro); color: var(--text-3); }
.future { grid-column: 1 / -1; justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--text-3); font: inherit; font-size: var(--f-small); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.future:hover { color: var(--text); }
.future:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: none; }
.chip { flex: none; min-width: 58px; min-height: 44px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text-2); font: inherit; font-size: var(--f-name); font-weight: 600; line-height: 1.1; cursor: pointer; scroll-snap-align: center; }
.chip-to { display: block; font-size: var(--f-micro); font-weight: 500; color: var(--text-3); }
.chip.is-current { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip.is-current .chip-to { color: inherit; opacity: 0.8; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Phones and tablets: no ruler to drag. A boxed level field with a number pad, and one chip per gear bracket to tap. */
@media (pointer: coarse), (max-width: 820px) {
  .level { grid-template-columns: minmax(0, 1fr); grid-template-areas: "now" "chips"; row-gap: 10px; }
  .ruler-row { display: none; }
  .level-now { grid-template-columns: auto auto 1fr; align-items: center; column-gap: 10px; }
  .level-num { width: 4.2ch; margin-left: 0; padding: 4px 8px; border-color: var(--line); background: var(--raised); text-align: center; }
  .level-hint { display: inline; }
  .chips { grid-area: chips; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
}
.ruler { --t: 30px; --p: 0; position: relative; height: 62px; min-width: 0; }
.ruler-scale { position: absolute; inset: 0; }
.ruler-band {
  position: absolute;
  top: 16px;
  left: calc(var(--t) / 2 + var(--a) * (100% - var(--t)));
  width: calc((var(--b) - var(--a)) * (100% - var(--t)));
  height: 16px;
  border-left: 2px solid var(--bg);
  background: var(--raised);
  color: var(--text-3);
  font-size: var(--f-micro);
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.ruler-band:first-child { border-left: 0; border-radius: 5px 0 0 5px; }
.ruler-band:nth-last-child(1 of .ruler-band) { border-radius: 0 5px 5px 0; }
.ruler-band:only-of-type { border-radius: 5px; }
.ruler-band.is-current { background: var(--accent); color: var(--text); font-weight: 650; }
.ruler-tier { position: absolute; left: 3px; bottom: 18px; line-height: 1.2; }
.ruler--dense .ruler-band:not(.is-current) .ruler-tier { display: none; }
.ruler--dense .ruler-band.is-right .ruler-tier { left: auto; right: 2px; }
.ruler--dense .ruler-unlock { display: none; }
.ruler-tick.is-unnumbered .num { display: none; }
.ruler-tick { position: absolute; top: 34px; left: calc(var(--t) / 2 + var(--p) * (100% - var(--t))); width: 1px; height: 4px; background: var(--line); }
.ruler-tick--mid { height: 7px; }
.ruler-tick--edge { height: 10px; background: var(--text-2); }
.ruler-tick .num { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: var(--f-micro); font-weight: 600; color: var(--text-2); }
.ruler-unlock { position: absolute; top: 20px; left: calc(var(--t) / 2 + var(--p) * (100% - var(--t))); width: 8px; height: 8px; margin-left: -3px; border-radius: 1.5px; background: var(--text-2); box-shadow: 0 0 0 2px var(--bg); transform: rotate(45deg); }

.ruler-input { position: absolute; left: 0; top: 2px; width: 100%; height: 44px; margin: 0; padding: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.ruler-input:disabled { cursor: default; }
.ruler-input::-webkit-slider-runnable-track { height: 44px; background: none; }
.ruler-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--t);
  height: 44px;
  border: 0;
  border-radius: 10px;
  background:
    linear-gradient(var(--bg), var(--bg)) center 22px / 2px 12px no-repeat,
    linear-gradient(var(--text), var(--text)) center 9px / 22px 26px no-repeat;
  border-radius: 8px;
  filter: drop-shadow(0 1px 3px oklch(0 0 0 / 0.45));
  cursor: grab;
}
.ruler-input:active::-webkit-slider-thumb { cursor: grabbing; }
.ruler-input:focus-visible { outline: none; }
.ruler-input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.ruler-input::-moz-range-track { height: 44px; background: none; }
.ruler-input::-moz-range-thumb { width: var(--t); height: 44px; border: 0; border-radius: 8px; background: linear-gradient(var(--bg), var(--bg)) center 22px / 2px 12px no-repeat, linear-gradient(var(--text), var(--text)) center 9px / 22px 26px no-repeat; cursor: grab; }
.ruler-input:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: -2px; }

.level-info { grid-area: info; display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 1px 16px; min-width: 0; min-height: 36px; font-size: var(--f-small); line-height: 1.35; color: var(--text-3); }
.level-tier { white-space: nowrap; }
.level-tier b { font-weight: 650; color: var(--text); }
.level-range { white-space: nowrap; }
.unlocks { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--text-2); }
.unlocks li { display: inline-flex; align-items: center; gap: 7px; }
.unlock-mark { width: 6px; height: 6px; border-radius: 1px; background: var(--text-3); transform: rotate(45deg); }

/* ---------- page frame ---------- */

main { max-width: 1400px; margin: 0 auto; padding-block: 28px 72px; padding-left: max(var(--pad), env(safe-area-inset-left, 0px)); padding-right: max(var(--pad), env(safe-area-inset-right, 0px)); }

.build {
  display: grid;
  grid-template-columns: minmax(0, 22.5rem) minmax(0, 1fr);
  grid-template-areas: "summary plan" "support support";
  gap: 40px 44px;
  align-items: start;
}
.summary { grid-area: summary; min-width: 0; }
.plan { grid-area: plan; min-width: 0; }
.support { grid-area: support; min-width: 0; }

.block { min-width: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2, .note-group h2 { font-size: var(--f-label); font-weight: 650; color: var(--text-2); }
.block-note { font-size: var(--f-small); color: var(--text-3); text-align: right; }
.name { font-weight: 600; }
.slot { font-size: var(--f-small); color: var(--text-3); }

/* ---------- summary ---------- */

.build-title { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.build-title > span { display: grid; gap: 5px; min-width: 0; }
.build-class { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 1.75rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.build-role { display: flex; align-items: center; gap: 6px; font-size: var(--f-label); font-weight: 500; color: var(--text-2); }
.build-role .glyph { width: 16px; height: 16px; color: var(--accent); }
.build--empty .none { margin-top: 4px; }

.newmark { display: inline-flex; align-items: center; padding: 2px 8px 3px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--f-micro); font-weight: 650; line-height: 1.3; letter-spacing: 0; white-space: nowrap; }

.headline-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 3.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.035em; }
.headline-unit { font-size: var(--f-body); font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.headline-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 10px; font-size: var(--f-label); color: var(--text-3); }

.secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.secondary li { display: grid; gap: 2px; align-content: start; }
.secondary-value { line-height: 1.25; }
.secondary-value .num { font-size: 1.125rem; font-weight: 650; }
.secondary-value .unit { font-size: var(--f-small); color: var(--text-3); }
.secondary-value .unit--long { display: block; }
.secondary-label { font-size: var(--f-small); color: var(--text-3); text-wrap: balance; }

.conf { display: inline-flex; align-items: center; gap: 6px; font-size: var(--f-label); color: var(--text-3); }
.conf .glyph { width: 16px; height: 16px; }
.conf--measured { color: var(--text); font-weight: 550; }
.conf--measured .glyph { color: var(--accent); }

.rank-list { display: grid; gap: 7px; }
.rank-row { display: grid; grid-template-columns: auto 4.75rem minmax(0, 1fr) 3.25rem; align-items: center; gap: 10px; font-size: var(--f-label); color: var(--text-2); }
.rank-row .name { font-weight: 500; }
.rank-off { display: grid; gap: 7px; margin: 10px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px dashed var(--line-soft); }
.rank-off-row { display: grid; grid-template-columns: auto 4.75rem minmax(0, 1fr) 3.25rem; align-items: center; gap: 10px; font-size: var(--f-label); color: var(--text-3); }
.rank-off-row .ico, .rank-off-row img { filter: grayscale(1); opacity: 0.6; }
.rank-off-why { font-size: var(--f-micro); }
.rank-off-row .rank-value { text-align: right; text-decoration: line-through; text-decoration-color: var(--line); }
.rank-row.is-top { color: var(--text); }
.rank-row.is-top .name, .rank-row.is-top .rank-value { font-weight: 700; }
.rank-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--raised); }
.rank-fill { display: block; width: var(--w); height: 100%; border-radius: 4px; background: color-mix(in oklch, var(--text-3) 60%, var(--raised)); transform-origin: left; }
.rank-row.is-top .rank-fill { background: var(--accent); }
.rank-value { text-align: right; }

.summary .block { margin-top: 30px; }

.scenes { display: flex; flex-wrap: wrap; gap: 8px; }
.scene {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
  gap: 1px 8px;
  padding: 7px 11px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--surface);
  text-align: left;
}
.scene .ico { grid-row: span 2; }
.scene-name { font-size: var(--f-label); font-weight: 600; }
.scene-foes { display: inline-flex; align-items: center; gap: 3px; font-size: var(--f-small); font-weight: 600; color: var(--text-2); }
.scene-foes .glyph { width: 14px; height: 14px; color: var(--text-3); }
.scene-note, .scene-other { grid-column: 1 / -1; font-size: var(--f-small); color: var(--text-3); }
.scene-other { display: inline-flex; align-items: center; gap: 5px; }
.scene-other .glyph { width: 13px; height: 13px; }
.scene--other { border-style: dashed; border-color: var(--line); background: none; color: var(--text-3); transition: border-color 0.15s, color 0.15s, transform 0.1s var(--ease); }
.scene--other .scene-name { font-weight: 500; }
.scene--other .scene-foes { color: var(--text-3); font-weight: 500; }
.scene--other:hover { border-color: var(--text-3); color: var(--text-2); }
.scene--other:active { transform: scale(0.97); }
.where .none { margin-bottom: 10px; }

.tg { display: grid; grid-template-columns: 4.5rem repeat(var(--cols), minmax(0, 1fr)); align-items: center; row-gap: 5px; }
.tg-plotwrap { grid-column: 2 / -1; }
.tg-plot { display: block; width: 100%; height: auto; overflow: visible; }
.tg-grid { stroke: var(--line-soft); stroke-width: 1.5; }
.tg-line { fill: none; stroke: var(--text-3); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tg-line.is-current { stroke: var(--accent); stroke-width: 4.5; }
.tg-dot { fill: var(--bg); stroke: var(--text-3); stroke-width: 3; }
.tg-dot.is-current { fill: var(--accent); stroke: var(--bg); stroke-width: 2.5; }
.tg-cross { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-dasharray: 5 4; }
.tg-rowlabel { display: flex; align-items: center; gap: 7px; justify-self: start; font-size: var(--f-small); color: var(--text-2); white-space: nowrap; }
.tg-rowlabel.is-current { color: var(--text); font-weight: 600; }
.tg-axis { color: var(--text-3); }
.tg-switch { min-height: 24px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.tg-switch:hover { color: var(--text); text-decoration-color: var(--text-3); }
.tg-key { display: block; width: 12px; height: 2px; border-radius: 1px; background: var(--text-3); }
.tg-key.is-current { height: 3px; background: var(--accent); }
.tg-x, .tg-v { text-align: center; font-size: var(--f-small); color: var(--text-3); }
.tg-x { padding-bottom: 3px; border-bottom: 1px solid var(--line-soft); align-self: stretch; }
.tg-axis { align-self: stretch; justify-self: stretch; border-bottom: 1px solid var(--line-soft); }
.tg-v.is-best { color: var(--text); font-weight: 650; }

/* ---------- the Plan: five sections in the game's Prepare order ---------- */

.plan { container: plan / inline-size; padding: 6px 28px 28px; border: 1px solid var(--line-soft); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.plan-top h2 { font-size: var(--f-name); font-weight: 650; }
.plan-tabs { display: flex; gap: 4px; }
.plan-tab { display: grid; place-items: center; min-width: 30px; height: 24px; border-radius: 7px; background: var(--raised); color: var(--text-3); font-size: var(--f-small); font-weight: 600; }
.plan-tab.is-current { background: var(--accent); color: var(--accent-ink); }

.plan-sec { padding: 18px 0 24px; border-top: 1px solid var(--line-soft); }
.plan-sec:last-child { padding-bottom: 0; }
.plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.plan-head h3 { font-size: var(--f-body); font-weight: 650; }
.plan-head .block-note { margin-left: auto; }
.plan-sec.is-changed .plan-n { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.plan-n { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; font-size: var(--f-micro); font-weight: 650; color: var(--text-2); }

/* 1 Equipment: each piece points at the skill it boosts */
.gear { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gear-piece { display: grid; align-content: start; gap: 8px; min-width: 0; }
.gear-art { display: flex; align-items: center; }
.gear-link { position: relative; flex: 0 1 64px; min-width: 20px; height: 2px; margin: 0 13px 0 8px; border-radius: 1px; background: var(--accent); }
.gear-link::after { content: ""; position: absolute; right: -6px; top: -4px; border: 5px solid transparent; border-right: 0; border-left: 7px solid var(--accent); }
.gear-art .ico-mini { outline: 1.5px solid var(--accent); outline-offset: 2px; }
.gear-text { display: grid; gap: 2px; }
.gear-text .name { font-size: var(--f-body); }
.effect { font-size: var(--f-label); color: var(--text-2); }
.gear-any { font-size: var(--f-micro); color: var(--text-3); }
.effect b { font-weight: 600; color: var(--text); }

/* 2 Talent: the four skills in bar order */
.talents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.talent { display: flex; flex-direction: column; min-width: 0; text-align: center; }
.talent-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 10px; border-radius: 16px; transition: background-color 0.15s; }
.talent.is-linked .talent-top { background: var(--accent-soft); }
.talent-ring { position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin-bottom: 4px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: var(--v) 100; }
.boosters { position: absolute; left: 50%; bottom: -9px; display: flex; gap: 3px; transform: translateX(-50%); }
.ico-pip { padding: 2px; width: 26px; height: 26px; border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 2px 4px oklch(0 0 0 / 0.25); }
.talent .share { font-size: 1.0625rem; font-weight: 700; line-height: 1.2; }
.talent-top .name { font-size: var(--f-body); line-height: 1.25; text-wrap: balance; }
.talent-more { padding: 0 6px; }
.slot--inline { display: none; }
.why { display: block; min-height: 2.8em; font-size: var(--f-label); color: var(--text-2); text-wrap: balance; }
.alts { display: grid; align-content: start; gap: 6px; min-height: 75px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.alt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: left; font-size: var(--f-small); color: var(--text-2); }
.alt-name { line-height: 1.2; }
.alt-loss { color: var(--text-3); font-weight: 600; }
@container plan (max-width: 760px) {
  .alt { grid-template-columns: auto minmax(0, 1fr); row-gap: 0; }
  .alt .ico { grid-row: span 2; }
  .alt-loss { grid-column: 2; }
  .alts { min-height: 92px; }
  .why { min-height: 4.2em; }
}

/* 3 Pet: cast order, left to right */
.pets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pet { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; column-gap: 14px; row-gap: 3px; min-width: 0; }
.pet-art { position: relative; grid-row: span 2; align-self: center; }
.pet .name { align-self: end; font-size: var(--f-body); }
.pet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; align-self: start; font-size: var(--f-label); color: var(--text-2); }
.job { display: inline-flex; align-items: center; gap: 5px; }
.job .glyph { width: 15px; height: 15px; color: var(--accent); }
.pet .share { color: var(--text-3); }
.pet + .pet::before { content: ""; position: absolute; left: -14px; top: calc(50% - 4px); width: 8px; height: 8px; border-top: 1.5px solid var(--text-3); border-right: 1.5px solid var(--text-3); transform: rotate(45deg); }
.order { position: absolute; left: -5px; top: -5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: var(--f-small); font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }

/* 4 Inscription: a core and its four supports (the game has no art for these) */
.insc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 9fr); gap: 12px; }
.insc-supports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.insc-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-soft); }
.insc-tile--core { align-items: center; padding: 16px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px oklch(from var(--accent) l c h / 0.55); }
.insc-mark { width: 26px; height: 26px; margin-top: 1px; fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-linejoin: round; }
.insc-tile--core .insc-mark { width: 40px; height: 40px; stroke: var(--accent); stroke-width: 1.25; }
.insc-mark-core { fill: var(--accent); stroke: none; }
.insc-text { display: grid; gap: 2px; min-width: 0; }
.insc-text .name { font-size: var(--f-body); line-height: 1.25; }

/* 5 Class Specialization: numbered spend order */
.spec { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px 8px; }
.spec-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.spec-art { position: relative; }
.spec-step + .spec-step::before { content: ""; position: absolute; top: 26px; left: calc(-50% - 8px + 33px); right: calc(50% + 33px); height: 1.5px; background: var(--line); }
.spec-step .name { min-height: 2.5em; font-size: var(--f-small); font-weight: 500; line-height: 1.25; color: var(--text-2); text-wrap: balance; }
.spec-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; font-size: var(--f-label); }
.gain { font-weight: 700; }
.gain--none { font-weight: 500; color: var(--text-3); }
.ranks { color: var(--text-3); }

/* ---------- supporting material ---------- */

.support { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 44px; padding-top: 36px; border-top: 1px solid var(--line-soft); }
.rotation { grid-column: 1 / -1; }
.sources { grid-column: span 7; }
.stats { grid-column: span 5; }
.notes { grid-column: 1 / -1; }

.tl { --lab: 3.25rem; --row: 32px; display: flex; flex-wrap: wrap; row-gap: 14px; padding: 0 30px 0 var(--lab); }
.tl-seg { position: relative; flex: 0 0 25%; min-width: 0; background: linear-gradient(to right, var(--line-soft) 1px, transparent 1px) 0 0 / 20% 100%; }
.tl-lane { position: relative; height: calc(var(--rows) * var(--row) + 6px); border-top: 1px solid var(--line-soft); }
.tl-lane-label { position: absolute; left: calc(var(--lab) * -1); top: 9px; display: none; font-size: var(--f-micro); color: var(--text-3); }
.tl-seg:first-child .tl-lane-label { display: block; }
.ico-ev { position: absolute; left: var(--x); top: calc(var(--row) * var(--r, 0) + 5px); }
.ico-ev--small { margin-top: 4px; }
.tl-axis { position: relative; height: 24px; border-top: 1px solid var(--line); }
.tl-tick { position: absolute; left: var(--x); top: 0; height: 4px; border-left: 1px solid var(--line); }
.tl-tick--major { height: 7px; border-left-color: var(--text-3); }
.tl-tick .num { position: absolute; left: -1px; top: 9px; font-size: var(--f-micro); color: var(--text-3); }
.tl-tick--end .num { left: auto; right: 0; }
.tl-readout { min-height: 1.4em; margin-top: 6px; padding-left: 3.25rem; font-size: var(--f-label); color: var(--text-2); }

.src-bar { display: flex; gap: 2px; height: 30px; overflow: hidden; border-radius: 9px; }
.src-seg { flex: var(--w) 1 0; min-width: 3px; }
.src-seg, .src-key { background: color-mix(in oklch, var(--accent) calc(100% - var(--k) * 12.5%), var(--raised)); }
.src-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 32px; margin-top: 18px; }
.src-legend li { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: var(--f-label); }
.src-key { width: 10px; height: 10px; border-radius: 3px; }
.src-legend .share { font-weight: 650; }

.stat-list { display: grid; gap: 9px; }
.marks { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.marks-title { margin: 0 0 12px; font-size: var(--f-label); font-weight: 650; color: var(--text); }
.mark-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.mark { display: grid; gap: 5px; min-width: 0; }
.mark-head { display: flex; align-items: center; gap: 8px; font-size: var(--f-label); font-weight: 600; }
.mark-tag { margin-left: auto; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--f-small); font-weight: 500; color: var(--text-2); white-space: nowrap; }
.mark-tag b { font-weight: 700; color: var(--text); }
.mark-bar { position: relative; height: 10px; border-radius: 5px; background: var(--raised); }
.mark-fill { display: block; width: var(--w); height: 100%; border-radius: 5px; background: var(--accent); }
.mark.is-off .mark-fill { background: var(--over); }
.mark-line { position: absolute; top: -4px; bottom: -4px; left: var(--p); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.mark-now, .mark-note { margin: 0; font-size: var(--f-small); line-height: 1.4; color: var(--text-2); }
.mark-note { color: var(--text-3); }
.marks-legend { margin: 12px 0 0; font-size: var(--f-micro); color: var(--text-3); }
.stat { display: grid; grid-template-columns: 1rem auto minmax(4.5rem, 7.5rem) minmax(0, 1fr) 2.75rem; align-items: center; gap: 10px; font-size: var(--f-label); }
.stat-rank { color: var(--text-3); font-size: var(--f-small); text-align: center; }
.stat-bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--raised); }
.stat-fill { display: block; width: var(--w); height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; }
.stat-value { color: var(--text-2); text-align: right; }

.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 44px; }
.note-group h2 { margin-bottom: 8px; }
.note-group li { display: flex; gap: 9px; padding: 3px 0; font-size: var(--f-label); color: var(--text-2); }
.note-group .glyph { width: 15px; height: 15px; margin-top: 2px; color: var(--text-3); }

/* ---------- tank: class matrix (summary) and the tank report ---------- */

.scale-sign { display: inline-flex; margin-left: 5px; color: var(--text-2); vertical-align: -1px; }
.nowrap { white-space: nowrap; }
.scale-sign .glyph { width: 13px; height: 13px; stroke-width: 2.4; }
.scale-legend { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px; margin-top: 14px; font-size: var(--f-small); line-height: 1.45; color: var(--text-3); }
.scale-legend .scale-sign { margin: 2px 6px 0 0; }
.headline-unit .scale-sign { vertical-align: 0; }
.scale-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; max-width: 110ch; margin-top: 8px; font-size: var(--f-small); line-height: 1.45; color: var(--text-3); }
.scale-note .tk-tag { color: var(--text-2); }

.hold { display: inline-grid; place-items: center; color: var(--text-2); }
.hold .glyph { width: 20px; height: 20px; }
.hold--no { color: var(--over); }
.ico-hold { --s: 24px; }

.tkm { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--f-small); }
.tkm th, .tkm td { padding: 0; text-align: left; font-weight: 400; }
.tkm thead th { padding: 0 0 8px 8px; font-size: var(--f-micro); line-height: 1.25; color: var(--text-3); vertical-align: bottom; }
.tkm thead .scale-sign { margin-left: 3px; }
.tkm thead .scale-sign .glyph { width: 11px; height: 11px; }
.tkm-class { width: 34%; }
.tkm-hold { width: 12%; }
.tkm thead .tkm-hold, .tkm td.tkm-hold { padding-left: 0; text-align: center; }
.tkm tbody th, .tkm tbody td { padding: 6px 0; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tkm tbody th > span { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: var(--f-label); color: var(--text-2); }
.tkm tbody .name { font-weight: 500; }
.tkm tr.is-top th > span { color: var(--text); }
.tkm tr.is-top .name { font-weight: 700; }
.tkm td.tkm-cell { padding-left: 8px; color: var(--text-2); }
.tkm tr.is-top .tkm-cell { color: var(--text); font-weight: 650; }
.tkm-value { display: flex; align-items: center; min-height: 18px; white-space: nowrap; }
.tkm-value .glyph { width: 17px; height: 17px; }
.tkm-bar { display: block; height: 3px; margin-top: 3px; overflow: hidden; border-radius: 2px; background: var(--raised); }
.tkm-fill { display: block; width: var(--w); height: 100%; border-radius: 2px; background: color-mix(in oklch, var(--text-3) 70%, var(--raised)); transform-origin: left; }
.tkm tr.is-top .tkm-fill { background: var(--accent); }
.tkm .is-over .tkm-value { color: var(--over); }
.tkm .is-over .tkm-fill, .tkm tr.is-top .is-over .tkm-fill { background: var(--over); }

.tank-report { grid-column: 1 / -1; }
.tk-alert { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; margin-bottom: 24px; padding: 14px 16px; border-radius: 12px; background: color-mix(in oklch, var(--over) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--over) 45%, transparent); }
.tk-alert > .glyph { margin-top: 1px; color: var(--over); }
.tk-alert p { max-width: 80ch; font-size: var(--f-label); color: var(--text-2); }
.tk-alert .tk-alert-lead { margin-bottom: 3px; font-size: var(--f-body); font-weight: 650; color: var(--text); }
.tk-alert .scale-sign { margin: 0 6px 0 0; }

.tk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 44px; }
.tk-tile { display: grid; align-content: start; gap: 10px; min-width: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.tk-tile h3, .tk-lower h3 { font-size: var(--f-label); font-weight: 650; color: var(--text-2); }
.tk-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 1.625rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.tk-value .unit { font-size: var(--f-small); font-weight: 400; letter-spacing: 0; color: var(--text-3); }
.tk-value.is-over { color: var(--over); }
.tk-value--state { align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 650; letter-spacing: 0; }
.tk-value--state .glyph { width: 22px; height: 22px; }
.tk-value--state .hold .glyph { width: 24px; height: 24px; color: var(--accent); }
.tk-value--state .hold--no .glyph { color: var(--over); }
.tk-cap { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: var(--f-small); color: var(--text-3); }
.tk-cap b { font-weight: 650; color: var(--text-2); }

.tk-row, .tk-pips { display: grid; grid-template-columns: 7.25rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 10px; font-size: var(--f-small); color: var(--text-2); }
.tk-row-label { display: flex; align-items: center; line-height: 1.25; }
.tk-row-value { font-weight: 650; color: var(--text); text-align: right; }
.tk-bar, .tk-meter { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--raised); }
.tk-meter { height: 12px; margin: 2px 0; }
.tk-fill { display: block; width: var(--w); min-width: 2px; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; }
.tk-fill.is-plain { background: color-mix(in oklch, var(--text-3) 75%, var(--raised)); }
.tk-fill.is-over { background: var(--over); }
.tk-health, .tk-median { position: absolute; top: -3px; bottom: -3px; left: var(--x); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.tk-median { top: 0; bottom: 0; background: none; border-left: 2px dotted var(--bg); }
.tk-key { display: inline-flex; align-items: center; gap: 7px; }
.tk-key .tk-health, .tk-key .tk-median { position: static; width: 2px; height: 12px; margin: 0; }
.tk-key .tk-median { border-left-color: var(--text-3); }

.pips { display: grid; grid-template-columns: repeat(auto-fill, minmax(8px, 12px)); gap: 2px; }
.pip { display: block; height: 14px; border-radius: 3px; background: linear-gradient(to right, var(--accent) calc(var(--f) * 100%), var(--raised) 0); }
.tk-pips { align-items: start; }
.tk-pips .tk-row-label, .tk-pips .tk-row-value { min-height: 14px; }

.tk-lower { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 44px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.tk-heavy { grid-column: span 7; display: grid; align-content: start; gap: 10px; min-width: 0; }
.tk-scale { grid-column: span 5; display: grid; align-content: start; gap: 10px; min-width: 0; }
.tk-lower > :only-child { grid-column: 1 / -1; }
.tk-mechanics { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: var(--f-label); color: var(--text-2); }
.tk-mechanics li, .tk-attacks li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tk-mechanics .name, .tk-attacks .name { font-weight: 550; }
.tk-attack-meta { font-size: var(--f-small); color: var(--text-3); }
.tk-tag { padding: 1px 7px 2px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--f-micro); color: var(--text-3); white-space: nowrap; }
.tk-mechanics + h3 { margin-top: 8px; }
.tk-attacks { display: grid; gap: 8px; font-size: var(--f-label); color: var(--text-2); }
.tk-attacks .tk-meter { flex: 1 1 8rem; }
.tk-attack-hit { font-size: var(--f-small); color: var(--text-3); }
.tk-attack-hit b { font-weight: 650; color: var(--text-2); }

.tk-scale table { width: 100%; border-collapse: collapse; font-size: var(--f-small); }
.tk-scale th, .tk-scale td { padding: 5px 0 5px 10px; text-align: right; font-weight: 400; color: var(--text-2); white-space: nowrap; }
.tk-scale th:first-child { padding-left: 0; text-align: left; color: var(--text-3); }
.tk-scale thead th { padding-top: 0; color: var(--text-3); }
.tk-scale thead th.is-now { font-weight: 700; color: var(--text); }
.tk-scale tbody tr { border-top: 1px solid var(--line-soft); }
.tk-scale td.is-over { color: var(--over); }
.tk-scale td .glyph { width: 15px; height: 15px; vertical-align: -3px; }

/* ---------- marks, free alternative, accessories, build ranking ---------- */

.tag { display: inline-flex; align-items: center; padding: 1px 7px 2px; border-radius: 999px; font-size: var(--f-micro); font-weight: 600; line-height: 1.3; letter-spacing: 0; white-space: nowrap; }
.tag--yours { background: var(--accent-soft); color: var(--accent); }
.tag--paid { color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--warn) 55%, transparent); }
.tag--assumed { padding: 0 6px 1px; border: 1px dashed var(--text-3); color: var(--text-2); cursor: help; }
.tag--plain { font-weight: 500; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

.gear-free { display: grid; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.gear-free-label { font-size: var(--f-micro); color: var(--text-3); }
.gear-free-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--f-label); }
.gear-free-item .name { font-weight: 550; }
.ico-free { --s: 28px; }
.gear-free-loss { font-size: var(--f-small); color: var(--text-3); }
.gear-free-loss.is-loss { font-weight: 650; color: var(--over); }
.gear-free-also { font-size: var(--f-small); color: var(--text-3); }

.acc { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line-soft); }
.acc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.acc-head h4 { margin: 0; font-size: var(--f-label); font-weight: 650; color: var(--text-2); }
.acc-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 18px; }
.acc-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 3px 10px; min-width: 0; }
.acc-main { display: contents; }
.ico-acc { --s: 40px; grid-row: span 2; align-self: start; border-radius: 10px; }
.acc-void { grid-row: span 2; align-self: start; width: 40px; height: 40px; border: 1px dashed var(--line); border-radius: 10px; }
.acc-top { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 18px; }
.acc-gain { margin-left: auto; font-size: var(--f-label); font-weight: 700; color: var(--text); white-space: nowrap; }
.acc-gain.is-zero { font-weight: 500; color: var(--text-3); }
.acc-gain.is-unsure { font-weight: 600; color: var(--text-3); text-decoration: underline dotted; text-underline-offset: 3px; }
.acc-gain.is-none { font-size: var(--f-micro); font-weight: 400; color: var(--text-3); }
.acc-main > .name { grid-column: 2; align-self: start; font-size: var(--f-body); line-height: 1.25; }
.acc-main > .effect { grid-column: 1 / -1; margin-top: 5px; }
.acc-item.is-empty .acc-main > .effect { grid-column: 2; margin-top: 0; font-size: var(--f-small); color: var(--text-3); }
.acc-flag, .acc-note, .affixes, .acc-unranked { grid-column: 1 / -1; }
.acc-flag { display: flex; align-items: flex-start; gap: 6px; font-size: var(--f-small); color: var(--warn); }
.acc-flag .glyph { width: 14px; height: 14px; margin-top: 1px; }
.acc-item.is-unsure .ico-acc { opacity: 0.6; outline: 1px dashed var(--text-3); outline-offset: 2px; }
.acc-note, .acc-unranked { font-size: var(--f-small); color: var(--text-3); }
.affixes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.affixes li { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-soft); font-size: var(--f-micro); color: var(--text-2); white-space: nowrap; }
.affixes .num { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--raised); font-weight: 650; }
.affixes li:first-child .num { background: var(--accent); color: var(--accent-ink); }

.br-list { display: grid; gap: 12px; }
.br-more + .br-or:not([hidden]) { margin-top: -4px; }
.br-row { display: grid; grid-template-columns: 0.9rem auto minmax(1.5rem, 1fr) 3.1rem 2.75rem; align-items: center; gap: 8px 8px; font-size: var(--f-label); color: var(--text-2); }
.br-rank { font-size: var(--f-small); color: var(--text-3); text-align: center; }
.br-skills { display: flex; gap: 5px; }
.br-skill { position: relative; display: grid; }
.ico-br { --s: 28px; }
.br-skill.is-same .ico { opacity: 0.36; }
.br-skill.is-diff .ico { outline: 2px solid var(--accent); outline-offset: 1px; }
.br-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--raised); }
.br-fill { display: block; width: var(--w); height: 100%; border-radius: 4px; background: color-mix(in oklch, var(--text-3) 60%, var(--raised)); transform-origin: left; }
.br-row.is-top { color: var(--text); }
.br-row.is-top .br-fill { background: var(--accent); }
.br-row.is-top .br-value { font-weight: 700; }
.br-value { text-align: right; }
.br-behind { font-size: var(--f-small); color: var(--text-3); text-align: right; }
.br-more { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.br-note, .br-or { font-size: var(--f-small); color: var(--text-3); }
.br-or { grid-column: 2 / -1; color: var(--text-2); }
.br-or[hidden] { display: none; }
.br-or-btn { position: absolute; right: -6px; bottom: -6px; min-width: 19px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: var(--f-micro); font-weight: 650; line-height: 17px; color: var(--text); }
.br-or-btn::after { content: ""; position: absolute; inset: -12px; }
.br-or-btn[aria-expanded="true"] { background: var(--accent); box-shadow: none; color: var(--accent-ink); }
.headline-err { font-size: var(--f-body); font-weight: 500; letter-spacing: 0; color: var(--text-3); }

/* ---------- about these numbers ---------- */

.about {
  position: fixed;
  inset: 68px var(--pad) auto auto;
  width: min(27rem, calc(100vw - 32px));
  max-height: calc(100dvh - 96px);
  margin: 0;
  padding: 20px 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.about::backdrop { background: none; }
.about h2 { font-size: 1rem; font-weight: 650; }
.about h3 { margin: 18px 0 6px; font-size: var(--f-label); font-weight: 650; color: var(--text-2); }
.about p { margin-top: 8px; font-size: var(--f-label); color: var(--text-2); }
.about .about-lead { color: var(--text); }
.about .about-warn { color: var(--warn); font-weight: 600; }
.about-close { float: right; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -8px 0 8px; border-radius: 50%; color: var(--text-2); }
.about-close:hover { background: var(--raised); color: var(--text); }
.about-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin-top: 8px; font-size: var(--f-label); }
.about-stats div { display: flex; justify-content: space-between; gap: 12px; }
.about-stats dt, .about-scenarios dt { color: var(--text-3); }
.about-stats dd { font-weight: 600; }
.about-scenarios { display: grid; gap: 8px; font-size: var(--f-label); }
.about-scenarios div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 10px; }
.about-scenarios dt { display: flex; align-items: flex-start; gap: 6px; }
.about-scenarios .glyph { width: 15px; height: 15px; margin-top: 1px; }
.about-scenarios dd { color: var(--text-2); }
.about-list { display: grid; gap: 4px; margin-top: 8px; font-size: var(--f-label); color: var(--text-2); }
.about-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.about-list li::before { content: ""; width: 4px; height: 4px; margin-top: 0.5em; border-radius: 50%; background: var(--text-3); }
.about .about-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: var(--f-small); color: var(--text-3); }

/* ---------- motion: values settle when the guide changes; nothing plays on first load ---------- */

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; }
.is-swap .ring-arc { animation: ring 0.28s var(--ease) both; }
.is-swap .stat-fill, .is-swap .rank-fill, .is-swap .tkm-fill, .is-swap .tk-fill, .is-swap .br-fill { animation: grow 0.26s var(--ease) both; }
.is-bracket .newmark { animation: mark 0.26s var(--ease) both; }
@keyframes ring { from { stroke-dasharray: 0 100; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes mark { from { opacity: 0; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) {
  .is-swap .ring-arc, .is-swap .stat-fill, .is-swap .rank-fill, .is-swap .tkm-fill, .is-swap .tk-fill, .is-swap .br-fill { animation: none; }
  .is-bracket .newmark { animation: mark-calm 0.2s linear both; }
  .role-btn:active:not(:disabled), .about-btn:active, .scene--other:active { transform: none; }
}
@keyframes mark-calm { from { opacity: 0; } }

/* ---------- responsive ---------- */

@media (max-width: 1160px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand roles about" "level level level" "info info info"; }
  .roles { justify-self: start; }
  .level-info { min-height: 18px; }
}

@media (max-width: 1020px) {
  .tk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-heavy, .tk-scale { grid-column: 1 / -1; }
  .build { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "plan" "support"; gap: 32px; }
  .summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; align-items: start; }
  .summary > .build-title, .summary > .headline, .summary > .secondary, .summary > .ranking, .summary > .builds { grid-column: 1; }
  .acc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > .where, .summary > .targets { grid-column: 2; }
  .summary > .where { grid-row: 1 / span 3; margin-top: 0; }
  .summary > .targets { grid-row: 4 / span 2; }
  .tl-seg { flex-basis: 50%; }
  .tl-seg:nth-child(odd) .tl-lane-label { display: block; }
  .tl-seg:nth-child(odd) .tl-tick--end { display: none; }
}

@media (max-width: 700px) {
  :root { --pad: 16px; }
  .top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand about" "roles roles" "level level" "info info"; gap: 10px 12px; }
  .roles { justify-self: stretch; }
  .role-btn { gap: 5px; padding: 0 4px; }
  .role-long { display: none; }
  .role-short { display: inline; }
  .ico-roleclass { --s: 22px; }
  .level { column-gap: 12px; }
  .level-now { min-width: 0; }
  .level-num { font-size: 2.25rem; }
  .about { inset: auto 16px 16px 16px; width: auto; max-height: calc(100dvh - 32px); }

  main { padding-top: 20px; padding-bottom: 56px; }
  .summary { display: block; }
  .summary > .where { margin-top: 30px; }
  .build-title { margin-bottom: 18px; }
  .ico-title { --s: 56px; }
  .build-class { font-size: 1.5rem; }
  .headline-value { font-size: 3.25rem; }

  .plan { margin-inline: -4px; padding: 2px 14px 20px; border-radius: 18px; }
  .plan-sec { padding: 16px 0 20px; }

  .gear { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .acc-list { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gear-free { margin-top: 6px; }
  .gear-piece { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "art slot" "art text"; column-gap: 14px; row-gap: 1px; align-items: center; }
  .gear-piece .slot { grid-area: slot; align-self: end; }
  .gear-art { grid-area: art; }
  .gear-text { grid-area: text; align-self: start; }
  .ico-gear { --s: 52px; }
  .ico-mini { --s: 34px; }
  .gear-link { flex-basis: 22px; margin: 0 11px 0 6px; }

  .talents { gap: 0 4px; }
  .talent { display: contents; }
  .talent-top { grid-row: 1; grid-column: var(--i); padding: 6px 2px 12px; gap: 4px; }
  .talent-ring { width: 78px; height: 78px; }
  .ico-skill { --s: 60px; }
  .ico-pip { width: 22px; height: 22px; }
  .boosters { gap: 2px; bottom: -8px; }
  .talent .share { font-size: var(--f-name); }
  .talent-top .name { font-size: var(--f-label); }
  .talent-more { grid-column: 1 / -1; grid-row: calc(var(--i) + 1); display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line-soft); text-align: left; }
  .slot--inline { display: block; padding-top: 1px; }
  .why { min-height: 0; text-wrap: wrap; }
  .alts { display: flex; flex-wrap: wrap; gap: 6px 16px; min-height: 0; margin-top: 8px; padding-top: 0; border-top: 0; }
  .alt { display: inline-flex; gap: 6px; white-space: nowrap; }
  .alt .ico { grid-row: auto; }
  .ico-alt { --s: 24px; }

  .pets { gap: 12px; }
  .pet { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 4px; text-align: center; }
  .pet-art { grid-row: auto; }
  .ico-pet { --s: 72px; }
  .pet-meta { justify-content: center; }
  .pet + .pet::before { left: -10px; top: 32px; }

  .insc { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .insc-supports { gap: 8px; }
  .insc-tile { padding: 10px 11px; gap: 9px; }
  .insc-tile--core { padding: 12px 14px; }
  .insc-tile--core .insc-mark { width: 32px; height: 32px; }
  .insc-mark { width: 20px; height: 20px; }

  .spec { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 6px; }
  .ico-spec { --s: 48px; }
  .spec-step + .spec-step::before { top: 24px; left: calc(-50% - 6px + 30px); right: calc(50% + 30px); }
  .spec-step:nth-child(4n + 1)::before { display: none; }

  .support { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 28px; }
  .tk-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .tk-lower { gap: 22px; }
  .tk-row, .tk-pips { grid-template-columns: 6.5rem minmax(0, 1fr) 3.25rem; }
  .sources, .stats { grid-column: 1 / -1; }
  .tl { --lab: 2.75rem; padding-right: 30px; }
  .tl-seg { flex-basis: 100%; }
  .tl-seg .tl-lane-label { display: block; }
  .tl-lane.is-empty { display: none; }
  .tl-seg:not(:last-child) .tl-tick--end { display: none; }
  .tl-readout { padding-left: 2.75rem; }
  .src-legend { grid-template-columns: minmax(0, 1fr); }
  .notes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
  .role-btn > .glyph { display: none; }
  .level-num { font-size: 2rem; }
}
