/* ---------- Theme (black) ---------- */
:root {
    color-scheme: dark;
    --cc-bg: #000000;
    --cc-surface: #0e0e10;
    --cc-surface-2: #17171a;
    --cc-border: #232328;
    --cc-border-strong: #34343b;
    --cc-text: #ececef;
    --cc-muted: #9b9ba6;
    --cc-primary: #6366f1;
    --cc-primary-hover: #818cf8;
    --cc-primary-soft: #1a1940;
    --cc-success: #4ade80;
    --cc-success-soft: #0a2a16;
    --cc-danger: #f87171;
    --cc-danger-soft: #2c0f0f;
    --cc-warning: #fbbf24;
    --cc-warning-soft: #2b1d05;
    --cc-info: #38bdf8;
    --cc-info-soft: #082a3d;
    --cc-sidebar: #000000;
    --cc-radius: 0.75rem;
    --cc-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);

    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-body-color: var(--cc-text);
    --bs-body-bg: var(--cc-bg);
    --bs-border-color: var(--cc-border);
    --bs-secondary-color: var(--cc-muted);
}

html, body {
    font-family: var(--bs-body-font-family);
    background: var(--cc-bg);
    color: var(--cc-text);
    font-size: 0.925rem;
    -webkit-font-smoothing: antialiased;
}

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

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 {
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--cc-text);
}

h1.h3, h1.h4 { font-size: 1.45rem; margin-bottom: 1.25rem; }
h2.h5 { font-size: 1.02rem; margin-bottom: 0.85rem; }

h1:focus { outline: none; }

.text-muted { color: var(--cc-muted) !important; }
hr { border-color: var(--cc-border); opacity: 1; margin: 1.75rem 0; }

/* ---------- Surfaces ---------- */
.card, .panel {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
}

.content img.img-fluid.rounded {
    border-radius: var(--cc-radius) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--cc-border);
}

/* ---------- Tables ---------- */
.content .table {
    --bs-table-bg: var(--cc-surface);
    --bs-table-hover-bg: var(--cc-surface-2);
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    box-shadow: var(--cc-shadow);
    margin-bottom: 1.5rem;
}

    .content .table > :not(:first-child) {
        border-top: 0 !important;
    }

    .content .table > thead > tr > th {
        background: var(--cc-surface-2);
        color: var(--cc-muted);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        border-bottom: 1px solid var(--cc-border) !important;
        padding: 0.7rem 0.85rem;
        white-space: nowrap;
    }

    .content .table > tbody > tr > td,
    .content .table > tbody > tr > th {
        padding: 0.7rem 0.85rem;
        border-bottom: 1px solid var(--cc-border);
        vertical-align: middle;
    }

    .content .table > tbody > tr:last-child > td,
    .content .table > tbody > tr:last-child > th {
        border-bottom: 0;
    }

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

    .content .table td.text-end, .content .table th.text-end {
        font-variant-numeric: tabular-nums;
    }

/* Small screen: the table scrolls horizontally instead of breaking the page */
@media (max-width: 640.98px) {
    .content .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .content .table td, .content .table th { white-space: nowrap; }
}

/* Details table (key / value) on a card page */
.content .table-sm > tbody > tr > th {
    color: var(--cc-muted);
    font-weight: 500;
    width: 42%;
}

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--cc-primary) !important; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: 0.55rem;
    font-weight: 500;
    padding: 0.45rem 0.95rem;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; border-radius: 0.45rem; }

/* Bootstrap 5.1: button colours as plain properties (no --bs-btn-* variables) */
.btn-primary { color: #fff; background-color: var(--cc-primary); border-color: var(--cc-primary); box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { color: #fff; background-color: var(--cc-primary-hover); border-color: var(--cc-primary-hover); }
.btn-primary:disabled, .btn-primary.disabled { background-color: #4f46e5; border-color: #4f46e5; }

.btn-success { color: #fff; background-color: #16a34a; border-color: #16a34a; }
.btn-success:hover, .btn-success:focus, .btn-success:active { color: #fff; background-color: #15803d; border-color: #15803d; }

.btn-danger { color: #fff; background-color: #dc2626; border-color: #dc2626; }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active { color: #fff; background-color: #b91c1c; border-color: #b91c1c; }

.btn-warning { color: var(--cc-warning); background-color: var(--cc-warning-soft); border-color: #78350f; }
.btn-warning:hover, .btn-warning:focus, .btn-warning:active { color: #fcd34d; background-color: #5c3a0a; border-color: #fbbf24; }

.btn-outline-primary { color: var(--cc-primary); background-color: var(--cc-surface); border-color: #312e81; }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active { color: var(--cc-primary-hover); background-color: var(--cc-primary-soft); border-color: #4f46e5; }

.btn-outline-secondary { color: #d4d4d8; background-color: var(--cc-surface); border-color: var(--cc-border-strong); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active { color: var(--cc-text); background-color: #26262c; border-color: #45454d; }

.btn-outline-danger { color: var(--cc-danger); background-color: var(--cc-surface); border-color: #7f1d1d; }
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active { color: #fff; background-color: #dc2626; border-color: #dc2626; }

.btn:focus-visible, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ---------- Forms ---------- */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #d4d4d8;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-color: var(--cc-border-strong);
    border-radius: 0.55rem;
    font-size: 0.9rem;
    padding: 0.45rem 0.7rem;
}

.form-control-sm, .form-select-sm { border-radius: 0.45rem; }

.input-group-text {
    background: var(--cc-surface-2);
    border-color: var(--cc-border-strong);
    color: var(--cc-muted);
    font-size: 0.85rem;
}

.input-group > :first-child { border-top-left-radius: 0.55rem; border-bottom-left-radius: 0.55rem; }
.input-group > :last-child { border-top-right-radius: 0.55rem; border-bottom-right-radius: 0.55rem; }

.form-text { color: var(--cc-muted); font-size: 0.78rem; }

.form-check-input:checked {
    background-color: var(--cc-primary);
    border-color: var(--cc-primary);
}

/* Card page and settings forms: placed on a surface */
.content form.row {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    padding: 1.25rem 1rem 1.5rem;
    margin-left: 0;
    margin-right: 0;
}

details > summary {
    cursor: pointer;
    color: var(--cc-primary);
    font-weight: 500;
}

/* ---------- Badges and alerts ---------- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.35em 0.65em;
    border-radius: 999px;
}

.badge.bg-success { background: var(--cc-success-soft) !important; color: var(--cc-success) !important; }
.badge.bg-danger { background: var(--cc-danger-soft) !important; color: var(--cc-danger) !important; }
.badge.bg-warning { background: var(--cc-warning-soft) !important; color: var(--cc-warning) !important; }
.badge.bg-info { background: var(--cc-info-soft) !important; color: var(--cc-info) !important; }
.badge.bg-primary { background: var(--cc-primary-soft) !important; color: var(--cc-primary) !important; }
.badge.bg-secondary { background: #26262c !important; color: #a1a1aa !important; }
.badge.bg-dark { background: #3f3f46 !important; color: #fff !important; }

.alert {
    border-radius: var(--cc-radius);
    border-width: 1px;
    font-size: 0.88rem;
}

.alert-warning { background: #1f1606; border-color: #5c3a0a; color: #fcd34d; }
.alert-danger { background: #200b0b; border-color: #7f1d1d; color: #fca5a5; }
.alert-info { background: #071b28; border-color: #0c4a6e; color: #7dd3fc; }
.alert-success { background: #06200f; border-color: #0f3d20; color: #86efac; }

.text-success { color: var(--cc-success) !important; }
.text-danger { color: var(--cc-danger) !important; }

/* ---------- Top bar ---------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 1.9rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface-2);
    color: #d4d4d8;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

    .status-chip svg { width: 0.95rem; height: 0.95rem; color: var(--cc-muted); }
    .status-chip .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }

.status-chip-dry { background: var(--cc-warning-soft); border-color: #78350f; color: var(--cc-warning); }
.status-chip-live { background: var(--cc-danger-soft); border-color: #7f1d1d; color: var(--cc-danger); }
.status-chip-live .dot { animation: cc-pulse 1.6s infinite; }
.status-chip-danger { background: var(--cc-danger-soft); border-color: #7f1d1d; color: var(--cc-danger); }

@keyframes cc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- Misc ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid #22c55e; }
.invalid { outline: 1px solid #ef4444; }
.validation-message { color: var(--cc-danger); }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.price-flash {
    background-color: #3f2f05;
    transition: background-color 0.3s;
    border-radius: 0.25rem;
    padding: 0 0.25rem;
}


/* Best offer: gross amount unstyled, net in brackets, green when it beats the buyback */
.offer-net { font-size: 0.8rem; color: var(--cc-muted); }
td.offer-beats-buyback .offer-net { color: var(--cc-success); font-weight: 600; }

/* Page header totals */
.stat-chips { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.stat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 999px;
    box-shadow: var(--cc-shadow);
    white-space: nowrap;
}

    .stat-chip .stat-label { color: var(--cc-muted); font-size: 0.75rem; font-weight: 500; }
    .stat-chip .stat-value { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
    .stat-chip .stat-sub { color: var(--cc-muted); font-size: 0.72rem; }

/* Start price quick choices */
.price-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }

.price-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--cc-border-strong);
    border-radius: 0.5rem;
    background: var(--cc-surface);
    color: var(--cc-text);
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: left;
    transition: border-color 0.15s, background-color 0.15s;
}

    .price-choice span { color: var(--cc-muted); font-weight: 500; }
    .price-choice b { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
    .price-choice:hover:not(:disabled) { border-color: #4f46e5; background: var(--cc-primary-soft); }
    .price-choice.active { border-color: var(--cc-primary); background: var(--cc-primary-soft); box-shadow: inset 0 0 0 1px var(--cc-primary); }
    .price-choice.active span { color: var(--cc-primary); }
    .price-choice:disabled { opacity: 0.45; cursor: not-allowed; }

/* Step quick choices */
.step-choices { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.step-choice {
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--cc-border-strong);
    border-radius: 999px;
    background: var(--cc-surface);
    color: #d4d4d8;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, background-color 0.15s;
}

    .step-choice:hover { border-color: #4f46e5; background: var(--cc-primary-soft); }
    .step-choice.active { border-color: var(--cc-primary); background: var(--cc-primary); color: #fff; }

/* Card name linking to CollectorCrypt */
.card-name-link { color: inherit; text-decoration: none; font-weight: 500; }
.card-name-link:hover { color: var(--cc-primary, #2563eb); text-decoration: underline; }

/* My cards: columns fit their content, the Card column takes the rest */
.cards-table th.fit, .cards-table td.fit { white-space: nowrap; }
.cards-table th.text-end, .cards-table td.text-end { text-align: right !important; }

/* Best exit */
.exit-cell { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-width: 5.5rem; }

.exit-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

    .exit-pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; flex: none; }
    .exit-pill .exit-label { margin-right: auto; }
    .exit-pill .exit-gain { font-variant-numeric: tabular-nums; }

.exit-offer { background: var(--cc-success-soft); border-color: #166534; color: var(--cc-success); }
.exit-buyback { background: var(--cc-primary-soft); border-color: #312e81; color: var(--cc-primary); }

.exit-accept { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 0.2rem 0.5rem; font-size: 0.75rem; line-height: 1.15; text-align: center; }
.exit-accept .exit-dry { font-size: 0.65rem; font-weight: 700; padding: 0 0.3rem; border-radius: 0.25rem; background: rgba(255, 255, 255, 0.25); }
.exit-result { max-width: 12rem; white-space: normal; }

/* Listed price: highlighted in yellow, gap with the buyback (or offer) below */
.listed-price { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.3rem; background: #3f2f05; color: #fde047; font-weight: 600; }
.listed-gap { font-size: 0.75rem; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.listed-gap.gap-up { color: var(--cc-success); }
.listed-gap.gap-down { color: var(--cc-danger); }
.listed-price.price-flash { background: #854d0e; box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35); }

/* Buyback expiry: green to red bar */
.expiry-bar { width: 4.5rem; height: 0.3rem; margin-top: 0.25rem; border-radius: 999px; background: #26262c; overflow: hidden; }
.expiry-fill { height: 100%; border-radius: 999px; }

/* Offer gain over the buyback */
.offer-gain { font-size: 0.75rem; color: var(--cc-success); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Action: accept the buyback (link to CollectorCrypt), same colour as the former Buyback pill */
.exit-accept-buyback { background: var(--cc-primary-soft); border: 1px solid #312e81; color: var(--cc-primary); font-weight: 600; }
.exit-accept-buyback:hover, .exit-accept-buyback:focus { background: #25235a; color: var(--cc-primary-hover); border-color: #4f46e5; }
.job-end { font-size: 0.72rem; margin-top: 0.2rem; text-align: center; white-space: nowrap; }

/* Card column: fixed width, the name wraps */
.cards-table th.card-col, .cards-table td.card-col { width: 15rem; min-width: 8rem; max-width: 15rem; white-space: normal; overflow-wrap: anywhere; }
.content .table.cards-table { width: 100%; } /* every column has its own size: the table does not stretch */

/* My cards: tighter cell padding to fit without horizontal scrolling */
.content .table.cards-table > thead > tr > th,
.content .table.cards-table > tbody > tr > td { padding: 0.6rem 0.45rem; }
.content .table.cards-table > thead > tr > th:first-child,
.content .table.cards-table > tbody > tr > td:first-child { padding-left: 0.85rem; }
.content .table.cards-table > thead > tr > th:last-child,
.content .table.cards-table > tbody > tr > td:last-child { padding-right: 0.85rem; }
.cards-table td.fit img { height: 52px !important; }
@media (max-width: 1399.98px) {
    .content .table.cards-table > thead > tr > th,
    .content .table.cards-table > tbody > tr > td { padding-left: 0.3rem; padding-right: 0.3rem; }
    .cards-table td.fit img { height: 40px !important; }
}
@media (max-width: 1239.98px) {
    .cards-table .col-img { display: none; }
}

/* Header totals: buyback then best exit (max of buyback / net offer) in green */
.stat-chip.stat-chip-stacked { flex-direction: column; align-items: flex-end; gap: 0.05rem; border-radius: 0.75rem; padding: 0.4rem 0.85rem; line-height: 1.2; }
.stat-chip-stacked .stat-label { align-self: flex-start; }
.stat-best { color: var(--cc-success); font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.stat-best-pct { font-size: 0.72rem; font-weight: 600; margin-left: 0.25rem; }

/* Header totals: small plain table */
.stat-summary {
    display: inline-grid;
    flex: 0 0 auto;
    grid-template-columns: auto auto auto auto;
    column-gap: 1.5rem;
    row-gap: 0.15rem;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 0.6rem;
    font-variant-numeric: tabular-nums;
}

    .stat-summary .ss-head, .stat-summary .ss-row { display: contents; }
    .stat-summary .ss-head > span { color: var(--cc-muted); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: right; }
    .stat-summary .ss-label { color: var(--cc-muted); font-size: 0.8rem; font-weight: 500; align-self: center; }
    .stat-summary .ss-count { display: inline-block; min-width: 1.4rem; margin-left: 0.25rem; padding: 0 0.3rem; border-radius: 999px; background: #26262c; font-size: 0.7rem; text-align: center; }
    .stat-summary .ss-amount { text-align: right; font-size: 0.9rem; font-weight: 600; color: var(--cc-text, #ececef); }
    .stat-summary .ss-best { color: var(--cc-success); }
    .stat-summary .ss-pct { font-size: 0.72rem; font-weight: 500; opacity: 0.85; margin-left: 0.2rem; }

/* Above the grid: summary on the left, name filter on the right */
.grid-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.grid-filter { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.grid-filter input { width: 16rem; }
/* The bar above is exactly as wide as the table (the summary text does not widen it) */
.cards-grid { display: flex; flex-direction: column; width: 100%; }
.cards-grid > .table.cards-table { width: 100%; }
.grid-toolbar > p { flex: 1 1 0; min-width: 12rem; contain: inline-size; }

/* Best exit of the row (buyback or net offer): highlighted in green, like the listed price in yellow */
.best-price { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.3rem; background: #0f3d20; color: #86efac; font-weight: 600; }

/* ---------- Settings: airy sections ---------- */
.settings-page { max-width: 1100px; }
.settings-header { margin-bottom: 1.25rem; }

.settings-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; position: sticky; top: 3.75rem; z-index: 5; padding: 0.6rem 0; background: var(--cc-bg, #000); }
.settings-nav a { padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--cc-border); background: var(--cc-surface); color: var(--cc-muted); font-size: 0.82rem; font-weight: 500; text-decoration: none; }
.settings-nav a:hover { color: var(--cc-primary); border-color: #312e81; background: var(--cc-primary-soft); }

.settings-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
    gap: 2.5rem;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 0.75rem;
    box-shadow: var(--cc-shadow);
    scroll-margin-top: 7rem;
}
.settings-section-live { border-color: #7f1d1d; box-shadow: 0 0 0 3px var(--cc-danger-soft); }
.settings-intro h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.settings-intro p { color: var(--cc-muted); font-size: 0.88rem; margin-bottom: 0; }
.settings-fields .form-label { font-weight: 500; font-size: 0.88rem; margin-bottom: 0.35rem; }
.settings-sub { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cc-muted); margin: 2rem 0 0.9rem; padding-top: 1.25rem; border-top: 1px solid var(--cc-border); }
.settings-sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-sub .form-check-label { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--cc-text); }
.settings-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.5rem 1.5rem; }
.settings-narrow { max-width: 14rem; }
.settings-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; margin: 0; font-size: 0.9rem; }
.settings-dl dt { color: var(--cc-muted); font-weight: 500; }
.settings-dl dd { margin: 0; }

.settings-savebar {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
    padding: 0.9rem 1.25rem; margin-top: 0.5rem;
    background: rgba(14, 14, 16, 0.92); backdrop-filter: blur(6px);
    border: 1px solid var(--cc-border); border-radius: 0.75rem; box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

@media (max-width: 860px) {
    .settings-section { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
}

/* Status column: pause / resume button next to the state */
.job-actions { display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
.job-toggle { padding: 0.15rem 0.45rem; line-height: 1.2; border: 1px solid var(--cc-border); background: var(--cc-surface); color: var(--cc-muted); }
.job-toggle:hover { color: var(--cc-text); border-color: #45454d; background: #26262c; }
.job-toggle-play { color: var(--cc-success); border-color: #166534; background: var(--cc-success-soft); }
    .stat-summary .ss-insured { color: var(--cc-muted); font-weight: 500; }

/* ---------- My cards: header, KPIs, action bar ---------- */
.page-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head-sub { color: var(--cc-muted); font-size: 0.9rem; }

.kpi-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi {
    padding: 1rem 1.15rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 0.75rem;
    box-shadow: var(--cc-shadow);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.kpi-label { color: var(--cc-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 1.45rem; font-weight: 700; line-height: 1.25; margin-top: 0.3rem; color: var(--cc-text); }
.kpi-sub { color: var(--cc-muted); font-size: 0.78rem; margin-top: 0.2rem; }
.kpi-accent { border-color: #166534; background: linear-gradient(180deg, #06200f 0%, var(--cc-surface) 70%); }
.kpi-accent .kpi-value { color: var(--cc-success); }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--cc-border); }
.page-actions-info { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--cc-text); }
.page-actions-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

@media (max-width: 991.98px) { .kpi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-unit { font-size: 0.75rem; font-weight: 500; color: var(--cc-muted, #6c757d); }
@media (max-width: 1399.98px) and (min-width: 992px) { .kpi-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Phone (installed app): each card becomes a tile, no more table ---------- */
.mobile-sort { display: none; width: auto; }

@media (max-width: 767.98px) {
    .content { padding-left: 0.75rem !important; padding-right: 0.75rem !important; padding-bottom: env(safe-area-inset-bottom); }
    .page-head h1 { font-size: 1.35rem; }

    .kpi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .kpi { padding: 0.7rem 0.8rem; }
    .kpi-value { font-size: 1.1rem; }
    .kpi-tiles > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }

    .page-actions { flex-direction: column; align-items: stretch; }
    .page-actions-buttons { display: grid; grid-template-columns: repeat(3, 1fr); }
    .page-actions-buttons .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-actions-buttons .btn { padding: 0.5rem 0.3rem; font-size: 0.8rem; }

    .grid-toolbar > p { display: none; }
    .grid-filter { margin-left: 0; width: 100%; }
    .grid-filter input { width: auto; flex: 1 1 auto; min-width: 0; }
    .mobile-sort { display: block; flex: 0 0 auto; max-width: 45%; }

    .content .table.cards-table { display: block; overflow: visible; background: transparent; border: 0; box-shadow: none; }
    .content .table.cards-table > thead { display: none; }
    .content .table.cards-table > tbody { display: flex; flex-direction: column; gap: 0.75rem; }
    .content .table.cards-table > tbody > tr {
        display: grid; grid-template-columns: 1fr 1fr; gap: 0.1rem 0.75rem;
        padding: 0.75rem; background: var(--cc-surface);
        border: 1px solid var(--cc-border); border-radius: var(--cc-radius); box-shadow: var(--cc-shadow);
    }
    .content .table.cards-table > tbody > tr:hover > * { background: transparent; }
    .content .table.cards-table > tbody > tr > td {
        /* label on the left, content stacked on the right (cell text and blocks) */
        display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.5rem; align-items: start; justify-items: end;
        padding: 0.4rem 0 !important; border: 0; border-top: 1px solid var(--cc-border);
        white-space: nowrap; text-align: right; min-width: 0; font-size: 0.85rem;
    }
    .content .table.cards-table > tbody > tr > td::before {
        content: attr(data-label); grid-column: 1; grid-row: 1 / span 6; justify-self: start; padding-top: 0.15rem;
        color: var(--cc-muted); font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; text-align: left;
    }
    .content .table.cards-table > tbody > tr > td > * { grid-column: 2; text-align: right; }
    .content .table.cards-table > tbody > tr > td .listed-gap { white-space: normal; font-size: 0.72rem; }

    /* Tile header: image + name across the full width */
    .cards-table td.col-img { display: none !important; }
    .content .table.cards-table > tbody > tr > td.card-col {
        grid-column: 1 / -1; display: block; width: auto; max-width: none; border-top: 0;
        padding-top: 0 !important; text-align: left; font-size: 1rem; justify-items: stretch;
    }
    .content .table.cards-table > tbody > tr > td.card-col > * { text-align: left; }
    .content .table.cards-table > tbody > tr > td.card-col::before { content: none; }

    /* Action and Status: full width, finger-friendly buttons */
    .content .table.cards-table > tbody > tr > td[data-label="Action"],
    .content .table.cards-table > tbody > tr > td[data-label="Status"],
    .content .table.cards-table > tbody > tr > td[data-label="Best offer"] { grid-column: 1 / -1; align-items: center; }
    .content .table.cards-table > tbody > tr > td[data-label="Action"] .btn { padding: 0.45rem 0.8rem; }
    .cards-table .expiry-bar { width: 5rem; margin-left: auto; }
}

/* Sales: amounts and dates on one line */
.sales-table td.text-end, .sales-table th { white-space: nowrap; }
.sales-table td.sale-img { width: 1%; padding-right: 0; }
td.deal-img { width: 1%; padding-right: 0; }

/* Card image size picked with ImageSizePicker: thumbnail height and hover preview width. */
table { --thumb-h: 130px; --zoom-w: 420px; }
table.img-size-s { --thumb-h: 88px; --zoom-w: 320px; }
table.img-size-m { --thumb-h: 130px; --zoom-w: 420px; }
table.img-size-l { --thumb-h: 180px; --zoom-w: 520px; }
.zoom-thumb { height: var(--thumb-h); width: auto; border-radius: 0.4rem; display: block; }

/* Deals filters: search bar, then compact fields sized to their content. */
.deal-filters { padding: .75rem .9rem; }
.df-search { display: flex; gap: .5rem; margin-bottom: .6rem; }
.df-category { width: 10rem; flex: 0 0 auto; }
.df-text { flex: 1 1 auto; min-width: 0; }
.df-go { flex: 0 0 auto; min-width: 5.5rem; }
.df-row { display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; align-items: center; }
.df-row + .df-row { margin-top: .45rem; }
.df-field { display: flex; align-items: center; gap: .3rem; }
.df-label { font-size: .75rem; color: var(--cc-muted); white-space: nowrap; margin-right: .1rem; }
.df-sep { font-size: .75rem; color: var(--cc-muted); }
.df-field .form-control, .df-field .form-select { padding-top: .2rem; padding-bottom: .2rem; }
.deal-filters .form-select { padding-right: 2rem; background-position: right .6rem center; }
.df-w-grade { width: 4.2rem; }
.df-w-small { width: 4.2rem; }
.df-w-year { width: 5rem; }
.df-w-price { width: 5.5rem; }
.df-w-order { width: 9.5rem; }
.df-w-dir { width: 6.8rem; }
.df-status { margin-top: .6rem; font-size: .75rem; color: var(--cc-muted); }
@media (max-width: 640px) {
    .df-search { flex-wrap: wrap; }
    .df-text { flex-basis: 100%; order: 3; }
}

/* Market card page: all PriceCharting sales scroll, sales chart. */
.pc-scroll { max-height: 420px; overflow-y: auto; }
.sales-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.sales-chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .75rem; color: var(--cc-muted); }
.sales-chart-legend i { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc-primary-hover); }
.lg-line { width: 16px; height: 2px; background: var(--cc-warning); }
.lg-dash { width: 16px; border-top: 2px dashed; }
.lg-insured { border-color: var(--cc-info); }
.lg-listed { border-color: var(--cc-success); }
.lg-buyback { border-color: var(--cc-danger); }
.sales-chart-svg { width: 100%; height: auto; display: block; }
.sc-grid { stroke: var(--cc-border); stroke-width: 1; }
.sc-label { fill: var(--cc-muted); font-size: 11px; }
.sc-dot { fill: var(--cc-primary-hover); fill-opacity: .75; }
.sc-median { fill: none; stroke: var(--cc-warning); stroke-width: 2; }
.sc-median-pt { fill: var(--cc-warning); }
.sc-ref { stroke-width: 1.5; stroke-dasharray: 5 4; }
.sc-insured { stroke: var(--cc-info); }
.sc-listed { stroke: var(--cc-success); }
.sc-buyback { stroke: var(--cc-danger); }
.period-stats td, .period-stats th { white-space: nowrap; }

/* Market card page: PSA population per grade. */
.psa-pop { margin-top: .9rem; }
.psa-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .4rem; }
.psa-pop-sum { font-size: .8rem; color: var(--cc-muted); }
.psa-grades { display: flex; flex-wrap: wrap; gap: .4rem; }
.psa-grade { display: inline-flex; flex-direction: column; align-items: center; min-width: 4.2rem; padding: .3rem .55rem;
    border: 1px solid var(--cc-border); border-radius: .5rem; background: var(--cc-surface-2); }
.psa-grade-label { font-size: .68rem; color: var(--cc-muted); }
.psa-grade-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.psa-grade.current { border-color: var(--cc-primary); background: var(--cc-primary-soft); }

/* Thumbnail with a large preview on hover (Deals, Sales). */
.zoom-img { position: relative; display: inline-block; }
.zoom-img .zoom-large {
    display: none; position: absolute; left: calc(100% + .6rem); top: 50%; transform: translateY(-50%);
    width: var(--zoom-w); height: auto; max-width: none; border-radius: .6rem; z-index: 1050; pointer-events: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45); background: var(--bs-body-bg, #111);
}
.zoom-img:hover .zoom-large, .zoom-img:focus-within .zoom-large { display: block; }


/* ---------- Bootstrap 5.1 dark overrides ---------- */
.table { color: var(--cc-text); --bs-table-striped-color: var(--cc-text); --bs-table-hover-color: var(--cc-text); --bs-table-active-color: var(--cc-text); }
.content .table > :not(caption) > * > * { border-bottom-color: var(--cc-border); }
.form-control, .form-select { background-color: var(--cc-surface-2); color: var(--cc-text); }
.form-control:focus, .form-select:focus { background-color: var(--cc-surface-2); color: var(--cc-text); }
.form-control::placeholder { color: #6b6b75; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: #121215; color: var(--cc-muted); }
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a1a1aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.form-select option { background: var(--cc-surface-2); color: var(--cc-text); }
.form-check-input { background-color: var(--cc-surface-2); border-color: var(--cc-border-strong); }
.form-switch .form-check-input:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2371717a'/%3e%3c/svg%3e");
}
.card { background-color: var(--cc-surface); border-color: var(--cc-border); color: var(--cc-text); }
.border { border-color: var(--cc-border) !important; }
.text-dark { color: var(--cc-text) !important; }
.text-primary { color: var(--cc-primary-hover) !important; }
.btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
code { color: #f472b6; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cc-bg); }
::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 999px; border: 2px solid var(--cc-bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a42; }
.badge.bg-primary, .btn-outline-primary, .price-choice.active span, .exit-buyback, .exit-accept-buyback { color: var(--cc-primary-hover) !important; }
.sold-before { display: inline-block; margin-top: 0.2rem; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid #312e81; background: var(--cc-primary-soft); color: var(--cc-primary-hover); font-size: 0.72rem; font-weight: 500; text-decoration: none; }
.sold-before:hover { color: #fff; border-color: var(--cc-primary); text-decoration: none; }
.not-sold-row td { opacity: 0.75; }
.not-sold-row td:last-child { opacity: 1; }

/* In-app confirmation dialog (ConfirmDialog) */
.confirm-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 1050; }
.confirm-dialog {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1051;
    width: min(28rem, calc(100vw - 32px)); padding: 1.25rem 1.25rem 1rem;
    background: var(--cc-surface-2); color: var(--cc-text); border: 1px solid var(--cc-border-strong);
    border-radius: .75rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .6);
}
.confirm-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }
.confirm-message { white-space: pre-line; font-size: .9rem; color: var(--cc-muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* My cards: multi-selection and totals */
.cards-table td.col-select, .cards-table th.col-select { width: 1%; }
.cards-table tr.row-selected > td { background: var(--cc-primary-soft) !important; }
.content .table.cards-table > tfoot > tr.totals-row > td { padding: 0.6rem 0.45rem; border-top: 2px solid var(--cc-border-strong); font-weight: 600; }
.content .table.cards-table > tfoot > tr.totals-row > td:first-child { padding-left: 0.85rem; }

/* ---------- Card page: panels, key figures, data tables ---------- */
.card-page { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.panel { padding: 1rem 1.1rem; border-radius: .75rem; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-subtitle { color: var(--cc-muted); font-size: .8rem; margin-top: .15rem; }
.panel-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.panel-note { font-size: .8rem; color: var(--cc-muted); border-left: 3px solid var(--cc-primary); padding: .35rem .6rem; margin-bottom: .8rem; }
.panel-empty { color: var(--cc-muted); font-size: .85rem; margin: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.panel-section + .panel-section { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--cc-border); }
.panel-section-title { color: var(--cc-muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }
.panel .stat-label { color: var(--cc-muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.panel .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.panel .stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.panel .stat { background: var(--cc-surface-2); border: 1px solid var(--cc-border); border-radius: .6rem; padding: .6rem .75rem; text-align: right; min-width: 0; }
.panel .stat-main { border-color: var(--cc-primary); background: linear-gradient(180deg, var(--cc-primary-soft) 0%, var(--cc-surface-2) 80%); }
.panel .stat-good .stat-value { color: var(--cc-success); }
.panel .stat-value { font-size: 1.15rem; font-weight: 700; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.panel .stat-hint { color: var(--cc-muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table { font-size: .82rem; margin: 0; }
.data-table th { color: var(--cc-muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table .muted { white-space: nowrap; color: var(--cc-muted); }
.data-table .strong { white-space: nowrap; font-weight: 600; }

/* Card header */
.card-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; }
.card-hero-img { width: 100%; border-radius: .6rem; border: 1px solid var(--cc-border); background: var(--cc-bg); }
.card-hero h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { background: var(--cc-surface-2); border: 1px solid var(--cc-border); border-radius: 999px; padding: .15rem .65rem; font-size: .75rem; color: var(--cc-muted); }
.chip b { color: var(--cc-text); font-weight: 600; }
.attr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .3rem 1rem; font-size: .78rem; margin-top: .5rem; }
.attr-list span { color: var(--cc-muted); }

/* PriceCharting: match check (both pictures) */
.pc-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; }
.pc-match { background: var(--cc-surface-2); border: 1px solid var(--cc-border); border-radius: .6rem; padding: .75rem; align-self: start; }
.pc-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .5rem; }
.pc-thumbs figure { margin: 0; text-align: center; }
.pc-thumbs img, .pc-noimg { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: .4rem; background: var(--cc-bg); border: 1px solid var(--cc-border); }
.pc-noimg { display: flex; align-items: center; justify-content: center; color: var(--cc-muted); font-size: .75rem; }
.pc-thumbs figcaption { color: var(--cc-muted); font-size: .7rem; margin-top: .3rem; }
.pc-product-title { font-size: .8rem; margin-top: .6rem; line-height: 1.3; }
.pc-fix { font-size: .78rem; margin-top: .6rem; color: var(--cc-muted); }
.pc-fix summary { cursor: pointer; }
.pc-date { white-space: nowrap; color: var(--cc-muted); }
.pc-listing { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-price { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Price drop: running job log */
.job-log { background: var(--cc-bg); border: 1px solid var(--cc-border); border-radius: .5rem; padding: .6rem .75rem; max-height: 280px; overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; line-height: 1.5; }
.job-log .t { color: var(--cc-muted); margin-right: .5rem; }
.job-log .err { color: var(--cc-danger); }
.form-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

@media (max-width: 991.98px) {
    .pc-body, .card-hero, .panel-grid { grid-template-columns: 1fr; }
    .card-hero-img { max-width: 220px; }
    .panel .stats, .panel .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Price drop: estimated end vs buyback expiry */
.job-end { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem;
    padding: .8rem 1rem; border-radius: .6rem; border: 1px solid var(--cc-border-strong); background: var(--cc-surface-2); }
.job-end-date { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.job-end > div:first-child { text-align: left; }
.job-end-vs { text-align: right; }
.job-end-exp { font-size: 1rem; font-weight: 600; margin-top: .15rem; }
.job-end-pill { display: inline-block; margin-top: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: var(--cc-surface); border: 1px solid var(--cc-border); color: var(--cc-muted); }
.job-end-ok { border-color: #166534; background: linear-gradient(90deg, #06200f 0%, var(--cc-surface-2) 70%); }
.job-end-ok .job-end-pill { color: var(--cc-success); border-color: #166534; }
.job-end-late { border-color: #7f1d1d; background: linear-gradient(90deg, var(--cc-danger-soft) 0%, var(--cc-surface-2) 70%); }
.job-end-late .job-end-pill { color: var(--cc-danger); border-color: #7f1d1d; }

/* Price drop: run settings */
.run-params { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 .9rem; background: var(--cc-surface-2);
    border: 1px solid var(--cc-border); border-radius: .6rem; overflow: hidden; }
.run-params > div { background: var(--cc-surface-2); padding: .5rem .75rem; min-width: 0; }
.run-params dt { color: var(--cc-muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.run-params dd { margin: .15rem 0 0; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 991.98px) { .run-params { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.expiry-date { color: var(--cc-muted); font-size: .72rem; margin-top: .2rem; white-space: nowrap; }
.job-main { display: flex; flex-direction: column; align-items: center; }
.job-left { color: var(--cc-muted); font-size: .78rem; margin-top: .3rem; text-align: center; font-variant-numeric: tabular-nums; }
.job-actions { align-items: flex-start; }
.cc-link { color: var(--cc-muted); margin-left: .3rem; vertical-align: .05em; }
.cc-link:hover { color: var(--cc-primary-hover); }
.job-state { min-width: 6.5rem; font-weight: 600; }

/* Card page: SOL needed by the price drop. */
.sol-estimate { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; margin: .5rem 0; padding: .5rem .75rem; border: 1px solid var(--cc-border); border-radius: 8px; }
.sol-estimate .form-text { flex-basis: 100%; }
.sol-estimate.short { border-color: var(--cc-danger); background: var(--cc-danger-soft); }
