/* PoE Mint — styles. Dark is the default; light is a real theme, not an afterthought.
   Every colour is a token defined for both, with no exceptions -- a value that only
   exists in one of them is a bug waiting for the other. */

:root{
  --plane:#0d0d0d; --surface:#1a1a19;
  --ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781;
  --grid:#2c2c2a; --axis:#383835;
  --s1:#3987e5; --s2:#d95926;
  --good:#0ca30c; --bad:#ea706e; --warn:#e0a80f;
  --border:rgba(255,255,255,.10);
  --hover:rgba(128,128,128,.06);
  --chip:rgba(128,128,128,.10);
  --radius:10px;
  --font:system-ui,-apple-system,"Segoe UI",sans-serif;
}
:root[data-theme="light"]{
  --plane:#f9f9f7; --surface:#fcfcfb;
  --ink:#0b0b0b; --ink-2:#52514e; --muted:#6e6c67;
  --grid:#e1e0d9; --axis:#c3c2b7;
  --s1:#2a78d6; --s2:#eb6834;
  --good:#006300; --bad:#c02b2b; --warn:#8a6200;
  --border:rgba(11,11,11,.12);
  --hover:rgba(128,128,128,.08);
  --chip:rgba(11,11,11,.07);
}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    --plane:#f9f9f7; --surface:#fcfcfb;
    --ink:#0b0b0b; --ink-2:#52514e; --muted:#6e6c67;
    --grid:#e1e0d9; --axis:#c3c2b7;
    --s1:#2a78d6; --s2:#eb6834;
    --good:#006300; --bad:#c02b2b; --warn:#8a6200;
    --border:rgba(11,11,11,.12);
    --hover:rgba(128,128,128,.08);
    --chip:rgba(11,11,11,.07);
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--plane); color:var(--ink); font-family:var(--font);
  font-size:14px; line-height:1.45; -webkit-font-smoothing:antialiased}
.num{font-variant-numeric:tabular-nums}
a{color:inherit}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------------------------------------------------------------- chrome */
.topbar{display:flex; align-items:center; gap:16px; padding:0 22px; height:56px;
  border-bottom:1px solid var(--border); background:var(--surface);
  position:sticky; top:0; z-index:20; flex-wrap:wrap}
.brand{display:flex; align-items:center; gap:9px; font-weight:650;
  letter-spacing:-.01em; text-decoration:none; color:var(--ink)}
.seg{display:flex; background:var(--chip); border-radius:8px; padding:3px; gap:2px}
.seg button{font:inherit; font-size:13px; font-weight:550; color:var(--ink-2);
  background:none; border:0; padding:5px 14px; border-radius:6px; cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--surface); color:var(--ink);
  box-shadow:0 1px 2px rgba(0,0,0,.35), 0 0 0 1px var(--border)}
.spacer{flex:1}
select,.ghost{font:inherit; font-size:13px; color:var(--ink-2); background:transparent;
  border:1px solid var(--border); border-radius:7px; padding:6px 10px; cursor:pointer;
  max-width:220px}
/* A <select> will not shrink below the intrinsic width of its widest option, so it sizes
   itself; max-width's only job is to stay out of the way. 380px is deliberately slack,
   not a fit -- a cap set just above today's widest option is a cliff, because one longer
   league name or one wider font binds it again and text-overflow hides that. Keep it
   slack. The ellipsis is the floor, not the fix: a <select> otherwise clips mid-word and
   reads as a rendering fault. */
#leagueSel{max-width:380px; text-overflow:ellipsis}
.deflabel{font-size:10.5px; letter-spacing:.05em; text-transform:uppercase;
  color:var(--muted); border:1px solid var(--border); border-radius:4px; padding:1px 5px}
/* Sits in the DEFAULT chip's slot, beside the picker. The two are mutually exclusive --
   a league that does not open is never the default -- so the slot is always free when
   this needs it, and it stays as close to the control as anything in the bar can be. */
.leaguenote{font-size:12px; color:var(--muted)}
.leaguenote:empty{display:none}
.searchwrap{position:relative}
.searchwrap input{font:inherit; font-size:13px; color:var(--ink);
  background:var(--chip); border:1px solid transparent;
  border-radius:7px; padding:6px 10px 6px 30px; width:200px; outline:none}
.searchwrap input:focus{border-color:var(--s1)}
.searchwrap svg{position:absolute; left:9px; top:50%; transform:translateY(-50%); opacity:.5}

.wrap{max-width:1320px; margin:0 auto; padding:22px 22px 60px}
.card{background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 20px}
.tablecard{overflow-x:auto; padding:16px 20px 4px}

/* ------------------------------------------------------ staleness banner */
.banner{display:flex; gap:11px; align-items:flex-start; font-size:13px;
  border:1px solid var(--border); border-radius:8px; padding:12px 14px;
  margin-bottom:18px; background:var(--surface)}
.banner.warn{border-left:3px solid var(--warn)}
.banner.bad{border-left:3px solid var(--bad)}
.banner .lead{color:var(--ink); font-weight:640; flex:none}
.banner .body{color:var(--ink-2)}
.freshnote{font-size:12px; color:var(--muted); margin:-8px 0 16px}

/* ------------------------------------------------------------- market list */
h1.title{font-size:19px; font-weight:650; letter-spacing:-.02em; margin:0 0 4px}
.seccap{font-size:12.5px; color:var(--muted); margin:0 0 14px; max-width:none}
.seccap:not(.tablenote){margin-bottom:6px}
table{width:100%; border-collapse:collapse}
th{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  font-weight:600; text-align:right; padding:0 0 10px;
  border-bottom:1px solid var(--border); white-space:nowrap}
th:first-child{text-align:left}
th button{font:inherit; color:inherit; background:none; border:0; padding:0;
  cursor:pointer; letter-spacing:inherit; text-transform:inherit; font-weight:inherit}
th[aria-sort] button{color:var(--ink)}
td{padding:10px 0; border-bottom:1px solid var(--border); text-align:right; font-size:13.5px}
/* Cells need horizontal padding. A wide table hides its absence; narrow, the last two
   headers run together and read as one word. */
th + th, td + td{padding-left:10px}
td:first-child{text-align:left}
th.act,td.act{text-align:left; padding-left:24px}
tbody tr{cursor:pointer}
tbody tr:hover td{background:var(--hover)}
tr.quiet td{color:var(--muted)}
.pairc{display:flex; align-items:center; gap:9px; min-width:0}
.pill{width:22px; height:22px; border-radius:6px; flex:none; display:grid;
  place-items:center; font-size:9.5px; font-weight:700; color:#fff; letter-spacing:-.02em;
  overflow:hidden}
.pill img{width:22px; height:22px; object-fit:contain; display:block}
.pairtext{min-width:0}
.pairtext .q{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:46ch}
.sub2{font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; max-width:46ch}
.rawid{font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px;
  color:var(--ink-2)}
.up{color:var(--good)} .down{color:var(--bad)} .none{color:var(--muted)}
.strip{display:inline-flex; gap:1px; vertical-align:middle}
.strip i{width:3px; height:12px; border-radius:1px; background:var(--chip)}
.strip i.on{background:var(--s1)}
.actwrap{display:inline-flex; align-items:center; gap:9px}
.actn{font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums;
  width:38px; text-align:right}
.more{margin:14px 0 2px; text-align:center}
.more button{font:inherit; font-size:13px; color:var(--ink-2); background:var(--chip);
  border:1px solid var(--border); border-radius:7px; padding:7px 16px; cursor:pointer}

/* ------------------------------------------------------------ pair detail */
.crumb{font-size:12.5px; color:var(--muted); margin-bottom:14px}
.crumb a{color:var(--ink-2)}
.pairhead{display:flex; align-items:flex-end; gap:26px; flex-wrap:wrap; margin-bottom:18px}
.pairname{font-size:12px; letter-spacing:.09em; text-transform:uppercase;
  color:var(--muted); margin-bottom:6px}
.pairtitle{font-size:22px; font-weight:640; letter-spacing:-.02em;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.swap{color:var(--muted); font-weight:400; font-size:15px}
.hero{display:flex; align-items:baseline; gap:12px}
.heronum{font-size:44px; font-weight:660; letter-spacing:-.03em; line-height:1}
.heronum.empty{font-size:26px; color:var(--muted); font-weight:600}
.delta{display:inline-flex; align-items:center; gap:5px; font-size:14px;
  font-weight:600; padding:3px 9px; border-radius:999px}
.delta.up{color:var(--good); background:color-mix(in srgb, var(--good) 14%, transparent)}
.delta.down{color:var(--bad); background:color-mix(in srgb, var(--bad) 14%, transparent)}
.delta.none{color:var(--muted); background:var(--chip)}

.tiles{display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:14px}
.tile{background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 16px}
.tile .k{font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); margin-bottom:7px; white-space:nowrap}
.tile .v{font-size:19px; font-weight:620; letter-spacing:-.02em}
.tile .v.empty{font-size:15px; color:var(--muted); font-weight:550}
.tile .sub{font-size:11.5px; color:var(--ink-2); margin-top:3px}
.twoside{display:flex; flex-direction:column; gap:3px; margin-top:1px}
.twoside .r{display:flex; align-items:baseline; justify-content:space-between; gap:10px}
.twoside .n{font-size:15px; font-weight:620; letter-spacing:-.01em}
.twoside .c{font-size:11px; color:var(--muted); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; max-width:16ch}

.chartcard{margin-bottom:14px; position:relative}
.charthead{display:flex; align-items:flex-start; justify-content:space-between;
  margin-bottom:2px; gap:16px; flex-wrap:wrap}
.charttitle{font-size:14px; font-weight:600}
.chartsub{font-size:12px; color:var(--muted); margin-top:1px}
.ranges{display:flex; gap:2px; background:var(--chip); border-radius:7px; padding:3px}
.ranges button{font:inherit; font-size:12px; font-weight:550; color:var(--ink-2);
  background:none; border:0; padding:4px 11px; border-radius:5px; cursor:pointer;
  max-width:15ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ranges button[aria-pressed="true"]{background:var(--surface); color:var(--ink);
  box-shadow:0 0 0 1px var(--border)}
.ranges button[disabled]{opacity:.4; cursor:default}
svg.chart{display:block; overflow:visible; width:100%}
.gridline{stroke:var(--grid); stroke-width:1}
.axisline{stroke:var(--axis); stroke-width:1}
.tick{fill:var(--muted); font-size:11px}
.patchline{stroke:var(--muted); stroke-width:1; stroke-dasharray:2 3}
.patchhit{cursor:pointer}
.patchtag{fill:var(--muted); font-size:10px; font-weight:600; letter-spacing:.03em}
.legend{display:flex; gap:14px; align-items:center; font-size:12px; color:var(--ink-2);
  margin-top:8px; flex-wrap:wrap}
.legend .i{display:inline-flex; align-items:center; gap:6px}
.legend .sw{width:9px; height:9px; border-radius:2px}
.legend .swp{width:0; height:11px; border-left:1px dashed var(--muted)}
.legend .qual{color:var(--muted)}
.tip{position:absolute; pointer-events:none; opacity:0; transition:opacity .1s;
  background:var(--surface); border:1px solid var(--border); border-radius:8px;
  padding:9px 11px; font-size:12.5px; min-width:170px; z-index:10;
  box-shadow:0 8px 24px rgba(0,0,0,.45)}
.tip.pinned{pointer-events:auto}
.tip .t{color:var(--muted); font-size:11px; letter-spacing:.05em;
  text-transform:uppercase; margin-bottom:6px}
.tip .row{display:flex; align-items:center; justify-content:space-between;
  gap:16px; margin-top:3px}
.tip .lbl{display:flex; align-items:center; gap:6px; color:var(--ink-2)}
.dot{width:8px; height:8px; border-radius:2px; flex:none}
.emptychart{display:grid; place-items:center; height:160px; color:var(--muted);
  font-size:13px; text-align:center; padding:0 20px}

.notfound{padding:40px 0; max-width:60ch}
.notfound h1{font-size:20px; margin:0 0 8px}
.notfound p{color:var(--ink-2)}

footer{margin-top:34px; font-size:11.5px; color:var(--muted); line-height:1.7;
  border-top:1px solid var(--border); padding-top:16px}
footer p{margin:0 0 6px}

@media (max-width:1000px){
  .tiles{grid-template-columns:repeat(2,1fr)}
  .topbar{height:auto; padding:8px 14px; gap:10px}
  .wrap{padding:16px 14px 48px}
  .searchwrap input{width:150px}
  .heronum{font-size:34px}
}

/* Narrow screens. With five columns and no wrapping the table is 631-663px wide, so the
   document scrolls sideways below about 690px; the breakpoint sits at 760px for margin.

   Ids WRAP, never ellipsise: two ids differing only in a trailing digit would render
   identically under an ellipsis, which is the same failure as inventing a name. A taller
   row is the cheaper cost. */
@media (max-width:760px){
  th.hidesm, td.hidesm{display:none}
  .pairtext .q, td .sub2{white-space:normal; overflow-wrap:anywhere;
    max-width:none; text-overflow:clip}
  /* A 1fr track has an auto minimum, so a tile whose label cannot wrap pushes the grid
     wider than its container -- which overflows the pair page at the narrowest widths.
     minmax(0,1fr) lets the track shrink and the label wrap instead. */
  .tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tile .k{white-space:normal}
  /* The headers, not the data, set three of the four column widths -- "LAST TRADED" is
     90px of a 350px table. Wrapping them returns that space to the pair column. */
  th{white-space:normal}
  /* 16px of card padding is 16px the table does not have. At 320px that is the difference
     between an id breaking three times and breaking twice. */
  .tablecard{padding-left:12px; padding-right:12px}
  /* The banner is a flex ROW with a non-shrinking lead: at these widths the lead takes
     most of the row and the body wraps into a four-word ribbon down the right-hand side.
     It is the most-read element on the worst day this site has, so it stacks instead. */
  .banner{flex-direction:column; gap:3px}
  /* The picker takes the whole row rather than the width of its longest option: system
     fonts differ by platform, so a margin measured on one is not portable.
     .spacer goes with it -- it pushes the search and theme controls right on a single-row
     bar, but once the bar wraps it lands at the start of the next row and shoves them
     right, leaving a hole on the left. */
  #leagueSel{max-width:none; flex:1 1 100%}
  .spacer{display:none}
  /* The note takes its own row directly beneath the picker. Sharing a row with the
     filter box pushes the theme button onto a line of its own. It only appears for a
     league that does not open, so the extra row is not the common case. */
  .leaguenote{flex:1 0 100%}
}

/* The pair cell is a link so the row is keyboard-reachable and the URL is copyable. */
a.pairtext{text-decoration:none; color:inherit; display:block; min-width:0}
a.pairtext:focus-visible{outline:2px solid var(--s1); outline-offset:3px; border-radius:4px}
tbody tr:focus-within td{background:var(--hover)}
