/* Botler look (botler.gr): Manrope, black with white dots in dark, soft grey in light. The theme is
   data-theme on <html> (set before paint by the script in base.html); without JS it follows the system. */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/manrope-greek-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
:root {
  --bg: #f6f6f7; --card: rgb(255 255 255 / 0.72); --card-solid: #fff; --text: #111; --muted: #52525b;
  --border: rgb(0 0 0 / 0.1); --border-strong: rgb(0 0 0 / 0.18); --accent: #1565c0; --accent-bg: #1565c0;
  --ok: #116b33; --err: #b91c1c; --warn: #7a5000; --bar: rgb(246 246 247 / 0.72); --orb-rgb: 40,40,48; --orb-dim: 0.28;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000; --card: rgb(17 17 17 / 0.8); --card-solid: #111; --text: #fafafa; --muted: #a1a1aa;
  --border: rgb(255 255 255 / 0.1); --border-strong: rgb(255 255 255 / 0.18); --accent: #4aa3f0; --accent-bg: #1565c0;
  --ok: #4ade80; --err: #f87171; --warn: #fbbf24; --bar: rgb(0 0 0 / 0.55); --orb-rgb: 250,250,250; --orb-dim: 0.9;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  --bg: #000; --card: rgb(17 17 17 / 0.8); --card-solid: #111; --text: #fafafa; --muted: #a1a1aa;
  --border: rgb(255 255 255 / 0.1); --border-strong: rgb(255 255 255 / 0.18); --accent: #4aa3f0; --accent-bg: #1565c0;
  --ok: #4ade80; --err: #f87171; --warn: #fbbf24; --bar: rgb(0 0 0 / 0.55); --orb-rgb: 250,250,250; --orb-dim: 0.9;
  color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Manrope, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
nav a.active { font-weight: 600; }
nav .soon { color: var(--muted); cursor: default; }
.logout { display: flex; gap: 10px; align-items: center; margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
h2 { font-size: 16px; margin: 28px 0 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi .label { display: block; color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.platform .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.status-ok { color: var(--ok); border-color: var(--ok); }
.status-error { color: var(--err); border-color: var(--err); }
.status-not_configured { color: var(--warn); border-color: var(--warn); }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 32px; }
button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login form { width: 100%; max-width: 340px; display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 20px; }
.login label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login input { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.login button { background: var(--accent-bg); color: #fff; border-color: var(--accent-bg); }
.error { color: var(--err); margin: 0; font-size: 14px; }
code { font-size: 12px; }
h1 { font-size: 20px; margin: 0; }
.pagehead { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi .muted { display: block; margin-top: 2px; }
.platform { display: flex; flex-direction: column; gap: 8px; }
.platform dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.platform dt { color: var(--muted); font-size: 13px; }
.platform dd { margin: 0; font-variant-numeric: tabular-nums; }
.platform dd.big { font-size: 18px; font-weight: 600; }
.platform dd small { font-weight: 400; margin-left: 4px; }
.platform p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.actions button, .actions .button { font-size: 13px; padding: 4px 10px; }
.button { display: inline-block; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); }
button[disabled] { opacity: .5; cursor: progress; }
.small { font-size: 13px; }
.flash.ok { color: var(--ok); }
button.primary { background: var(--accent-bg); color: #fff; border-color: var(--accent-bg); }
button.danger { color: var(--err); }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.inline-form .error { flex-basis: 100%; }
.inline-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.inline-form input, .inline-form select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.ended td { color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.row-actions button { font-size: 13px; padding: 3px 10px; }
.warn { color: var(--warn); }
.norate { color: var(--warn); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.outcome-booked { color: var(--ok); border-color: var(--ok); }
.outcome-abandoned, .outcome-cancelled { color: var(--err); border-color: var(--err); }
.outcome-transferred, .outcome-rescheduled { color: var(--warn); border-color: var(--warn); }
.badge.current { color: var(--accent); border-color: var(--accent); }
.feed { padding: 0; }
.feed .empty { margin: 0; }
.feed-item { display: grid; grid-template-columns: 52px 1fr auto auto 110px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 14px; }
.feed-item:last-of-type { border-bottom: 0; }
.feed-item:hover { background: var(--bg); }
.feed-time, .feed-dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-cost { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 640px) { .feed-item { grid-template-columns: 44px 1fr auto; } .feed-item > :nth-child(3), .feed-item > :nth-child(4) { display: none; } }
.fresh { animation: fresh 4s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: middle; margin-left: 6px; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.ledger tbody tr { cursor: pointer; }
.ledger tbody tr:hover td { background: var(--bg); }
.ledger th { vertical-align: bottom; }
.per-agent { margin: 12px 0; }
#call-totals .kpis { margin-bottom: 0; }
.kpi .small { display: block; }
.filters { margin-bottom: 12px; }
.banner { background: var(--card); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; margin: 12px 0; font-size: 14px; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }
tr.subtotal td { color: var(--muted); font-size: 13px; }
td.src { white-space: normal; min-width: 220px; }
.wrap { white-space: normal; }
#call-totals { margin-bottom: 12px; }
.spacer { flex: 1; }
.markup-btn { border-color: var(--accent); color: var(--accent); font-size: 13px; padding: 4px 10px; white-space: nowrap; }
.markup-btn[disabled] { border-color: var(--border); color: var(--muted); }
.small-btn, .button.small-btn { font-size: 13px; padding: 3px 10px; }
.subnav { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subnav a { padding: 6px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); }
dialog#panel { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--card); color: var(--text); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog#panel::backdrop { background: rgb(0 0 0 / .35); }
.panel-form { display: grid; gap: 12px; padding: 18px 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; }
.panel-head h2 { margin: 0; font-size: 18px; }
.close { font-size: 20px; line-height: 1; padding: 2px 10px; }
.panel-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; }
.panel-form legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.panel-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.panel-form label.radio, label.radio { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; }
.panel-form input:not([type=radio]):not([type=checkbox]), .panel-form select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.row-inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.preview { background: var(--bg); border-radius: 8px; padding: 10px 12px; min-height: 40px; }
.preview h3 { margin: 0 0 6px; font-size: 14px; }
.preview p { margin: 4px 0; }
table.mini { width: auto; min-width: 60%; font-size: 13px; }
table.mini th, table.mini td { padding: 4px 10px; }
tr.strong td { font-weight: 600; }
.confirm, .confirm-card { border-left: 3px solid var(--warn); padding: 8px 12px; margin-top: 8px; }
.confirm-card { margin: 12px 0; }
.tag-default { color: var(--accent); border-color: var(--accent); }
.tag-included { color: var(--ok); border-color: var(--ok); }
.ok { color: var(--ok); }
ol.steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.inline-edit { display: flex; gap: 6px; margin: 0; }
.inline-edit input, .assign select, .assign input { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.assign { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.history { margin: 4px 0; padding-left: 18px; }
.months { display: flex; gap: 8px; flex-wrap: wrap; }
.statement table tfoot td { border-bottom: 0; }
.st-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.st-head img { vertical-align: middle; border-radius: 8px; }
.internal { margin-top: 12px; border-left: 3px solid var(--accent); }
.internal h3 { margin-top: 0; font-size: 14px; }
.settings-form { display: grid; gap: 10px; max-width: 640px; }
.settings-form h3 { margin: 8px 0 0; font-size: 15px; }
.settings-form label:not(.radio) { display: grid; gap: 4px; font-size: 13px; color: var(--muted); max-width: 320px; }
.settings-form input:not([type=checkbox]) { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.grow { flex: 1; min-width: 200px; }
form.inline { margin: 0; }
form.inline select { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.feed-charge { display: block; font-weight: 400; }
.type-choice { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.type-option { display: flex !important; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text) !important; }
.type-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.type-option span { display: grid; gap: 2px; }
.type-option input { margin-top: 3px; }
.real-cost { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--bg); }
.headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.headline .label { display: block; font-size: 12px; color: var(--muted); }
.headline .big { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
table.scenarios { width: 100%; }
#plan-save[disabled] { cursor: not-allowed; }
/* Keep the hidden attribute authoritative over display rules above (e.g. grid fieldsets). */
[hidden] { display: none !important; }

/* Phase 6: alerts badge, reconciliation and severity colours, net profit */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.recon-ok, .recon-free_plan { color: var(--ok); }
.recon-warn { color: var(--warn); }
.recon-bad, .sev-critical { color: var(--err); }
.recon-no_data, .recon-unattributed, .recon-idle { color: var(--muted); }
.sev-warning { color: var(--warn); }
.netprofit td.num { white-space: nowrap; }
.netprofit tr.total td { font-weight: 600; border-top: 1px solid var(--border); }

/* Assistants */
.act-ok { color: var(--ok); }
.act-failed { color: var(--err); }
.act-skipped { color: var(--warn); }
.nowrap { white-space: nowrap; }

/* Botler orb logo */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; display: block; }
.login-logo { display: block; width: 64px; height: 64px; border-radius: 15px; margin: 0 auto 12px; }
/* Fixed costs: repeat badges */
.badge.rep-monthly { color: var(--muted); }
.badge.rep-yearly { color: var(--accent); border-color: var(--accent); }
.badge.rep-once { color: var(--warn); border-color: var(--warn); }
.add-actions, .cost-filters { margin: 0 0 10px; }
.spread-field > span { display: flex; gap: 6px; align-items: center; }
.inline-form .spread-help { flex-basis: 100%; margin: 0; }
.badge.rep-biennial { color: var(--ok); border-color: var(--ok); }
.inline-form .form-title { flex-basis: 100%; margin: 0; }
.inline-form.editing { border-color: var(--accent); }
.inline-form .price-change { flex-basis: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.inline-form .price-change legend { font-size: 13px; color: var(--text); padding: 0 4px; }
.inline-form .price-change p { flex-basis: 100%; margin: 0; }

/* News: Jarvis's daily briefing */
.acc-0 { --sec: #1557a8; } .acc-1 { --sec: #09594f; } .acc-2 { --sec: #7a4205; }
.acc-3 { --sec: #6339b8; } .acc-4 { --sec: #9d1b4b; } .acc-5 { --sec: #3d590c; }
[data-theme="dark"] .acc-0 { --sec: #6ea0ff; } [data-theme="dark"] .acc-1 { --sec: #3dc7b5; } [data-theme="dark"] .acc-2 { --sec: #e3a548; }
[data-theme="dark"] .acc-3 { --sec: #b392f0; } [data-theme="dark"] .acc-4 { --sec: #f07aa3; } [data-theme="dark"] .acc-5 { --sec: #9ccc4f; }
.news-head { margin-bottom: 8px; }
.news-tabs { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; flex: none;
             margin: 0 -16px 8px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
             scrollbar-width: none; }
.news-tabs::-webkit-scrollbar { display: none; }
.news-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
               border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text);
               white-space: nowrap; font-size: 14px; }
.news-tabs a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sec); }
.news-tabs .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.news-section { scroll-margin-top: 72px; }
.news-section h2 { display: flex; align-items: baseline; gap: 8px; border-left: 3px solid var(--sec); padding-left: 8px; }
.news-section h2 .muted { font-weight: 400; }
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.story { background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.story[open] { grid-column: 1 / -1; border-color: var(--sec); }
.story summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px;
                 align-items: start; min-height: 44px; padding: 12px 14px; height: 100%; }
.story summary::-webkit-details-marker { display: none; }
.story summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
@media (hover: hover) { .story summary:hover .story-title { color: var(--sec); } }
.story-n { grid-row: span 2; min-width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
           font-size: 13px; font-weight: 600; color: var(--sec); background: color-mix(in srgb, var(--sec) 14%, transparent);
           font-variant-numeric: tabular-nums; }
.story-title { font-weight: 600; overflow-wrap: anywhere; }
.story-src { color: var(--muted); font-size: 13px; }
.story[open] summary { height: auto; }
.story-body { padding: 0 14px 14px 48px; display: grid; gap: 8px; }
.story-body p { margin: 0; overflow-wrap: anywhere; }
.story-why { font-style: italic; }
.story-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
              border-color: var(--sec); color: var(--sec); overflow-wrap: anywhere; }
.news-days { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.news-days a { flex: none; display: grid; justify-items: center; align-content: center; min-height: 44px; min-width: 64px;
               padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card);
               color: var(--text); font-size: 13px; }
.news-days a.current { border-color: var(--accent); color: var(--accent); }
.news-days .muted { font-size: 12px; }
@media (max-width: 640px) {
  .story-body { padding-left: 14px; }
  .news-section { scroll-margin-top: 64px; }
}

/* Top bar: grouped menus on desktop, ☰ drawer on a phone */
.topbar { position: relative; z-index: 20; gap: 4px; padding: 6px 16px; flex-wrap: nowrap; }
.topbar .brand { margin-right: 12px; flex: none; }
.topbar .mainnav { flex: none; display: flex; flex-wrap: nowrap; gap: 4px; }
.navlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 8px;
           color: var(--text); white-space: nowrap; cursor: pointer; }
.navlink:hover, details[open] > .navlink { background: var(--bg); }
.navlink.active, .menu.active > .navlink { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.topbar summary { list-style: none; }
.topbar summary::-webkit-details-marker { display: none; }
.menu { position: relative; }
.menu > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; border: solid currentColor;
                         border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .7; }
.menu[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.menu-list { position: absolute; top: calc(100% + 4px); left: 0; min-width: 200px; padding: 6px; display: grid;
             background: var(--card); border: 1px solid var(--border); border-radius: 10px;
             box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.menu-list.right { left: auto; right: 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px;
                                  color: var(--text); border: 0; background: none; width: 100%; text-align: left; font: inherit; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg); }
.menu-list a.active { color: var(--accent); font-weight: 600; }
.menu-list form { margin: 0; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.bar-spacer { flex: 1; }
.icon-link { padding: 0 12px; min-width: 44px; justify-content: center; font-size: 20px; }
.user-menu > summary { color: var(--muted); }
.navlink:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.drawer { display: none; }
.drawer-panel { position: fixed; left: 0; right: 0; top: var(--bar-h, 57px); bottom: 0; overflow-y: auto; display: block;
                padding: 8px 16px 24px; background: var(--card); border-top: 1px solid var(--border); }
.drawer-panel h3 { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.drawer-panel ul { list-style: none; margin: 0; padding: 0; }
.drawer-panel li a { display: flex; align-items: center; min-height: 48px; padding: 0 10px; border-radius: 8px; color: var(--text);
                     border-bottom: 1px solid var(--border); }
.drawer-panel li a.active { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drawer-logout { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.drawer-logout button { min-height: 44px; }
@media (max-width: 760px) {
  .topbar { padding: 6px 12px; --bar-h: 57px; }
  .topbar .mainnav, .topbar .desk { display: none; }
  .drawer { display: block; }
  .drawer[open] > summary { background: var(--bg); }
  main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 400px) { .brand-name { display: none; } }

/* Two-step sign-in */
.login.wide .login-card { width: 100%; max-width: 460px; display: grid; gap: 14px; }
.code-input { font: 600 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .25em; text-align: center;
              padding: 10px 12px !important; min-height: 56px; width: 100%; }
.code-input.recovery { font-size: 20px !important; letter-spacing: .08em; }
.code-input.small { font-size: 18px !important; min-height: 44px; letter-spacing: .15em; max-width: 200px; }
.big-btn { min-height: 48px; font-size: 16px; }
label.check { min-height: 44px; }
.alt-link { text-align: center; font-size: 14px; display: inline-flex; justify-content: center; align-items: center; min-height: 44px; }
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 16px; }
.qr-box { margin: 12px 0 8px; }
.qr-box svg.qr { width: 220px; height: 220px; max-width: 100%; display: block; border-radius: 8px; }
.secret-key { display: block; font-size: 16px; letter-spacing: .08em; padding: 8px 10px; background: var(--bg); border-radius: 6px;
              word-break: break-all; user-select: all; }
.key-alt summary { cursor: pointer; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.confirm-code { display: grid; gap: 10px; margin-top: 10px; max-width: 320px; }
.recovery-codes h2 { margin-top: 0; }
.codes { columns: 2; column-gap: 24px; padding-left: 28px; font-size: 15px; }
.codes code { font-size: 15px; letter-spacing: .05em; }
.button.primary { background: var(--accent-bg); color: #fff; border-color: var(--accent-bg); }
.recovery-codes .button { min-height: 44px; display: inline-flex; align-items: center; }
h2.first { margin-top: 0; }
.security-status p { margin: 6px 0; }
.security-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.security-actions .settings-form label { max-width: none; }
@media (max-width: 400px) { .codes { columns: 1; } }
.topbar .brand { min-height: 44px; }
.security-status button, .security-actions button, .setup-card button, .security-status .button { min-height: 44px; }
/* Small summary tables scroll inside themselves on a phone instead of widening the page. */
@media (max-width: 760px) { table.mini { display: block; max-width: 100%; overflow-x: auto; min-width: 0; } }
.badge.status-ok { color: var(--ok); border-color: var(--ok); }
.badge.status-not_configured { color: var(--warn); border-color: var(--warn); }
.security-actions button { justify-self: start; padding: 0 18px; }

/* The orb behind everything; pages sit on top of it as slightly translucent surfaces. */
#orb-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }
.topbar { position: relative; z-index: 20; } /* above the page: its menus and the ☰ drawer open over it */
.topbar { background: none; isolation: isolate; border-bottom-color: var(--border); }
/* The blur sits on a pseudo-element: a backdrop-filter on the bar itself would trap the drawer's position: fixed. */
.topbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bar);
                  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card, .story, .news-tabs a, .news-days a { background: var(--card); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card { border-radius: 14px; }
.menu-list, .drawer-panel, dialog#panel { background: var(--card-solid); }
.news-tabs { background: var(--bar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
button, .button { background: var(--card-solid); }
input, select, textarea { color-scheme: inherit; }

/* Logo: the botler.gr mark + wordmark, then "Costs". The mark composes on load and on hover (not with reduced motion). */
.topbar .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); margin-right: 14px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-wordmark { display: block; height: 17px; line-height: 0; }
.brand-word { height: 100%; width: auto; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 14px; padding-left: 8px; border-left: 1px solid var(--border-strong); }
.brand-mark circle { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .is-composing .brand-mark circle { animation: compose 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both; animation-delay: calc(var(--i) * 28ms); }
}
@keyframes compose { from { opacity: 0.1; transform: scale(0.35); } 60% { opacity: 1; transform: scale(1.12); } to { opacity: 1; transform: scale(1); } }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); margin-bottom: 4px; }
.login-brand .brand-mark { width: 52px; height: 52px; }
.login-brand .brand-wordmark { height: 26px; }
.login-brand .brand-sub { font-size: 18px; padding-left: 10px; }
.login form.card, .login .login-card { background: var(--card); }

/* Light mode slide switch: a real checkbox, styled. */
.theme-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 8px;
                cursor: pointer; color: var(--muted); font-size: 14px; }
.theme-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.theme-switch .track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--border-strong); transition: background .2s; }
.theme-switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text);
                      display: grid; place-items: center; font-size: 11px; color: var(--bg); transition: transform .22s cubic-bezier(.25,.46,.45,.94); }
.theme-switch input:checked + .track { background: var(--accent-bg); }
.theme-switch input:checked + .track .knob { transform: translateX(20px); background: #fff; color: #1565c0; }
.theme-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.drawer-panel .theme-switch { display: flex; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 10px;
                              color: var(--text); font-size: 15px; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .topbar .brand-sub { display: none; } }
@media (prefers-reduced-motion: reduce) { .theme-switch .track, .theme-switch .knob { transition: none; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media print { #orb-bg { display: none; } .card, .story { backdrop-filter: none; background: #fff; } }
/* Phone: the orb sits in the top-right corner, bright behind the bar and faint below it, so the page title and
   the lines under it stay readable (measured: AA over the brightest dots). */
@media (max-width: 767px) {
  #orb-bg { -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 56px, rgb(0 0 0 / 0.3) 150px, rgb(0 0 0 / 0.3) 100%);
            mask-image: linear-gradient(to bottom, #000 0, #000 56px, rgb(0 0 0 / 0.3) 150px, rgb(0 0 0 / 0.3) 100%); }
}
[data-theme="dark"] .story-n { color: var(--text); background: color-mix(in srgb, var(--sec) 30%, transparent); }
