:root {
  color-scheme: light;
  --canvas: #f5f6ef;
  --paper: #fff;
  --ink: #172b26;
  --muted: #4a6057;
  --line: #cdd9ce;
  --pine: #183a32;
  --green: #18705c;
  --green-wash: #e6f4ea;
  --gold: #f7ed92;
  --error: #842e24;
  --error-wash: #fff0e8;
  --focus: #1d568d;
  --radius: 14px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, p, dl, dd, ul { margin: 0; }
h1, h2 { line-height: 1.12; color: var(--pine); text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.05em; }
h2 { font-size: clamp(1.18rem, 2.8vw, 1.48rem); letter-spacing: -.026em; }
p { overflow-wrap: anywhere; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--pine); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
[role="list"] { list-style: none; padding: 0; }
.shell { width: min(100% - 2.25rem, 68rem); margin-inline: auto; }
.main { flex-grow: 1; padding-block: 2rem 3rem; }
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-inner { min-height: 4.65rem; display: flex; align-items: center; gap: clamp(.6rem, 2.5vw, 2.5rem); }
.brand { display: inline-flex; gap: .55rem; align-items: center; text-decoration: none; font-weight: 850; letter-spacing: -.035em; font-size: 1.35rem; }
.brand img { flex: 0 0 auto; display: block; }
.main-nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.main-nav a, .subtle { padding: .62rem .72rem; border-radius: 8px; text-decoration: none; font-weight: 650; color: var(--muted); line-height: 1.3; min-height: 44px; display: inline-flex; align-items: center; }
.main-nav a:hover, .subtle:hover { background: var(--canvas); color: var(--pine); }
.main-nav a[aria-current] { background: var(--green-wash); color: var(--pine); }
.subtle { border: none; background: transparent; }
.logout { margin-left: auto; }
.foot { border-top: 1px solid var(--line); color: var(--muted); padding-block: 1rem 1.35rem; font-size: .86rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 1; padding: .55rem; background: var(--paper); transform: translateY(-180%); }
.skip:focus { transform: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; color: var(--green); font-size: .78rem; font-weight: 800; margin: 0 0 .45rem; }
.meta, .intro > div:first-child > p:last-child, .range-label, .chart-note, .flow small { color: var(--muted); }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, auto); align-items: end; gap: 1.3rem; margin-bottom: 1.5rem; }
.intro h1 + p, .range-label, .welcome h1 + p { margin-top: .55rem; }
.daily { min-width: 0; border-top: 4px solid var(--gold); border-radius: var(--radius); padding: .65rem 1.05rem .85rem; background: var(--pine); color: #fff; display: flex; flex-direction: column; font-size: .85rem; }
.daily strong { color: var(--gold); font-weight: 820; font-size: clamp(1.55rem, 4vw, 2.3rem); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; list-style: none; padding: 0; margin-bottom: 1.6rem; }
.category-grid li { min-width: 0; }
.category { min-height: 8.15rem; height: 100%; padding: .9rem 1.1rem; text-decoration: none; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.category:hover { border-color: var(--green); background: #f0f8f2; }
.category:active { background: var(--green-wash); }
.category-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .2rem; margin-bottom: .45rem; }
.product-icon { color: var(--green); flex: 0 0 auto; }
.arrow { color: var(--green); font-size: 1.15rem; line-height: 1.35; }
.category strong { font-size: 1.16rem; line-height: 1.24; overflow-wrap: anywhere; }
.category .meta { font-size: .85rem; margin-top: .25rem; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.5rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .8rem 1.15rem; margin-bottom: .95rem; }
.report-head { margin-bottom: 1.3rem; }
.button { font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .54rem .92rem; min-height: 44px; border: 1px solid transparent; border-radius: 9px; text-align: center; text-decoration: none; line-height: 1.4; }
.primary { background: var(--pine); color: white; }
.primary:hover { background: #24574a; }
.primary span { color: var(--gold); }
.outline { background: var(--paper); color: var(--pine); border-color: #9fb6a8; }
.outline:hover { background: var(--green-wash); }
.danger { background: var(--error); color: white; }
.danger:hover { background: #6d2119; }
.notice { padding: .7rem .95rem; border: 1px solid #c6b955; border-left-width: 4px; background: #fffae6; border-radius: 8px; color: #503c18; margin-bottom: 1rem; overflow-wrap: anywhere; }
.notice.good { border-color: var(--green); background: var(--green-wash); color: var(--pine); }
.notice.bad { border-color: var(--error); background: var(--error-wash); color: var(--error); }
.form-panel h1 { font-size: clamp(1.65rem, 5vw, 2.45rem); }
.form-panel h2 { margin-bottom: .8rem; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(1.4rem, 4.5vw, 4rem); width: min(100%, 50rem); margin: clamp(.7rem, 7vw, 5rem) auto; }
.welcome { padding: 1rem 0 1.2rem; border-bottom: 4px solid #d5c74d; }
.flow { width: min(100%, 34rem); margin: .25rem auto 0; }
.flow > p, .form-panel > p:not(.eyebrow, .notice, .selected) { margin-top: .75rem; }
.flow > .button { margin-top: 1rem; }
.back { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; margin-bottom: .35rem; text-decoration: none; font-weight: 700; }
.back:hover { text-decoration: underline; }
.flow-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.flow-head .product-icon { width: 3rem; height: 3rem; padding: .45rem; background: var(--green-wash); border-radius: 10px; }
.stack { display: flex; flex-direction: column; }
.stack label { font-weight: 730; margin-bottom: .3rem; }
.stack input:not([type="hidden"]), .custom-range input:not([type="hidden"]) { min-height: 48px; min-width: 0; width: 100%; background: var(--paper); color: var(--ink); font-size: 1rem; border: 1px solid #829d8b; border-radius: 8px; padding: .55rem .65rem; }
.stack input[aria-invalid] { border-color: var(--error); }
.stack input + label, .stack .button { margin-top: 1.15rem; }
.stack small { margin-top: .35rem; }
.price-input { position: relative; }
.price-input input:not([type="hidden"]) { font-size: 1.65rem; font-weight: 750; padding: .35rem 2.25rem .35rem .7rem; font-variant-numeric: tabular-nums; }
.price-input span { position: absolute; inset: .56rem .77rem auto auto; font-size: 1.32rem; color: var(--muted); pointer-events: none; }
.selected { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .2rem 1rem; background: var(--canvas); padding: .3rem .65rem; border-radius: 8px; margin-bottom: 1rem; }
.selected a { display: inline-flex; align-items: center; min-height: 44px; font-size: .88rem; font-weight: 700; }
.sale-facts { margin-top: 1.1rem; }
.sale-facts div { display: grid; grid-template-columns: 6rem 1fr; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.sale-facts dt { color: var(--muted); }
.sale-facts dd { font-weight: 650; overflow-wrap: anywhere; }
.ledger-list { border-top: 1px solid var(--line); }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: none; padding-bottom: .1rem; }
.ledger-what, .ledger-value { display: flex; flex-direction: column; min-width: 0; }
.ledger-what > strong, .money { overflow-wrap: anywhere; }
.description { color: var(--muted); font-weight: 500; }
.ledger-what small { color: var(--muted); font-size: .82rem; }
.ledger-value { align-items: end; font-variant-numeric: tabular-nums; }
.storno, .pill { font-size: .84rem; font-weight: 690; }
.storno { text-align: right; display: inline-flex; min-height: 44px; align-items: center; }
.pill { display: inline-block; padding: .15rem .5rem; background: var(--error-wash); color: var(--error); border-radius: 5px; }
.empty { color: var(--muted); padding-block: .4rem; }
.big-empty { margin-bottom: 1rem; padding: 1.1rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.25rem; justify-content: space-between; margin-bottom: 1rem; }
.period-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.period-links a { min-height: 44px; display: inline-flex; align-items: center; padding: .4rem .67rem; text-decoration: none; font-size: .91rem; border-radius: 7px; color: var(--pine); font-weight: 720; }
.period-links a:hover { background: var(--canvas); }
.period-links a[aria-current] { background: var(--green-wash); }
.custom-range { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; }
.custom-range label { min-width: 0; color: var(--muted); font-weight: 700; font-size: .84rem; }
.custom-range input:not([type="hidden"]) { display: block; margin-top: .2rem; }
.custom-range .button { min-height: 48px; }
.metrics { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: .7rem; margin-bottom: 1rem; }
.metric { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .64rem .85rem; }
.metric.key-metric { background: var(--pine); border-color: var(--pine); color: var(--gold); }
.metric dt { font-size: .84rem; font-weight: 720; color: var(--muted); }
.metric.key-metric dt { color: white; }
.metric dd { font-variant-numeric: tabular-nums; font-size: clamp(1.2rem, 4vw, 2rem); letter-spacing: -.025em; font-weight: 800; overflow-wrap: anywhere; }
.charts { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; align-items: start; }
.chart-note { margin: .3rem 0 .9rem; font-size: .9rem; }
.plot { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: .4rem; margin-top: .85rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.y-labels, .x-labels { font-size: .84rem; line-height: 1; }
.y-labels { display: flex; height: calc(9.25rem + .84rem); margin-top: -.42rem; flex-direction: column; justify-content: space-between; text-align: right; }
.plot-right { min-width: 0; }
.x-labels { display: flex; justify-content: space-between; gap: .15rem; margin-top: .45rem; }
.time-graph { width: 100%; height: 9.25rem; display: block; }
.grid-line { stroke: #b6c7bb; stroke-width: 1; }
.time-bar, .bar-fill { fill: var(--green); }
.bar-track { fill: #e3ebe3; }
.bar-list { display: flex; flex-direction: column; gap: .8rem; }
.bar-label { display: flex; justify-content: space-between; gap: .4rem; font-size: .93rem; }
.bar-label > * { min-width: 0; overflow-wrap: anywhere; }
.bar-label strong { font-variant-numeric: tabular-nums; text-align: right; }
.bar-label small { color: var(--muted); }
.category-bar { display: block; width: 100%; height: .55rem; margin-top: .15rem; }
.chart-values { margin-top: .8rem; }
.chart-values summary { display: list-item; padding: .5rem .1rem; color: var(--pine); font-weight: 700; cursor: pointer; }
.value-table { margin-top: .25rem; width: 100%; font-size: .875rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.value-table th, .value-table td { padding: .35rem .2rem; border-bottom: 1px solid var(--line); text-align: right; }
.value-table th:first-child { text-align: left; }
.pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--muted); }
@media (max-width: 50rem) {
  .charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 39rem) {
  .shell { width: min(100% - 1.45rem, 68rem); }
  .main { padding-top: 1.35rem; }
  .top-inner { gap: .3rem .65rem; padding-block: .4rem; flex-wrap: wrap; }
  .brand { font-size: 1.13rem; }
  .brand img { width: 35px; height: 35px; }
  .main-nav { order: 2; width: 100%; }
  .logout { font-size: .9rem; }
  .subtle { padding: .45rem .6rem; }
  .intro, .login-layout { grid-template-columns: minmax(0, 1fr); }
  .intro { gap: .85rem; margin-bottom: .95rem; }
  .daily { padding: .45rem .75rem .55rem; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .category { padding: .63rem .62rem; min-height: 6.75rem; }
  .category strong { font-size: 1rem; }
  .category .meta { font-size: .81rem; }
  .category-top { margin-bottom: .34rem; }
  .product-icon { width: 29px; height: 29px; }
  .metric { padding-inline: .5rem; }
}
@media (max-width: 25rem) {
  .metric.key-metric { grid-column: 1 / -1; }
  .metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .custom-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .custom-range .button { grid-column: 1 / -1; }
  .ledger-row { gap: .45rem; }
  .period-links a { padding-inline: .45rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
