:root{color-scheme:light;--theme-control:#e8eadf;--theme-control-ink:#4c5937;--theme-thumb:#fffcf5}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#1b1613;--card:#2a221d;--ink:#f6ede2;--muted:#c0ada0;
  --olive:#d8af85;--olive-dark:#e5c29d;--line:#44362b;--danger:#dca49a;
  --mobile-surface:#2a221d;--mobile-muted:#c0ada0;
  --espresso-soft:#352a23;--espresso-raised:#3c2f26;--espresso-on-accent:#281c12;
  --theme-control:#44362b;--theme-control-ink:#f1d6b7;--theme-thumb:#d8af85;
}
.header-actions,.page-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0}
.theme-toggle{position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:space-between;width:76px;min-width:76px;height:44px;padding:6px;gap:4px;border:1px solid var(--line);border-radius:24px;background:var(--theme-control);color:var(--theme-control-ink);direction:ltr;touch-action:manipulation}
.theme-toggle::before{content:'';position:absolute;top:5px;left:5px;width:32px;height:32px;border-radius:50%;background:var(--theme-thumb);box-shadow:0 2px 6px #00000012;z-index:-1;transform:translateX(0)}
.theme-toggle svg{width:22px;height:22px;margin:0 4px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
[data-theme="dark"] .theme-toggle::before{transform:translateX(32px)}
[data-theme="dark"] .theme-toggle .theme-moon{color:var(--espresso-on-accent)}
.login-theme-switch{position:absolute;top:max(20px,env(safe-area-inset-top));left:20px;z-index:2}
/* Blend paint colors without moving content or interrupting input. */
html.theme-color-transition *,html.theme-color-transition *::before,html.theme-color-transition *::after{transition:background-color 700ms cubic-bezier(.4,0,.2,1),color 700ms cubic-bezier(.4,0,.2,1),border-color 700ms cubic-bezier(.4,0,.2,1),box-shadow 700ms cubic-bezier(.4,0,.2,1),transform 180ms ease,opacity 180ms ease}
html.theme-color-transition .theme-toggle::before{transition:transform 700ms cubic-bezier(.4,0,.2,1),background-color 700ms ease}

/* Dark Espresso: chocolate surfaces, cream type, caramel actions. */
[data-theme="dark"] body{background:var(--paper)}
[data-theme="dark"] :is(.site-header,.menu-navigation,.sidebar-brand){background:#1b1613ed}
[data-theme="dark"] :is(.mobile-tabbar,.sidebar nav){background:#2a221df2;border-color:var(--line)}
[data-theme="dark"] .sidebar{background:#241c18;border-color:var(--line)}
[data-theme="dark"] :is(.brand-caption,.sidebar-brand>span,.welcome-link,.search-field,.menu-card,.card-bottom,.mobile-category-tile,.mobile-cafe-details,.login-card,.edit-button,.sidebar-bottom>.button,.photo-tile,.pairing-option){border-color:var(--line)}
[data-theme="dark"] :is(.category-tab,.filter,.nav-button,.logout,.card-description,.card-capacity,.unavailable .card-title,.mobile-cafe-intro,.mobile-tabbar button,.mobile-search-trigger,.site-footer small){color:var(--muted)}
[data-theme="dark"] :is(.site-header .text-button,.logout,.icon-button,.category-tab,.filter.active,.mobile-search-trigger,.search-field,.dialog-heading .icon-button,.sample-notice,.detail-tag,.mobile-tag-filter.active,.group-heading span,.mobile-tabbar [aria-current="page"]>span,.secondary,.sidebar-bottom>.button,.mobile-seed,.photo-cover,.order-buttons .icon-button){background:var(--espresso-soft);color:var(--olive)}
:root[data-theme="dark"] :is(.category-tab.active,.category-choice.active,.solid-button,.mobile-filter-button,.sheet-done,.primary,.nav-button[aria-current="page"]){background:var(--olive);color:var(--espresso-on-accent);border-color:var(--olive)}
[data-theme="dark"] :is(.card-badge,.dialog-close,.gallery-controls button,.gallery-count){background:#2a221df2;color:var(--olive-dark)}
[data-theme="dark"] :is(.unavailable,.pairing-card,.photo-tile,.empty){background:#241c18}
[data-theme="dark"] :is(.unavailable .card-badge,.detail-tag.sold-out){background:#4b302c;color:var(--danger)}
[data-theme="dark"] :is(.card-image,.detail-photo,.gallery-slide .detail-photo,.detail-gallery,.mobile-category-tile img,.cover-crop img,.admin-item>img){background:#211a16}
[data-theme="dark"] :is(.mobile-welcome-icon,.mobile-cafe-cover>span span,.mobile-tabbar [aria-current="page"]){color:var(--olive)}
[data-theme="dark"] :is(.all-categories,.search-field:focus-within){background:var(--card);border-color:var(--olive)}
[data-theme="dark"] :is(.sheet-grabber>span,.switch){background:#655143}
[data-theme="dark"] .switch::after{background:#f6ede2}
[data-theme="dark"] .mobile-category-tile.selected::after,[data-theme="dark"] .mobile-tag-filter.active::after{background:var(--olive);color:var(--espresso-on-accent)}
[data-theme="dark"] .mobile-tag-filter::after{border-color:#8f7560}
[data-theme="dark"] :is(.sheet-grabber,.sheet-footer){background:var(--mobile-surface)}
[data-theme="dark"] input:not([type="checkbox"]):not([type="file"]):not([type="range"]),[data-theme="dark"] textarea,[data-theme="dark"] select{background:#241c18;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .search-field input{background:transparent!important}
[data-theme="dark"] :is(input,textarea)::placeholder{color:#a38e7f}
[data-theme="dark"] .login-screen{background:radial-gradient(ellipse at 20% 20%,#463123,transparent 60%),var(--paper)}
[data-theme="dark"] :is(.form-error,.panel-error,.danger,.variant-row .icon-button,.photo-tile .remove-photo){background:#422a25;color:var(--danger);border-color:#714c42}
[data-theme="dark"] .toast{background:var(--olive);color:var(--espresso-on-accent)}
[data-theme="dark"] .toast.error{background:#71463d;color:var(--ink)}
[data-theme="dark"] .daily-bar{background:var(--olive)}
[data-theme="dark"] .daily-track{background:linear-gradient(to bottom,transparent 49%,var(--line) 50%,transparent 51%)}
[data-theme="dark"] dialog::backdrop{background:#0e0906a3}
[data-theme="dark"] .password-field>.icon-button{background:transparent}
@media(hover:hover) and (pointer:fine){
  .theme-toggle:hover{border-color:var(--olive)}
  [data-theme="dark"] :is(.icon-button:hover,.category-tab:not(.active):hover,.secondary:hover,.edit-button:hover,.nav-button:not([aria-current]):hover){background:var(--espresso-raised);color:var(--olive)}
  [data-theme="dark"] :is(.primary:hover,.solid-button:hover){background:#e5c29d;color:var(--espresso-on-accent)}
  [data-theme="dark"] .menu-card:hover{border-color:#8f7560}
}
@media(max-width:767px),(max-width:950px) and (max-height:500px){
  .header-actions{gap:8px}
  .site-header .brand-caption{display:none}
  .page-header-actions{gap:8px}
  .page-header-actions .preview-link{font-size:0;width:44px;padding:0}
  .page-header-actions .preview-link::after{content:'↗';font-size:21px}
  .login-screen{padding-top:88px}
  [data-theme="dark"] .sidebar nav .nav-button[aria-current="page"]{background:var(--espresso-soft);color:var(--olive)}
  [data-theme="dark"] :is(.menu-card:active,.mobile-category-tile:active){background:var(--espresso-soft)}
}
@media(prefers-reduced-transparency:reduce){[data-theme="dark"] :is(.site-header,.menu-navigation,.sidebar-brand){background:var(--paper)}[data-theme="dark"] :is(.mobile-tabbar,.sidebar nav){background:var(--card)}}
@media(prefers-contrast:more){[data-theme="dark"] .card-description{color:var(--ink)}[data-theme="dark"] :is(.menu-card,.mobile-category-tile){border-color:var(--olive)}}
@media(prefers-reduced-motion:reduce){html.theme-color-transition *,html.theme-color-transition *::before,html.theme-color-transition *::after{transition:none!important}}

[data-theme="dark"] input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #241c18 inset;-webkit-text-fill-color:var(--ink);caret-color:var(--ink)}
