:root {
    --paper: #f3eee4;
    --paper-deep: #e7dfd0;
    --ink: #1c1915;
    --muted: #5e574c;
    --line: #d9d0c0;
    --card: #fffdf8;
    --ember: #c84b1a;
    --ember-dark: #9a3510;
    --pine: #1d6b43;
    --gold: #8a6a2f;
    --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 16.5px;
    line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; }

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(243, 238, 228, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.55rem;
    font-weight: 620;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: block;
    flex: 0 0 auto;
}

.brand span { font-style: italic; font-weight: 500; }

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.beta-mark {
    padding: 2px 7px;
    border: 1px solid var(--ember);
    color: var(--ember);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
}

.nav a.active,
.nav a:hover { color: var(--ink); }

.nav-join {
    background: var(--ink);
    color: var(--paper) !important;
    padding: 8px 12px;
    text-decoration: none;
}

.banner {
    background: var(--ink);
    color: var(--paper);
    text-align: center;
    padding: 12px 16px;
}

.banner strong { font-weight: 600; }

.hold-bar {
    background: #f3e2b8;
    color: var(--ink);
    text-align: center;
    padding: 12px 16px;
    border-top: 1px solid #e2c98a;
    font-weight: 500;
}

.hold-warn {
    display: flex;
    justify-content: center;
    padding: 0 16px 14px;
}

.hold-warn p {
    margin: 0;
    max-width: 40rem;
    text-align: center;
    background: #fde8df;
    border: 1px solid var(--ember);
    padding: 12px 18px;
    font-weight: 500;
}

.hold-bar strong { font-weight: 600; }

.hold-bar a { font-weight: 600; }

.todo {
    background: var(--card);
    border: 2px solid var(--gold);
    padding: 8px 18px 6px;
    margin: 8px 0 32px;
}

.todo h2 { margin-bottom: 4px; }

.todo-empty { color: var(--muted); margin-top: 0; }

.todo-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.todo-item p { margin: 0; }

.todo-item .meta { display: block; }

main { padding: 28px 0 64px; }

.flash,
.form-errors {
    padding: 12px 14px;
    margin-bottom: 18px;
}

.flash {
    background: #e7f3ec;
    border: 1px solid var(--pine);
}

.form-errors {
    background: #fde8df;
    border: 1px solid var(--ember);
}

.form-errors ul { margin: 0; padding-left: 18px; }

h1, h2, h3 {
    font-family: Fraunces, Georgia, serif;
    font-weight: 560;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 0 0 14px; }

h2 { font-size: 2rem; margin: 0 0 12px; }

.lede {
    font-size: 1.18rem;
    max-width: 38rem;
    color: var(--ink);
    margin: 0 0 22px;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ember);
}

.hero {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 36px;
    align-items: end;
    padding: 18px 0 10px;
}

.hero-actions, .stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ember); border-color: var(--ember); color: white; }
.btn-primary:hover { background: var(--ember-dark); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-block { width: 100%; }
.btn-small { padding: 8px 10px; font-size: 0.92rem; }

.example {
    background: var(--card);
    border: 1px solid var(--ink);
    box-shadow: 8px 8px 0 var(--ink);
    padding: 18px 18px 16px;
}

.example h2 {
    font-size: 1.45rem;
    margin: 0 0 6px;
}

.step h2 { margin-top: 8px; }

main h2 { margin-top: 32px; }

.example p { margin: 0 0 12px; color: var(--muted); }

.prem-list { list-style: none; margin: 0; padding: 0; }
.prem-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}
.prem-list .out { color: var(--muted); }
.tag {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold);
}

.example-result {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid var(--ink);
    font-variant-numeric: tabular-nums;
}

.example-result strong {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.8rem;
    font-weight: 560;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 54px 0 18px;
}

.step {
    border-top: 2px solid var(--ink);
    padding-top: 12px;
}

.step em {
    font-family: Fraunces, Georgia, serif;
    font-style: italic;
    font-size: 1.4rem;
    color: var(--ember);
}

.tour {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    align-items: start;
    margin-top: 28px;
}

.tour-rail {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tour-rail a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    text-decoration: none;
    color: var(--muted);
}

.tour-rail em {
    font-family: Fraunces, Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ember);
}

.tour-rail a.is-here {
    color: var(--ink);
    font-weight: 600;
}

.tour-stop {
    min-height: calc(100vh - 130px);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: start;
    padding: 32px 0 48px;
    border-top: 2px solid var(--ink);
    scroll-margin-top: 88px;
}

.tour-stop h2 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.tour-stop h3 {
    margin: 0 0 6px;
    font-size: 1.45rem;
}

.tour-stop .footnote { margin-bottom: 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin: 42px 0 8px;
}

.section-head h2 { margin: 0; }

.section-head a { color: var(--ember); font-weight: 600; }

.footnote { color: var(--muted); margin-top: 8px; }

.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.book-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 16px;
    text-decoration: none;
    min-height: 100%;
    box-shadow: var(--shadow);
}

.book-card:hover { border-color: var(--ink); }

.masked {
    letter-spacing: 0.12em;
    font-weight: 600;
}

.guest-join { margin: 22px 0 8px; }

.card-top, .card-bid, .card-buy {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.card-top { margin-bottom: 12px; }

.time-left { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; }

.pill {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.pill-live { background: var(--pine); color: white; }
.pill-sold { background: var(--ink); color: var(--paper); }
.pill-pending { background: var(--gold); color: white; }
.pill-rejected { background: var(--ember); color: white; }
.pill-nda, .pill-sale_pending { background: var(--gold); color: white; }
.pill-ended, .pill-withdrawn, .pill-removed, .pill-inactive { background: var(--paper-deep); color: var(--muted); }

.nda-doc {
    max-height: 28rem;
    overflow: auto;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    background: white;
    white-space: pre-wrap;
    font-size: 0.92rem;
    line-height: 1.45;
}

.notice {
    padding: 12px 14px;
    background: var(--paper-deep);
    border: 1px solid var(--line);
    margin: 0 0 18px;
}

.seller-alert {
    background: #fde8df;
    border-color: var(--ember);
}

.seller-alert p {
    margin: 0 0 8px;
}

.seller-alert p:last-child {
    margin-bottom: 0;
}

.choice {
    border: 0;
    margin: 18px 0 6px;
    padding: 0;
}

.choice legend {
    padding: 0;
    margin: 0 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.choice .check { margin: 8px 0; }

.carrier-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
}

.carrier-picks .check { margin: 6px 0; }

.carrier-settings {
    display: grid;
    gap: 8px;
}

.carrier-settings .check {
    margin: 0;
    align-items: center;
}

.carrier-settings .check input.carrier-name {
    width: 100%;
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
}

.state-line {
    display: flex;
    gap: 8px;
    align-items: center;
}

.state-line input { flex: 1; cursor: pointer; }

.state-line .btn { flex: none; }

body.state-modal-open { overflow: hidden; }

.state-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(28, 25, 21, 0.45);
}

.state-modal[hidden] { display: none; }

.state-modal-card {
    width: min(440px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    padding: 14px;
}

.state-modal-title {
    margin: 0 0 10px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
}

.state-chip {
    margin: 0;
    padding: 4px 0;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    cursor: pointer;
}

.state-chip.is-on {
    background: var(--ember);
    border-color: var(--ember);
    color: white;
}

.state-chosen {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.state-chosen:empty { display: none; }

.state-chosen-chip {
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--ember);
    background: var(--ember);
    color: white;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
}

.state-chosen-chip::after {
    content: " \00d7";
}

.state-modal-card .row-actions { margin-top: 12px; }

.carrier-modal-card { width: min(560px, 100%); }

.confirm-modal-card {
    width: min(640px, 100%);
    max-height: calc(100vh - 32px);
    padding: 18px;
}

#confirm-modal .confirm-modal-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.confirm-details {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    margin: 0 0 4px;
    overflow: auto;
    min-height: 0;
}

.terms-modal .confirm-modal-card { overflow: auto; }

.confirm-details .pair strong {
    max-width: 68%;
    text-align: right;
    font-weight: 600;
}

.confirm-note {
    margin: 8px 0;
}

.confirm-note span {
    color: var(--muted);
    font-size: 0.92rem;
}

.confirm-note p {
    margin: 2px 0 0;
}

.confirm-modal-card .check { margin: 12px 0; }

.terms-modal { z-index: 50; background: rgba(28, 25, 21, 0.72); }

.terms-copy p { margin: 0 0 10px; }

.terms-copy p:last-child { margin-bottom: 14px; }

.text-link {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.carrier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.carrier-chip {
    margin: 0;
    padding: 4px 6px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.carrier-chip.is-on {
    background: var(--ember);
    border-color: var(--ember);
    color: white;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form { display: inline; }

.table-wrap { overflow-x: auto; }

.bid-actions {
    justify-content: flex-end;
    gap: 8px;
}

#min-bid-wrap[hidden] { display: none; }

.book-card h3, .book-title {
    font-size: 1.45rem;
    margin: 0 0 4px;
}

.carrier { margin: 0; font-weight: 600; }
.meta, .count { margin: 2px 0; color: var(--muted); }

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 12px 0;
}

.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-4 { grid-template-columns: repeat(4, 1fr); }

.stats + .stats { margin-top: -13px; }

.stats div { padding: 8px 8px 8px 0; }
.stats div + div { border-left: 1px solid var(--line); padding-left: 8px; }
.stats .k, .k {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.stats .v, .v {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.card-bid, .card-buy {
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.card-buy strong { color: var(--ember); }

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 8px 0 14px;
}

.filter-row a {
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
}

.filter-row a.active,
.filter-row a:hover { color: var(--ink); }

.filter-row a.active { border-bottom: 2px solid var(--ember); }

.search {
    display: flex;
    gap: 8px;
    margin: 8px 0 18px;
}

.search input { flex: 1; }

.layout-book {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.bid-card {
    position: sticky;
    top: 84px;
    background: var(--card);
    border: 1px solid var(--ink);
    box-shadow: 6px 6px 0 var(--ink);
    padding: 16px;
}

.bid-card h2 { font-size: 1.7rem; margin: 8px 0; }

.bid-card p { margin: 8px 0; }

.seller {
    color: var(--muted);
    margin: 0 0 8px;
}

.policy-table, .plain-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.policy-table th, .plain-table th {
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.policy-table td, .policy-table th,
.plain-table td, .plain-table th {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.dir-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.dir-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    min-width: 0;
}

.dir-line strong { flex: none; font-weight: 600; }

.dir-detail {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.dir-line .pill,
.dir-count { flex: none; font-variant-numeric: tabular-nums; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

tr.excluded td { color: var(--muted); }

.history { list-style: none; margin: 0; padding: 0; }

.history li.reject-row { display: block; }

.reject-form {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.reject-form input {
    width: auto;
    flex: 1;
    padding: 8px 10px;
}
.history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.form {
    max-width: 720px;
}

.narrow { max-width: 460px; }

label {
    display: block;
    margin: 14px 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
}

textarea { min-height: 110px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--ember);
    outline-offset: 1px;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 16px 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
    font-weight: 400;
}

.check input { width: auto; margin-top: 4px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }

.choice-row { margin: 18px 0 6px; }

.choice-row .choice {
    margin: 0;
    min-width: 0;
}

.policy-head, .policy-row {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr 0.8fr auto;
    gap: 8px;
    align-items: center;
}

.policy-head {
    margin-top: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.policy-row { margin-top: 8px; }

.row-remove {
    border: 1px solid var(--line);
    background: transparent;
    font: inherit;
    padding: 11px 10px;
    cursor: pointer;
}

.calc {
    margin-top: 16px;
    padding: 12px;
    background: var(--paper-deep);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pair { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }

.page-intro { max-width: 40rem; color: var(--muted); }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 22px 0 32px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 18px;
}

.footer-inner p { margin: 4px 0 0; color: var(--muted); }

.empty {
    border: 1px dashed var(--line);
    padding: 18px;
    background: var(--card);
}

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 12px 0;
    }
    .nav { width: 100%; }
    .hero, .steps, .book-grid, .layout-book, .footer-inner, .form-row, .form-row.cols-2, .tour, .tour-stop {
        grid-template-columns: 1fr;
    }
    .tour-rail {
        top: 64px;
        z-index: 4;
        flex-direction: row;
        gap: 14px;
        overflow-x: auto;
        background: rgba(243, 238, 228, 0.94);
        padding: 8px 0;
    }
    .tour-rail a { white-space: nowrap; }
    .tour-stop { min-height: 70vh; }
    .stats-4 { grid-template-columns: 1fr 1fr; }
    .carrier-picks { grid-template-columns: 1fr 1fr; }
    .example { box-shadow: 4px 4px 0 var(--ink); }
    .bid-card { position: static; }
    .policy-head { display: none; }
    .policy-row { grid-template-columns: 1fr; }
}
