/* Smart Life — light and dark mode. Loaded last on every page, after app.css and skin.css. */
/* ===== Light and dark mode (v93) =====
   The app follows the phone's Appearance setting (Light, Dark or Automatic) and switches the moment the phone does,
   with no reload. Everything is built on the color tokens in :root; the block below re-colors the few parts that
   had fixed light colors. The signature box stays white like paper in both modes, so signatures look the same. */
:root{color-scheme:light dark;--fill:#0f73c2;--surface-2:var(--sunk);--card:var(--surface);--bg2:var(--sunk)}
@media (prefers-color-scheme:dark){
:root{--fill:#1b6fbf;--accent:#7cb8ff;--ok:#22c55e;--head:#0b0f15}
body{background:var(--bg);color:var(--ink)}
.go,button.primary,.primary,a.primary,.bigbtn{background:linear-gradient(135deg,#1b78cc,#14569a)}
.sl-zoomto a.on:hover{background:#14569a}
.tabs a.on,.chip.on,.sl-zoomto a.on,.qh[aria-expanded=true]{background:var(--fill);border-color:var(--fill)}
.pill.on{color:#6ee7a0}.pill.brk{color:#fbbf6a}

pre{color:var(--ink)}
.leaflet-bar a,.leaflet-control-layers,.leaflet-control-attribution{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
.leaflet-control-attribution a{color:var(--brand)!important}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--surface);color:var(--ink)}
.tb-light.break{background:#3e3519}.tb-actions a,.tb-map summary{color:#90c6f3}
  .clock.brk{border-color:#8e7629}
  .pill.on{color:#96eeb7}
  .pill.brk{color:#f6bb8e}
  table.board td.conf{background:#3e1f19}
  .chip.off{background:#202a37;color:#a3c0e0}
  .pill.warn{background:#3e1d19;color:#f19a93}
  section.draft{border-color:#8e7029}
  tr.gap td{background:#1d283a;color:var(--muted)}
  .autofilled{background:#3e3619}
  .pill.geo{background:#3e1c19;color:#f4978f}
  label.aifill>:is(input,textarea,select){background:#3e3619;border-color:#8e7929}
  .cl-in{background:#1b3e19;color:#9fe4ac}
  .cl-out{background:#192b3e;color:#94bdf0}
  .cl-miss{background:#3e1919;color:#ed9b96}
  .cl-todo>summary{color:#f6c38e}
  .cl-ai{background:#19293e}
  .cl-ai b{color:#94bdf0}
  .cl-priv{color:#f6ce8e}
  .cl-vm{background:#3e3119;color:#f6d28e}
  .cl-vmb{background:#3e3119}
  .cl-cb.need{background:#3e3119}
  .pill.warn{background:#3e2e19;color:#f6c68e}
  .pill.ok{background:#1b3e19;color:#9fe4ac}
  .tk-urgent{background:#3e1919;color:#ed9b96}
  .tk-high{background:#3e2319;color:#f5b38f}
  .pt-unmatched{background:#3e3319;border-color:#8e7429}
  .btn.done{background:#193e29;color:#9fe4ba}
  .brknow{background:#3e3319;border-color:#8e7029;color:#f6da8e}
  .clock .btn.hot{background:#3e3119}
  .clock .btn.hot.over{background:#3e1b19}
  .brknow.up{background:#3e1b19;color:#ea9999}
  .ci-stats .due b{color:#f19a93}
  .fieldhint{color:#f19a93}
  .clock .btn.active{background:#193e29;color:#9ce7ba}
  .clock .btn.active.trav{background:#1e2b39;color:#a3bde0}
  .clock .btn.active.amber{background:#3e3319;color:#f6be8e}
  .crm-ctd{background:var(--surface)}
  .fl-list.over li{color:#ef9595}
  .ss-msg .ss-ok{color:#96eeb7}
  .ss-msg .ss-bad{color:#ef9595}
  .ss-msg .ss-info{color:#a3bbe0}
  .ss-newtag{color:#f6bb8e}
  .ss-x{color:#ef9595}
  .ss-pick{background:var(--surface)}
  .ss-row.on{background:#19293e}
  .jbar{background:#262931}
  .pt-ohi{background:var(--surface)}
  .ss-count.ok span{color:#96eeb7}
  .ss-count.off span{color:#f6bb8e}
  .ss-rc.ok{color:#96eeb7}
  .ss-rc.off{color:#f6bb8e}
  .ss-rxpick{background:#3e3619;border-color:#8e7729}
  .ss-allok{color:#96eeb7}
  .ss-back{background:var(--surface)}
  .pt-th,.ss-th{background:#202937}
  .ss-pic{background:var(--surface)}
  .pt-money span{background:#202937}
  .dsn-i{background:var(--surface)}
  .dsn-chip.ok{background:#193e25;color:#9be8bd}
  .dsn-chip.no{background:#3e1919;color:#ee9696}
  .vs-store{background:var(--surface)}
  .vs-st.ok{color:#9be8bd}
  .vs-st.bad{color:#ee9696}
  .vs-st.warn{color:#f6cb8e}
  .vs-test li.ok{color:#9be8bd}
  .vs-test li.bad{color:#ee9696}
  .vs-test li.warn{color:#f6cb8e}
  .vs-rm{color:#ee9696}
  .qh{background:var(--surface)}
  .qhx{background:#19283e;color:#9fc1e4}
  .sig-ink{background:var(--surface)}
  .btn.danger{color:#f87171;border-color:#7f2a2a}.btn.danger:hover{background:#3a1715}
  button.link.danger,details.danger summary{color:#f87171}
}
/* signature box: always white "paper" with dark ink, in light and dark mode */
.sigpad{background:#fff;color:#141a22;--ink:#141a22;--muted:#5d6b7c;--line:#d7dee8;--brand:#0f73c2;color-scheme:light}
.sigpad .muted{color:#5d6b7c}.sigpad button.link{color:#0f73c2}.sp-line{color:#6b7785}
