/* Shared surfaces: keep SEVRA blue, typography and layout in both themes. */
:root{color-scheme:light;--surface:#fff;--soft:#f0f4ff;--accent:#1657ff;--danger:#c5313b;--success:#087b43;--warning:#946000}
:root[data-theme=dark]{color-scheme:dark;--ink:#edf1fa;--dim:#a9b5ca;--line:#303d54;--paper:#10141d;--tint:#1a2231;--surface:#171e2b;--soft:#202e48;--accent:#91b0ff;--danger:#ff8d98;--success:#70d8a3;--warning:#eec16e}
.theme-toggle{width:44px;height:44px;flex-shrink:0;display:grid;place-items:center;position:relative;border:1px solid #ffffff66;border-radius:50%;color:#fff;background:#ffffff15;transition:background .2s,transform .2s}
.theme-toggle:hover{background:#ffffff30;transform:rotate(8deg)}
.theme-toggle svg{grid-area:1/1;transition:opacity .2s,transform .2s}
.theme-sun{opacity:0;transform:rotate(-60deg) scale(.6)}
[data-theme=dark] .theme-sun{opacity:1;transform:none}
[data-theme=dark] .theme-moon{opacity:0;transform:rotate(60deg) scale(.6)}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
header .telegram-entry{color:#fff;border-color:#ffffff66;min-height:44px}
body{height:100dvh}
input,select,textarea{max-width:100%;min-width:0}
input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px}
.sheet-close,.detail-back,.wi-add,.qty-btn,.dose-pill{min-width:44px;min-height:44px}
.sheet{max-height:100dvh;padding-bottom:env(safe-area-inset-bottom,0px)}
footer{padding-bottom:env(safe-area-inset-bottom,0px)}
.request-grid>*{min-width:0}
.activity-card,.cart-item-name{overflow-wrap:anywhere}
[data-theme=dark] :is(.catalog-search,.cart-btn,.balance-btn,.coa-cta,.request-field input,.request-field select,.affiliate-form-field input){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(footer,#storeNotice){background:var(--tint);color:var(--dim)}
[data-theme=dark] .coa-cta:hover{background:var(--tint);border-color:var(--accent)}
[data-theme=dark] .resource-icon{background:var(--soft);border-color:var(--line);color:var(--accent)}
[data-theme=dark] :is(.delivery-panel,.delivery-profile,.delivery-create,.delivery-history,.delivery-plan,.delivery-facts span,.delivery-panel input:not([type=checkbox]),.delivery-panel select,.delivery-actions button,.delivery-history button){background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme=dark] :is(.delivery-eyebrow,.delivery-panel [role=status],.delivery-actions button,.delivery-history button,.delivery-badge,.cart-btn,.resource-arrow,.activity-card button,.affiliate-meta b){color:var(--accent)}
[data-theme=dark] .delivery-badge{background:var(--soft)}
[data-theme=dark] .detail-tag.phase,[data-theme=dark] .withdraw-status{background:#382d1d;color:var(--warning)}
[data-theme=dark] :is(.detail-tag.subtype,.withdraw-status.paid){background:#18382c;color:var(--success)}
[data-theme=dark] :is(.withdraw-status.rejected){background:#3b2029;color:var(--danger)}
[data-theme=dark] :is(.cart-error,.wi-stock-flag.out,.detail-stock-note.out){color:var(--danger)}
[data-theme=dark] .wi-stock-flag.in{color:var(--success)}
[data-theme=dark] .wi-stock-flag.low{color:var(--warning)}
[data-theme=dark] :is(.badge,.detail-research svg,.address-card-default,.restock-notify-btn.active,.public-links a:hover){color:var(--accent)}
[data-theme=dark] input::placeholder{color:var(--dim);opacity:1}
[data-theme=dark] :is(.detail-tag,.dose-pill,.wi-add,.search-clear){color:var(--accent)}
[data-theme=dark] :is(.dose-pill.active,.wi-add.added){color:#fff}
@media(max-width:600px){
  header{max-height:124px}
  header nav{height:auto;min-height:102px;flex-wrap:wrap;padding:8px 0;gap:6px}
  .nav-actions{width:100%;justify-content:space-between;gap:6px}
  .theme-toggle{width:44px;height:44px}
  .telegram-entry{font-size:11px;padding:8px}
  .container{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
}
@media(max-width:360px){.request-form,.activity-card{padding-left:16px;padding-right:16px}.sheet-top{padding:0 16px}}
@media(prefers-reduced-motion:reduce){.theme-toggle,.theme-toggle svg{transition:none}.theme-toggle:hover{transform:none}}
