:root {
    --bg-main: #f2eee7;
    --bg-soft: #e6ddd0;
    --bg-card: #f8f5ef;
    --text-main: #2f2a24;
    --text-muted: #6a6158;
    --border: #c9bbab;
    --accent: #8d6f4f;
    --accent-soft: #c8ad8d;
    --focus: #3f6f7a;
    --radius-sm: 8px;
    --radius-md: 14px;
    --shadow-soft: 0 8px 24px rgba(58, 45, 31, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Work Sans", "Segoe UI", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top right, #d9c9b2 0%, #f2eee7 46%, #e4ddd2 100%);
    min-height: 100vh;
}

h1,
h2,
h3 {
    font-family: "Fraunces", Georgia, serif;
    line-height: 1.2;
    margin-top: 0;
}

p,
li {
    line-height: 1.6;
}

.container {
    width: min(1080px, 92vw);
    margin: 0 auto;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--bg-main) 85%, white 15%);
    border-bottom: 1px solid var(--border);
}

.header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.brand-mark {
    display: none;
}
.brand-logo {
    height: 32px;
    width: auto;
    margin-right: 0.5rem;
    vertical-align: middle;
}
.home-logo img {
    max-width: 220px;
    width: 60vw;
    height: auto;
    display: inline-block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.nav-link {
    display: inline-flex;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid transparent;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    border-color: var(--border);
    background: var(--bg-soft);
}

.nav-link.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent-soft) 30%, var(--bg-main) 70%);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    font-weight: 600;
    color: var(--text-main);
}

.site-main {
    padding: 2.2rem 0 2.8rem;
    flex: 1;
}

.page-intro {
    margin-bottom: 1.6rem;
    animation: rise-in 380ms ease both;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.lede {
    color: var(--text-muted);
    max-width: 70ch;
}

.panel,
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 1.3rem;
    animation: rise-in 430ms 40ms ease both;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.tab-btn {
    border: 1px solid var(--border);
    background: #efe8dd;
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.tab-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.card-grid {
    margin-top: 1.3rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.card {
    padding: 1.15rem;
    animation: rise-in 520ms ease both;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-main) 88%, var(--bg-soft) 12%);
}

    .footer-wrap {
        padding: 0.3rem 0 0.5rem;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-main);
        border-bottom: 1px solid var(--border);
        padding: 0.8rem 1rem 1rem;
        display: none;
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav.is-open {
        display: flex;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Dropdown (three-bar) ── */

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropdown-toggle:hover {
    border-color: var(--border);
    background: var(--bg-soft);
}

.hamburger-bar {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    z-index: 30;
}

.dropdown-link {
    display: block;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.15s ease;
}

.dropdown-link:hover {
    background: var(--bg-soft);
}

.dropdown-link.is-active {
    background: color-mix(in srgb, var(--accent-soft) 30%, var(--bg-main) 70%);
    color: var(--accent);
}

/* ── User widget ── */

.user-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid transparent;
    padding: 0.3rem 0.65rem 0.3rem 0.4rem;
    border-radius: 999px;
    font-weight: 500;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.user-btn:hover {
    transform: translateY(-1px);
    border-color: var(--border);
    background: var(--bg-soft);
}

.user-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
}

.user-guest {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.user-guest-link {
    text-decoration: none;
    border: 1px solid transparent;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.user-guest-link:hover {
    transform: translateY(-1px);
    border-color: var(--border);
    background: var(--bg-soft);
}

/* ── Shared button styles ── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-soft);
    transform: translateY(-1px);
}

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

/* ── Auth / form pages ── */

.auth-panel {
    max-width: 480px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent 82%);
}

.form-help {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.form-errors,
.field-errors {
    list-style: none;
    margin: 0;
    padding: 0;
}

.form-errors {
    background: color-mix(in srgb, #c0392b 12%, var(--bg-card) 88%);
    border: 1px solid color-mix(in srgb, #c0392b 30%, var(--border) 70%);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
}

.form-errors li,
.field-errors li {
    font-size: 0.88rem;
    color: #8b2020;
}

.field-errors li {
    margin-top: 0.2rem;
}

.form-actions {
    margin-top: 1.2rem;
}

.auth-links {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-divider {
    color: var(--border);
}

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

/* ── Profile page ── */

.profile-list {
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.profile-row {
    display: flex;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row dt {
    width: 140px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.1rem;
}

.profile-row dd {
    margin: 0;
    font-size: 0.95rem;
}
/* ============================================================
   Links — category index cards
   ============================================================ */

.links-category-section {
    margin-top: 1.1rem;
    animation: rise-in 430ms 40ms ease both;
}

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

.links-cat-card {
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
}

.links-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(58, 45, 31, 0.14);
    border-color: var(--accent);
}

.links-cat-image {
    height: 180px;
    overflow: hidden;
}

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

.links-cat-img--contain {
    object-fit: contain;
    padding: 1rem;
}

.links-cat-body {
    text-align: center;
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.links-product-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.links-product-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.links-cat-icon {
    font-family: sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    display: block;
    margin-top: auto;
    padding-top: 0.75rem;
    color: var(--accent);
}

/* ============================================================
   Links — category back link
   ============================================================ */

.links-back-row {
    margin-top: 1.1rem;
    margin-bottom: 0.5rem;
}

.links-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.links-back-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-card);
    transform: translateX(-2px);
}

.links-product-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}


/* ==========================================================================
   Leaderboards
   ========================================================================== */

.lb-layout {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.lb-entity-tabs {
    margin-bottom: 0;
}

/* Filters */
.lb-filters {
    padding: 0.9rem 1.1rem;
}

.lb-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.2rem;
}

.lb-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.lb-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lb-search-input,
.lb-starts-input,
.lb-date-input {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.42rem 0.7rem;
    font: inherit;
    background: #fff;
    color: var(--text-main);
}

.lb-search-input { width: 200px; }
.lb-starts-input { width: 90px; }
.lb-date-input { width: 160px; }

.lb-filter-btn {
    align-self: flex-end;
    padding: 0.42rem 1.1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.lb-filter-btn:hover { opacity: 0.85; }

.lb-reset-link {
    align-self: flex-end;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.42rem 0.2rem;
    transition: color 0.15s ease;
}

.lb-reset-link:hover { color: var(--text-main); }

/* Panel header row */
.lb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.lb-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Raw / Smooth pill toggle */
.lb-raw-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lb-raw-toggle:hover .lb-toggle-label { color: var(--text-main); }

.lb-raw-cb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.22s ease, border-color 0.22s ease;
}

.lb-raw-cb::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: transform 0.22s ease, background 0.22s ease;
}

.lb-raw-cb:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.lb-raw-cb:checked::after {
    transform: translateX(16px);
    background: #fff;
}

/* Table */
.lb-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

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

.lb-table thead {
    background: var(--bg-soft);
}

.lb-th {
    padding: 0.55rem 0.85rem;
    text-align: right;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-soft);
}

.lb-th.lb-name-col { text-align: left; }

.lb-th.is-sorted {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent-soft) 22%, var(--bg-soft) 78%);
}

.lb-sort-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    transition: color 0.15s ease;
}

.lb-sort-link:hover { color: var(--accent); }

.lb-sort-caret { font-size: 0.68em; opacity: 0.75; }

.lb-table tbody tr {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent 45%);
    transition: background 0.12s ease;
}

.lb-table tbody tr:last-child { border-bottom: none; }

.lb-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--bg-soft) 40%, var(--bg-card) 60%);
}

.lb-table tbody tr:hover {
    background: color-mix(in srgb, var(--accent-soft) 16%, var(--bg-card) 84%) !important;
}

.lb-table td {
    padding: 0.5rem 0.85rem;
    text-align: right;
    color: var(--text-main);
}

.lb-name {
    text-align: left;
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-num { font-variant-numeric: tabular-nums; }

/* Raw / Smooth column visibility */
.raw-col    { display: none; }
.smooth-col { display: table-cell; }

.lb-table.show-raw .raw-col    { display: table-cell; }
.lb-table.show-raw .smooth-col { display: none; }

/* Empty state */
.lb-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Pagination */
.lb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--accent-soft) 8%, var(--bg-card, #fff) 92%);
    border-radius: 0 0 var(--radius, 6px) var(--radius, 6px);
}

.lb-page-btn {
    padding: 0.32rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.lb-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-muted);
}

.lb-page-btn:not(:disabled):hover {
    background: var(--accent);
    color: #fff;
}

.lb-page-info {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    min-width: 14ch;
    text-align: center;
}

@media (max-width: 680px) {
    .lb-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .lb-search-input,
    .lb-starts-input,
    .lb-date-input {
        width: 100%;
    }
}

/* ── Tools nav hover dropdown ── */

.nav-tools-dropdown {
    position: relative;
}

.nav-link--dropdown {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-caret {
    width: 10px;
    height: 7px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-tools-dropdown:hover .nav-caret,
.nav-tools-dropdown:focus-within .nav-caret {
    transform: rotate(180deg);
}

.nav-tools-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    padding-top: 10px; /* bridges the gap so hover stays active */
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.nav-tools-dropdown:hover .nav-tools-menu,
.nav-tools-dropdown:focus-within .nav-tools-menu {
    opacity: 1;
    pointer-events: all;
}

/* ── DeepOutcomes ── */

.deepoutcomes-panel {
    max-width: 1020px;
}

/* Picker row ─────────────────────────────────────────────────────────────── */

.do-picker-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
}

.do-picker-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.do-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Shared input/select style */
.do-input {
    height: 2.4rem;
    padding: 0 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
    font-size: 0.93rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.do-input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent 84%);
}

.do-select {
    padding-right: 2rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236a6158' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    cursor: pointer;
}

/* Load Card button */
.do-load-btn {
    height: 2.4rem;
    padding: 0 1.35rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.18s ease, transform 0.12s ease;
    align-self: flex-end;
}

.do-load-btn:hover { opacity: 0.88; }
.do-load-btn:active { transform: scale(0.97); }

/* Combobox / dropdown */
.do-combobox {
    position: relative;
}

.do-combobox .do-input {
    width: 220px;
}

.do-dropdown {
    display: block;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 340px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    list-style: none;
    margin: 0;
    padding: 0.3rem;
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
}

.do-dropdown[hidden] { display: none; }

.do-dropdown li {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.45rem 0.7rem;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    transition: background 0.12s ease;
}

.do-dropdown li:hover,
.do-dropdown li.is-active {
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-soft) 90%);
}

.do-dd-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.do-dd-loc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Controls row */

.do-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin: 0.9rem 0 0.5rem;
}

.do-controls-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.do-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

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

.deepoutcomes-table th,
.deepoutcomes-table td {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.deepoutcomes-table th {
    background: var(--bg-soft);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    user-select: none;
}

.deepoutcomes-table th[style*="cursor"] {
    white-space: nowrap;
}

.deepoutcomes-table th::after {
    content: '';
    display: inline-block;
    width: 0.7em;
    margin-left: 0.3em;
    opacity: 0;
}

.deepoutcomes-table th[data-sort-dir="asc"]::after {
    content: '▲';
    opacity: 1;
}

.deepoutcomes-table th[data-sort-dir="desc"]::after {
    content: '▼';
    opacity: 1;
}

.deepoutcomes-table .do-col-name {
    text-align: left;
    min-width: 140px;
    font-weight: 600;
}

.deepoutcomes-table .do-col-pp {
    width: 36px;
}

.deepoutcomes-table .do-col-odds {
    width: 68px;
}

/* probability cell heat-map colouring: dark red → white → dark blue (set inline by JS) */
.deepoutcomes-table td[data-heat] {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.status-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 1.4em;
    margin-top: 0.5rem;
}

/* ── xPurse ── */

.xpurse-panel {
    max-width: 1020px;
}

.xpurse-table .xp-col-xpurse {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* xPurse heat-map: gold-to-green scale */
.xpurse-table td[data-xp-heat] {
    background: color-mix(in srgb, #c8a832 calc(var(--xp-heat, 0) * 1%), var(--bg-card) calc(100% - var(--xp-heat, 0) * 1%));
    color: color-mix(in srgb, #fff calc(var(--xp-heat, 0) * 0.75%), var(--text-main) calc(100% - var(--xp-heat, 0) * 0.75%));
}

.xp-save-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.xp-save-btn:hover {
    background: color-mix(in srgb, var(--accent) 80%, black 20%);
}

/* ── Kelly Bet Sizing ── */

.kelly-panel {
    max-width: 860px;
}

.kelly-result {
    margin-top: 1.5rem;
}

.kelly-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.kelly-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}

.kelly-stat-bet {
    border-color: var(--accent);
}

.kelly-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kelly-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

.kelly-stat-bet .kelly-stat-value {
    font-size: 1.6rem;
    color: var(--accent);
}

.kelly-no-bet {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

/* ============================================================
   Blog — post list
   ============================================================ */

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: rise-in 430ms 40ms ease both;
}

.post-list-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
}

.post-list-thumb-link {
    flex-shrink: 0;
}

.post-list-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: block;
    transition: opacity 0.15s ease;
}

.post-list-thumb-link:hover .post-list-thumb {
    opacity: 0.85;
}

.post-list-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.post-list-item:first-child {
    padding-top: 0.4rem;
}

.post-list-title {
    margin: 0;
    font-size: 1.25rem;
}

.post-list-title a {
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.15s ease;
}

.post-list-title a:hover {
    color: var(--accent);
}

/* ── Blog layout (list page) ───────────────────────────────── */

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 3rem;
    align-items: start;
}

.blog-posts {
    min-width: 0;
}

.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.tag-cloud-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.tag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tag:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.tag--active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent 90%);
}

.post-tags {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.no-tags {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

    .blog-sidebar {
        position: static;
        order: -1;
    }
}

/* ============================================================
   Blog — post detail
   ============================================================ */

.post-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.post {
    animation: rise-in 430ms 40ms ease both;
}

/* ── Prose typography ──────────────────────────────────────── */

.prose {
    max-width: 72ch;
    line-height: 1.75;
    font-size: 1.05rem;
}

.prose h2 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.5rem;
    margin-top: 2.6rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.prose p {
    margin: 0 0 1.1rem;
}

.prose ul {
    padding-left: 1.4rem;
    margin: 0 0 1.1rem;
}

.prose li {
    margin-bottom: 0.45rem;
}

.prose strong {
    font-weight: 700;
    color: var(--text-main);
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.8rem 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    margin: 1.6rem 0;
}

/* Opening lede */
.prose .post-intro {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.12rem;
    margin-bottom: 1.8rem;
    margin-top: 0.6rem;
}

/* Callout blockquote */
.prose .post-callout {
    margin: 1.4rem 0;
    padding: 1rem 1.25rem;
    background: color-mix(in srgb, var(--accent-soft) 20%, var(--bg-card) 80%);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-muted);
}

.prose .post-callout p {
    margin: 0;
}

/* Data table */
.post-table-wrap {
    overflow-x: auto;
    margin: 1.4rem 0 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.post-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.post-table-wrap thead {
    background: var(--bg-soft);
}

.post-table-wrap th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.post-table-wrap td {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent 45%);
    font-variant-numeric: tabular-nums;
}

.post-table-wrap tbody tr:last-child td {
    border-bottom: none;
}

.post-table-wrap tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--bg-soft) 40%, var(--bg-card) 60%);
}

.stat-raw {
    color: color-mix(in srgb, #b83030 85%, var(--text-main) 15%);
    font-weight: 600;
}

.stat-smooth {
    color: var(--accent);
    font-weight: 700;
}

/* Figure caption below table */
.post-figcaption {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0;
    margin-bottom: 1.6rem;
}

/* Footnote */
.post-footnote {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-top: 0;
}

@font-face {
  font-family: 'USDeclaration';
  src: url('../fonts/zai_USDeclaration.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

.nav-link[href="/the-inquiry/"] {
  font-family: 'USDeclaration', serif;
  font-size: 0.75em;
}

.font-declaration {
  font-family: 'USDeclaration', serif;
}

/* ── Comments ───────────────────────────────────────────────── */
.comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.comments-heading {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-soft);
}

.comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.comment-author {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.prose-comment {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}

.prose-comment p { margin: 0 0 0.4rem; }
.prose-comment p:last-child { margin-bottom: 0; }
.prose-comment ul,
.prose-comment ol {
    padding-left: 1.4rem;
    margin: 0.4rem 0;
}
.prose-comment li { margin-bottom: 0.2rem; }

.no-comments {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Comment form */
.comment-form-section {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.comment-form-heading {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Override Quill snow theme to match site palette */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-soft);
}

.ql-container.ql-snow {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--bg-main);
    font-family: "Work Sans", "Segoe UI", sans-serif;
    font-size: 0.95rem;
}

.ql-editor {
    min-height: 120px;
    color: var(--text-main);
}

.ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: italic;
}

.ql-snow .ql-stroke { stroke: var(--text-muted); }
.ql-snow .ql-fill { fill: var(--text-muted); }
.ql-snow .ql-picker { color: var(--text-muted); }
.ql-snow .ql-picker-options { background: var(--bg-card); border-color: var(--border); }

.comment-form-actions {
    margin-top: 1rem;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: "Work Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn--primary:hover { background: var(--text-main); }

.sign-in-prompt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.sign-in-prompt .link {
    color: var(--accent);
    text-decoration: underline;
}