/* donutorders.com */
:root {
  --bg: #0d0f12;
  --surface: #15181d;
  --surface-2: #1b1f26;
  --hover: #20252d;
  --line: #262b33;
  --text: #eceff3;
  --text-2: #a3abb7;
  --text-3: #8b94a1;
  --accent: #f5a524;
  --price: #ffc65c;
  --ench: #b794ff;
  --warn: #f0a04b;
  --focus: #6aa8ff;
  --up: #4ccf8a;
  --down: #ff6b6b;
  --radius: 12px;
  --radius-s: 8px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f3f4f7; --hover: #eef0f4; --line: #e1e5ea;
    --text: #14171b; --text-2: #4d5662; --text-3: #5a6370; --accent: #9c5a00; --price: #9a5b00;
    --ench: #6d3fd1; --warn: #995300; --focus: #1f6feb; --up: #0f7346; --down: #c62f2f;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f3f4f7; --hover: #eef0f4; --line: #e1e5ea;
  --text: #14171b; --text-2: #4d5662; --text-3: #5a6370; --accent: #9c5a00; --price: #9a5b00;
  --ench: #6d3fd1; --warn: #995300; --focus: #1f6feb; --up: #0f7346; --down: #c62f2f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
.price { color: var(--price); font-weight: 650; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.ench { color: var(--ench); }
.stale { color: var(--warn); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; }
.logo .mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--surface) 0 27%, var(--accent) 29% 100%); }
.logo b { color: var(--accent); font-weight: 800; }
.top .spacer { flex: 1; }
.top .meta { color: var(--text-3); font-size: 13px; }

/* page intro */
.intro { padding-top: 28px; padding-bottom: 6px; }
.intro h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; }
.intro p { margin: 0; color: var(--text-2); max-width: 62ch; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--text-3); font-size: 13.5px; min-height: 20px; } /* (room kept: no jump when it fills in) */
.summary strong { color: var(--text); font-weight: 600; }

/* toolbar (sticky) */
.toolbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 14px 0 10px; }
.toolbar .wrap { display: flex; gap: 10px; align-items: center; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 76px 0 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* 16px: no zoom-in on iOS */
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--text-2);
  height: 28px; padding: 0 10px; border-radius: 7px; font: inherit; font-size: 13px; cursor: pointer;
}
.search .clear:hover { color: var(--text); }
.search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 12px/1 inherit; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; pointer-events: none;
}
.select { position: relative; }
.select select {
  appearance: none; height: 44px; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border: solid var(--text-3); border-width: 0 1.6px 1.6px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.status { color: var(--text-3); font-size: 13px; margin: 2px 0 10px; min-height: 20px; }

/* item list: real links laid out as a grid */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row, .head {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 120px 74px 72px 104px 16px; gap: 12px; align-items: center; padding: 10px 16px;
}
.head { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); }
.head span, .row > span { text-align: right; }
.head span:first-child, .row > span:first-child { text-align: left; }
.row { text-decoration: none; border-bottom: 1px solid var(--line); min-height: 58px; }
#rows > :last-child > .row { border-bottom: 0; }
#rows > [role="listitem"] > .row { display: grid; }
.row:hover { background: var(--hover); }
.row:focus-visible { outline-offset: -2px; border-radius: 0; }
.row .chev { color: var(--text-3); }
.row:hover .chev { color: var(--text); }
.item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item .t { min-width: 0; }
.item .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.icon.ph { display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--text-3); font-size: 13px; font-weight: 700; }
.lbl { display: none; }
.item .s.m { display: none; }

.more { display: block; margin: 16px auto 0; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.more:hover { background: var(--hover); }
.more[hidden] { display: none; }

.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.skel { height: 58px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--surface-2), transparent) 0 0 / 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

/* item page */
.crumbs { margin: 20px 0 14px; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.ihead { display: flex; align-items: center; gap: 16px; }
.ihead .icon { width: 56px; height: 56px; }
.ihead .icon.ph { font-size: 22px; border-radius: 12px; }
.ihead h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
.ihead .sub { margin-top: 3px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .k { color: var(--text-3); font-size: 12.5px; }
.card .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .h { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.note { color: var(--text-3); font-size: 13px; margin: 0 0 4px; }
section { margin-top: 28px; }
section > h2 { font-size: 17px; margin: 0 0 4px; }
section > p { margin: 0 0 12px; color: var(--text-3); font-size: 13.5px; }

table.t { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.t th { text-align: right; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.t td { text-align: right; padding: 9px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.t tr:last-child td { border-bottom: 0; }
.t th:first-child, .t td:first-child { text-align: left; }
.t tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.t tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.t a { text-decoration: none; }
.t a:hover { text-decoration: underline; }
.t tbody tr:hover td { background: var(--hover); }
.depth { position: relative; }
.depth i { position: absolute; right: 0; top: 6px; bottom: 6px; background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 3px 0 0 3px; }
.depth span { position: relative; }
.filter { width: 100%; max-width: 320px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; margin-bottom: 10px; }
.filter:focus { outline: none; border-color: var(--focus); }

footer { color: var(--text-3); font-size: 13px; padding: 28px 0 40px; margin-top: 40px; border-top: 1px solid var(--line); }
footer p { margin: 0 0 6px; }

@media (max-width: 760px) {
  .intro h1, .ihead h1 { font-size: 23px; }
  .row, .head { grid-template-columns: minmax(0, 1fr) auto 12px; padding: 10px 12px; }
  .head { display: none; }
  .row .opt { display: none; }
  .row > span.tp { display: flex; flex-direction: column; align-items: flex-end; }
  .lbl { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
  .lbl .chg { font-size: 12px; font-weight: 600; }
  .skel { height: 74px; }
  .item .s:not(.m) { display: none; }
  .item .s.m { display: block; font-size: 12.5px; line-height: 1.35; }
  .row { align-items: start; }
  .row > svg.chev { align-self: center; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t th, .t td { padding: 8px 6px; font-size: 13px; }
  .t th { font-size: 11px; }
  .search kbd { display: none; }
  .toolbar .wrap { flex-wrap: wrap; gap: 8px; }
  .search { flex-basis: 100%; }
  .select select { height: 36px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.item .n, .item .s { display: block; }
[hidden] { display: none !important; }
.chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.sechead h2 { font-size: 17px; margin: 0; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg:empty { display: none; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; cursor: pointer; min-width: 44px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 8px 4px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .yl { fill: var(--text-3); font-size: 11px; text-anchor: end; dominant-baseline: middle; }
.chart .xl { fill: var(--text-3); font-size: 11px; }
.chart .xl.end { text-anchor: end; }
.chart .l { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .a { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.chart .p { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.nochart { padding: 22px 12px; color: var(--text-2); text-align: center; }
.chart { position: relative; }
.chart svg { cursor: crosshair; touch-action: pan-y; }
.chart .cur line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .cur circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; top: 8px; display: flex; flex-direction: column; gap: 1px; min-width: 170px; max-width: 240px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; line-height: 1.35; pointer-events: none;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); }
.tip strong { font-size: 15px; color: var(--price); font-variant-numeric: tabular-nums; }

/* every item as a plain link, folded away at the bottom of the home page (browsing + search engines) */
.allitems { margin-block: 32px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.allitems summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--text-2); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.allitems summary::-webkit-details-marker { display: none; }
.allitems summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 4px; }
.allitems[open] summary::after { transform: rotate(-135deg); }
.allitems summary:hover { color: var(--text); }
.allitems ul { list-style: none; margin: 0; padding: 4px 16px 16px; columns: 4 170px; column-gap: 24px; font-size: .88rem; line-height: 1.9; }
.allitems a { color: var(--text-2); text-decoration: none; }
.allitems a:hover { color: var(--text); text-decoration: underline; }

/* item with no orders right now */
.noorders { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.noorders h2 { margin: 0 0 8px; font-size: 1.15rem; }
.noorders p { margin: 0 0 8px; color: var(--text-2); }
