/* The item page: prices and the ways to trade first, everything else folded away. */
.item-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 0 40px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

/* One strip across the top: the item, its two prices, the three actions. */
.strip { display: grid; grid-template-columns: minmax(0, 1.2fr) auto auto; gap: 20px; align-items: center; }
.ident { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.item-pic { width: 88px; height: 88px; border-radius: 14px; background: var(--tile); display: grid; place-items: center; }
.ident h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
.ident .sub { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chips span { font-size: 13px; background: var(--chip); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.stat-chips b { font-weight: 700; }
.prices { display: flex; gap: 22px; padding: 0 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); align-self: stretch; align-items: center; }
.pricebox .lab { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pricebox .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.pricebox.second .val { font-size: 20px; font-weight: 700; }
.pricebox .val.none { color: var(--muted); font-size: 17px; font-weight: 600; }
.pricebox .why { font-size: 12px; color: var(--muted); white-space: nowrap; }
.acts { display: grid; gap: 6px; min-width: 190px; }
.acts button { border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--chip); font-weight: 600; text-align: center; }
.acts button.main { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.acts button:hover { border-color: var(--accent); }
.acts .no { color: var(--muted); font-size: 14px; max-width: 22ch; }
@media (max-width: 980px) {
  .strip { grid-template-columns: minmax(0, 1fr); }
  .prices { border: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
  .acts { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
}
@media (max-width: 520px) { .acts { grid-template-columns: minmax(0, 1fr); } }
details.more { margin-top: 12px; font-size: 14px; }
details.more summary { cursor: pointer; color: var(--muted); }
details.more p { margin: 8px 0; max-width: 70ch; }
details.more dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; }
details.more dt { color: var(--muted); }
details.more dd { margin: 0; }

/* One row of filters above everything they change. */
.filters { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.filters .group { display: inline-flex; gap: 4px; align-items: center; }
.filters .group > span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.filters .note { color: var(--muted); font-size: 13px; }

.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }

/* Charts. Series colours are a validated pair: blue for sold, orange for listed. */
.viz { margin: 0; --s1: #2a78d6; --s2: #eb6834; --grid: #e7e4dc; --axis: #c9c5ba; }
@media (prefers-color-scheme: dark) { .viz { --s1: #3987e5; --s2: #d95926; --grid: #2c2f38; --axis: #3d414c; } }
.viz figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; margin-bottom: 6px; }
.viz figcaption b { font-size: 15px; }
.legend { display: inline-flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key.line { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.plot-box { position: relative; }
.plot { position: relative; width: 100%; }
.plot svg { display: block; overflow: visible; }
.plot .grid { stroke: var(--grid); stroke-width: 1; }
.plot .axis { stroke: var(--axis); stroke-width: 1; }
.plot .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .dot { stroke: var(--panel); stroke-width: 2; }
.plot .end { fill: var(--text); font-size: 12px; font-weight: 600; }
.plot .cross { stroke: var(--axis); stroke-width: 1; }
.plot .ghost { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 7; stroke-linecap: round; opacity: .28; }
.plot .ghost-dot { fill: var(--muted); opacity: .2; }
.plot .mark { stroke: var(--text); stroke-width: 1; opacity: .7; }
.plot .mark-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.empty-plot { position: absolute; inset: 0 0 22px 0; display: grid; place-items: center; padding: 0 12px; }
.empty-card { display: grid; gap: 4px; justify-items: center; text-align: center; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; max-width: 340px; font-size: 13px; color: var(--muted); }
.empty-card > b { color: var(--text); font-size: 15px; }
.empty-card .btn { margin-top: 6px; padding: 6px 14px; }
.empty-card .progress { display: flex; gap: 14px; }
.empty-card .progress b { color: var(--text); }
.waiting { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.waiting i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: wait 1.8s ease-in-out infinite; }
@keyframes wait { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.tip { position: absolute; z-index: 3; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); white-space: nowrap; }
.tip[hidden] { display: none; }
.tip > b { display: block; margin-bottom: 2px; }
.tip div { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.tip div b { color: var(--text); }
.as-table { margin-top: 6px; font-size: 13px; }
.as-table summary { cursor: pointer; color: var(--muted); }
.as-table table { border-collapse: collapse; margin-top: 6px; }
.as-table th, .as-table td { text-align: left; padding: 3px 14px 3px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* Listings: one panel, four tabs. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px -4px 10px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; background: var(--chip); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .price { font-size: 16px; }
.rows .what { overflow-wrap: anywhere; font-size: 14px; }
.rows .what small { display: block; color: var(--muted); font-size: 12px; }
.row-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.row-acts .chip { padding: 2px 9px; font-size: 13px; }
.rows-empty { color: var(--muted); margin: 6px 0; font-size: 14px; }

.post .fields { padding: 16px; display: grid; gap: 12px; overflow-y: auto; }
.post label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.post input, .post select { padding: 9px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--text); }
.post .send { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
#form-error { color: #d12c4a; font-size: 13px; }

/* A listing in full. */
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); text-decoration: underline; }
.full { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(240px, 300px); gap: 24px; align-items: start; }
@media (max-width: 860px) { .full { grid-template-columns: minmax(0, 1fr); } }
.full-pic .tile { width: 150px; height: 150px; border-radius: 18px; }
.full-main h1 { margin: 6px 0 2px; font-size: 28px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.full-main h1.up { color: var(--scrolled); }
.full-main .sub { color: var(--muted); margin: 0 0 10px; }
.full-main .note { margin: 0 0 12px; font-size: 16px; max-width: 60ch; }
.kind-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--chip); border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.kind-tag.sold { background: var(--good-bg); color: var(--good); }
.facts-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; }
.full-side { display: grid; gap: 12px; align-content: start; border-left: 1px solid var(--line); padding-left: 24px; }
@media (max-width: 860px) { .full-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; } }
.full-side .lab { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: -8px; }
.full-side .big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.vs { display: grid; gap: 4px; justify-items: start; }
.vs small, .vs.none { color: var(--muted); font-size: 13px; }
.seller-box { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.seller-box .av { --h: 24; }
.seller-box b { display: block; }
.seller-box small { color: var(--muted); font-size: 12px; }
.full-side .acts { min-width: 0; }
.acts button:disabled { opacity: .55; cursor: not-allowed; }
.rows a.what { text-decoration: none; }
.rows a.what:hover { text-decoration: underline; }

/* The listing page's extra sections. */
.h { font-size: 15px; margin: 0 0 8px; }
.base { margin-top: 14px; }
.base .lab { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.full-main .desc { margin: 12px 0 0; color: var(--muted); font-size: 14px; max-width: 62ch; }
.rows .diff { font-size: 12px; color: var(--muted); white-space: nowrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.steps b { display: block; font-size: 14px; }
.steps small { color: var(--muted); font-size: 13px; }

.mock-note { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }

.stats-table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { text-align: left; padding: 4px 18px 4px 0; border-bottom: 1px solid var(--line); }
.stats-table thead th { color: var(--muted); font-weight: 400; font-size: 13px; }
details.more + details.more { margin-top: 6px; }
