/* RAM Deal Finder — terminal-window aesthetic.
   Catppuccin Mocha-ish palette. Sans-serif body text, monospace accents
   (prompts, panel titles, metric values) for the riced-terminal feel. */

:root {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --surface0: #313244;
    --surface1: #45475a;
    --overlay0: #6c7086;
    --text: #cdd6f4;
    --subtext: #a6adc8;
    --muted: #7f849c;
    --blue: #89b4fa;
    --green: #a6e3a1;
    --mauve: #cba6f7;
    --peach: #fab387;
    --red: #f38ba8;
    --yellow: #f9e2af;
    --teal: #94e2d5;

    --mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--crust);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    padding: 18px 22px 16px;
    background: var(--mantle);
    border-bottom: 1px solid var(--surface0);
}

.site-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text);
    letter-spacing: 0.2px;
}

.site-header h1 a { color: inherit; }

.site-header .tagline {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.window-body {
    padding: 20px 22px 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── layout ─────────────────────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

/* ── panels ─────────────────────────────────────────────────────── */
.panel {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: 6px;
    overflow: hidden;
}

.panel-title {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--mauve);
    padding: 8px 12px;
    background: var(--surface0);
    border-bottom: 1px solid var(--surface0);
    letter-spacing: 0.3px;
}

.panel-title::before { content: "─ "; color: var(--overlay0); }
.panel-title::after  { content: " ─"; color: var(--overlay0); }

/* Muted "· last updated …" suffix tacked onto the result-count line. Stays
   the same font weight/size as the surrounding text so it reads as one phrase. */
.result-count-meta {
    margin-left: 6px;
    color: var(--muted);
}

.panel-body {
    padding: 14px 14px 16px;
}

/* ── filters ────────────────────────────────────────────────────── */
.filters form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 15px;
}

.filters fieldset {
    border: 1px solid var(--surface0);
    border-radius: 4px;
    padding: 10px 12px 12px;
    margin: 0;
}

.filters legend {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--teal);
    padding: 0 6px;
    text-transform: lowercase;
    letter-spacing: 0.4px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field span {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--subtext);
    letter-spacing: 0.3px;
}

.field input,
.field select,
.filters input[type="text"],
.filters input[type="number"],
.filters select {
    padding: 6px 8px;
    border: 1px solid var(--surface1);
    border-radius: 4px;
    background: var(--base);
    color: var(--text);
    font: inherit;
    font-family: var(--mono);
    font-size: 14px;
}

.field input:focus,
.field select:focus,
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--mauve);
    box-shadow: 0 0 0 2px rgba(203,166,247,0.18);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 0;
    color: var(--text);
}

.checkbox input { accent-color: var(--mauve); }
.checkbox span { font-family: var(--mono); font-size: 14px; }

.actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.actions button {
    background: var(--mauve);
    color: var(--crust);
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.actions button:hover { background: var(--blue); }

.actions .reset {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 14px;
}

/* ── results ────────────────────────────────────────────────────── */
.result-count {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--subtext);
    margin: 0 0 10px;
    padding: 0 4px;
}
.result-count::before { content: "» "; color: var(--green); }
.result-count .num { color: var(--peach); font-weight: 600; }

.table-wrap {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid var(--surface0);
    background: var(--base);
}

table.products {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

table.products th,
table.products td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--surface0);
    vertical-align: top;
}

table.products thead th {
    background: var(--surface0);
    color: var(--teal);
    font-family: var(--mono);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--surface1);
}

table.products tbody tr:nth-child(even) { background: rgba(49,50,68,0.25); }
table.products tbody tr:hover { background: var(--surface0); }
table.products tbody tr:last-child td { border-bottom: none; }

table.products td.mono,
table.products .price-per-gb,
table.products td.num {
    font-family: var(--mono);
    font-size: 14px;
}

.price-per-gb {
    font-weight: 600;
    color: var(--green);
    white-space: nowrap;
}

.price-cell { color: var(--text); font-family: var(--mono); }
.price-move {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    vertical-align: middle;
}
.price-move-up   { background: rgba(243,139,168,0.15); color: var(--red);   border: 1px solid rgba(243,139,168,0.35); }
.price-move-down { background: rgba(166,227,161,0.18); color: var(--green); border: 1px solid rgba(166,227,161,0.45); }

.stock-cell { font-family: var(--mono); white-space: nowrap; }
.stock-cell .stock-yes { color: #2e8540; font-weight: 600; }
.stock-cell .stock-no { color: #b22; font-weight: 600; }
.stock-cell .stock-unknown { color: var(--muted); }
.stock-cell .stock-checked { font-size: 11px; color: var(--muted); margin-top: 2px; }

.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 12px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-warn { background: rgba(249,226,175,0.15); color: var(--yellow); border: 1px solid rgba(249,226,175,0.3); }
.badge-info { background: rgba(137,180,250,0.15); color: var(--blue); border: 1px solid rgba(137,180,250,0.3); }

.deal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Scoring transparency panel ───────────────────────────────────────────── */
.scoring-info {
    margin: 0 0 12px 0;
    padding: 10px 14px;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-left: 3px solid var(--blue);
    border-radius: 4px;
    font-size: 14px;
}
.scoring-info > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-family: var(--mono);
    user-select: none;
}
.scoring-info > summary::-webkit-details-marker { display: none; }
.scoring-info .info-icon {
    color: var(--blue);
    font-size: 16px;
}
.scoring-info .info-toggle {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    text-transform: lowercase;
}
.scoring-info[open] .info-toggle::after { content: ""; }
.scoring-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--surface0);
    color: var(--subtext);
    line-height: 1.55;
}
.scoring-intro {
    margin: 0 0 10px 0;
}
.scoring-intro strong {
    color: var(--text);
}
.scoring-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 12px;
    margin-bottom: 10px;
}
.scoring-row {
    display: contents;
}
.scoring-row > span:first-child {
    align-self: center;
}
.scoring-row > .badge {
    margin-left: 0;
}
.scoring-row > span:last-child {
    align-self: center;
    color: var(--subtext);
    font-family: var(--mono);
    font-size: 13px;
}
.scoring-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-family: var(--mono);
}

/* ── Pinned items (user-driven, persisted in localStorage) ──────────────── */
/* Outer chrome (background / border / radius / title) comes from .panel + .panel-title
   so this section visually matches the filters and listings panels. Only the
   bottom spacing — which separates the panel from the layout grid below — is
   kept here. */
.pinned {
    margin: 0 0 16px 0;
}
.pinned-hint {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--muted);
    font-family: var(--mono);
}
.pinned-card .highlight-header {
    position: relative;
    padding-right: 24px;
}
.pinned-link {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--blue) !important;
}
.pinned-link:hover {
    text-decoration: underline;
}
.unpin-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.unpin-btn:hover { color: var(--red); }

.pin-cell { text-align: center; width: 32px; }
.pin-btn {
    background: transparent;
    border: none;
    color: var(--overlay0);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 4px;
    transition: color 0.08s, transform 0.08s;
}
.pin-btn:hover { color: var(--yellow); }
.pin-btn.pinned { color: var(--yellow); }
.pin-btn.pinned:hover { color: var(--peach); }

/* ── Phase 5: highlights strip ─────────────────────────────────────────────── */
.highlights {
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: 4px;
}
.highlights .panel-title {
    font-family: var(--mono);
    color: var(--mauve);
    font-size: 14px;
    margin-bottom: 10px;
    letter-spacing: 0.4px;
}
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}
.highlight-card {
    display: block;
    padding: 12px 14px;
    background: var(--base);
    border: 1px solid var(--surface0);
    border-left: 3px solid var(--overlay0);
    border-radius: 3px;
    text-decoration: none !important;
    color: var(--text) !important;
    transition: transform 0.08s ease, border-color 0.08s ease;
}
.highlight-card:hover {
    transform: translateY(-1px);
    border-left-color: var(--mauve);
}
/* Category accent stripes — color signals which bucket the card represents. */
.highlight-ddr5-desktop { border-left-color: var(--mauve); }
.highlight-ddr4-desktop { border-left-color: var(--blue); }
.highlight-laptop       { border-left-color: var(--peach); }
.highlight-ecc          { border-left-color: var(--teal); }
.highlight-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--subtext);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.highlight-icon { font-size: 16px; }
.highlight-title { flex: 1; }
.highlight-flags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.highlight-flags .badge { margin-left: 0; }
.highlight-brand {
    font-family: var(--mono);
    color: var(--blue);
    font-size: 13px;
    margin-bottom: 2px;
}
.highlight-product {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.highlight-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.highlight-price {
    font-family: var(--mono);
    font-size: 18px;
    color: var(--green);
    font-weight: 600;
}
.highlight-ppg {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

/* ── Phase 5: chip-bar quick filters ───────────────────────────────────────── */
.chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface0);
}
.chip {
    display: inline-block;
    padding: 4px 10px;
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 12px;
    color: var(--text) !important;
    font-family: var(--mono);
    font-size: 14px;
    text-decoration: none !important;
    transition: background 0.08s, border-color 0.08s, color 0.08s;
    cursor: pointer;
    white-space: nowrap;
}
.chip:hover {
    background: var(--surface1);
    border-color: var(--overlay0);
}
.chip-active {
    background: var(--mauve);
    color: var(--crust) !important;
    border-color: var(--mauve);
}
.chip-default {
    border-color: var(--overlay0);
}
.deal-great_deal  { background: rgba(166,227,161,0.18); color: var(--green); border: 1px solid rgba(166,227,161,0.45); }
.deal-good_price  { background: rgba(137,180,250,0.18); color: var(--blue);  border: 1px solid rgba(137,180,250,0.45); }
.deal-normal      { background: rgba(108,112,134,0.18); color: var(--subtext); border: 1px solid rgba(108,112,134,0.35); }
.deal-overpriced  { background: rgba(243,139,168,0.15); color: var(--red);   border: 1px solid rgba(243,139,168,0.35); }
.deal-unscored    { color: var(--subtext); opacity: 0.5; }

.buy-link {
    display: inline-block;
    background: var(--green);
    color: var(--crust) !important;
    padding: 4px 10px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
}
.buy-link:hover { background: var(--teal); text-decoration: none; }

.buy-link-large {
    font-size: 15px;
    padding: 10px 18px;
    margin-top: 10px;
}

.empty {
    padding: 32px;
    text-align: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 15px;
    background: var(--base);
    border: 1px dashed var(--surface1);
    border-radius: 6px;
}
.empty::before { content: "∅ "; color: var(--red); }

/* ── detail page ────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-bottom: 14px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
}
.back-link:hover { color: var(--blue); }

.detail h2 {
    margin: 6px 0 14px;
    font-size: 20px;
    color: var(--text);
}

.detail-grid {
    display: grid;
    /* Price column gets just enough to hold the image + buy button comfortably;
       the chart claims everything else because price-history is the page's main
       payload — a wider chart reads ranges and trends far better. */
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 18px;
    /* Row-1 items (price + chart) stretch to equal height — visually paired
       headers. The alert panel in row 2 overrides this with `justify-self`
       so it stays content-sized and centered. */
    align-items: stretch;
}

.product-image {
    /* Sits inside the price panel, so no extra background / border — let the
       panel chrome carry the framing. */
    margin: 0 0 14px 0;
    text-align: center;
}
.product-image img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.detail .panel-body .price {
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 600;
    color: var(--peach);
    margin: 0 0 4px;
}
.detail .panel-body .price .price-per-gb {
    font-size: 15px;
    color: var(--green);
    margin-left: 8px;
    font-weight: 500;
}

dl.specs {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 0;
    font-family: var(--mono);
    font-size: 14px;
}
dl.specs dt { color: var(--teal); }
dl.specs dt::after { content: ":"; color: var(--overlay0); }
dl.specs dd { margin: 0; color: var(--text); }

/* ── price history chart ────────────────────────────────────────── */
/* Chart sits side-by-side with the price panel inside `.detail-grid`, so no top
   margin — the grid's `gap` handles spacing between the two panels. */

.chart-context {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--subtext);
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}
.chart-context .ctx-label { color: var(--muted); }
.chart-context .ctx-key   { color: var(--peach); word-break: break-all; }
.chart-context .ctx-note  { color: var(--muted); font-style: italic; }

.chart-wrap {
    position: relative;
    height: 360px;
    width: 100%;
}

.chart-empty {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
    background: var(--base);
    border: 1px dashed var(--surface1);
    border-radius: 4px;
    padding: 18px;
    text-align: center;
}
.chart-empty code {
    color: var(--teal);
    background: rgba(148,226,213,0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

dl.chart-stats {
    margin: 14px 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 12px;
    font-family: var(--mono);
    font-size: 13px;
}
dl.chart-stats dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
dl.chart-stats dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }

/* ── status bar (footer) ────────────────────────────────────────── */
.statusbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    background: var(--mantle);
    border-top: 1px solid var(--surface0);
    font-family: var(--mono);
    font-size: 13px;
    color: var(--subtext);
}

.statusbar .seg {
    padding: 6px 12px;
    border-right: 1px solid var(--surface0);
    display: flex;
    align-items: center;
    gap: 6px;
}

.statusbar .seg:last-child { border-right: none; margin-left: auto; }

.statusbar .label { color: var(--muted); }
.statusbar .val { color: var(--text); }
.statusbar .ok { color: var(--green); }
.statusbar .info { color: var(--blue); }

.disclosure {
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
    background: var(--crust);
    border-top: 1px solid var(--surface0);
    margin-top: auto;
}

/* ── price-alert panel (product detail page) ─────────────────────── */
/* Row 2: alert in column 1 (under the price panel), peers in column 2
   (under the chart panel). Pairing them keeps the buy-flow CTA on the
   left and the comparison data on the right, mirroring row 1's layout. */
.alert-panel { grid-column: 1; }
.peers-panel { grid-column: 2; }

/* ── similar-products panel (product detail page) ────────────────── */
.peers-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-family: var(--mono);
    font-size: 13px;
}
.peers-summary-label { color: var(--subtext); }
.peers-summary-delta { padding: 2px 8px; border-radius: 3px; font-weight: 600; }
.peers-above { background: rgba(243,139,168,0.15); color: var(--red);   border: 1px solid rgba(243,139,168,0.3); }
.peers-below { background: rgba(166,227,161,0.18); color: var(--green); border: 1px solid rgba(166,227,161,0.4); }
.peers-same  { background: rgba(137,180,250,0.12); color: var(--blue);  border: 1px solid rgba(137,180,250,0.3); }
.peers-empty {
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
}
.peers-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.peer-item { border-bottom: 1px solid var(--surface0); }
.peer-item:last-child { border-bottom: none; }
.peer-link {
    display: grid;
    /* Columns: thumb | price | "you: ±X%" delta | stock pill | title */
    grid-template-columns: 44px 64px 88px 60px 1fr;
    gap: 8px;
    align-items: center;
    padding: 6px 4px;
    color: inherit;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 13px;
}
.peer-link:hover { background: var(--surface0); text-decoration: none; }
.peer-thumb {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--base);
    border: 1px solid var(--surface0);
    border-radius: 3px;
    overflow: hidden;
}
.peer-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.peer-thumb-empty { color: var(--overlay0); font-size: 14px; }
.peer-price { font-weight: 600; }
.peer-delta {
    justify-self: start;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.peer-stock {
    justify-self: start;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.peer-stock-yes     { color: var(--green); border: 1px solid rgba(166,227,161,0.4); }
.peer-stock-no      { color: var(--red);   border: 1px solid rgba(243,139,168,0.4); }
.peer-stock-unknown { color: var(--muted); border: 1px dashed var(--surface0); }
.peer-title {
    color: var(--subtext);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.alert-blurb {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0 0 10px;
    line-height: 1.45;
}
.alert-banner {
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 12.5px;
    margin: 0 0 10px;
    font-family: var(--mono);
}
.alert-pending { background: rgba(137,180,250,0.12); color: var(--blue);   border: 1px solid rgba(137,180,250,0.3); }
.alert-updated { background: rgba(166,227,161,0.12); color: var(--green);  border: 1px solid rgba(166,227,161,0.35); }
.alert-invalid { background: rgba(243,139,168,0.12); color: var(--red);    border: 1px solid rgba(243,139,168,0.3); }
.alert-form-body { display: flex; flex-direction: column; gap: 8px; }
.alert-field { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--subtext); }
.alert-field input {
    background: var(--base);
    color: var(--text);
    border: 1px solid var(--surface0);
    border-radius: 4px;
    padding: 6px 8px;
    font-family: var(--mono);
    font-size: 13px;
}
.alert-field input:focus { outline: none; border-color: var(--blue); }
.alert-submit {
    margin-top: 4px;
    padding: 8px 12px;
    background: var(--blue);
    color: var(--crust);
    border: 0;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.alert-submit:hover { filter: brightness(1.1); }
/* Honeypot — kept in DOM but yanked off-screen so screen readers and bots
   still see it while humans never do. Visually-hidden pattern. */
.alert-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.disclosure::before { content: "# "; color: var(--overlay0); }

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    /* Without these resets, `.peers-panel { grid-column: 2 }` from row 2 keeps
       forcing an implicit second column wide enough for the nowrap peer titles,
       squeezing the price + alert panels in column 1 down to zero width. */
    .alert-panel, .peers-panel { grid-column: 1; }
}

@media (max-width: 600px) {
    .window-body { padding: 14px 14px 4px; }
    .site-header { padding: 14px 14px 12px; }
    .detail h2 { font-size: 17px; }
    .detail .panel-body .price { font-size: 26px; }
    .chart-wrap { height: 280px; }
    /* Make tap targets meet the 44px guideline and stop iOS zoom-on-focus by
       holding inputs at >=16px. */
    .alert-field input,
    .alert-submit { font-size: 16px; padding: 10px 12px; }
    /* Peer rows: drop to a two-line layout so the title can wrap and the
       price/delta/stock row stays scannable on a narrow viewport. */
    .peer-link {
        grid-template-columns: 40px 1fr auto;
        grid-template-areas:
            "thumb price stock"
            "thumb title title"
            "thumb delta delta";
        row-gap: 2px;
        padding: 8px 4px;
    }
    .peer-thumb { grid-area: thumb; width: 40px; height: 40px; }
    .peer-price { grid-area: price; }
    .peer-stock { grid-area: stock; justify-self: end; }
    .peer-title { grid-area: title; white-space: normal; }
    .peer-delta { grid-area: delta; justify-self: start; }
}
