:root {
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg: #f1f5f9;
    --brand: #0f6e56;
    --brand-deep: #0a4f3d;
    --brand-soft: #e6f4ef;
    --accent: #b45309;
    --accent-soft: #fef3c7;
    --signal: #1d4ed8;
    --signal-soft: #eff6ff;
    --purple: #6d28d9;
    --purple-soft: #f3e8ff;
    --ok: #15803d;
    --ok-soft: #dcfce7;
    --warn: #b45309;
    --danger: #b91c1c;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;
    --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

a:hover { color: var(--brand-deep); }

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navigation */
.topbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-inner {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.7rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: inherit;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand:hover { color: inherit; }

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.08;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.brand-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 140ms ease;
}

.nav a:hover,
.nav a.is-active {
    background: var(--brand-soft);
    color: var(--brand-deep);
    border-color: #c2e3d7;
}

.nav-secondary {
    margin-left: auto;
    padding-left: 0.9rem;
    border-left: 1px solid var(--line);
}

.nav-secondary a {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.35rem 0.65rem;
}

.page {
    width: min(1320px, calc(100% - 2rem));
    margin: 1.15rem auto 2.5rem;
}

/* Page Header */
.page-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.page-hero-copy {
    display: grid;
    gap: 0.25rem;
}

.page-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    letter-spacing: -0.03em;
    color: var(--ink);
}

.page-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
    max-width: 66ch;
    line-height: 1.45;
}

/* KPI Strip */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metrics-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.8rem 0.95rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 140ms ease;
}

a.metric:hover {
    border-color: var(--brand);
    color: inherit;
}

.metric-highlight {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.metric-value-ok { color: var(--ok); }
.metric-value-warn { color: var(--accent); }

.metric-hint {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Set Pills (exburst-style quick collection bar) */
.set-strip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.set-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: all 140ms ease;
}

.set-pill:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.set-pill.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #ffffff;
}

.set-pill-count {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    opacity: 0.78;
}

/* Screener / Filtro Supremo Bar */
.filters {
    margin-bottom: 1rem;
}

.screener-bar {
    display: grid;
    grid-template-columns: minmax(220px, 2.1fr) repeat(4, minmax(120px, 1fr)) auto;
    gap: 0.65rem;
    align-items: end;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.filter-field {
    display: grid;
    gap: 0.3rem;
}

.filter-field span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.filter-field input,
.filter-field select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.55rem 0.7rem;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: 2px solid rgba(15, 110, 86, 0.22);
    border-color: var(--brand);
    background: #fff;
}

.screener-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.quick-chips-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-right: 0.2rem;
}

.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 130ms ease;
}

.chip-toggle:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.chip-toggle.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.chip-toggle-auction.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.advanced-filters {
    margin-top: 0.7rem;
}

.advanced-filters summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    user-select: none;
}

.advanced-filters summary:hover {
    color: var(--brand);
}

.advanced-filters[open] summary {
    margin-bottom: 0.7rem;
}

.filters-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-deep);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink-soft);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

/* Panels & Tables */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    overflow: auto;
}

.panel-auction {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.panel h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.panel-note {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th,
.table td {
    padding: 0.65rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--surface-2);
}

.muted { color: var(--muted); }

.mono {
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.price {
    font-family: var(--font-mono);
    font-weight: 700;
    white-space: nowrap;
    color: var(--ink);
}

.price-ok { color: var(--ok); }

/* Badges & Chips */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--surface-2);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.badge-source-ebay { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-source-130point { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-source-tcgplayer { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-source-liga_pokemon { background: #fefce8; color: #a16207; border-color: #fde047; }

.badge-auction { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge-bin { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-sold { background: #dcfce7; color: #166534; border-color: #86efac; }

.badge-variant-master_ball { background: var(--purple-soft); color: var(--purple); border-color: #d8b4fe; }
.badge-variant-poke_ball { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.badge-variant-sir { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge-variant-reverse_holo { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.badge-variant-promo { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.status-auto { color: var(--ok); }
.status-unmatched { color: var(--warn); }
.status-reviewed { color: var(--signal); }

/* Card Screener Grid (exburst / TCGplayer inspired) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

.card-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.card-tile:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    color: inherit;
}

.card-tile-art {
    position: relative;
    width: 100%;
    aspect-ratio: 63 / 88;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(160deg, #e8eef7, #d9e2ef);
    border: 1px solid var(--line);
}

.card-tile-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 180ms ease;
}

.card-tile:hover .card-tile-art img {
    transform: scale(1.03);
}

.card-tile-top {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card-tile-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.card-tile-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.45rem;
}

.art-badge-num {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.14rem 0.44rem;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.69rem;
    font-weight: 700;
    line-height: 1.25;
}

.art-badge-live {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.46rem;
    border-radius: 6px;
    background: rgba(15, 110, 86, 0.92);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.25;
}

.art-badge-auction {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.48rem;
    border-radius: 6px;
    background: rgba(180, 83, 9, 0.94);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.25;
}

.art-badge-muted {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.44rem;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.25;
}

.card-tile-art-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--brand);
    background: linear-gradient(160deg, #eef5f2, #e4ebf5);
}

.card-tile-head {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.card-tile-name {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.2;
}

.card-tile-meta {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.card-price-box {
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
    padding: 0.45rem 0.52rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    margin-top: auto;
}

.card-price-empty {
    font-size: 0.74rem;
    color: var(--muted);
    text-align: center;
    padding: 0.25rem 0;
}

.card-price-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.16rem 0.22rem;
    border-radius: 6px;
}

.card-price-tier + .card-price-tier {
    border-top: 1px dashed var(--line);
    padding-top: 0.34rem;
    border-radius: 0;
}

.card-price-tier.is-focus {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px var(--line-strong);
    border-radius: 6px;
}

.card-price-tier-head {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.card-price-tier-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.34rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

.card-price-tier-tag.is-raw {
    background: #eef8f2;
    border-color: #c9e6d5;
    color: var(--ok);
}

.card-price-tier-tag.is-graded {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--signal);
}

.card-price-tier-count {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--muted);
}

.card-price-range {
    display: inline-flex;
    align-items: baseline;
    gap: 0.26rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    white-space: nowrap;
}

.card-price-pair {
    display: inline-flex;
    align-items: baseline;
    gap: 0.16rem;
}

.card-price-pair small {
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}

.card-price-pair strong {
    font-weight: 700;
    color: var(--ink);
}

.card-price-sep {
    color: var(--muted);
    font-size: 0.7rem;
}

.card-price-val-floor {
    color: var(--ok);
}

.card-price-val-graded {
    color: var(--signal);
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-soft);
    border-radius: 6px;
    padding: 0.15rem 0.42rem;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.meta-chip-condition { background: #eef8f2; border-color: #c9e6d5; color: var(--ok); }
.meta-chip-grader { background: #eff6ff; border-color: #bfdbfe; color: var(--signal); }
.meta-chip-grade { background: var(--accent-soft); border-color: #fcd34d; color: #92400e; }

.stat-chip {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
    font-family: var(--font-mono);
}

/* Card X-Ray Detail Page */
.xray-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.detail-art {
    width: min(170px, 40vw);
    aspect-ratio: 63 / 88;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: var(--surface-2);
    flex: 0 0 auto;
}

.detail-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.xray-info {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.xray-info h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    letter-spacing: -0.03em;
}

.xray-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.split-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.split-2 .panel {
    margin-bottom: 0;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    align-items: end;
}

.split-2 .calc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calc-result {
    margin-top: 0.85rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: var(--brand-soft);
    border: 1px solid #b7dfd0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.calc-result-main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.calc-result-val {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--muted);
}

.back-link:hover { color: var(--brand); }

/* Mini thumb in listings feed */
.feed-card-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.feed-thumb {
    width: 32px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--surface-2);
    flex: 0 0 auto;
}

.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.seg-control {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.seg-btn {
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.seg-btn:hover {
    color: var(--ink);
}

.seg-btn.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.seg-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.chart-stats-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.chart-stat {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.chart-stat-accent {
    background: var(--brand-soft);
    border-color: #b7dfd0;
}

.chart-stat span {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.chart-stat strong {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
}

.chart-stage {
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.35rem 0.45rem 0.25rem;
    min-height: 0;
    overflow: hidden;
}

.chart-stage canvas {
    display: block;
    max-width: 100%;
}

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    max-width: 310px;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    font-size: 0.78rem;
    line-height: 1.35;
}

.tt-top {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.tt-meta {
    color: #cbd5e1;
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
}

.tt-title {
    color: #f1f5f9;
    font-weight: 500;
}

.tt-hint {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    color: #5eead4;
}

.chart-empty-state {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    color: var(--ink-soft);
    max-width: 56ch;
    margin: 0 auto;
    line-height: 1.45;
}

.chart-empty-state span {
    font-size: 0.86rem;
    color: var(--muted);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.15rem;
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
}

.legend-line {
    width: 16px;
    border-top: 2px dashed;
    display: inline-block;
}

@media (max-width: 720px) {
    .chart-stats-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.pager {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

.empty {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}

/* Modules & Collections compatibility */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    color: inherit;
    text-decoration: none;
    min-height: 210px;
    transition: border-color 160ms ease, transform 160ms ease;
}

.module-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    color: inherit;
}

.module-card h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.module-tagline { margin: 0; color: var(--accent); font-size: 0.82rem; font-weight: 700; }
.module-summary { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; flex: 1; }

.module-card-top,
.module-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.module-card-foot {
    margin-top: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
}

.module-hero-row { display: flex; gap: 1rem; align-items: flex-start; }

.module-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-soft);
    border: 1px solid #c7e6db;
    position: relative;
    flex: 0 0 auto;
}

.module-icon-lg { width: 56px; height: 56px; }

.module-icon::before {
    content: "";
    position: absolute;
    inset: 11px;
    background: var(--brand);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.module-icon-list::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h16v2H4zm0 5h16v2H4zm0 5h10v2H4z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h16v2H4zm0 5h16v2H4zm0 5h10v2H4z'/%3E%3C/svg%3E"); }
.module-icon-radar::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 10 10h-2A8 8 0 1 1 12 4V2zm1 5.05A6 6 0 0 1 18 13h-2a4 4 0 0 0-3-3.85V7.05zM11 11v9l7-9h-7z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 10 10h-2A8 8 0 1 1 12 4V2zm1 5.05A6 6 0 0 1 18 13h-2a4 4 0 0 0-3-3.85V7.05zM11 11v9l7-9h-7z'/%3E%3C/svg%3E"); }
.module-icon-chart::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 19h14v2H3V3h2v16zm4-2H7V9h2v8zm4 0h-2V5h2v12zm4 0h-2v-6h2v6z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 19h14v2H3V3h2v16zm4-2H7V9h2v8zm4 0h-2V5h2v12zm4 0h-2v-6h2v6z'/%3E%3C/svg%3E"); }
.module-icon-portfolio::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 4h4a2 2 0 0 1 2 2v1h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3V6a2 2 0 0 1 2-2zm0 3h4V6h-4v1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 4h4a2 2 0 0 1 2 2v1h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3V6a2 2 0 0 1 2-2zm0 3h4V6h-4v1z'/%3E%3C/svg%3E"); }
.module-icon-assistant::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 1 7 7v2h1a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v1a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-1H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h1V9a7 7 0 0 1 7-7zm-3 9a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm6 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 1 7 7v2h1a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v1a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-1H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h1V9a7 7 0 0 1 7-7zm-3 9a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm6 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z'/%3E%3C/svg%3E"); }
.module-icon-merchant::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h16l-1 4H5L4 6zm1 6h14v8H5v-8zm3 2v4h2v-4H8zm6 0v4h2v-4h-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h16l-1 4H5L4 6zm1 6h14v8H5v-8zm3 2v4h2v-4H8zm6 0v4h2v-4h-2z'/%3E%3C/svg%3E"); }
.module-icon-alerts::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2zm6-6V11a6 6 0 1 0-12 0v5L4 18v1h16v-1l-2-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2zm6-6V11a6 6 0 1 0-12 0v5L4 18v1h16v-1l-2-2z'/%3E%3C/svg%3E"); }
.module-icon-platform::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4z'/%3E%3C/svg%3E"); }

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 0.18rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--line);
}

.status-scaffold { background: #f1f5f9; color: var(--muted); }
.status-partial { background: var(--accent-soft); color: #92400e; border-color: #fcd34d; }
.status-ready { background: var(--ok-soft); color: var(--ok); border-color: #86efac; }

.scope-list { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); line-height: 1.55; }

/* Responsive */
@media (max-width: 1024px) {
    .screener-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .split-2,
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 0.65rem;
    }
    .nav-secondary {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
    .screener-bar,
    .filters-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    }
}


/* Authentication & Topbar User Controls */
.user-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--line);
    flex: 0 0 auto;
}

.user-chip {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    appearance: none;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 140ms ease;
}

.logout-btn:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 20%, rgba(15, 110, 86, 0.14), transparent 46%),
        radial-gradient(circle at 84% 80%, rgba(29, 78, 216, 0.08), transparent 45%),
        var(--bg);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.auth-subtitle {
    margin: 0 0 1.4rem;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
}

.auth-alert {
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.auth-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.auth-alert-ok {
    background: var(--ok-soft);
    border-color: #86efac;
    color: var(--ok);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.auth-field input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.14);
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    accent-color: var(--brand);
    width: 15px;
    height: 15px;
}

.auth-submit {
    margin-top: 0.25rem;
    width: 100%;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms ease;
}

.auth-submit:hover {
    background: var(--brand-deep);
}

@media (max-width: 720px) {
    .user-bar {
        padding-left: 0;
        border-left: 0;
    }
}

/* User Management inline action helpers */
.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.link-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font-family: var(--font-body);
    font-size: inherit;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
}

.link-btn:hover {
    color: var(--brand-deep);
    text-decoration: underline;
}

.link-btn-danger {
    color: var(--danger);
}

.link-btn-danger:hover {
    color: #991b1b;
}

.field-error {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--danger);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--ink);
}

/* Offers Table Filter & Sort Controls */
.offers-toolbar {
    display: grid;
    grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr)) auto;
    gap: 0.65rem;
    align-items: end;
    padding: 0.85rem 1rem;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.offers-toolbar-actions {
    display: flex;
    align-items: flex-end;
}

.sort-th {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: color 120ms ease;
}

.sort-th:hover,
.sort-th.is-sorted {
    color: var(--brand-deep);
}

.sort-arrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand);
    min-width: 0.65rem;
}

@media (max-width: 1080px) {
    .offers-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .offers-toolbar {
        grid-template-columns: 1fr;
    }
}

/* Card Detail Offers Filter & Sortable Headers */
.offers-toolbar {
    display: grid;
    grid-template-columns: 1.5fr repeat(5, minmax(120px, 1fr)) auto;
    gap: 0.65rem;
    padding: 0.75rem 0 0.9rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--line);
    align-items: end;
}

.offers-toolbar-actions {
    display: flex;
    align-items: flex-end;
}

.sort-th {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.sort-th:hover {
    color: var(--brand-deep);
}

.sort-th.is-sorted {
    color: var(--brand-deep);
}

.sort-arrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--brand);
}

@media (max-width: 1080px) {
    .offers-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .offers-toolbar {
        grid-template-columns: 1fr;
    }
}

/* Offers Table Filter & Sort Controls */
.offers-toolbar {
    display: grid;
    grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)) auto;
    gap: 0.65rem;
    align-items: end;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.offers-toolbar-actions {
    display: flex;
    align-items: flex-end;
}

.sort-th {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    white-space: nowrap;
}

.sort-th:hover,
.sort-th.is-sorted {
    color: var(--brand-deep);
}

.sort-arrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    min-width: 0.75em;
    display: inline-block;
}

@media (max-width: 1080px) {
    .offers-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .offers-toolbar {
        grid-template-columns: 1fr;
    }
}

.live-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.countdown-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.countdown-pill-sm {
    padding: 0.1rem 0.38rem;
    font-size: 0.7rem;
}

.countdown-pill.is-soon {
    background: #ffedd5;
    border-color: #fb923c;
    color: #9a3412;
}

.countdown-pill.is-urgent {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
    animation: urgentBlink 1.2s ease-in-out infinite;
}

.countdown-pill.is-ended {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
    animation: none;
}

@keyframes urgentBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.bid-delta {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
}

.bid-delta.is-up {
    background: #dcfce7;
    color: #166534;
}

.bid-delta.is-down {
    background: #fee2e2;
    color: #991b1b;
}

.row-flash {
    animation: rowFlash 1.8s ease-out;
}

@keyframes rowFlash {
    0% { background-color: #fef08a; }
    100% { background-color: transparent; }
}

.auction-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed #fde68a;
}

.auction-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.auction-sort-select {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.28rem 0.55rem;
    cursor: pointer;
}

.auction-refresh-btn {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-deep);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.auction-refresh-btn:hover:not(:disabled) {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.auction-refresh-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
}

.table-pager-info {
    color: var(--muted);
    font-weight: 500;
}

.table-pager-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.table-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.table-pager-size select {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.22rem 0.45rem;
    cursor: pointer;
}

.table-pager-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.table-pager-page {
    font-size: 0.76rem;
    color: var(--ink-soft);
    padding: 0 0.25rem;
}

.pager-btn {
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.26rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--brand);
    color: var(--brand-deep);
}

.pager-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
