:root {
    --canvas: #f4f5ef; --paper: #fdfdf9; --ink: #20241f; --muted: #565e52;
    --line: #daddd3; --forest: #263628; --accent: #e97753; --wash: #e7edd9;
    --shadow: 0 22px 62px #232e1624; --radius: .8rem;
    font-family: Inter, Aptos, system-ui, sans-serif; font-size: 16px; color: var(--ink); background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, .button { min-height: 2.65rem; cursor: pointer; border: 1px solid transparent; border-radius: .5rem; padding: .55rem .85rem; background: var(--forest); color: #fff; font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
button:hover, .button:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #a5492c; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.quiet { background: transparent; color: var(--muted); border: 0; }
.small { font-size: .875rem; min-height: 2.2rem; padding: .35rem .6rem; }
.boot { display: grid; place-items: center; min-height: 85vh; color: var(--muted); }
.mark { display: inline-grid; width: 2.1rem; height: 2.1rem; place-items: center; border: 1px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.mark::before { content: ''; width: .95rem; height: .95rem; border: 1px solid currentColor; border-radius: 50%; }
.mark::after { content: ''; width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); position: absolute; top: .21rem; right: .15rem; }
.brand { display: flex; align-items: center; gap: .75rem; font-size: 1.14rem; font-weight: 750; letter-spacing: -.03em; }
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; color: #eef0e6; background: #242923; padding: 1.45rem 1.1rem; display: flex; flex-direction: column; gap: 2.5rem; }
.sidebar .brand { margin: .2rem .42rem 0; }
.nav { display: grid; gap: .35rem; }
.nav button { min-height: 2.7rem; justify-content: flex-start; border-radius: .4rem; color: #d8ddd3; background: transparent; font-weight: 520; text-align: left; }
.nav button[aria-current="page"] { background: #3c4837; color: #f5f7ed; box-shadow: inset 3px 0 var(--accent); }
.side-end { margin-top: auto; border-top: 1px solid #5c6658; padding-top: 1rem; font-size: .88rem; color: #d4dccd; }
.side-end button { color: #f0f2ea; padding-left: 0; }
.main { padding: 0 clamp(1.15rem, 4vw, 4.5rem) 3rem; max-width: 104rem; width: 100%; }
.masthead { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); min-height: 4rem; gap: 1rem; color: var(--muted); font-size: .88rem; }
.masthead strong { color: var(--forest); font-weight: 650; }
.hero { padding: clamp(2rem, 7vw, 5.3rem) 0 2rem; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1.4rem; }
.hero h1, .gate h1 { font: 500 clamp(2.9rem, 6.6vw, 6.3rem)/.94 Georgia, serif; margin: 0; letter-spacing: -.075em; }
.hero h1 i { color: #516342; font-weight: 400; }
.hero p { color: var(--muted); margin: .8rem 0 0; max-width: 42rem; line-height: 1.5; }
.hero button { align-self: end; }
.rail { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); margin-bottom: 2rem; }
.metric { min-width: 0; padding: 1rem 1.05rem; }
.metric:first-child { padding-left: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric span { color: var(--muted); font-size: .86rem; display: block; }
.metric b { font-size: clamp(1.1rem, 2.2vw, 1.8rem); font-weight: 620; display: block; margin-top: .2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin: 1.1rem 0; }
.section-head h2, .panel h2, dialog h2 { margin: 0; font-size: 1.28rem; letter-spacing: -.035em; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
input, select { width: 100%; padding: .66rem .75rem; min-height: 2.7rem; border: 1px solid #bbc2b7; border-radius: .42rem; background: #fff; color: var(--ink); }
.filters input, .filters select { width: auto; max-width: 100%; font-size: .9rem; }
label { display: block; font-weight: 620; font-size: .9rem; }
label > input, label > select { display: block; margin-top: .33rem; }
input[type="checkbox"] { width: auto; min-height: 0; display: inline; margin: 0 .45rem 0 0; }
.track, .source-row, .offer { border-top: 1px solid var(--line); display: grid; gap: .9rem; align-items: center; padding: 1rem 0; }
.track { grid-template-columns: minmax(0, 1.2fr) minmax(10rem, 1fr) auto; }
.source-row { grid-template-columns: minmax(8rem,.6fr) minmax(9rem, 1.2fr) auto; }
.offer { grid-template-columns: minmax(0,1fr) minmax(8rem,.35fr) auto; }
.track:last-child, .source-row:last-child, .offer:last-child { border-bottom: 1px solid var(--line); }
.row-title { font-weight: 730; margin: 0; }
.muted { color: var(--muted); }
.meta { font-size: .875rem; margin-top: .3rem; line-height: 1.4; overflow-wrap: anywhere; }
.snippet { margin: .5rem 0 0; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.line-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.source-switch::before { content: ' '; display: block; width: 1.65rem; height: .92rem; border: 1px solid #676f61; border-radius: 1rem; background: radial-gradient(circle at .42rem center, #676f61 .23rem, transparent .26rem); }
.source-switch[aria-checked="true"]::before { background: radial-gradient(circle at 1.12rem center, #fff .24rem, transparent .27rem), #34533a; border-color: #34533a; }
.status { border-radius: .3rem; background: var(--wash); color: #344632; padding: .17rem .38rem; font-size: .8rem; }
.status.error { background: #f7e3dc; color: #762e1d; }
.empty { border: 1px solid var(--line); padding: clamp(1.4rem, 5vw, 3rem); background: var(--paper); border-radius: var(--radius); }
.empty h3 { font-family: Georgia,serif; font-size: 1.6rem; font-weight: 500; margin: 0 0 .5rem; }
.empty p { margin: 0 0 .8rem; max-width: 34rem; line-height: 1.55; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.55rem); margin: 0 0 1rem; }
.panel p { margin-top: .55rem; line-height: 1.5; }
.form-grid { display: grid; gap: .9rem; }
.cols { display: grid; gap: .85rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.cities { display: grid; gap: .45rem; }
.city-results { max-height: 10rem; overflow: auto; display: grid; border: 1px solid var(--line); border-radius: .4rem; }
.city-results:empty, .chosen:empty { display: none; }
.city-results button { justify-content: start; border-radius: 0; border: 0; }
.chosen { display: flex; flex-wrap: wrap; gap: .35rem; }
.chosen button { font-size: .83rem; }
dialog { width: min(calc(100% - 1.8rem), 34rem); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); color: var(--ink); padding: 1.4rem; box-shadow: var(--shadow); }
dialog::backdrop { background: #18211785; }
dialog h2 { margin-bottom: 1.15rem; }
dialog p { margin: 0; }
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(16rem, .93fr) 1.07fr; }
.gate-brand { background: #242923; color: #eff2e9; padding: clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; gap: 2.4rem; overflow: hidden; position: relative; }
.gate-brand h1 { max-width: 7ch; position: relative; z-index: 1; margin-bottom: .7rem; }
.gate-brand p { color: #d1d8c9; position: relative; z-index: 1; }
.rings { position: absolute; bottom: -8rem; right: -9rem; width: 28rem; height: 28rem; border: 1px solid #768c6a; border-radius: 100%; box-shadow: 0 0 0 2.6rem #334034, 0 0 0 2.65rem #687862, 0 0 0 5rem #303b32, 0 0 0 5.05rem #4e6250; opacity: .65; }
.rings::after { content: ''; position: absolute; background: var(--accent); border-radius: 50%; width: 1rem; height: 1rem; left: 3.6rem; top: 3.4rem; }
.gate-form { padding: 2rem clamp(1.3rem, 10vw, 9rem); display: grid; align-content: center; min-width: 0; }
.gate-form h2 { font: 500 clamp(1.9rem, 4vw, 3.4rem)/1 Georgia, serif; margin: 0 0 .65rem; letter-spacing: -.05em; }
.gate-form p { line-height: 1.5; }
.gate-form button { width: 100%; }
.message { min-height: 1.4rem; color: #803522; font-size: .9rem; }
#announcement:not(:empty) { position: fixed; z-index: 2; right: 1rem; bottom: 1rem; background: var(--ink); color: white; padding: .8rem 1rem; border-radius: .4rem; max-width: min(24rem,calc(100vw - 2rem)); box-shadow: var(--shadow); }
@media (max-width:920px) { .shell { grid-template-columns: 12rem minmax(0, 1fr); } .sidebar { padding-inline: .75rem; } .track,.offer { grid-template-columns: minmax(0,1fr) auto; } .track .line-actions,.offer .line-actions { grid-column: 1/-1; } }
@media (max-width:670px) {
    .shell { display: block; }
    .sidebar { position: static; height: auto; gap: .65rem; padding: .8rem .75rem .35rem; }
    .sidebar .brand { margin: .1rem .4rem .35rem; }
    .nav { display: flex; gap: .15rem; overflow: auto; }
    .nav button { white-space: nowrap; padding-inline: .65rem; font-size: .87rem; }
    .nav button[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
    .side-end { display: none; }
    .masthead { min-height: 3.3rem; }
    .hero { padding: 2rem 0 1.4rem; grid-template-columns: 1fr; }
    .hero button { justify-self: start; }
    .metric { padding: .75rem .5rem; }
    .source-row { grid-template-columns: 1fr; gap: .4rem; }
    .offer { grid-template-columns: 1fr; }
    .offer .line-actions { grid-column: auto; }
    .track { grid-template-columns: 1fr; }
    .gate { grid-template-columns: 1fr; }
    .gate-brand { padding: 1rem 1.25rem 1.5rem; gap: 2rem; min-height: 15rem; }
    .gate-brand p { margin-bottom: 0; }
    .gate-form { padding: 2rem 1.25rem; }
}
