/* Leptir shared brand. Page-specific layout and interaction selectors stay intact. */
body[data-leptir-brand] {
  --brand-bg: #171d19; --brand-surface: #202923; --brand-soft: #252e25;
  --brand-ink: #f6f3eb; --brand-muted: #b7bdb0; --brand-line: #414a40;
  --brand-accent: #c6b8ff; --brand-button: #bba8ff; --brand-button-ink: #241c3c;
  --brand-blue: #9bc7ef;
  --brand-body: 'DM Sans', Arial, sans-serif;
  --brand-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-family: var(--brand-body) !important;
  background: var(--brand-bg) !important; color: var(--brand-ink) !important;
}
body[data-leptir-brand][data-lp2-theme='light'] {
  --brand-bg: #f6f3eb; --brand-surface: #fffdf8; --brand-soft: #e9eddb;
  --brand-ink: #202923; --brand-muted: #676b63; --brand-line: #d9d9cd;
  --brand-accent: #6450ca; --brand-button: #6450ca; --brand-button-ink: #ffffff;
  --brand-blue: #326fa9; color-scheme: light;
}
/* Map existing component contracts to the same palette. Important is confined
   to tokens that legacy theme variants otherwise redefine at higher specificity. */
body[data-leptir-brand] {
  --lp2-bg: var(--brand-bg) !important; --lp2-bg-soft: var(--brand-surface) !important;
  --lp2-surface: var(--brand-surface) !important; --lp2-surface-2: var(--brand-surface) !important;
  --lp2-text: var(--brand-ink) !important; --lp2-text-2: var(--brand-ink) !important;
  --lp2-text-3: var(--brand-muted) !important; --lp2-text-4: var(--brand-muted) !important;
  --lp2-border: var(--brand-line) !important; --lp2-border-strong: var(--brand-line) !important;
  --lp2-nav-bg: var(--brand-bg) !important; --lp2-nav-border: var(--brand-line) !important;
  --lp2-accent: var(--brand-accent) !important; --lp2-accent-strong-fg: var(--brand-accent) !important;
  --lp2-btn-primary-bg: var(--brand-button) !important; --lp2-btn-primary-fg: var(--brand-button-ink) !important;
  --lp2-btn-primary-shadow: none !important;
  --dl-shell-ink: var(--brand-ink) !important; --dl-shell-muted: var(--brand-muted) !important;
  --dl-shell-ghost: var(--brand-muted) !important; --dl-shell-border: var(--brand-line) !important;
  --dl-shell-surface: var(--brand-surface) !important; --dl-shell-hover: var(--brand-soft) !important;
  --dl-shell-accent: var(--brand-accent) !important;
  --today-ink: var(--brand-ink) !important; --today-muted: var(--brand-muted) !important;
  --today-surface: var(--brand-surface) !important; --today-border: var(--brand-line) !important;
  --today-accent: var(--brand-accent) !important;
  --dl-c-surface: var(--brand-surface) !important; --dl-c-border: var(--brand-line) !important;
}
body[data-leptir-brand] :is(button,input,select,textarea) {font-family:var(--brand-body)}
body[data-leptir-brand] :is(a,button,input,textarea,select):focus-visible {outline:3px solid var(--brand-blue);outline-offset:3px}
body[data-leptir-brand] .lp2-nav-brand {font-family:var(--brand-body);font-size:25px;letter-spacing:-1px;font-weight:600}
body[data-leptir-brand] .lp2-nav-shell {box-shadow:none;backdrop-filter:none}
body[data-leptir-brand] :is(.lp2-nav-link,.lp2-product-link,.lp2-nav-account) {font-family:var(--brand-body)}
body[data-leptir-brand] :is(.dl-shell-page-title,.lp2-public-title,.entry-main h1) {font-family:var(--brand-display);font-size:clamp(40px,6vw,60px);font-weight:600;line-height:1;letter-spacing:-.02em;color:var(--brand-ink)}
body[data-leptir-brand] :is(.dl-shell-entry,.dl-account-action,.dl-shell-pill,.dl-settings-input,.dl-settings-select) {border-radius:6px}
body[data-leptir-brand] .dl-shell-main {padding-top:calc(3.5rem + env(safe-area-inset-top,0px) + 35px)}
body[data-leptir-brand] :is(.dl-account-section__title,.dl-shell-date) {letter-spacing:.13em;font-weight:500;font-size:11px}
body[data-leptir-brand] .dl-account-action {min-height:44px;padding:10px 16px}
body[data-leptir-brand] .dl-settings-input:disabled {opacity:.75}
body[data-leptir-brand] .dl-shell-entry {padding:20px;margin-bottom:14px}
body[data-leptir-brand] .dl-shell-entry__raw {font-size:17px;line-height:1.5;font-weight:500}
body[data-leptir-brand] .lp2-public-title {max-width:760px}
body[data-leptir-brand] .lp2-public-hero {padding-top:30px}
body[data-leptir-brand] .lp2-public-main h2 {font-family:var(--brand-body);font-weight:600}
/* Account entry and recovery share the same paper and typography. */
body[data-leptir-brand].entry-page {color-scheme:light}
body[data-leptir-brand].entry-page:not([data-lp2-theme='light']) {color-scheme:dark}
body[data-leptir-brand].entry-page .entry-main {max-width:450px;padding-top:46px}
body[data-leptir-brand].entry-page .entry-brand {color:var(--brand-ink) !important;font-family:var(--brand-body);font-size:26px;letter-spacing:-1px}
body[data-leptir-brand].entry-page :is(.entry-kicker,.entry-page a) {color:var(--brand-accent)}
body[data-leptir-brand].entry-page :is(.entry-description,.auth-hint,.entry-note,.entry-footer a,.entry-example span,.entry-telegram p,.pw-rule,.entry-password-guide summary) {color:var(--brand-muted)}
body[data-leptir-brand].entry-page :is(.auth-label,.entry-header nav a,.entry-telegram h2) {color:var(--brand-ink)}
body[data-leptir-brand].entry-page .auth-input {background:var(--brand-surface);border-color:var(--brand-line);color:var(--brand-ink);border-radius:6px}
body[data-leptir-brand].entry-page .auth-input::placeholder {color:var(--brand-muted)}
body[data-leptir-brand].entry-page .auth-btn--primary {background:var(--brand-button);color:var(--brand-button-ink);border-radius:6px;box-shadow:none}
body[data-leptir-brand].entry-page .auth-btn--primary:hover {filter:brightness(.94)}
body[data-leptir-brand].entry-page .entry-example {background:var(--brand-soft);border-color:var(--brand-line);border-radius:6px;color:var(--brand-ink)}
body[data-leptir-brand].entry-page .entry-telegram {border-color:var(--brand-line)}
body[data-leptir-brand].entry-page .pw-toggle {color:var(--brand-accent)}
/* Current app implementation: preserve date controls, entry actions and sheets. */
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__date {font-family:var(--brand-display);font-size:clamp(30px,4.5vw,48px);font-weight:600;letter-spacing:-.02em}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__eyebrow {text-transform:uppercase;letter-spacing:.13em;font-size:10px;margin-bottom:18px}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__grid {border:0;border-bottom:1px solid var(--brand-line);border-radius:0;background:transparent;padding:12px 0 18px;margin-top:30px}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__macro {padding:5px 16px}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__macro:first-child {padding-left:0}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__macro-value {font-size:clamp(30px,4vw,42px);font-weight:500;letter-spacing:-1px}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__log-btn {background:var(--brand-button);color:var(--brand-button-ink);border-radius:6px;min-height:48px;padding:13px 20px;font-family:var(--brand-body)}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__meal {border-radius:6px;padding:23px;box-shadow:none}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__meal-raw {font-size:19px;font-weight:500;letter-spacing:-.4px}
body[data-leptir-brand].design-lab--classic.dl-product-shell :is(.dl-c2__panel,.dl-c2__weight-mobile) {background:var(--brand-soft);border:1px solid var(--brand-line);border-radius:6px}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__panel-title {color:var(--brand-muted)}
body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__empty {border-radius:6px;padding:38px 20px}
body[data-leptir-brand] .dl-c2__empty>p:first-child {font-family:var(--brand-display);font-size:32px;color:var(--brand-ink)}
body[data-leptir-brand] .brand-day-note {padding:27px;background:var(--brand-soft);border-radius:6px}
body[data-leptir-brand] .brand-day-note h2 {font-family:var(--brand-display);font-size:35px;line-height:1.05;margin:0 0 18px;color:var(--brand-ink)}
body[data-leptir-brand] .brand-day-note p {font-size:13px;line-height:1.7;color:var(--brand-muted);margin:0}
body[data-leptir-brand] .brand-day-note a {display:inline-block;margin-top:18px;color:var(--brand-accent);font-size:12px}
@media(min-width:960px){body[data-leptir-brand].design-lab-active .command-center {padding-top:38px}body[data-leptir-brand] .lp2-nav-inner {max-width:1232px}}
@media(max-width:600px){body[data-leptir-brand] .dl-shell-main {padding-top:calc(3.5rem + env(safe-area-inset-top,0px) + 24px)}body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__meal {padding:18px}body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__meal-raw {font-size:17px}body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__macro {padding:4px 9px}}
@media(prefers-reduced-motion:reduce){body[data-leptir-brand] *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Recovery forms and stored meal/workout receipts. */
body[data-leptir-brand] {--bg:var(--brand-bg);--card:var(--brand-surface);--border:var(--brand-line);--text:var(--brand-ink);--text-muted:var(--brand-muted);--font:var(--brand-body)}
body[data-leptir-brand][data-lp2-theme='light'] {--green:#267244;--yellow:#896014;--red:#b13b37;--blue:var(--brand-blue)}
body[data-leptir-brand] .auth-title {font-family:var(--brand-display);font-size:42px;color:var(--brand-ink)}
body[data-leptir-brand] .auth-card {background:var(--brand-surface);border-color:var(--brand-line);box-shadow:none;border-radius:6px}
body[data-leptir-brand] .lp2-auth-backdrop {display:none}
body[data-leptir-brand] .auth-btn--primary {background:var(--brand-button);color:var(--brand-button-ink);box-shadow:none}
body[data-leptir-brand][data-brand-receipt] .container {max-width:720px;margin:24px auto}
body[data-leptir-brand][data-brand-receipt] :is(.meal-name,.workout-kind-label) {font-family:var(--brand-display);font-size:36px;line-height:1.1}
body[data-leptir-brand][data-brand-receipt] :is(.score-card,.receipt-section,.workout-detail-card) {border-radius:6px;box-shadow:none}
body[data-leptir-brand][data-brand-receipt] .logo-row span {font-size:24px;letter-spacing:-1px}
body[data-leptir-brand] .brand-back-link {display:inline-block;margin-bottom:20px;color:var(--brand-muted);font-size:12px;text-decoration:none}
body[data-leptir-brand] #btn-generate {background:var(--brand-button);color:var(--brand-button-ink);border-color:var(--brand-button);min-height:48px}
body[data-leptir-brand] .dl-account-btn {border-color:var(--brand-line)!important}
@media(max-width:600px){body[data-leptir-brand].design-lab--classic.dl-product-shell .dl-c2__date {font-size:24px}}
body[data-leptir-brand] .score-scale-hint {color:var(--brand-muted);border-color:var(--brand-line)}
/* Meal corrections use the same surfaces in both saved themes. */
body[data-leptir-brand] :is(.meal-edit-dialog,.meal-edit-footer,.meal-edit-delete-confirm-dialog) {background:var(--brand-surface);border-color:var(--brand-line);color:var(--brand-ink)}
body[data-leptir-brand] .meal-edit-dialog {--zinc-950:var(--brand-bg);--zinc-900:var(--brand-surface);--zinc-800:var(--brand-line);--zinc-700:var(--brand-line);--zinc-500:var(--brand-muted);--zinc-100:var(--brand-ink)}
body[data-leptir-brand] .meal-edit-dialog :is(p,label,summary,dt,.meal-edit-close,.meal-edit-refresh,.meal-edit-block-title,.meal-edit-item-source,.meal-edit-version-meta,.meal-edit-versions-empty,.meal-edit-memory-toggle) {color:var(--brand-muted)}
body[data-leptir-brand] .meal-edit-dialog :is(.meal-edit-items-title,.meal-edit-item-name,.meal-edit-item-metric dd) {color:var(--brand-ink)}
body[data-leptir-brand] .meal-edit-item-row {background:var(--brand-surface);border-color:var(--brand-line)}
body[data-leptir-brand] .meal-edit-items-state {color:var(--brand-ink);border-color:var(--brand-line)}
body[data-leptir-brand] #meal-edit-reconciliation {font-size:.82rem;line-height:1.5}
body[data-leptir-brand] .meal-edit-dialog :is(input,textarea.meal-edit-textarea) {background:var(--brand-bg);color:var(--brand-ink);border-color:var(--brand-line)}
body[data-leptir-brand] .meal-edit-dialog :is(dd,.meal-edit-version-words,.meal-edit-version-current) {color:var(--brand-ink)}
body[data-leptir-brand] .meal-edit-dialog :is(.meal-edit-more,.meal-edit-section,.meal-edit-danger-row,.meal-edit-version-row) {border-color:var(--brand-line)}
body[data-leptir-brand] #meal-edit-save {background:var(--brand-button);color:var(--brand-button-ink);border-color:var(--brand-button)}
body[data-leptir-brand][data-lp2-theme='light'] .meal-edit-delete-btn {color:#b13b37!important}
body[data-leptir-brand] .meal-edit-delete-confirm-dialog h4 {color:var(--brand-ink)}
body[data-leptir-brand] .meal-edit-delete-confirm-dialog p {color:var(--brand-muted)}
