:root {
  color-scheme: light;
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --bg: #e5edeb;
  --surface: #fffefa;
  --text: #163430;
  --muted: #506761;
  --line: #dce6df;
  --blue: #146956;
  --blue-soft: #e3f1e9;
  --green: #276446;
  --shadow: 0 8px 22px #193d3410;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 93px; }
body { margin: 0; background: var(--bg); color: var(--text); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; transition: background .16s, transform .16s; }
button:active { transform: scale(.97); }
:focus-visible { outline: 3px solid #6b8bff; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
[data-icon] { display: inline-grid; place-items: center; }
.top { position: sticky; top: 0; z-index: 2; background: #ffffffee; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner, main { width: min(1176px, calc(100% - 64px)); margin-inline: auto; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 780; white-space: nowrap; line-height: 1.1; }
.logo { width: 40px; height: 40px; background: var(--blue); color: white; border-radius: 13px; box-shadow: 0 4px 11px #305ddc38; }
.brand-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
nav { display: flex; align-items: center; gap: 4px; }
nav a { padding: 13px 15px; border-radius: 11px; color: var(--muted); font-size: 14px; white-space: nowrap; }
nav a:hover, nav a[aria-current] { color: var(--blue); background: var(--blue-soft); }
nav a[aria-current] { font-weight: 700; }
nav [data-icon] { display: none; }
.mode { display: flex; gap: 7px; align-items: center; padding: 7px 10px; background: #f1f4fa; color: var(--muted); font-size: 12px; font-weight: 650; border-radius: 99px; white-space: nowrap; }
.mode i, .tile-head i, .foot-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mode[data-mode="live"] { background: #ebf8f1; color: var(--green); }
.mode[data-mode="error"], .mode[data-mode="stale"] { background: #fff0ec; color: #ad482d; }
.intro { padding: 31px 0 22px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.overview-actions, .form-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
#restaurant-switch { display: grid; gap: 4px; min-width: 138px; max-width: 250px; font-size: 12px; color: var(--muted); font-weight: 650; }
select, input { font: inherit; color: var(--text); min-height: 48px; width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
#restaurant-select { font-size: 14px; font-weight: 650; padding-right: 8px; }
.settings-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); gap: 14px; align-items: start; }
.settings-layout h2 { margin: 0; font-size: 20px; }
.restaurant-list { list-style: none; padding: 0; margin: 8px 0 0; }
.restaurant-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.restaurant-list li:last-child { border: 0; }
.restaurant-list div { min-width: 0; overflow-wrap: anywhere; }
.restaurant-list p { font-size: 12px; margin-top: 4px; }
#restaurant-form { display: grid; gap: 13px; margin-top: 14px; }
#restaurant-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
#restaurant-form input { font-weight: 400; }
.save-button { border-radius: 11px; min-height: 48px; padding: 0 14px; background: var(--blue); color: white; font-weight: 700; font-size: 14px; }
.save-button:disabled { opacity: .55; cursor: wait; }
#settings-notice { font-size: 13px; }
.maps-fields { min-width: 0; display: grid; gap: 10px; margin: 3px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.maps-fields legend { padding: 0 5px; font-weight: 700; }
.maps-fields p { font-size: 12px; }
.reviews-card { margin: 14px 0; }
.review-link { display: inline-block; color: var(--blue); font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
#review-settings { margin-top: 10px; }
.review-rating { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-rating strong { font-size: 25px; color: #8d5715; }
.review-rating span { color: var(--muted); font-size: 13px; }
.review-items { list-style: none; padding: 0; margin: 0; }
.review-items li { display: grid; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-items p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }
.review-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.review-byline img { width: 25px; height: 25px; border-radius: 50%; }
.maps-attribution { padding-top: 10px; font-size: 12px; }
.feed-card, .monitor-settings { margin: 14px 0; }
.feed-settings { margin-top: 10px; }
.feed-card h2 .pill { vertical-align: middle; margin-left: 3px; }
.feed-card .review-items { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.feed-card .review-items:empty { display: none; }
.monitor-settings h2 { margin: 0 0 6px; }
.monitor-settings > p { font-size: 13px; }
#monitor-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); gap: 12px; margin: 14px 0 8px; }
#monitor-form label { display: grid; gap: 6px; font-size: 14px; }
.monitor-actions { display: flex; flex-shrink: 0; gap: 6px; }
@media (max-width: 650px) { #monitor-form { grid-template-columns: 1fr; } }
main[data-active-screen="settings"] [data-screen]:not([data-screen="settings"]),
main[data-active-screen="settings"] > .error,
main[data-switching] :is(.kpis,.details,.table-card) { display: none; }
.context { display: flex; align-items: center; gap: 7px; color: var(--blue); font-size: 13px; font-weight: 730; }
.context svg { width: 15px; height: 15px; }
h1, h2, .metric strong { font-family: var(--display); }
h1 { margin: 7px 0 6px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.06em; }
p { margin: 0; color: var(--muted); line-height: 1.5; }
#updated { font-size: 13px; }
.refresh { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--blue); font-size: 14px; font-weight: 700; white-space: nowrap; }
.refresh:hover { background: var(--blue-soft); }
.refresh svg { width: 17px; height: 17px; }
.refresh[aria-busy] svg { animation: spin .8s linear infinite; }
.error { background: #fff0ec; color: #973b29; padding: 12px 15px; border-radius: 12px; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.metric, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); min-width: 0; }
.metric { padding: 17px 18px; min-height: 151px; }
.metric.lead { background: #284cba; border-color: #284cba; color: #fff; }
.metric.lead h2, .metric.lead p { color: #e1eaff; }
.metric-icon { background: #ffffff25; color: white; border-radius: 11px; width: 36px; height: 36px; }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.green { background: #eaf8f0; color: var(--green); }
.metric-icon.amber { background: #fff3e6; color: #98561f; }
.metric h2 { margin: 10px 0 3px; font-size: 14px; font-weight: 620; color: var(--muted); }
.metric strong { display: block; font-size: clamp(21px, 3vw, 32px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric p { font-size: 12px; margin-top: 4px; }
.details { display: grid; grid-template-columns: minmax(0,1.9fr) minmax(0,1fr); gap: 14px; margin: 14px 0; }
.card { padding: 18px 20px; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.section-head p { font-size: 13px; margin-top: 4px; }
.segments { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: #f0f3f9; white-space: nowrap; }
.segments button { min-height: 42px; min-width: 45px; border-radius: 9px; padding-inline: 9px; color: var(--muted); font-size: 13px; }
.segments button:hover { color: var(--blue); }
.segments button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 5px #20375c18; color: var(--blue); font-weight: 700; }
.chart-wrap { min-height: 196px; margin-top: 15px; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 6px; }
.chart-wrap > p:only-child { grid-column: 1 / -1; align-self: center; text-align: center; }
.chart-track { min-width: 0; min-height: 196px; }
.axis { height: 173px; display: flex; justify-content: space-between; flex-direction: column; text-align: right; padding-right: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: repeat(var(--count),minmax(0,1fr)); height: 166px; margin-top: 4px; background: repeating-linear-gradient(var(--line) 0 1px, transparent 1px 25%); border-bottom: 1px solid var(--line); }
.bar-slot { min-width: 0; height: 100%; position: relative; display: flex; justify-content: center; align-items: end; padding: 0; border-radius: 8px 8px 0 0; }
.bar-slot:hover { background: #eaf1ff80; }
.bar { height: max(2px,var(--height)); display: block; width: 62%; max-width: 43px; border-radius: 6px 6px 1px 1px; background: #b7c9fa; transform-origin: bottom; animation: raise .25s ease-out both; }
.bar-slot[aria-pressed="true"] .bar { background: var(--blue); }
.bar-slot small { position: absolute; bottom: -21px; color: var(--muted); font-size: 11px; white-space: nowrap; pointer-events: none; }
.bar-slot:first-child small { left: 0; }
.bar-slot:last-child small { right: 0; }
.chart-detail { padding: 8px 10px; min-height: 36px; border-radius: 9px; background: var(--blue-soft); color: #274eb5; font-size: 13px; }
.section-icon { width: 42px; height: 42px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }
.printer-list { list-style: none; padding: 0; margin: 9px 0 0; }
.printer-list li { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 45px; border-bottom: 1px solid var(--line); }
.printer-list li:last-child { border-bottom: 0; }
.printer-list strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.printer-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--bg); border-radius: 8px; }
.printer-icon svg { width: 16px; height: 16px; }
.pill { background: var(--bg); color: var(--muted); border-radius: 99px; padding: 4px 8px; font-size: 12px; font-weight: 650; }
.pill.online { background: #ebf8f1; color: var(--green); }
.pill.offline { background: #fff0ec; color: #ad482d; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(108px,1fr)); gap: 8px; margin-top: 14px; }
.table-tile { border: 1px solid #d9e5ff; background: #f0f5ff; border-radius: 12px; min-height: 66px; padding: 10px; }
.tile-head { display: flex; gap: 5px; justify-content: space-between; align-items: center; }
.tile-head strong { overflow-wrap: anywhere; font-size: 15px; }
.tile-head i { flex: 0 0 7px; color: #3970e3; }
.table-tile > span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-size: 13px; }
.printer-list li.empty { display: flex; }
footer { display: flex; align-items: center; gap: 7px; min-height: 54px; color: var(--muted); font-size: 12px; }
footer svg { width: 15px; height: 15px; }
.foot-dot { width: 3px; height: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes raise { from { transform: scaleY(.08); opacity: .45; } }

@media (max-width: 840px) {
  .top-inner, main { width: calc(100% - 32px); }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  html { scroll-padding-top: 0; scroll-behavior: auto; }
  .top { backdrop-filter: none; background: var(--surface); padding-top: env(safe-area-inset-top); }
  .top-inner { min-height: 62px; }
  .brand { font-size: 17px; }
  .logo { width: 34px; height: 34px; border-radius: 11px; }
  nav {
    position: fixed;
    inset: auto 0 0;
    justify-content: center;
    padding: 5px max(10px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: #fffffff5;
    backdrop-filter: blur(16px);
    box-shadow: 0 -5px 20px #1a3a640c;
  }
  nav a { flex: 1; min-height: 55px; max-width: 146px; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 4px 8px; font-size: 12px; }
  nav [data-icon] { display: inline-grid; }
  nav svg { width: 21px; height: 21px; }
  main { min-height: calc(100dvh - 62px); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  main[data-active-screen="overview"] [data-screen]:not([data-screen="overview"]),
  main[data-active-screen="tables"] [data-screen]:not([data-screen="tables"]),
  main[data-active-screen="printers"] [data-screen]:not([data-screen="printers"]) { display: none; }
  main:not([data-active-screen="overview"]) { padding-top: 16px; }
  .intro { padding: 20px 0 15px; }
  .intro:has(#restaurant-switch:not([hidden])) { flex-direction: column; align-items: stretch; }
  .overview-actions { flex-wrap: nowrap; }
  #restaurant-switch { flex: 1; min-width: 0; max-width: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .intro p { font-size: 12px; }
  .refresh { padding-inline: 9px; font-size: 13px; min-height: 44px; }
  .kpis, .details { gap: 9px; }
  .details { display: contents; }
  .trend { margin-top: 9px; }
  .card, .metric { padding: 13px; border-radius: 15px; }
  .metric { min-height: 132px; }
  .metric strong { font-size: 23px; }
  .section-head h2 { font-size: 18px; }
  .table-grid { grid-template-columns: repeat(auto-fit,minmax(91px,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.shell { background: #f7f9f5; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #145b50; color: #fffefa; border-radius: 28px; margin-bottom: 14px; min-height: 182px; padding: 27px 29px; align-items: end; }
.hero::before, .hero::after { content: ""; pointer-events: none; position: absolute; z-index: -1; border-radius: 50%; }
.hero::before { width: 455px; height: 340px; right: -94px; top: -202px; background: #247668; }
.hero::after { width: 250px; height: 250px; right: -115px; bottom: -205px; border: 36px solid #b6c89a69; }
.hero h1 { letter-spacing: -.04em; }
.hero .context, .hero p, .hero #restaurant-switch { color: #e0f0e8; }
.hero .context svg { color: #f4d784; }
.hero .refresh { color: #263d33; background: #f4d784; border-color: #f4d784; }
.hero .refresh:hover { background: #ffe6a4; }
.hero .overview-actions { position: relative; }
.logo { background: #f4d784; color: #24483d; box-shadow: 0 4px 14px #24483d1e; }
.card, .metric { border-radius: 23px; }
.metric { position: relative; overflow: hidden; }
.metric.lead { background: #913957; border-color: #913957; }
.metric.lead::after { content: ""; position: absolute; pointer-events: none; width: 148px; height: 148px; right: -57px; top: -77px; border: 21px solid #ffffff1e; border-radius: 50%; }
.metric.lead h2, .metric.lead p { color: #ffedf3; }
.metric:nth-child(2) { background: #ebf4ef; }
.metric:nth-child(4) { background: #faf1d9; border-color: #ede4cd; }
.metric-icon.amber { background: #f2e1ae; color: #694b1f; }
.metric-icon.blue { background: #d6ebe1; }
.occupancy-ring { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; background: conic-gradient(#258875 var(--occupancy, 0%), #e0ebe4 0); }
.occupancy-ring span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 10px; font-weight: 750; }
.occupancy h2 { margin-top: 5px; }
.details { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.printers { background: #edf3ef; }
.chart-detail { color: #235b4b; }
.bar { background: #a9cdbd; }
.bar-slot:hover { background: #d6ebe169; }
.segments { background: #edf2ed; }
.table-tile { background: #edf5ef; border-color: #dceae0; }
.tile-head i { color: #2e876a; }
.feed-card { border-left: 4px solid #579781; }
.refresh, .segments button { font-weight: 650; }

@media (min-width: 651px) {
  html { scroll-padding-top: 24px; }
  .shell { display: grid; grid-template-columns: 92px minmax(0,1fr); width: min(1280px, calc(100% - 44px)); margin: 22px auto; border: 1px solid #d5e3dd; border-radius: 30px; box-shadow: 0 18px 52px #244c3d1b; }
  .top { height: fit-content; top: 22px; padding: 22px 0; border: 0; background: transparent; backdrop-filter: none; }
  .top-inner { width: 100%; display: flex; flex-direction: column; gap: 24px; }
  .brand { flex-direction: column; gap: 7px; font-size: 15px; }
  .brand-sub { display: none; }
  .logo { width: 42px; height: 42px; border-radius: 16px; }
  nav { flex-direction: column; gap: 4px; width: 68px; padding: 8px 5px; border-radius: 29px; background: #dfece5; }
  nav a { display: grid; place-items: center; gap: 4px; padding: 9px 2px; width: 58px; min-height: 56px; border-radius: 19px; font-size: 11px; }
  nav [data-icon] { display: inline-grid; }
  nav svg { width: 18px; height: 18px; }
  nav a[aria-current] { background: #175b50; color: #fffefa; }
  .mode { font-size: 10px; padding-inline: 6px; }
  main { width: auto; min-width: 0; margin: 0; padding: 22px 24px 0 0; }
  #settings > .intro { padding-top: 9px; }
}

@media (max-width: 650px) {
  .top { background: #f7f9f5; }
  .hero { margin-top: 12px; border-radius: 21px; padding: 17px 15px; min-height: 145px; }
  .hero::before { right: -245px; top: -185px; }
  .hero .refresh { min-height: 44px; }
  .hero h1 { font-size: clamp(26px, 7vw, 37px); }
  .hero #updated { font-size: 11px; }
  .hero .context { font-size: 12px; }
  .card, .metric { border-radius: 17px; }
  nav { background: #f8fcf8f5; box-shadow: 0 -5px 20px #1c4b360d; }
  nav a[aria-current] { background: #dbece1; }
  main, .top-inner {
    width: auto;
    margin-left: max(16px, env(safe-area-inset-left));
    margin-right: max(16px, env(safe-area-inset-right));
  }
  #restaurant-select, #restaurant-form input, #monitor-form input { font-size: 16px; }
  .chart-track-wide { overflow-x: auto; overscroll-behavior-inline: contain; }
  .chart-track-wide .bars { min-width: 840px; }
  .chart-track-wide .bar { width: 58%; }
  .segments button { min-height: 44px; }
  .review-items { overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  main, .top-inner { margin-inline: 12px; }
  .hero { flex-wrap: wrap; align-content: space-between; }
  .hero .overview-actions { width: 100%; }
  .monitor-settings .restaurant-list li { flex-wrap: wrap; }
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wrap { grid-template-columns: 23px minmax(0, 1fr); gap: 4px; }
}

main[data-active-screen="health"] [data-screen]:not([data-screen="health"]),
main[data-active-screen="health"] > :is(.error,.details,footer) { display: none; }
#health iframe { display: block; width: 100%; height: calc(100dvh - 68px); border: 1px solid var(--line); border-radius: 23px; background: var(--surface); }
@media (max-width: 650px) {
  main[data-active-screen="health"] { padding-top: 8px; }
  #health iframe { height: calc(100dvh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 14px; }
  nav a { padding-inline: 2px; }
}

main[data-active-screen="income"] [data-screen]:not([data-screen="income"]),
main[data-active-screen="income"] > :is(.error,.details,footer) { display: none; }
.income-hero .refresh { text-decoration: none; }
.income-settings, .income-breakdown { margin: 14px 0; }
.income-settings h2, .income-breakdown h2 { margin: 0 0 10px; font-size: 20px; }
.income-fields, .shift-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.income-fields label, .shift-row label { display: grid; gap: 5px; font-size: 14px; font-weight: 650; }
.shift-row { grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; min-width: 0; border: 0; padding: 0; margin: 12px 0; }
.shift-row input { min-width: 0; }
#income-notice { margin-top: 8px; }
.income-totals .metric { min-height: 106px; }
.income-totals .metric strong { font-size: clamp(20px, 5vw, 40px); }
.income-totals { grid-template-columns: repeat(3,minmax(0,1fr)); }
#income-exchange { margin-top: 11px; font-size: 13px; }
@media (max-width: 650px) {
  .income-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .income-totals .metric:last-child { grid-column: 1 / -1; }
  nav a { padding-inline: 0; font-size: 11px; }
  .income-fields input, .income-fields select, .shift-row input { font-size: 16px; }
  .shift-row { gap: 6px; }
  .shift-row .refresh { padding-inline: 7px; }
}
@media (max-width: 650px) { #income-settings { scroll-margin-top: calc(72px + env(safe-area-inset-top)); } }

.ledger h2 { margin: 0; }
.ledger-summary { margin: 14px 0; }
.ledger-summary > div { min-width: 0; border-radius: 14px; background: var(--blue-soft); padding: 12px; }
.ledger-summary span, .ledger-summary p { font-size: 13px; color: var(--muted); }
.ledger-summary strong { display: block; margin-top: 4px; font-size: clamp(18px, 4vw, 28px); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ledger-inline, .ledger-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-bottom: 12px; }
.ledger label { display: grid; gap: 4px; font-size: 14px; }
.ledger input, .ledger select { min-width: 0; font-size: 16px; }
.ledger .leave-toggle { display: flex; align-items: center; min-height: 48px; gap: 8px; }
.ledger .leave-toggle input { width: 19px; height: 19px; min-height: 0; accent-color: var(--blue); }
#ledger-notice { margin-top: 8px; }
@media (max-width: 650px) {
  .ledger-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-fields label:last-child { grid-column: 1 / -1; }
}

[data-forbidden] { display: none !important; }
:root { --bg:#eeeff3; --surface:#fffefa; --text:#202b42; --muted:#596477; --line:#e3e6ee; --blue:#435b88; --blue-soft:#e9eef8; --green:#287653; --shadow:0 8px 25px #2435530d; }
.shell, .top { background: #f9f8f5; }
.hero { background: #303e5b; }
.hero::before { background: #455778; }
.hero .context, .hero p, .hero #restaurant-switch { color: #e4ebf8; }
.hero .context svg { color: #c5d3ef; }
.hero .refresh, .hero .refresh:hover { background: #e0e8f8; border-color: #e0e8f8; color: #273957; }
.logo { background: #e4eaf6; color: #394e76; }
.metric.lead { background: #4f648c; border-color: #4f648c; }
.metric.lead h2, .metric.lead p { color:#eef3fd; }
.metric:nth-child(2), .metric:nth-child(4), .printers { background:#f2f4f9; border-color:var(--line); }
.chart-detail { color:#3c537b; }
.bar { background:#b5c3dc; }
.bar-slot:hover, .segments { background:#ecf0f7; }
.table-tile, .metric-icon.blue { background:#edf1f8; border-color:#dce4f0; }
.occupancy-ring { background:conic-gradient(#6483b6 var(--occupancy,0%), #e4eaf3 0); }
.tile-head i { color:#6582b1; }
.feed-card { border-left-color:#718bb9; }
.login-panel { width:min(420px,calc(100% - 32px)); margin:10vh auto; padding:26px; }
#login-form, #account-form { display:grid; gap:12px; }
#login-form label, #account-form label, .wallet-settings label { display:grid; gap:5px; font-size:14px; }
.permission-fields { display:flex; flex-wrap:wrap; gap:8px 15px; min-width:0; padding:10px; border:1px solid var(--line); border-radius:12px; }
#account-form .permission-fields label { display:flex; align-items:center; gap:5px; min-height:36px; }
.permission-fields input { min-height:0; width:18px; height:18px; accent-color:var(--blue); }
#wallet-form { margin-top:18px; }
.ledger-date-row { display:grid; grid-template-columns:minmax(135px,1fr) minmax(0,2fr); }
.ledger .leave-toggle { justify-content:space-between; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#f3f5fa; cursor:pointer; }
.leave-toggle span { display:grid; gap:2px; }
.leave-toggle small { color:var(--muted); font-size:12px; }
.ledger .leave-toggle input { appearance:none; flex:none; position:relative; width:44px; height:26px; padding:0; margin:0; border:0; border-radius:20px; background:#a4afc1; cursor:pointer; }
.leave-toggle input::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:white; }
.leave-toggle input:checked { background:var(--blue); }
.leave-toggle input:checked::after { left:21px; }
.ledger-summary .review-link { margin-top:5px; }
@media (min-width:651px) { nav { background:#e8edf6; } nav a[aria-current] { background:#485e87; color:white; } }
@media (max-width:650px) {
  nav { background:#fafbfff5; } nav a[aria-current] { background:#e3eaf7; }
  .top-inner { gap:8px; }
  #logout { margin-left:auto; min-height:38px; padding:0 8px; }
  .ledger-date-row { grid-template-columns:1fr; }
}
#secondary-store { margin: 14px 0; }
#secondary-store:has([hidden]) { display: none; }

.account-row-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:end; }
#invite-box { margin-top:12px; padding:12px; display:grid; gap:8px; border-radius:12px; background:var(--blue-soft); }
#invite-box label { display:grid; gap:4px; font-size:14px; }
#invite-box button { justify-self:start; }
#invite-box p { font-size:13px; }

.ledger { padding: clamp(16px, 3vw, 26px); }
.ledger-title, .ledger .leave-copy { display:flex; align-items:center; gap:10px; }
.ledger-icon, .ledger .leave-icon { display:grid; place-items:center; width:42px; height:42px; flex:none; border-radius:14px; background:#e7edf9; color:#485f8d; }
.ledger .leave-icon { width:34px; height:34px; border-radius:11px; }
.ledger .leave-icon svg { width:17px; height:17px; }
.ledger-summary { margin:18px 0; }
.ledger-summary > div { padding:14px 16px; border:1px solid #e3e8f2; background:#f4f6fb; }
.ledger-summary > div:first-child { background:#344766; border-color:#344766; color:#fff; }
.ledger-summary > div:first-child :is(span,a) { color:#e0e8f9; }
.ledger-date-row { align-items:stretch; margin-bottom:16px; }
.ledger-date-row > label:first-child input { align-self:end; }
.ledger .leave-toggle { min-height:62px; background:#f5f7fb; transition:background .2s ease,border-color .2s ease; }
.ledger .leave-toggle:has(input:checked) { background:#eaf0fc; border-color:#aabbdc; }
.ledger .leave-toggle input { transition:background .22s ease; }
.ledger .leave-toggle input::after { left:3px; box-shadow:0 2px 5px #1a28473d; transition:transform .24s cubic-bezier(.2,.8,.25,1.3); }
.ledger .leave-toggle input:checked::after { left:3px; transform:translateX(18px); }
#ledger-form { padding:14px; border-radius:17px; border:1px solid var(--line); background:#f8f9fc; }
.ledger-kind { margin:0 0 12px; padding:0; min-width:0; border:0; }
.ledger-kind legend { padding:0; font-size:14px; font-weight:750; margin-bottom:8px; }
.ledger-segments { display:grid; grid-template-columns:repeat(2,1fr); position:relative; isolation:isolate; width:min(100%,264px); padding:3px; border-radius:12px; background:#e8edf6; }
.ledger-segments::before { content:""; position:absolute; inset:3px auto 3px 3px; width:calc((100% - 6px)/2); border-radius:9px; background:white; box-shadow:0 2px 7px #21385916; z-index:-1; transition:transform .23s cubic-bezier(.2,.75,.3,1); }
.ledger-segments:has([value=income]:checked)::before { transform:translateX(100%); }
.ledger-segments label { position:relative; display:grid; place-items:center; min-height:44px; color:var(--muted); cursor:pointer; }
.ledger-segments label:has(:checked) { color:#344d7b; font-weight:750; }
.ledger-segments input { position:absolute; width:1px; min-height:0; height:1px; opacity:0; }
.ledger-segments label:has(:focus-visible) { outline:2px solid #5376b0; outline-offset:-2px; border-radius:9px; }
.ledger-fields { display:grid; grid-template-columns:minmax(105px,1fr) minmax(0,2fr); }
.amount-input { position:relative; }
.amount-input > span { position:absolute; top:50%; left:11px; transform:translateY(-50%); color:#617391; font-weight:750; pointer-events:none; }
.amount-input input { padding-left:31px; }
.ledger-save { display:inline-flex; align-items:center; justify-content:center; gap:7px; transition:background .18s ease,transform .18s ease,box-shadow .18s ease; }
.ledger-save:hover { background:#324a77; box-shadow:0 5px 12px #263d6a29; }
.ledger-save svg { width:16px; height:16px; }
#ledger-notice:empty { display:none; }
#ledger-entries li { min-width:0; }
#ledger-entries .ledger-entry-amount { margin-left:auto; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ledger-entry-amount.income { color:#26704f; }
.ledger-entry-amount.expense { color:#9c464e; }
.ledger-empty { justify-content:center !important; min-height:58px; border:1px dashed var(--line) !important; border-radius:12px; margin-top:12px; }
.ledger-entry-new { animation:ledger-in .35s cubic-bezier(.2,.8,.25,1) both; }
@keyframes ledger-in { from { opacity:0; transform:translateY(6px); } }
@media (max-width:650px) {
  .ledger-fields label:last-child { grid-column:auto; }
  .ledger-save { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
  .ledger *, .ledger *::before, .ledger *::after { animation:none !important; transition:none !important; }
}

/* Shared visual language for the Sakura workspace. */
:root {
  --bg:#eef1f6; --surface:#fff; --text:#202a3e; --muted:#5b6980;
  --line:#e2e8f1; --blue:#395d90; --blue-soft:#edf3fd;
  --shadow:0 2px 7px #21365608,0 14px 32px #2136560b;
  --ease-out:cubic-bezier(.2,.75,.25,1);
}
.shell { background:#f8faff; }
.top { background:transparent; }
.card, .metric { box-shadow:var(--shadow); }
.card { border-color:#e4eaf3; }
.hero { background:linear-gradient(115deg,#243653,#385579 76%,#436589); min-height:185px; }
.hero::before { background:#9dbdec1b; }
.hero::after { border-color:#a7c3ef46; }
.hero .refresh { background:#f0f5ff; border-color:#f0f5ff; border-radius:14px; }
.hero .refresh:hover { background:white; }
.metric.lead { background:linear-gradient(135deg,#395781,#4e6c98); border-color:#4e6c98; }
.metric:nth-child(2), .metric:nth-child(4), .printers { background:#f6f8fd; }
.section-head h2, .income-settings h2, .monitor-settings h2 { letter-spacing:-.035em; }
nav a { transition:background .2s var(--ease-out),color .2s,transform .2s var(--ease-out); }
nav a svg { transition:transform .25s cubic-bezier(.2,.75,.25,1.35); }
nav a[aria-current] svg { transform:translateY(-1px) scale(1.06); }
nav a:active { transform:scale(.94); }
.mode { background:#ebf1fb; color:#435979; }
.section-icon, .metric-icon.blue { background:#e8effb; }
.bar { background:#b4c9e8; }
.bar-slot[aria-pressed="true"] .bar { background:#436897; }
.segments { border:1px solid #e6ecf5; }
.chart-detail { background:#ecf3fe; }
.table-tile { background:#f1f6ff; border-color:#e2eaf8; }
.tile-head i { color:#547eb1; box-shadow:0 0 0 3px #dbe9fa; }
.printer-list li { padding:3px 0; }
.printer-icon { background:#e7effb; color:#426395; }
.settings-layout, #settings .card + .card { margin-top:14px; }
#settings :is(input:not([type=checkbox]),select), .ledger :is(input:not([type=checkbox]),select) { background:#fbfcff; }
#settings :is(input,select):focus, .ledger :is(input,select):focus { border-color:#8ca6cd; }
#health iframe { box-shadow:var(--shadow); }
.ledger-date-field { display:grid; align-content:space-between; gap:5px; font-size:14px; }
.date-trigger { display:flex; min-height:54px; gap:9px; align-items:center; text-align:left; padding:6px 10px; border:1px solid var(--line); border-radius:13px; background:#f6f9ff; }
.date-trigger:hover { background:#ebf2ff; }
.date-trigger strong { flex:1; font-size:13px; }
.date-icon { flex:none; width:31px; height:31px; border-radius:9px; background:#e4edfb; color:#3c6193; }
.date-icon svg, .date-trigger > span:last-child svg { width:16px; height:16px; }
#ledger-calendar { color:var(--text); background:var(--surface); width:min(385px, calc(100% - 24px)); border:1px solid var(--line); padding:18px; border-radius:24px; box-shadow:0 24px 88px #15253b45; }
#ledger-calendar[open] { animation:calendar-open .24s var(--ease-out) both; }
#ledger-calendar::backdrop { background:#15264062; backdrop-filter:blur(4px); }
.calendar-header, .calendar-month { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.calendar-header h2 { font-size:19px; margin:0; }
.calendar-header button, .calendar-month button { display:grid; place-items:center; height:44px; width:44px; border-radius:12px; color:var(--blue); }
.calendar-header button:hover, .calendar-month button:hover { background:var(--blue-soft); }
.calendar-week, #calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; text-align:center; }
.calendar-week { color:var(--muted); font-size:12px; padding:8px 0 4px; }
.calendar-day { min-height:40px; padding:0; border-radius:10px; font-size:14px; font-variant-numeric:tabular-nums; }
.calendar-day:hover { background:var(--blue-soft); }
.calendar-day[aria-current="date"] { box-shadow:inset 0 0 0 1px #7191bf; color:var(--blue); }
.calendar-day[aria-pressed="true"] { background:#405f8c; color:white; font-weight:750; }
#calendar-today { width:100%; margin-top:12px; }
@keyframes calendar-open { from { opacity:0; transform:translateY(8px) scale(.98); } }
@media (max-width:650px) {
  .top { background:#f8faff; }
  .hero { min-height:145px; }
  .card, .metric { border-radius:18px; }
  #ledger-calendar { margin:auto auto max(12px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion:reduce) {
  #ledger-calendar[open] { animation:none; }
}

main[data-active-screen="delivery"] [data-screen]:not([data-screen="delivery"]),
main[data-active-screen="delivery"] > :is(.error,.details,footer) { display:none; }
#delivery { --delivery-ink:#24594c; --delivery-tint:#e1f1e7; }
.delivery-hero { margin:0 0 14px; padding:24px; border-radius:24px; background:linear-gradient(122deg,#e2f0e8,#f8f2dd); border:1px solid #dceadf; }
.delivery-hero h1 { color:var(--delivery-ink); }
.delivery-hero .delivery-kicker { color:var(--delivery-ink); font-size:12px; font-weight:750; letter-spacing:.12em; }
.delivery-demo { color:#24594c; background:#fffefa; border:1px solid #d6e6db; border-radius:99px; padding:7px 10px; font-size:12px; font-weight:650; white-space:nowrap; }
.delivery-layout { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(230px,1fr); gap:14px; align-items:start; }
.delivery-filters { display:flex; gap:6px; flex-wrap:wrap; margin:14px 0; }
.delivery-filter { min-height:44px; padding:0 12px; border-radius:100px; background:#f1f5f3; color:#395b51; font-size:13px; }
.delivery-filter[aria-pressed="true"] { background:var(--delivery-ink); color:white; }
.delivery-dishes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.delivery-dish { min-width:0; padding:11px; border:1px solid #e5eee8; border-radius:15px; background:#f8fbf9; display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; align-items:start; animation:calendar-open .22s var(--ease-out) both; }
.delivery-dish-art { display:grid; place-items:center; width:42px; height:42px; font-size:24px; border-radius:12px; background:#e6f2ea; }
.delivery-dish h3 { font-size:15px; margin:0 0 3px; }
.delivery-dish p, #delivery-order-details { font-size:13px; overflow-wrap:anywhere; }
.delivery-dish-actions { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; gap:4px; }
.delivery-add { min-width:36px; min-height:36px; padding:0; border-radius:12px; background:#e3f0e9; color:#24594c; font-size:18px; }
.delivery-add:hover { background:#d2e9dd; }
.delivery-quantity { display:flex; gap:5px; align-items:center; }
.delivery-total { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:13px 0; color:#294e45; }
.delivery-total strong { font-size:20px; }
#delivery-checkout, #delivery-form .save-button { width:100%; background:#24594c; }
#delivery-checkout:disabled { cursor:default; opacity:.48; }
#delivery-dialog { width:min(400px,calc(100% - 24px)); color:var(--text); border:1px solid var(--line); border-radius:23px; padding:18px; box-shadow:0 24px 88px #15253b45; }
#delivery-dialog[open] { animation:calendar-open .24s var(--ease-out) both; }
#delivery-dialog::backdrop { background:#15264062; backdrop-filter:blur(4px); }
#delivery-form, #delivery-form label { display:grid; gap:7px; }
#delivery-form { gap:13px; margin-top:10px; }
.delivery-route { position:relative; height:110px; margin:15px 0; overflow:hidden; border-radius:16px; background:repeating-linear-gradient(35deg,#eff6ef 0 28px,#e6f0e8 28px 31px); }
.delivery-road { position:absolute; top:55%; left:7%; right:7%; border-top:4px dashed #7ba798; }
.delivery-origin,.delivery-destination { position:absolute; bottom:12px; color:#355b50; font-size:12px; }
.delivery-origin { left:7%; } .delivery-destination { right:7%; }
#delivery-rider { position:absolute; top:24%; left:clamp(19px,var(--position,12%),calc(100% - 19px)); transform:translateX(-50%); width:36px; height:36px; border-radius:50%; background:#24594c; color:white; transition:left .5s linear; box-shadow:0 4px 10px #254b3c42; }
.delivery-steps { list-style:none; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; padding:0; margin:0 0 12px; }
.delivery-steps li { border-top:3px solid #e7ece9; padding-top:6px; text-align:center; font-size:12px; color:var(--muted); }
.delivery-steps li.active,.delivery-steps li.complete { border-color:#528b78; color:#24594c; }
.delivery-steps li.active { font-weight:750; }
#delivery-reorder { margin-top:10px; }
@media (max-width:800px) { .delivery-layout { grid-template-columns:1fr; } }
@media (max-width:650px) {
  .delivery-hero { flex-wrap:wrap; padding:15px; }
  .delivery-dish-art { width:35px; height:35px; font-size:21px; }
  .delivery-add { min-width:44px; min-height:44px; }
  nav { gap:1px; }
  nav a { font-size:10px; }
}

.delivery-pair-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin-top:14px; }
.delivery-pair-form p, #delivery-checkout-error { grid-column:1/-1; font-size:13px; }
#delivery-checkout-error:empty, .delivery-notice:empty { display:none; }
.delivery-notice { padding:8px 12px; margin-bottom:12px; background:#eef5f1; border-radius:12px; font-size:13px; }
#delivery-action { margin-top:12px; background:#24594c; }

main[data-active-screen="ranking"] [data-screen]:not([data-screen="ranking"]),
main[data-active-screen="ranking"] > :is(.error,.details,footer) { display:none; }
#ranking { --delivery-ink:#24594c; }
#ranking-list { list-style:none; display:grid; gap:10px; padding:0; margin:16px 0 0; }
#ranking-list:empty { display:none; }
.ranking-row { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:10px; min-height:72px; padding:10px; border:1px solid #dcebe3; border-radius:15px; background:#f3f8f5; animation:calendar-open .24s var(--ease-out) both; }
.ranking-position { display:grid; place-items:center; border-radius:12px; height:40px; background:#dceee4; color:#24594c; font-weight:750; }
.ranking-person { overflow-wrap:anywhere; }
.ranking-person p { font-size:12px; }
.ranking-score { color:#24594c; white-space:nowrap; }
@media (max-width:650px) { nav a { min-width:0; flex:1 1 0; } }

@media (max-width:360px) { nav a { font-size:9px; } }

.wellness-date { display:grid; gap:5px; font-size:13px; color:#365f54; }
.wellness-log { margin-top:14px; }
#wellness-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0; }
#wellness-form label { display:grid; gap:5px; font-size:14px; }
.wellness-meals { grid-column:1/-1; }
#wellness-form textarea { font:inherit; color:inherit; resize:vertical; padding:10px; border:1px solid var(--line); border-radius:12px; }
#wellness-form button { justify-self:start; }
.wellness-share { display:flex; align-items:center; gap:9px; padding:12px; border-radius:12px; background:var(--blue-soft); font-size:13px; }
.wellness-share input { min-height:0; width:19px; height:19px; flex:none; accent-color:var(--blue); }
.wellness-food { white-space:pre-wrap; color:var(--text); }
#wellness-notice { font-size:13px; margin-top:6px; }

#ledger-form { background:#fff; padding:clamp(12px,2.4vw,20px); }
.ledger-categories { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; padding:5px 0 15px; }
.ledger-category { display:grid; justify-items:center; gap:6px; min-width:0; min-height:65px; padding:5px 0; color:var(--muted); font-size:12px; border-radius:12px; }
.ledger-category:hover { background:#f5f7fb; }
.ledger-category-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#eef1f6; font-size:17px; transition:background .18s,transform .2s; }
.ledger-category[aria-pressed="true"] { color:#9d3d50; font-weight:700; }
.ledger-category[aria-pressed="true"] .ledger-category-icon { background:#f9e1e6; transform:scale(1.1); }
.ledger-composer { background:#f0f2f6; border-radius:16px; padding:9px; }
.ledger-composer .ledger-fields { grid-template-columns:minmax(0,1fr) minmax(112px,.55fr); gap:0; background:white; border-radius:11px; margin-bottom:8px; }
.ledger-composer .ledger-fields input { border:0; background:transparent; }
.ledger .ledger-amount { display:flex; align-items:center; padding-right:10px; border-left:1px solid #edf0f5; }
.ledger-amount input { text-align:right; font-variant-numeric:tabular-nums; color:#9d3d50; font-weight:750; font-size:19px; }
.ledger-amount span { color:var(--muted); font-size:11px; }
.ledger-keypad { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.ledger-key { min-height:46px; border-radius:10px; background:white; font-size:17px; font-variant-numeric:tabular-nums; }
.ledger-key:hover { background:#e9effa; }
.ledger-key:nth-child(8), .ledger-key-action { font-size:13px; font-weight:700; }
.ledger-key:last-child { grid-column:span 2; background:#465f8b; color:white; }
@media(max-width:650px) { .ledger-composer .ledger-fields { grid-template-columns:minmax(0,1fr) minmax(105px,.65fr); } }

.ledger-month-tools { display:flex; justify-content:space-between; gap:9px; align-items:center; margin:14px 0 10px; }
.ledger-month-tools .refresh { background:#eaf2ff; color:#315c95; }
.ledger-month-picker { display:flex !important; align-items:center; gap:8px; padding-left:9px; border:1px solid var(--line); border-radius:13px; background:#f8faff; }
.ledger-month-picker svg { width:17px; color:#44699d; }
.ledger-month-picker input { border:0; width:auto; min-height:43px; }
.ledger-month-hero { position:relative; isolation:isolate; overflow:hidden; display:grid; gap:4px; padding:21px; border-radius:17px; background:linear-gradient(118deg,#23395c,#3c6190 70%,#6583a9); color:white; }
.ledger-month-hero::before,.ledger-month-hero::after { content:""; z-index:-1; position:absolute; inset:38% -14% -110% 19%; border-radius:50%; transform:rotate(-18deg); border:24px solid #b8d5fb22; background:#9bbce623; }
.ledger-month-hero::after { transform:rotate(13deg); inset:58% 12% -120% -24%; border-color:#dceaff28; }
.ledger-month-hero strong { font-size:clamp(28px,7vw,44px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ledger-month-hero div { display:flex; flex-wrap:wrap; gap:8px 15px; margin-top:12px; font-size:13px; color:#edf4ff; }
.ledger-budget { border:1px solid var(--line); border-radius:15px; padding:13px; margin:12px 0; }
.ledger-budget h3,.ledger-bill-title { margin:0; font-size:16px; }
.ledger-budget .section-head { align-items:center; }
.ledger-budget progress { width:100%; height:8px; accent-color:#347d72; }
.ledger-budget progress.over-budget { accent-color:#a94455; }
.ledger-budget p { font-size:13px; }
#ledger-budget-form { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin-top:10px; }
.ledger-bill-title { margin:15px 0 8px; }
.ledger-day { border:1px solid var(--line); border-radius:14px; overflow:hidden; margin-bottom:8px; }
.ledger-day header { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px; padding:10px 12px; background:#f5f8fd; font-size:13px; color:var(--muted); }
.ledger-day h4 { margin:0; color:var(--text); }
.ledger-day ul { margin:0; padding:0 12px; }
#ledger-entries .ledger-empty { display:grid; place-items:center; }
#ledger-form { scroll-margin-top:80px; }

.ledger-view-switch { width:fit-content; margin:14px 0; }
.ledger-view-switch button { min-width:68px; }
.ledger-assets { display:grid; gap:12px; }
.ledger-assets h3 { margin:0; font-size:16px; }
.ledger-assets-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.ledger-assets-head > div { display:flex; gap:6px; flex-wrap:wrap; }
.asset-overview,.asset-section { border-radius:16px; padding:14px; border:1px solid var(--line); }
.asset-overview { display:grid; gap:14px; background:linear-gradient(135deg,#edf4ff,#fff); text-align:center; padding:18px 14px 14px; }
.asset-overview span,.asset-totals span { color:var(--muted); font-size:13px; }
.asset-overview strong { display:block; font-size:clamp(27px,7vw,42px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.asset-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.asset-totals div { background:#f4f7fc; border-radius:12px; padding:10px; min-width:0; }
.asset-totals b { display:block; font-size:16px; overflow-wrap:anywhere; }
.asset-section .asset-totals { margin-top:8px; }
.asset-section li { display:grid; grid-template-columns:34px minmax(0,1fr) auto auto; gap:7px; }
.asset-section li.empty { display:block; }
.asset-item-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#e6effe; color:#3f6196; font-weight:750; }
.asset-item-name { overflow-wrap:anywhere; }
.asset-item-amount { font-size:14px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#asset-dialog { width:min(410px,calc(100% - 24px)); color:var(--text); border:1px solid var(--line); border-radius:22px; padding:16px; box-shadow:0 24px 88px #15253b45; }
#asset-dialog[open] { animation:calendar-open .24s var(--ease-out) both; }
#asset-dialog::backdrop { background:#15264062; backdrop-filter:blur(4px); }
#asset-form { display:grid; gap:10px; }
#asset-form label { display:grid; gap:4px; font-size:14px; }
#asset-form .asset-include { display:flex; align-items:center; gap:8px; }
#asset-form .asset-include input { width:18px; height:18px; min-height:0; accent-color:var(--blue); }
#asset-notice:empty,#asset-form-error:empty { display:none; }
@media(max-width:420px) { .asset-section li { grid-template-columns:28px minmax(0,1fr) minmax(55px,auto) auto; gap:5px; } .asset-item-icon { width:28px; height:28px; } .asset-section li .refresh { padding-inline:7px; min-height:40px; } }

.ledger-stats { display:grid; gap:12px; }
.ledger-stats h3 { margin:0; font-size:16px; }
.stats-controls { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.stats-period { display:flex; align-items:center; gap:5px; }
.stats-period button { width:42px; min-height:44px; border-radius:10px; color:var(--blue); background:#f1f5fd; }
.stats-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0 0; }
.stats-totals > div { border-radius:12px; background:#f4f7fc; padding:10px; }
.stats-totals dt { color:var(--muted); font-size:13px; }
.stats-totals dd { margin:4px 0 0; font-weight:750; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.stats-trend { display:grid; grid-template-columns:repeat(var(--stats-count),minmax(0,1fr)); margin-top:12px; background:repeating-linear-gradient(to top, transparent 0 29px,#eef2f8 29px 30px); }
.stats-column { display:grid; grid-template-rows:120px 22px; min-width:0; padding:0; border-radius:6px; }
.stats-column[aria-pressed=true] { background:#e6edf9a0; }
.stats-bars { display:flex; align-items:end; justify-content:center; gap:1px; }
.stats-bar { flex:0 1 45%; max-width:18px; border-radius:4px 4px 0 0; transform-origin:bottom; animation:stats-rise .22s var(--ease-out) both; }
.stats-expense { background:#d85665; }
.stats-income { background:#457d69; }
.stats-column small { align-self:end; color:var(--muted); font-size:10px; }
.stats-trend-detail { font-size:13px; margin-top:8px; }
.stats-donut { width:min(174px,100%); aspect-ratio:1; margin:16px auto; display:grid; place-items:center; border-radius:50%; }
.stats-donut > div { width:73%; aspect-ratio:1; display:grid; place-content:center; text-align:center; border-radius:50%; background:white; padding:8px; overflow-wrap:anywhere; }
.stats-donut span { color:var(--muted); font-size:12px; }
.stats-donut strong { font-size:17px; }
.ledger-stats .stats-category { grid-template-columns:12px minmax(0,1fr) auto; }
.stats-category i { border-radius:100%; width:10px; height:10px; }
.stats-category strong { overflow-wrap:anywhere; }
.stats-table-wrap { overflow-x:auto; }
.stats-table { width:100%; border-collapse:collapse; font-size:13px; margin:10px 0; }
.stats-table :is(td,th) { padding:8px 4px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.stats-table :is(td,th):first-child { text-align:left; }
.stats-table tbody th { font-weight:600; }
@keyframes stats-rise { from { transform:scaleY(.05); opacity:.4; } }

.ledger { background:#f9fbff; }
.ledger-view-switch { width:100%; max-width:400px; display:flex; background:#e9eef7; }
.ledger-view-switch button { flex:1; }
.ledger-stats { grid-template-columns:minmax(0,1fr); gap:12px; }
.ledger-stats .asset-section { min-width:0; padding:clamp(12px,2.7vw,20px); background:white; }
.stats-controls { padding:8px; border-radius:15px; border:1px solid #e6edf7; background:white; }
.stats-period strong { min-width:78px; text-align:center; font-variant-numeric:tabular-nums; }
.ledger-stats .stats-summary { color:white; background:linear-gradient(132deg,#253958,#3f628c); border-color:#3b5780; }
.stats-summary .stats-totals { grid-template-columns:repeat(4,minmax(0,1fr)); }
.stats-summary .stats-totals > div { background:#ffffff12; padding:10px; }
.stats-summary .stats-total-net { background:#ffffff24 !important; }
.stats-summary .stats-totals dt { color:#e4edfc; }
.stats-summary .stats-totals dd { font-size:clamp(15px,3vw,23px); }
.stats-chart-shell { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px; align-items:start; margin-top:14px; }
#stats-axis { display:flex; flex-direction:column; justify-content:space-between; height:129px; font-size:10px; color:var(--muted); text-align:right; font-variant-numeric:tabular-nums; }
.stats-chart-scroll { min-width:0; overflow-x:auto; overscroll-behavior-inline:contain; padding-bottom:3px; }
.stats-trend { margin:4px 0 0; background:repeating-linear-gradient(to bottom,#edf1f8 0 1px,transparent 1px 30px); background-size:100% 121px; background-repeat:no-repeat; }
.stats-column[aria-pressed=true] { background:#eaf0fa; }
.stats-column:focus-visible { outline-offset:-2px; }
.stats-trend-detail { padding:8px 10px; border-radius:9px; background:#edf3fd; color:#3b5176; }
.stats-donut { width:min(155px,100%); }
.stats-share-track { display:block; height:4px; margin-top:5px; border-radius:99px; background:#edf1f8; overflow:hidden; }
.stats-share-track span { display:block; height:100%; border-radius:inherit; }
.stats-report-title { letter-spacing:-.02em; }
.stats-table thead { color:#4d6081; background:#f1f5fc; }
.stats-table tbody tr:last-child { background:#f6f8fc; font-weight:650; }
@media(min-width:840px) {
  .ledger-stats { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); }
  .stats-controls,.stats-summary,.stats-trend-card { grid-column:1/-1; }
}
@media(max-width:650px) {
  .stats-summary .stats-totals { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stats-daily { min-width:650px; }
  .stats-trend-card .section-head { align-items:center; flex-wrap:wrap; }
}
