/* Ouro — one stylesheet. Tokens first: the hero colours from heroplanner-v2 (navy, with gold for the wordmark,
   headings, links and active states) and the planner's font for the wordmark and page titles.
   Sections are separated by space and a rule, not boxed; only tables and inputs get borders. */
@font-face {
  font-family: "paragoncity";
  src: url("fonts/REDCIRCL.ttf") format("truetype");
  font-display: swap;
}
:root {
  --bg: #0e1726;
  --bg-2: #18243a;
  --panel: #15223a;
  --panel-2: #16223a;
  --line: #1f2f4a;
  --line-2: #2c4266;
  --text: #e6ecf5;
  --text-2: #b6c3d6;
  --muted: #8299b8;
  --accent: #f2bd4b;
  --accent-soft: #1b2a45;
  --gold: #f2bd4b;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px rgba(0, 0, 0, .4);
  --buff: #5fd49a; --debuff: #ff8f6b; --ctl: #b79cff;
  --radius: 12px;
  --top-h: 56px;

  --smash: #c9a27a; --lethal: #ff6b7a; --fire: #ff8a4c; --cold: #4cc3ff; --energy: #8199ff;
  --negative: #b388ff; --psionic: #ff7bd0; --toxic: #6fd47a; --plain: #8a93ab;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "paragoncity", "Impact", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); font-size: .86em; }
code { background: var(--bg-2); border-radius: 4px; padding: .05em .35em; }
kbd { border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .4em; font-size: .75em; color: var(--muted); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font: 400 clamp(1.6rem, 3vw, 2.1rem)/1.15 var(--font-display); letter-spacing: .01em; }
.page-head { overflow-wrap: anywhere; }  /* long internal names and table names on narrow screens */
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: .9rem; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
p { margin: 0 0 .7em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---- top bar */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 24px;
  padding: 0 24px; background: #070c16; border-bottom: 1px solid var(--line);
}
.top-l { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top-r { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.ver { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; color: var(--muted); font-size: .78rem; line-height: 1.3; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand span { font: 400 1.35rem/1 var(--font-display); color: var(--gold); letter-spacing: .02em; }
.brand img { width: 26px; height: 26px; flex: none; }
.brand:hover { text-decoration: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--line-2); }
.crumbs a { flex: none; display: inline-flex; align-items: center; gap: 7px; }
.crumbs .picon { width: 20px; height: 20px; }
.crumbs a:last-child { flex: 0 1 auto; min-width: 0; }
.crumbs a:last-child span { overflow: hidden; text-overflow: ellipsis; }
.search-btn, .icon-btn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .88rem;
}
.search-btn:hover, .icon-btn:hover { border-color: var(--line-2); color: var(--text); }
.search-btn { width: clamp(220px, 22vw, 400px); }
.search-btn span { flex: 1; text-align: left; }
.icon-btn { padding: 0 8px; }
.top-c { position: relative; display: flex; align-items: center; gap: 8px; }
@media (min-width: 641px) { .dice { position: absolute; left: calc(100% + 8px); } }  /* keeps the search box centred */
.dice { border-color: transparent; }
.dice circle { fill: currentColor; stroke: none; }
.about-btn { border-color: transparent; }
.about-btn svg circle:last-child { fill: currentColor; stroke: none; }
.about-btn:hover { text-decoration: none; }
.about-pop {
  position: fixed; inset: auto; top: calc(var(--top-h) + 8px); right: 16px; margin: 0; width: min(360px, calc(100vw - 32px));
  padding: 14px 20px 8px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.about-pop h2 { margin: 0 0 2px; font-size: 1rem; }
.about-pop .stats + h2 { margin-top: 14px; }
.about-pop .stats dt, .about-pop .stats dd { font-size: .88rem; }

.crumbs:has(a[data-nav]) { gap: 14px; }
.crumbs:has(a[data-nav]) .sep { display: none; }
.crumbs a[data-nav]::after { content: ""; margin-left: -1px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--muted); opacity: .7; }
.crumb-menu {
  position: fixed; z-index: 40; width: 280px; max-height: min(460px, 70vh); overflow: auto; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}
.crumb-menu[hidden] { display: none; }
.crumb-menu a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--text-2); font-size: .9rem; }
.crumb-menu a:hover, .crumb-menu a:focus-visible { background: var(--bg-2); color: var(--text); text-decoration: none; outline: none; }
.crumb-menu a[aria-current] { color: var(--gold); font-weight: 600; background: var(--accent-soft); }
.crumb-menu img, .crumb-menu i { width: 22px; height: 22px; flex: none; }

/* ---- layout */
.layout { width: 100%; max-width: 1520px; margin: 0 auto; padding: 28px 24px 64px; flex: 1; }
.layout.has-side { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-content: start; }
.side { position: sticky; top: calc(var(--top-h) + 24px); align-self: start; max-height: calc(100vh - var(--top-h) - 48px); overflow: auto; }
.side-head { display: flex; flex-direction: column; padding: 0 8px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.side-head a { font-weight: 650; color: var(--text); }
.side-head span { font-size: .8rem; color: var(--muted); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 5px; color: var(--text-2); font-size: .9rem; }
.side-list a:hover { background: var(--bg-2); text-decoration: none; color: var(--text); }
.side-list a[aria-current] { background: var(--bg-2); color: var(--gold); font-weight: 600; }
.side-list span:nth-child(2) { flex: 1; }
.side-list .lvl { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }


/* ---- sections */
.sec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 28px; }
.sec > h2, .sec-head { margin-bottom: 10px; }
.sec details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.sec details > summary::-webkit-details-marker { display: none; }
.sec details > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s; }
.sec details[open] > summary::before { transform: rotate(90deg); }
.sec details > summary h2 { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.sec details[open] > summary { margin-bottom: 12px; }
.count { font-size: .85rem; font-weight: 400; color: var(--muted); }
.note { color: var(--muted); font-size: .84rem; margin-top: 10px; }
.eyebrow { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.help { color: var(--text-2); max-width: 72ch; }
.page-head { margin-bottom: 8px; }
.page-head h1 { margin-bottom: 10px; }
.also { font-size: .9rem; color: var(--muted); }

/* power icon placeholder: initials on a damage-type colour */
.picon {
  --c: var(--plain); display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  font-size: .62rem; font-weight: 700; color: #fff; background: var(--c);
}
.picon.sm { width: 22px; height: 22px; font-size: .56rem; }
.picon.md { width: 36px; height: 36px; font-size: .8rem; }
.picon.lg { width: 64px; height: 64px; font-size: 1.2rem; }
/* Game icons carry their own shape (round powers, square inspirations, Incarnate frames), so they aren't cropped. */
.picon.img { background: none; border-radius: 0; }
.picon.img img { width: 100%; height: 100%; display: block; }
.picon.blank { background: none; }
.smash { --c: var(--smash); } .lethal { --c: var(--lethal); } .fire { --c: var(--fire); } .cold { --c: var(--cold); }
.energy { --c: var(--energy); } .negative { --c: var(--negative); } .psionic { --c: var(--psionic); } .toxic { --c: var(--toxic); }
.plain { --c: var(--plain); }
.dmg { color: var(--c, var(--text)); font-weight: 650; }
h1.with-icon { display: flex; align-items: center; gap: 14px; }
.expr { border-bottom: 1px dotted var(--line-2); cursor: help; }
.expr a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 2px; cursor: pointer; }
.expr a:hover, .expr a:focus-visible { color: var(--accent); text-decoration-color: currentColor; }

/* ---- panels: the effects and the stats column; everything secondary stays flat */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .note { padding: 10px 16px; margin: 0; border-top: 1px solid var(--line); }

/* ---- power page: header in the icon's colour (--pc), then the main column and the stats panel */
.power { --pc: var(--accent); --pc-soft: color-mix(in oklab, var(--pc) 75%, var(--muted)); }
.phead {
  display: flex; gap: 20px; align-items: center; margin-bottom: 24px; padding: 20px 22px; border-radius: 16px;
  background: radial-gradient(520px 170px at 70px 50%, color-mix(in srgb, var(--pc-soft) 18%, transparent), transparent 75%),
              linear-gradient(90deg, color-mix(in srgb, var(--pc-soft) 6%, transparent), transparent 80%);
  border: 1px solid color-mix(in srgb, var(--pc-soft) 14%, transparent);
}
.phead .picon.lg { border-radius: 50%; box-shadow: 0 0 26px color-mix(in srgb, var(--pc-soft) 38%, transparent); }
.phead .picon.lg.img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 13px color-mix(in srgb, var(--pc-soft) 38%, transparent)); }
.phead-text { min-width: 0; }
.phead .meta { margin: 6px 0 0; color: var(--text-2); font-size: .95rem; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.pmain { grid-column: 1; grid-row: 1; min-width: 0; }
.paside { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--top-h) + 20px); }
.pmain > .help { margin-bottom: 4px; }
.pmain > .panel { margin-top: 20px; }

.headline { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.headline .gv, .headline .v { font-size: 2.2rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.headline .gv { color: var(--gold); text-decoration: underline dotted var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 6px; cursor: help; }
.headline .hl-k { color: var(--text-2); font-size: .92rem; }
.stats { margin: 0; }
.stats .st { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stats .st:last-child { border-bottom: 0; }
.stats dt { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .92rem; }
.stats dt .picon { width: 26px; height: 26px; }
.stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.stats dd[title] { text-decoration: underline dotted var(--line-2); text-underline-offset: 4px; cursor: help; }
.stats-at .st:last-child { border-bottom: 1px solid var(--line); }
.enh { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.enh h2 { margin-bottom: 10px; }

.tray { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tray a { display: block; border-radius: 50%; }
.tray a:hover .picon, .tray a:focus-visible .picon { filter: brightness(1.2); }
.tray .picon.md { width: 38px; height: 38px; }
.setcats { list-style: none; margin: 0; padding: 0; font-size: .88rem; color: var(--text-2); }
.setcats li { padding: 2px 0; }
.setcats a { display: inline-flex; align-items: center; gap: 8px; }

/* value tones: buffs, debuffs and costs, control */
.v.buff { color: var(--buff); }
.v.debuff { color: var(--debuff); }
.v.ctl { color: var(--ctl); }

.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.ctl { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.ctl select {
  font: inherit; font-size: .88rem; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 5px 28px 5px 9px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.at-wrap { position: relative; }
.at-pick {
  display: flex; align-items: center; gap: 7px; font: inherit; font-size: .88rem; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 28px 3px 6px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.at-pick img, .at-menu img, .at-pick i, .at-menu i { width: 22px; height: 22px; flex: none; }
.at-menu {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; min-width: 100%; max-height: min(420px, 60vh); overflow: auto;
  padding: 6px; display: grid; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}
.at-menu[hidden] { display: none; }
.at-menu button {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; border: 0; border-radius: 6px; background: none;
  color: var(--text-2); font: inherit; font-size: .9rem; text-align: left; white-space: nowrap; cursor: pointer;
}
.at-menu button:hover, .at-menu button:focus-visible { background: var(--bg-2); color: var(--text); outline: none; }
.at-menu button[aria-selected="true"] { color: var(--text); font-weight: 600; background: var(--accent-soft); }
.ctl.lvl b { color: var(--text); font-variant-numeric: tabular-nums; display: inline-block; min-width: 2ch; }
.ctl input[type="range"] { width: 120px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: .82rem; border: 0; background: none; color: var(--muted); padding: 4px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--bg-2); color: var(--gold); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); cursor: pointer; }
.switch input { margin: 0; accent-color: var(--accent); }

.fx { list-style: none; margin: 0; padding: 0; }
.fx li { display: grid; grid-template-columns: 26px 6rem minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fx .picon { width: 26px; height: 26px; }
.fx li.fx-g { display: block; margin-top: 12px; padding: 5px 10px; border: 0; border-radius: 6px; font-size: .84rem; font-weight: 600;
  color: var(--text); background: color-mix(in srgb, var(--pc, var(--accent)) 14%, transparent); }
.fx li.fx-g:first-child { margin-top: 4px; }
.fx li:last-child { border-bottom: 0; }
.fx .v { font-size: .8rem; line-height: 1.3; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; white-space: pre; }
.fx .v::first-line { font-size: 1.05rem; }   /* a duration's magnitude goes on a smaller second line */
.fx .fx-l { display: flex; flex-direction: column; min-width: 0; }
.fx .fx-l small { color: var(--muted); font-size: .8rem; }
.fx .fx-l small:empty { display: none; }
.fx .fx-w { font-size: .8rem; color: var(--gold); }
.fx .fx-t { font-size: .82rem; color: var(--muted); }
.fx.minor .v::first-line { font-size: .95rem; }
.fx.minor .picon { width: 22px; height: 22px; justify-self: center; }
.fx-h { margin: 18px 0 6px; }
body[data-pv="pve"] .pv-pvp, body[data-pv="pvp"] .pv-pve { display: none; }
.details-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }

/* enhancement sets */
.eset-ctl { margin: 0 0 16px; }
.ctl[hidden] { display: none; }
.eset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.eset-grid h2 { margin-top: 0; }
.pieces { list-style: none; margin: 0; padding: 0; }
.piece { padding: 10px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.piece:last-child { border-bottom: 0; }
.piece:target .pc-h b { color: var(--accent); }
.pc-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pc-h b { font-weight: 600; }
.tag { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); }
.piece .fx li { padding: 4px 0; border: 0; }
.bonuses .bn-sub { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.ep { font-size: .88rem; }
.ep li { padding: 3px 0; }
.ep b { font-weight: 600; margin-right: 6px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; margin: 0 0 12px; }
section[id] { scroll-margin-top: 72px; }
@media (max-width: 900px) { .eset-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- enhancement page (outside sets) */
.enh-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.enh-stack h2 { margin-top: 0; }
.enh-page .nm { display: flex; align-items: center; gap: 8px; }
.enh-page .effects td { vertical-align: middle; }
.enh-page .effects code { font-size: .78rem; background: none; padding: 0; color: var(--muted); }
.enh-tbl td.cur { color: var(--gold); font-weight: 650; }
.enh-page .panel h3 { margin: 14px 0 6px; font-size: .9rem; }

/* ---- tables */
.tbl td { padding: 5px 10px; }
.tbl th span, .tbl th code { display: block; }
.tbl th .picon { margin-left: auto; margin-bottom: 4px; }
.tbl th code { font-size: .7rem; font-weight: 400; color: var(--muted); background: none; padding: 0; }
.tbl th:first-child, .tbl td:first-child { position: sticky; left: 0; background: var(--bg); white-space: nowrap; }
.tbl td code { font-size: .8rem; background: none; padding: 0; }
.tbl .types .nm { display: inline-flex; align-items: center; gap: 6px; margin: 2px 16px 2px 0; white-space: nowrap; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line-2); border-bottom: 0; }

/* proc chance */
.proc-ctl { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.proc-ctl .ctl { min-width: 0; max-width: 100%; justify-content: flex-start; }
.proc-ctl .ctl > span:first-child { min-width: 2.2em; }
.proc-ctl .at-wrap { min-width: 0; }
.proc-ctl .at-pick { max-width: 100%; }
.proc-ctl .at-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-ctl .at-menu { width: max-content; max-width: min(520px, calc(100vw - 32px)); }
.proc-ctl .at-menu button { white-space: normal; }
@media (max-width: 640px) {
  .proc-ctl { position: relative; }
  .proc-ctl .at-wrap { position: static; }
  .proc-ctl .at-menu { left: 0; right: 0; top: 40px; width: auto; max-width: none; }
}
.pk-note { margin-left: auto; padding-left: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.at-pick .pk-note { padding-left: 4px; }
.proc-ctl input[type="number"] {
  font: inherit; font-size: .88rem; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 4px 8px; width: 5.5em; font-variant-numeric: tabular-nums;
}
.proc-out { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.proc-out .gv { font-size: 2.2rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.proc-out .hl-k { color: var(--text-2); font-size: .92rem; }
.proc-chart { margin-top: 8px; min-height: 220px; }
.proc-chart svg { display: block; overflow: visible; width: 100%; height: 220px; stroke: none; }
.pc-grid { stroke: var(--line); stroke-width: 1; }
.pc-ref { stroke: var(--line-2); stroke-width: 1; }
.pc-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pc-title { fill: var(--text-2); font-size: 12px; }
.pc-line { fill: none; stroke: var(--pc, var(--accent)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pc-area { fill: var(--pc, var(--accent)); opacity: .1; }
.pc-dot { fill: var(--pc, var(--accent)); stroke: var(--panel); stroke-width: 2; pointer-events: none; }
.pc-cross { stroke: var(--line-2); stroke-width: 1; pointer-events: none; }
.pc-hit { fill: transparent; cursor: crosshair; }

table { border-collapse: collapse; width: 100%; }
.effects { font-size: .9rem; }
.effects th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line-2); }
.effects td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.effects .num, .effects .val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.effects .val .v { font-weight: 650; white-space: pre-line; }
.effects .tgt { color: var(--text-2); font-size: .85rem; white-space: nowrap; }
.effects .det { font-size: .8rem; color: var(--muted); }
.effects .det:empty { display: none; }
.effects .formula { display: none; }
.effects.show-formulas .formula { display: table-cell; }
.effects .f { font-size: .76rem; background: none; padding: 0; color: var(--muted); }
.effects .cond td { background: var(--panel-2); font-size: .8rem; color: var(--text-2); padding: 5px 10px; }
.effects .cond code { font-size: .74rem; }
.effects tbody.d1 td.lbl { padding-left: 26px; }
.effects tbody.d2 td.lbl, .effects tbody.d3 td.lbl { padding-left: 42px; }
.pv-tag { font-size: .74rem; font-weight: 700; margin-right: 8px; color: var(--accent); }
.pv-tag.pvp { color: var(--lethal); }
body[data-pv="pve"] tbody.pv-pvp, body[data-pv="pvp"] tbody.pv-pve { display: none; }
.full { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.full code { background: none; padding: 0; color: var(--muted); font-size: .8rem; word-break: break-all; }
.copy { font: inherit; font-size: .74rem; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--text); }
.users li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
/* raw data viewer (jsonView in app.js) */
.jv { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.jv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.jv-find { position: relative; display: flex; flex: 1 1 170px; min-width: 0; }
.jv-q { width: 100%; min-width: 0; font: inherit; font-size: .85rem; padding: 5px 78px 5px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--text); }
.jv-q::-webkit-search-cancel-button { display: none; }
.jv-count { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.jv-bar button, .jv-only { font: inherit; font-size: .78rem; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; }
.jv-bar button:hover, .jv-only:hover { color: var(--text); background: var(--bg-2); }
.jv-only { display: inline-flex; align-items: center; gap: 5px; user-select: none; }
.jv-only input { margin: 0; }
.jv-sp { flex: 1; }
.jv-tree { max-height: 560px; overflow: auto; padding: 10px 12px 10px 8px; font: .8rem/1.6 var(--mono); }
.jv-n { position: relative; padding-left: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.jv-t { all: unset; position: absolute; left: 0; top: 0; width: 14px; line-height: 1.6; text-align: center; color: var(--muted); cursor: pointer; }
.jv-t::before { content: "▾"; }
.jv-t:hover, .jv-t:focus-visible { color: var(--text); }
.jv-t:focus-visible { outline: 2px solid var(--accent); border-radius: 3px; }
.jv-closed > .jv-t::before { content: "▸"; }
.jv-c { margin-left: 3px; border-left: 1px solid var(--line); }
.jv-closed > .jv-c { display: none; }
.jv-end { display: block; }
.jv-closed > .jv-end { display: inline; }
.jv-s { display: none; color: var(--muted); font-style: italic; cursor: pointer; }
.jv-closed > .jv-s { display: inline; }
.jv-s:hover { color: var(--text); }
.jv-p { color: var(--muted); }
.jv-k { color: var(--energy); cursor: copy; }
.jv-i { color: var(--muted); cursor: copy; }
.jv-k:hover, .jv-i:hover { text-decoration: underline; }
.jv-str { color: var(--toxic); }
.jv-num { color: var(--fire); }
.jv-bool { color: var(--psionic); }
.jv-null { color: var(--plain); font-style: italic; }
.jv-str a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.jv-str a:hover { text-decoration-style: solid; }
.jv mark { background: color-mix(in srgb, #f2bd4b 40%, transparent); color: inherit; border-radius: 2px; }
.jv mark.cur { background: #f2bd4b; color: #1a1a1a; box-shadow: 0 0 0 1px #f2bd4b; }
.jv-filter .jv-n:not(.jv-hit) { display: none; }
.jv-filter .jv-all .jv-n { display: block; }
.jv-path { padding: 5px 12px; border-top: 1px solid var(--line); background: var(--panel); font: .74rem/1.5 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- set page */
.flush { margin-top: 20px; }
.flush .note { margin-top: 10px; }
.table-wrap { overflow-x: auto; }
.compare { font-size: .9rem; border-top: 1px solid var(--line-2); }
.compare th { position: sticky; top: 0; background: var(--panel-2); border-bottom: 1px solid var(--line-2); padding: 0; text-align: left; }
.compare th button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 9px 12px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.compare th.num button { text-align: right; }
.compare th button:hover { color: var(--text); }
.compare th[aria-sort] button { color: var(--text); }
.compare th[aria-sort="ascending"] button::after { content: " ↑"; }
.compare th[aria-sort="descending"] button::after { content: " ↓"; }
.compare td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.compare tr:hover td { background: var(--bg-2); }
.compare tbody tr:has(a.pname) { cursor: pointer; }
.compare .det { font-size: .8rem; color: var(--muted); margin-top: 2px; }
/* the power's icon spans its name and the line under it */
.pcell { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: start; min-width: 15rem; }
.pcell .pname { display: contents; }
.pcell .picon { grid-row: 1 / span 2; width: 40px; height: 40px; }
.pcell .pname > span:last-child { align-self: end; }
.pcell .det { grid-column: 2; }

/* bars (bar_cell in build.py): the bar, scaled to its column, then the value at its tip */
.cb { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.cb-b { display: flex; gap: 2px; height: 8px; width: calc((100% - 4.4em) * var(--w)); min-width: 0; }
.cb-b i { flex: 1; min-width: 2px; background: var(--c, color-mix(in srgb, var(--text-2) 40%, transparent)); }
.cb-b i:last-child { border-radius: 0 4px 4px 0; }
.cb-track { display: flex; width: calc(100% - 4.4em); height: 8px; border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--line) 80%, transparent); }
.cb-track .cb-b { width: calc(100% * var(--w)); }
.cb-track { position: relative; }
.cb-over { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.cb-cap { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--lethal); }
.cb-b i.ext { background: color-mix(in srgb, var(--c) 30%, transparent); }
.cb.b-dpa .cb-b i { background: var(--accent); }
.cb-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb small { flex-basis: 100%; font-size: .74rem; color: var(--muted); }
.cb[data-tip] { cursor: help; }
.cb[data-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.compare td.bar, .compare th.bar { min-width: 190px; }
.compare td.bar { vertical-align: middle; }

/* set totals: resistance and defense by type on the left, the other cards on the right */
.set-totals { margin-bottom: 20px; }
.set-totals h2 { margin: 0 0 14px; }
.st-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.st-head h2 { margin: 0; }
.st-toggle { all: unset; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.st-toggle::before { content: ""; border-left: 6px solid var(--muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transform: rotate(90deg); transition: transform .12s; }
.st-toggle[aria-expanded="false"]::before { transform: none; }
.st-toggle:hover::before { border-left-color: var(--text); }
.st-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.set-totals.closed .st-body, .set-totals.closed .seg { display: none; }
.set-totals.closed .st-head { margin-bottom: 0; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pick-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; border: 1px solid var(--line-2);
  border-radius: 999px; background: transparent; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; user-select: none; }
.pick-chip .stk { font-size: .78rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.pick-chip .stk:empty { display: none; }
.pick-chip .picon { width: 22px; height: 22px; filter: grayscale(1); opacity: .55; }
.pick-chip:hover { color: var(--text); border-color: var(--muted); }
.pick-chip[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pick-chip[aria-pressed="true"] .picon { filter: none; opacity: 1; }
.pick-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ss-strip { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-bottom: 16px; }
.ss-group h3 { margin: 0 0 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.ss-group { display: flex; flex-direction: column; }
.ss-tiles { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.ss-tile { display: flex; flex-direction: column; gap: 6px; min-width: 132px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: color-mix(in srgb, var(--text) 3%, transparent); font-size: .85rem; color: var(--text-2); }
.ss-tile .ss-n .picon { width: 20px; height: 20px; }
.ss-tile .cb { gap: 6px 8px; }
.ss-tile .cb-v { order: -1; flex-basis: 100%; font-size: 1.3rem; font-weight: 600; color: var(--text); }
.ss-tile .cb-v.neg { color: var(--lethal); }
.ss-tile .cb-track { width: 100%; height: 4px; }
.ss-tile .ss-v > .muted { font-size: 1.3rem; }
.ss-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.ss-grid.one { grid-template-columns: minmax(0, 1fr); }
.ss-card { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--text) 3%, transparent); }
.ss { width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed; }
.ss th { text-align: left; font-weight: 500; color: var(--text-2); padding: 5px 12px 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss thead th { font-size: .8rem; font-weight: 600; color: var(--muted); padding-bottom: 6px; white-space: normal; vertical-align: bottom; }
.ss th:first-child { width: 8.4em; }
.ss-status .ss th:first-child { width: 9.4em; }
.ss-main .ss th:first-child { width: 9.6em; }
.ss-status .ss td, .ss-status .ss thead th:not(:first-child) { text-align: right; }
.ss-status .ss tbody th, .ss-status .ss td { padding-top: 3px; padding-bottom: 3px; }
.ss-status td > .muted { opacity: .5; }
.ss-n { display: inline-flex; align-items: center; gap: 8px; }
.ss-n .picon { width: 22px; height: 22px; }
.ss td { padding: 5px 0 5px 12px; vertical-align: middle; }
.ss tbody th { vertical-align: middle; }
.ss tr.sep th, .ss tr.sep td { border-top: 1px solid var(--line); padding-top: 9px; }
.ss .nobar { justify-content: flex-end; text-align: right; }
.ss .nobar small { text-align: right; }
.set-totals .note { margin: 16px 0 0; }

/* tooltip ([data-tip], app.js) */
.tip { position: fixed; z-index: 60; max-width: 300px; padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-size: .8rem; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: var(--shadow); }
.pname { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text); }

/* ---- lists of sets and categories, archetypes, home */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; margin: 12px 0 28px; border-top: 1px solid var(--line); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--text); }
.tile:hover { text-decoration: none; background: var(--bg-2); }
.tile b { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tile span { font-size: .84rem; color: var(--muted); }
.tile .tile-icons { display: flex; gap: 4px; margin-top: 6px; }
section > h2 { margin: 28px 0 0; }
section > h2 .count { font-size: .8rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.clist { list-style: none; margin: 12px 0 28px; padding: 0; columns: 240px; column-gap: 32px; }
.clist li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; break-inside: avoid; font-size: .92rem; }
.clist li span { font-size: .8rem; color: var(--muted); }
.clist ul { list-style: none; margin: 0; padding: 0; }
.az-block { break-inside: avoid-column; }
.az-block h3 { margin: 10px 0 2px; font-size: .86rem; color: var(--muted); scroll-margin-top: 72px; }
.az-block:first-child h3 { margin-top: 0; }
.jump.az { gap: 4px 10px; margin-top: 10px; }
.etoc { margin-bottom: 20px; }
.etoc li[hidden] { display: none; }
.filter { width: min(100%, 320px); margin: 4px 0 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.epow { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9rem; }
.epow li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 3px 0; }
.epow li > .muted { flex-basis: 100%; font-size: .8rem; }
.ep-p { display: inline-flex; align-items: center; gap: 6px; }
.stats-at { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 32px; }

.home-hero { padding: 40px 0 24px; max-width: 760px; }
.home-hero h1 { display: flex; align-items: center; gap: .35em; font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 20px; color: var(--gold); }
.home-hero h1 img { width: 1.25em; height: 1.25em; flex: none; }
.brand .dim, .home-hero h1 .dim { opacity: .75; }
.big-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; margin: 0 0 12px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font: inherit; cursor: pointer; }
.big-search:hover { border-color: var(--text-2); }
.big-search span { flex: 1; text-align: left; }
.section-title { margin: 32px 0 10px; }
.panel h2, .sec h2, .section-title { color: var(--gold); }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.at-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.at-name { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.at-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; margin-top: 6px; padding-left: 32px; }
.at-cats a, .at-cats .off { display: flex; align-items: baseline; gap: 6px; font-size: .86rem; }
.at-cats .off { color: var(--muted); }
.at-cats .count { font-size: .8rem; }

/* ---- search palette */
.palette { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 18, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-box { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 1.05rem; padding: 16px 18px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette-list li a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 6px; color: var(--text); }
.palette-list img, .palette-list i { width: 26px; height: 26px; }
.palette-list li a:hover, .palette-list li[aria-selected="true"] a { background: var(--bg-2); text-decoration: none; }
.palette-list .sub { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: .8rem; color: var(--muted); text-align: right; }
.palette-list .sub img.at { width: 20px; height: 20px; }
.palette-list .sub img.at:first-of-type { margin-left: 5px; }
.palette-list .kind { font-size: .74rem; font-weight: 600; color: var(--muted); margin-right: 8px; }
.palette-list a.back .sub { font-weight: 600; }
.palette-list .empty { padding: 18px; color: var(--muted); text-align: center; }
.palette-foot { display: flex; gap: 6px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.palette-foot kbd:not(:first-child) { margin-left: 8px; }

/* ---- narrower screens: stats move above the text */
@media (max-width: 900px) {
  .ss-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ss-strip { display: grid; }
  .ss-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ss-tile { min-width: 0; }
  .ss-card { padding: 10px; }
  .ss-main .ss th:first-child { width: 8em; }
  .ss-status .ss th:first-child { width: 9em; }
  .ss td { padding-left: 8px; }
}
@media (max-width: 1180px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pmain, .paside { grid-column: 1; grid-row: auto; }
  .paside { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; margin-bottom: 20px; }
  .headline { grid-column: 1 / -1; }
  .enh { margin-top: 0; padding-top: 0; border-top: 0; }
}
@media (max-width: 1500px) {
  .crumbs a:not(:last-child), .crumbs .sep { display: none; }
}
@media (max-width: 1200px) {
  .crumbs { display: none; }
}
@media (max-width: 900px) {
  .layout.has-side { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; max-height: none; overflow: visible; order: 2; margin-top: 28px; }
}
@media (max-width: 900px) {
  .ver { display: none; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 0 16px; }
  .brand { min-width: 0; }
  .brand span { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumbs { display: none; }
  .top { grid-template-columns: minmax(0, 1fr) auto auto; }
  .search-btn { width: auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .layout { padding: 20px 16px 48px; }
  .phead { gap: 14px; }
  .picon.lg { width: 52px; height: 52px; }
  .paside { grid-template-columns: minmax(0, 1fr); }
  .enh { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
  .phead { padding: 16px; }
  .controls { width: 100%; }
  .ctl { flex: 1 1 100%; justify-content: space-between; }
  .ctl input[type="range"] { flex: 1; width: auto; }
  .fx li { grid-template-columns: 24px 5rem minmax(0, 1fr); }
  .fx .fx-t, .effects .tgt, .effects th.tgt-h { display: none; }
  .users li { flex-direction: column; gap: 0; }
}
