/* BABEL: window styles. Colours are roles; light values first, dark under [data-theme="dark"]. */
:root {
  color-scheme: light;
  --bg: #f6f5f2;            /* window plane */
  --surface: #fcfcfb;       /* cards, tables, charts */
  --surface-2: #f0efec;     /* insets, table heads */
  --hover: rgba(11, 11, 11, .05);
  --selected: rgba(109, 40, 217, .10);
  --border: rgba(11, 11, 11, .10);
  --border-strong: rgba(11, 11, 11, .20);
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --gear: #6250d6;          /* series: gear (violet) */
  --s1: #6250d6; --s2: #e0218a; --s3: #d96f0b; --s4: #0891b2; --s5: #118c74; --s6: #6172b0;   /* the History graph's lines, in the order they are ticked: Tokyo Night violet, pink, orange, cyan, teal, slate (no blue, green or amber), then the same dashed, then dotted */
  --exp: #d96f0b;           /* series: expertise: Tokyo Night (Day) orange (swapped with the demon at the user's request) */
  --bonus: #0891b2;         /* series: stat bonus: Tokyo Night's cyan, a deeper step so it holds up on the light surface */
  --demon: #e0218a;         /* series: digitalize demon: pink, as the logo; apart from the stat-bonus cyan, gear violet and expertise orange */
  --aff: #7847bd;           /* affinity radar, boost: Tokyo Night (Day) purple; on its own chart, never beside the gear violet */
  --aff-res: #118c74;       /* affinity radar, resistance: Tokyo Night (Day) teal. The pair passes the palette check (colour-blind separation, contrast) on both surfaces */
  --law: #2e7de9;           /* alignment colours (Tokyo Night Day): Law blue, Neutral green, Chaos red, as the game marks them */
  --neutral: #4d8a1c;       /* Neutral: green, as the game shows it (Tokyo Night Day's green, a step more vivid) */
  --chaos: #f52a65;
  --fuse: #33635c;          /* fusion bonus on a piece's stats ("(82 + 45) MAX"): Tokyo Night teal (the user's choice) */
  --menu-path: #0d2e43;     /* where a window is in the game's menu (first-snapshot steps): the navy inside the game's own
                               menu buttons (menu_icon_00.tga, as the bar shows it), the same in both themes */
  --on-menu-path: #edf0f1;  /* the white of the buttons' pictures */
  --up: #3d7a12;            /* Build Planner: a number that got better / worse. Tokyo Night Day's green and red, a step deeper so small text holds up on the light surface */
  --down: #c4264f;
  --base: #b5b3aa;          /* de-emphasised: a stat's own base */
  --accent: #4c1d95;        /* the app's own colour: deep purple, as in the logo (blue stays the "gear" data colour) */
  --accent-hover: #5b21b6;
  --accent-ink: #ffffff;
  --accent-edge: transparent;
  --focus: #7c3aed;
  --good: #006300;
  --bad: #b3261e;
  --warn-ink: #7a4d00;
  --warn-mark: #c98500;
  --warn-bg: #fdf3dc;
  --over-ink: #9c1f3d;     /* past a cap (wasted points): a soft red, the user's pick over the amber it was */
  --over-mark: #d94a66;
  --over-bg: #fde7ec;
  --err-bg: #fbe9e7;
  --ok-bg: #e6f4e6;
  --shadow: 0 1px 2px rgba(11, 11, 11, .06), 0 8px 24px rgba(11, 11, 11, .10);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413;
  --surface: #1c1c1b;
  --surface-2: #262624;
  --hover: rgba(255, 255, 255, .06);
  --selected: rgba(139, 92, 246, .20);
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .22);
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #9c9a92;
  --grid: #2c2c2a;
  --axis: #454541;
  --gear: #9085e9;
  --s1: #9085e9; --s2: #d55181; --s3: #ff9e64; --s4: #2ac3de; --s5: #73daca; --s6: #a9b1d6;
  --exp: #ff9e64;           /* Tokyo Night orange */
  --bonus: #2ac3de;         /* Tokyo Night cyan ("blue1") */
  --demon: #d55181;
  --aff: #9d7cd8;           /* Tokyo Night (Storm) purple */
  --aff-res: #3aa890;       /* Tokyo Night teal, a step deeper so it stays inside the dark lightness band */
  --law: #7aa2f7;           /* Tokyo Night blue / green / red */
  --neutral: #9ece6a;       /* Neutral: Tokyo Night green, as the game shows it (the comment-lavender #a9b1d6 looked white around a picture) */
  --chaos: #f7768e;
  --fuse: #73daca;
  --up: #9ece6a;            /* Tokyo Night green and red */
  --down: #f7768e;
  --base: #5e5d58;
  --accent: #4c1d95;
  --accent-hover: #5b21b6;
  --accent-ink: #ffffff;
  --accent-edge: rgba(196, 160, 255, .40);   /* a violet edge keeps the dark button readable on the dark window */
  --focus: #a78bfa;
  --good: #3fbf3f;
  --bad: #f08a80;
  --warn-ink: #f3c770;
  --warn-mark: #fab219;
  --warn-bg: #33290f;
  --over-ink: #f9a8b8;
  --over-mark: #f7768e;
  --over-bg: #3a1c26;
  --err-bg: #3a1c19;
  --ok-bg: #16301a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--selected); }
svg.icon { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.app { display: grid; grid-template: "top top" 56px "side main" 1fr / 196px 1fr; height: 100vh; }
/* who | the page's name, in the middle | the game, the mode, snapshot, settings */
.top { grid-area: top; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 16px 0 14px; border-bottom: 1px solid var(--border); background: var(--bg); }
.top-title { font: 600 16px/1.2 var(--font-display); white-space: nowrap; }
.top .top-actions { justify-self: end; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: block; width: 34px; height: 34px; flex: none; }
.who-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; }
.who-btn:hover { background: var(--hover); }
.who-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Back | the page's name | Forward. The name has the longest page name's width, so the arrows stay put from page to page. */
.top-mid { display: flex; align-items: center; gap: 8px; }
.top-mid .top-title { min-width: 140px; text-align: center; }
.top-mid .btn-square { width: 30px; height: 30px; }
.top-mid .btn:disabled { opacity: .35; cursor: default; background: transparent; }
.who-chev { display: inline-grid; color: var(--text-3); transform: rotate(90deg); }
.who-pic { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; object-position: 50% 0; flex: none; box-shadow: 0 0 0 1px var(--border-strong); }
/* character picture: the portrait on Overview, the small ones in lists, and the crop dialog */
.page-head.with-portrait { justify-content: flex-start; align-items: center; gap: 16px; }
.portrait { all: unset; box-sizing: border-box; width: 160px; height: 120px; border-radius: 10px; overflow: hidden; cursor: pointer; flex: none; display: grid; place-items: center; background: #000; box-shadow: 0 0 0 1px var(--border-strong); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; }   /* always 4:3; an older, taller picture shows its top */
.portrait.no-pic { background: var(--surface-2); box-shadow: none; border: 1.5px dashed var(--border-strong); color: var(--text-3); font-size: 11px; text-align: center; }
.portrait.no-pic > span { display: grid; gap: 4px; justify-items: center; }
.portrait:hover { filter: brightness(1.08); color: var(--text); }
.portrait:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.char-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 0; box-shadow: 0 0 0 2px var(--border-strong); }
.char-pic.on { box-shadow: 0 0 0 2px var(--good); }
.dlg.dlg-wide { width: min(860px, calc(100vw - 32px)); }   /* .dlg (further down) sets the usual width; this has to win over it */
.pic-stage { position: relative; display: grid; place-items: center; min-height: 240px; background: #0b0b0d; border-radius: 10px; overflow: hidden; }
.pic-frame { position: relative; line-height: 0; overflow: hidden; }
.pic-frame img { display: block; max-width: 100%; max-height: min(52vh, 470px); user-select: none; -webkit-user-drag: none; }
.pic-crop { position: absolute; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58); cursor: move; touch-action: none; }
.pic-crop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pic-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); cursor: nwse-resize; }
.pic-empty { color: #b9b7ae; padding: 24px; text-align: center; max-width: 44ch; }
.pic-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.who-chev svg.icon { width: 14px; height: 14px; }
.who-text { display: grid; min-width: 0; line-height: 1.2; text-align: left; }
/* character list (the "which one?" dialog and the switcher) */
.char-list { display: grid; gap: 2px; max-height: min(52vh, 420px); overflow: auto; margin: -6px; padding: 6px; }
.char-list .list-head { padding: 8px 8px 4px; }
.char-list .list-head:first-child { padding-top: 0; }
.char { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.char:hover { background: var(--hover); border-color: var(--border-strong); }
.char[aria-current="true"] { background: var(--selected); border-color: transparent; }
.char:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.char-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.char-dot.on { background: var(--good); border-color: var(--good); }
.char-text { display: grid; min-width: 0; }
.char-name { font: 600 14px/1.3 var(--font-display); }
.char-line { color: var(--text-2); font-size: 12px; }
.chooser-foot { display: flex; align-items: center; gap: 12px; }
.who-name { font: 600 15px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.game { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; white-space: nowrap; margin-right: 4px; }
.game-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.game.on .game-dot { background: var(--good); border-color: var(--good); }

.side { grid-area: side; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 8px 12px; border-right: 1px solid var(--border); min-height: 0; overflow: hidden; }
/* The sidebar never grows past the window: the top bar and the snapshot block (.side-foot) stay put and only the list of
   sections scrolls (in a short window the Tools links and the snapshot line used to be cut off with no way to reach them). */
.nav { display: grid; gap: 2px; align-content: start; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* Every scrollbar in the app is this thin one, first made for the left pane (repo rule, CLAUDE.md "Every scrollbar looks like the
   left pane's"): the pages themselves, lists, popovers, dialogs, anything that scrolls either way. Nothing needs its own copy: the
   per-list rules further down say the same and can go when their page is next worked on. Never set "scrollbar-width" or
   "scrollbar-color" on an element: either one switches these rules off there and the system's bar comes back. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
.nav-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--text-2); cursor: pointer; position: relative; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--selected); color: var(--text); font-weight: 600; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--focus); }
.nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.nav-label { flex: 1; }
.nav-key { font-size: 11px; color: var(--text-3); font-weight: 400; }
.side-foot { flex: none; display: grid; gap: 2px; padding: 10px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--border); }
.side-foot b { color: var(--text); font-weight: 600; }
.side-foot .warn { color: var(--warn-ink); }

.main { grid-area: main; overflow: auto; min-width: 0; outline: none; scrollbar-gutter: stable; }
.page { max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; display: grid; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.page-sub { color: var(--text-2); max-width: 110ch; margin-top: 3px; }
.page-head-text { flex: 1 1 320px; min-width: 0; }
.page-who { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.page-who b { color: var(--text); font-weight: 600; }
/* Overview: the name with the compact stats under it, beside the picture */
.page-head.with-portrait .page-head-text { display: grid; gap: 8px; align-content: center; }
.who-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.who-line .page-who { margin: 0; }
.who-big { font: 600 19px/1.2 var(--font-display); letter-spacing: -.01em; }
.who-right { display: flex; align-items: center; gap: 14px; }
/* as many columns as fit, each wide enough for its label, bar and number (never squeezed into each other) */
.dg-bars.who-stats { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 2px 18px; }
.who-stats .dg-row { grid-template-columns: 38px minmax(20px, 1fr) 40px; }
.dg-bars.who-stats .dg-row .strack i { border-radius: 0; }   /* the player's bars have square ends (asked for); the demon's are square too */

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); font-weight: 600; padding: 0 14px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 1; background: var(--accent); filter: saturate(.6) brightness(.92); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-square { width: 32px; padding: 0; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { display: inline-grid; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { all: unset; box-sizing: border-box; height: 26px; padding: 0 12px; border-radius: 7px; color: var(--text-2); cursor: pointer; font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, .08); }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.input, .select { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); min-width: 0; }
.input::placeholder { color: var(--text-3); }
.select { padding-right: 6px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search .input { width: 100%; padding-left: 32px; }
.search svg.icon { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.toolbar-spacer { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { all: unset; box-sizing: border-box; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn:hover { color: var(--text); background: var(--hover); }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chip-btn .count { opacity: .7; font-weight: 400; font-variant-numeric: tabular-nums; }
.chip-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 1; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--text-2); }
.tag-digi { border-color: transparent; background: var(--selected); color: var(--text); }
.tag-off { border-style: dashed; }
.tag-max { border-color: var(--border-strong); color: var(--text); }                             /* exactly at a cap */
.tag-over { border-color: transparent; background: var(--over-bg); color: var(--over-ink); }      /* past a cap: wasted */
.tag-warn { gap: 4px; padding-left: 5px; border-color: transparent; background: var(--warn-bg); color: var(--warn-ink); }   /* something wasn't read: a number may be off */
.tag-warn svg.icon { flex: none; width: 12px; height: 12px; color: var(--warn-mark); }
.cmp .tbl tfoot td.capped { color: var(--warn-ink); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.card-title { font-size: 13px; font-weight: 600; }
.card-sub { color: var(--text-2); font-size: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.section-title { font: 600 15px/1.3 var(--font-display); }
/* a page section: its heading outside the box, then the box */
.sect { display: grid; gap: 10px; min-width: 0; align-content: start; }
.sect > .toolbar { min-height: 30px; }
.legend { display: inline-flex; flex-wrap: wrap; gap: 12px; color: var(--text-2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.sw-gear { background: var(--gear); } .sw-exp { background: var(--exp); } .sw-demon { background: var(--demon); } .sw-base { background: var(--base); } .sw-bonus { background: var(--bonus); }
.note { color: var(--text-2); font-size: 12px; max-width: 80ch; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.notice svg.icon { flex: none; margin-top: 1px; }
.notice-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.notice-warn svg.icon { color: var(--warn-mark); }
.notice b { font-weight: 600; }

/* ---------- overview: the stat sheet ---------- */
/* One heading over one row ("Key stats and affinities"): the stat sheet with What changed under it and, beside them,
   the affinity radar with its table. Each side is as tall as what it holds. Sheet: one line per key stat: name, a bar only where the stat has a cap (how close
   to it), the total. A click opens where the total comes from, under the line. */
.stat-label { color: var(--text-2); font-size: 12px; }
.over-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.over-left { display: grid; gap: 18px; align-content: start; min-width: 0; }   /* the sheet, then What changed, spaced as the page's sections are */
/* Overview: the one-line bands under your stats (expertise, the demon's own card, gear). Expertise and gear share this
   shape: title | what it holds, wrapping in a narrow window | View more. */
.band { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 10px 14px; }
.band-head { display: grid; gap: 4px; }
.band-title { margin: 0; font: 600 17px/1.2 var(--font-display); letter-spacing: -.01em; }
.band-items { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
/* expertise: under the title, points / cap over a thin bar; then one chip per unlocked chain, its name and class-rank
   (its skills are in the chip's tooltip, a click opens it on the Expertise page) */
.exp-band { align-items: start; }
.exp-band > .btn { align-self: center; }
.exp-top { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 12px; }   /* title, points at its right; the bar under both */
.band-points { display: contents; }
.band-pts { justify-self: end; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.band-bar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: var(--grid); overflow: hidden; }
.band-bar i { display: block; height: 100%; border-radius: 2px; background: var(--exp); }
/* the chains: name and class-rank, two columns (filled downwards) when the window has room */
.exp-ranks { display: grid; grid-template-rows: repeat(var(--rows, 3), auto); grid-auto-flow: column; grid-auto-columns: auto; gap: 0 18px; margin: 2px -6px 0; }
.exp-rank { all: unset; box-sizing: border-box; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; height: 22px; padding: 0 6px; border-radius: 5px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.exp-rank:hover { background: var(--hover); }
.exp-rank:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.exp-rank b { color: var(--exp); font-weight: 600; font-variant-numeric: tabular-nums; }
/* the rest of the band: the skills' icons in one run */
.exp-icons-run { gap: 3px; align-content: start; }
.exp-icons-run .skill-ico.off { opacity: .35; }
/* the air between groups sits after a group's last icon, not before the next one's first: when a group starts a new
   line, the space stays at the end of the line above and every line starts flush left */
.exp-icons-run .skill-ico:has(+ .skill-ico.first) { margin-right: 8px; }
@media (max-width: 1100px) { .exp-ranks { grid-template-rows: none; grid-auto-flow: row; } }   /* one column of chains, more room for icons */
/* gear: each worn piece is its game icon in a slot-like tile, then the complete sets. Names and numbers are the Gear
   page's: a tile's tooltip is the game's, a click opens the piece there. */
.gear-sets { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.gear-sets .stat-label { margin-right: 4px; }
.gear-pc { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
/* a demon user's Overview: who each worn piece boosts, as a dot on its corner (partner: the demon pink) */
.gear-pc { position: relative; }
.who-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.who-partner { background: var(--demon); } .who-you { background: var(--base); } .who-both { background: linear-gradient(90deg, var(--demon) 50%, var(--base) 50%); }
.gear-band .legend { display: grid; gap: 2px; }
/* the partner card: who it is beside its stat bars, then what it gives you; framed in the demon pink (it is the view's subject) */
.partner-card { display: grid; gap: 10px; padding: 12px 14px; border-color: color-mix(in srgb, var(--demon) 55%, transparent); }
/* in the head beside you: it takes most of the row, your own part shrinks to the name and three stats in one column */
.page-head.du { align-items: stretch; }
.page-head.du .portrait { align-self: center; width: 112px; height: 84px; }   /* smaller here (still 4:3): the row is the partner's */
.page-head.du.with-portrait { gap: 12px; }
.partner-card .dg-bars.who-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* the partner's stats always in three columns */
.page-head.du .page-head-text { flex: 0 0 auto; max-width: 240px; }   /* as wide as what it holds, like the summoned card of the Player view */
.page-head.du .page-head-text > .dg-bars.who-stats { grid-template-columns: 118px; }
.page-head.du .page-head-text > .dg-bars.who-stats .dg-row { grid-template-columns: 26px minmax(20px, 1fr) 40px; gap: 6px; }
.page-head.du .who-line { display: grid; justify-content: start; }
.page-head.du .partner-card { flex: 1 1 420px; min-width: 0; align-content: center; }
.partner-top { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 10px 18px; align-items: center; }
.partner-who { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-auto-rows: 18px; gap: 2px 10px; align-items: center; }   /* five rows, as tall as the stats' five */
.partner-who .demon-pic { grid-column: 1; grid-row: 1 / span 5; align-self: center; }
.partner-card .partner-who .demon-pic { border-color: transparent; box-shadow: none; }   /* no frame of its own here: the card carries the alignment colour */
.partner-who > :not(.demon-pic) { grid-column: 2; min-width: 0; }
.partner-who .list-head { padding: 0; margin: 0; }
.partner-top { align-items: start; }
.partner-who .dg-tile > .dgt-line { display: none; }   /* what digitalizing with it would give: not a partner's business */
.partner-who .dg-skill-icons { display: none; }   /* its skills are the Skills bar below */
.partner-card[class*="align-"] { border-color: color-mix(in srgb, var(--align) 70%, transparent); }   /* framed in the demon's alignment colour, as its picture (pink only while the alignment isn't known) */
/* two columns: who, stats and the line of bars on the left; the rebirths radar in a column of its own on the right, as tall as the card */
.partner-card { grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; }
.partner-card.none { grid-template-columns: minmax(0, 1fr); }
.partner-top { grid-column: 1; }
.partner-build, .partner-build .rbp-minibars { display: contents; }
.partner-build .rbp-minirows { grid-column: 1; }   /* no rules inside the card (the user's call): the gap sets the bars apart */
.partner-build .rbp-miniranks { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
/* skills, Demon Force and equipment on one line, no titles (the user's call): a divider between them, each icon's tip says what it is */
.partner-build .rbp-minibars { align-items: center; }
.partner-build .rbp-minirows { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.partner-build .rbp-minirows .rbp-minibar-title, .partner-build .rbp-miniranks .rbp-minibar-title { display: none; }   /* nor "Ranks" over the radar */
.partner-build .rbp-minibar { display: flex; }
.partner-build .rbp-minibar { align-items: center; gap: 0; }
.partner-build .rbp-minibar + .rbp-minibar::before { content: ''; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); margin: 0 14px; }   /* a dot between the groups (the user's call), not a rule */
.partner-build .rbp-minislots { flex-wrap: nowrap; }@media (max-width: 760px) { .partner-top { grid-template-columns: minmax(0, 1fr); } }
/* Switching Player <-> Demon user: a view transition. The parts that exist in both views are named (only while the
   switch runs: html.vt-view), so each glides and resizes to its new place; everything else cross-fades. */
html.vt-view .over-top { view-transition-name: ov-top; }
html.vt-view .page-head .portrait { view-transition-name: ov-portrait; }
html.vt-view .page-head .page-head-text { view-transition-name: ov-me; }
html.vt-view .page-head .summoned:not(.none), html.vt-view .page-head .partner-card { view-transition-name: ov-partner; }
html.vt-view .page > .exp-band { view-transition-name: ov-exp; }
html.vt-view .page > .gear-band { view-transition-name: ov-gear; }
html.vt-view .page > .sect { view-transition-name: ov-sheet; }
/* the assistant in the corner stands over the page: a layer of its own, or the moving parts would cover it while the switch runs */
html.vt-view .assistant { view-transition-name: ov-assistant; }
html.vt-view::view-transition-old(ov-assistant), html.vt-view::view-transition-new(ov-assistant) { animation: none; }
html.vt-view::view-transition-old(ov-assistant) { display: none; }
html.vt-view::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
html.vt-view::view-transition-old(*), html.vt-view::view-transition-new(*) { animation-duration: .24s; }
/* the two that change size: their content is not stretched while the box grows or shrinks, it is uncovered from the top left */
html.vt-view::view-transition-old(ov-me), html.vt-view::view-transition-new(ov-me),
html.vt-view::view-transition-old(ov-partner), html.vt-view::view-transition-new(ov-partner),
html.vt-view::view-transition-old(ov-sheet), html.vt-view::view-transition-new(ov-sheet) { width: 100%; height: 100%; object-fit: none; object-position: left top; overflow: clip; }
html.vt-view::view-transition-group(ov-partner) { border-radius: 12px; overflow: clip; }
.over-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.du-card { display: grid; gap: 10px; align-content: start; padding-top: 14px; }
.gear-pc:hover { border-color: var(--border-strong); background: var(--hover); }
.gear-pc:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Overview: expertise points against the cap, then the unlocked chain expertises with their skills' icons */
.exp-points { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.exp-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.exp-bar i { display: block; height: 100%; border-radius: 4px; background: var(--exp); }
.exp-free { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Expertise page summary: the Overview band's look (counts left, points right over the thin bar; then a compact line per
   expertise: name and orange class-rank, a thin bar to its highest class, its points, one run of skill icons) */
.exp-sum { gap: 2px; padding: 10px 14px; }
.exp-sum > .exp-top { margin-bottom: 4px; }
.exp-sum-counts { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-sum .list-head { margin: 0; padding: 16px 0 4px; }   /* flush with the names and the counts (the rows carry their own 6px inset) */
.exp-sum-list { display: grid; margin: 0 -6px; }
.exp-sum-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 260px 56px 44px 76px minmax(0, 1fr); align-items: center; gap: 0 12px;
  min-height: 30px; padding: 3px 6px; border-radius: 5px; cursor: pointer; }
.exp-sum-row:hover { background: var(--hover); }
.exp-sum-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.exp-sum-row .exp-rank { height: auto; padding: 0; cursor: inherit; }
.exp-sum-row .exp-rank:hover { background: none; }
.exp-sum-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.exp-sum-row .band-bar { grid-column: auto; }
.exp-sum-max { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.exp-sum-max.done { color: var(--exp); font-weight: 600; }
.exp-sum-pt { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* Expertise page: the cap, one line per place that raises it, a chip per raise */
.cap-list { display: grid; margin-top: 6px; }
.cap-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 160px; align-items: center; gap: 0 12px; padding: 5px 0; border-top: 1px solid var(--border); }
.cap-row:first-child { border-top: 0; }
.cap-group { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.cap-server { color: var(--text-3); font-size: 12px; }   /* a raise only NewMoon has, beside its place's name */
.cap-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cap-chip { gap: 6px; cursor: default; }
.cap-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cap-got { border-color: transparent; background: color-mix(in srgb, var(--exp) 22%, transparent); color: var(--text); }
.cap-open { color: var(--text-3); }
.cap-ready { border-color: var(--exp); color: var(--text); }
.cap-unknown { border-style: dashed; color: var(--text-3); }
.exp-cap .exp-sum-pt.done { color: var(--exp); font-weight: 600; }
.exp-cap .note { margin: 8px 0 0; }
@media (max-width: 1100px) { .cap-row { grid-template-columns: 170px minmax(0, 1fr); } .cap-row .exp-sum-pt { grid-column: 2; text-align: left; } }
@media (max-width: 1100px) { .exp-sum-row { grid-template-columns: 220px 48px 44px 76px; } .exp-sum-row .exp-icons-run { grid-column: 1 / -1; padding: 2px 0 4px; } }
.sheet { padding: 12px 16px 6px; }
.sheet-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 32px; align-items: start; }   /* two columns when both fit with their labels in full, else one */
.sheet-col { display: grid; gap: 14px; align-content: start; }
.sheet-group { display: grid; }
.sheet-group .list-head { margin: 0; padding: 0 0 5px; }
.sheet-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto minmax(58px, auto); gap: 8px; align-items: center; min-height: 30px; padding: 0 6px; margin: 0 -6px; border-top: 1px solid var(--border); cursor: pointer; }
.sheet-row:hover { background: var(--hover); }
.sheet-row.static, .sheet-row.static:hover { cursor: default; background: none; }   /* a line with no sources: nothing to open */
.sheet-row.static .sheet-label, .sheet-row.static .sheet-value { color: var(--text-3); font-weight: 400; }   /* and greyed out (the user's call) */
.sheet-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px; }
.sheet-row .chev { margin: 0; }
.sheet-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sheet-name .tag { flex: none; }
.sheet-label { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-row[aria-expanded="true"] .sheet-label { color: var(--text); font-weight: 600; }
.sheet-value { font: 600 14px/1.2 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sheet-value.bad { color: var(--bad); }
.cap-bar { display: block; width: 72px; height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.cap-bar i { display: block; height: 100%; border-radius: 3px; background: var(--text-2); }   /* neutral: this is "total against the cap", not one of the source series */
.cap-bar.over i { background: var(--over-mark); }   /* past the cap: soft red, with the "Over cap" tag beside the name */
.sheet-detail { display: grid; gap: 6px; padding: 2px 0 12px 22px; justify-items: stretch; }
.sheet-src { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 12px; }
.sheet-src .swatch { align-self: center; }
.sheet-src small { display: block; color: var(--text-2); }
.sheet-src b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-detail .btn { justify-self: start; margin-top: 2px; }
.chg-more { justify-self: start; }
/* affinity: one radar, three series on the same percentage scale (boost, its cap, resistance). Boost: purple, round
   marks. Resistance: teal, square marks. Cap: a dashed neutral outline (a limit, not a measurement). */
.radar { justify-self: center; }
.radar svg { width: auto; max-width: 100%; height: auto; }
.radar .gridline, .radar .zeroline { fill: none; }
.radar .zeroline { stroke: var(--axis); stroke-width: 1.5; }
.radar text.ring-label { fill: var(--text-3); font-size: 10px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }   /* small, with a halo so a line behind it does not cut the number */
.radar .aff-s { --c: var(--aff); transition: opacity .12s ease; }
.radar .aff-res { --c: var(--aff-res); }
.radar .aff-cap { --c: var(--text-2); }
.radar .aff-area { fill: var(--c); opacity: .14; }
.radar .aff-cap .aff-area { fill: none; }
.radar .aff-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.radar .aff-cap .aff-line { stroke-dasharray: 5 4; stroke-width: 1.5; }
.radar .aff-dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.radar .aff-dot.bad { fill: var(--bad); }
.radar text.aff-name { fill: var(--text-2); }
.radar text.aff-name.none { fill: var(--text-3); }
.radar text.aff-value { fill: var(--text); font-weight: 600; }
.radar text.aff-value.bad { fill: var(--bad); }
.radar text.aff-value.over { fill: var(--text-2); font-weight: 500; }   /* a cap past the rim, under All */
.radar .aff-over { fill: var(--text-2); }
/* The radar's numbers as lines under it, in the stat sheet's style: Affinity | Boost | Cap | Resist */
.aff-table { display: grid; margin-top: 27px; }   /* more air over the table than the card's 12px (39 in all) */
.aff-tr { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 64px; gap: 8px; align-items: center; min-height: 28px; border-top: 1px solid var(--border); }
.aff-tr:not(.aff-th):hover { background: var(--hover); }
.aff-tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px; }
.aff-th { border-top: 0; min-height: 0; }
.aff-th .list-head { margin: 0; padding: 0 0 5px; text-align: right; }
.aff-th .list-head:first-child { text-align: left; }
.aff-table .aff-name { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aff-td { font: 600 13px/1.2 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.aff-wb { border-top-style: dashed; }   /* not an element: the line under the elements */
.aff-td.zero { color: var(--text-3); font-weight: 400; }
.aff-td.bad { color: var(--bad); }
.aff-td.raised { color: var(--text); }
.aff-pick { justify-self: center; margin-top: -12px; }   /* right under the radar: the card's 12px gap taken back */
.aff-pick button { gap: 6px; }
.aff-key { display: inline-block; width: 9px; height: 9px; background: var(--aff); border-radius: 50%; }
.aff-key-res { background: var(--aff-res); border-radius: 2px; }
.aff-key-cap { width: 12px; height: 0; background: none; border-radius: 0; border-top: 2px dashed var(--text-2); }
.card > .aff-pick + .note { justify-self: center; text-align: center; }

/* ---------- stat bars (base + bonus) ---------- */
.srows { display: grid; gap: 1px; }
.srow { display: grid; grid-template-columns: 62px minmax(60px, 1fr) 44px; align-items: center; gap: 10px; height: 24px; border-radius: 4px; padding: 0 4px; margin: 0 -4px; }
.srow:hover { background: var(--hover); }
.srow-label { color: var(--text); }
.srow-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.strack { display: flex; gap: 2px; height: 12px; }
.strack i { display: block; height: 100%; min-width: 0; }
.strack i.base { background: var(--base); border-radius: 0; }
.strack i.bonus { background: var(--bonus); border-radius: 0 4px 4px 0; }
.strack i.base:last-child { border-radius: 0 4px 4px 0; }
.srow-gap { height: 9px; }

/* ---------- changes ---------- */
.chg-list { columns: 2 340px; column-gap: 36px; }   /* the card is as wide as the page: two columns of changes */
.chg-group { break-after: avoid; }
.chg { break-inside: avoid; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.chg:last-child { border-bottom: 0; }
.chg-vals { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg-vals b { color: var(--text); font-weight: 600; }
.delta { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 4.5em; text-align: right; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); }
.chg-group { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 0 2px; }
.chg-group:first-child { padding-top: 0; }

/* ---------- tables ---------- */
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; }
.tbl-scroll { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; }
.tbl th, .tbl td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .zero { color: var(--text-3); }
.tbl .emph { font-weight: 600; }
.tbl .dim { color: var(--text-2); }
.tbl td.good { color: var(--good); }
.tbl tr.group-row th { background: var(--surface); color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 14px; padding-bottom: 6px; }
.tbl tr.group-row:first-child th { padding-top: 10px; }
.tbl tr.row-click { cursor: pointer; }
.tbl tr.row-click:hover td { background: var(--hover); }
.tbl tr.row-click.open td { border-bottom-color: transparent; }
.tbl tr.detail td { padding: 0 12px 12px 38px; background: transparent; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border-strong); border-bottom: 0; }
.tbl col.active-col { background: var(--selected); }
.row-btn { all: unset; cursor: pointer; display: inline-flex; align-items: flex-start; gap: 8px; }
.row-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.chev { display: inline-grid; color: var(--text-3); transition: transform .12s ease; margin-top: 1px; }
.chev svg.icon { width: 14px; height: 14px; }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.src-count { color: var(--text-3); font-size: 12px; margin-left: 6px; white-space: nowrap; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; max-width: 640px; }
.parts li { display: grid; grid-template-columns: 24px 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 3px 0; border-top: 1px solid var(--border); font-size: 12px; }
.parts .slot-icon { zoom: .75; image-rendering: auto; }   /* the gear icon at 24px, to suit the smaller rows */
.parts .kind { color: var(--text-2); }
.parts .part-from { color: var(--text-2); font-weight: 400; }
.parts .part-from::before { content: "·"; margin: 0 6px; color: var(--text-3); }
.parts .pv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.parts small, .sub { display: block; color: var(--text-2); font-size: 12px; }
.empty-row { padding: 22px 12px; color: var(--text-2); text-align: center; }

/* ---------- gear ---------- */
.gear-layout { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.slot-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; display: grid; gap: 1px; }
.list-head { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 10px 8px 4px; }
.slot { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 32px 62px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 7px; cursor: pointer; }
.slot:hover { background: var(--hover); }
.slot[aria-selected="true"] { background: var(--selected); }
.slot:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.slot-icon { display: block; width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
/* game-style tooltips on icons: icon and name, then the game's text with its section headings */
.tip.tip-rich { max-width: 380px; padding: 10px 12px; font-variant-numeric: normal; }
.tt-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.tt-head .slot-icon { zoom: 1; image-rendering: pixelated; }
.tt-title { font: 600 13px/1.25 var(--font-display); }
.tt-sub { color: var(--text-2); font-size: 11px; margin-top: 2px; }
.tt-sec { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 2px; }
.tt-line { white-space: pre-wrap; line-height: 1.45; }
.tt-line.tt-gap { margin-top: 6px; }
.tt-fuse { color: var(--fuse); }
.tt-max { margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--fuse); }
.slot-icon.orbs { position: relative; }
.orbs img { position: absolute; width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border-strong); }
.orbs-2 img:nth-child(1) { left: 0; top: 2px; } .orbs-2 img:nth-child(2) { left: 14px; top: 12px; }
.orbs-3 img:nth-child(1) { left: 7px; top: 0; } .orbs-3 img:nth-child(2) { left: 0; top: 14px; } .orbs-3 img:nth-child(3) { left: 14px; top: 14px; }
.orbs-4 img:nth-child(1) { left: 0; top: 0; } .orbs-4 img:nth-child(2) { left: 14px; top: 0; } .orbs-4 img:nth-child(3) { left: 0; top: 14px; } .orbs-4 img:nth-child(4) { left: 14px; top: 14px; }
.detail-id { margin-left: 8px; color: var(--text-3); font: 400 13px/1 var(--font); font-variant-numeric: tabular-nums; }
.detail-head { display: flex; align-items: center; gap: 12px; }
.slot-name { color: var(--text-2); font-size: 12px; }
.slot-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot[aria-selected="true"] .slot-item { font-weight: 600; }
.slot-n { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.card.detail { position: sticky; top: 16px; }   /* the Gear page's card only: the Bonuses table's tr.detail rows must not stick */
.detail-title { font: 600 17px/1.25 var(--font-display); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.kv-group { display: grid; }
.kv-head { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 6px 0 4px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); }
.kv-label { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.kv-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.kv.off .kv-label, .kv.off .kv-value { color: var(--text-3); }

/* compare: wide table (pinned first column, heading and total) + the column list */
.page.wide { max-width: none; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 16px; align-items: start; }
.cmp-main { min-width: 0; }
.cmp-scroll { overflow: auto; max-height: calc(100vh - 268px); min-height: 220px; }
.cmp .tbl { width: max-content; min-width: 100%; }
.cmp .tbl th, .cmp .tbl td { padding: 6px 9px; }
.cmp .tbl thead th { vertical-align: bottom; white-space: normal; min-width: 62px; max-width: 96px; line-height: 1.25; }
.cmp .tbl .pin { position: sticky; left: 0; z-index: 2; background: var(--surface); width: 270px; min-width: 270px; max-width: 270px; box-shadow: 1px 0 0 var(--border-strong); }
.pin-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cmp .tbl thead .pin { z-index: 4; background: var(--surface-2); }
.cmp .tbl thead th { z-index: 3; }
.cmp .tbl tfoot td { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -1px 0 var(--border-strong); }
.cmp .tbl tfoot .pin { z-index: 4; background: var(--surface-2); box-shadow: 1px 0 0 var(--border-strong), 0 -1px 0 var(--border-strong); }
.cmp .tbl tbody tr:hover td { background: var(--hover); }
.cmp .tbl tbody tr:hover td.pin { background: var(--surface-2); }
.cmp.short .tbl thead th { min-width: 46px; white-space: nowrap; max-width: none; }
.col-full { display: block; color: var(--text-3); font-size: 11px; line-height: 1.3; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .12s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .12s ease; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.th-btn { all: unset; cursor: pointer; display: inline-flex; align-items: flex-end; gap: 4px; text-align: right; }
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.cmp th[aria-sort] { color: var(--text); }
.sort-mark { font-size: 9px; line-height: 1.6; }
.sit { color: var(--text-3); }
.cmp-panel { position: sticky; top: 16px; max-height: calc(100vh - 212px); overflow: auto; padding: 12px; gap: 10px; }
.col-list { display: grid; gap: 1px; }
.col-item { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.col-item:hover { background: var(--hover); }
.col-item input { accent-color: var(--accent); width: 15px; height: 15px; margin: 2px 0 0; flex: none; cursor: pointer; }
.col-group { margin-top: 8px; font-weight: 600; }
.col-group:first-child { margin-top: 0; }
.col-group .src-count { margin-left: auto; font-weight: 400; }

/* ---------- expertise ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 20px; }
.tile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tile-label { color: var(--text-2); min-width: 0; }
.tile-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.exp-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.exp-group + .exp-group { margin-top: 8px; }
.exp-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); }
.exp-group summary::-webkit-details-marker { display: none; }
.exp-group summary:hover { background: var(--hover); }
.exp-group[open] > summary .chev { transform: rotate(90deg); }
.exp-name { font-weight: 600; }
/* a closed group shows its passives as a row of small icons, at the right */
.exp-group summary > .exp-name, .exp-group summary > .exp-meta { flex: none; white-space: nowrap; }
.exp-icons { display: flex; flex-wrap: wrap; gap: 3px; margin-left: 6px; min-width: 0; }   /* straight after the name and count, not pushed to the right */
.exp-icons .skill-ico { width: 20px; height: 20px; border-radius: 3px; }
.exp-icons .skill-ico.off { opacity: .35; }
.exp-group[open] > summary .exp-icons { display: none; }
.exp-meta { color: var(--text-2); font-size: 12px; }
.exp-body { padding: 0 14px 10px 36px; display: grid; }
.passive { display: grid; grid-template-columns: 118px minmax(0, 190px) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); align-items: baseline; }
.passive .skill { display: flex; align-items: center; gap: 8px; min-width: 0; align-self: center; }
.skill-ico { flex: none; width: 24px; height: 24px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.skill-ico img { display: block; width: 100%; height: 100%; }
.passive .rank { color: var(--text-2); font-size: 12px; }
.passive .fx { color: var(--text-2); display: grid; gap: 1px; }
.passive.off { color: var(--text-3); }
/* quest bonus / compendium steps (Bonuses page): the same rows without the rank column, in a card */
.step-list { gap: 0; padding: 4px 16px; }
.step-list .passive { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.step-list .passive:first-child { border-top: 0; }
/* the digitalize demon's own skills, in the demon card: icons on the closed line; opened, the same rows as the passives */
.dg-skill-icons { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; margin-left: 6px; }
.dg-skill-icons .skill-ico.off { opacity: .35; }
/* a feature's stand-in picture (the Features boost's): one dark Tokyo Night blue, so it reads apart from the pink boost.
   Greyed first and then tinted (a plain hue-rotate turned its blue parts green) */
.skill-ico.as-feature img { filter: grayscale(1) sepia(1) hue-rotate(185deg) saturate(2.6) brightness(.8); }
.demon-skills { grid-column: 1 / -1; display: grid; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.dg-skill-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0 4px; }
.dg-skill-head .section-title { margin: 0; }
.dg-skill-list + .dg-skill-head { margin-top: 12px; }
/* a COMP demon as a card (the demon dropdown): who it is and what digitalizing with it would give */
#demons { width: min(400px, calc(100vw - 16px)); }
#demons .char-list { display: grid; gap: 6px; max-height: min(64vh, 620px); overscroll-behavior: contain; }
/* the same thin scrollbar as the sidebar's (.nav) */
#demons .char-list::-webkit-scrollbar { width: 8px; }
#demons .char-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
.dg-tile { all: unset; box-sizing: border-box; display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; min-width: 0; }
.dg-tile:hover { background: var(--hover); border-color: var(--border-strong); }
.dg-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-tile.on { border-color: color-mix(in srgb, var(--demon) 70%, transparent); cursor: default; }
.dg-tile.on:hover { background: var(--surface); }
.dg-tile[disabled] { opacity: .6; cursor: progress; }
.dg-tile.static, .dg-tile.static:hover { cursor: default; background: var(--surface); border-color: var(--border); }
/* a demon that can be taken off the list: the card with a trash button in its corner, then "Remove?" under it */
.dg-item { position: relative; display: grid; gap: 4px; min-width: 0; }
.dg-item .dgt-head { padding-right: 26px; }   /* room for the trash button */
.dg-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0; opacity: .55; }
.dg-item:hover .dg-del, .dg-del:focus-visible { opacity: 1; }
.dg-del svg.icon, .snap-pick .btn-square svg.icon { width: 15px; height: 15px; }
/* asking: the card stays where it was, tinted red, with the question added under its content (one card, not two:
   the list doesn't jump and the eye stays on the demon) */
.dg-item.asking { gap: 0; border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.dg-item.asking .dg-tile, .dg-item.asking .dg-tile:hover { border-color: transparent; background: transparent; }
.dg-ask { display: grid; gap: 8px; margin: 0 12px; padding: 10px 0 12px; border-top: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.dg-ask-btns { display: flex; gap: 6px; }
/* What changed: the snapshot picker with its trash button, or "Delete this snapshot?" */
.snap-pick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.snap-pick .btn-square { width: 26px; height: 26px; padding: 0; }
/* the picker: a button that looks like the other selects, opening the app's own dropdown (.menu, as the demon's) */
.snap-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font: inherit; cursor: pointer; }
.snap-btn svg.icon { width: 14px; height: 14px; transform: rotate(90deg); color: var(--text-2); }
.snap-menu { width: min(290px, calc(100vw - 16px)); }
.snap-menu .char-list { max-height: min(50vh, 420px); overscroll-behavior: contain; }
.snap-menu .char { grid-template-columns: minmax(0, 1fr); padding: 8px 12px; border-color: transparent; }
.snap-menu .char:hover { border-color: transparent; }
/* a snapshot in the dropdown: the choice, and its bin on the right; asking: the row tinted red with the question in it */
.snap-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; border: 1px solid transparent; border-radius: 10px; }
.snap-x { width: 26px; height: 26px; padding: 0; margin-right: 4px; opacity: .55; }
.snap-row:hover .snap-x, .snap-x:focus-visible { opacity: 1; }
.snap-x svg.icon { width: 15px; height: 15px; }
.snap-row.asking { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.snap-row.asking .snap-opt, .snap-row.asking .snap-opt:hover { background: transparent; }
.snap-ask { grid-column: 1 / -1; display: grid; gap: 8px; margin: 0 12px; padding: 8px 0 10px; border-top: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
/* the same thin scrollbar as the sidebar's (.nav) */
.snap-menu .char-list::-webkit-scrollbar { width: 8px; }
.snap-menu .char-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
.snap-del { display: inline-flex; align-items: center; gap: 6px; }
/* Overview: the summoned demon, to the right of the character's stats (the picker's card without its bonus list) */
.summoned { flex: 0 1 auto; min-width: 0; max-width: 340px; }
.summoned.none { display: none; }
.dgt-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dgt-head .demon-pic { align-self: center; }
.dgt-id { display: grid; gap: 1px; min-width: 0; }
.dgt-name { font: 600 15px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dgt-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }   /* the name with its tag right after it */
.dgt-line { color: var(--text-2); font-size: 12px; }
.dgt-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.dg-tile .dg-skill-icons { margin-left: 0; }
.dgt-adds { display: grid; gap: 2px; font-size: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.dgt-add { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.dgt-add b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
/* the demons your Digitalization Levels unlocked: a line per race */
.dgu { display: grid; padding: 4px 16px; }
.dgu-race { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); align-items: start; }
.dgu-race:first-child { border-top: 0; }
.dgu-head { display: grid; gap: 1px; padding-top: 4px; }
.dgu-race-name { font-weight: 600; }
.dgu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.dgu-demon { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.dgu-demon .demon-pic { align-self: center; width: 40px; height: 40px; }
.dgu-demon .demon-pic img { inset: 3px; }
.dgu-text { display: grid; min-width: 0; }
.dgu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dgu-demon.off { opacity: .4; }
.dgu-small { display: flex; flex-wrap: wrap; gap: 5px; padding: 12px 14px; }
.dgu-small .demon-pic { width: 28px; height: 28px; border-radius: 5px; box-shadow: none; }
.dgu-small .demon-pic span { font-size: 13px; }
.dgu-small .demon-pic img { inset: 0; width: 100%; height: 100%; border-radius: 4px; image-rendering: auto; }
.dgu-small .demon-pic.off { opacity: .3; }
@media (max-width: 640px) { .dgu-race { grid-template-columns: minmax(0, 1fr); } }
.tt-why { color: var(--text-2); }
.dg-skill-list { display: grid; }
.dg-skill-list .passive { grid-template-columns: 84px minmax(0, 230px) minmax(0, 1fr); }
.dg-skill-list .passive:first-child { border-top: 0; }
.dg-skill-list .passive.off .skill-ico { opacity: .45; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11px var(--font); fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--gear); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--gear); opacity: .10; }
.chart .dot { fill: var(--gear); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .endlabel { fill: var(--text); font-size: 12px; font-weight: 600; }

.tip { position: fixed; inset: auto; margin: 0; overflow: visible; z-index: 50; pointer-events: none; max-width: 320px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- the assistant (Black Frost in the corner) ---------- */
.assistant { position: fixed; right: var(--assistant-right, 18px); bottom: var(--assistant-bottom, 2px); z-index: 30; width: 136px; height: 150px; cursor: pointer; user-select: none; animation: rise .3s ease-out; }
.assistant[hidden] { display: none; }
/* the floor under its feet, so it stands on the window instead of floating */
.assistant::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 3px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0)); }
:root[data-theme="dark"] .assistant::before { background: radial-gradient(closest-side, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); }
/* the canvas is bigger than this box (assistant.js sizes it): room for arms, jumps and falls. Clicks go to the box. */
.assistant canvas { position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
/* room at the end of every page, so its last lines can be scrolled out from behind the assistant */
body.has-assistant .main::after { content: ""; display: block; height: 96px; }
.assistant.turning { cursor: ew-resize; }
/* messages are what it says: speech bubbles above its head, the newest one with the tail pointing down at it */
body.has-assistant .toasts { right: 16px; bottom: calc(var(--assistant-bottom, 2px) + 162px); width: min(380px, calc(100vw - 32px)); }
body.has-assistant .toast { position: relative; border-radius: 14px; }
body.has-assistant .toast:last-child::after { content: ""; position: absolute; right: calc(var(--assistant-right, 18px) + 46px); bottom: -7px; width: 12px; height: 12px; background: var(--surface); border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); transform: rotate(45deg); border-bottom-right-radius: 3px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: grid; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 10px 11px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: rise .18s ease-out; }
.toast-title { font-weight: 600; }
.toast-text { color: var(--text-2); margin-top: 1px; }
.toast svg.icon { margin-top: 1px; }
.toast-ok > svg.icon { color: var(--good); } .toast-warn > svg.icon { color: var(--warn-mark); } .toast-err > svg.icon { color: var(--bad); }
.toast .btn-square { width: 24px; height: 24px; margin: -3px -2px 0 0; }
.toast .btn-square svg.icon { width: 14px; height: 14px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- empty / first run ---------- */
.empty { max-width: 520px; margin: 8vh auto 0; display: grid; gap: 14px; justify-items: start; }
.empty-title { font: 600 22px/1.2 var(--font-display); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: baseline; }
.steps .menu-path { display: block; width: fit-content; margin-top: 4px; padding: 1px 8px; border-radius: 6px; background: var(--menu-path); color: var(--on-menu-path); font-size: 12px; font-weight: 500; white-space: nowrap; }
.steps .menu-btn { width: 24px; height: 24px; margin: 1px 5px 1px 1px; vertical-align: middle; }
.steps .step-note { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; }

/* ---------- settings dialog ---------- */
.dlg { border: 1px solid var(--border-strong); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(480px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.dlg-body { display: grid; gap: 18px; padding: 18px 20px 20px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { font: 600 17px/1.2 var(--font-display); }
.dlg-steps { width: min(540px, calc(100vw - 32px)); }
.snap-steps-body { display: grid; gap: 14px; }
.snap-steps-body .field-help { margin: -8px 0 0; }
.field { display: grid; gap: 6px; justify-items: start; }
.field .input { width: 100%; }
.field-label { font-weight: 600; }
.field-help { color: var(--text-2); font-size: 12px; }
.field-row { display: flex; gap: 8px; }
.path { width: 100%; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; word-break: break-all; user-select: text; }
.dlg-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.dlg-note svg.icon { flex: none; width: 16px; height: 16px; }

/* Send feedback */
.dlg.dlg-feedback { width: min(560px, calc(100vw - 32px)); }
.fb-fields, .fb-done { display: grid; gap: 16px; }
.fb-fields[hidden], .fb-done[hidden] { display: none; }
.field-opt { font-weight: 400; color: var(--text-3); }
.input.fb-message { height: auto; min-height: 140px; padding: 8px 10px; resize: vertical; font: inherit; line-height: 1.45; }
.fb-count { justify-self: end; margin-top: -2px; }
.fb-error { color: var(--warn-ink); }
.fb-error:empty { display: none; }
.fb-sections { display: grid; gap: 12px; }
.fb-sections:empty { display: none; }
.fb-section { display: grid; gap: 8px; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fb-section-head { display: flex; gap: 8px; align-items: center; }
.fb-pick { flex: 1; justify-content: space-between; }
.fb-pick-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.fb-pick .fb-pick-label svg.icon { transform: none; width: 16px; height: 16px; color: var(--text-2); }   /* .snap-btn turns its icons: only the chevron */
.fb-pick-empty { color: var(--text-3); }
.fb-menu .char-list { max-height: min(50vh, 420px); overscroll-behavior: contain; }
.fb-menu .char-list::-webkit-scrollbar { width: 8px; }
.fb-menu .char-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
.fb-menu .list-head:first-child { padding-top: 4px; }
.fb-menu .char { grid-template-columns: auto minmax(0, 1fr) auto; padding: 7px 10px; }
.fb-menu .char svg.icon { width: 16px; height: 16px; color: var(--text-2); }
.fb-menu .char[disabled] { opacity: .45; cursor: default; }
.fb-menu .char[disabled]:hover { background: transparent; }
.fb-emoji { margin-right: 6px; font-size: 13px; line-height: 1; }
.input.fb-section-text { min-height: 90px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-issue { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fb-issue-title { font-weight: 600; }
.fb-issue pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 220px; overflow: auto; color: var(--text-2); }

/* ---------- narrower windows ---------- */
@media (max-width: 1020px) {
  .over-grid { grid-template-columns: minmax(0, 1fr); }
  .passive { grid-template-columns: 118px minmax(0, 1fr); }
  .passive .fx { grid-column: 2; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 52px 1fr; }
  .nav-label, .nav-key, .side-foot { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .game span { display: none; }
  .gear-layout { grid-template-columns: minmax(0, 1fr); }
  .cmp { grid-template-columns: minmax(0, 1fr); }
  .cmp-panel { position: static; order: -1; max-height: 240px; }
  .card.detail { position: static; }
  .page { padding: 18px 16px 32px; }
}
@media (max-width: 640px) {
  .dg-bars.who-stats { grid-template-rows: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* the digitalize demon card (Overview, Digitalized view), one compact band: icon | name, chips and stat bars | its
   digitalize boosts (learned assists) */
.demon-card { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; align-items: stretch; padding: 10px 14px; }
.demon-main { display: grid; gap: 6px; min-width: 0; align-content: start; }   /* who it is, the bars, then its skills and features */
.demon-pic { align-self: start; position: relative; flex: none; width: 44px; height: 44px; border-radius: 7px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--demon) 22%, transparent), transparent 70%), var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--demon) 55%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--demon) 12%, transparent), 0 0 12px color-mix(in srgb, var(--demon) 25%, transparent); }
.demon-pic span { font: 600 18px/1 var(--font-display); color: var(--demon); }
.demon-pic img { position: absolute; inset: 5px; width: 32px; height: 32px; image-rendering: pixelated; }
/* a Mitama demon: the game's mark on the top left corner of the picture (its 14x14 image as a mask, in the game's cyan) */
.demon-pic .mitama-mark { position: absolute; left: 5px; top: 5px; box-sizing: content-box; width: 10px; height: 10px; border: 1px solid #1a2b4c; background: #1a2b4c; }   /* dark blue, 2px around (asked for) and behind the mark, as the game's dark square */
.demon-pic .mitama-mark::before { content: ''; position: absolute; inset: 0; background: #7dcfff; image-rendering: auto;
  -webkit-mask: var(--mark) center / 100% 100% no-repeat; mask: var(--mark) center / 100% 100% no-repeat; }
.demon-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.demon-id .stat-label { font-size: 11px; }
.demon-name { margin: 0 4px 0 0; font: 600 17px/1.2 var(--font-display); letter-spacing: -.01em; }
/* the demon's name is the picker: a button that opens the dropdown of COMP demons */
.name-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 8px; margin: -2px -6px -2px -8px; border-radius: 7px; cursor: pointer; }
.name-btn:hover { background: var(--hover); }
.name-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.name-btn .chev.down { transform: rotate(90deg); color: var(--text-3); }
.name-btn .chev svg.icon { width: 14px; height: 14px; }
.strack i:not(:last-child) { border-radius: 0; }   /* only the last part of a bar has a rounded end */
.tag-demon { border-color: color-mix(in srgb, var(--demon) 60%, transparent); color: var(--text); background: color-mix(in srgb, var(--demon) 14%, transparent); }
/* its stats: the player's tiny bars, four columns of three, HP and MP first */
.dg-bars { display: grid; grid-template-rows: repeat(3, 20px); align-items: center; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 14px; }
.dg-row { grid-template-columns: 40px minmax(20px, 1fr) 42px; gap: 6px; height: 18px; font-size: 12px; white-space: nowrap; }
.dg-row .srow-label { color: var(--text-2); }
.dg-row .strack { height: 8px; }
.strack i.demon { background: var(--demon); border-radius: 0; }   /* square ends, as the player's bars (asked for) */
/* its boosts: the card's right column, down its whole height; one row per level: level, that level's passive icons, the boost */
.demon-assists { display: grid; gap: 3px; padding-left: 14px; border-left: 1px solid var(--border); align-content: start; min-width: 190px; }
.demon-assists .stat-label { font-size: 11px; }
.dg-assist-list { display: grid; gap: 4px; }
/* level | the boost's picture (or its lock) | the boost | that level's passive icons, at the right end */
.dg-assist { display: grid; grid-template-columns: 26px 22px 1fr auto; align-items: center; gap: 6px; min-height: 24px; font-size: 12px; color: var(--text); white-space: nowrap; }
.dg-assist > .skill-ico { width: 22px; height: 22px; background: none; }
.dg-assist-icons { display: inline-flex; gap: 3px; }
.dg-assist-icons .skill-ico { width: 22px; height: 22px; }
.dg-assist-icons .skill-ico.off { opacity: .35; }
.dg-assist.none { color: var(--text-3); } .dg-assist.none b { background: var(--surface-2); color: var(--text-3); }
.dg-assist b { justify-self: start; font-weight: 600; font-size: 9.5px; color: var(--text); background: color-mix(in srgb, var(--demon) 22%, transparent); border-radius: 999px; padding: 0 5px; }
@media (max-width: 1100px) { .demon-card { grid-template-columns: auto minmax(0, 1fr); } .demon-assists { grid-column: 1 / -1; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .dg-assist-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
@media (max-width: 640px) { .demon-main { display: contents; } .dg-bars { grid-column: 1 / -1; grid-template-rows: repeat(6, auto); } }
/* alignment frames: the player's picture and the digitalize demon's icon take their alignment's colour */
.align-law { --align: var(--law); } .align-neutral { --align: var(--neutral); } .align-chaos { --align: var(--chaos); }
.demon-pic[class*="align-"] { border-color: var(--align);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--align) 22%, transparent), transparent 70%), var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--align) 14%, transparent), 0 0 14px color-mix(in srgb, var(--align) 30%, transparent); }
.demon-pic[class*="align-"] span { color: var(--align); }
/* the player's picture: the same recipe as the demon's icon (a border in the alignment colour, a soft ring, a glow),
   on the Overview portrait, on its empty "Add picture" frame, and on the small picture in the top bar */
.portrait[class*="align-"] { box-shadow: 0 0 0 2px var(--align), 0 0 0 5px color-mix(in srgb, var(--align) 14%, transparent), 0 0 16px color-mix(in srgb, var(--align) 30%, transparent); }
.portrait.no-pic[class*="align-"] { border: 1.5px solid var(--align);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--align) 16%, transparent), transparent 70%), var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--align) 14%, transparent), 0 0 14px color-mix(in srgb, var(--align) 30%, transparent); }
.who-pic[class*="align-"] { box-shadow: 0 0 0 1.5px var(--align), 0 0 8px color-mix(in srgb, var(--align) 35%, transparent); }
.tag-align { border-color: color-mix(in srgb, var(--align) 70%, transparent); color: var(--text); background: color-mix(in srgb, var(--align) 14%, transparent); }

/* digitalize demon picker: the game's 32x32 icons, pixel-crisp */
.dm-icon { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--border-strong); }
.dm-none { display: grid; place-items: center; font: 600 14px/1 var(--font-display); color: var(--demon); background: var(--surface-2); }
.char[disabled] { opacity: .6; cursor: progress; }
.demon-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.demon-actions .chev { margin: 0 4px 0 0; }
.demon-actions .chev.down { margin: 0 0 0 4px; transform: rotate(90deg); }
.demon-switching { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.spin.ink { border-color: var(--border-strong); border-top-color: var(--text); }   /* the spinner on a plain surface (the default one is for the purple button) */
/* the demon picker: a dropdown under "Change" (a popover; app.js places it under its button) */
.menu { position: fixed; inset: auto; margin: 0; width: min(360px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: visible; }
.menu .char-list { margin: 0; padding: 0; max-height: min(50vh, 360px); }
.menu .char { padding: 6px 8px; gap: 10px; border-color: transparent; }
.menu .char:hover { border-color: transparent; }
.menu .char:focus-visible { outline-offset: -2px; }   /* inside the row: the list scrolls with no padding, so an outline outside it was cut at the edges (user, 2026-11-27) */
.menu-foot { display: grid; gap: 6px; margin-top: 6px; padding: 8px 6px 0; border-top: 1px solid var(--border); }
.menu-foot .btn { width: 100%; }
.menu-foot .field-help:empty { display: none; }
.dm-off { color: var(--text-3); }
/* the demon line with no demon: the same box, empty */
.demon-pic.none { border: 1.5px dashed var(--border-strong); background: var(--surface-2); box-shadow: none; }
.demon-pic.none span { color: var(--text-3); }
.menu-note { margin: 0; padding: 4px 8px 4px; }
/* closed (the default): one line, who it is and your HP/MP with it */
.demon-card.closed { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.demon-card.closed .demon-main { grid-template-rows: auto; }
.demon-card.closed .demon-pic { align-self: center; }
/* demon card: second line (Max HP/MP while digitalized, force stack, equipment, Demon Force) */
.demon-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--text-2); }
.dg-total b { color: var(--text); font-weight: 600; }
.demon-extra .tag-off { opacity: .7; }

/* Tools section of the sidebar, and the DCM Locator */
.nav-group { position: relative; display: grid; }
.nav-fold { all: unset; box-sizing: border-box; position: absolute; right: 4px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--text-3); cursor: pointer; }
.nav-fold:hover { background: var(--hover); color: var(--text); }
.nav-fold:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.nav-fold svg.icon { width: 14px; height: 14px; transition: transform .12s ease; }
.nav-fold[aria-expanded="true"] svg.icon { transform: rotate(90deg); }
.nav-sub { display: grid; gap: 1px; margin: 0 0 4px 19px; padding-left: 8px; border-left: 1px solid var(--border); max-height: 32vh; overflow-y: auto; }
.nav-subitem { all: unset; box-sizing: border-box; display: block; height: 28px; line-height: 28px; padding: 0 8px; border-radius: 6px; color: var(--text-2); font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-subitem:hover { background: var(--hover); color: var(--text); }
.nav-subitem[aria-current="page"] { background: var(--selected); color: var(--text); font-weight: 600; }
.nav-subitem:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 900px) { .nav-fold, .nav-sub { display: none; } }
/* The "Databases" group: a fold-away entry with the database pages indented under it, open at every start */
.nav-dbhead { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nav-dbhead:hover { color: var(--text); }
.nav-dbchev { display: grid; place-items: center; width: 18px; }
.nav-dbchev svg.icon { width: 14px; height: 14px; transition: transform .12s ease; }
.nav-dbhead[aria-expanded="true"] .nav-dbchev svg.icon { transform: rotate(90deg); }
.nav-dbhead.has-current { color: var(--text); }
.nav-dbhead.has-current::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--focus); }
.nav-dbs { display: grid; gap: 2px; margin: 0 0 4px 17px; padding-left: 4px; border-left: 1px solid var(--border); }
.nav-dbs .nav-item { padding: 0 6px; gap: 8px; }
.nav-dbs .nav-label { white-space: nowrap; }
.nav-dbs[hidden] { display: none; }
/* narrow (icon-only) sidebar: the pages stay reachable, no fold-away entry */
@media (max-width: 900px) { .nav-dbhead { display: none; } .nav-dbs, .nav-dbs[hidden] { display: grid; margin: 0; padding: 0; border: 0; } }
.nav-head { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 900px) { .nav-head { margin: 10px 8px 4px; height: 1px; overflow: hidden; background: var(--border); color: transparent; } }
.page-dcm { grid-template-columns: minmax(0, 1fr); }
.page-dcm .hist-tbl td:first-child, .hist-tbl td.dim { white-space: nowrap; }
.page-dcm .search { max-width: 300px; }
.dcm-best { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.dcm-kind { color: var(--text-2); font-size: 12px; }
.dcm-best .src-count { white-space: normal; }
.detail-row > td { background: var(--surface-2); padding: 6px 12px 12px 34px; }
.dcm-parts { max-width: 760px; }
.dcm-parts li:first-child { border-top: 0; }
.dcm-parts li { grid-template-columns: 92px minmax(0, 1fr) auto; }   /* DCM lines have no icon: kind, text, rate */
.dcm-icon { flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: inline-grid; margin: -4px 0; }
.dcm-icon img { width: 28px; height: 28px; display: block; object-fit: cover; object-position: 50% 20%; }
.page-dcm .row-btn { align-items: center; }

/* Demon Rank: the sorted column in the demon colour */
.rank-tbl th, .rank-tbl td { padding-left: 6px; padding-right: 6px; }
.rank-tbl .th-btn { white-space: nowrap; }
.rank-tbl td.rank-on, .rank-tbl th.rank-on { color: var(--demon); }
.rank-tbl td.rank-on { background: color-mix(in srgb, var(--demon) 7%, transparent); }
.rank-no { color: var(--text-3); width: 1%; }
.rank-demon { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rank-demon .src-count { display: block; margin-left: 0; }
.rank-at { gap: 10px; align-items: center; }
/* the Mitama mark as on Overview's summoned demon, sized for the 28px face */
.rank-face { position: relative; }
.rank-face .mitama-mark { position: absolute; left: 1px; top: 1px; box-sizing: content-box; width: 8px; height: 8px; border: 1px solid #1a2b4c; background: #1a2b4c; }
.rank-face .mitama-mark::before { content: ''; position: absolute; inset: 0; background: #7dcfff;
  -webkit-mask: var(--mark) center / 100% 100% no-repeat; mask: var(--mark) center / 100% 100% no-repeat; }

/* Quest Guide */
.q-detail { display: grid; gap: 10px; max-width: 860px; }
.q-needs { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; font-size: 12px; }
.q-key { color: var(--text-2); font-size: 12px; }
.q-steps { margin: 0; padding: 0; list-style: none; counter-reset: qstep; display: grid; gap: 0; }
.q-steps > li { counter-increment: qstep; position: relative; padding: 10px 0 10px 34px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.q-steps > li::before { content: counter(qstep); position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--selected); color: var(--text); }
.q-step-title { font-weight: 600; }
.q-objective { margin: 0; max-width: 80ch; }
.q-goals { margin: 0; padding-left: 18px; font-weight: 600; }
.q-way { display: grid; gap: 3px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.q-do { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.q-place { color: var(--text-2); font-size: 12px; }
.q-or { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.q-line { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 12px; align-items: baseline; }
/* a person's picture before their name (npc-pictures.json) */
/* the picture sits on the text's middle and its negative margins keep the line as tall as the text, so the name stays
   on the same baseline as "Talk to" and the rows below keep their spacing */
.q-who { white-space: nowrap; }
.q-face { display: inline-block; width: 24px; height: 24px; margin: -6px 5px -6px 0; vertical-align: middle; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); object-fit: contain; }
.q-pick { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.q-arrow { color: var(--text-3); }
.q-answers { display: grid; gap: 4px; }
.q-answer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.q-not { color: var(--text-3); }
/* live progress from the game: the step you are on in the app's purple, steps behind you dimmed */
.q-live-tag { margin-left: 8px; border-color: var(--accent-edge); background: var(--accent); color: var(--accent-ink); }
.q-done-tag { margin-left: 8px; }
.q-steps > li.q-now { box-shadow: inset 3px 0 0 var(--accent); padding-left: 40px; margin-left: -6px; }
.q-steps > li.q-now::before { left: 6px; background: var(--accent); color: var(--accent-ink); }
.q-steps > li.q-past > * { opacity: .55; }
.q-step-title .q-live-tag { margin-left: 0; }
.q-step-title .q-live-tag:not(:first-child) { margin-left: 8px; }
.q-count { font-weight: 600; margin-left: 6px; }
.q-goal-met .q-count::after { content: " ✓"; }
.q-talks > li.q-talk-done > :not(:first-child) { opacity: .55; }
.q-live-note { margin: 0 0 8px; }
/* ---- Quest Tracker: the quests in progress, read from the game ---- */
.page-tracker { max-width: 980px; }
.qt-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; }
.qt-status-text { flex: 1; display: grid; gap: 3px; min-width: 0; }
.qt-status-text .note { margin: 0; }
.qt-dot-live { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.qt-dot-live.on { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.qt-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); font-size: 12px; }
.qt-facts b { color: var(--text); }
.qt-list { display: grid; gap: 8px; }
.qt-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.qt-card.here { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.qt-card.hidden { background: none; }
.qt-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.qt-card.hidden .qt-head { cursor: default; padding: 6px 12px; }
/* closed, the whole card opens it (its head and the line of what comes next), so all of it lights up; open, only the
   head closes it */
.qt-card.open .qt-head:hover, .qt-card:not(.open):not(.hidden):hover { background: var(--surface-2); }
.qt-card:not(.open):not(.hidden) .qt-peek { cursor: pointer; }
.qt-card.hidden .qt-head:hover { background: none; }
.qt-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.qt-head .chev { flex: none; display: inline-flex; transition: transform .15s; color: var(--text-3); }
.qt-card.open .qt-head .chev { transform: rotate(90deg); }
.qt-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.qt-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-card.hidden .qt-title b { font-weight: 400; color: var(--text-2); }
.qt-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-steps { flex: none; display: inline-flex; align-items: center; gap: 3px; }
.qt-pip { width: 14px; height: 4px; border-radius: 2px; background: var(--border-strong); }
.qt-pip.done { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.qt-pip.now { background: var(--accent); }
.qt-stepno { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--text-2); min-width: 26px; }
.qt-hide { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.qt-hide:hover { background: var(--surface-2); color: var(--text); }
.qt-peek { padding: 0 12px 10px 38px; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-body { display: grid; gap: 10px; padding: 2px 14px 12px 38px; }
.qt-objective { margin: 0; color: var(--text-2); max-width: 80ch; }
.qt-goals { display: grid; gap: 6px; max-width: 520px; }
.qt-goal { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 12px; }
.qt-count { font-weight: 600; }
.qt-goal.met .qt-count { color: var(--accent-text, var(--text)); }
.qt-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.qt-bar > span { display: block; height: 100%; background: var(--accent); }
.qt-next { display: grid; gap: 8px; }
.qt-foot { display: flex; justify-content: flex-end; }
.qt-hidden-head { display: flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; cursor: pointer; }
.qt-hidden-head:hover { background: var(--surface-2); color: var(--text); }
.qt-hidden-head .chev { display: inline-flex; transition: transform .15s; }
.qt-hidden-head .chev.open { transform: rotate(90deg); }
.qt-hidden { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.qt-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 16px; color: var(--text-2); border: 1px dashed var(--border); border-radius: 10px; }
.qt-empty .icon { width: 28px; height: 28px; }
.qt-empty p { margin: 0; }
/* the quest panel: open it from the status line, follow a quest in it from the quest itself */
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text, var(--text)); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.q-panel-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-panel-bar .btn[aria-pressed="true"] { border-color: var(--accent); }
.q-panel-bar .note { margin: 0; }
/* the zone you are in (live): outlined in the app's purple, beside the filled "You are here" of the step */
.q-here-tag { margin-left: 8px; border-color: var(--accent); color: var(--text); }
/* what has to happen before a step's talk: "first ... then ..." */
.q-before { margin: 0 0 4px; padding: 0; list-style: none; display: grid; gap: 6px; }
.q-before > li { display: grid; gap: 3px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.q-fx { color: var(--text-2); }
.q-tree { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.q-tree .q-tree { margin-top: 6px; padding-left: 14px; border-left: 1px solid var(--border); }
.q-tree > li { display: grid; gap: 4px; }
.q-outcome { display: grid; gap: 3px; padding-left: 14px; }
.q-outcome .q-line { grid-template-columns: 92px minmax(0, 1fr); }
.q-after .q-lines { display: grid; gap: 2px; font-weight: 600; }
.q-talks { margin: 2px 0 2px; padding-left: 20px; display: grid; gap: 8px; }
.q-talks > li { display: grid; gap: 3px; }
.q-talks > li::marker { color: var(--text-3); }
.q-get > span:last-child { font-weight: 600; }.q-hint { font-size: 12px; color: var(--text-2); }
.q-do { line-height: 1.5; }
.q-asks { font-style: italic; }
.q-asks::before { content: open-quote; }
.q-asks::after { content: close-quote; }

/* Gear Database */
.gdb-block { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.gdb-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.gdb-list .src-count { margin-left: 8px; }
.gdb-gives { color: var(--text-2); font-size: 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.pager:empty { display: none; }
.pager > .note { margin-right: 8px; }
.pager-num { min-width: 32px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.pager-num[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.pager-gap { color: var(--text-2); padding: 0 2px; }
.pager-per { margin-right: 8px; }
.gdb-filters { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.gdb-fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gdb-flabel { min-width: 72px; font-size: 12px; color: var(--text-2); }
.gdb-fbtn[aria-expanded="true"] { background: var(--surface-2); }
.page-dcm .tbl th .th-btn { align-items: center; text-align: left; }
.gdb-lv { width: 64px; height: 28px; padding: 0 6px; font-size: 12px; }
.gdb-sub-chips { margin-top: -4px; }
.gdb-sub-chips .chip-btn { height: 24px; font-size: 11.5px; }
.gdb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.page-dcm .search { max-width: 380px; }.page-dcm .tbl tr.detail-row > td { white-space: normal; }
.gdb-list li { overflow-wrap: anywhere; }
.gdb-with { color: var(--text-2); font-size: 12px; }
.gdb-kind { display: inline-block; min-width: 96px; margin-right: 8px; color: var(--text-2); font-size: 12px; }
.gdb-rate { margin-left: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gdb-sub { padding-left: 22px; }
.ddb-get-row { display: flex; align-items: baseline; }
.ddb-get-row > .gdb-kind { flex: none; }
.ddb-get-body { flex: 1; min-width: 0; }
.ddb-get-body > .fus-plugin { margin-top: 2px; }
.q-link { margin: 2px 0 2px 10px; vertical-align: baseline; }
.any-one { margin: 2px 0 4px; font-size: 12px; font-style: italic; opacity: .85; }
.gdb-sub-list { margin: 3px 0 0; padding-left: 14px; font-size: 12.5px; color: var(--text-2); }

/* ---------- Build Planner (Tools): the build on the left, what it gives on the right ---------- */
.page-sim { max-width: 1320px; }
.page-sim, .sim-pick, .xp-layout { --good: var(--up); --bad: var(--down); }
/* a little dot before a chain or a bonus the change touches: green new, blue changed, red gone */
.chg-dot { --dot: var(--good); display: inline-block; flex: none; width: 7px; height: 7px; margin: 0 3px 1px 7px; border-radius: 50%; vertical-align: middle; background: var(--dot); }
.chg-dot.upd { --dot: var(--law); }
.chg-dot.gone { --dot: var(--bad); }
/* Expertise page planner: the Build Planner's expertise editor beside what the plan changes */
.xp-out .list-head { padding-left: 0; margin-top: 4px; }
.xp-unlocks { display: grid; gap: 8px; }
.xp-unlock { display: grid; gap: 2px; padding-left: 10px; border-left: 2px solid var(--good); }
.xp-unlock.bad { border-left-color: var(--bad); }
.xp-unlock-head { display: flex; align-items: baseline; gap: 8px; }
.xp-unlock-list { margin: 0; }
.sim-unlocks.xp-unlock-list li { grid-template-columns: 36px minmax(0, 1fr); gap: 6px; color: var(--text); }
.xp-unlock.good .sim-unlock-rank { color: var(--good); } .xp-unlock.bad .sim-unlock-rank { color: var(--bad); }
/* skills the plan loses: greyed out, picture too */
.xp-unlock.bad .unl-skill, .xp-unlock.bad .sim-unlock-pick { color: var(--text-3); }
.xp-unlock.bad .unl-skill img { filter: grayscale(1); opacity: .45; }   /* every "better / worse" in the Build Planner in the same two colours */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.sim-edit { display: grid; gap: 12px; min-width: 0; }
/* The result has no scroll of its own (the user's choice): it grows with the page, which scrolls as a whole. */
.sim-out { display: grid; gap: 12px; }
@media (max-width: 1040px) {
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .sim-out { order: -1; }
}
/* the builds: "New build" and one card per saved build, as compact as the digitalize demons' cards (.dg-tile) */
.sim-builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: stretch; }   /* every card in a row as tall as the tallest, "New build" too */
.sim-build-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.sim-build-name { all: unset; box-sizing: border-box; display: block; max-width: 100%; font: 600 15px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border-radius: 4px; }
.sim-build-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sim-build-acts { display: inline-flex; align-items: center; gap: 2px; margin: -4px -6px 0 0; }
.sim-build-acts .btn-square { width: 26px; height: 26px; padding: 0; }   /* (.btn-sm's side padding would squeeze the icon to a dot) */
.sim-build-acts .btn-square svg.icon { width: 15px; height: 15px; }
/* a saved build's card: its pieces as pictures in a small column on the left (3 across, the 15 slots in the game's order), the rest beside it */
.sim-build:not(.sim-new) { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr; column-gap: 14px; padding: 14px; min-height: 190px; }
.sim-build-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sim-build-saved { margin-top: auto; padding-top: 4px; color: var(--text-3); }   /* when it was saved: at the foot of the card, however much is above it */
.sim-build-col { display: grid; grid-template-columns: repeat(3, 28px); grid-auto-rows: 28px; gap: 4px; align-content: start; }
.sim-build-slot { display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); }
.sim-build-slot img { width: 24px; height: 24px; image-rendering: pixelated; }
.sim-build-slot.none { opacity: .5; }
.sim-build-slot.changed { box-shadow: 0 0 0 1.5px var(--accent); }
/* a changed piece's tooltip on a build card: the usual sections; where the build differs from the base, the base's comes first and the build's is under it in a card: outlined in the ring's purple, headed "Changes to" (a filled band with a line under it), its text in the readable purple of the focus ring. The card's sides sit OUTSIDE the text column (negative side margins as wide as its padding), so what is in it stays in line with the section headings and the lines above. */
.tt-new { margin: 6px -8px 4px; padding: 0 8px 7px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--accent); overflow: hidden; }
.tt-new-cap { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: 3px; }
.tt-new .tt-new-cap { margin: 0 -8px 6px; padding: 4px 8px; background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); border-bottom: 1.5px solid var(--accent); }   /* the band is the outline's purple thinned out (a whole band of it at full strength reads much brighter than the thin outline), and the line under it is the outline itself */
.tt-new .tt-head { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.tt-cmp > .tt-new:has(.tt-head) { margin-bottom: 8px; }
.tt-head.tt-head-was { padding-bottom: 6px; margin-bottom: 0; border-bottom: 0; }
/* a section's source in a piece tooltip: the picture(s) of the piece, crystal or set pieces it comes from, then the name */
.tt-src { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 3px; }
.tt-src-pic { width: 22px; height: 22px; flex: none; image-rendering: pixelated; border-radius: 4px; background: var(--surface-2); }
.tt-src span { min-width: 0; flex: 1 1 60%; }
.sim-build .dgt-add b.good { color: var(--good); } .sim-build .dgt-add b.bad { color: var(--bad); }
.sim-new { align-content: center; justify-items: center; text-align: center; gap: 14px; min-height: 190px; padding: 20px 14px; border-style: dashed; border-color: var(--border-strong); background: transparent; }
/* "Share" and "Import build": the code in a box, and what a pasted code holds (one line per piece, the ranks as tags) */
.dlg.sim-code { width: min(560px, calc(100vw - 32px)); }
.sim-code-body { display: grid; gap: 12px; min-width: 0; }
.sim-code-box { width: 100%; height: auto; min-height: 86px; padding: 8px 10px; font: 12px/1.5 Consolas, "Cascadia Mono", monospace; word-break: break-all; resize: vertical; user-select: text; }
.sim-code-count { align-self: center; }
.sim-code-status:empty { display: none; }
.sim-code-status.bad { color: var(--bad); }
.sim-code-preview { display: grid; gap: 12px; min-width: 0; }
.sim-code-preview:empty { display: none; }
.sim-code-on { flex-wrap: wrap; }
.sim-code-list { display: grid; gap: 6px; max-height: min(40vh, 340px); overflow: auto; padding-right: 4px; }
.sim-code-row { display: grid; grid-template-columns: 26px 62px minmax(0, 1fr); gap: 8px; align-items: center; }
.sim-code-row img { width: 26px; height: 26px; image-rendering: pixelated; }
.sim-code-piece { display: grid; min-width: 0; }
.sim-code-piece b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-code-ranks { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-top: 4px; }
.sim-code-foot { display: flex; gap: 10px; align-items: end; }
.sim-code-foot[hidden] { display: none; }
.sim-code-foot .field { flex: 1; }
.sim-new-main { all: unset; box-sizing: border-box; display: grid; justify-items: center; gap: 10px; cursor: pointer; border-radius: 8px; }
.sim-new-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sim-new-import { border: 1px solid var(--border); }
.sim-new-plus { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--selected); color: var(--text); }
/* one build in the editor: back to the builds, its name, save / duplicate / delete */
.sim-head { align-items: center; }
.sim-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.sim-back { gap: 4px; padding: 0 10px 0 6px; }
.sim-back .chev { margin: 0; transform: rotate(180deg); }
.sim-name { width: min(260px, 44vw); font-weight: 600; }
.sim-name-text { font: 600 15px/1.3 var(--font-display); }
/* under the title: the digitalize demon picker, the Overview's own band (for a build with no base: its level and alignment) */
.sim-bands { display: grid; min-width: 0; }
.sim-lv-in { width: 54px; }
.sim-import { gap: 6px; padding: 0 8px 0 12px; }
.sim-import .chev.down { margin: 0; transform: rotate(90deg); color: var(--text-3); }
.sim-import .chev svg.icon { width: 14px; height: 14px; }
.sim-band .seg button { height: 22px; }
.sim-tabs { justify-self: start; }
.sim-edit-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sim-edit-body { display: grid; min-width: 0; }
.sim-count { margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 600; display: inline-grid; place-items: center; }

/* the 15 worn pieces: one box each, always open. First line the piece, then the tarot and the soul a line each,
   then Slot 1, Slot 2, Slot 3 side by side, then the mods in one line */
.sim-slots { display: grid; gap: 10px; container-type: inline-size; }
/* the gear at a glance: 15 tiles in the game's equipment window order, 5 by 3 */
.sim-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sim-grid-tile { all: unset; box-sizing: border-box; display: grid; gap: 4px; align-content: start; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.sim-grid-tile:hover { border-color: var(--text-3); }
.sim-grid-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sim-grid-tile.changed { border-color: color-mix(in srgb, var(--focus) 50%, var(--border)); }
.sim-grid-tile.sim-grid-empty .sim-grid-name { color: var(--text-3); font-weight: 400; }
.sim-grid-slot { color: var(--text-3); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.sim-grid-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sim-grid-name { font-size: 12px; font-weight: 600; line-height: 1.25; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.sim-grid-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.sim-grid-donors { display: grid; gap: 1px; min-width: 0; }
.sim-grid-donor { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 11px; color: var(--text-3); }
.sim-grid-donor.infused { color: var(--text); }
.sim-grid-n { flex: none; width: 12px; font-size: 9px; font-weight: 700; text-align: center; line-height: 12px; border-radius: 3px; background: var(--surface-2); color: var(--text-2); }
.sim-grid-donor.infused .sim-grid-n { background: var(--accent); color: var(--accent-ink); }
.sim-grid-donor-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-grid-crystal { width: 16px; height: 16px; image-rendering: pixelated; }
.sim-grid-mark { font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 0 4px; line-height: 14px; border-radius: 4px; color: var(--text-2); background: var(--surface-2); }
.sim-grid-mark.limit { color: var(--fuse); }
/* "Where to get it" under the picked piece: one block per item it is made of */
.sim-where { display: grid; gap: 12px; }
.sim-where-item { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); min-width: 0; }
.sim-where-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.sim-where-parts { display: flex; gap: 4px; }
.sim-where-open { margin-left: auto; }
.sim-where-item > .btn { justify-self: start; }
.sim-where-notes { display: grid; gap: 2px; }
/* the tile whose piece is shown below for editing */
.sim-grid-tile.on, .sim-grid-tile.on:hover { border-color: var(--accent); background: var(--selected); box-shadow: inset 0 0 0 1px var(--accent); }
.sim-exp-name[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sim-slot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; display: grid; gap: 10px; min-width: 0; }
.sim-slot.changed { border-color: color-mix(in srgb, var(--focus) 50%, var(--border)); }
.sim-slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.sim-slot-head .slot-name { flex: none; width: 62px; }
.sim-slot-item { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-slot-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.sim-slot-head .sim-hist { flex-basis: 100%; padding-left: 42px; }
.sim-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sim-crystals { display: grid; gap: 8px; }
.sim-crystal { grid-template-columns: 90px minmax(0, 280px); align-items: start; gap: 8px 16px; }
.sim-crystal-pick { display: grid; gap: 6px; min-width: 0; }
.sim-mods { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sim-crystal .sim-lines, .sim-mods > .sim-lines { display: flex; flex-wrap: wrap; gap: 2px 16px; }
/* a weapon's five mod slots side by side, each with its dropdown */
.sim-mod-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sim-mod { display: grid; gap: 6px; align-content: start; min-width: 0; }
.sim-mod.changed .sim-col-key > span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--focus); vertical-align: middle; }
.sim-mod .sim-col-key.sim-mod-key { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.sim-mod-added { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 0 4px; line-height: 14px; border-radius: 4px; color: var(--text-2); background: var(--surface-2); }
.sim-crystal > .sim-lines, .sim-crystal > .sim-none { grid-column: 1 / -1; padding-top: 0; }
.sim-cols-none { margin: 0; padding-left: 42px; }
.sim-col { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.sim-col.off { opacity: .7; }
.sim-col-key { display: grid; gap: 1px; font-size: 12px; font-weight: 600; }
.sim-col-key small { color: var(--text-2); font-weight: 400; font-size: 11px; }
.sim-col.changed .sim-col-key > span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--focus); vertical-align: middle; }
.sim-col .sim-part-pick { flex-wrap: wrap; }
.sim-col .sim-pickbtn { flex: 1 1 100%; }
.sim-col .sim-none { margin: 0; }
/* Slot 2's title line: the title on the left, the LIMIT switch on the right; the fusion bonus it adds, in the fusion colour */
.sim-col-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.sim-limit-box { display: flex; align-items: center; gap: 4px; flex: none; }
.sim-limit-box .sim-limit { min-height: 0; gap: 6px; font-size: 11px; letter-spacing: .05em; color: var(--fuse); }
.sim-fuse-add { color: var(--fuse); font-weight: 600; }
/* a slot of a piece the game won't soul infuse: the piece itself, no dropdown */
.sim-pick-fixed, .sim-pick-fixed:hover { cursor: default; background: transparent; border-color: var(--border); color: var(--text-2); justify-content: flex-start; }
.sim-pick-icon { width: 20px; height: 20px; flex: none; image-rendering: pixelated; margin-left: -4px; }
.sim-pick-text { flex: 1 1 auto; }
@container (max-width: 560px) { .sim-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sim-cols, .sim-crystal { grid-template-columns: minmax(0, 1fr); } .sim-mod-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sim-noicon { box-sizing: border-box; border-radius: 6px; border: 1px dashed var(--border-strong); }
.sim-tag-changed, .sim-tag-use { border-color: transparent; background: var(--selected); color: var(--text); }
.sim-tag-limit { border-color: var(--fuse); color: var(--fuse); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.sim-part-pick { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sim-pickbtn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 1 400px; min-width: 0; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.sim-pickbtn > .sim-pick-text, .sim-pickbtn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-pickbtn:hover { border-color: var(--text-3); }
.sim-pickbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sim-pickbtn .chev { margin: 0; transform: rotate(90deg); }
.sim-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 12px; color: var(--text-2); }
.sim-line { overflow-wrap: anywhere; }
.sim-line small { color: var(--text-3); font-size: 12px; }
.sim-line.is-inactive, .sim-line.is-situational, .sim-line.is-unknown { color: var(--text-3); }
.sim-none { color: var(--text-3); font-size: 12px; }
.sim-sets { display: grid; gap: 6px; }
.sim-set { display: grid; gap: 2px; }
.sim-set.off { opacity: .7; }
.sim-limit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 32px; cursor: pointer; }
.sim-limit small { color: var(--text-2); font-size: 12px; }
.sim-undo { color: var(--text-2); }
/* what was picked before for a part: a chip to use it again, with an x to take it off the list */
.sim-hist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sim-hist-label { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.sim-hchip { display: inline-flex; align-items: stretch; height: 24px; max-width: 100%; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); overflow: hidden; }
.sim-hchip.on { background: var(--selected); border-color: transparent; }
.sim-hchip-use { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-width: 0; padding: 0 4px 0 10px; font-size: 12px; cursor: pointer; }
.sim-hchip-use span { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-hchip.on .sim-hchip-use { font-weight: 600; cursor: default; }
.sim-hchip-x { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 22px; color: var(--text-3); cursor: pointer; }
.sim-hchip-x svg.icon { width: 11px; height: 11px; }
.sim-hchip:not(.on) .sim-hchip-use:hover, .sim-hchip-x:hover { background: var(--hover); color: var(--text); }
.sim-hchip-use:focus-visible, .sim-hchip-x:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 999px; }

/* expertise: one slider per expertise, the chains worked out under them */
.sim-exp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 1px; }
.sim-exp .list-head { padding-left: 0; }
.sim-points { display: grid; gap: 8px; padding-bottom: 4px; }
.sim-points-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sim-points .exp-bar { flex: none; display: block; }
.sim-cap { display: inline-flex; align-items: center; gap: 4px; }
.sim-cap .btn { flex: none; width: 24px; height: 24px; font-size: 13px; }
.sim-cap-in { width: 84px; height: 28px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.sim-cap-in::-webkit-inner-spin-button, .sim-cap-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }   /* the − and + beside it do this */
.exp-bar.over i { background: var(--warn-mark); }
.sim-exp-row { display: grid; grid-template-columns: minmax(140px, 1fr) 150px minmax(210px, 1.3fr) 50px; gap: 10px; align-items: center; min-height: 34px; padding: 0 6px; margin: 0 -6px; border-radius: 6px; }
.sim-exp-row:hover { background: var(--hover); }
.sim-exp-name { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-width: 0; cursor: pointer; border-radius: 4px; }
.sim-exp-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sim-exp-name .chev { margin: 0; }
.sim-exp-dot { display: contents; }
.sim-exp-name .chg-dot { margin: 0 3px 0 1px; }
.sim-exp-val { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 0; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.25; }   /* "was 9-0" under the class and rank */
.sim-exp-was:empty { display: none; }
.sim-exp-rank { color: var(--text-2); }
.sim-exp-row.changed .sim-exp-rank, .sim-chain.changed .sim-exp-rank { color: var(--text); font-weight: 600; }
.sim-exp-row.changed .sim-exp-name { font-weight: 600; }
.sim-exp-was { color: var(--text-3); font-size: 12px; }
.sim-exp-ctl { display: flex; align-items: center; gap: 2px; min-width: 0; }
.sim-exp-ctl .btn { flex: none; width: 24px; height: 24px; font-size: 13px; }
.sim-range { flex: 1; min-width: 60px; height: 20px; margin: 0 4px; accent-color: var(--exp); cursor: pointer; }
.sim-exp-detail { grid-column: 1 / -1; }
.sim-exp-detail:empty { display: none; }
.sim-unlocks { margin: 2px 0 10px 20px; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12px; color: var(--text-3); }
.sim-unlocks li { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; }
.sim-unlocks li.on { color: var(--text); }
.unl-passive { font-style: italic; }   /* passives in italics, actives upright (the user's choice) */
/* a skill in an unlock list: its picture and name (hover: the game's description) */
.unl-skill { display: inline-flex; align-items: center; gap: 5px; margin: 1px 12px 1px 0; vertical-align: middle; cursor: default; }
.unl-skill .skill-ico { width: 20px; height: 20px; flex: none; }
.unl-or { margin-right: 12px; color: var(--text-3); font-size: 11px; vertical-align: middle; }
.unl-skill .skill-ico img { width: 20px; height: 20px; }
.sim-unlocks li { align-items: center; }
.sim-list-head { display: flex; align-items: center; gap: 10px; }
.sim-list-head small { flex: 1; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.sim-chains { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px; }
.sim-chain { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.sim-chain.off { color: var(--text-3); }

/* the result */
.sim-card { gap: 10px; }
.sim-card.sheet { padding: 12px 16px; gap: 12px; }
.sim-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sim-stat { display: grid; gap: 1px; min-width: 0; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.sim-stat:nth-child(-n+2) { grid-column: span 2; }
.sim-stats.no-hp .sim-stat { grid-column: auto; }   /* no Max HP / MP tiles (a build without a base): the first two are STR and MAG, as wide as the rest */
/* a stat that moved: tinted by which way (the user: "differentiate with green and red, fitting the Tokyo Night theme") */
.sim-stat.changed { background: var(--selected); }
.sim-stat.up { background: color-mix(in srgb, var(--up) 15%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 50%, transparent); }
.sim-stat.down { background: color-mix(in srgb, var(--down) 15%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 50%, transparent); }
.sim-stat-label { color: var(--text-2); font-size: 11px; }
.sim-stat-value { font: 600 16px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.sim-stat-delta { font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sim-stat-delta.good { color: var(--good); } .sim-stat-delta.bad { color: var(--bad); }
.sim-stat-delta.same { color: var(--text-3); font-weight: 400; }
.sim-key { display: flex; align-items: center; gap: 8px; min-height: 28px; border-top: 1px solid var(--border); }
.sim-key .sheet-label { flex: 1; }
.sim-key.changed .sheet-label { color: var(--text); font-weight: 600; }
.sim-key .delta { min-width: 5.4em; font-size: 12px; }
.sim-others .chg { font-size: 12px; padding: 5px 0; }
.sim-others .delta { min-width: 5.4em; }
.sim-setnotes { display: grid; gap: 4px; font-size: 12px; }
.sim-setnote.bad b { color: var(--bad); } .sim-setnote.good b { color: var(--good); }

/* the picker */
.sim-pick .dlg-body { gap: 12px; }
.sim-pick .dlg-head { align-items: flex-start; gap: 12px; }
.sim-pick .field-help { margin-top: 3px; }
.sim-pick .search { flex: 1 1 280px; max-width: none; }
.sim-options { height: min(50vh, 440px); overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; display: grid; gap: 1px; align-content: start; }
.sim-opt { display: grid; gap: 2px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.sim-opt[aria-selected="true"] { background: var(--selected); }
/* a row with the item's or crystal's picture on the left */
.sim-opt.with-pic { grid-template-columns: 32px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.sim-opt-body { display: grid; gap: 2px; min-width: 0; }
.sim-opt-pic { margin-top: 1px; }
.sim-opt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sim-opt-lines { color: var(--text-2); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.sim-opt-lines .is-inactive, .sim-opt-lines .is-situational, .sim-opt-lines .is-unknown { color: var(--text-3); }
.sim-opt-lines .sim-hit { color: var(--text); font-weight: 600; }   /* the line the search found: the list is sorted by its number */
.sim-opt-set .q-key { font-size: 12px; }
.sim-more { justify-self: center; margin: 8px 0; }
/* the demon picker in the same dialog: the demon's framed picture, its parts under headings, its skills as icons */
.sim-opt.sim-dopt { grid-template-columns: 44px minmax(0, 1fr) 76px; align-items: start; }
/* the rebirth ranks radar, small, in its own column at the end of the row */
.sim-dradar { align-self: center; justify-self: end; display: grid; place-items: center; }
.sim-dradar .rbp-radar { width: 72px; height: 72px; margin: 0; }
.sim-dpic { align-self: start; }
.sim-dhead { padding: 10px 10px 4px; }
.sim-dhead:first-child { padding-top: 4px; }
.sim-dskills { margin: 0; }
/* skills, Demon Force and equipment in one line (wrapping whole bars when the dialog is narrow), a dot between */
.sim-dbars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 3px; }
.sim-dbars > * { flex-wrap: nowrap; gap: 3px; width: auto; }
.sim-dbars > * + * { position: relative; margin-left: 31px; }
.sim-dbars > * + *::before { content: ""; position: absolute; left: -18px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--text-3); }
.sim-dbars .skill-ico { width: 22px; height: 22px; }
/* Import demon: "Load demons from the game" where the Character Planner has its numbers strip */
.sim-dfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sim-dcount { margin-left: 2px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] .sim-dcount { color: var(--text-2); }
.sim-preview { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 6px; min-height: 52px; font-size: 12px; }
.sim-preview-label { font-weight: 600; }
.sim-chip { display: inline-flex; align-items: baseline; gap: 6px; height: 22px; line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.sim-chip b { font-variant-numeric: tabular-nums; }
.sim-chip.good b { color: var(--good); } .sim-chip.bad b { color: var(--bad); }
/* a chip still being worked out: an empty one of about a real chip's size, a soft light passing over it */
.sim-chip-wait { box-sizing: border-box; background: linear-gradient(90deg, var(--surface-2) 0%, var(--hover) 50%, var(--surface-2) 100%) 0 0 / 300% 100%; animation: sim-wait 1s linear infinite; }
@keyframes sim-wait { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .sim-chip-wait { animation: none; background: var(--surface-2); } }
/* narrow window: what changed first, then the build, then the full stat sheet */
@media (max-width: 1040px) {
  .sim-out { display: contents; }
  .sim-out > * { order: 2; }
  .sim-out > :first-child { order: 0; }
  .sim-edit { order: 1; }
}

/* ---------- Fusion Planner ---------- */
.page-fusion { grid-template-columns: minmax(0, 1fr); }
.fus-body { display: grid; gap: 14px; min-width: 0; }
.fus-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }   /* every card as tall as the tallest */
.fus-slot { min-height: 132px; }
.fus-slot .card-head { min-height: 28px; align-items: center; flex-wrap: nowrap; }   /* the third card's Remove button doesn't make its head taller */
.fus-add { all: unset; box-sizing: border-box; min-height: 132px; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); cursor: pointer; font-size: 12px; padding: 12px; text-align: center; }
.fus-add:hover { color: var(--text); background: var(--hover); }
.fus-add:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fus-combo { position: relative; min-width: 0; }
.fus-combo .search { max-width: none; }
/* a picker's own clear button: as tall as the field and 30px wide, so it is easy to hit (the field's tiny built-in x is
   hidden). On every picker of this kind: the Fusion Planner's demons, the Digitalize Planner's goals, the assistant's demon */
.fus-combo .search.has-clear .input { padding-right: 34px; }
.fus-combo .search.has-clear .input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.fus-clear { all: unset; box-sizing: border-box; position: absolute; top: 2px; right: 2px; bottom: 2px; width: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--text-3); cursor: pointer; }
.fus-clear[hidden] { display: none; }
.fus-clear:hover { color: var(--text); background: var(--hover); }
.fus-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.fus-combo .search .fus-clear svg.icon { position: static; width: 14px; height: 14px; color: inherit; pointer-events: none; }
.fus-target, .toolbar .fus-combo { flex: 1 1 260px; max-width: 420px; }
.fus-menu { position: absolute; z-index: 20; left: 0; min-width: max(100%, 320px); top: calc(100% + 4px); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.fus-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.fus-slots > :nth-child(3) .fus-menu { left: auto; right: 0; }   /* the right-hand slot's list opens leftwards, inside the window */
.fus-opt.on, .fus-opt:hover { background: var(--selected); }
.fus-opt.empty { cursor: default; color: var(--text-2); }
.fus-opt .dcm-icon { margin: 0; width: 24px; height: 24px; }
.fus-opt .dcm-icon img { width: 24px; height: 24px; }
.fus-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fus-pic-big { width: 44px; height: 44px; border-radius: 8px; margin: 0; }
.fus-pic-big img { width: 44px; height: 44px; }
.fus-picked, .fus-out { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fus-picked-text { flex: 1; min-width: 0; }
.fus-out-name { font-size: 15px; font-weight: 600; font-family: var(--font-display); overflow-wrap: anywhere; }
.fus-out .fus-out-name { font-size: 17px; }
.fus-lvl-box { display: grid; gap: 2px; font-size: 11px; color: var(--text-2); }
.fus-lvl { width: 64px; font-variant-numeric: tabular-nums; }
.fus-result { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
:root[data-theme="dark"] .fus-result { border-color: rgba(196, 160, 255, .40); }
.fus-none { color: var(--text-2); }
.fus-how { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text-2); font-size: 13px; }
.fus-plugin { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.fus-plugin svg.icon { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--warn-mark); }
.fus-plugin b { font-weight: 600; }
.fus-plugin ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.fus-sec .card-title { display: inline-flex; align-items: baseline; }
.fus-recipes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }   /* every card in a section the same size, rows aligned */
.fus-rcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.fus-rcard-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.fus-sum { margin-left: auto; }
.fus-rcard .fus-chip { display: flex; width: 100%; max-width: none; height: 42px; }
.fus-rcard .fus-chip-text { flex: 1; }
.fus-chip > .tag { flex: none; }
.fus-rcard .fus-plus { align-self: center; font-size: 12px; line-height: 12px; }
.fus-rcard > .fus-plugin { margin-top: auto; }
.fus-plugin-sm { padding: 6px 8px; font-size: 12px; align-items: center; cursor: help; }
.fus-plugin-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fus-tip-ways { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 2px; }
.fus-plus { color: var(--text-3); font-weight: 600; }
.fus-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); min-width: 0; max-width: 260px; }
button.fus-chip { cursor: pointer; }
button.fus-chip:hover { background: var(--hover); border-color: var(--border-strong); }
button.fus-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fus-chip .dcm-icon { margin: 0; }
.fus-chip-text { display: grid; min-width: 0; line-height: 1.25; }
.fus-chip-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fus-chip-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.tag.fus-up { border-color: transparent; color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.tag.fus-down { border-color: transparent; color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.tag.fus-same { border-style: dashed; }
.fus-foot { margin-top: 4px; }
/* Fusion tree: the whole way to a demon as a pyramid. A demon to get (contract, Summon PG) wears the app's purple tint;
   a demon to fuse is a plain card. Lines are drawn by the list items (top half-borders that meet over each child). */
.chip-btn.ft-fixed { cursor: default; background: var(--selected); border-color: transparent; color: var(--text); }
.chip-btn.ft-fixed:hover { background: var(--selected); }
.ft-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.ft-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: 13px; }
.ft-count b { color: var(--text); font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 2px; }
.ft-gather { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; }
.ft-get { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px 5px 5px; border-radius: 8px; background: var(--selected); cursor: help; }
.ft-get.have { background: none; border: 1px dashed var(--border-strong); }
.ft-get .dcm-icon { margin: 0; }
.ft-get .fus-chip-text { flex: 1; }
.ft-get .fus-chip-sub { overflow: hidden; text-overflow: ellipsis; }
.ft-get:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tag.ft-raise { flex: none; border-color: transparent; background: var(--surface-2); color: var(--text); }
.ft-key { display: inline-block; width: 10px; height: 10px; margin: 0 5px 0 0; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--surface-2); vertical-align: -1px; }
.ft-key.start { background: var(--selected); border-color: transparent; }
.ft-key + .ft-key, .card-sub .ft-key:not(:first-child) { margin-left: 12px; }
.ftree { overflow: auto; max-height: min(72vh, 760px); padding: 6px 0 10px; }
.ftree:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ftree ul { position: relative; display: flex; justify-content: center; margin: 0; padding: 18px 0 0; list-style: none; }
.ftree { cursor: grab; }
.ftree.dragging { cursor: grabbing; user-select: none; }
.ftree-in { display: flex; justify-content: center; width: max-content; min-width: 100%; }
.ftree-in > ul { padding-top: 0; }
.ft-zoom { margin-top: -4px; }
.ftree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 5px 0; }
.ftree-in > ul > li { padding-top: 0; }
.ftree li::before, .ftree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 18px; border-top: 1px solid var(--border-strong); }
.ftree li::after { right: auto; left: 50%; border-left: 1px solid var(--border-strong); }
.ftree li:first-child::before, .ftree li:last-child::after { border-top: 0; }
.ftree li:last-child::before { border-right: 1px solid var(--border-strong); border-top-right-radius: 7px; }
.ftree li:last-child::after { border-left: 0; }
.ftree li:first-child::after { border-top-left-radius: 7px; }
.ftree-in > ul > li::before, .ftree-in > ul > li::after { display: none; }
.ftree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 1px solid var(--border-strong); }
.ft-node { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 164px; height: 42px; padding: 3px 9px 3px 6px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.ft-node.start { border-color: transparent; background: var(--selected); }
.ft-node.have { background: none; border: 1px dashed var(--border-strong); }
.ft-node:hover { box-shadow: 0 0 0 1px var(--border-strong); }
.ft-node.on { box-shadow: 0 0 0 2px var(--focus); }
.ft-node:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ft-node .dcm-icon { margin: 0; }
.ft-node .fus-chip-text { flex: 1; }
.ft-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 164px; margin-top: 4px; }
/* a demon made the same way as one already drawn: a compact card with only its ingredients' pictures, hanging from it by a short line */
.ft-fold { all: unset; box-sizing: border-box; position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; padding: 4px 7px; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface); cursor: pointer; }
.ft-fold::before { content: ''; position: absolute; left: 50%; bottom: 100%; height: 12px; border-left: 1px dashed var(--border-strong); }
.ft-marks + .ft-fold { margin-top: 8px; }
.ft-marks + .ft-fold::before { height: 8px; }
.ft-fold:hover { background: var(--hover); border-style: solid; }
.ft-fold:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ft-fold .fus-plus { font-size: 11px; line-height: 1; }
.ft-orb { display: inline-grid; border-radius: 50%; padding: 1px; box-shadow: 0 0 0 1px var(--border-strong); }
.ft-orb.start { box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 70%, transparent); }
.ft-orb .dcm-icon { margin: 0; width: 22px; height: 22px; border-radius: 50%; }
.ft-orb .dcm-icon img { width: 22px; height: 22px; }
button.tag.ft-refold { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 1; border: 1px dashed var(--border-strong); color: var(--text-2); cursor: pointer; }
button.tag.ft-refold:hover { color: var(--text); background: var(--hover); }
button.tag.ft-refold:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ft-panel { border-color: color-mix(in srgb, var(--focus) 55%, var(--border)); }
.ft-panel .card-head { align-items: center; }
.ft-panel .fus-rcard.ft-cur { border-color: color-mix(in srgb, var(--focus) 55%, var(--border)); }
.ft-way-src { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.ft-use, .ft-inuse, .ft-lost { margin-top: auto; align-self: flex-start; }
.fus-rcard > .fus-plugin + .ft-use, .fus-rcard > .fus-plugin + .ft-inuse, .fus-rcard > .fus-plugin + .ft-lost { margin-top: 4px; }
.ft-inuse { display: inline-flex; align-items: center; gap: 5px; height: 28px; font-size: 12px; font-weight: 600; color: var(--text-2); }
/* a recipe the tree can't take: one of its demons has no way from the starts chosen */
.ft-lost { display: inline-flex; align-items: center; min-height: 28px; max-width: 100%; font-size: 12px; color: var(--text-3); cursor: help; overflow-wrap: anywhere; }
.ft-lost:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ft-panel > .toolbar .search { flex: 1 1 260px; max-width: 420px; }
.ft-inuse svg.icon { width: 14px; height: 14px; }
.ft-steps { margin: 0; padding: 0; list-style: none; counter-reset: ft; display: grid; gap: 4px; }
.ft-steps li { counter-increment: ft; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.ft-steps li:nth-child(odd) { background: var(--surface-2); }
.ft-steps li::before { content: counter(ft); flex: none; width: 22px; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; margin-right: 2px; }
.ft-mini { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ft-mini .dcm-icon { margin: 0; width: 22px; height: 22px; }
.ft-mini .dcm-icon img { width: 22px; height: 22px; }
.ft-mini-name { font-weight: 600; }
.ft-mini-lv { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.ft-arrow { color: var(--text-3); margin: 0 2px; }
@media (max-width: 900px) { .fus-slots { grid-template-columns: minmax(0, 1fr); } .fus-slot, .fus-add { min-height: 0; } }
/* Dungeon Database */
.dun-detail { display: grid; gap: 8px; }
.dun-detail .note { margin: 0; }
.tbl.dun-mobs { background: var(--surface); border-radius: var(--radius-sm); }
.tbl.dun-mobs tr.detail-row > td { background: var(--surface-2); padding-left: 34px; }
.dun-mob { display: grid; gap: 8px; max-width: 900px; }
.dun-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.dun-stat { display: grid; gap: 1px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.dun-stat-k { font-size: 11px; color: var(--text-3); }
.dun-stat-v { font-variant-numeric: tabular-nums; font-weight: 600; }
.dun-aff { display: grid; gap: 4px; }
.dun-aff-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; align-items: center; }
.dun-aff-k { font-size: 12px; color: var(--text-2); }
.tag-boss { border-color: transparent; background: var(--selected); color: var(--text); font-weight: 600; }
.dun-weak { border-color: transparent; background: var(--over-bg); color: var(--over-ink); }
.dun-res { border-color: color-mix(in srgb, var(--aff-res) 60%, transparent); background: color-mix(in srgb, var(--aff-res) 12%, transparent); color: var(--text); }
.dun-nra { border-color: color-mix(in srgb, var(--aff) 60%, transparent); background: color-mix(in srgb, var(--aff) 14%, transparent); color: var(--text); }
.dun-rate { min-width: 56px; font-variant-numeric: tabular-nums; }
/* ---------- Demon Database (Tools) ---------- */
.ddb-select { height: 28px; padding: 0 6px; font-size: 12px; }
.ddb-detail .gdb-block > div { min-width: 0; }
.ddb-lv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ddb-lvnum { width: 64px; height: 26px; }
.ddb-range { width: 180px; accent-color: var(--demon); }
.ddb-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-width: 720px; }
.ddb-stat { display: grid; gap: 1px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ddb-stat b { font-variant-numeric: tabular-nums; font-size: 14px; }
.ddb-aff { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-width: 760px; }
.ddb-aff-cell { display: grid; gap: 1px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; }
.ddb-aff-cell b { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 500; }
.ddb-aff-cell.strong b { color: var(--text); font-weight: 600; }
.ddb-aff-cell.null { border-color: color-mix(in srgb, var(--aff-res) 55%, transparent); background: color-mix(in srgb, var(--aff-res) 12%, var(--surface-2)); }
.ddb-aff-cell.null b { color: var(--text); font-weight: 600; }
.ddb-aff-cell.weak { border-color: color-mix(in srgb, var(--down) 55%, transparent); background: color-mix(in srgb, var(--down) 10%, var(--surface-2)); }
.ddb-aff-cell.weak b { color: var(--down); font-weight: 600; }
.ddb-nra { font-size: 11px; color: var(--aff); font-weight: 600; }
.ddb-skill { display: flex; align-items: flex-start; gap: 8px; }
.ddb-skill > span:last-child { min-width: 0; }
.ddb-skills { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.ddb-desc { display: block; color: var(--text-2); font-size: 12px; white-space: pre-line; }
.ddb-enemy { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 14px; color: var(--text-2); }
.ddb-form { margin-top: 2px; }
/* Skill Database */
.skl-notice { margin-bottom: 0; }
.skl-notice > div { display: grid; gap: 2px; min-width: 0; }
.skl-help { margin: 0 0 6px; color: var(--text-2); white-space: pre-line; max-width: 900px; }
.skl-help:last-child { margin-bottom: 0; }
.skl-tbl .row-btn { align-items: center; }
.skl-tbl td.dim { white-space: nowrap; }
.skl-who { color: var(--text-2); }
.skl-desc { margin: 0; font-size: 13px; color: var(--text); max-width: 640px; }
.skl-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-width: 760px; }
.skl-demons { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 14px; }
.skl-demon { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-radius: 4px; }
.skl-demon:hover b { color: var(--demon); }
.skl-demon:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dun-mobs td.dun-aff-cell { white-space: normal; min-width: 120px; }
.dun-mobs .dun-aff-cell .chips { gap: 4px; }
.dun-skill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dun-skill-name { cursor: help; height: 22px; }
.dun-skill-name:hover, .dun-skill-name:focus-visible { border-color: var(--focus); outline: none; }
.dun-skill { display: inline-grid; border-radius: 6px; cursor: help; }
.dun-skill:hover .dun-skill-pic, .dun-skill:focus-visible .dun-skill-pic { box-shadow: 0 0 0 2px var(--focus); }
.dun-skill:focus-visible { outline: none; }
.dun-skill-pic { display: block; width: 32px; height: 32px; border-radius: 6px; background: var(--hover); }
.tt-head .dun-skill-pic { flex: none; }
.dun-group-row > td { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; font-weight: 600; cursor: pointer; }
.dun-group-row .src-count { font-weight: 400; }
.dun-group-pre { font-weight: 400; color: var(--text-2); }
.tbl tr.dun-in-group > td:first-child { padding-left: 34px; }
.dun-faces { display: inline-flex; align-items: center; gap: 3px; margin-left: 12px; vertical-align: middle; }
.dun-face { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; object-position: 50% 20%; background: var(--surface-2); }
.dun-face.boss { box-shadow: 0 0 0 1.5px var(--focus); }   /* the purple of the Boss tag */
.dun-faces-more { margin-left: 3px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dun-loot-block { display: grid; gap: 6px; }
.dun-loot { display: flex; flex-wrap: wrap; gap: 6px; }
.dun-loot-item { display: inline-grid; justify-items: center; gap: 2px; padding: 4px; min-width: 40px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); cursor: help; }
.dun-loot-item:hover, .dun-loot-item:focus-visible { border-color: var(--focus); outline: none; }
.dun-loot-rate { font-size: 10px; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1; }
.dun-item-pic { display: inline-block; flex: none; border-radius: 4px; background: var(--hover); vertical-align: middle; }
.dun-drop-list li { display: flex; align-items: center; gap: 6px; cursor: help; }
.dun-drop-list li:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
.dun-drop-list .gdb-kind { margin-right: 2px; }
.dun-tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tt-head .dun-item-pic { flex: none; }
.dun-warn { padding: 7px 10px; font-size: 12px; }
.gdb-icon img { object-position: 50% 50%; }

/* ---------- settings: About this version, When something goes wrong (Check my setup) ---------- */
#settings { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.field-wrap { flex-wrap: wrap; }
.about { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 14px; width: 100%; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.about dt { color: var(--text-3); }
.about dd { margin: 0; user-select: text; word-break: break-word; }
/* Settings > Updates: the release notes of the version on offer, and the download's progress */
.upd-notes { width: 100%; max-height: 220px; overflow-y: auto; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 12px; user-select: text; }
.upd-notes-head { font-weight: 600; margin: 6px 0 2px; }
.upd-notes-head:first-child { margin-top: 0; }
.upd-notes ul { margin: 2px 0 4px; padding-left: 18px; }
.upd-notes li { margin: 2px 0; }
.upd-notes p { margin: 2px 0; }
.upd-progress { width: 100%; height: 6px; accent-color: var(--accent); }
.toast-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-row input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; flex: none; }
.checks { width: 100%; display: grid; gap: 4px; }
.checks-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; }
.checks h3 { font: 600 12px/1.3 var(--font); color: var(--text-2); margin: 10px 0 2px; word-break: break-word; }
.check { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.check svg.icon { width: 16px; height: 16px; margin-top: 1px; }
.check-pass svg.icon { color: var(--good); }
.check-warn { background: var(--warn-bg); }
.check-warn svg.icon { color: var(--warn-mark); }
.check-fail { background: var(--err-bg); }
.check-fail svg.icon { color: var(--bad); }
.check-name { font-weight: 600; }
.check-detail { color: var(--text-2); font-size: 12px; word-break: break-word; user-select: text; }
.check-advice { margin-top: 2px; font-size: 12px; word-break: break-word; }
.check-advice b { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Digitalize Planner ---------- */
/* The digitalize pink (--demon) is what the plan adds to a race; your own levels are in the text colour. A race's side
   (Law, Neutral, Chaos) wears the alignment colours, as everywhere else in the app: the map's column names, and in the
   plan each step's card, number, line to the next step and part of the points bar (--side). */
.page-dpl .note.warn { color: var(--over-ink); }
.dpl-rest { display: contents; }
.slot-icon.dpl-orbs { width: 34px; height: 34px; image-rendering: auto; }
.dpl-x { all: unset; box-sizing: border-box; flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--text-3); cursor: pointer; }
.dpl-x:hover { background: var(--hover); color: var(--text); }
.dpl-x:focus-visible { outline: 2px solid var(--focus); }
.dpl-x .icon { width: 14px; height: 14px; }

/* The boost search: a list you tick in. The ones you have are listed last, dimmed, and can't be ticked. */
.tag.dpl-kind { flex: none; min-width: 52px; justify-content: center; }
/* a race's tier in its chip: the higher the tier, the bluer (Tokyo Night blue at tier 5) */
/* a loot-rarity ladder in Tokyo Night colours: grey, cyan, blue, purple, orange */
.dpl-tier { margin-left: 4px; font-weight: 700; color: var(--text-3); }
.dpl-tier[data-tier="1"] { color: #6172b0; }   /* light theme: Tokyo Night Day */
.dpl-tier[data-tier="2"] { color: #007197; }
.dpl-tier[data-tier="3"] { color: #2e7de9; }
.dpl-tier[data-tier="4"] { color: #9854f1; }
.dpl-tier[data-tier="5"] { color: #b15c00; }
:root[data-theme="dark"] .dpl-tier[data-tier="1"] { color: #a9b1d6; }
:root[data-theme="dark"] .dpl-tier[data-tier="2"] { color: #7dcfff; }
:root[data-theme="dark"] .dpl-tier[data-tier="3"] { color: #7aa2f7; }
:root[data-theme="dark"] .dpl-tier[data-tier="4"] { color: #bb9af7; }
:root[data-theme="dark"] .dpl-tier[data-tier="5"] { color: #ff9e64; }
.dpl-menu { max-height: 380px; padding-top: 0; }
.dpl-menu-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -4px 2px; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 34px; box-sizing: border-box; }
.dpl-check { flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-strong); display: inline-grid; place-items: center; }
.dpl-check.ticked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dpl-check .icon { width: 14px; height: 14px; }
.dpl-check.ticked .icon circle { display: none; }
.dpl-check.dpl-check-none { border-color: transparent; }
.fus-opt.dpl-have { opacity: .55; cursor: default; }
.fus-opt.dpl-have:hover { background: none; }

/* Goals: one card per boost (the race's orbs, the boost, its race, the level to reach), in an even grid. */
.dpl-goals, .dpl-suggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.dpl-goal { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.dpl-goal.done { opacity: .6; }
.dpl-goal .dcm-icon { margin: 0; }
.dpl-goal-text { flex: 1; display: grid; gap: 1px; line-height: 1.25; min-width: 0; }
.dpl-goal-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dpl-goal-title b { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpl-goal-title .tag { height: 16px; font-size: 10px; min-width: 0; padding: 0 6px; }
.dpl-lvl { flex: none; width: auto; height: 26px; padding: 0 6px; font-size: 12px; }
/* no goals yet: a headline and a few boosts to click */
.dpl-empty { display: grid; gap: 6px; }
.dpl-empty-title { margin: 0; font: 600 15px/1.3 var(--font-display); }
.dpl-suggs { margin-top: 6px; }
.dpl-sugg { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 10px; cursor: pointer; min-width: 0; }
.dpl-sugg:hover { background: var(--hover); border-style: solid; border-color: color-mix(in srgb, var(--demon) 55%, transparent); }
.dpl-sugg:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dpl-sugg-plus { flex: none; display: inline-grid; color: var(--text-3); }
.dpl-sugg-plus .icon { width: 16px; height: 16px; }
.dpl-sugg:hover .dpl-sugg-plus { color: var(--demon); }

/* The plan: the totals, each step's share of the points as one bar, then the steps down a numbered line. */
.dpl-plan-card { gap: 14px; }
/* the totals: one row of labels, one row of values under it, the values on one baseline (big numbers and the list of races alike) */
.dpl-sum { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 2px 32px; align-items: baseline; }
.dpl-stat { display: contents; }
.dpl-stat b { font: 600 26px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.dpl-stat-list > span:last-child { font-size: 13px; }
.dpl-dpbar { display: flex; gap: 2px; height: 10px; }
.dpl-dpbar i, .dpl-step { --side: var(--text-3); }
.dpl-dpbar i.law, .dpl-step.law { --side: var(--law); }
.dpl-dpbar i.neutral, .dpl-step.neutral { --side: var(--neutral); }
.dpl-dpbar i.chaos, .dpl-step.chaos { --side: var(--chaos); }
.dpl-dpbar i { min-width: 5px; border-radius: 3px; background: var(--side); }   /* the 2px gap keeps same-side neighbours apart */
.dpl-dpbar i:hover, .dpl-dpbar i:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dpl-steps { position: relative; list-style: none; margin: 0; padding: 0 0 0 38px; display: grid; gap: 10px; }
.dpl-step { position: relative; display: grid; gap: 8px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--side) 28%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--side) 9%, var(--surface-2)); }
/* the line from a step's number down to the next one, 4px clear of both numbers; under the last, to the card's foot */
.dpl-step::before { content: ''; position: absolute; left: -26px; top: 44px; bottom: -20px; width: 2px; border-radius: 1px; background: color-mix(in srgb, var(--side) 60%, transparent); }
.dpl-step:last-child::before { bottom: 0; }
.dpl-n { position: absolute; left: -38px; top: 14px; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--side); color: var(--surface); }
.dpl-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* the head's tags: lower-case text sits low in the font's line box, so it is lifted 1px to look centred */
.dpl-step-head .tag { padding-bottom: 1px; }
/* "Mitama-fused demon": the cyan of the game's Mitama mark (as on the demon pictures), apart from the pink demon boosts */
.tag.dpl-mitama { border-color: color-mix(in srgb, #7dcfff 65%, var(--text-3)); background: color-mix(in srgb, #7dcfff 16%, transparent); color: var(--text); }
.dpl-step-name { display: grid; gap: 1px; line-height: 1.25; }
.dpl-step-name b { font-size: 14px; }
.dpl-step-lv { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dpl-arrow { color: var(--demon); font-weight: 600; }
.dpl-dp { font: 600 15px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dpl-line { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; font-size: 12px; }
.dpl-key { color: var(--text-3); padding-top: 2px; }
.dpl-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dpl-tags .tag, .dpl-tbl td .tag { height: auto; min-height: 18px; white-space: normal; padding: 2px 7px; line-height: 1.3; }
.dpl-pics { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.dpl-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.dpl-mini .dcm-icon { width: 22px; height: 22px; margin: 0; }
.dpl-mini .dcm-icon img { width: 22px; height: 22px; }
.card.dpl-done { grid-template-columns: auto 1fr; align-items: center; }
.dpl-done > .icon { width: 28px; height: 28px; color: var(--demon); }
.dpl-done .note { margin: 2px 0 0; }

/* Races: a tile per race, by side (columns) and tier (rows). A locked race is dashed and its orbs greyed. */
.dpl-map-card { overflow-x: auto; }
.dpl-map { display: grid; grid-template-columns: 64px repeat(3, minmax(190px, 1fr)); gap: 8px 10px; align-items: start; }
.dpl-col-head { padding-bottom: 5px; border-bottom: 2px solid color-mix(in srgb, currentColor 45%, transparent); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: center; color: var(--text-2); }
.dpl-col-head.law { color: var(--law); }
.dpl-col-head.neutral { color: var(--neutral); }
.dpl-col-head.chaos { color: var(--chaos); }
.dpl-row-head { display: grid; gap: 1px; padding-top: 10px; font-size: 12px; color: var(--text-2); }
.dpl-row-head b { font-weight: 600; }
.dpl-mult { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dpl-cell { display: grid; gap: 6px; }
.dpl-tile { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; min-width: 0; }
.dpl-tile:hover { background: var(--hover); }
.dpl-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dpl-tile.locked { border-style: dashed; }
.dpl-tile.locked .dpl-tile-head b { color: var(--text-2); }
.dpl-tile.locked .dpl-orbs { filter: grayscale(1); opacity: .5; }
.dpl-tile.planned { border-style: solid; border-color: color-mix(in srgb, var(--demon) 55%, transparent); background: color-mix(in srgb, var(--demon) 6%, var(--surface)); }
.dpl-tile.planned .dpl-orbs { filter: none; opacity: 1; }
.dpl-tile.sel { border-style: solid; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.dpl-tile-body { display: grid; gap: 5px; min-width: 0; }
.dpl-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.dpl-tile-head > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpl-lv { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.dpl-tile.planned .dpl-lv { color: var(--text); font-weight: 600; }
.dpl-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.dpl-bar i { height: 6px; border-radius: 2px; background: var(--grid); }
.dpl-bar i.on, .swatch.dpl-sw-on { background: var(--text-2); }
.dpl-bar i.plan, .swatch.dpl-sw-plan { background: var(--demon); }
.dpl-needs { display: flex; flex-wrap: nowrap; gap: 2px 8px; font-size: 11px; line-height: 15px; color: var(--text-3); overflow: hidden; white-space: nowrap; }
.dpl-needs .met { color: var(--text-2); }
.dpl-needs .met::before { content: '\2713'; margin-right: 3px; }   /* a tick: a need you already meet */

/* One race's levels: yours dimmed, the one you are at marked with a dot, the plan's tinted. */
.dpl-race-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dpl-race-head .card-title { margin: 0; font-size: 15px; }
.dpl-tbl td { font-size: 12px; vertical-align: middle; }
.dpl-tbl td .tag { display: inline-flex; margin: 1px 4px 1px 0; }
.dpl-tbl tr.dpl-have td { color: var(--text-3); }
.dpl-tbl tr.dpl-have .dcm-icon, .dpl-tbl tr.dpl-have .tag { opacity: .6; }
.dpl-tbl tr.dpl-plan-row td { background: color-mix(in srgb, var(--demon) 11%, transparent); }
.dpl-here { margin-right: 6px; font-size: 8px; vertical-align: 2px; color: var(--demon); }
.dpl-assist { color: var(--text-2); }
.dpl-or { margin: 0 6px; font-size: 11px; color: var(--text-3); }
.dpl-tbl td.dpl-act { width: 1%; text-align: right; white-space: nowrap; }

/* the assistant picker (feature "assistant-picker"): under the switch in Settings > Assistant */
.assistant-pick { display: grid; gap: 4px; margin-top: 8px; max-width: 360px; }
.assistant-pick[hidden] { display: none; }

/* the summoning effect when the picker changes demon: the old one goes into the light, the new one comes out of it */
.assistant canvas.summon-fx { position: absolute; pointer-events: none; z-index: 1; }
.assistant canvas.summon-out { animation: summon-out .45s ease-in forwards; }
.assistant canvas.summon-in { animation: summon-in .5s ease-out; }
@keyframes summon-out { to { opacity: 0; filter: brightness(3); } }
@keyframes summon-in { from { opacity: 0; filter: brightness(3.5); } 60% { opacity: 1; } to { opacity: 1; filter: none; } }
/* Key Items (Tools): the English name, "translated" when it is ours, the game's Japanese name greyed under it */
.key-en { font-weight: 600; }
.key-tr { margin-left: 6px; font-size: 11px; color: var(--text-3); border-bottom: 1px dotted var(--text-3); }
.key-jp { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; margin-top: 1px; }
.key-tbl td.key-does { color: var(--text-2); max-width: 520px; }
.key-tbl .tag-nm { margin-left: 4px; }
.key-have { color: var(--aff); border-color: currentColor; }   /* Tokyo Night purple: not one of the data series' colours */
.key-have .icon { width: 12px; height: 12px; margin-right: 3px; vertical-align: -2px; }
.key-detail .q-needs > span:last-child { white-space: pre-line; }
/* ---- Tools: Rebirth Planner ---- */
/* The four Mitama kinds in the game's own colours (its rune bars: Ara red, Nigi blue, Kusi green, Saki yellow), Tokyo Night tones */
:root { --mt-1: #f7768e; --mt-2: #7aa2f7; --mt-3: #9ece6a; --mt-4: #e0af68; --rb: #007197; --rb-ink: #ffffff; --rb-slot: #e8f2f7; }   /* --rb: the planner's own accent, the teal of the game's Rebirth window (Tokyo Night Day cyan on light) */
:root[data-theme="dark"] { --rb: #7dcfff; --rb-ink: #1a1b26; --rb-slot: #16233a; }   /* dark: the game's teal on its navy slots */
.page-rbp .card { gap: 10px; }
.rbp-headright { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rbp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.rbp-pick { flex: 1 1 240px; max-width: 380px; min-width: 0; }
.rbp-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rbp-head-text { display: grid; gap: 3px; min-width: 0; }
.rbp-head-name { display: flex; align-items: baseline; gap: 8px; }
.rbp-head-name b { font-size: 15px; font-family: var(--font-display); }
.rbp-head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; }
.rbp-kv { display: inline-flex; gap: 6px; align-items: baseline; }
.rbp-kindtag { color: var(--k); font-weight: 600; }
.rbp-face { width: 44px; height: 44px; border-radius: 8px; margin: 0; position: relative; }
.rbp-face img { width: 44px; height: 44px; }
.rbp-inputs { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-left: auto; }
.rbp-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.rbp-num { width: 64px; height: 28px; padding: 0 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.rbp-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.rbp-main, .rbp-side { display: grid; gap: 18px; min-width: 0; }
.rbp-side { position: sticky; top: 12px; }
@media (max-width: 1000px) { .rbp-cols { grid-template-columns: minmax(0, 1fr); } .rbp-side { position: static; } }
.rbp-title { display: inline-flex; align-items: center; gap: 10px; }
.rbp-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rb); color: #fff; font: 700 12px/1 var(--font-display); font-style: normal; }
.rbp-rows { display: grid; gap: 2px; }
.rbp-rrow { display: grid; grid-template-columns: 112px 58px auto auto minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 6px 10px; border-radius: 8px; }
.rbp-rrow:nth-child(odd) { background: var(--surface-2); }
.rbp-rrow.up { box-shadow: inset 3px 0 0 var(--rb); }
.rbp-rrow.over { box-shadow: inset 3px 0 0 var(--over-ink); }
.rbp-rname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rbp-rune { font-weight: 600; white-space: nowrap; }
.rbp-own { height: 16px; font-size: 10px; padding: 0 5px; }
.rbp-rnow { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.rbp-bar { display: inline-flex; gap: 3px; }
.rbp-pill { all: unset; box-sizing: border-box; width: 22px; height: 12px; border-radius: 3px; border: 1px solid var(--border-strong); background: transparent; cursor: pointer; }
.rbp-pill.now { background: var(--text-2); border-color: var(--text-2); cursor: default; }
.rbp-pill.plan { background: color-mix(in srgb, var(--rb) 70%, transparent); border-color: var(--rb); }
.rbp-pill.off:hover { border-color: var(--rb); background: color-mix(in srgb, var(--rb) 25%, transparent); }
.rbp-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rbp-slotbar .rbp-pill { cursor: default; }
.rbp-pill.have { background: var(--k); border-color: var(--k); }
.rbp-pill.add { background: repeating-linear-gradient(135deg, var(--k) 0 3px, color-mix(in srgb, var(--k) 35%, transparent) 3px 6px); border-color: var(--k); }
.rbp-pill.locked { border-style: dashed; opacity: .45; }
.rbp-stepper { display: inline-flex; align-items: center; gap: 2px; --k: var(--text-2); }
.rbp-stepper.off { opacity: .35; pointer-events: none; }
.rbp-stepbtn { all: unset; box-sizing: border-box; width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); font-weight: 700; line-height: 1; }
.rbp-stepbtn:hover { background: var(--hover); color: var(--text); }
.rbp-stepbtn:disabled { opacity: .3; cursor: default; }
.rbp-stepbtn:focus-visible { outline: 2px solid var(--focus); }
.rbp-stepval { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; color: var(--k); }
.rbp-rbonus { font-size: 12px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbp-endbtn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 11px; color: var(--text-3); cursor: pointer; white-space: nowrap; }
.rbp-endbtn .icon { width: 14px; height: 14px; }
.rbp-endbtn:hover { background: var(--hover); color: var(--text); }
.rbp-endbtn[aria-pressed="true"] { color: var(--rb); font-weight: 600; }
.rbp-endbtn:focus-visible { outline: 2px solid var(--focus); }
.rbp-sum, .rbp-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; }
.rbp-stat { display: inline-flex; align-items: baseline; gap: 6px; }
.rbp-stat b { font: 600 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.rbp-total .rbp-stat b { font-size: 24px; }
.rbp-stat span { font-size: 12px; color: var(--text-2); }
.rbp-short { color: var(--over-ink); }
.rbp-details { display: grid; gap: 8px; justify-items: start; }
.rbp-items { display: grid; gap: 4px; font-size: 13px; }
.rbp-item-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; color: var(--text-2); }
.rbp-item-list b { color: var(--text); font-weight: 600; }
.rbp-steps { margin: 0; padding-left: 22px; display: grid; gap: 3px; font-size: 13px; }
.rbp-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.rbp-check input { accent-color: var(--rb); }
.rbp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rbp-ptsbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: visible; }
.rbp-ptsbar i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: var(--rb); }
.rbp-ptsbar i.mark { width: 2px; height: 14px; top: -3px; border-radius: 1px; background: var(--text-2); }
.rbp-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.rbp-kind { all: unset; box-sizing: border-box; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; min-width: 0; border-left: 4px solid var(--k); }
.rbp-kind:hover { background: var(--hover); }
.rbp-kind[aria-pressed="true"] { background: color-mix(in srgb, var(--k) 14%, var(--surface)); border-color: var(--k); }
.rbp-kind b { color: var(--k); }
.rbp-kind:focus-visible { outline: 2px solid var(--focus); }
.rbp-caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rbp-cap { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.rbp-cap-name { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k); }
.rbp-cap b { font: 600 18px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.rbp-cap.over b { color: var(--over-ink); }
.rbp-capbar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rbp-capbar i { display: block; height: 100%; background: var(--k); }
.rbp-cap.over .rbp-capbar i { background: var(--over-ink); }
.rbp-ksteps { display: inline-flex; gap: 6px; }
.rbp-sets { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rbp-set { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; color: var(--text-2); cursor: pointer; max-width: 100%; }
.rbp-set:hover { background: var(--hover); color: var(--text); }
.rbp-set.on { background: color-mix(in srgb, var(--rb) 16%, var(--surface)); border-color: var(--rb); color: var(--text); cursor: default; }
.rbp-set.nofit { opacity: .45; cursor: default; }
.rbp-set:focus-visible { outline: 2px solid var(--focus); }
.rbp-set-req { display: inline-flex; gap: 2px; }
.rbp-set-req i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font: 700 10px/1 var(--font-display); font-style: normal; color: var(--k); border: 1px solid var(--k); }
.rbp-set-req i.met { background: var(--k); color: #1a1b26; }
.rbp-set-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbp-costs td { padding: 4px 8px; font-size: 12px; }
.rbp-costs tr td:first-child { color: var(--text-2); }
.rbp-stats th, .rbp-stats td { padding: 5px 8px; font-size: 13px; }
.rbp-stats .num, .rbp-costs .num { text-align: right; font-variant-numeric: tabular-nums; }
.rbp-planned { font-weight: 600; }
.rbp-up { color: var(--rb); font-weight: 600; }
.rbp-down { color: var(--over-ink); }
.rbp-setlines { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-2); display: grid; gap: 2px; }
.rbp-setlines b { color: var(--text); }
@media (max-width: 760px) { .rbp-caps { grid-template-columns: repeat(2, 1fr); } }
.rbp-pill.free, .rbp-pill.off { background: color-mix(in srgb, var(--text-3) 12%, transparent); }
/* "Pick boosts first" */
.rbp-brows { display: grid; gap: 4px; }
.rbp-brow { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; }
.rbp-brow:nth-child(odd) { background: var(--surface-2); }
.rbp-pick { height: 26px; cursor: pointer; }
.rbp-pick.on { cursor: pointer; }
.rbp-pick.over { border-color: var(--over-ink); color: var(--over-ink); }
.rbp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.rbp-kinds-sm { display: inline-flex; gap: 4px; }
.rbp-kinds-sm .rbp-kind { padding: 3px 8px; border-radius: 999px; border-left-width: 1px; }
.rbp-kinds-sm .rbp-kind:disabled { cursor: default; }
.rbp-twobars { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.rbp-ranksbox { display: grid; gap: 4px; }
.rbp-ranks { display: grid; gap: 1px; }
.rbp-rmini { grid-template-columns: 76px auto 24px; padding: 2px 8px; gap: 8px; }
.rbp-rmini .rbp-pill { pointer-events: none; width: 16px; height: 9px; }
.rbp-rank-n { font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
/* the sets as a fixed 4-column grid: every rune has four, so each sits in the same place (muscle memory) */
.rbp-setgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rbp-setgrid .rbp-set { height: auto; min-height: 40px; padding: 5px 8px; border-radius: 8px; align-items: flex-start; }
.rbp-setgrid .rbp-set-req { flex: none; margin-top: 1px; }
.rbp-setgrid .rbp-set-text { white-space: normal; line-height: 1.25; }
.rbp-setgrid .rbp-set.on { box-shadow: inset 0 0 0 1px var(--rb); }
@media (max-width: 760px) { .rbp-setgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rbp-pill.kind { background: var(--k); border-color: var(--k); }   /* after the fusion: the Mitama planned for the slot */
/* the pills as the game draws its slots: a navy box with a teal edge, filled teal when the rank is there */
.rbp-pill { background: var(--rb-slot); border-color: color-mix(in srgb, var(--rb) 55%, transparent); }
.rbp-pill.now { background: var(--rb); border-color: var(--rb); }
.rbp-pill.plan { background: color-mix(in srgb, var(--rb) 45%, var(--rb-slot)); border-color: var(--rb); }
.rbp-pill.off, .rbp-pill.free { background: var(--rb-slot); }
.rbp-pill.off:hover { background: color-mix(in srgb, var(--rb) 30%, var(--rb-slot)); }
.rbp-pill.locked { border-style: dashed; opacity: .4; }
.rbp-step { color: var(--rb-ink); }
.rbp-rrow.up { box-shadow: inset 3px 0 0 var(--rb); }
.rbp-setgrid .rbp-set.on, .rbp-set.on { background: color-mix(in srgb, var(--rb) 14%, var(--surface)); border-color: var(--rb); }
.rbp-ptsbar { background: var(--rb-slot); border: 1px solid color-mix(in srgb, var(--rb) 45%, transparent); }
.rbp-capbar { background: var(--rb-slot); }
.rbp-pill.kind, .rbp-pill.plan.kind, .rbp-pill.now.kind { background: var(--k); border-color: var(--k); }   /* the Mitama's colour wins over the teal (this rule comes last on purpose) */
.rbp-rmini { grid-template-columns: 76px auto auto; }
.rbp-rmini .rbp-pill { pointer-events: auto; cursor: pointer; }
.rbp-rmini .rbp-pill.now { cursor: default; }
.rbp-rmini.raised .rbp-stepval { color: var(--rb); }
.rbp-unraise { justify-self: start; }
/* slotted Mitamas vs planned ranks: a planned rank is a teal-edged box with a light wash; a slotted Mitama is a solid
   gem of its kind with a dark core, and Nigi's blue sits deeper than the teal so the two never read the same */
:root { --mt-2: #4c6fe0; }
:root[data-theme="dark"] { --mt-2: #5d7fe8; }
.rbp-pill.plan { background: color-mix(in srgb, var(--rb) 22%, var(--rb-slot)); border-color: var(--rb); }
.rbp-pill.now { background: color-mix(in srgb, var(--rb) 70%, var(--rb-slot)); border-color: var(--rb); }
.rbp-pill.kind, .rbp-pill.plan.kind, .rbp-pill.now.kind, .rbp-pill.have, .rbp-pill.add { position: relative; background: var(--k); border-color: var(--k); }
.rbp-pill.kind::after, .rbp-pill.have::after, .rbp-pill.add::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 4px; margin: -2px 0 0 -3px; border-radius: 2px; background: var(--rb-slot); opacity: .85; }
.rbp-pill.add { background: repeating-linear-gradient(135deg, var(--k) 0 3px, color-mix(in srgb, var(--k) 40%, var(--rb-slot)) 3px 6px); }
/* slotted Mitamas as bold glossy capsules (the user's pick, 2026-11-27): a strong light edge on top, a dark band below,
   a dark rim so the colour stands off the navy; no core */
.rbp-pill.kind, .rbp-pill.plan.kind, .rbp-pill.now.kind, .rbp-pill.have, .rbp-pill.add { background: var(--k); border: 1px solid rgba(0, 0, 0, .55); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .4); }
.rbp-pill.kind::after, .rbp-pill.have::after, .rbp-pill.add::after { content: none; }
.rbp-pill.add { background: repeating-linear-gradient(135deg, var(--k) 0 3px, color-mix(in srgb, var(--k) 55%, var(--rb-slot)) 3px 6px); }
:root:not([data-theme="dark"]) .rbp-pill.kind, :root:not([data-theme="dark"]) .rbp-pill.have, :root:not([data-theme="dark"]) .rbp-pill.add { border-color: rgba(0, 0, 0, .35); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .28); }
/* ... plus a thin bright border of the Mitama's colour outside the dark rim; the fill, rim and gloss are untouched */
.rbp-pill.kind, .rbp-pill.plan.kind, .rbp-pill.now.kind, .rbp-pill.have, .rbp-pill.add { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .4), 0 0 0 1px color-mix(in srgb, var(--k) 70%, white); }
:root:not([data-theme="dark"]) .rbp-pill.kind, :root:not([data-theme="dark"]) .rbp-pill.have, :root:not([data-theme="dark"]) .rbp-pill.add { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .28), 0 0 0 1px color-mix(in srgb, var(--k) 75%, black); }
/* the four cap bars in the same style: a navy track with the kind's edge, the filled part a glossy capsule with the bright border */
.rbp-capbar { height: 12px; border-radius: 4px; overflow: visible; background: var(--rb-slot); border: 1px solid color-mix(in srgb, var(--k) 45%, transparent); box-sizing: border-box; }
.rbp-capbar i { box-sizing: border-box; height: 12px; margin: -1px 0 0 -1px; border-radius: 4px; background: var(--k); border: 1px solid rgba(0, 0, 0, .55); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .4), 0 0 0 1px color-mix(in srgb, var(--k) 70%, white); min-width: 0; }
.rbp-capbar i[style*="width:0%"] { display: none; }
.rbp-cap.over .rbp-capbar i { background: var(--over-ink); }
:root:not([data-theme="dark"]) .rbp-capbar i { border-color: rgba(0, 0, 0, .35); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .28), 0 0 0 1px color-mix(in srgb, var(--k) 75%, black); }
/* the cap bars: the bright border sits inside the filled part instead of around it, so it stays within the track */
.rbp-capbar { overflow: hidden; }
.rbp-capbar i { margin: -1px 0 0 -1px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 70%, white), inset 0 3px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .4); }
:root:not([data-theme="dark"]) .rbp-capbar i { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 75%, black), inset 0 3px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(0, 0, 0, .28); }
.rbp-namebtn { font: 600 15px/1.3 var(--font-display); margin: 0; padding: 6px 8px 6px 10px; border: 1px solid var(--border-strong); background: var(--surface); }
.rbp-namebtn:hover { background: var(--surface-2); }
#rbp-demons .dm-icon img { width: 32px; height: 32px; display: block; border-radius: 6px; }
/* the demon band as the Overview's: the inputs sit at the right of the band */
.rbp-demon.demon-card { align-items: center; }
.rbp-demon .rbp-inputs { align-self: center; }
.rbp-demon .demon-pic.none { border-color: var(--border-strong); }
.rbp-demons-search { margin: 0 0 6px; max-width: none; }
.rbp-dm-icon { margin: 0; }
.rbp-dm-icon img { width: 32px; height: 32px; }
/* the boosts search lights the matches and dims the rest; nothing is hidden */
.rbp-setgrid .rbp-set.miss { opacity: .35; }
.rbp-setgrid .rbp-set.hit { border-color: var(--rb); box-shadow: inset 0 0 0 1px var(--rb); }
.rbp-demon.demon-card.closed { grid-template-columns: auto minmax(0, 1fr) auto; }
/* every set tile the same size: the kind circles on top, the full text under them (up to three lines) */
.rbp-setgrid .rbp-set { display: grid; grid-template-rows: 16px minmax(0, 1fr); align-items: start; justify-items: start; gap: 4px; height: 64px; padding: 6px 8px; }
.rbp-setgrid .rbp-set-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.25; text-wrap: balance; }
/* picked vs found: a picked tile wears a check in its corner and the teal wash; a tile the search finds gets a purple
   ring and brighter text, the others dim; a picked tile that also matches shows both */
.rbp-setgrid .rbp-set { position: relative; }
.rbp-set-check { position: absolute; right: 5px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--rb); color: var(--rb-ink); display: inline-grid; place-items: center; }
.rbp-set-check .icon { width: 11px; height: 11px; stroke-width: 3; }
.rbp-setgrid .rbp-set.hit { border-color: var(--aff); box-shadow: inset 0 0 0 1px var(--aff); color: var(--text); }
.rbp-setgrid .rbp-set.hit .rbp-set-text { font-weight: 600; }
.rbp-setgrid .rbp-set.on.hit { box-shadow: inset 0 0 0 1px var(--aff), inset 0 0 0 2px var(--rb); }
.rbp-setgrid .rbp-set.on.miss { opacity: .6; }   /* a picked tile the search skips stays readable */
/* a search match in red, not purple (user: purple wasn't enough); Iron Man at the end of the search row */
:root { --rb-hit: #d8365e; }
:root[data-theme="dark"] { --rb-hit: #f7768e; }
.rbp-setgrid .rbp-set.hit { border-color: var(--rb-hit); box-shadow: inset 0 0 0 1px var(--rb-hit); }
.rbp-setgrid .rbp-set.on.hit { box-shadow: inset 0 0 0 1px var(--rb-hit), inset 0 0 0 2px var(--rb); }
.rbp-searchrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.rbp-searchrow .search { flex: 1 1 240px; max-width: none; }
.rbp-searchrow .rbp-check { margin-left: auto; white-space: nowrap; }
/* no check on picked tiles (user): the teal border and wash say it; a match adds the red ring inside it */
.rbp-set-check { display: none; }
.rbp-setgrid .rbp-set.on { border-color: var(--rb); box-shadow: inset 0 0 0 1px var(--rb); }
.rbp-setgrid .rbp-set.on.hit { border-color: var(--rb); box-shadow: inset 0 0 0 1px var(--rb), inset 0 0 0 3px var(--rb-hit); }
/* the Mitama to fuse with, on the demon band of a demon not fused yet: four kind chips (and Auto in the boosts view) */
.rbp-fusewith { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.rbp-fusewith .q-key { margin-right: 2px; }
.rbp-kindchip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--k, var(--text-3)) 60%, transparent); color: var(--k, var(--text-2)); font-size: 11px; font-weight: 600; cursor: pointer; }
.rbp-kindchip:hover { background: color-mix(in srgb, var(--k, var(--text-3)) 15%, transparent); }
.rbp-kindchip[aria-pressed="true"] { background: var(--k, var(--text-2)); color: #1a1b26; border-color: var(--k, var(--text-2)); }
.rbp-kindauto[aria-pressed="true"] { background: var(--text-2); color: var(--bg); border-color: var(--text-2); }
.rbp-kindchip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* the game's own pictures: rune glyphs (white, tinted to the text colour) and the Mitama kinds' counters */
.rbp-runeicon { width: 18px; height: 18px; flex: none; opacity: .85; image-rendering: auto; }
:root:not([data-theme="dark"]) .rbp-runeicon { filter: invert(1); opacity: .7; }
.rbp-rname { display: inline-flex; align-items: center; gap: 6px; }
.rbp-kindicon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; vertical-align: -3px; }
.rbp-cap-name { display: inline-flex; align-items: center; gap: 5px; }
.rbp-kindchip .rbp-kindicon { width: 14px; height: 14px; margin-left: -4px; margin-right: 3px; }
.rbp-kind-name { display: inline-flex; align-items: center; gap: 6px; }
.rbp-kstep { display: inline-flex; align-items: center; gap: 2px; }
.rbp-kstep .rbp-kindicon { width: 14px; height: 14px; }
/* cost pictures: four runes or four Mitamas as a cluster of orbs, the apple, the macca sign */
.rbp-total .rbp-stat { gap: 8px; }
.rbp-orbs { width: 34px; height: 34px; align-self: center; margin-right: 2px; image-rendering: auto; }
.rbp-orbs img { background: var(--rb-slot); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rb) 45%, transparent); }
.rbp-orbs-runes img { padding: 2px; box-sizing: border-box; }
:root:not([data-theme="dark"]) .rbp-orbs-runes img { filter: invert(1); background: #1a2b4c; }
.rbp-costicon { width: 24px; height: 24px; align-self: center; image-rendering: pixelated; }
.rbp-costicon.rbp-macca { width: 28px; height: 16px; image-rendering: pixelated; }
:root:not([data-theme="dark"]) .rbp-costicon.rbp-macca { filter: invert(1); }
/* cap tiles: name and count left, the Mitama's picture right, the bar under both */
.rbp-cap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rbp-cap-text { display: grid; gap: 2px; }
.rbp-cap-top .rbp-kindicon { width: 26px; height: 26px; }
.rbp-costicon.rbp-macca { width: 24px; height: 24px; filter: none; }   /* the Macca item's coin, same size as the apple */
:root:not([data-theme="dark"]) .rbp-costicon.rbp-macca { filter: none; }
/* the cost table's header: the pictures of the three numbers, small, right-aligned over their columns */
.rbp-costs thead th { padding: 2px 8px 4px; background: transparent; position: static; }
.rbp-costs thead th.num { text-align: right; }
.rbp-costs thead th .rbp-orbs-sm { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.rbp-costs thead th .rbp-orbs-sm img { width: 12px; height: 12px; }
.rbp-costs thead th .orbs-4.rbp-orbs-sm img:nth-child(1) { left: 0; top: 0; } .rbp-costs thead th .orbs-4.rbp-orbs-sm img:nth-child(2) { left: 10px; top: 0; } .rbp-costs thead th .orbs-4.rbp-orbs-sm img:nth-child(3) { left: 0; top: 10px; } .rbp-costs thead th .orbs-4.rbp-orbs-sm img:nth-child(4) { left: 10px; top: 10px; }
.rbp-costs thead th .rbp-costicon-sm { width: 18px; height: 18px; vertical-align: middle; }
/* the Mitama demons' faces on the bigger tiles: 32 px native, no scaling, so they stay sharp */
.rbp-kindface { width: 32px; height: 32px; flex: none; border-radius: 6px; image-rendering: auto; }
.rbp-cap-top .rbp-kindface { box-shadow: 0 0 0 1px color-mix(in srgb, var(--k) 60%, transparent); }
.rbp-kindface { width: 29px; height: 29px; }   /* square again, 10% smaller (user) */
/* the cost items under the per-step table: the item's icon, its name, how many */
.rbp-needs { display: grid; gap: 6px; }
.rbp-needlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rbp-needlist li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.rbp-need-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.rbp-needlist b { font-variant-numeric: tabular-nums; }
.rbp-itemicon { width: 24px; height: 24px; image-rendering: pixelated; border-radius: 4px; }
.rbp-itemicon-none { display: inline-block; background: var(--surface-2); }
/* the kind-of-item selector over the cost items; a pick swipes the list in from the left */
.rbp-needs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.rbp-kindpick { justify-self: end; }
.rbp-kindpick button { height: 22px; padding: 0 8px; font-size: 11px; }
.rbp-needlist.swipe { animation: rbp-swipe .28s ease-out; }
@keyframes rbp-swipe { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rbp-needlist.swipe { animation: none; } }
/* the runestone list scrolls past about eight rows, so the sticky cost card stays short */
.rbp-needlist { max-height: 212px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
/* the same thin scrollbar as the Overview's demon picker (#demons .char-list) on the runestone list and the planner's own picker */
.rbp-needlist::-webkit-scrollbar, #rbp-demons .char-list::-webkit-scrollbar, .sim-dpick .sim-options::-webkit-scrollbar { width: 8px; }
.rbp-needlist::-webkit-scrollbar-thumb, #rbp-demons .char-list::-webkit-scrollbar-thumb, .sim-dpick .sim-options::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
.rbp-needlist { padding-right: 0; }
#rbp-demons .menu-note:empty { display: none; }   /* no note under the Any-demon list */

/* Dungeon Guides (Tools): per dungeon its outcomes, each with numbered steps (the Quest Guide's step list and lines) */
.guide-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.guide-tag-hidden { color: var(--aff); border-color: currentColor; }   /* the one tag to spot first: a boss you only get by doing something */
.guide-detail { gap: 14px; }
.guide-prep { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.guide-out { display: grid; gap: 4px; }
.guide-res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.guide-res-text { font-weight: 600; }
.guide-res .src-count { margin-left: 0; }
.guide-steps > li { padding-top: 8px; padding-bottom: 8px; gap: 3px; }
.guide-steps > li::before { top: 8px; }
.guide-do { max-width: 80ch; }
.guide-steps .q-line, .guide-prep .q-line, .guide-fails { grid-template-columns: 92px minmax(0, 1fr); }
.guide-steps .q-line > span:last-child, .guide-prep .q-line > span:last-child { color: var(--text-2); max-width: 80ch; }
.guide-fails > span:last-child { color: var(--warn-ink); max-width: 80ch; }
.guide-linear { margin-top: 4px; }
.guide-linear summary { cursor: pointer; font-weight: 600; }
.guide-linear summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.guide-linear .note { margin: 6px 0 0; max-width: 110ch; }
/* one row per outcome (a way the dungeon can go): closed rows stack as a list, an open one shows its steps under it */
.guide-outs { display: grid; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.guide-outs > .guide-out { padding: 8px 10px; }
.guide-outs > .guide-out + .guide-out { border-top: 1px solid var(--border); }
.guide-out-btn { display: flex; width: 100%; box-sizing: border-box; }
.guide-out-btn:hover .guide-res-text { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.guide-out.open > .q-steps { margin-left: 22px; }
.guide-out.open > .guide-fails { margin-left: 22px; }
/* The rune view, revamped (2026-11-27): each phase is one grid with a header row and subgrid rows, so the bars, steppers
   and bonuses of the twelve runes line up and the header names every column. The "ends on" flag is a radio; the rank
   points toward the fusion sit under step 1's rows; the fusion is a switch; the ranks after the fusion and the Mitama
   slots are one step (a rank is a slot) */
.rbp-rows { display: grid; grid-template-columns: 112px auto auto minmax(0, 1fr) auto; gap: 2px 0; }
.rbp-rows.has-now { grid-template-columns: 112px auto auto auto minmax(0, 1fr) auto; }
.rbp-rows > .rbp-rrow, .rbp-rows > .rbp-colhead { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; column-gap: 14px; row-gap: 6px; padding: 6px 10px; border-radius: 8px; }
.rbp-rows > .rbp-rrow:nth-child(even) { background: var(--surface-2); }
.rbp-rows > .rbp-rrow:nth-child(odd) { background: transparent; }
.rbp-rows > .rbp-colhead { padding: 0 10px 4px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.rbp-colhead .span2 { grid-column: span 2; }
.rbp-colhead span[data-tip] { cursor: help; }
.rbp-rnow { font-variant-numeric: tabular-nums; text-align: center; color: var(--text-2); }
.rbp-rrow > .rbp-mrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 16px; }
.rbp-mrow .rbp-ksteps { flex: none; padding-top: 3px; }
.rbp-mrow .rbp-sets { flex: 1 1 400px; min-width: 0; }
.rbp-rname .src-count { margin-left: 0; font-size: 11px; }
.rbp-pill { width: 24px; height: 13px; }
.rbp-how { max-width: none; }
.rbp-quick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rbp-quick .chips { gap: 4px; }
.rbp-quick .chip-btn { height: 24px; padding: 0 9px; font-size: 11px; }
/* the rank points toward the fusion */
.rbp-points { display: grid; gap: 6px; padding-top: 2px; }
.rbp-points-text { display: flex; align-items: baseline; gap: 8px; }
.rbp-points-text b { font: 600 18px/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--rb); }
.rbp-points:not(.ok) .rbp-points-text b { color: var(--over-ink); }
.rbp-points-text span { font-size: 12px; color: var(--text-2); }
.rbp-points:not(.ok) .rbp-ptsbar i:not(.mark) { background: var(--over-ink); }
/* "ends on" as a radio */
.rbp-endbtn { gap: 6px; padding: 0 6px 0 4px; }
.rbp-endph { display: inline-block; height: 22px; }
.rbp-rows > .rbp-rrow { min-height: 34px; box-sizing: border-box; }   /* padding 6 + the 22 px radio + 6: the height whether or not a rune is raised */
.rbp-radio { box-sizing: border-box; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-3); flex: none; }
.rbp-endbtn:hover .rbp-radio { border-color: var(--rb); }
.rbp-endbtn[aria-checked="true"] { color: var(--rb); font-weight: 600; }
.rbp-endbtn[aria-checked="true"] .rbp-radio { border-color: var(--rb); background: var(--rb); box-shadow: inset 0 0 0 2.5px var(--surface); }
.rbp-rows > .rbp-rrow:nth-child(even) .rbp-endbtn[aria-checked="true"] .rbp-radio { box-shadow: inset 0 0 0 2.5px var(--surface-2); }
/* the fusion switch and the gate before it */
.rbp-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.rbp-switch .switch:checked { background: var(--rb); }
.rbp-switch input:checked + span { color: var(--text); font-weight: 600; }
.rbp-switch.off { opacity: .55; cursor: default; }
.rbp-gate { display: grid; gap: 8px; justify-items: start; }
.rbp-kind .src-count { white-space: normal; margin-left: 0; line-height: 1.3; }
@media (max-width: 900px) {
  .rbp-rows, .rbp-rows.has-now { grid-template-columns: 100px auto minmax(0, 1fr); }
  .rbp-rows > .rbp-colhead, .rbp-rnow { display: none; }
  .rbp-rbonus, .rbp-endbtn, .rbp-ksteps { grid-column: 1 / -1; }
}
/* the Mitamas to get (step 3): a tile per kind with how many, where they come from and the random bonus each one rolls */
.rbp-gets { display: grid; gap: 6px; }
.rbp-getlist { display: grid; gap: 6px; }
.rbp-get { display: grid; gap: 5px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); box-shadow: inset 3px 0 0 var(--k); }
.rbp-get-head { display: flex; align-items: center; gap: 8px; }
.rbp-get-head b { color: var(--k); }
.rbp-get-head .rbp-kindface { width: 24px; height: 24px; }
.rbp-get-ways { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; }
.rbp-get-way { display: inline-flex; gap: 6px; align-items: baseline; }
.rbp-get-pool { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rbp-poolchip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a phase's totals as a strip of tiles with the cost card's pictures (user, 2026-11-27) */
.rbp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: stretch; }
.rbp-sumtile { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.rbp-sumtile .rbp-orbs, .rbp-sumtile .rbp-costicon, .rbp-sumblank { flex: none; width: 30px; height: 30px; margin: 0; align-self: center; }
.rbp-sumtile .rbp-costicon { width: 26px; height: 26px; }
.rbp-sumblank { display: inline-block; width: 0; }
.rbp-sumtext { display: grid; gap: 1px; min-width: 0; }
.rbp-sumtile b { font: 600 18px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.rbp-sumtile span { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbp-sumsub { color: var(--text-3); white-space: inherit; }   /* inline after the label, on its one ellipsed line */
.rbp-sumtile[data-tip] { cursor: help; }
/* "What it all costs" under the steps (experiment, 2026-11-27): bigger total tiles, a step-by-step table with a "what" column, the items to gather as a grid */
.rbp-costcard { gap: 14px; }
.rbp-sum-big .rbp-sumtile { min-height: 58px; }
.rbp-sum-big .rbp-sumtile b { font-size: 22px; }
.rbp-sum-big .rbp-sumtile .rbp-orbs, .rbp-sum-big .rbp-sumtile .rbp-costicon { width: 34px; height: 34px; }
.rbp-costs-wide td { vertical-align: top; padding: 7px 8px; }
.rbp-costs-wide tr td:first-child { color: var(--text); }
.rbp-cost-step { white-space: nowrap; }
.rbp-cost-step > span { display: inline-flex; align-items: center; gap: 8px; }
.rbp-costs-wide td, .rbp-costs-wide th { vertical-align: top; }
.rbp-cost-step .rbp-step { width: 18px; height: 18px; font-size: 11px; }
.rbp-cost-what { color: var(--text-2); font-size: 12px; line-height: 1.4; min-width: 0; }
.rbp-costs-wide tfoot td { border-top: 1px solid var(--border); font-weight: 600; }
.rbp-costs-wide thead th { text-align: left; }
.rbp-costs-wide thead th.num { text-align: right; }
.rbp-gather { display: grid; gap: 12px; }
.rbp-gather-group { display: grid; gap: 6px; }
.rbp-itemgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 8px; }
.rbp-itemtile { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 8px 3px 4px; border-radius: 6px; font-size: 12px; background: var(--surface-2); min-width: 0; }
.rbp-itemtile b { font-variant-numeric: tabular-nums; }
.rbp-itemtile .rbp-kindface { width: 24px; height: 24px; border-radius: 4px; }
/* the rebirth cluster is three glyphs, not four (user, 2026-11-27): the small header version needs its own places */
.rbp-costs thead th .orbs-3.rbp-orbs-sm img:nth-child(1) { left: 5px; top: 0; } .rbp-costs thead th .orbs-3.rbp-orbs-sm img:nth-child(2) { left: 0; top: 10px; } .rbp-costs thead th .orbs-3.rbp-orbs-sm img:nth-child(3) { left: 10px; top: 10px; }
.rbp-gather-sub { display: grid; gap: 4px; margin-top: 4px; }
/* a Summon PG tile's picture: the PG card with the Mitama it summons as an orb cluster (user, 2026-11-27); Sacred Soul: the four Mitamas with the card on top */
.rbp-itemtile { grid-template-columns: auto minmax(0, 1fr) auto; }
.rbp-itemtile .rbp-orbs-pg { width: 34px; height: 34px; margin: 0; }
.orbs-5 img:nth-child(1) { left: 0; top: 0; } .orbs-5 img:nth-child(2) { left: 16px; top: 0; } .orbs-5 img:nth-child(3) { left: 0; top: 16px; } .orbs-5 img:nth-child(4) { left: 16px; top: 16px; } .orbs-5 img:nth-child(5) { left: 8px; top: 8px; z-index: 1; box-shadow: 0 0 0 2px var(--surface-2); }
/* paying for the rebirths: a column per rank with its item options as tiles, one picked (user, 2026-11-27) */
.rbp-rankgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.rbp-rankcol { display: grid; gap: 4px; align-content: start; padding: 6px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.rbp-rankcol.idle { opacity: .55; }
.rbp-rankcol-head { display: grid; gap: 1px; padding: 0 2px 3px; }
.rbp-rankcol-head b { font-size: 12px; }
.rbp-rankcol-head .src-count { margin: 0; font-size: 11px; white-space: normal; }
.rbp-rankopt { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; min-width: 0; }
.rbp-rankopt:hover { background: var(--hover); }
.rbp-rankopt[aria-pressed="true"] { background: color-mix(in srgb, var(--rb) 14%, var(--surface)); border-color: var(--rb); }
.rbp-rankopt:focus-visible { outline: 2px solid var(--focus); }
.rbp-rankopt-text { display: grid; gap: 1px; min-width: 0; }
.rbp-rankopt-name { font-size: 11px; line-height: 1.2; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rbp-rankopt[aria-pressed="true"] .rbp-rankopt-name { color: var(--text); }
.rbp-rankopt b { font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 1300px) { .rbp-rankgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rbp-pgrows { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* a PG per row, its gems (or Fighting Spirit) beside it */
/* the Skills step: the bar of eight slots as the game draws it, what each holds under it, the demon's other skills as chips */
.rbp-skillbar { display: flex; flex-wrap: wrap; gap: 6px; }
.rbp-skillslot { all: unset; box-sizing: border-box; position: relative; width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.rbp-skillslot:hover { border-color: var(--rb); }
.rbp-skillslot.swapped { border-color: var(--rb); box-shadow: inset 0 0 0 1px var(--rb); }
.rbp-skillslot.empty { border-style: dashed; }
.rbp-skillslot:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rbp-skillpic { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; display: block; background: var(--hover); }
.rbp-skillpic img { display: block; width: 100%; height: 100%; }
.rbp-skillnone { display: grid; place-items: center; color: var(--text-3); font-size: 20px; background: transparent; }
/* an empty slot's plus, drawn as two bars so it sits in the exact middle (a "+" glyph sat low: user, 2026-11-27) */
.rbp-plus { background: linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat; }
/* a list row of an empty slot: a dashed square where the item's picture would be (the rows have no slot numbers) */
.rbp-rowblank { width: 24px; height: 24px; flex: none; box-sizing: border-box; border: 1px dashed var(--border-strong); border-radius: 4px; }
.rbp-rowblank.locked { border-style: solid; border-color: var(--border); background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hover) 3px 6px); }
.rbp-skilllist { gap: 4px; }
.rbp-skills .rbp-skilllist, .rbp-force .rbp-skilllist { margin-left: 8px; }   /* the list under a bar, set in a little (user, 2026-11-27) */
.rbp-skillrow { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rbp-skillrow.empty { color: var(--text-3); margin: 0; max-width: none; gap: 8px; }   /* not the page-wide .empty (an empty state, 8vh down) */
.rbp-slotno-text { width: 14px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.rbp-skilltext { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.rbp-skilltext .src-count { margin: 0; }
.rbp-skillfrom { color: var(--text-3); }
.rbp-skillfrom.got { color: var(--rb); }
.rbp-skillrest { display: grid; gap: 6px; }
.rbp-skillchip { height: 26px; padding-left: 5px; }
/* a gallery card's compact bars: the icons only, a tip on each (user, 2026-11-27) */
.rbp-minibars { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; }   /* the rows on the left, the ranks radar on the right */
.rbp-minirows { display: grid; gap: 6px; min-width: 0; }
.rbp-miniranks { display: grid; gap: 0; justify-items: start; }
.rbp-minibar { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.rbp-minibar-title { font-size: 11px; color: var(--text-3); }
.rbp-minislots { display: flex; gap: 3px; flex-wrap: wrap; min-width: 0; }
.rbp-mini { width: 22px; height: 22px; flex: none; box-sizing: border-box; border-radius: 4px; overflow: hidden; background: var(--hover); display: grid; place-items: center; }
.rbp-mini:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rbp-mini-blank { background: transparent; border: 1px dashed var(--border-strong); }
.rbp-mini-locked { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hover) 3px 6px); border: 1px solid var(--border); }
.rbp-mini-bad { box-shadow: 0 0 0 1px var(--over-mark); }
.rbp-mini-fused { box-shadow: 0 0 0 1px var(--df-fused); }
.rbp-mini-pic { display: block; width: 100%; height: 100%; }
.rbp-mini-pic img { display: block; width: 100%; height: 100%; }
.rbp-mini-q { display: grid; place-items: center; font-size: 12px; color: var(--text-3); }
/* the Demon Force step: the same bar; a slot the form doesn't open is a hatched, inactive square */
.rbp-forceslot.locked { cursor: not-allowed; border-style: solid; border-color: var(--border); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--hover) 5px 10px); }
.rbp-forceslot.locked:hover { border-color: var(--border); }
.rbp-forceslot.bad { border-color: var(--over-mark); box-shadow: inset 0 0 0 1px var(--over-mark); }
.rbp-forceico { width: 24px; height: 24px; flex: none; border-radius: 4px; overflow: hidden; background: var(--hover); }
.rbp-forceico img, .rbp-forceimg { display: block; width: 100%; height: 100%; }
.rbp-forcebad { color: var(--over-ink); }
/* the slots the Mitama fusion opens (past what the demon's own type opens): yellow as in the game, in the bar and in the list (user, 2026-11-27: not purple) */
:root { --df-fused: #8f5e15; }   /* Tokyo Night Day yellow */
:root[data-theme="dark"] { --df-fused: #e0af68; }   /* Tokyo Night yellow */
.rbp-forceslot.fused { background: color-mix(in srgb, var(--df-fused) 14%, var(--surface-2)); }
.rbp-forceslot.fused:not(.swapped):not(.bad) { border-color: color-mix(in srgb, var(--df-fused) 75%, transparent); color: var(--df-fused); }
.rbp-forceslot.fused:not(.swapped):not(.bad):hover { border-color: var(--df-fused); }
.rbp-forceslot.fused .rbp-plus { color: var(--df-fused); }
.rbp-rowblank.fused { border-color: color-mix(in srgb, var(--df-fused) 75%, transparent); background: color-mix(in srgb, var(--df-fused) 14%, transparent); }
.rbp-forceico.fused { box-shadow: 0 0 0 1px var(--df-fused); }
.rbp-fusedtag { color: var(--df-fused); }
.rbp-chip-ico { width: 18px; height: 18px; border-radius: 3px; overflow: hidden; display: inline-block; }
.rbp-chip-ico img { width: 100%; height: 100%; display: block; }
/* the cost card's skills: each price as item pictures with the amount, one line per way with where it is (user, 2026-11-27) */
.rbp-skillcosts { gap: 8px; }
.rbp-skillcost { display: grid; gap: 4px; }
.rbp-ways { display: grid; gap: 3px; padding-left: 32px; }
.rbp-way { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; }
.rbp-way-items { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rbp-way-where { color: var(--text-3); }
.rbp-way-needs { flex-basis: 100%; margin: 0; white-space: normal; }   /* what the exchange asks of the demon, on its own line under the way */
.rbp-pricetile { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; border-radius: 6px; background: var(--surface-2); font-size: 11px; cursor: help; }
.rbp-pricetile .rbp-itemicon { width: 20px; height: 20px; }
.rbp-pricetile b { font-variant-numeric: tabular-nums; }
/* the cost card's sections (Rebirth items, Mitamas, Skills to get) as proper sub-headings, their shops as smaller ones (user, 2026-11-27: too small) */
.rbp-gather { gap: 16px; }
.rbp-gather-group > .q-key { display: block; font-size: 14px; font-weight: 600; color: var(--text); padding: 10px 0 2px; border-top: 1px solid var(--border); }
.rbp-gather-sub > .q-key { font-size: 12px; font-weight: 600; color: var(--text-2); padding-top: 2px; }
/* the Demon equipment step: a row per feature slot, its square (the part's picture, or + on an empty one) as the skill bar's */
.rbp-eqlist { gap: 6px; }
.rbp-eqrow { align-items: flex-start; }   /* the text starts level with the top of its square (user, 2026-11-27) */
.rbp-eqslot { flex: none; }
.rbp-eqslot.bad { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.rbp-eqimg { display: block; width: 40px; height: 40px; border-radius: 6px; }
.rbp-eqfeat.covered { text-decoration: line-through; text-decoration-color: var(--text-3); }
.rbp-eqfeat.none { color: var(--text-3); }
.rbp-eqbad { color: var(--bad); flex-basis: 100%; }
.rbp-eqrow .rbp-skillfrom.got { flex-basis: 100%; }
.rbp-skillcost .skill-ico img { display: block; width: 24px; height: 24px; border-radius: 4px; }
#rbp-equip-menu .dm-icon img { width: 32px; height: 32px; display: block; border-radius: 6px; }
#rbp-equip-menu .char.rbp-eqoff { opacity: .5; cursor: not-allowed; }
#rbp-equip-menu .menu-note:empty { display: none; }
.rbp-eqrow .rbp-skilltext, .rbp-skillcost .rbp-skilltext { flex: 1 1 auto; }
.rbp-eqrow .src-count, .rbp-skillcost .src-count { white-space: normal; }   /* a part's or feature's description wraps inside the card (.src-count is nowrap) */
.rbp-eqdesc { flex-basis: 100%; }   /* a feature's description on its own line under its name, as a long part description falls (user, 2026-11-27) */
/* the stats card's Boosts: every effect of the skills, features and parts that isn't one of the 14 stats, per who it reaches */
.rbp-fx { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.rbp-fxgroup { display: grid; gap: 4px; }
.rbp-fxgroup > .q-key { font-size: 12px; font-weight: 600; color: var(--text-2); }
.rbp-fxlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rbp-fxlist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.rbp-fxlist li:hover { background: var(--hover); }
.rbp-fxlabel { flex: 1 1 auto; min-width: 0; }
.rbp-fxlist b { font-variant-numeric: tabular-nums; color: var(--rb); }
.rbp-fxlist li.cond .rbp-fxlabel { color: var(--text-2); }
.rbp-fxnote { flex-basis: 100%; color: var(--text-3); }

/* Dungeon Guides (Tools): per dungeon its outcomes, each with numbered steps (the Quest Guide's step list and lines) */
.guide-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.guide-tag-hidden { color: var(--aff); border-color: currentColor; }   /* the one tag to spot first: a boss you only get by doing something */
.guide-detail { gap: 14px; }
.guide-prep { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.guide-out { display: grid; gap: 4px; }
.guide-res { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.guide-res-text { font-weight: 600; }
.guide-res .src-count { margin-left: 0; }
.guide-steps > li { padding-top: 8px; padding-bottom: 8px; gap: 3px; }
.guide-steps > li::before { top: 8px; }
.guide-do { max-width: 80ch; }
.guide-steps .q-line, .guide-prep .q-line, .guide-fails { grid-template-columns: 92px minmax(0, 1fr); }
.guide-steps .q-line > span:last-child, .guide-prep .q-line > span:last-child { color: var(--text-2); max-width: 80ch; }
.guide-fails > span:last-child { color: var(--warn-ink); max-width: 80ch; }
.guide-linear { margin-top: 4px; }
.guide-linear summary { cursor: pointer; font-weight: 600; }
.guide-linear summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.guide-linear .note { margin: 6px 0 0; max-width: 110ch; }
/* one row per outcome (a way the dungeon can go): closed rows stack as a list, an open one shows its steps under it */
.guide-outs { display: grid; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.guide-outs > .guide-out { padding: 8px 10px; }
.guide-outs > .guide-out + .guide-out { border-top: 1px solid var(--border); }
.guide-out-btn { display: flex; width: 100%; box-sizing: border-box; }
.guide-out-btn:hover .guide-res-text { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.guide-out.open > .q-steps { margin-left: 22px; }
.guide-out.open > .guide-fails { margin-left: 22px; }
/* the Demon Planner's builds: the gallery's cards (the Build Planner's, with the demon's picture where the pieces are) */
.rbp-build-pic { width: 45px; height: 45px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; align-self: start; }
.rbp-build-pic.none { opacity: .5; }
.rbp-build-img { display: block; width: 45px; height: 45px; }
.rbp-build-img img { width: 45px; height: 45px; display: block; }
.sim-build.rbp-build:not(.sim-new) { min-height: 110px; }
.rbp-builds .sim-new { min-height: 110px; }

/* a gallery card in two rows: the demon (picture, name, level, chips) on top, what it holds (bars) under it, then when it was saved */
.sim-build.rbp-build:not(.sim-new) { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.rbp-builds { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* three cards to a row (user, 2026-11-27) */
@media (max-width: 620px) { .rbp-builds { grid-template-columns: minmax(0, 1fr); } }
.sim-build.rbp-build { container-type: inline-size; }
@container (max-width: 415px) { .rbp-minibar { grid-template-columns: minmax(0, 1fr); gap: 3px; } }   /* a narrower card: each label over its icons */
@container (max-width: 331px) { .rbp-minibars { grid-template-columns: minmax(0, 1fr); row-gap: 10px; } }   /* a narrow card: the radar under the rows */
.rbp-build-top { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
.rbp-build-bars { display: block; }
.rbp-build-pic { position: relative; }
.rbp-build-pic .mitama-mark { position: absolute; left: 3px; top: 3px; box-sizing: content-box; width: 10px; height: 10px; border: 1px solid #1a2b4c; background: #1a2b4c; }
.rbp-build-pic .mitama-mark::before { content: ''; position: absolute; inset: 0; background: #7dcfff; -webkit-mask: var(--mark) center / 100% 100% no-repeat; mask: var(--mark) center / 100% 100% no-repeat; }
.rbp-build .rbp-fusewith { margin-left: 0; }
.rbp-build .rbp-kindchip { cursor: inherit; }
.rbp-mini .rbp-eqimg { display: block; width: 100%; height: 100%; }

/* every scrollbar on the Demon Planner page follows the sidebar's (.nav): the page itself, the pickers' lists, the sidebar's list of builds and the
   Import / Share dialog's list (user, 2026-11-27: a rule for this page; a new scrolling list here takes the same two lines) */
.main:has(.page-rbp)::-webkit-scrollbar, #rbp-skills-list::-webkit-scrollbar, #rbp-force-list::-webkit-scrollbar, #rbp-equip-list::-webkit-scrollbar, .nav-sub::-webkit-scrollbar, #sim-code .sim-code-list::-webkit-scrollbar { width: 8px; }
.main:has(.page-rbp)::-webkit-scrollbar-thumb, #rbp-skills-list::-webkit-scrollbar-thumb, #rbp-force-list::-webkit-scrollbar-thumb, #rbp-equip-list::-webkit-scrollbar-thumb, .nav-sub::-webkit-scrollbar-thumb, #sim-code .sim-code-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }

/* the ranks radar of a gallery card: before the Mitama fusion (the planner's teal) and after it (purple), one colour per series */
.rbp-radar-wrap { display: grid; justify-items: center; gap: 2px; border-radius: 6px; min-width: 0; }
.rbp-radar-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rbp-radar { display: block; width: 100px; height: 100px; margin: 5px 0; }   /* 5 px above and below (user) */
.rbp-radar-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.rbp-radar-pre { --c: var(--rb); }
.rbp-radar-post { --c: var(--aff); }
.rbp-radar-area { fill: var(--c); opacity: .16; }
.rbp-radar-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.rbp-radar-ico { opacity: .85; }
:root:not([data-theme="dark"]) .rbp-radar-ico { filter: invert(1); opacity: .7; }
.rbp-radar-name { fill: var(--text-3); font-size: 9px; }
.rbp-radar-keys { display: grid; gap: 4px; font-size: 11px; color: var(--text-2); }
.rbp-radar-key { display: inline-flex; align-items: center; gap: 6px; }
.rbp-radar-key i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.rbp-radar-key b { color: var(--text); font-variant-numeric: tabular-nums; }
/* A name BABEL translated because the game has it only in Japanese (skill-db.json / demon-db.json `ja`): greyed out */
.tl-name, .char-name.tl-name, .row-btn .tl-name, .tag.tl-name, td.tl-name, .ddb-desc.tl-name, .gdb-block.tl-name li { color: var(--text-3); }
.tl-note { font-style: italic; }

/* ---------- History: the graph and its list of stats ---------- */
.hist-page { grid-template-columns: minmax(0, 1fr); }   /* the page's one column may be narrower than the table: the table scrolls sideways instead of widening the page */
.hist-row { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: stretch; }
.hist-row .chart { min-height: 415px; }
.card.hist-pick { position: relative; padding: 0; min-height: 0; }
.hist-pick-in { position: absolute; inset: 0; overflow-y: auto; padding: 4px 6px 8px; }
.hist-pick-in::-webkit-scrollbar { width: 8px; }
.hist-pick-in::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 4px; background: var(--border-strong); background-clip: content-box; }
.hist-pick-head { position: sticky; top: -4px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; margin: 0 -6px; padding: 0 12px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; }
.hist-group { font: 600 11px/1.3 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 10px 6px 2px; }
.hist-opt { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.hist-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hist-opt:hover { background: var(--hover); }
.hist-opt input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); }
.hist-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-opt.on .hist-name { font-weight: 600; }
.hist-val { color: var(--text-3); font-size: 12px; }
.hist-sw { display: block; flex: none; }
.tbl th .hist-sw { display: inline-block; vertical-align: middle; margin-right: 4px; }
.hist-tip { display: grid; gap: 3px; min-width: 190px; }
.hist-tip-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.hist-delta { margin-left: 10px; display: inline-block; }
.hist-delta .delta { min-width: 0; font-weight: 500; font-size: 12px; }
.tbl th.hist-act, .tbl td.hist-act { width: 1%; white-space: nowrap; text-align: right; }
.tbl td.hist-act { padding-top: 4px; padding-bottom: 4px; }
.hist-act .btn-square { width: 34px; height: 34px; padding: 0; }   /* (.btn-sm's side padding would squeeze the icon) */
.hist-act .btn-square svg.icon { width: 20px; height: 20px; }
.tbl td:first-child { white-space: nowrap; }
.hist-ask { display: inline-flex; align-items: center; gap: 8px; }
tr.hist-asking td { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
@media (max-width: 820px) { .hist-row { grid-template-columns: minmax(0, 1fr); } .hist-pick { height: 415px; } }

/* The website (WEB in app.js): what only the desktop app can do is not shown */
html.web [data-desktop] { display: none !important; }
