[hidden]{display:none!important}
/* Shared state tokens keep both themes coherent without changing business logic. */
:root{color-scheme:light;--surface-soft:#eff6f3;--surface-input:#fbfcfc;--surface-selected:#e2f4eb;--danger-soft:#fff1f4;--success-soft:#e6f5ec;--action:#09825b;--on-action:#fff;--text:var(--ink)}
:root[data-theme="dark"]{--surface-soft:#22383c;--surface-input:#102126;--surface-selected:#183c2d;--danger-soft:#402731;--success-soft:#183c2d;--action:#09825b;--on-action:#fff}
html body :is(.empty,.modal-head,.draft-totals,.segmented button.active,.icon-btn,.saas-onboarding-example){background:var(--card);color:var(--ink);border-color:var(--line)}
html body :is(.filter,.danger-outline){background:var(--card);border-color:var(--line)}
html body .filter{color:var(--muted)}
html body .filter.active{background:var(--action);color:var(--on-action);border-color:var(--action)}
html body .danger-outline{color:var(--red);background:var(--danger-soft)}
html body :is(.segmented,.profile-icon,.metric-icon,.saas-template,.insight,.delete-preview>div,.track,.input-modes){background:var(--surface-soft)}
html body :is(.login-error:not(:empty),.period-error:not(:empty),.dot.expense,.metric-icon.out){background:var(--danger-soft);color:var(--red)}
html body :is(.dot.income,.nav button.active){background:var(--surface-selected);color:var(--green)}
html body :is(.secondary:hover,.filter:not(.active):hover,.nav button:hover){background:var(--surface-soft);color:var(--ink)}
html body :is(.filter,.primary,.secondary,.danger-outline):disabled{opacity:.55;cursor:not-allowed}
html body .control{border-color:var(--line);color:var(--ink);background:var(--surface-input);color-scheme:inherit}
html body .control::placeholder{color:var(--muted);opacity:1}
html body .text-action{color:var(--green)}
html body .quantity-control button:not([data-plus]){background:var(--surface-soft);color:var(--ink)}
html body :is(.quick-card,#quickSummary,.card-sale-preview,.cash-summary,.cash-close-summary){background:var(--card);color:var(--ink);border-color:var(--line)}
html body :is(.machine-fee-panel.is-disabled,.card-machine-row.inactive){background:var(--surface-soft);color:var(--muted)}
html body :is(#quickFeeLine b,.quick-cash-change strong.red,.saas-error){color:var(--red)}
html body :is(.cash-breakdown>span,.card-machine-rates span,.machine-badge,.card-machine-empty,.report-bar-label,.report-legend,.logo-icon){background:var(--surface-soft);color:var(--ink)}
html[data-theme="dark"] body :is(.cash-help-trigger,.cash-help-bubble,.cash-help-text){background:var(--card);color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] body svg text{fill:var(--muted)}
html body .mobile-nav button.active .ui-icon{background:var(--surface-selected);box-shadow:0 0 0 7px var(--surface-selected)}
html body .period-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:end}
html body .period-controls .field{min-width:0}
html body .period-controls input[type=date]{width:100%;max-width:100%;min-width:0;min-height:50px;appearance:none;display:block}
input[type=date]::-webkit-date-and-time-value{text-align:left;min-height:1.4em}
html body .period-head{align-items:flex-start;gap:12px;flex-wrap:wrap}
html body #periodLabel{padding:5px 10px;background:var(--surface-soft);border-radius:8px;font-size:13px}
html body .login-card>.secondary{width:100%;margin-top:20px}
html body .login-card>.text-action{display:block;margin:8px auto 0;min-height:44px;text-align:center;color:var(--muted)}
.install-guide .install-illustration{display:grid;place-items:center;gap:12px;min-height:130px;padding:20px;background:var(--surface-soft);border:1px solid var(--line);border-radius:16px;margin:20px 0}
.install-illustration>span:first-child{font-size:28px;font-weight:700;color:var(--green)}
.install-touch{font-size:14px;padding:6px 12px;border:1px solid var(--green);border-radius:8px;color:var(--ink)}
.install-guide #installLater{width:100%;margin-top:8px}
@media(max-width:760px){html body .main{padding-top:calc(26px + env(safe-area-inset-top))}html body #home .top{gap:12px;align-items:flex-start}html body #home .top .pill{flex:none}html body .period-controls{gap:12px}html body .period-controls button{width:100%;font-size:13px;padding-inline:8px}}
@media(max-width:350px){html body .period-controls{grid-template-columns:minmax(0,1fr)}}
.password-control{display:block;isolation:isolate}
.password-control .control{width:100%;padding-right:54px!important}
.password-control .password-eye{display:grid!important;visibility:visible!important;opacity:1!important;z-index:2;flex:none;margin:0!important}
.password-control .password-eye:active{transform:translateY(-50%)}
.confirmation-panel{min-width:0;margin-top:20px}
.confirmation-panel .chat{height:auto;max-height:none;overflow:visible;padding:0}
.confirmation-panel .msg{max-width:100%;width:100%;margin:0;overflow-wrap:anywhere}
.theme-choice{padding:16px}
.tap-feedback{filter:brightness(.92)}
.split-controls{display:grid;gap:12px;margin:16px 0}
.split-controls>label{display:flex;gap:10px;align-items:center;min-height:44px}
.split-part{border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:12px;min-width:0}
.split-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}
.split-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.split-grid .field{min-width:0}.split-grid .control{width:100%;min-width:0;box-sizing:border-box}
.split-controls button,.split-controls input,.split-controls select{min-height:44px}
.payment-breakdown .sale-item{flex-wrap:wrap}
@media(max-width:360px){.split-grid{grid-template-columns:1fr}}
.mobile-nav{width:100%;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;box-sizing:border-box;padding-inline:0}
.mobile-nav button{min-width:0;width:100%;padding-inline:0;font-size:clamp(8px,2.3vw,12px);font-weight:500;line-height:1.2;gap:5px;transform:none}
.mobile-nav button.active{font-size:clamp(8px,2.3vw,12px);font-weight:500;transform:none}
.mobile-nav button>span{white-space:nowrap}
.mobile-nav .central-add>span:first-child{display:grid;place-items:center;background:var(--green);color:white;width:44px;height:44px;border-radius:14px;font-size:30px;line-height:1}
@media(min-width:761px){.mobile-nav{display:none}}
:root[data-theme="dark"]{color-scheme:dark;--bg:#101b20;--card:#1a292f;--ink:#edf5f4;--text:#edf5f4;--muted:#b1c4c9;--green:#53d5a0;--green2:#25ae7c;--red:#ff869e;--line:#35484e;--shadow:none;--dark:#0a1816}
html[data-theme="dark"] #home .metric{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] #home .metric .label{color:var(--muted)}
[data-theme="dark"] body,[data-theme="dark"] .main{background:var(--bg);color:var(--ink)}
[data-theme="dark"] :is(.card,.ledger-surface,.period-summary>div,dialog,.login-card,.expired-card,.quick-item,.catalog-row,.row,.sale-group,.draft,.report-section,.report-card,.mobile-nav,.organized-section,.control,.secondary,.saas-dialog,.cash-panel,.card-sale-panel,.cash-received-panel,.compose-panel){background:var(--card);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(input,textarea,select){background:#102126;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(p,small,label,dt,.label,.subheading,.catalog-muted,.payment-label,.tx-copy>span){color:var(--muted)}
[data-theme="dark"] :is(.green,.amount.green,.report-total){color:var(--green)}
[data-theme="dark"] :is(.red,.amount.red,.login-error){color:var(--red)}
[data-theme="dark"] .primary{background:#09825b;color:white}
[data-theme="dark"] :is(.sale-detail,.quick-line,.quick-total,.setting-info,.report-rank,.report-insights,.report-empty,.message,.bot,.metric,.pill,.saas-template,.payment-options label,.type-filters button){background:var(--card);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .mobile-nav button{color:var(--muted)}
[data-theme="dark"] .mobile-nav button.active{color:var(--green)}
[data-theme="dark"] .password-eye{color:var(--muted)}
[data-theme="dark"] :is(.card-machine-row,.card-machine-row.inactive,.cash-summary,.cash-session,.cash-help-panel,.machine-fee-panel,.report-change,.report-rank-number,.report-track,.payment-options label:has(input:checked)){background:#22383c;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] #reports :is(.report-change,.neutral,#serviceRank,#productRank,.report-insights){background:#22383c;color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] #reports .positive{background:#183c2d;color:#7dedb8}
html[data-theme="dark"] #reports .negative{background:#402731;color:#ff9aaf}
html[data-theme="dark"] #reports :is(.report-track,.report-rank-number){background:#30464b;color:var(--ink)}
[data-theme="dark"] :is(.cash-help-bubble,.cash-help-text,.cash-current,.card-sale-machine-note,.admin-dialog,.admin-shell .card,.saas-welcome,.catalog-kind){background:var(--card);color:var(--ink)}
