:root {
  color-scheme: light;
  --ink: #122940; --muted: #526579; --navy: #10283f; --teal: #185e64;
  --gold: #efc982; --line: #d7dfe3; --surface: #fff; --page: #f3f6f7;
  --serif: "STIX Two Text", "Baskerville", "Georgia", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font: 100%/1.45 var(--sans); background: var(--page); color: var(--ink);
  font-synthesis: none; -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box }
body, figure, h1, h2, p { margin: 0 }
body { min-width: 290px }
button, input, select { font: inherit }
button, a, input, select { -webkit-tap-highlight-color: transparent }
button { cursor: pointer; color: inherit }
button:disabled, input:disabled { cursor: default }
a { color: var(--teal) }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #399caa; outline-offset: 3px }
button { border: 0 }
[hidden] { display: none !important }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0 }
.icon { width: 1.18em; height: 1.18em; flex: none; vertical-align: middle }
.brand, .header-meta, .login-footer span, .photo-caption, .eyebrow, .button, .icon-button, .nav-link, .account, .city-chip, .badge, .section-head, .actions, .notice { display: flex; align-items: center }
.brand { gap: .75rem; color: inherit; text-decoration: none; flex: none }
.brand-mark { display: grid; place-items: center; width: 2.85rem; height: 3.1rem; color: var(--gold) }
.brand-mark .icon { width: 100%; height: 100%; stroke-width: 1.15 }
.brand-name { font: 600 1.03rem/1.12 var(--serif); letter-spacing: .035em }
.login-shell { color: #fff9eb; min-height: 100svh; background: radial-gradient(ellipse at 34% 64%,#16344c 0,transparent 58%), #0d2339; display: flex; flex-direction: column; isolation: isolate; overflow: hidden; }
.login-header, .login-main, .login-footer { width: min(91%, 1450px); margin-inline: auto }
.login-header, .login-footer, .topbar { display: flex; align-items: center; justify-content: space-between }
.login-header { padding: clamp(1.05rem,2.1vh,2rem) 0; border-bottom: 1px solid #d5c89838; }
.login-header .brand-name { font-size: 1.14rem }
.header-meta { gap: .55rem; color: #dae3e8; font-size: .88rem; letter-spacing: .02em }
.header-meta .icon { color: var(--gold) }
.login-main { display: grid; grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); gap: clamp(2.5rem,5vw,7.5rem); flex: 1; align-items: center; padding: clamp(2.3rem,5.5vh,5rem) 0; }
.login-panel { width: min(100%, 29.5rem); padding-left: clamp(0rem,2.3vw,2.25rem); }
.eyebrow { gap: .7rem; font-weight: 650; letter-spacing: .095em; font-size: .79rem; text-transform: uppercase; }
.login-panel .eyebrow { color: var(--gold) }
.eyebrow-rule, .caption-line { width: 2rem; height: 1px; background: currentColor; flex: none; }
.login-panel h1 { font: 500 clamp(4.4rem,7.2vw,7.65rem)/.87 var(--serif); letter-spacing: -.055em; margin: 1.7rem 0 1.7rem; }
.login-panel h1 em { font-family: Georgia, var(--serif); font-weight: 400; color: #f0cf93; }
.intro { color: #d8e3e7; max-width: 24rem; line-height: 1.55; font-size: clamp(1rem,1.23vw,1.15rem); }
.form-stack { display: grid; gap: .9rem }
.login-form { margin-top: 2.15rem; width: min(100%,23rem); gap: .6rem }
.field { display: grid; gap: .4rem; min-width: 0 }
.field > span { font-weight: 630; font-size: .93rem }
.input { display: block; width: 100%; min-width: 0; border: 1px solid #aebcc6; background: white; border-radius: .6rem; padding: .68rem .85rem; color: var(--ink); min-height: 2.92rem; }
.input::placeholder { color: #667987; opacity: 1 }
select.input { appearance: none; padding-right: 2.3rem; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23314a5e' stroke-width='1.5'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E") right .9rem center / .92rem no-repeat; }
input[type=radio] { accent-color: var(--teal) }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 3rem; color: #fff9eb; border: 1px solid #758490; background: #e8f4ff0a; height: 3.25rem; }
.password-wrap input::placeholder { color: #bcc9d0 }
.password-wrap .icon-button { position: absolute; right: .15rem; top: 50%; transform: translateY(-50%); color: #e1eaec; }
.button, .icon-button, .nav-link { justify-content: center; gap: .5rem; border-radius: .6rem; transition: background .15s, box-shadow .15s; }
.button { min-height: 2.7rem; line-height: 1.25; padding: .65rem 1rem; font-weight: 620; font-size: .95rem; }
.button.primary { color: #fff; background: var(--teal); border: 1px solid transparent }
.button.primary:hover:enabled { background: #10494e }
.button.secondary { background: #fff; color: var(--ink); border: 1px solid #bcc9d0 }
.button.secondary:hover:enabled { background: #edf2f4 }
.button.quiet { color: var(--teal); background: transparent; padding-inline: .5rem }
.button.quiet:hover:enabled { background: #e4efed }
.button:disabled { color: #546571; background: #e1e7eb; border-color: transparent }
.icon-button { border: 0; background: transparent; color: inherit; width: 2.7rem; height: 2.7rem; }
.icon-button:hover { background: #819ba41c }
.login-submit.button { background: #edc786; color: #172d40; min-height: 3.25rem; width: 100%; margin-top: .13rem; }
.login-submit.button:enabled:hover { background: #f9d99d }
.form-error:empty { display: none }
.login-art { position: relative; isolation: isolate; width: 100%; height: clamp(27rem,67vh,49rem); overflow: hidden; border-radius: clamp(4rem,9vw,10rem) .9rem .9rem .9rem; outline: 1px solid #ffe4ab45; outline-offset: 5px; background: #1b2c38; }
.login-art::after { content: ""; position: absolute; inset: 56% 0 0; background: linear-gradient(transparent,#071621b0); pointer-events: none; z-index: 0 }
.login-art img, .hero-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 64% 52%; }
.photo-caption { position: absolute; z-index: 1; bottom: 1.45rem; left: 1.7rem; gap: .7rem; font: italic 1.35rem var(--serif); color: #fff6dd }
.caption-line { width: 1.6rem; color: var(--gold) }
.login-footer { border-top: 1px solid #d5c89838; padding: 1.1rem 0 1.25rem; gap: 1rem; color: #b7c8d3; font-size: .86rem; }
.login-footer span { gap: .5rem }
.login-footer .icon { color: #d1b582 }
.login-footer i { font-style: normal }
.topbar { padding: .8rem max(4.5vw,calc((100vw - 90rem)/2)); min-height: 4.7rem; background: var(--navy); color: #f8f2e5; gap: 1.5rem; border-bottom: 3px solid #c09a5e; }
.topbar .brand-mark { width: 2.2rem; height: 2.6rem }
.main-nav, .account { display: flex; gap: .45rem }
.nav-link { padding: .65rem .95rem; background: transparent; color: #d4e0ea; font-size: .94rem; font-weight: 550; }
.nav-link[aria-current=page] { background: #2b4357; color: #ffdb9a }
.nav-link:hover { background: #273f54 }
.city-chip { gap: .35rem; font-size: .9rem; white-space: nowrap }
.city-chip .icon { color: var(--gold) }
.account .quiet { color: #d5e0e9; margin-left: .55rem; border-left: 1px solid #72849460; border-radius: 0; padding-left: .9rem }
.account .quiet:hover:enabled { background: #233e55 }
.workspace { width: min(91%,90rem); margin: 1.5rem auto 3rem; }
.page-hero, .report-banner { position: relative; isolation: isolate; background: var(--navy); color: #fff8e9; border-radius: 1rem; overflow: hidden; display: flex; min-height: 10.1rem; }
.hero-copy { z-index: 1; width: 68%; padding: 1.5rem 2rem; }
.hero-copy h1, .page-heading h1 { font: 500 clamp(2.65rem,4vw,4.35rem)/1.08 var(--serif); letter-spacing: -.045em; margin: .35rem 0; }
.hero-copy .eyebrow { color: var(--gold); font-size: .77rem }
.hero-copy p { font-size: 1rem; color: #d5e0e7 }
.hero-art { position: absolute; top: 0; right: 0; height: 100%; width: 43%; z-index: 0; }
.hero-art img { object-position: 62% 48% }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 0, #10283fa6 16%, transparent 55%); }
.workspace { max-width: 82rem; }
.report-banner { min-height: 9.3rem; margin-bottom: 1.15rem; }
.panel { min-width: 0; padding: clamp(1rem, 2vw, 1.55rem); background: white; border: 1px solid var(--line); border-radius: .9rem; }
.section-head { justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel h2, .dialog-header h2, .group-head h2, .group-head h3 { margin: 0; font: 550 clamp(1.45rem,2.1vw,1.9rem)/1.16 var(--serif); letter-spacing: -.025em; }
.section-head h3 { font: 620 1.08rem var(--sans); }
.report-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(18rem, .85fr); gap: 1.15rem; align-items: start; }
.report-main, .report-aside { min-width: 0; display: grid; align-content: start; gap: 1rem; }
.report-aside { position: sticky; top: .8rem; }
.report-controls { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1.2rem; }
.report-controls > .field { flex: 1 1 15rem; }
.report-controls .report-date { flex: 0 1 12rem; }
.report-date input { min-width: 10rem; }
.input:read-only, .input:disabled { background: #f2f5f6; color: #435b69; opacity: 1; }
input[type=number] { font-variant-numeric: tabular-nums; }
.report-group { scroll-margin-top: .8rem; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .85rem; }
.group-head > .icon, .group-head h2 .icon, .group-head h3 .icon { color: #a16c32; }
.row-labels, .item-row { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(5.7rem, .32fr) minmax(5.2rem, .32fr) minmax(4.5rem, .31fr); gap: .65rem; align-items: center; }
.row-labels { padding: .5rem .3rem; border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 590; color: var(--muted); }
.row-labels > :not(:first-child) { text-align: right; }
.item-row { min-height: 3.2rem; padding: .35rem .3rem; border-bottom: 1px solid #e4e9ec; }
.item-row:last-child { border-bottom: 0; }
.item-name { font-weight: 570; line-height: 1.27; }
.item-price, .item-subtotal { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-price { color: #526977; font-size: .92rem; }
.item-subtotal { font-weight: 620; }
.qty-input, .price-input { justify-self: end; width: min(100%, 5.2rem); min-height: 2.45rem; height: 2.45rem; border-radius: .5rem; border: 1px solid #b5c5ce; background: #f9fbfb; padding: .35rem .5rem; text-align: right; color: #172f43; }
.qty-input:focus, .price-input:focus { background: white; }
.price-field { justify-self: end; position: relative; width: min(100%, 6.5rem); }
.price-field .price-input { width: 100%; padding-right: 1.4rem; font-variant-numeric: tabular-nums; }
.price-field > span { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.daily-amount-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(4.5rem,5.2rem) minmax(7.5rem,9rem); align-items: end; gap: .65rem; padding: .8rem .3rem .35rem; }
.daily-amount-row .item-name { align-self: center; grid-area: auto; }
.daily-amount-row label { display: grid; justify-items: end; gap: .25rem; min-width: 0; font-variant-numeric: tabular-nums; }
.daily-amount-row label > span:first-child { color: var(--muted); font-size: .875rem; }
.daily-amount-row .input { min-width: 0; width: 100%; height: 2.45rem; min-height: 2.45rem; padding: .35rem .5rem; border-radius: .5rem; text-align: right; grid-area: auto; }
@media (max-width: 420px) {
  .daily-amount-row { grid-template-columns: minmax(0,1fr) 4.65rem 7.5rem; gap: .35rem; padding-inline: .1rem; }
}
.report-status, .badge { display: inline-flex; align-items: center; gap: .35rem; width: max-content; max-width: 100%; color: #485e6b; background: #edf2f4; font-weight: 600; font-size: .85rem; border-radius: 2rem; padding: .25rem .65rem; }
.report-status.submitted, .report-status[data-status=submitted] { color: #245c4e; background: #e0efe7; }
.report-status.draft, .report-status[data-status=draft] { color: #80531e; background: #fcf1d8; }
.amount-fields, .cash-fields { display: grid; gap: .75rem; }
.amount-fields .field span, .cash-fields .field span { line-height: 1.3; }
.report-summary { border-top: 3px solid #bd975d; }
.summary-line { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid #e2e8eb; }
.summary-line > :last-child { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-weight: 640; }
.report-difference { color: #385969; background: #f0f5f6; border-radius: .6rem; padding: .7rem .8rem; margin: .55rem 0; line-height: 1.4; }
.report-difference[data-match=true], .report-difference.match { background: #e9f4ed; color: #24583d; }
.report-difference[data-match=false], .report-difference.mismatch { background: #fff3da; color: #754d15; }
.report-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.report-aside .report-actions { display: grid; }
.print-only { display: none; }
.history-list { display: grid; }
.history-row { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; gap: .6rem 1.1rem; padding: 1rem .25rem; border: none; border-bottom: 1px solid var(--line); color: var(--ink); background: white; }
.history-row:last-child { border: 0; }
.history-row strong, .history-row small { display: block; }
small,.muted,.field-hint { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.page-heading { margin: 1.3rem 0; }
.page-heading .eyebrow { color: var(--teal); }
.page-heading p, .dialog-intro { color: var(--muted); }
.dialog { border: 1px solid #bac9d0; color: var(--ink); width: min(92vw,31rem); max-height: 90svh; padding: 1.35rem; border-radius: 1rem; box-shadow: 0 1.5rem 7rem #061c3940; }
.dialog::backdrop { background: #0618279e; backdrop-filter: blur(3px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: -.25rem -.25rem .75rem 0; }
.actions { justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.notice, .error { padding: .72rem .85rem; margin: 0 0 .7rem; border-radius: .55rem; gap: .6rem; font-size: .94rem; overflow-wrap: anywhere; }
.notice { color: #205844; background: #e2f1e7; }
.notice.pending { justify-content: space-between; color: #734f12; background: #faf0d7; }
.error { background: #fbeded; color: #893544; border: 1px solid #e3bdc2; }
.login-form .error, .form-error .error { margin: 0; }
.empty { padding: 1.2rem; color: var(--muted); }
.loading, .load-failed { margin: 3rem auto; max-width: 34rem; text-align: center; }

@media (max-width: 900px) {
  .login-main { gap: 3rem; grid-template-columns: 1fr 1fr; }
  .login-panel { padding-left: 0; }
  .login-panel h1 { font-size: clamp(4rem,8vw,5.3rem); }
  .topbar { flex-wrap: wrap; gap: .5rem; padding: .65rem 4.5vw .4rem; }
  .main-nav { order: 3; width: 100%; }
  .nav-link { flex: 1; }
  .workspace { width: 94%; }
  .report-layout { grid-template-columns: minmax(0, 1.55fr) minmax(14.5rem, .8fr); gap: .7rem; }
  .row-labels, .item-row { grid-template-columns: minmax(6.7rem,1fr) 5.7rem 4.4rem minmax(3.6rem,auto); gap: .35rem; }
}
@media (max-width: 735px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-aside { position: static; }
  .report-controls > .field { flex-basis: 12rem; }
}
@media (max-width: 660px) {
  .login-header,.login-main,.login-footer { width: 88%; }
  .login-main { grid-template-columns: 1fr; gap: 1.8rem; padding: 2rem 0 1.3rem; }
  .login-panel { width: 100%; }
  .login-panel .eyebrow { font-size: .75rem; }
  .login-panel h1 { font-size: clamp(3.25rem,12.5vw,4.8rem); line-height: .96; margin: .85rem 0; }
  .intro { font-size: 1rem; max-width: 100%; }
  .login-form { margin-top: 1.3rem; width: 100%; }
  .login-art { height: clamp(10.3rem,30vh,16.3rem); border-radius: 2.6rem .7rem .7rem .7rem; outline-offset: 3px; }
  .login-art img { object-position: 50% 48%; }
  .photo-caption { font-size: 1.08rem; bottom: .7rem; left: .85rem; }
  .login-footer { margin-top: auto; font-size: .81rem; padding: .9rem 0; }
  .login-footer span:last-child { display: none; }
  .login-header .brand-name { font-size: .94rem; }
  .login-header .brand-mark { width: 2.1rem; height: 2.6rem; }
  .header-meta { font-size: .8rem; }
  .workspace { width: 94%; margin: .75rem auto 1.5rem; }
  .topbar { padding-inline: 3%; }
  .topbar .brand { gap: .35rem; }
  .topbar .brand-name { font-size: .84rem; }
  .topbar .brand-mark { width: 1.85rem; }
  .city-chip, .account .button { font-size: .83rem; }
  .account { gap: 0; }
  .account .quiet { padding: .35rem; margin: .2rem; }
  .main-nav { gap: .2rem; }
  .nav-link { font-size: .93rem; padding: .62rem .4rem; }
  .hero-copy { padding: 1rem; width: 73%; }
  .hero-copy h1 { font-size: clamp(2.3rem,8vw,3rem); }
  .hero-copy p { font-size: .9rem; }
  .page-hero, .report-banner { min-height: 8rem; }
  .panel { padding: .9rem; }
  .item-row { grid-template-columns: minmax(0,1fr) 4.7rem 4.3rem; grid-template-areas: 'name qty subtotal' 'price qty subtotal'; gap: .25rem .35rem; padding: .55rem .1rem; }
  .item-name { grid-area: name; }
  .item-price { grid-area: price; text-align: left; font-size: .84rem; }
  .price-field { grid-area: price; justify-self: start; width: min(100%, 9.2rem); display: flex; align-items: center; gap: .35rem; }
  .price-field::before { content: 'Цена'; color: var(--muted); font-size: .875rem; }
  .qty-input { grid-area: qty; }
  .item-subtotal { grid-area: subtotal; }
  .row-labels { display: none; }
  .report-controls { gap: .65rem; }
  .report-controls > .field { flex-basis: 100%; }
  .report-controls .report-date { flex-basis: 100%; }
  .history-row { flex-wrap: wrap; }
  .notice.pending { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 370px) {
  .header-meta { display: none; }
  .account .quiet { font-size: 0; }
  .account .quiet .icon { width: 1.1rem; height: 1.1rem; }
  .item-row { grid-template-columns: minmax(0,1fr) 3.5rem 3.6rem; }
}
@media print {
  @page { margin: 14mm; }
  :root, body { background: #fff; color: #111; font: 10pt/1.35 Arial,sans-serif; }
  .no-print, .topbar, .report-banner, .report-actions, .screen-only, dialog, .sr-only, #feedback { display: none !important; }
  .print-only { display: block; }
  .workspace { width: 100%; margin: 0; }
  .report-layout, .report-aside { display: block; position: static; }
  .report-main { gap: .4rem; }
  .panel { border: none; box-shadow: none; padding: .2rem 0; }
  .group-head, h2, h3 { break-after: avoid; }
  .item-row, .summary-line { break-inside: avoid; }
  .row-labels, .item-row { grid-template-columns: 1fr 6rem 5rem 6rem; }
  .item-row[data-empty=true] { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }

.report-controls { margin-bottom: .85rem; }
.report-state { display: grid; align-content: center; gap: .3rem; min-height: 2.92rem; }
.report-state .muted:empty { display: none; }
.report-jumps { display: flex; align-items: center; gap: .3rem; margin: .25rem 0 .85rem; overflow-x: auto; }
.report-jumps a { flex: 0 0 auto; padding: .38rem .66rem; color: #355a67; font-size: .9rem; font-weight: 580; text-decoration: none; border: 1px solid #cbd8dc; border-radius: 2rem; background: #fff; }
.report-jumps a:hover { background: #e8f1ee; }
.group-head h2 { display: flex; gap: .55rem; align-items: center; }
.group-head .icon { width: 1.75rem; height: 1.75rem; padding: .26rem; border-radius: .42rem; background: #fbefda; }
[data-category=caramel] .group-head .icon { color: #944856; background: #fbebea; }
[data-category=other] .group-head .icon { color: #316a6b; background: #e5f1ee; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list > li + li { border-top: 1px solid var(--line); }
.history-date { flex: 1; }
.history-total { min-width: 6rem; text-align: right; }
.history-row:hover { background: #f3f8f6; }
.report-print { display: none; }
.report-main, .report-aside { align-self: start; }
@media (max-width: 660px) {
  .report-state { min-height: unset; }
  .row-labels { display: grid; grid-template-columns: minmax(0,1fr) 4.7rem 4.3rem; gap: .35rem; padding-inline: .1rem; }
  .row-labels span:nth-child(2) { display:none; }
  .row-labels span:nth-child(3) { font-size: .78rem; }
  .history-total { min-width: 4.3rem; }
}
@media (max-width: 370px) {
  .row-labels { grid-template-columns: minmax(0,1fr) 3.5rem 3.6rem; }
  .report-jumps a { font-size: .84rem; padding-inline: .5rem; }
}
@media print {
  #daily-report, .report-jumps { display: none !important; }
  #report-print:not([hidden]) { display: block; color: #101f2a; }
  .print-heading { border-bottom: 1.5pt solid #334f60; padding-bottom: .4rem; margin-bottom: .6rem; }
  .print-heading h1, .print-heading h2 { font: 600 18pt/1.1 Georgia,serif; margin: .35rem 0; }
  .print-heading p, .print-heading small { font-size: 10pt; }
  .print-table { width: 100%; border-collapse: collapse; margin: .4rem 0 .8rem; }
  .print-table th, .print-table td { text-align: right; padding: .28rem .3rem; border-bottom: 1px solid #c8d2d6; }
  .print-table th:first-child, .print-table td:first-child { text-align:left; }
  .print-table thead { display: table-header-group; }
  .print-table tr, .print-facts > div { break-inside: avoid; }
  .print-facts { margin: .4rem 0; }
  .print-facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .24rem 0; border-bottom: 1px solid #d5dadb; }
  .print-facts dd { font-weight: bold; margin: 0; }
}

.viewer-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.viewer-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.viewer-filters .tab, .viewer-filters button { min-height: 2.7rem; font-size: .95rem; font-weight: 580; color: var(--ink); background: #f3f6f7; border: 1px solid #d5dfe2; border-radius: .6rem; padding: .5rem .85rem; }
.viewer-filters [aria-pressed=true] { border-color: #347b79; background: #e6f0ed; color: #174e50; }
.viewer-date { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .55rem; }
.viewer-date input[type=date] { min-width: 10.1rem; }
.viewer-columns { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 24rem),1fr)); gap: 1rem; align-items: start; }
.viewer-city .section-head { padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.viewer-city .empty { color: var(--muted); padding: 1rem .1rem; }
.viewer-city .history-list { margin: -.25rem 0 0; }
.viewer-report-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem; }
.viewer-city .history-row { min-width: 0; gap: .45rem .6rem; flex-wrap: wrap; }
.viewer-city .history-date { min-width: min(100%, 7.5rem); overflow-wrap: anywhere; }
.viewer-quick-edit { padding: .5rem .65rem; min-height: 2.5rem; border: 1px solid #aac2c3; border-radius: .5rem; background: #f1f7f6; color: #185e64; font-weight: 600; }
.viewer-quick-edit:hover { background: #e0eeeb; }
.viewer-city .history-total { min-width: auto; }
.viewer-city .history-row:focus-visible { outline-offset: -2px; }
.viewer-detail { display: grid; gap: .85rem; }
.viewer-detail-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .75rem; }
.viewer-facts { margin: .5rem 0; }
.viewer-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--line); padding: .55rem 0; }
.viewer-facts > div:last-child { border-bottom: none; }
.viewer-facts dt { color: var(--muted); }
.viewer-facts dd { flex: 0 0 auto; max-width: 54%; margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.viewer-detail .print-heading { margin-bottom: 1rem; }
.viewer-detail .print-table { margin-bottom: 1.15rem; }
.viewer-detail table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.viewer-detail th, .viewer-detail td { padding: .61rem .4rem; border-bottom: 1px solid var(--line); text-align: right; }
.viewer-detail th:first-child, .viewer-detail td:first-child { text-align: left; }
.viewer-detail thead th { color: var(--muted); font-weight: 600; font-size: .87rem; }
.viewer-detail td:not(:first-child) { white-space: nowrap; }
.viewer-detail .table-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 660px) {
  .viewer-controls { align-items: stretch; }
  .viewer-date { width: 100%; }
  .viewer-filters .tab, .viewer-filters button { padding: .5rem .65rem; font-size: .9rem; }
  .viewer-detail td, .viewer-detail th { font-size: .86rem; padding: .46rem .23rem; }
  .viewer-detail caption { text-align: left; }
}
@media print {
  .viewer-screen, .viewer-detail-actions { display: none !important; }
}
