/* Betting 0 — warm paper, charcoal and terracotta. No external fonts or assets. */
:root {
  --ink: #292824;
  --muted: #716b62;
  --paper: #f6f4ef;
  --surface: #fffefa;
  --line: #e2ddd4;
  --brand: #a64029;
  --brand-hover: #87311f;
  --brand-soft: #f5e6df;
  --teal: var(--brand);
  --red: #a33532;
  --serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: var(--serif); font-size: clamp(32px, 3.5vw, 46px); font-weight: 500; letter-spacing: -.045em; line-height: 1.1; margin-bottom: 12px; }
h2 { font-size: 20px; letter-spacing: -.025em; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
small, .small { font-size: 12px; }
.eyebrow { display: block; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 500; color: var(--brand); margin-bottom: 12px; }
.mono, .numeric { font-variant-numeric: tabular-nums; }
.numeric { text-align: right; white-space: nowrap; }
.positive { color: #326a50; }
.negative { color: var(--red); }

/* Persistent horizontal navigation, shared by every section. */
.frame { min-height: 100vh; }
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.section-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 8px 38px; max-width: 1700px; margin: auto; }
.topbar-brand { display: flex; align-items: center; gap: 32px; min-width: 0; }
.section-context { border-left: 1px solid var(--line); padding-left: 26px; }
.section-view, #room-discovery { scroll-margin-top: 190px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { position: relative; flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 44px; border: 1px solid var(--ink); color: var(--ink); font-family: var(--serif); font-size: 36px; line-height: 1; }
.brand-mark::after { content: ''; position: absolute; right: -4px; bottom: 5px; width: 8px; height: 8px; background: var(--brand); border: 2px solid var(--surface); }
.brand strong { display: block; font-size: 20px; font-family: var(--serif); font-weight: 600; letter-spacing: -.035em; }
.brand small { display: block; color: var(--muted); margin-top: 4px; font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }
.nav-link { display: flex; flex-shrink: 0; gap: 8px; align-items: center; padding: 11px 12px 9px; border-radius: 4px 4px 0 0; border-bottom: 2px solid transparent; white-space: nowrap; color: #655f56; font-size: 12px; font-weight: 500; transition: background-color .12s, color .12s; }
.nav-link i { font-style: normal; display: grid; place-items: center; width: 18px; flex-shrink: 0; }
.icon { display: inline-block; width: 18px; height: 18px; vertical-align: -.2em; flex-shrink: 0; }
.nav-link:hover { background: #f1eee8; color: var(--ink); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); border-bottom-color: var(--brand); font-weight: 600; }
.main-column { min-width: 0; }
.topbar { position: relative; min-height: 80px; max-width: 1700px; margin: auto; padding: 16px 38px; display: flex; justify-content: space-between; gap: 15px; align-items: center; border-bottom: 1px solid var(--line); }
.topbar small { display: block; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; margin-bottom: 3px; }
.topbar strong { font-size: 12px; }
.topbar .brand strong { font-size: 20px; }
.topbar .brand small { margin-bottom: 0; }
.top-actions { display: flex; gap: 14px; align-items: center; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #d6cec2; background: #eee9df; color: #554e43; font-size: 11px; }
.link-button { border: 0; background: transparent; color: var(--brand); padding: 0; font-size: 12px; font-weight: 600; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.local-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); border: 1px solid var(--line); padding: 6px 10px; border-radius: 4px; white-space: nowrap; }
.local-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #527052; }
.sync-status { display: inline-flex; align-items: center; gap: 7px; min-width: 104px; font-size: 10px; color: var(--muted); opacity: 0; }
.sync-status.is-syncing { opacity: 1; }
.sync-status.is-syncing::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.main { padding: 36px 38px 45px; max-width: 1700px; margin: auto; }
.section-view { min-width: 0; }
.heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.heading p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.heading > .actions { flex-shrink: 0; max-width: 42%; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d6cfc4; background: var(--surface); border-radius: 5px; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.button:hover { background: #f0ebe3; border-color: #bfb5a6; }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button.soft { background: var(--brand-soft); color: var(--brand); border-color: #e4c6b8; }
.button.soft:hover { background: #eed6c9; }
.button.small { padding: 6px 10px; font-size: 11px; }
.button.danger { color: var(--red); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 3px; background: #eeebe5; color: #655c4f; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tag.analysis { background: #eaeef4; color: #4e6082; }
.tag.active, .tag.win { background: #e9f0e7; color: #386048; }
.tag.operative { background: #f2e9df; color: #88583b; }
.tag.lose { background: #f7e4e1; color: #a33532; }
.tag.pending, .tag.pending_review { background: #f7eed5; color: #7b5b1b; }
.tag.void { background: #eeece7; color: #69645c; }
.demo-banner { display: flex; gap: 14px; justify-content: space-between; align-items: center; background: #f5ecda; border-bottom: 1px solid #e5d7ba; color: #6d5930; padding: 10px 38px; font-size: 11px; }

/* Figures, panels and ledgers. */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.metric { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.metric > span { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-bottom: 17px; }
.metric > strong { display: block; font-family: var(--serif); font-size: clamp(23px, 2.5vw, 34px); font-weight: 500; letter-spacing: -.04em; line-height: 1.15; margin-bottom: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric > small { display: block; font-size: 10px; color: var(--muted); line-height: 1.7; }
.metric.accent { color: var(--brand); background: var(--brand-soft); border-color: #e4c9bb; }
.metric.accent > span, .metric.accent > small { color: #805444; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-title h2 { font-size: 15px; margin: 0; }
.panel-title p { font-size: 11px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.panel-body { padding: 22px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { background: #f4f1ea; color: #70675b; font-family: var(--mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .055em; padding: 13px 18px; white-space: nowrap; }
td { padding: 14px 18px; border-top: 1px solid #ece7de; vertical-align: middle; line-height: 1.6; }
tbody tr:hover { background: #faf7f1; }
td strong { display: block; }
td small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ellipsis { max-width: 320px; min-width: 210px; }
.ellipsis strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.table-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 20px; font-size: 11px; color: var(--muted); }
.empty { text-align: center; padding: 60px 24px; }
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 25px; margin-bottom: 10px; }
.empty p { font-size: 12px; color: var(--muted); max-width: 480px; margin: 0 auto 20px; line-height: 1.7; }
.empty .actions { justify-content: center; }
.empty-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #e3c6b7; color: var(--brand); background: #fbf1e9; margin: 0 auto 18px; border-radius: 50%; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filters label { display: grid; gap: 6px; font-size: 10px; color: var(--muted); min-width: 115px; }
.filters input, .filters select { border: 1px solid #d7d0c5; border-radius: 4px; padding: 8px 10px; font-size: 12px; background: #fffefa; color: var(--ink); max-width: 230px; }
.filters .search-field { flex: 1; min-width: 180px; }
.filters .search-field input { max-width: none; width: 100%; }
.info, .notice, .error { padding: 13px 16px; border: 1px solid #e1d8ca; border-left: 3px solid #b9a48d; border-radius: 4px; font-size: 12px; line-height: 1.7; margin-bottom: 20px; background: #f2ede4; color: #645744; }
.notice { display: flex; justify-content: space-between; gap: 10px; background: #edf2e8; border-color: #c9d9c2; color: #3d5b3b; }
.notice button { border: 0; background: none; color: inherit; font-size: 17px; }
.error, .check-error { background: #fbece8; border-color: #e4bfb3; color: #963c2f; }
.info.analysis-info { background: #eef0f5; color: #4b5c7b; border-color: #cad2e1; }
.check-warning { background: #faf2dc; border-color: #e4d0a2; color: #7b5b1b; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 0; border-bottom: 1px solid #ece7de; font-size: 12px; }
.list-item:last-child { border-bottom: 0; }
.list-item p { font-size: 11px; color: var(--muted); margin: 5px 0 0; line-height: 1.7; }
.list-item strong > .icon { margin-right: 6px; color: var(--brand); }
.page-foot { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.chart { height: 176px; width: 100%; overflow: visible; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.chart-zero { stroke: #bdb5a6; stroke-dasharray: 4 4; stroke-width: 1; }
.chart-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 9px; }
.graph-value { font-family: var(--serif); font-size: 28px; color: var(--brand); font-weight: 500; }

/* Anonymous sign-in. All visual changes stay inside this view. */
html.login-view { scrollbar-gutter: auto; background: #111313; }
.login-page { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 100vh; min-height: 100svh; overflow: hidden; background: #111313; color: #f4f1e9; padding: 40px 24px; }
.login-pattern { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; user-select: none; }
.login-pattern::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, #111313b3, #1113130d 65%); }
.login-pattern-field { position: absolute; left: 50%; top: 50%; width: 170vmax; transform: translate(-50%, -50%) rotate(-16deg); }
.login-pattern-row { display: flex; width: max-content; height: clamp(80px, 8vmax, 138px); align-items: center; animation: login-drift 110s linear infinite; will-change: transform; }
.login-pattern-group { display: flex; flex: none; align-items: center; gap: clamp(30px, 3vw, 64px); padding-right: clamp(30px, 3vw, 64px); }
.login-word { flex: none; white-space: nowrap; color: #a2a69b; opacity: .28; font-size: clamp(42px, 5.3vmax, 94px); line-height: 1; font-weight: 800; letter-spacing: -.055em; }
.login-word:nth-child(3n + 2) { color: transparent; -webkit-text-stroke: 1px #b8bcae; opacity: .4; }
.login-word:nth-child(4n) { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.065em; }
.login-pattern-row:nth-child(even) { animation-direction: reverse; animation-duration: 140s; }
.login-pattern-row:nth-child(3n + 1) { animation-delay: -37s; }
.login-pattern-row:nth-child(3n + 2) { animation-delay: -72s; }
.login-pattern-row:nth-child(3n) { animation-delay: -16s; }
.login-pattern-row:nth-child(5n) .login-word { color: #c3c8af; opacity: .24; -webkit-text-stroke-width: 0; }
.login-form-wrap { width: min(360px, 100%); padding: 36px; border: 1px solid #edf0dc24; border-radius: 22px; background: #171a18e8; box-shadow: 0 24px 100px #0006, inset 0 1px #ffffff06; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.login-form .form { gap: 24px; }
.login-form .form label { gap: 10px; color: #dedfd5; font-size: 11px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.login-form .form input { height: 50px; padding: 12px 14px; border: 1px solid #e4e7d62b; border-radius: 8px; background: #ffffff04; color: #f4f1e9; font-size: 16px; font-weight: 400; letter-spacing: normal; color-scheme: dark; transition: background .18s, border-color .18s; }
.login-form .form input:hover { border-color: #e4e7d655; }
.login-form .form input:focus { outline: 2px solid #c7cfb4; outline-offset: 3px; border-color: #c7cfb4; background: #ffffff08; }
.login-form .form input:autofill { box-shadow: 0 0 0 1000px #252a24 inset; -webkit-text-fill-color: #f4f1e9; caret-color: #f4f1e9; }
.login-form .form > .login-submit { width: 100%; height: 49px; margin-top: 4px; padding: 12px; border: 1px solid #e2e5d4; border-radius: 8px; background: #e2e5d4; color: #1c211a; transition: background .18s, border-color .18s; }
.login-form .form > .login-submit:hover { background: #f2f3e9; border-color: #f2f3e9; }
.login-submit svg { width: 30px; height: 24px; transition: transform .18s; }
.login-submit:hover svg { transform: translateX(3px); }
.login-submit:focus-visible { outline: 2px solid #e2e5d4; outline-offset: 4px; }
.login-form .error { background: #332420; border: 1px solid #aa776660; border-radius: 8px; color: #f2c8bc; font-size: 12px; }
.login-page:has(input:focus) .login-pattern-row { animation-play-state: paused; }
.login-view .loading { min-height: 100vh; min-height: 100svh; color: #dedfd5; background: #111313; }
@keyframes login-drift { to { transform: translateX(-50%); } }
@media (max-width: 760px) {
  .login-page { padding: 28px 22px; }
  .login-form-wrap { padding: 30px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-pattern-row { animation: none; will-change: auto; }
  .login-submit svg, .login-form .form input, .login-form .form > .login-submit { transition: none; }
}

/* Editors and feature-specific controls use the same paper palette. */
.form { display: grid; gap: 17px; }
.form label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; }
.form input, .form select, .form textarea { border: 1px solid #d7d0c5; border-radius: 5px; padding: 10px 12px; background: var(--surface); color: var(--ink); min-width: 0; width: 100%; font-size: 13px; }
.form textarea { resize: vertical; }
.form .check { display: flex; align-items: center; gap: 9px; font-weight: 500; line-height: 1.4; }
.form .check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-two { grid-column: 1 / -1; }
.form-divider { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--brand); letter-spacing: .06em; text-transform: uppercase; border-top: 1px solid var(--line); padding-top: 16px; margin: 5px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 4px; }
.form-help { font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.7; }
.form .info { margin: 0; }
.form .error:empty { display: none; }
.hidden, [hidden] { display: none !important; }
dialog { width: min(680px, calc(100vw - 30px)); border: 1px solid var(--line); border-radius: 8px; padding: 0; box-shadow: 0 24px 100px #29282430; max-height: 90vh; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #29282460; backdrop-filter: blur(3px); }
.dialog-header { display: flex; justify-content: space-between; gap: 15px; align-items: start; padding: 24px 26px; border-bottom: 1px solid var(--line); background: #f6f2eb; }
.dialog-header h2 { font-family: var(--serif); font-size: 28px; font-weight: 500; margin-bottom: 7px; }
.dialog-header p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.6; }
.close-dialog { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); }
.dialog-body { padding: 23px 26px; }
.venue-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; padding: 12px; }
.venue-checks label { font-size: 11px; }
.mode-note { background: #f3eee5; padding: 12px; border-radius: 4px; font-size: 11px; color: #6d5c45; line-height: 1.7; }
.history-list { max-height: 370px; overflow: auto; }
.history-list article { border-bottom: 1px solid var(--line); padding: 13px 0; }
.history-list pre { white-space: pre-wrap; font-size: 10px; background: #f4f1ea; padding: 10px; max-height: 160px; overflow: auto; }
.loading { display: grid; place-items: center; min-height: 60vh; font-size: 14px; color: var(--muted); }
.status-count { font-size: 11px; background: #eee9e0; padding: 3px 7px; border-radius: 3px; }
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.book-card { padding: 19px; border: 1px solid var(--line); border-radius: 5px; background: #faf7f1; }
.book-card h3 { margin-bottom: 7px; }
.book-card p { margin: 0; font-size: 11px; color: var(--muted); }
.channel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chat-id { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.routing-result { border-bottom: 1px solid var(--line); }
.routing-result > summary { padding: 18px 22px; display: flex; justify-content: space-between; gap: 14px; align-items: center; cursor: pointer; font-size: 12px; }
.routing-result > summary:hover { background: #f6f2eb; }
.routing-result > summary > span { line-height: 1.7; }
.excluded-heading { margin-top: 22px; }
#route-venues .check { flex-wrap: wrap; }
#route-venues .check small { margin-left: 24px; width: 100%; font-size: 10px; font-weight: 400; }
#groups-search label { min-width: min(20rem, 100%); }
.daily-message { white-space: pre-wrap; background: #f6f0e5; border: 1px solid #dfcfb8; border-radius: 8px 8px 8px 2px; padding: 22px; max-width: 620px; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; margin: 16px 0; }
.report-details { margin: 14px 0 22px; font-size: 12px; }
.report-room-select { flex: 1; min-width: min(20rem, 100%); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hours-heading, .hours-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hours-heading { margin-top: 10px; }
.hours-heading h3 { margin: 0; }
.hours-week { display: grid; gap: 8px; margin: 14px 0; }
.hours-day { padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f7f4ee; }
.hours-day-heading strong { font-size: 13px; }
.hours-day-heading select { width: 155px; }
.hours-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.hours-slot { display: flex; align-items: center; gap: 6px; }
.hours-slot label { width: 78px; min-width: 0; }
.hours-slot input { width: 100%; padding: 9px 7px; font-variant-numeric: tabular-nums; }
.hours-slot .button { padding: 7px 10px; }
.hours-details { min-width: 150px; max-width: 280px; font-size: 12px; }
.hours-details summary { cursor: pointer; color: var(--ink); }
.hours-details dl { margin: 10px 0; }
.hours-details dl > div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; margin-bottom: 7px; }
.hours-details dt { font-weight: 600; }
.hours-details dd { margin: 0; }
.room-links { display: grid; gap: 12px; }
.room-links .list-item { flex-wrap: wrap; }
.room-links p { margin: 5px 0; }
.room-identity { margin-top: 12px; }
.room-identity summary { font-size: 12px; cursor: pointer; }
.room-identity .form-grid { margin-top: 12px; }

@media (max-width: 1150px) {
  .section-nav { padding: 8px 24px; }
  .main { padding: 28px 24px; }
  .topbar { padding: 13px 24px; }
  .nav-link { font-size: 11px; padding: 10px 8px; gap: 9px; }
  .metrics { gap: 10px; }
  .metric { padding: 18px; }
  .metric > strong { font-size: 26px; }
  .grid-two { grid-template-columns: 1fr; gap: 0; }
  .heading { align-items: start; }
  .top-actions .local-pill { display: none; }
}
@media (max-width: 850px) {
  .channel-cards { grid-template-columns: 1fr; }
  .routing-result > summary { align-items: flex-start; flex-direction: column; }
  .heading { flex-wrap: wrap; }
  .heading > .actions { max-width: 100%; justify-content: flex-start; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section-nav { flex-wrap: nowrap; overflow-x: auto; padding: 6px 16px; scrollbar-width: thin; scroll-padding-inline: 16px; }
  .section-context { display: none; }
  .topbar .brand-mark { width: 32px; height: 36px; font-size: 29px; }
  .topbar .brand strong { font-size: 19px; }
  .topbar .brand small { font-size: 8px; }
  .section-view, #room-discovery { scroll-margin-top: 140px; }
  .nav-link { padding: 11px 10px 9px; font-size: 12px; }
  .topbar { min-height: 64px; padding: 12px 18px; }
  .top-actions { gap: 9px; }
  .sync-status { position: absolute; bottom: 2px; right: 18px; min-width: 0; font-size: 8px; }
  .main { padding: 26px 16px; }
  .heading { display: block; margin-bottom: 24px; }
  .heading > .actions { margin-top: 17px; }
  .metric { padding: 18px 14px; }
  .metric > strong { font-size: clamp(23px, 5.7vw, 32px); }
  .metric > span { margin-bottom: 13px; }
  .demo-banner { padding: 10px 17px; align-items: start; font-size: 10px; }
  .page-foot { flex-direction: column; gap: 3px; }
  .filters { gap: 8px; }
  .filters label { flex: 1; min-width: 110px; }
  .filters input, .filters select { width: 100%; max-width: none; }
  .filters .search-field { min-width: 100%; }
  .form-grid, .venue-checks { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr 1fr; }
  .dialog-header, .dialog-body { padding: 20px; }
  .topbar .operator-name { display: inline-block; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  .row-actions { min-width: 130px; }
  th, td { padding: 12px; }
  .panel-title { padding: 17px; flex-wrap: wrap; }
  .panel-body { padding: 18px; }
  .table-footer { padding: 12px; flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .hours-day { padding: 10px; }
  .hours-day-heading select { width: 140px; }
  .hours-slots { align-items: flex-start; flex-direction: column; }
  .hours-slot label { width: 86px; }
  .heading .button { white-space: normal; }
  .chart-label { flex-wrap: wrap; gap: 8px; }
  .book-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-link { transition: none; }
}

/* Daily reports stay inside Accounting without replacing its ledger view. */
.report-preview { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.report-preview h3 { margin-bottom: 8px; }
#report-draft-note { margin-top: 18px; }
.report-history { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.report-history > summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.report-history-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.report-history-item > summary { cursor: pointer; font-size: 12px; line-height: 1.8; }

@media (min-width: 761px) {
  .report-form .form-grid { grid-template-columns: minmax(0, 1fr) 180px; }
}
.report-form .actions { justify-content: flex-end; }

/* Accounting is scoped to one room, with explicit per-bet saves. */
.accounting-room-picker { display: flex; align-items: center; gap: 28px; padding: 20px 22px; }
.accounting-room-picker label { display: grid; gap: 8px; flex: 1; max-width: 660px; min-width: 0; font-size: 12px; font-weight: 600; }
.accounting-room-picker select { width: 100%; padding: 11px 12px; border: 1px solid #d7d0c5; border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; }
.accounting-room-picker p { margin: 0; font-size: 11px; line-height: 1.8; }
.ledger-edit-help { margin: 0; padding: 14px 18px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.ledger-scroll-footer small { display: block; margin-top: 5px; line-height: 1.5; }
.ledger-event { min-width: 185px; max-width: 350px; }
.ledger-input { width: 102px; padding: 9px; font-size: 12px; border: 1px solid #d7d0c5; border-radius: 4px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.odds-input { width: 86px; }
.outcome-input { width: 115px; }
.row-save-status { display: block; margin-top: 5px; font-size: 10px; line-height: 1.6; color: var(--brand); }
.accounting-today > summary { padding: 18px 22px; cursor: pointer; font-size: 14px; font-weight: 600; }
@media (max-width: 760px) {
  .accounting-room-picker { display: block; padding: 18px; }
  .accounting-room-picker p { margin-top: 12px; }
  .ledger-edit-row .row-actions { flex-wrap: wrap; min-width: 155px; }
}

.report-selected-room { display: block; min-height: 42px; padding: 11px 0; font-size: 13px; font-weight: 600; }

/* Keep the room selector and first editable bets close together. */
.section-view[data-section="accounting"] > .heading { margin-bottom: 18px; }
.section-view[data-section="accounting"] > .heading .eyebrow { display: none; }
.section-view[data-section="accounting"] > .heading h1 { font-size: 36px; margin-bottom: 8px; }
.section-view[data-section="accounting"] .accounting-room-picker { padding: 14px 18px; }
.section-view[data-section="accounting"] .metric { padding: 14px 18px; }
.section-view[data-section="accounting"] .metric > span { margin-bottom: 8px; }
.section-view[data-section="accounting"] .metric > strong { font-size: 28px; margin-bottom: 6px; }
.section-view[data-section="accounting"] .panel-title { padding: 14px 18px; }
.section-view[data-section="accounting"] .ledger-edit-help { padding: 10px 18px; }

/* BetBurger configuration and local read-only feed diagnostics. */
.betburger-key { display:flex; align-items:end; gap:14px; flex-wrap:wrap; }
.betburger-key > label { flex:1; min-width:220px; }
.betburger-feeds { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.betburger-feed { border:1px solid var(--line); border-radius:5px; padding:16px; display:grid; gap:14px; }
.betburger-feed header { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:13px; }
.betburger-feed .form-help { margin:0; }
.betburger-log-feed + .betburger-log-feed { border-top:1px solid var(--line); margin-top:24px; padding-top:24px; }
@media(max-width:1050px) { .betburger-feeds { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:640px) { .betburger-feeds { grid-template-columns:1fr; } }
/* Current provider opportunities */
.opportunity-feeds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.opportunity-feed{border:1px solid var(--line);border-radius:10px;padding:16px;min-width:0}
.opportunity-feed header{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.opportunity-feed p{margin:10px 0 0;overflow-wrap:anywhere}
.opportunity-controls{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:18px 22px 0}
.opportunity-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:18px 22px;border-bottom:1px solid var(--line)}
.opportunity-filters label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;flex:1;min-width:160px}
.opportunity-filters label:first-child{flex:2}
.opportunity-leg+.opportunity-leg{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.opportunity-odds{font-variant-numeric:tabular-nums;display:inline-block;margin-left:10px;padding:3px 8px;border-radius:5px;background:var(--surface)}
@media(max-width:700px){.opportunity-feeds{grid-template-columns:1fr}.opportunity-controls,.opportunity-filters{padding-left:16px;padding-right:16px}.opportunity-filters label{min-width:100%}}
.rule-savebar { display:flex; gap:10px; flex-wrap:wrap; margin:16px 0; padding:12px; background:var(--surface); border:1px solid #d7d0c5; border-radius:6px; }
.rule-group { margin:12px 0; border:1px solid #d7d0c5; border-left:3px solid var(--brand); border-radius:6px; min-width:0; }
.rule-group > summary { padding:12px; cursor:pointer; font-weight:600; }
.rule-group-body { padding:0 12px 12px; }
.rule-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin:10px 0; }
.rule-toolbar label { display:flex; gap:10px; align-items:center; }
.rule-condition { display:grid; grid-template-columns:minmax(150px,1fr) minmax(135px,.75fr) minmax(180px,1.2fr) auto; gap:14px; align-items:center; }
.rule-variable { display:grid; grid-template-columns:minmax(120px,.6fr) minmax(180px,2fr) auto auto; gap:10px; align-items:end; margin:12px 0; }
.rule-case { border-bottom:1px solid #d7d0c5; padding-bottom:18px; margin-bottom:18px; }
.rule-json { white-space:pre-wrap; overflow-wrap:anywhere; max-height:450px; overflow:auto; font-size:12px; }
#engine-rule-form code { overflow-wrap:anywhere; }
#engine-rule-form details > p { padding:8px 0; }
@media(max-width:900px) { .rule-condition,.rule-variable { grid-template-columns:minmax(0,1fr); } .rule-group-body { padding:0 8px 8px; } }
.rule-fieldset { border:0; padding:0; margin:0; min-width:0; }
.rule-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; border-bottom:1px solid var(--line); padding-bottom:14px; }
.rule-tabs .button { padding:11px 18px; font-size:13px; }
.rule-tabs .selected,.rule-join .selected { color:var(--brand); background:#eee2d8; border-color:var(--brand); }
.rule-join { display:flex; flex-wrap:wrap; gap:5px; }
.root-group { border:0; border-radius:0; }
.root-group > .rule-group-body { padding:0; }
.rule-group > summary { display:flex; align-items:center; gap:12px; line-height:1.6; }
.rule-group > summary::before { content:'▸'; color:var(--brand); }
.rule-group[open] > summary::before { content:'▾'; }
.rule-group-badge { font-size:10px; letter-spacing:.04em; flex-shrink:0; color:var(--brand); background:#eee2d8; padding:3px 7px; border-radius:4px; }
.rule-condition-card { border:1px solid var(--line); border-radius:7px; background:var(--surface); padding:16px; }
.rule-condition label { margin:0; }
.condition-prefix { font-size:10px; color:var(--brand); font-weight:700; }
.condition-connector { color:var(--brand); font-size:10px; font-weight:700; margin:9px 18px; }
.rule-operand { display:grid; gap:9px; min-width:0; }
.operand-mode { grid-template-columns:auto 1fr; align-items:center; color:var(--muted); }
.form .operand-mode select { border:0; padding:3px; color:var(--brand); background:transparent; font-size:12px; }
.rule-value-list summary { font-size:12px; color:var(--brand); cursor:pointer; padding:8px 0; }
.rule-variable-card { border:1px solid var(--line); border-radius:8px; padding:18px; margin:18px 0; }
.rule-variable-card > .rule-toolbar > label { display:grid; flex:1; min-width:180px; max-width:360px; }
.formula-control { margin:14px 0; min-width:0; }
.formula-reading { background:#f6f3ee; border:1px solid #e5ded4; border-radius:6px; padding:12px; line-height:2; max-height:108px; overflow:auto; }
.formula-token { display:inline-block; line-height:1.6; padding:2px 5px; border-radius:4px; font-size:12px; }
.formula-token.is-variable { background:#e4ece9; color:#31584e; }
.formula-token.is-operator { font-weight:600; color:var(--brand); }
.formula-builder { border:1px solid var(--brand); border-radius:8px; background:#fcfaf7; padding:18px; margin:12px 0; }
.formula-builder-head { display:flex; justify-content:space-between; align-items:center; }
.form #rule-formula-input { font-family:var(--mono); font-size:13px; line-height:1.7; background:white; }
.formula-feedback { font-size:12px; margin:8px 0; min-height:20px; overflow-wrap:anywhere; }
.formula-operators { display:flex; flex-wrap:wrap; gap:7px; padding:10px 0; }
.formula-operators .operator-key { min-width:43px; min-height:40px; font-size:17px; font-weight:600; background:white; }
.formula-number { display:flex; flex-wrap:wrap; gap:9px; align-items:end; padding:10px 0 18px; }
.formula-number label { width:155px; }
.formula-palette { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:16px 0; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.variable-buttons { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:7px; max-height:190px; overflow:auto; padding:2px; }
.variable-chip { border:1px solid #c4d5cd; border-radius:5px; background:#e9f0ed; color:#31584e; padding:8px 11px; font-size:12px; cursor:pointer; }
.variable-chip:hover { background:#d4e3dd; }
.formula-helpers { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:14px 0; }
.fixed-roi { display:grid; grid-template-columns:minmax(180px,1fr) minmax(240px,1.5fr); gap:22px; padding:22px; margin:20px 0; border:1px solid var(--line); border-radius:8px; background:#f6f3ee; }
.fixed-roi td,.fixed-roi th { padding:9px 14px; }
.rule-more { margin-left:auto; font-size:12px; }
.rule-more summary { cursor:pointer; padding:8px; }
.rule-more[open] .button { margin:6px; }
@media(max-width:700px) { .formula-palette,.fixed-roi { grid-template-columns:minmax(0,1fr); } .rule-tabs .button { padding:10px; } .formula-builder,.rule-condition-card { padding:12px; } .rule-group > summary { flex-wrap:wrap; } }

.form label.proxy-toggle{display:flex;align-items:center;gap:10px}.form .proxy-toggle input{width:auto;margin:0}.proxy-status{margin:20px 0 0;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:8px}

.booking-result{border-top:1px solid var(--line,#ddd);padding:10px 0;margin-top:8px}.booking-barcode{display:block;max-width:300px;width:100%;max-height:110px;object-fit:contain;background:white;margin:6px 0}

/* Filter-to-group editing stays scoped to one operative filter. */
.filter-group-add { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.filter-group-add label { display: grid; gap: 8px; flex: 1; min-width: 220px; font-size: 12px; }
.filter-group-add select { padding: 12px; width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.filter-group-save { padding: 18px 0; }
.filter-group-save > p { font-size: 12px; }
.filter-group-stake { display: grid; gap: 6px; font-size: 12px; }
.filter-group-stakes { display: flex; flex-wrap: wrap; gap: 10px; min-width: 280px; }
.filter-group-stake input { box-sizing: border-box; width: 130px; max-width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font: inherit; }

/* Configuration: one service at a time, visible save and runtime states. */
.settings-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:26px; align-items:start; }
.settings-nav { display:grid; gap:7px; position:sticky; top:180px; }
.settings-nav-item { text-align:left; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--ink); padding:15px; display:grid; gap:5px; }
.settings-nav-item span,.settings-nav-item small { color:var(--muted); font-size:12px; }
.settings-nav-item.selected { border-color:var(--line); background:var(--surface); box-shadow:inset 3px 0 var(--brand); }
.settings-nav-item.selected strong { color:var(--brand); }
.settings-content { min-width:0; }
.settings-inline-status { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom:18px; }
.settings-inline-status .button { margin-left:auto; }
.settlement-status-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.settlement-status-card { border:1px solid var(--line); padding:16px; border-radius:6px; min-width:0; }
.settlement-status-card > span { font-size:12px; color:var(--muted); }
.settlement-status-card > strong { display:block; margin:7px 0 10px; font-size:19px; }
.settlement-status-card p { font-size:12px; line-height:1.8; margin:0; overflow-wrap:anywhere; }
.settlement-status-card.is-ready { border-color:#aec7ba; background:#f5f9f5; }
.settlement-totals { display:flex; flex-wrap:wrap; gap:12px 22px; padding:18px 0 12px; font-size:12px; }
.settlement-savebar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; padding:0 0 18px; margin-bottom:18px; border-bottom:1px solid var(--line); }
.settlement-savebar strong { font-size:14px; }.settlement-savebar p { margin:6px 0 0; }
.settlement-keys { margin-top:20px; }.settlement-keys label { min-width:0; }
.settlement-details > summary { cursor:pointer; padding:20px 24px; font-weight:600; }
.settlement-details .panel-body { padding-top:0; }.settlement-details .table-scroll { max-height:450px; overflow:auto; margin-bottom:18px; }
.settings-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px; }
@media(max-width:1000px) { .settings-layout { grid-template-columns:minmax(0,1fr); gap:18px; }.settings-nav { position:static; grid-template-columns:repeat(3,minmax(0,1fr)); }.settings-nav-item { padding:12px; }.settings-nav-item span { display:none; } }
@media(max-width:640px) { .settings-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }.settlement-status-grid,.settings-action-grid { grid-template-columns:minmax(0,1fr); }.settings-inline-status .button { margin-left:0; }.settlement-savebar { align-items:stretch; }.settlement-savebar .button { width:100%; } }
