/* GreedLab web, in the prototype's look (his direction, Nov 19: "use ... prototype design as a good base").
   Tokens are site/LOOK.md token for token, with its "rounded look" (his yes, Nov 17): a database site in the manner of
   Wowhead. Charcoal page, Open Sans, gold titles, blue links, panels as 8 px fills, zebra tables, the game's item colours.
   One stylesheet, no inline style (CSP). Sentence case everywhere except the top menu. */

@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/OpenSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/OpenSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/OpenSans-Bold.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --ink: #1a1a1a;      /* the page */
  --deep: #151515;     /* the top bar, tooltip cards */
  --panel: #242424;    /* a panel's body */
  --head: #2a2a2a;     /* a panel's header, a table's header */
  --raised: #2f2f2f;   /* chips and fields inside a panel, the chosen tab */
  --hover: #2c2c2c;    /* a row under the pointer */
  --press: #383838;    /* a raised control under the pointer */
  --band: #292929;     /* every second table row */
  --line: #404040;     /* outlines that must read as edges: the top bar, tooltip cards */
  --rule: rgba(255,255,255,.05);   /* lines inside a panel */
  --text: #dddddd; --bright: #ffffff; --faded: #9a9a9a; --menu: #bbbbbb;
  --gold: #ffd100; --gold-wash: rgba(255,209,0,.15); --link: #4a9dff;
  --good: #1eff00; --bad: #ff4040; --warn: #c9a227; --bnet: #0a6fd6;
  --silver: #c7ccd1; --copper: #d8854a;
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd; --q-epic: #a335ee; --q-legendary: #ff8000;
  --sans: "Open Sans", Verdana, "Segoe UI", system-ui, sans-serif;
  --r-panel: 8px; --r-ctl: 6px;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { font-size: clamp(15px, .55vw + 7px, 21px); background: var(--ink); }   /* 15 px up to about 1450 px wide, growing on very wide screens */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: var(--text);
       font: 400 1rem/1.5 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
b, strong { font-weight: 600; color: var(--bright); }
.skip { position: absolute; left: -9999px; top: .5rem; }
.skip:focus { left: 1rem; z-index: 30; background: var(--raised); color: var(--bright); padding: .5rem .8rem; border-radius: var(--r-ctl); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dim, .faded, .faint { color: var(--faded); }
.up { color: var(--good); } .down { color: var(--bad); } .warn { color: var(--warn); }
.no { color: var(--faded); }
.ln { color: var(--link); }
.q-poor { color: var(--q-poor); } .q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); }
.q-rare { color: var(--q-rare); } .q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }

/* ---------------------------------------------------------------- top bar: mark, menu, then search, house, data age, account */
.nav { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 1rem; padding: 0 1.4rem; background: var(--deep);
       border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.brand { display: flex; align-items: center; gap: .5rem; flex: none; min-height: 3.4rem; color: var(--gold); font: 700 1.45rem/1 var(--sans); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand i { font-style: normal; color: var(--bright); }
.flask { width: 1.2rem; height: 1.35rem; color: var(--gold); flex: none; }
.nav .tabs { display: flex; flex: none; }
.nav .tab { display: flex; align-items: center; gap: .4rem; padding: 0 .75rem; white-space: nowrap; color: var(--menu);
            font-weight: 700; font-size: .93rem; letter-spacing: .06em; text-transform: uppercase;
            border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.nav .tab:hover { color: var(--bright); background: var(--panel); text-decoration: none; }
.nav .tab.on { color: var(--gold); background: var(--panel); border-bottom-color: var(--gold); }
.cnt { color: var(--gold); font-weight: 600; letter-spacing: 0; }
.nav .end { margin-left: auto; display: flex; align-items: center; gap: .8rem; min-width: 0; }
.chev { width: .65rem; height: .65rem; color: var(--faded); }
.acct { display: flex; align-items: center; height: 2.1rem; padding: 0 .75rem; border-radius: var(--r-ctl); background: var(--panel);
        color: var(--bright); font-weight: 600; font-size: .93rem; white-space: nowrap; }
.acct:hover { background: var(--raised); text-decoration: none; }
form.inline { display: inline; margin: 0; }

/* search: one bar on a row of its own under the menu, full width (his words, Nov 17); a fill like the chips, focus a lighter
   fill with a gold underline */
form.search { order: 10; flex: 1 1 100%; height: 2.3rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem;
              padding: 0 .4rem 0 .7rem; border-radius: var(--r-ctl); background: var(--panel); color: var(--faded); }
form.search:focus-within { background: var(--raised); box-shadow: inset 0 -2px 0 var(--gold); }
form.search .ic { width: 1rem; height: 1rem; flex: none; }
form.search input[name=q] { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; box-shadow: none; outline: none; color: var(--bright); }
form.search input[name=q]:focus { box-shadow: none; background: none; }
kbd { font: 600 .78rem var(--sans); color: var(--faded); background: var(--raised); border-radius: 4px; padding: .05rem .45rem; }

/* data age: a green dot and its age in faded text (LOOK.md: sources and ages) */
.age { display: flex; align-items: center; white-space: nowrap; font-size: .87rem; color: var(--faded); }
.age.late { color: var(--warn); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; flex: none; }
.dot.ok { background: var(--good); } .dot.warn { background: var(--warn); }

/* the house picker: a chip that opens a list */
details.house { position: relative; }
details.house summary { list-style: none; display: flex; align-items: center; gap: .45rem; height: 2.1rem; padding: 0 .6rem 0 .75rem;
                        border-radius: var(--r-ctl); background: var(--panel); color: var(--bright); font-weight: 600; font-size: .93rem;
                        white-space: nowrap; cursor: pointer; }
details.house summary::-webkit-details-marker { display: none; }
details.house summary:hover, details.house[open] summary { background: var(--raised); }
.hk { color: var(--faded); font-weight: 400; }
details.house ul { position: absolute; right: 0; top: calc(100% + .3rem); min-width: 13rem; max-height: 60vh; overflow: auto; margin: 0; padding: .3rem;
                   list-style: none; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-ctl);
                   box-shadow: 0 .8rem 2rem rgba(0,0,0,.5); z-index: 25; }
details.house li a { display: block; padding: .35rem .6rem; border-radius: 4px; color: var(--text); white-space: nowrap; }
details.house li a:hover { background: var(--raised); color: var(--bright); text-decoration: none; }

.ctx { display: flex; align-items: center; gap: .8rem; }
.ctx.under { display: none; }
.nav .tabs, .nav .end { min-height: 3.4rem; }

/* ---------------------------------------------------------------- buttons (the addon's kit: primary gold, normal, quiet) */
button { height: 2.1rem; padding: 0 .9rem; border: 0; border-radius: var(--r-ctl); background: var(--raised); color: var(--text);
         font-weight: 600; cursor: pointer; white-space: nowrap; }
button:hover { background: var(--press); color: var(--bright); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.1rem; padding: 0 .9rem;
       border-radius: var(--r-ctl); font-weight: 600; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn.quiet { background: var(--raised); color: var(--text); }
.btn.quiet:hover { background: var(--press); color: var(--bright); }
.btn.gold, button.gold { background: var(--gold); color: #1a1a1a; }
.btn.gold:hover, button.gold:hover { background: #ffdf4d; color: #1a1a1a; }
.btn.wide { width: 100%; height: 2.6rem; }
.btn.bnet { width: 100%; height: 2.8rem; background: var(--bnet); color: #fff; font-size: 1.02rem; }
.btn.bnet:hover { background: #1580ee; }
.nav .btn.quiet { background: var(--panel); color: var(--bright); }
.nav .btn.quiet:hover { background: var(--raised); }

/* ---------------------------------------------------------------- page */
main { flex: 1; width: 100%; max-width: 110rem; margin: 0 auto; padding: 1.3rem 1.6rem 1.6rem; }
/* every page opens on one sentence with its numbers; figures bright, the rest plain text */
h1.lede { font: 400 1.2rem/1.45 var(--sans); color: var(--text); margin: 0 0 1.1rem; max-width: 80ch; text-wrap: pretty; }
h1.lede b { font-weight: 700; color: var(--bright); }
h1.lede .dim { display: block; margin-top: .2rem; font-size: .93rem; }
main h1 { font: 700 1.75rem/1.2 var(--sans); color: var(--bright); margin: 0 0 .8rem; }
main h2 { font: 700 1.05rem/1.3 var(--sans); color: var(--gold); margin: 1.4rem 0 .5rem; }
main p { max-width: 80ch; }
.note { background: var(--panel); border-radius: var(--r-panel); padding: .6rem .8rem; max-width: 80ch; }
.note.warn { color: var(--text); background: rgba(201,162,39,.12); display: flex; align-items: baseline; gap: .6rem; }
.note.warn::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--warn); flex: none; transform: translateY(-.05rem); }
.note.dev { margin: 1rem auto 0; width: calc(100% - 3.2rem); max-width: 106.8rem; }
.mark { color: var(--faded); font-size: .75rem; opacity: .55; }
.code { font: 700 1.6rem ui-monospace, Consolas, monospace; color: var(--gold); letter-spacing: .08em; }

/* ---------------------------------------------------------------- tables: gold headers, zebra rows, numbers right */
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--panel); border-radius: var(--r-panel); overflow: hidden; }
th { background: var(--head); color: var(--gold); font-weight: 600; font-size: .87rem; line-height: 1.25; text-align: left; white-space: nowrap;
     padding: .45rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
td { padding: .38rem .7rem; border-top: 1px solid var(--rule); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr:nth-child(even) td { background: var(--band); }
tbody tr:hover td { background: var(--hover); }
th:first-child, td:first-child { padding-left: .8rem; } th:last-child, td:last-child { padding-right: .8rem; }
.r { text-align: right; }
.yn { text-align: center; width: 4rem; }
td.yn { color: var(--good); } th.pro { color: var(--q-epic); }
.ck { width: .95rem; height: .95rem; vertical-align: -.12rem; }

/* money: a number and a round coin; screen readers get g / s / c */
.m { display: inline-flex; align-items: baseline; white-space: nowrap; }
.m b { font-weight: inherit; color: inherit; }
.m i { display: inline-block; width: .72em; height: .72em; border-radius: 50%; margin: 0 .3em 0 .12em; flex: none; transform: translateY(.04em);
       box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.m i:last-of-type { margin-right: 0; }
.cg { background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd100 50%, #a87400); }
.cs { background: radial-gradient(circle at 35% 30%, #ffffff, #c7ccd1 50%, #6f7a86); }
.cc { background: radial-gradient(circle at 35% 30%, #ffd0a8, #d8854a 50%, #7a3f18); }
.sg { display: inline-flex; align-items: baseline; white-space: nowrap; }

/* ---------------------------------------------------------------- a list page: the rail on the left, the sheet beside it, one panel */
.mk { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); align-items: stretch; background: var(--panel);
      border-radius: var(--r-panel); overflow: hidden; }
.la { background: var(--panel); border-right: 1px solid var(--rule); padding: .2rem 0 .8rem; min-width: 0; }
.la h4 { margin: .8rem .8rem .25rem; font-size: .8rem; font-weight: 600; color: var(--faded); }
.la ul { list-style: none; margin: 0; padding: 0; }
.la li a { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .3rem .8rem .3rem calc(.8rem - 3px);
           border-left: 3px solid transparent; color: var(--text); }
.la li a:hover { background: var(--hover); text-decoration: none; }
.la li a:focus-visible { outline-offset: -2px; }
.la li.sel a { color: var(--gold); border-left-color: var(--gold); background: var(--ink); font-weight: 600; }
.la li a em { font-style: normal; font-weight: 400; font-size: .84rem; color: var(--faded); margin-left: .4rem; }
.la li.sel a em { color: var(--gold); }
.la .trk + h4 { margin-top: 1.1rem; }
.la li.lo-g { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--rule); }
.la li form.lo { margin: 0; }
.la li form.lo button { display: flex; width: 100%; height: auto; padding: .3rem .8rem .3rem calc(.8rem - 3px); border-left: 3px solid transparent;
                        border-radius: 0; background: none; color: var(--text); font-weight: 400; justify-content: flex-start; }
.la li form.lo button:hover { background: var(--hover); color: var(--bright); }

.sheet { background: var(--panel); border-radius: var(--r-panel); overflow: hidden; min-width: 0; }
.mk > .sheet { border-radius: 0; }
.sh-h { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .8rem; background: var(--head);
        border-bottom: 1px solid var(--rule); }
.sh-h > div { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; min-width: 0; }
.sh-h h2 { font: 700 1.05rem/1.3 var(--sans); color: var(--gold); margin: 0; }
.sh-h p { margin: 0; font-size: .87rem; color: var(--faded); }
.sh-h > span { font-size: .87rem; color: var(--faded); white-space: nowrap; }
.sheet table, table.tbl { border-radius: 0; background: none; }
.tbl td { white-space: nowrap; }
.tbl td.nt { white-space: normal; color: var(--faded); }
.nm { font-weight: 600; }
a.nm:hover { text-decoration: underline; }
.kd { color: var(--faded); font-size: .87rem; margin-left: .5rem; }
.legend { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .87rem; color: var(--faded);
          padding: .5rem .8rem; border-top: 1px solid var(--rule); }
main p.legend, .legend { max-width: none; margin: 0; }
.pager { display: flex; gap: 1rem; }
.sheet .mark { padding: 0 .8rem; margin: 0 0 .4rem; }
.empty { padding: .8rem; margin: 0; }

/* segmented control: fills with 6 px corners; the chosen one is gold on a gold wash */
.seg { display: inline-flex; border-radius: var(--r-ctl); overflow: hidden; background: var(--panel); flex: none; }
.sh-h .seg, .chartbox .seg, .side .seg { background: var(--raised); }
.seg a { display: flex; align-items: center; padding: .3rem .75rem; color: var(--text); font-size: .9rem; font-weight: 600; white-space: nowrap; }
.seg a:hover { color: var(--bright); text-decoration: none; background: var(--press); }
.seg a.on { background: var(--gold-wash); color: var(--gold); }
.seg.sm a { padding: .2rem .6rem; font-size: .84rem; }

/* status words with their dot: Sold green, bought gold, came back red; the rest plain */
.tm { display: inline-block; min-width: 3.2rem; color: var(--faded); margin-right: .6rem; }
.tag { display: inline-flex; align-items: center; gap: .45rem; }
.tag i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--faded); }
.tag.t-sold i { background: var(--good); } .tag.t-bought i { background: var(--gold); } .tag.t-came-back i { background: var(--bad); }
.tag.t-undercut { margin-left: .6rem; color: var(--bad); } .tag.t-undercut i { background: var(--bad); }
.tbl td.it .tag { margin-left: .6rem; }
.pd, .l2 { display: none; }
.narrow-h { display: none; }

/* empty states: what is missing and what brings it */
.es { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: .8rem; color: var(--faded); }
.es p { margin: 0; }
.es.big { align-items: center; text-align: center; padding: 4rem 1rem; }
.es-t { color: var(--bright); font-size: 1.1rem; font-weight: 700; margin: .3rem 0 0; }
.es.big .dim { margin-top: .2rem; }
.flask.ef { width: 1.3rem; height: 1.45rem; color: #8a7a2e; }

/* ---------------------------------------------------------------- forms (account pages) */
input:not([type=hidden]):not([type=checkbox]), select { height: 2.1rem; padding: 0 .6rem; border: 0; border-radius: var(--r-ctl);
        background: var(--raised); color: var(--bright); }
input:not([type=hidden]):not([type=checkbox]):focus { outline: none; background: var(--press); box-shadow: inset 0 -2px 0 var(--gold); }
input::placeholder { color: var(--faded); }
select { appearance: none; -webkit-appearance: none; padding: 0 1.9rem 0 .7rem; font-weight: 600; cursor: pointer;
         background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.2 3.8 5 6.6l2.8-2.8' fill='none' stroke='%239a9a9a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right .6rem center / .65rem no-repeat; }
select:hover { background-color: var(--press); }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 1.1rem; height: 1.1rem; margin: 0 .5rem 0 0; flex: none; vertical-align: -.2rem;
        border-radius: 3px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
input[type=checkbox]:checked { box-shadow: none; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.4 5.8 10 11 4' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / .85rem no-repeat; }
form.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
label.ckr { display: flex; align-items: center; min-height: 1.9rem; }
label.ckr input[type=checkbox] { vertical-align: 0; }

/* account: the rail and one view per address */
.acc .accb { padding: .8rem; border-top: 1px solid var(--rule); }
.acc .sh-h + .accb { border-top: 0; }
.acc form + form, .acc table + form { margin-top: .8rem; }
.acc fieldset { border: 0; padding: 0; margin: 0 0 .9rem; } .acc legend { font-weight: 600; color: var(--bright); margin-bottom: .35rem; padding: 0; }
.acc label { color: var(--text); }
.acc label:has(input[type=checkbox]:not(:checked)) { color: var(--faded); }
.accb table { margin-bottom: .3rem; }
.plan { display: flex; align-items: baseline; gap: .9rem; margin: .3rem 0 .9rem; }
.pn { font: 700 1.45rem var(--sans); color: var(--bright); }
.kv { display: grid; grid-template-columns: auto 1fr; margin: 0; row-gap: .35rem; column-gap: 1rem; }
.kv dt { color: var(--faded); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--bright); min-width: 0; }
.kv.left { grid-template-columns: max-content 1fr; max-width: 40rem; margin-bottom: 1rem; }
.kv.left dd { text-align: left; font-weight: 400; color: var(--text); }
.acts { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.acts.center { justify-content: center; margin: .3rem 0 0; }
.sm2 { font-size: .87rem; margin: .8rem 0 0; }
h3.h3 { font: 700 1rem var(--sans); color: var(--bright); margin: 1.1rem 0 .5rem; } .accb > h3.h3:first-child { margin-top: .2rem; }

/* ---------------------------------------------------------------- tooltip cards: an item, a plan, what GreedLab reads */
.tipcard, .ptip, .reads { background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-panel); }
.glk { font-weight: 700; font-size: .87rem; color: var(--gold); padding-top: .7rem; border-top: 1px solid var(--rule); margin-bottom: .35rem; }

/* pricing: plans as item tooltips beside the comparison */
.pricing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); gap: 2.4rem; align-items: start; }
.ptips { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.ptip { padding: 1.1rem 1.2rem 1.1rem; }
.ptip.pro { border-color: rgba(163,53,238,.55); }
.ptip h2 { font: 700 1.45rem/1.2 var(--sans); margin: 0 0 .1rem; }
.ptip .bind { margin: 0 0 .7rem; color: var(--text); font-size: .93rem; }
.ptip .use { margin: 0 0 .6rem; color: var(--good); } .ptip .use b { color: var(--good); }
.ptip ul { margin: 0 0 .7rem; padding: 0; list-style: none; color: var(--text); }
.ptip li { padding: .15rem 0 .15rem .9rem; position: relative; }
.ptip li::before { content: ""; position: absolute; left: 0; top: .72em; width: .3rem; height: .3rem; border-radius: 50%; background: var(--faded); }
.ptip .dur { margin: 0 0 .9rem; color: var(--faded); }
.price { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .9rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.amt { font: 700 2rem/1 var(--sans); color: var(--bright); } .per { color: var(--faded); }
.fine { font-size: .84rem; color: var(--faded); margin: .8rem 0 0; line-height: 1.5; }
.pr h3 { font: 700 1.05rem var(--sans); color: var(--gold); margin: .3rem 0 .6rem; }
table.cmp { font-size: .93rem; }
.cmp td { color: var(--text); white-space: normal; }

/* log in */
.login { display: grid; grid-template-columns: minmax(0, 1fr); padding: 2rem 0 2.6rem; }
.lcard { width: 100%; max-width: 27rem; margin: 0 auto; text-align: center; }
.flask.big { width: 2.2rem; height: 2.45rem; }
.lcard h1 { font: 700 1.75rem/1.2 var(--sans); color: var(--bright); margin: .9rem 0 .4rem; }
.lcard > p.dim { margin: 0 0 1.4rem; }
.reads { margin-top: 1.5rem; text-align: left; padding: .2rem 1.1rem .9rem; }
.reads .glk { border-top: 0; }
.lcard > p.sm { font-size: .84rem; margin: .9rem 0 0; text-wrap: balance; }
.lcard .note { text-align: left; margin: 0 0 1rem; }

/* ---------------------------------------------------------------- the item page */
.crumbs { font-size: .9rem; color: var(--faded); margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.ihead { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.tipcard { padding: 1rem 1.1rem .9rem; }
.iname { font: 700 1.45rem/1.2 var(--sans); margin: 0 0 .2rem; }
.il { margin: 0 0 .8rem; color: var(--faded); font-size: .93rem; }
.tipcard .kv dd .hint { font-weight: 400; font-size: .84rem; margin-left: .35rem; }
.tipcard .kv dd .hint.up, .tipcard .kv dd .hint.down { color: var(--text); }   /* a market change is drawn neutral: green and red are his own profit and loss */
.iside { min-width: 0; }
.ilede { font-size: 1.1rem; line-height: 1.5; margin: 0 0 1rem; max-width: 60ch; color: var(--text); }
.ilede b { font-weight: 700; }
.side { background: var(--panel); border-radius: var(--r-panel); overflow: hidden; }
.sideh { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; padding: .5rem .8rem; background: var(--head);
         border-bottom: 1px solid var(--rule); }
.side h3 { font: 700 1.05rem/1.3 var(--sans); color: var(--gold); margin: 0; }
.sideh .faint { font-size: .87rem; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.6rem; margin: 0; padding: 0 .8rem .2rem; }
.crow { display: flex; justify-content: space-between; align-items: center; gap: .8rem; min-height: 2.6rem; border-top: 1px solid var(--rule); }
.cgrid > .crow.o1, .cgrid > .crow.o3 { border-top: 0; }   /* the first row of each column sits under the header */
.crow.tot b { font-weight: 700; font-size: 1.05rem; }
.cin2 { display: inline-flex; align-items: center; gap: .25rem; }
.cin2 input:not([type=hidden]) { width: 4.2rem; height: 1.9rem; text-align: right; font-weight: 600; }
.cin2 input[name=s], .cin2 input[name=c] { width: 2.7rem; }
.cin2 i { display: inline-block; width: .72em; height: .72em; border-radius: 50%; margin-right: .35rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.cin2 button { height: 1.9rem; padding: 0 .7rem; font-size: .87rem; }
.cin2 input::placeholder { color: var(--faded); font-weight: 400; }

/* tabs: fills with 6 px top corners over a faint rule; the chosen one is gold on raised */
.itabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 1.4rem 0 1rem; overflow-x: auto; scrollbar-width: none; }
.itabs a { flex: none; padding: .45rem 1rem; border-radius: var(--r-ctl) var(--r-ctl) 0 0; background: var(--panel); color: var(--menu); font-weight: 600; white-space: nowrap; }
.itabs a:hover { color: var(--bright); background: var(--hover); text-decoration: none; }
.itabs a.on { background: var(--raised); color: var(--gold); }

.chartbox { background: var(--panel); border-radius: var(--r-panel); padding: .8rem .9rem .3rem; }
.ch-h { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.lg { display: flex; align-items: center; gap: .5rem; font-size: .87rem; color: var(--faded); }
.lg .k { width: 1rem; height: 3px; border-radius: 2px; }
.k.lw { background: var(--gold); } .k.vb { background: rgba(255,255,255,.18); margin-left: .9rem; height: .55rem; }
.chart { display: block; width: 100%; max-width: 100%; height: auto; overflow: visible; }
.chart.narrow { display: none; }
.chart .gl { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .ax { fill: var(--faded); font: 12px var(--sans); }
.chart .lwl { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.chart .end { fill: var(--gold); stroke: var(--panel); stroke-width: 2.5; }
.elab rect { fill: var(--raised); } .elab text { fill: var(--bright); font: 600 13px var(--sans); }
.elab .cgs { fill: #ffd100; } .elab .css { fill: #c7ccd1; } .elab .ccs { fill: #d8854a; }
.chartbox .legend { border-top: 0; padding: .3rem 0 .4rem; }
.chartbox .hh { font-size: 1.05rem; margin: 0 0 .1rem; }
.chartbox .ch-h p { margin: 0; }
.chart.hours .vbar { fill: rgba(255,255,255,.09); }
.chart.hours .hit { fill: transparent; }
.chart.hours g:hover .vbar { fill: rgba(255,255,255,.18); }
.chart.hours .hdot { fill: var(--gold); }
.chart.hours .tgood { fill: var(--good); } .chart.hours .tbad { fill: var(--bad); }
.chart.hours .tagw { fill: var(--text); font-size: 12px; }
.astable { margin: .4rem 0 .1rem; } .astable summary { color: var(--link); cursor: pointer; font-size: .93rem; width: max-content; }
.astable .tbl { margin-top: .5rem; }
section.sheet + section, .chartbox + .sheet { margin-top: 1rem; }

/* item icons: the game's 56 px icon drawn small with a 1 px edge, before the name (LOOK.md tables); a plain square when none */
.iic { display: inline-block; width: 1.45rem; height: 1.45rem; flex: none; vertical-align: middle; margin-right: .5rem;
       border: 1px solid #555; background: var(--raised); object-fit: cover; }
.itn { display: inline-flex; align-items: center; }
.itn .iic { margin-right: .55rem; }
.iname { display: flex; align-items: center; gap: .65rem; }
.iname .iic { width: 2.4rem; height: 2.4rem; margin: 0; }

/* flips (Pro): one row a flip, as the prototype's Deals rows (design review, Nov 19) */
.tbl.flips td { vertical-align: middle; }
.dsub { display: block; font-size: .84rem; line-height: 1.3; white-space: nowrap; }
.tbl.flips tr.t-legendary td:first-child { box-shadow: inset 3px 0 0 var(--q-legendary); }   /* a legendary flip keeps a mark of its own: an orange edge, not a wash cut by the cells */
.tbl.flips th.act, .tbl.flips td.act { width: 9.5rem; }
.tbl.flips td.act form { margin: 0; }
button.buy { height: 1.85rem; padding: 0 .75rem; font-size: .9rem; background: var(--raised); color: var(--bright); }
button.buy:hover { background: var(--press); }
button.buy.off, button.buy.off:disabled { background: none; color: var(--faded); font-weight: 600; cursor: not-allowed; }

/* flips: the filters over the table */
.filters { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.bnote { color: var(--text); margin: 0 0 .9rem; }
.bst { font-size: .87rem; font-weight: 600; white-space: nowrap; text-align: right; } .bst.in { color: var(--bright); }
.more { font-size: .87rem; margin: .7rem .2rem 0; }
.ck4 { color: var(--faded); font-weight: 400; font-size: .84rem; }

/* the loot-threshold picker: six swatches in the game's item colours */
.qs { display: flex; align-items: center; gap: .6rem; }
.ql { font-weight: 600; font-size: .87rem; color: var(--faded); }
.qt { display: flex; background: var(--panel); border-radius: var(--r-ctl); padding: 2px; gap: 2px; }
.qc { width: 1.9rem; height: 1.6rem; border-radius: 4px; display: grid; place-items: center; }
.qc i { width: .75rem; height: .75rem; border-radius: 2px; opacity: .25; }
.qc.on i { opacity: 1; } .qc.th { background: var(--raised); } .qc:hover { background: var(--hover); }
.sw-poor { background: var(--q-poor); } .sw-common { background: var(--q-common); } .sw-uncommon { background: var(--q-uncommon); }
.sw-rare { background: var(--q-rare); } .sw-epic { background: var(--q-epic); } .sw-legendary { background: var(--q-legendary); }
.qv { font-size: .93rem; }

/* ---------------------------------------------------------------- the owner pages' chrome and kit (PARITY-PLAN.md section 2),
   P's own rules on these tokens: the menu's divider before Ledger, the account menu, the house form, the item tooltip, items,
   panels, highlight rows, stat tiles, the views strip, sortable heads, the pager, sparks and the line chart */
.nav .tab.grp { margin-left: 1.1rem; position: relative; }
.nav .tab.grp::before { content: ""; position: absolute; left: -.6rem; top: 28%; bottom: 28%; width: 1px; background: #555; }
.gl-menu { position: relative; }
.gl-menu summary { list-style: none; display: flex; align-items: center; height: 2.1rem; padding: 0 .75rem; border-radius: var(--r-ctl); background: var(--panel);
                   color: var(--bright); font-weight: 600; font-size: .93rem; white-space: nowrap; cursor: pointer; }
.gl-menu summary::-webkit-details-marker { display: none; }
.gl-menu summary::after { content: ""; margin-left: .5rem; border: 4px solid transparent; border-top-color: var(--faded); transform: translateY(2px); }
.gl-menu summary:hover, .gl-menu[open] summary { background: var(--raised); }
.gl-menu > div { position: absolute; right: 0; top: calc(100% + .3rem); min-width: 13rem; background: var(--deep); border-radius: var(--r-panel);
                 box-shadow: 0 0 0 1px var(--line), 0 .6rem 1.6rem rgba(0,0,0,.55); padding: .3rem; z-index: 30; }
.gl-menu > div a, .gl-menu > div button { display: block; width: 100%; height: auto; padding: .4rem .7rem; border-radius: var(--r-ctl); background: none;
                                          color: var(--text); font-weight: 400; text-align: left; }
.gl-menu > div a:hover, .gl-menu > div button:hover { background: var(--panel); color: var(--bright); text-decoration: none; }
.gl-menu hr { border: 0; border-top: 1px solid var(--rule); margin: .3rem 0; }
.gl-menu form, form.hpick { margin: 0; }
form.hpick { display: flex; gap: .3rem; } form.hpick select { background-color: var(--panel); }
#tt { position: fixed; z-index: 60; pointer-events: none; width: 21rem; max-width: calc(100vw - 16px); background: #0d0d0d; border: 1px solid #6b6b6b;
      border-radius: 3px; padding: .55rem .65rem; font-size: .87rem; line-height: 1.4; color: var(--bright); box-shadow: 0 6px 22px rgba(0,0,0,.7); }
.tth { display: flex; gap: .55rem; align-items: center; margin-bottom: .3rem; } .tth b { font-size: 1rem; line-height: 1.25; }
.tth img { width: 2.25rem; height: 2.25rem; border: 1px solid #777; flex: none; }
.ttl, .ttm div { display: flex; justify-content: space-between; gap: 1rem; } .ttl.g { color: var(--good); } .ttl.y { color: var(--gold); } .ttl.f { color: #66bbff; }
.ttm { margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #444; } .ttm h4 { margin: 0 0 .15rem; font: 600 .84rem var(--sans); color: var(--gold); }
.ttm div > span:first-child { color: var(--faded); } .ttm p { margin: .25rem 0 0; color: var(--faded); } .ttm p.flat { margin: 0; }
.ttsrc { margin-top: .35rem; color: #777; font-size: .78rem; }
.it { display: inline-flex; align-items: center; gap: .6rem; }
.it .ic { display: inline-block; width: 1.75rem; height: 1.75rem; border: 1px solid #555; background: var(--raised); flex: none; object-fit: cover; }
.it .ic.big { width: 3.8rem; height: 3.8rem; border-color: #777; } .it .ic.sm { width: 1.25rem; height: 1.25rem; }
.chgv { color: var(--text); white-space: nowrap; }      /* a change in the market is drawn neutral: green and red are his own profit and loss */
.panel { background: var(--panel); border-radius: var(--r-panel); min-width: 0; overflow: hidden; }
.panel > header { display: flex; align-items: baseline; gap: .9rem; padding: .5rem .8rem; background: var(--head); border-bottom: 1px solid var(--rule); }
.panel h2 { font: 700 1.05rem/1.3 var(--sans); margin: 0; color: var(--gold); white-space: nowrap; }
.panel .note { color: var(--faded); font-size: .87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ctl { margin-left: auto; display: flex; gap: 2px; align-self: center; }
.panel .body { padding: .8rem; overflow-x: auto; } .panel .body.flush { padding: 0; }
.chip { display: inline-block; padding: .2rem .75rem; border-radius: var(--r-ctl); background: var(--raised); color: var(--menu); font-weight: 600; font-size: .9rem; }
.chip:hover { color: var(--bright); background: var(--press); text-decoration: none; } .chip.on { background: var(--gold-wash); color: var(--gold); }
.hl { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; border-top: 1px solid var(--rule); color: var(--text); }
.hl:first-child { border-top: 0; } .hl:nth-child(even) { background: var(--band); } .hl:hover { background: var(--hover); text-decoration: none; }
.hlmid { flex: 1; min-width: 0; display: flex; flex-direction: column; } .hlmid b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hlmid small, .hlfig small, .stat small { color: #a8a8a8; font-size: .86rem; line-height: 1.3; }
.hlmid small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.hlfig { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; } .hlfig b { font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 8px; margin: 0 0 1rem; }
.stat { background: var(--panel); border-radius: var(--r-panel); padding: .6rem .8rem; }
.stat dt { color: var(--gold); font-size: .87rem; font-weight: 600; } .stat small { display: block; }
.stat dd { margin: .05rem 0 0; font-size: 1.4rem; font-weight: 700; color: var(--bright); line-height: 1.25; }
.itabs .n { margin-left: .45rem; font-weight: 400; color: var(--faded); }
@media (min-width: 901px) { nav.views { position: sticky; top: 6.4rem; z-index: 10; background: var(--ink); padding-top: .35rem; } }
th.tip { text-decoration: underline dotted; text-decoration-color: rgba(255,209,0,.45); text-underline-offset: 3px; cursor: help; }
th.sort a { color: inherit; } th.sort a:hover, th.by { color: var(--bright); text-decoration: none; }
.pager { align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; margin: .5rem .8rem; color: var(--faded); font-size: .9rem; }
.pager span { margin-right: .5rem; }
.spark { display: block; } .spark polyline { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.spark.up polyline { stroke: var(--good); } .spark.down polyline { stroke: var(--bad); }
.ch { position: relative; } .lc { display: block; width: 100%; height: auto; }
.lc .gl { stroke: #3a3a3a; } .lc .gl.day { stroke: #4a4a4a; } .lc .ax { fill: #a8a8a8; font: 400 13px var(--sans); }
.lc .ar { fill: var(--gold); opacity: .1; } .lc .ln { fill: none; stroke-width: 1.6; stroke-linejoin: round; opacity: .9; }
.lc .l0 { stroke: var(--gold); stroke-width: 2.6; opacity: 1; } .lc .l1 { stroke: var(--link); } .lc .l2 { stroke: var(--silver); }
.tipbox .l0 { background: var(--gold); } .tipbox .l1 { background: var(--link); } .tipbox .l2 { background: var(--silver); }
.lc .pd { fill: #2a6b35; stroke: #141414; } .lc .pd.firm { fill: #3fb950; }
.lc .cross { stroke: #fff; opacity: 0; } .lc .cross.on { opacity: .4; }
.tipbox { position: absolute; pointer-events: none; background: #101010; border: 1px solid var(--gold); padding: .4rem .6rem; font-size: .87rem; line-height: 1.5;
          white-space: nowrap; z-index: 5; }
.tipbox .k { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; }

/* ---------------------------------------------------------------- footer */
.foot { display: flex; justify-content: space-between; gap: .4rem 1.4rem; flex-wrap: wrap; margin-top: 1.6rem; padding: .9rem 1.6rem;
        border-top: 1px solid var(--line); font-size: .87rem; color: var(--faded); }
.fl { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- narrower windows */
@media (max-width: 1280px) {
  .nav { gap: .7rem; padding: 0 1rem; }
  .nav .tab { padding: 0 .5rem; font-size: .86rem; letter-spacing: .04em; }
}
@media (max-width: 1100px) {
  .pricing { grid-template-columns: minmax(0, 1fr); }
  .ihead { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
}
@media (max-width: 900px) {
  .nav .tab.grp { margin-left: 0; } .nav .tab.grp::before { display: none; }
  /* the menu takes a row of its own under the mark and slides sideways */
  .nav { flex-wrap: wrap; gap: 0 .7rem; padding: 0 .8rem; }
  .nav .tabs, .nav .end, .brand { min-height: 3rem; }
  form.search { margin-top: .5rem; }
  .nav .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -.8rem; padding: 0 .4rem; border-top: 1px solid var(--rule); }
  .nav .tab { padding: .55rem .6rem; }
  main { padding: 1rem .9rem 1.2rem; }
  .note.dev { width: calc(100% - 1.8rem); }
  .foot { padding: .9rem; }
  /* the rail becomes a row of chips that slides sideways and never wraps (LOOK.md: one row on a phone) */
  .mk { grid-template-columns: minmax(0, 1fr); background: none; border-radius: 0; overflow: visible; }
  .mk > .sheet { border-radius: var(--r-panel); }
  .la { background: none; border-right: 0; padding: 0; margin-bottom: .8rem; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory;
        mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); padding-right: 1.5rem; }
  .la h4 { display: none; }
  .la ul { display: inline-flex; gap: 2px; }
  .la li { scroll-snap-align: start; }
  .la li a, .la li form.lo button { border-left: 0; border-radius: var(--r-ctl); background: var(--panel); padding: .35rem .75rem; white-space: nowrap; }
  .la li.sel a { background: var(--gold-wash); }
  .la li.lo-g { margin: 0; padding: 0; border: 0; }
  .la.grp { overflow: visible; mask-image: none; padding-right: 0; scroll-snap-type: none; }
  .la.grp .trk { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
                 padding-right: 1.5rem; margin-bottom: .4rem; }
  .la.grp .trk ul { flex-wrap: nowrap; }
  .la .trk + h4 { margin: 0; }
}
@media (max-width: 640px) {
  .brand span { font-size: 1.3rem; }
  .ctx.bar { display: none; }
  .ctx.under { display: flex; flex-wrap: wrap; justify-content: space-between; row-gap: .6rem; margin: .7rem .9rem 0; }
  form.search kbd { display: none; }
  details.house ul { left: 0; right: auto; }
  .opt { display: none; }
  .tag.opt { display: none; }
  h1.lede { font-size: 1.08rem; }
  .ptips { grid-template-columns: minmax(0, 1fr); }
  .sh-h { flex-direction: column; align-items: flex-start; gap: .4rem; }
  /* ledger and lists on a phone: Item, Gold, Profit; the dot and a second line carry time and what */
  .wide-h { display: none; } .narrow-h { display: inline; }
  .tbl .tm { display: none; }
  .pd { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .5rem; vertical-align: .1rem; background: var(--faded); }
  .pd.t-sold { background: var(--good); } .pd.t-bought { background: var(--gold); } .pd.t-came-back { background: var(--bad); }
  .l2 { display: block; font-size: .84rem; color: var(--faded); padding-left: 1rem; }
  .l2.flush { padding-left: 0; }
  .l2 .ud { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--bad); margin-right: .35rem; vertical-align: .05rem; }
  .tbl td.it { white-space: normal; padding-block: .4rem; }
  .tbl td, .tbl th { padding-left: .6rem; padding-right: .6rem; }
  /* item page */
  .cgrid { grid-template-columns: minmax(0, 1fr); }
  .cgrid > .crow.o3 { border-top: 1px solid var(--rule); }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; }
  .crow.o1 { flex-wrap: wrap; row-gap: .5rem; padding-block: .4rem; } .crow.o1 > label { flex-basis: 100%; }
  .crow.o1 .cin2 { width: 100%; } .crow.o1 .cin2 input[name=g] { flex: 1; }
  .iname { font-size: 1.3rem; } .ilede { font-size: 1rem; }
  .chart.wide { display: none; } .chart.narrow { display: block; }
  .hrs-h { flex-direction: column; align-items: flex-start; gap: .4rem; }
  /* flips on a phone: each flip a two-line block (name and profit, then buy-at and the button), never cut off at the edge */
  .tbl.flips thead { display: none; }
  .tbl.flips tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .8rem; row-gap: .3rem; padding: .5rem .7rem;
                        border-top: 1px solid var(--rule); }
  .tbl.flips tbody tr:first-child { border-top: 0; }
  .tbl.flips tbody tr:nth-child(even) { background: var(--band); }
  .tbl.flips tbody td, .tbl.flips tbody tr:nth-child(even) td, .tbl.flips tbody tr:hover td { display: block; padding: 0; border: 0; background: none; }
  .tbl.flips td.it { grid-column: 1; grid-row: 1; white-space: normal; padding: 0; }
  .tbl.flips td:nth-child(6) { grid-column: 2; grid-row: 1; align-self: center; }
  .tbl.flips tbody tr td:nth-child(2) { grid-column: 1; grid-row: 2; text-align: left; padding-left: 2rem; }   /* under the name, past the icon */
  .tbl.flips td.act { grid-column: 2; grid-row: 2; width: auto; }
  .tbl.flips tbody tr td.opt { display: none; }
  .tbl.flips tr.t-legendary { box-shadow: inset 3px 0 0 var(--q-legendary); }
  .tbl.flips tr.t-legendary td:first-child { box-shadow: none; }
  button.buy { padding: 0 .6rem; font-size: .84rem; }
  .bst { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
