/* Slam or Buy: the design system (design/DESIGN.md, tokens and components from design/mockups/build.py) plus the
   live page's own pieces at the end. Every colour is a token on :root; light only (no night mode). */

/* ---- tokens -------------------------------------------------------------------------------------------------- */
:root {
  --bg: #f6f6f7; --surface: #ffffff; --surface-2: #f1f1f3; --surface-3: #e9e9ec;
  --ink: #18181b; --ink-2: #52525b; --ink-3: #85858f; --line: #e4e4e7; --line-strong: #cfcfd4;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #d9f3ef; --focus: #0f766e;
  --primary: #18181b; --primary-ink: #ffffff;
  --buy: #15803d; --buy-soft: #dcfce7; --craft: #b45309; --craft-soft: #fdebc8; --close: #475569; --close-soft: #e2e8f0;
  --danger: #b91c1c; --danger-soft: #fee2e2; --warn: #92400e; --warn-soft: #fef3c7;
  /* PoE2 semantic colours: the canonical hue as a swatch, a readable ink for text on this theme */
  --poe-normal: #c8c8c8; --poe-magic: #8888ff; --poe-rare: #ffff77; --poe-unique: #af6025;
  --rarity-normal: #52525b; --rarity-magic: #4a4ad1; --rarity-rare: #8a6d00; --rarity-unique: #a3581e;
  --mod-magic: #4a4ad1; --mod-bone: #1f7a4a; --mod-fractured: #8a6d2e;
  --attr-str: #dc2626; --attr-dex: #16a34a; --attr-int: #2563eb;
  --hit: #15803d; --hit-soft: #dcfce7; --junk: #85858f; --open: #a1a1aa;
  --art-well: #ececef; --art-glow: rgba(255,255,255,0); --art-bright: 1.3;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-18: 18px; --fs-22: 22px; --fs-28: 28px; --fs-36: 36px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --r-1: 0; --r-2: 2px; --r-3: 2px;  /* square edges, as on dogear3: 0 for boxes, 2px for controls */
  --shadow-1: 0 1px 2px rgba(0,0,0,.06); --shadow-2: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --t-fast: 120ms ease-out; --t-med: 200ms ease-out;
  --col: 640px; --gutter: 16px; --tap: 44px;
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- base ----------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-16)/1.5 var(--font); font-feature-settings: "tnum"; min-height: 100vh; overflow-x: hidden; }
a { color: var(--ink); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-28); font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: var(--fs-18); font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: var(--fs-14); font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .sm { font-size: var(--fs-14); } .xs { font-size: var(--fs-13); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }

/* ---- top bar -------------------------------------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-3); height: 52px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 650; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; flex: none; }
@media (max-width: 720px) { .crumbs a, .crumbs span { display: none; } .crumbs b::before { content: "› "; color: var(--ink-3); font-weight: 400; } }
.brand img { width: 20px; height: 20px; border-radius: var(--r-1); display: block; }
.crumbs { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-3); font-size: var(--fs-14); min-width: 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; } @media (hover: hover) { .crumbs a:hover { color: var(--ink); text-decoration: underline; } }
.crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }

/* ---- layout --------------------------------------------------------------------------------------------------- */
.page { max-width: var(--col); margin: 0 auto; padding: var(--s-6) var(--gutter) 120px; display: grid; gap: var(--s-5); }
.page.wide { max-width: 1080px; }
.page.answered { max-width: 1200px; grid-template-columns: 380px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.page.answered > .ask { position: sticky; top: 68px; display: grid; gap: var(--s-4); }
.item-summary { display: none; }
@media (max-width: 960px) {
  .page.answered { grid-template-columns: 1fr; } .page.answered > .ask { position: static; } .page.answered .ask-only { display: none; }
  .page.answered > .ask .item { display: none; }
  .item-summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 10px 12px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); border-left: 3px solid var(--poe-rare); }
  .item-summary .art { width: 40px; height: 40px; display: grid; place-items: center; background: var(--art-well); border-radius: var(--r-1); } .item-summary .art img { max-width: 32px; max-height: 36px; object-fit: contain; }
  .item-summary > span:nth-child(2) { display: block; min-width: 0; }
  .item-summary b { display: block; font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .item-summary .lines-sum { font-size: var(--fs-13); color: var(--mod-magic); font-weight: 550; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.stack { display: grid; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }

/* ---- controls ------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); color: var(--ink); font-weight: 550; font-size: var(--fs-14); cursor: pointer; text-decoration: none; transition: background var(--t-fast), border-color var(--t-fast); white-space: nowrap; }
@media (hover: hover) { .btn:hover { background: var(--surface-2); } }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-size: var(--fs-16); min-height: 48px; padding: 0 var(--s-5); }
@media (hover: hover) { .btn.primary:hover { opacity: .92; } }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); } @media (hover: hover) { .btn.ghost:hover { background: var(--surface-2); color: var(--ink); } }
.btn.lg { min-height: 48px; font-size: var(--fs-16); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: var(--fs-14); }
@media (hover: hover) { .link:hover { color: var(--ink); } }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); font-size: var(--fs-13); font-weight: 500; color: var(--ink-2); cursor: pointer; text-decoration: none; }
@media (hover: hover) { .pill:hover { border-color: var(--line-strong); color: var(--ink); } }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--r-2); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge.tier { background: var(--surface-3); color: var(--ink-2); font-family: var(--mono); font-weight: 600; cursor: help; }
.badge.bone { background: color-mix(in srgb, var(--mod-bone) 14%, transparent); color: var(--mod-bone); }
.badge.essence { background: var(--surface-3); color: var(--ink-2); }
.badge.fractured { background: color-mix(in srgb, var(--mod-fractured) 16%, transparent); color: var(--mod-fractured); }
.badge.have { background: var(--hit-soft); color: var(--hit); }
.badge.conf-high { background: var(--buy-soft); color: var(--buy); } .badge.conf-medium { background: var(--craft-soft); color: var(--craft); } .badge.conf-low { background: var(--close-soft); color: var(--close); }
.badge.rare { background: color-mix(in srgb, var(--poe-rare) 35%, var(--surface)); color: var(--rarity-rare); }
.badge.magic { background: color-mix(in srgb, var(--poe-magic) 22%, var(--surface)); color: var(--rarity-magic); }
.badge.normal { background: var(--surface-3); color: var(--rarity-normal); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-3); border-radius: var(--r-1); border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-14); color: var(--ink); text-decoration: none; cursor: pointer; }
@media (hover: hover) { .chip:hover { border-color: var(--line-strong); background: var(--surface-2); } }
.chip .ico { width: 18px; height: 18px; }
input[type=search], input[type=text], textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); color: var(--ink); font: inherit; }
textarea { font: 500 13px/1.45 var(--mono); min-height: 140px; resize: vertical; }
.ico { display: inline-block; width: 22px; height: 22px; background-size: contain; background-repeat: no-repeat; background-position: center; vertical-align: -6px; flex: none; }
.ico.lg { width: 36px; height: 36px; }
/* line marks: an essence-only line's essence, the desecration ◆ (in the bone-mod colour) before the line's text */
.lm { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; }
.mrow i.lm, .pk-sec .lm { margin: 0; }

/* ---- cards ---------------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-1); }
.card > .pad { padding: var(--s-4); }
.card .hd { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.callout { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-1); font-size: var(--fs-14); }
.callout.warn { background: var(--warn-soft); color: var(--warn); } .callout.info { background: var(--surface-2); color: var(--ink-2); }
.callout b { color: inherit; }

/* ---- start: the type search over one compact list of every item type ------------------------------------------- */
.hero { display: grid; gap: var(--s-2); }
.hero p { color: var(--ink-2); font-size: var(--fs-16); max-width: 60ch; }
.hero .league { font-size: var(--fs-14); }
.hero .league b { color: var(--ink); font-weight: 600; }
.hero .league span { white-space: nowrap; }
.trows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-3); align-items: start; padding: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.trow .art { width: 40px; height: 40px; display: grid; place-items: center; background: var(--art-well); border-radius: var(--r-1); }
.trow .art img { max-width: 32px; max-height: 36px; object-fit: contain; }
.trow .tmain { display: grid; gap: var(--s-2); min-width: 0; }
.trow .thead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-2); }
.trow .name { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: var(--fs-16); color: var(--ink); cursor: pointer; text-align: left; min-height: 28px; }
@media (hover: hover) { .trow .name:hover { text-decoration: underline; } }
.trow .meta { color: var(--ink-3); font-size: 12px; }
/* the variants are tabs on a hairline, like the picker's: a view switch, not a button like the starts under them;
   the pick is ink under a 2px rule in its attributes' colours (split for Dex/Int). One line always: under 960px the
   strip leaves the art column, and the one strip that still overflows (body armour's seven) scrolls under a fade
   with the pick in view (fitStrips); the hairline is inset so it spans the visible width, never the scrolled one */
.trow .tvar { position: relative; display: flex; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.trow .tvar::-webkit-scrollbar { display: none; }
.tvar .seg { position: relative; flex: none; min-height: 32px; padding: 0 10px; border: 0; background: none; font-size: var(--fs-13); font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tvar .seg:focus-visible { outline-offset: -2px; }  /* inside the strip's clip */
.tvar .seg.on { color: var(--ink); }
.tvar .rule { position: absolute; left: 0; right: 0; bottom: 0; display: flex; height: 2px; }
.tvar .rule i { flex: 1; }
.tvar .a-str { background: var(--attr-str); } .tvar .a-dex { background: var(--attr-dex); } .tvar .a-int { background: var(--attr-int); }
.tvar.scrolls::before, .tvar.scrolls::after { content: ""; flex: none; position: sticky; z-index: 1; width: 24px; pointer-events: none; opacity: 0; transition: opacity var(--t-fast); }
.tvar.scrolls::before { left: 0; margin-right: -24px; background: linear-gradient(90deg, var(--surface), transparent); }
.tvar.scrolls::after { right: 0; background: linear-gradient(90deg, transparent, var(--surface)); }
.tvar.scrolled::before, .tvar.more::after { opacity: 1; }
@media (max-width: 960px) {
  .trow { row-gap: var(--s-2); }
  .trow .tmain { display: contents; }
  .trow .thead { grid-column: 2; }
  .trow .tvar, .trow .tex { grid-column: 1 / -1; }
}
@media (max-width: 720px) { .tvar .seg { min-height: 40px; padding: 0 var(--s-2); } }
.trow .tex { display: flex; flex-wrap: wrap; gap: 6px; }
.trow .tex .pill::after { content: "→"; content: "→" / ""; color: var(--ink-3); transition: color var(--t-fast), transform var(--t-fast); }
.trow .pill { min-height: 36px; color: var(--ink); }
.trow .pill.start { border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); background: transparent; }
@media (max-width: 720px) { .trows { grid-template-columns: 1fr; } .trow .pill { min-height: 40px; } }

/* ---- the item builder card ------------------------------------------------------------------------------------ */
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-1); overflow: hidden; }
.item .head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s-3); align-items: center; padding: var(--s-4); border-bottom: 1px solid var(--line); border-top: 3px solid var(--poe-rare); }
.item.magic .head { border-top-color: var(--poe-magic); } .item.normal .head { border-top-color: var(--poe-normal); }
.item .head .art { width: 56px; height: 56px; display: grid; place-items: center; background: var(--art-well); border-radius: var(--r-1); }
.item .head .art img { max-width: 48px; max-height: 52px; object-fit: contain; }
.item .head .title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-weight: 650; font-size: var(--fs-18); letter-spacing: -.005em; }
.item .head .sub { color: var(--ink-2); font-size: var(--fs-14); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.item .head .sub .link { font-size: var(--fs-13); }
.item .ilvl { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); background: var(--surface-2); font-size: var(--fs-14); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.item .ilvl b { color: var(--ink); font-weight: 600; }
.item .implicit { padding: 8px var(--s-4); font-size: var(--fs-14); color: var(--mod-magic); border-bottom: 1px solid var(--line); display: flex; gap: var(--s-2); align-items: center; }
.item .implicit .badge { margin-left: auto; }
.side { padding: var(--s-3) var(--s-4) var(--s-4); display: grid; gap: var(--s-2); }
.side + .side { border-top: 1px solid var(--line); }
.side .label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 2px; }
.slot { display: grid; gap: var(--s-2); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); }
.slot.empty { display: flex; align-items: center; justify-content: center; min-height: var(--tap); border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); font-size: var(--fs-14); font-weight: 500; cursor: pointer; background: transparent; text-decoration: none; }
@media (hover: hover) { .slot.empty:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); } }
.slot.have { border-color: color-mix(in srgb, var(--hit) 40%, var(--line)); background: color-mix(in srgb, var(--hit-soft) 45%, var(--surface)); }
.slot .line { display: flex; align-items: flex-start; gap: var(--s-2); }
.slot .line .txt { flex: 1 1 auto; min-width: 0; color: var(--mod-magic); font-weight: 550; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.slot .line .txt.bone { color: var(--mod-bone); }
.slot .x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-3); cursor: pointer; position: relative; }
.slot .x::after { content: ""; position: absolute; inset: -8px; } @media (hover: hover) { .slot .x:hover { background: var(--surface-2); color: var(--danger); } }
/* tier selector: the chosen range first, "T2 or better" as a small badge; tap to expand the ladder */
.tier { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tier .range { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2); font-size: var(--fs-13); color: var(--ink); cursor: pointer; }
@media (hover: hover) { .tier .range:hover { border-color: var(--line-strong); } }
.tier .range b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tier .range .caret { color: var(--ink-3); font-size: 11px; }
.tier .hint { font-size: var(--fs-13); color: var(--ink-3); }
.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--cell, 72px), 100%), 1fr)); gap: 4px; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2); }
.ladder button { display: grid; gap: 1px; justify-items: center; min-height: 44px; padding: 5px 4px; border: 1px solid transparent; border-radius: var(--r-1); background: var(--surface); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.ladder button b { font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.ladder button .v { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ladder button.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); } .ladder button.on b { color: var(--accent); }
.ladder button.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); } .ladder button.sel .v { font-weight: 600; }
.ladder button.raises .v::after { content: " ↑"; color: var(--ink-3); font-size: 10px; }
.ladder-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--s-2); font-size: 12px; color: var(--ink-3); padding: 2px 2px 0; }
.group { display: grid; gap: var(--s-2); padding: var(--s-2); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--r-2); background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.group .glabel { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); padding: 2px 4px; font-size: var(--fs-13); font-weight: 600; color: var(--accent); }
.group .slot { background: var(--surface); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--ink-2); cursor: pointer; }
.toggle i { width: 30px; height: 18px; border-radius: var(--r-2); background: var(--accent); position: relative; display: inline-block; }
.toggle i::after { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: var(--r-2); background: #fff; }
.toggle.off i { background: var(--line-strong); } .toggle.off i::after { right: auto; left: 2px; }
.askbar { display: grid; gap: var(--s-2); }
.askbar .note { font-size: var(--fs-13); color: var(--ink-3); text-align: center; }
@media (max-width: 720px) { .askbar.sticky { position: sticky; bottom: 0; z-index: 15; margin: 0 calc(var(--gutter) * -1); padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); } }
.under { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; font-size: var(--fs-14); color: var(--ink-2); }

/* ---- picker: popover on desktop, bottom sheet on phones -------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); }
.picker { position: fixed; z-index: 50; width: 440px; max-height: 70vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-3); box-shadow: var(--shadow-2); overflow: hidden; }
.picker .search { padding: var(--s-3); border-bottom: 1px solid var(--line); }
.picker .tabs { display: flex; gap: 4px; padding: 6px var(--s-3); border-bottom: 1px solid var(--line); }
.picker .tabs button { min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-2); font-size: var(--fs-13); font-weight: 550; cursor: pointer; }
.picker .tabs button.on { background: var(--surface-3); color: var(--ink); }
.picker .tabs span { margin-left: auto; align-self: center; font-size: 12px; color: var(--ink-3); }
.picker .list { overflow: auto; overscroll-behavior: contain; padding: var(--s-2); }
.pk-sec { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.pk-row { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: var(--tap); padding: 8px 10px; border: 0; border-radius: var(--r-1); background: transparent; text-align: left; cursor: pointer; }
@media (hover: hover) { .pk-row:hover, .pk-row.active { background: var(--surface-2); } }
.pk-row .txt { flex: 1 1 auto; min-width: 0; color: var(--mod-magic); font-weight: 550; font-size: var(--fs-14); line-height: 1.3; }
.pk-row .txt.bone { color: var(--mod-bone); }
.pk-row .note { flex: none; font-size: 12px; color: var(--ink-3); text-align: right; max-width: 42%; }
.pk-row.off { cursor: default; opacity: .55; } .pk-row.off .txt { color: var(--ink-2); } .pk-row.off .note { color: var(--danger); opacity: 1; }
@media (max-width: 720px) { .picker { left: 0 !important; right: 0; width: auto; max-height: 82vh; border-radius: var(--r-3) var(--r-3) 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); } .picker::before { content: ""; justify-self: center; width: 36px; height: 4px; margin: 8px auto 0; border-radius: var(--r-2); background: var(--line-strong); grid-row: 0; } }

/* ---- progress ------------------------------------------------------------------------------------------------- */
.progress { display: grid; gap: var(--s-3); padding: var(--s-5) var(--s-4); }
.bar { height: 8px; border-radius: var(--r-1); background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; width: 42%; border-radius: var(--r-1); background: var(--accent); transition: width 400ms ease; }
.stages { display: flex; gap: var(--s-4); font-size: var(--fs-13); color: var(--ink-3); flex-wrap: wrap; }
.stages .done { color: var(--ink-2); } .stages .done::before { content: "✓ "; color: var(--accent); }
.stages .now { color: var(--ink); font-weight: 600; }

/* ---- answer --------------------------------------------------------------------------------------------------- */
.verdict { display: grid; gap: var(--s-3); padding: var(--s-5) var(--s-4); border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--close); }
.verdict.buy::before { background: var(--buy); } .verdict.craft::before { background: var(--craft); }
.verdict .word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.verdict .word .w { font-size: var(--fs-36); font-weight: 750; letter-spacing: -.02em; line-height: 1.05; color: var(--close); }
.verdict.buy .word .w { color: var(--buy); } .verdict.craft .word .w { color: var(--craft); }
.verdict .word .price { font-size: var(--fs-22); font-weight: 600; letter-spacing: -.01em; }
.verdict .say { font-size: var(--fs-16); color: var(--ink-2); max-width: 64ch; }
.verdict .say b { color: var(--ink); font-weight: 600; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s-3); align-items: center; }
.vs .side-price { display: grid; gap: 2px; padding: var(--s-3); border-radius: var(--r-1); background: var(--surface-2); }
.vs .side-price small { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.vs .side-price b { font-size: var(--fs-22); font-weight: 650; letter-spacing: -.01em; }
.vs .side-price.pick { outline: 2px solid currentColor; outline-offset: -2px; }
.vs .side-price .faint { font-size: 12px; }
.vs .or { color: var(--ink-3); font-size: var(--fs-13); font-weight: 600; }
@media (max-width: 420px) { .vs { grid-template-columns: 1fr; } .vs .or { display: none; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-2); }
.stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-1); background: var(--surface-2); min-width: 0; }
.stat small { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.stat b { font-size: var(--fs-18); font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .faint { font-size: 12px; }
.range3 { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: var(--s-2); }
.range3 .stat:nth-child(2) { box-shadow: inset 0 0 0 1px var(--line-strong); }
.lines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lines li { display: flex; gap: var(--s-2); align-items: baseline; font-size: var(--fs-14); color: var(--mod-magic); font-weight: 550; }
.lines li .badge { flex: none; }
.lines li.plain { color: var(--ink-2); font-weight: 400; }
.fold { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.fold > summary { display: flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: 0 var(--s-4); cursor: pointer; list-style: none; font-weight: 600; font-size: 15px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; color: var(--ink-3); font-size: 12px; transition: transform var(--t-fast); }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary { color: var(--ink); }
.fold > summary .faint { font-weight: 400; margin-left: auto; font-size: var(--fs-13); color: var(--ink-2); }
.fold > .inner { padding: 0 var(--s-4) var(--s-4); display: grid; gap: var(--s-4); }
.fold.quiet { border-style: dashed; }

/* ---- step card ------------------------------------------------------------------------------------------------ */
.step { display: grid; gap: var(--s-4); }
.step .meta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.step .meta .where { font-size: var(--fs-13); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.mini { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; background: var(--surface); }
.mini .mh { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--poe-rare); font-size: var(--fs-14); }
.mini .mh img { width: 28px; height: 28px; object-fit: contain; }
.mini.magic .mh { border-top-color: var(--poe-magic); } .mini.normal .mh { border-top-color: var(--poe-normal); }
.mini .mh b { font-weight: 600; } .mini .mh .faint { margin-left: auto; font-size: 12px; white-space: nowrap; }
.mini .ms { padding: 6px 12px 8px; display: grid; gap: 2px; }
.mini .ms + .ms { border-top: 1px solid var(--line); }
.mini .ms small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 4px 0 2px; }
.mrow { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 8px; border-radius: var(--r-1); font-size: var(--fs-14); }
.mrow.hit { color: var(--mod-magic); font-weight: 550; background: var(--hit-soft); box-shadow: inset 2px 0 0 var(--hit); }
.mrow.hit::after { content: "✓"; margin-left: auto; color: var(--hit); font-weight: 700; font-size: 12px; }
.mrow.junk { color: var(--junk); } .mrow.open { color: var(--open); font-style: italic; } .mrow.low { color: var(--junk); } .mrow.low i { color: var(--craft); font-style: normal; font-size: 12px; margin-left: auto; }
.mrow.unrevealed { color: var(--mod-bone); font-style: italic; } .mrow.new { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink-3); }
.move { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--s-3); align-items: start; padding: var(--s-3); border-radius: var(--r-2); background: var(--surface-2); }
.move .ico { width: 44px; height: 44px; }
.move .name { font-weight: 650; font-size: var(--fs-16); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.move .name .cost { font-weight: 500; color: var(--ink-2); font-size: var(--fs-14); }
.move .how { color: var(--ink-2); font-size: var(--fs-14); margin-top: 4px; }
.move .how b { color: var(--ink); font-weight: 600; }
.ask-what { font-weight: 600; font-size: 15px; }
.outcomes { display: grid; gap: var(--s-2); }
.outcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); text-align: left; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
@media (hover: hover) { .outcome:hover { border-color: var(--ink-3); background: var(--surface-2); } }
.outcome { text-decoration: none; color: inherit; }
.outcome .what { grid-column: 1; grid-row: 1; font-weight: 600; font-size: 15px; } .outcome .what .txt { color: var(--mod-magic); }
.outcome .then { grid-column: 1; grid-row: 2; font-size: var(--fs-13); color: var(--ink-2); }
.outcome .odds { grid-column: 2; grid-row: 1 / span 2; justify-self: end; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-13); color: var(--ink-2); }
.outcome .odds b { display: block; font-size: var(--fs-16); color: var(--ink); font-weight: 650; }
.outcome.done { border-color: color-mix(in srgb, var(--hit) 55%, var(--line)); background: color-mix(in srgb, var(--hit-soft) 40%, var(--surface)); } .outcome.done .odds b { color: var(--hit); }
.outcome.sell { border-color: var(--line); } .outcome.sell .what { color: var(--ink-2); }
.tally { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-13); color: var(--ink-2); }
.tally .acts { display: flex; gap: var(--s-2); }
.timeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.timeline i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-2); background: var(--line-strong); } .timeline i.done { background: var(--accent); } .timeline i.now { background: var(--ink); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: var(--s-3); align-items: center; padding: 10px 14px; background: var(--primary); color: var(--primary-ink); border-radius: var(--r-2); box-shadow: var(--shadow-2); font-size: var(--fs-14); max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; padding: 0; }


/* ---- the live page: pieces the mockups only drew ------------------------------------------------------------- */
.brand { background: none; border: 0; padding: 0; color: var(--ink); font-size: var(--fs-16); cursor: pointer; }
.crumbs button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
@media (hover: hover) { .crumbs button:hover { color: var(--ink); text-decoration: underline; } }
@media (max-width: 720px) { .crumbs button, .crumbs span { display: none; } }
abbr.g { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help; }
.callout.danger { background: var(--danger-soft); color: var(--danger); }
.callout.ok { background: var(--buy-soft); color: var(--buy); }
.hint { color: var(--ink-3); font-size: var(--fs-13); }
.stack > *, .page > * { min-width: 0; }

/* screens: one question per screen */
.page[data-screen="start"] { max-width: 1080px; }
.page[data-screen="start"] .ask, .page[data-screen="start"] .answer { display: none; }
.page:not([data-screen="start"]) section.start { display: none; }
section.start { display: grid; gap: var(--s-5); }
.build-head { display: grid; gap: var(--s-2); }
.build-head h1 { font-size: var(--fs-22); }
.build-head .head-acts { display: flex; gap: var(--s-4); align-items: baseline; white-space: nowrap; }
.ask { display: grid; gap: var(--s-4); }
.page.answered > .ask { max-height: calc(100vh - 84px); overflow: auto; overscroll-behavior: contain; padding: 2px; }
.page.answered .build-head, .page.answered .suggest { display: none; }
@media (max-width: 960px) {
  .page.answered > .ask { max-height: none; overflow: visible; }
  .page.answered:not(.editing) > .ask > :not(.item-summary) { display: none; }
  .page.answered.editing > .ask .item { display: block; }
  .page.answered.editing .item-summary { display: none; }
}
button.item-summary { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.item-summary .btn { pointer-events: none; }

/* the pasted item (a fold that moves between the start screen and the builder) */
.own > summary .faint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.own textarea { min-height: 120px; }
#own-home .own { border-style: solid; }
.suggest { gap: var(--s-2); }
.suggest .pill { min-height: 36px; color: var(--mod-magic); font-weight: 550; }

/* item card */
.item .head .title .tname { min-width: 0; }
.item .ilvl .link, .item .head .sub .link { min-height: 28px; }
.item .implicit { flex-wrap: wrap; }
.side .label .what { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.side .rows { display: grid; gap: var(--s-2); }
.slot .line .txt { background: none; border: 0; padding: 0; font: inherit; font-weight: 550; font-size: 15px; text-align: left; cursor: pointer; color: var(--mod-magic); }
.slot .why { font-size: var(--fs-13); color: var(--danger); }
.slot.blocked { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.slot .keep { min-height: 32px; }
.slot .kept-off { color: var(--ink-3); text-decoration: line-through; }
.slot.empty.res2 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line-strong)); }
.tier .best { min-height: 32px; font-size: var(--fs-13); }
.tier .range .badge.tier { margin-left: 2px; }
.ladder button.locked { opacity: .45; cursor: not-allowed; }
.ladder button.best-cell { grid-column: 1 / -1; min-height: 36px; }
.group .glabel .toggle { min-height: 32px; }
.group .slot { padding: 8px 12px; }
.group .slot .line .txt { cursor: default; }
.group .glabel .x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-3); cursor: pointer; position: relative; }
.group .glabel .x::after { content: ""; position: absolute; inset: -8px; } @media (hover: hover) { .group .glabel .x:hover { background: var(--surface-2); color: var(--danger); } }
.group .glabel > span:first-child { flex: 1; }
.toggle { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-13); }
.toggle:disabled { opacity: .5; cursor: default; }
.askbar .callout { text-align: left; }

/* picker extras: sides while searching, the collapsed Advanced group, the base list */
.pk-side { padding: 12px 10px 2px; font-size: var(--fs-13); font-weight: 650; color: var(--ink); display: flex; justify-content: space-between; gap: var(--s-2); }
.pk-side span { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.pk-adv { margin: var(--s-2) 0 0; border-top: 1px solid var(--line); }
.pk-adv > summary { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 10px; cursor: pointer; list-style: none; font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); }
.pk-adv > summary::-webkit-details-marker { display: none; }
.pk-adv > summary::before { content: "▸"; color: var(--ink-3); font-size: 11px; }
.pk-adv[open] > summary::before { content: "▾"; }
.pk-adv > summary .faint { margin-left: auto; font-weight: 400; font-size: 12px; }
.pk-none { padding: var(--s-4); color: var(--ink-2); font-size: var(--fs-14); }
.picker.bases { grid-template-rows: auto minmax(0, 1fr); }
.bk-head { justify-content: space-between; align-items: center; font-size: var(--fs-14); font-weight: 600; padding: var(--s-3); }
.bk-head span { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.bk-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: var(--r-1); background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
@media (hover: hover) { .bk-row:hover { background: var(--surface-2); } }
.bk-row.on { background: var(--accent-soft); }
.bk-row .bk-art { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r-1); }
.bk-row .bk-art img { max-width: 32px; max-height: 36px; object-fit: contain; }
.bk-row b { font-weight: 600; font-size: var(--fs-14); display: block; }
.bk-row small, .bk-row .imp { display: block; font-size: 12px; color: var(--ink-3); }
.bk-row .imp { color: var(--mod-magic); }
.bk-row .bk-lvl { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.badge.rune { background: color-mix(in srgb, var(--mod-fractured) 16%, transparent); color: var(--mod-fractured); }
.base-tip { position: fixed; z-index: 55; width: 300px; padding: var(--s-3); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-3); box-shadow: var(--shadow-2); font-size: var(--fs-13); display: grid; gap: var(--s-2); }
.base-tip .bt-head { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-14); }
.base-tip .bt-head img { max-height: 48px; }
.base-tip .pp { display: block; color: var(--ink); } .base-tip .pp .k { color: var(--ink-3); }
.base-tip .imp { display: block; color: var(--mod-magic); } .base-tip .note { color: var(--ink-2); }
@media (max-width: 720px) { .base-tip { left: 16px; right: 16px; width: auto; top: 12vh; } }

/* progress */
.progress h2 { font-size: var(--fs-18); }

/* answer */
.answer { display: grid; gap: var(--s-4); }
.answer.stale .answer-body { grid-auto-rows: max-content; opacity: .4; filter: grayscale(.8); max-height: 280px; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent); mask-image: linear-gradient(to bottom, black 40%, transparent); }
.stale-banner { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-2); background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.stale-banner b { font-size: var(--fs-22); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.stale-banner span { font-size: var(--fs-14); }
.stale-banner .btn { justify-self: start; }
.answer-body { gap: var(--s-5); }
.verdict .changed { font-size: var(--fs-14); color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-1); padding: var(--s-2) var(--s-3); }
.verdict .changed b { color: var(--ink); }
.vs .side-price.pick.buy { color: var(--buy); } .vs .side-price.pick.craft { color: var(--craft); }
.vs .side-price b, .vs .side-price .faint { color: var(--ink); } .vs .side-price .faint { color: var(--ink-3); }
.vs .side-price.pick b { color: inherit; }
.card .hd h2 { font-size: var(--fs-18); }
.card .hd .faint { margin-left: auto; text-align: right; }
.step-sec { display: grid; gap: var(--s-3); }
.step-sec .items { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.step-sec .items button { display: grid; gap: 0; text-align: left; min-height: var(--tap); padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); font: inherit; font-size: var(--fs-13); cursor: pointer; color: var(--ink); }
.step-sec .items button.on { border-color: var(--accent); background: var(--accent-soft); }
.step-sec .items small { color: var(--ink-3); font-size: 12px; }
.step .finish { font-size: var(--fs-13); color: var(--ink-2); }
.step .finish b { color: var(--ink); }
.step .note { font-size: var(--fs-13); color: var(--ink-2); }
.outcome { font: inherit; color: inherit; }
.outcomes .outcome:disabled { opacity: .6; }
.tally .acts .btn { min-height: var(--tap); }
.outline { font-size: var(--fs-13); }
.outline ol { margin: var(--s-2) 0 0; padding-left: var(--s-5); display: grid; gap: 2px; }
.outline button { background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; color: var(--ink-2); text-align: left; cursor: pointer; }
.outline button.on { color: var(--ink); font-weight: 600; }
.notice { font-size: var(--fs-14); color: var(--ink-2); }

/* prices used: a table on wide screens, a stacked list on phones */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .ico { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; }
@media (max-width: 720px) {
  .prices thead { display: none; }
  .prices tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
  .prices td { border: 0; padding: 0; }
  .prices td:first-child { grid-column: 1 / -1; font-weight: 600; color: var(--ink); }
  .prices td.num { text-align: left; }
  .prices td[data-k]::before { content: attr(data-k) ": "; color: var(--ink-3); }
}
.foot { max-width: 1200px; margin: 0 auto; padding: var(--s-4) var(--gutter) var(--s-6); color: var(--ink-3); font-size: var(--fs-13); }
.foot p + p { margin-top: var(--s-2); }
.foot a { color: var(--ink-2); }
@media (hover: hover) { .foot a:hover { color: var(--ink); } }
/* the privacy note (root/privacy.html): one column of plain text */
.prose { max-width: var(--col); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-5); display: grid; gap: var(--s-4); }
.prose h2 { margin-top: var(--s-3); }
.prose ul { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.page:not(.answered) .item-summary, .page.answered.editing .item-summary { display: none !important; }
.item-summary .lines-sum { display: block; }
.card .hd { flex-wrap: wrap; } .card .hd h2 { white-space: nowrap; }
@media (max-width: 420px) { .fold > summary .faint { display: none; } }

/* usability round 3 */
.type-search { display: grid; gap: var(--s-2); justify-items: start; }
.type-search input { width: 100%; }
#paste-jump { min-height: 32px; }
@media (max-width: 960px) {
  /* the answered phone page keeps the one-line item summary (with Edit) under the top bar, never under it */
  .page.answered:not(.editing) > .ask { position: sticky; top: 52px; z-index: 18; background: var(--bg); padding: var(--s-2) 0; margin: calc(var(--s-2) * -1) 0; }
}
.verdict .ex-note { font-size: var(--fs-13); color: var(--ink-3); font-weight: 500; }
/* money: the number, then the Exalted or Divine Orb art in place of "ex" / "div" (16 px, on the text's baseline) */
.amt { white-space: nowrap; }
.cur { display: inline-block; width: 16px; height: 16px; margin-left: 2px; vertical-align: -2px; background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: auto; }
.money-legend { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.money-legend .cur { margin-left: 0; }
.no-price { color: var(--ink-3); text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help; }
.verdict .changed { font-size: var(--fs-16); color: var(--ink); border-left: 3px solid var(--accent); }
.risks { line-height: 1.45; }
.data-note { font-size: var(--fs-13); }
.buy-facts b { color: var(--ink); }
.craft-means { color: var(--ink-2); }
.step .why-step { font-size: var(--fs-13); color: var(--ink-2); margin-top: 4px; }
.step .why-step b { color: var(--ink); font-weight: 600; }
.own h2 { font-size: var(--fs-16); }
.under #own-read { flex-basis: 100%; }
@media (max-width: 720px) { .prices td[data-k]:empty { display: none; } }
@media (max-width: 720px) {
  /* the sheet has a fixed height: the grab handle, search and tabs take their own height, the list the rest */
  .picker { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .picker.bases { grid-template-rows: auto auto minmax(0, 1fr); }
}
@media (max-width: 720px) { .toast { bottom: 112px; } }  /* above the sticky Ask bar */

/* usability round 4 */
.trow img, .item .head .art img, .item-summary .art img, .mini .mh img, .bk-row .bk-art img { filter: brightness(var(--art-bright)) drop-shadow(0 0 1px var(--art-glow)) drop-shadow(0 0 4px var(--art-glow)); }
.bk-row .bk-art { background: var(--art-well); }
.tier .tchip { min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .tier .tchip:hover { border-color: var(--ink-3); color: var(--ink); } }
.tier .tchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier .more { min-height: 32px; font-size: var(--fs-13); margin-left: auto; }
.tier .hint { font-size: 12px; }
@media (max-width: 720px) { .tier .tchip, .tier .more { min-height: 40px; } }
.swap-note { font-size: var(--fs-13); color: var(--accent); }
.item .ilvl { flex-wrap: wrap; }
.item .ilvl > span:first-child { flex: 1 1 0; min-width: 0; }
.item .ilvl .lvl-msg { flex-basis: 100%; font-size: var(--fs-13); color: var(--accent); font-weight: 550; }
.item .ilvl .lvl-msg.lock-why { color: var(--ink-2); font-weight: 500; }
.item .ilvl .lvl-btn { font-size: var(--fs-13); font-weight: 600; white-space: nowrap; }
.item .ilvl .lvl-menu { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.item .ilvl .lvl-opt { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; color: var(--ink); cursor: pointer; }
.item .ilvl .lvl-opt input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.item .ilvl #lvl-lock { width: 4.5em; min-height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.item .ilvl .lvl-picks { display: inline-flex; gap: var(--s-2); }
.item .ilvl .lvl-picks .tchip { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.item .ilvl .lvl-picks .tchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.verdict .own-words { font-size: var(--fs-14); color: var(--ink-2); }
.verdict .risk-jump { font-size: var(--fs-14); color: var(--warn); }
.verdict .risk-jump .link { color: var(--warn); font-weight: 600; }
.verdict.equal .word .w { font-size: var(--fs-28); }
.verdict .vs .side-price { padding: var(--s-2) var(--s-3); }
.risk-step { font-size: var(--fs-13); color: var(--warn); background: var(--warn-soft); border-radius: var(--r-1); padding: 6px 10px; margin-top: 6px; }
.badge.loop { background: var(--accent-soft); color: var(--accent); }
.badge.assumed { background: var(--warn-soft); color: var(--warn); }
.outcome .what { font-size: var(--fs-16); }
.outcome .odds b { font-size: var(--fs-18); }
.outcome .then { font-size: 12.5px; color: var(--ink-3); }
.outcome.forced { grid-template-columns: minmax(0, 1fr); }
.buy-facts .badge { margin-left: 4px; }
.match { color: var(--ink); }
.tier-note { color: var(--ink-2); }
.samples > summary { min-height: 44px; font-size: var(--fs-14); }
.samples-list { list-style: none; margin: 0; padding: 0 var(--s-4) var(--s-3); display: grid; gap: var(--s-2); }
.samples-list li { display: grid; gap: 2px; font-size: var(--fs-13); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.samples-list .sl { color: var(--mod-magic); }
#craft-numbers .numbers, .fold .numbers { gap: var(--s-3); }

/* round 5: the plan shown, sheets pinned to the bottom with the page held still, sticky offset */
.slot .line .badge.tier { flex: none; }
html { scroll-padding-top: var(--stuck, 64px); }
html.locked { overflow: hidden; }
body.locked { position: fixed; left: 0; right: 0; bottom: 0; overflow: hidden; }
@media (max-width: 720px) { .picker { top: auto !important; bottom: 0; height: 82vh; height: 82dvh; max-height: 82dvh; } }
/* links: the page's URL is the build */
.route-note { margin: 0; }
.under .copy-link { margin-left: auto; }
.answer-link { display: none; margin: 0; font-size: var(--fs-14); }
@media (max-width: 960px) { .page.answered:not(.editing) .answer-link { display: block; } }
/* The plan at a glance: the lucky path as chips, start → moves → finished; a vertical list on phones. */
.glance { display: grid; gap: var(--s-2); padding: var(--s-3); border-radius: var(--r-1); background: var(--surface-2); }
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s-2) 22px; }
.pchip { position: relative; display: grid; align-content: start; gap: 2px; min-width: 0; max-width: 240px; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); font-size: var(--fs-13); line-height: 1.35; }
.pchip + .pchip::before { content: "→"; position: absolute; left: -17px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; }
.pchip b { font-weight: 650; color: var(--ink); }
.pchip small { color: var(--ink-2); font-size: var(--fs-13); }
.pchip .p-name { display: flex; align-items: center; gap: 4px; }
.pchip .p-name .ico { width: 20px; height: 20px; vertical-align: 0; }
.pchip .p-price { color: var(--ink-3); font-size: var(--fs-12); }
.pchip.p-move { cursor: help; }
.pchip.p-move .p-odds { display: none; color: var(--accent); font-weight: 650; font-size: var(--fs-12); }
.pchip.p-move:hover .p-odds, .pchip.p-move:focus .p-odds, .pchip.p-move.show .p-odds { display: block; }
.pchip.p-move:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pchip.p-done { border-color: var(--hit); background: var(--hit-soft); }
.pchip.p-done b { color: var(--hit); }
.path-miss { margin: 0; }
@media (max-width: 520px) {
  .glance > .between { flex-direction: column; align-items: flex-start; gap: 2px; }
  .path { flex-direction: column; gap: 18px; }
  .pchip { max-width: none; }
  .pchip + .pchip::before { content: "↓"; left: 12px; top: -16px; transform: none; }
}

/* ---- interaction states: every control answers hover (with a mouse only), keyboard focus (the :focus-visible ring
   above) and press; changes take --t-fast and never rest on colour alone ----------------------------------------- */
:is(button, a.btn, a.outcome, .pill, input, textarea) { transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform 80ms ease-out; }
:is(button, a.btn, a.outcome):not(:disabled):active { transform: translateY(1px); }
.btn.primary:not(:disabled):active { opacity: .85; }
.pk-row.off:active { transform: none; }
@media (hover: hover) {
  .trow .pill.start:hover { border-color: var(--ink-3); background: var(--surface-2); color: var(--ink); }
  input[type=search]:hover, input[type=text]:hover, textarea:hover { border-color: var(--ink-3); }
  .slot .line button.txt:hover { text-decoration: underline; text-underline-offset: 3px; }
  .toggle:hover { color: var(--ink); }
  .picker .tabs button:not(.on):hover { background: var(--surface-2); color: var(--ink); }
  .tier .tchip.on:hover { background: color-mix(in srgb, var(--accent-soft), var(--accent) 12%); }
  .tvar .seg:not(.on):hover { color: var(--ink); box-shadow: inset 0 -2px var(--line-strong); }
  .trow .tex .pill:hover::after { color: var(--ink); transform: translateX(2px); }
  .pk-row.active:hover { background: var(--surface-3); }
  .brand:hover { color: var(--ink-2); }
}

/* ---- delight: three moments, each once per event (off under prefers-reduced-motion, by the rule at the top) ---- */
@keyframes verdict-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.verdict.arrive .word .w { display: inline-block; animation: verdict-in 260ms cubic-bezier(.2, .9, .3, 1.25) both; }
.verdict.arrive .word .price, .verdict.arrive .word .badge { animation: verdict-in 220ms 90ms ease-out both; }
@keyframes line-land { from { background-color: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } }
.slot.arrive { animation: line-land 700ms ease-out; }
@keyframes tick-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.3); opacity: 1; } 100% { transform: none; } }
.callout.ok.arrive .tick { display: inline-block; animation: tick-pop 360ms cubic-bezier(.2, .9, .3, 1) both; }
@keyframes finished-glow { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--poe-rare) 75%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
.arrive > .mini { animation: finished-glow 800ms 120ms ease-out; }
