/* System is the single Core theme authority. Shared names are identical in both modes. */
:root {
 color-scheme: dark;
 --core-background-primary:#10110f; --core-background-secondary:#151613;
 --core-surface:#1b1c19; --core-card:linear-gradient(135deg,#20211e,#1b1c19);
 --core-text-primary:#f4f0e5; --core-text-secondary:#c4bfb1; --core-text-tertiary:#aba697;
 --core-border:#71674d; --core-separator:#454638; --core-glass:rgb(27 28 25 / .88);
 --core-control:#1b1c19; --core-input:#11120f; --core-hover:#292a24; --core-pressed:#303027; --core-active:#3b3421;
 --core-accent:#ddb043; --core-accent-text:#17130a; --core-accent-hover:#edc15a; --core-accent-pressed:#c99b32; --core-heading:#f0d48c;
 --core-focus:#ddb043; --core-focus-rgb:221 176 67;
 --core-success:#9fe0b2; --core-warning:#f0cc7e; --core-danger:#ffcec5; --core-danger-surface:#351f1b;
 --core-glow-top:#4a3a1d; --core-glow-bottom:#251e14; --core-brand-backdrop:transparent; --core-brand-original-display:block; --core-brand-light-display:none;
 --core-shadow:0 16px 44px rgb(0 0 0 / .22);
 --bg:var(--core-background-primary); --surface:var(--core-surface); --text:var(--core-text-primary); --muted:var(--core-text-secondary); --accent:var(--core-accent); --border:var(--core-border);
 --card-background:var(--core-card); --field-background:var(--core-input);
 --button-background:var(--core-control); --button-hover:var(--core-hover); --button-active:var(--core-pressed);
 --error-background:var(--core-danger-surface); --error-text:var(--core-danger);
 --space-1:.5rem; --space-2:1rem; --space-3:1.5rem; --space-4:2rem; --space-5:3rem;
 --radius-control:14px; --radius-card:24px; --shadow-soft:var(--core-shadow);
}
@media (prefers-color-scheme:light) {
 :root {
  color-scheme:light;
  --core-background-primary:#faf7ef; --core-background-secondary:#f1ecdf;
  --core-surface:#fffdf7; --core-card:linear-gradient(135deg,#fffdf7,#f6f1e5);
  --core-text-primary:#29281f; --core-text-secondary:#615d50; --core-text-tertiary:#706b5d;
  --core-border:#a69b80; --core-separator:#d6cfbd; --core-glass:rgb(255 253 247 / .9);
  --core-control:#f3eedf; --core-input:#fffefa; --core-hover:#eae2cf; --core-pressed:#ddd1b5; --core-active:#efe1ba;
  --core-accent:#87600c; --core-accent-text:#ffffff; --core-accent-hover:#725009; --core-accent-pressed:#624307; --core-heading:#76520a;
  --core-focus:#87600c; --core-focus-rgb:135 96 12;
  --core-success:#21683c; --core-warning:#76500b; --core-danger:#922f26; --core-danger-surface:#fff0ec;
  --core-glow-top:#ecdbb3; --core-glow-bottom:#efe5cf; --core-brand-backdrop:transparent; --core-brand-original-display:none; --core-brand-light-display:flex;
  --core-shadow:0 16px 44px rgb(69 51 16 / .1);
 }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a,button,input { -webkit-tap-highlight-color: transparent; }
:focus-visible:not(:is(input:not([type]),input:is([type="text"],[type="email"],[type="password"],[type="search"],[type="tel"],[type="url"],[type="number"]),textarea,[contenteditable]:not([contenteditable="false"]))) { outline: 3px solid var(--accent); outline-offset: 4px; }
.core-card { background: var(--card-background); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-soft); }
.core-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: 48px; padding: .75rem 1.25rem; border: 1px solid var(--button-border, var(--border)); border-radius: var(--radius-control); color: var(--button-text, var(--text)); background: var(--button-background, var(--surface)); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.core-button:active { background: var(--button-active,var(--core-pressed)); }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@media (hover:hover) and (pointer:fine) { .core-button:hover { background: var(--button-hover,var(--core-hover)); border-color: var(--accent); } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (forced-colors:active) { .core-button,.core-card { border:1px solid ButtonText; } }

/* Shared home-link treatment for individual sub-app header icons. */
.app-home-icon { box-shadow: 0 8px 19px rgb(var(--app-icon-shadow-rgb, 0 0 0) / var(--app-icon-shadow-near-opacity, .17)), 0 14px 32px rgb(var(--app-icon-shadow-rgb, 0 0 0) / var(--app-icon-shadow-far-opacity, .10)); }

/* Opt-in shared app components. Existing pages retain their current styles. */
.core-app-shell { width:min(100%,var(--app-content-width,760px)); margin:auto; padding:calc(var(--space-4) + env(safe-area-inset-top)) max(var(--space-2),env(safe-area-inset-right)) calc(var(--space-5) + env(safe-area-inset-bottom)) max(var(--space-2),env(safe-area-inset-left)); }
.core-app-header { display:flex; align-items:center; gap:var(--space-2); margin-bottom:var(--space-3); }
.core-app-header .app-home-icon { display:block; width:48px; height:48px; flex-shrink:0; border-radius:var(--radius-control); }
.core-app-header .app-home-icon img { display:block; width:100%; height:100%; border-radius:inherit; object-fit:cover; }
.core-header-title { flex:1; min-width:0; }
.core-title { margin:0; font-size:clamp(1.5rem,4vw,2rem); line-height:1.15; letter-spacing:-.025em; }
.core-label { margin:0; color:var(--muted); font-size:.75rem; font-weight:600; letter-spacing:.09em; text-transform:uppercase; }
.core-prompt { margin:0; font-size:1.125rem; font-weight:600; }
.core-meta { margin:0; font-size:.875rem; line-height:1.25; font-weight:600; }
.core-small { font-size:.75rem; color:var(--muted); }
.core-field { display:block; width:100%; min-width:0; min-height:48px; padding:.75rem var(--space-2); border:1px solid var(--border); border-radius:var(--radius-control); color:var(--text); background:var(--field-background,var(--bg)); font:inherit; font-size:16px; }
.core-field::placeholder { color:var(--muted); opacity:.8; }
textarea.core-field { resize:vertical; overflow-wrap:anywhere; }
.core-button:disabled { opacity:.6; cursor:wait; }
.core-icon-button { width:48px; height:48px; min-width:48px; padding:0; }
/* Shared Recipes-style glass navigation, using the Core system palette. */
.core-glass-nav { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:stretch; gap:3px; width:100%; max-width:580px; padding:8px; margin:0 auto var(--space-4); border:1px solid color-mix(in srgb,var(--core-border) 48%,transparent); border-radius:999px; background:var(--core-glass); background:color-mix(in srgb,var(--core-surface) 80%,transparent); backdrop-filter:blur(26px) saturate(170%); -webkit-backdrop-filter:blur(26px) saturate(170%); box-shadow:0 10px 35px rgb(0 0 0 / .18),inset 0 1px 0 rgb(255 255 255 / .3); }
.core-glass-nav-item,.core-glass-nav>form { flex:1; min-width:0; }
.core-glass-nav>form { display:flex; margin:0; }
.core-glass-nav .core-glass-nav-item { display:flex; flex-direction:column; justify-content:flex-start; gap:4px; min-height:64px; padding:8px 2px; border:0; border-radius:999px; color:var(--core-text-secondary); background:transparent; font-size:clamp(.6875rem,2.5vw,.8125rem); font-weight:600; line-height:1.25; text-align:center; }
.core-glass-nav-item svg { width:22px; height:22px; flex-shrink:0; }
.core-glass-nav-item span { max-width:100%; overflow-wrap:anywhere; }
.core-glass-nav .core-glass-nav-item[aria-current=page] { color:var(--core-accent); background:color-mix(in srgb,var(--core-accent) 13%,transparent); box-shadow:inset 0 1px 0 rgb(255 255 255 / .15); }
.core-glass-nav .core-glass-nav-item:active { color:var(--core-accent); background:color-mix(in srgb,var(--core-accent) 18%,transparent); }
.core-glass-nav-item:focus-visible { outline-offset:-3px; }
.core-glass-nav [hidden],.core-glass-nav:not(:has(.core-glass-nav-item:not([hidden]))) { display:none; }
.core-navigation-footer { width:100%; max-width:580px; margin:var(--space-4) auto 0; text-align:center; }
.core-navigation-greeting { color:var(--core-text-secondary); font-size:.875rem; margin:0 0 var(--space-2); overflow-wrap:anywhere; }
/* Reserve scroll space for the floating Launcher/Core menu, including enlarged text. */
body:has(.core-navigation-footer) { padding-bottom:calc(9rem + env(safe-area-inset-bottom,0px)); }
html:has(.core-navigation-footer) { scroll-padding-bottom:calc(9rem + env(safe-area-inset-bottom,0px)); }
.core-navigation-footer .core-glass-nav { position:fixed; left:50%; bottom:calc(16px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); width:min(580px,calc(100% - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))); margin:0; z-index:10; }
@media (max-width:767px) {
 .core-navigation-footer .core-glass-nav { bottom:calc(25px + env(safe-area-inset-bottom,0px)); }
 .core-navigation-footer .core-glass-nav-item span { display:none; }
 .core-navigation-footer .core-glass-nav-item { min-height:48px; justify-content:center; gap:0; padding:8px 2px; }
}
@media (max-width:360px) { .core-navigation-footer .core-glass-nav { gap:0; padding:4px; } }
.core-glass-nav:has(> :only-child) { width:max-content; min-width:88px; }
@media (hover:hover) and (pointer:fine) { .core-glass-nav .core-glass-nav-item:hover { color:var(--core-accent); background:color-mix(in srgb,var(--core-accent) 13%,transparent); } }
@media (prefers-reduced-transparency:reduce) { .core-glass-nav { background:var(--core-surface); backdrop-filter:none; -webkit-backdrop-filter:none; } }
@media (prefers-contrast:more) { .core-glass-nav { background:var(--core-surface); border-color:var(--core-text-primary); } .core-glass-nav .core-glass-nav-item { color:var(--core-text-primary); } }
@media (forced-colors:active) { .core-glass-nav { background:Canvas; border-color:CanvasText; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; } .core-glass-nav .core-glass-nav-item { color:ButtonText; } .core-glass-nav .core-glass-nav-item[aria-current=page] { color:Highlight; outline:1px solid Highlight; } }
.core-date { display:grid; place-items:center; min-height:48px; font-size:1.5rem; font-weight:700; border-radius:var(--radius-control); cursor:pointer; }
.core-date:has(input:focus-visible) { outline:3px solid var(--accent); outline-offset:4px; }
.core-notice { padding:var(--space-2); border:1px solid var(--border); border-radius:var(--radius-control); background:var(--notice-background,var(--surface)); color:var(--notice-text,var(--text)); overflow-wrap:anywhere; }
.core-notice[data-error=true] { background:var(--error-background,#351f1b); color:var(--error-text,#ffcec5); }
@media(forced-colors:active) { .core-field,.core-notice { border-color:ButtonText; } }

/* Global text-entry contract: identical normal/focused appearance. Other controls
   retain keyboard focus. Legacy core-field-glow classes are intentionally inert. */
:is(input:not([type]),input:is([type="text"],[type="email"],[type="password"],[type="search"],[type="tel"],[type="url"],[type="number"]),textarea,[contenteditable]:not([contenteditable="false"])) {
 outline:0 !important;
 box-shadow:none !important;
}

/* Keep the normal system-color border in high contrast, including while typing. */
@media (forced-colors:active) {
 :is(input:not([type]),input:is([type="text"],[type="email"],[type="password"],[type="search"],[type="tel"],[type="url"],[type="number"]),textarea,[contenteditable]:not([contenteditable="false"])) {
  border-color:CanvasText !important;
 }
}

/* Quiet evidence below Launcher/Core content; the floating menu keeps its own position. */
.core-launcher-status { color:var(--core-text-secondary); font-size:.75rem; line-height:1.6; padding:var(--space-3) 8px; overflow-wrap:anywhere; }
.core-launcher-status p { margin:0; }
.core-launcher-backup { display:flex; justify-content:center; align-items:center; gap:6px; }
.core-launcher-backup svg { width:18px; height:18px; flex-shrink:0; }
.core-launcher-backup[data-verified=true] svg { color:var(--core-success,var(--core-text-secondary)); }
