/* Pearl glass. Every rule is scoped so the dark palette stays independent. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dce5f0;
  --text: #172334;
  --muted: #394959;
  --faint: #485968;
  --mint: #347b62;
  --mint-strong: #287555;
  --purple: #7e6b9d;
  --orange: #986d43;
  --danger: #b25661;
  --border: rgba(68, 91, 126, .32);
  --glass: rgba(255, 255, 255, .32);
  --shadow: 0 18px 42px rgba(83, 116, 119, .07);
  --glass-rim: rgba(65, 88, 136, max(.36, var(--glass-border-opacity, .34)));
  --glass-inner-rim: rgba(255, 255, 255, var(--glass-inner-opacity, .1));
  --glass-shadow: 0 12px 32px rgba(50, 69, 108, calc(var(--glass-shadow-opacity, .12) * .85)), inset 0 1px 0 #ffffffd9;
}
:root[data-theme="light"] ::selection { background: #a9d9c77d; color: #112d24; }
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }
:root[data-theme="light"] .ambient {
  background: radial-gradient(ellipse at 48% 0%, #f4f8ffad, transparent 67%),
    linear-gradient(135deg, #d5e9ef, #e2e7f7 52%, #eae3f3);
}
:root[data-theme="light"] .orb-one { background: #76cbbb; opacity: .5; }
:root[data-theme="light"] .orb-two { background: #a596ef; opacity: .5; }
:root[data-theme="light"] .orb-three { background: #9bc7ea; opacity: .45; }
:root[data-theme="light"] .ambient::before {
  border-color: #ffffff73;
  box-shadow: 0 0 45px #91bfc72e, inset 0 0 35px #a0ccd433;
}
:root[data-theme="light"] .ambient::after {
  border-color: #ffffff8c;
  box-shadow: 0 0 55px #b5a4d42b, inset 0 0 45px #c4b3e22e;
}
:root[data-theme="light"] .ambient-grid { opacity: .16; }
:root[data-theme="light"] .app-shell {
  background: linear-gradient(125deg, #ffffff6b, #edf4ff2e 65%, #ffffff61);
  border-color: var(--glass-rim);
  box-shadow: inset 0 1px 0 #fff9, 0 24px 70px rgba(78, 109, 115, calc(var(--glass-shadow-opacity, .12) * .65));
}
:root[data-theme="light"] .sidebar {
  background: linear-gradient(115deg, #f4f8ff80, #e8effa36 55%, #e5eafb26);
  border-right-color: var(--border);
  box-shadow: inset -1px 0 0 #ffffff70, 5px 0 20px #4e747309;
}
:root[data-theme="light"] :is(.glass:not(.recipe-hero), .glass.recipe-hero) {
  background:
    linear-gradient(126deg, rgba(255, 255, 255, calc(var(--glass-reflection-opacity, .045) * 4)), transparent 28.2%),
    linear-gradient(150deg, rgba(255, 255, 255, calc(var(--glass-surface-opacity, .045) * 8)), rgba(255, 255, 255, calc(var(--glass-surface-opacity, .045) * 3)));
  box-shadow: var(--glass-shadow), inset 0 1px 0 #ffffffb3;
}
:root[data-theme="light"] .glass.recipe-hero {
  background:
    linear-gradient(126deg, rgba(255, 255, 255, calc(var(--glass-reflection-opacity, .045) * 5)), transparent 29.2%),
    radial-gradient(ellipse at 100% 65%, #a9d8bd36, transparent 72%),
    linear-gradient(145deg, rgba(255, 255, 255, calc(var(--glass-surface-opacity, .045) * 8)), rgba(234, 250, 239, calc(var(--glass-surface-opacity, .045) * 3)));
}
:root[data-theme="light"] :is(.scan-option, .suggestion, .inventory-cards .product-row, .search-field, .chat-compose, .period-control, .view-switch) {
  border-color: rgba(65, 88, 136, .34);
  background: linear-gradient(125deg, #ffffff6e, #ffffff24 42%, #fafffc21);
  box-shadow: inset 0 1px 0 #ffffffd4, 0 5px 14px #5279750d;
}
:root[data-theme="light"] :is(.scan-option:hover, .suggestion:hover) {
  border-color: #7eaaa766;
  background: linear-gradient(125deg, #ffffffa3, #ffffff4a 42%, #e3f2e93b);
  box-shadow: inset 0 1px 0 #fff, 0 9px 20px #52797516;
}

/* Navigation and small chrome. */
:root[data-theme="light"] :is(.brand-ai, .breadcrumb, .workspace-label, .sidebar-note small, .profile-text small, .demo-badge) { color: #475658; }
:root[data-theme="light"] :is(.brand-dot, .note-symbol, .notification-dot) { color: #29604b; }
:root[data-theme="light"] .brand-dot { color: #29604b; }
:root[data-theme="light"] :is(.breadcrumb-dot, .live-dot, .notification-dot) { background: #549a7c; }
:root[data-theme="light"] .breadcrumb-separator { color: #6f7a7a; }
:root[data-theme="light"] .breadcrumb #breadcrumb-current { color: #37484b; }
:root[data-theme="light"] .nav-link { color: #415154; }
:root[data-theme="light"] .nav-link .icon { color: #4e6262; }
:root[data-theme="light"] .nav-link:hover:not(.active) { color: #1d3733; background: #fff5; }
:root[data-theme="light"] :is(.nav-link.active, .filter.active, .period-control button.active, .view-switch button.active) {
  color: #1d4c39;
  border-color: #76a8914d;
  background: linear-gradient(125deg, #b3dcca59, #effaf04d 65%, #d2e8e34a);
  box-shadow: inset 0 1px 0 #ffffffdb, 0 4px 10px #5376690b;
}
:root[data-theme="light"] .nav-link.active .icon { color: #255a44; }
:root[data-theme="light"] .nav-count { color: #4e5d5e; background: #88a3a015; }
:root[data-theme="light"] .assistant-nav .icon { color: #635476; }
:root[data-theme="light"] .assistant-nav.active { color: #524268; border-color: #a38dc74d; background: linear-gradient(125deg, #ddd2ed6b, #f7f1ff45); }
:root[data-theme="light"] .assistant-nav.active .icon { color: #5c496d; }
:root[data-theme="light"] .tiny-dot { background: #a184be; box-shadow: 0 0 9px #aa8bc12e; }
:root[data-theme="light"] .sidebar-note p { color: #35494c; }
:root[data-theme="light"] .sidebar-note p span { color: #516163; }
:root[data-theme="light"] .note-line { background: #82a29742; }
:root[data-theme="light"] .profile-text { color: #354649; }
:root[data-theme="light"] :is(.profile > .icon, .icon-button, .dialog-close) { color: #4e5e61; }
:root[data-theme="light"] .demo-badge { border-color: #668c941f; background: #ffffff21; }
:root[data-theme="light"] :is(.topbar .icon-button, .top-avatar, .brand-mark, .summary-icon, .save-recipe, .bot-avatar) {
  border-color: #91b2b33b;
  background: linear-gradient(135deg, #ffffff9c, #ffffff24 55%, #e4f1e936);
  box-shadow: inset 0 1px 0 #fff, 0 4px 9px #5273750d;
}
:root[data-theme="light"] :is(.top-avatar, .avatar, .brand-mark, .bot-avatar) { color: #36564b; }
:root[data-theme="light"] .avatar { background: linear-gradient(130deg, #c5e5d87d, #ddd4eb73); border-color: #a7c5b85c; }
:root[data-theme="light"] .topbar .icon-button:hover { border-color: #7fa49c73; background: #ffffffb8; }
:root[data-theme="light"] .top-avatar:hover { box-shadow: 0 0 18px #a4c4b72e; border-color: #92b7a7a6; }
:root[data-theme="light"] .theme-toggle { background: #ffffff59; border-color: #91b2b345; color: #576668; box-shadow: inset 0 1px 0 #fff, 0 3px 8px #5273750d; }
:root[data-theme="light"] .theme-toggle-thumb { background: linear-gradient(135deg, #ffffffeb, #e9f4ecc9); box-shadow: 0 1px 4px #52737524, inset 0 1px 0 #fff; border-color: #86ae9c3b; }
:root[data-theme="light"] .theme-sun { color: #295a46; }
:root[data-theme="light"] .theme-moon { color: #5f6d6f; }

/* Common foreground hierarchy. */
:root[data-theme="light"] :is(.eyebrow, .card-eyebrow, .section-heading p, .summary-item p, .summary-item strong small, .food-name small, .product-identity small, .product-identity .product-mobile-meta, .product-expiry small, .inventory-foot, .table-head, .cell-muted, .subtle-note, .chart-header p, .chart-legend, .chart-axis, .bar-label, .chart-months, .savings-foot, .app-footer, .dialog-info, .dialog-header p, .upload-zone span, .upload-help, .setting-row p, .scan-result-head, .assistant-thread-header p, .chat-disclaimer) { color: #435356; }
:root[data-theme="light"] :is(.hero-copy, .add-card > p, .recipe-card > p, .recipe-card .hero-meta, .hero-meta, .recipe-insight p, .stats-insight p, .assistant-welcome > p, .recipe-steps li, .chat-message.bot) { color: #425455; }
:root[data-theme="light"] .recipe-hero h2 em { color: #295e4c; }
:root[data-theme="light"] :is(.text-button, .manual-add, .button-subtle) { color: #3f5454; }
:root[data-theme="light"] :is(.text-button:hover, .manual-add:hover) { color: #1a523b; }
:root[data-theme="light"] :is(.food-name strong, .product-identity strong, .inventory-foot strong, .product-details dd, .result-total strong, .recipe-insight strong, .setting-row strong, .section-title) { color: #203536; }
:root[data-theme="light"] :is(.scan-option .icon, .scan-option:first-child .icon) { color: #49645b; }
:root[data-theme="light"] .scan-option small { color: #4e5d5f; }
:root[data-theme="light"] .summary-icon { color: #3c6653; }
:root[data-theme="light"] .summary-icon.purple { color: #645678; }
:root[data-theme="light"] .summary-icon.amber { color: #705b3d; }
:root[data-theme="light"] .summary-trend { color: #2d614a; }
:root[data-theme="light"] .food-icon { border-color: #8aaf8b1f; background: radial-gradient(ellipse at 30% 20%, #ffffff5e, #b6dab524); box-shadow: inset 0 1px 0 #ffffffb3; }
:root[data-theme="light"] .food-icon.orange { background: #e8cba82b; }
:root[data-theme="light"] .food-icon.pink { background: #e6bac32b; }
:root[data-theme="light"] .hero-label { color: #2d5946; background: #ecfff33b; border-color: #79aa8a36; }
:root[data-theme="light"] .hero-food-label {
  color: #40574c;
  border-color: #ffffffb3;
  background: linear-gradient(125deg, #ffffffb3, #e5f2eaa8 65%, #d7e8da94);
  box-shadow: inset 0 1px 0 #ffffffed, 0 10px 20px #2d5c4826;
}
:root[data-theme="light"] .hero-food-label strong { color: #244233; }
:root[data-theme="light"] .hero-food-label .icon { color: #39654a; }
:root[data-theme="light"] .hero-art img { filter: drop-shadow(0 20px 24px #31534036); }
:root[data-theme="light"] .recipe-hero .hero-orbit { border-color: #70a98a26; box-shadow: 0 0 0 26px #90bea307, 0 0 0 27px #79ad8a15, 0 0 0 58px #90bea305, 0 0 0 59px #79ad8a0d; }
:root[data-theme="light"] .count-badge { color: #654f32; background: #d3b88b24; border-color: #ad885329; }
:root[data-theme="light"] .expiry { color: #63492b; border-color: #b38f5733; background: #dfbd7f1f; }
:root[data-theme="light"] .expiry.soon { color: #5a4967; border-color: #a28eb038; background: #c0aad41f; }
:root[data-theme="light"] .expiry.safe { color: #2d5743; border-color: #79aa8c38; background: #92c9a51f; }
:root[data-theme="light"] .expiry.expired { color: #773e46; border-color: #c7899138; background: #df9da721; }
:root[data-theme="light"] .trend-pill { color: #2f5e47; background: #a9d3b629; }
:root[data-theme="light"] :is(.urgent-item, .product-row) { border-bottom-color: #6f999912; border-top-color: #6f999912; }
:root[data-theme="light"] .product-row:hover { background: #ffffff4d; }
:root[data-theme="light"] .filter { color: #4b5b5d; }
:root[data-theme="light"] .filter:hover { color: #304c47; background: #ffffff6b; }
:root[data-theme="light"] :is(.period-control button, .view-switch button) { color: #4e6063; }
:root[data-theme="light"] .search-field .icon { color: #5b6c6d; }
:root[data-theme="light"] .search-field input::placeholder,
:root[data-theme="light"] .chat-compose textarea::placeholder,
:root[data-theme="light"] .field input::placeholder { color: #58686a; }
:root[data-theme="light"] :is(.search-field:focus-within, .chat-compose:focus-within) { border-color: #6da58b8c; box-shadow: inset 0 1px 0 #fff, 0 0 18px #88b89c16; }

/* Buttons retain the mint accent with a dark, readable label. */
:root[data-theme="light"] .button { color: #32494c; border-color: #7eaaa738; background: linear-gradient(125deg, #ffffff87, #ffffff2e 55%, #e9f4ee2e); box-shadow: inset 0 1px 0 #fff, 0 4px 9px #5273750d; }
:root[data-theme="light"] .button:hover { border-color: #83a99a73; background: linear-gradient(125deg, #ffffffc2, #ffffff59 55%, #e2f0e85e); }
:root[data-theme="light"] .button-primary { color: #184232; border-color: #6eae914a; background: linear-gradient(115deg, #ffffff73, transparent 43%), linear-gradient(175deg, #bce6d6de, #a7d9c4c9 70%, #c5ead8e6); box-shadow: inset 0 1px 0 #ffffffe0, 0 3px 18px #7da98b1f; }
:root[data-theme="light"] .button-primary:hover { color: #123729; border-color: #659f8480; background: linear-gradient(115deg, #ffffff8c, transparent 43%), linear-gradient(175deg, #c6edddd4, #aedec9e6 70%, #d3efdfed); box-shadow: inset 0 1px 0 #fff, 0 5px 22px #7da98b29; }
:root[data-theme="light"] .button-subtle { color: #475a5b; border-color: transparent; background: transparent; box-shadow: none; }
:root[data-theme="light"] .button-subtle:hover { color: #2d4a45; border-color: transparent; background: #ffffff4d; }
:root[data-theme="light"] .danger-button { color: #784248; border-color: #cb969e47; background: #f1dce138; }
:root[data-theme="light"] .danger-button:hover { color: #6b333b; border-color: #c3838e7a; background: #f3dce273; }

/* Recipes and their preparation view. */
:root[data-theme="light"] :is(.recipe-image, .recipe-detail-hero) { background: radial-gradient(ellipse at 50% 70%, #9bc3a926, transparent 67%); }
:root[data-theme="light"] .recipe-image::before { border-color: #8ab69617; box-shadow: 0 0 0 20px #b1cdb50a, 0 0 0 21px #8ab6960f; }
:root[data-theme="light"] :is(.recipe-image img, .recipe-detail-hero img) { filter: drop-shadow(0 14px 17px #45654a2e); }
:root[data-theme="light"] .save-recipe { color: #4e655c; }
:root[data-theme="light"] .save-recipe.saved { color: #2d6049; background: #c5e5d6b3; }
:root[data-theme="light"] .save-recipe.saved .icon { fill: #79b59933; }
:root[data-theme="light"] :is(.recipe-insight > .icon, .recipe-insight .text-button) { color: #64537a; }
:root[data-theme="light"] .ingredient-pill { color: #3a5a49; border-color: #8eb19a3b; background: #f2fbf34a; }
:root[data-theme="light"] .ingredient-pill.missing { color: #6e5330; border-color: #c2a16f47; background: #f5eddf45; }
:root[data-theme="light"] .recipe-steps li::before { color: #375949; border-color: #91b49e47; background: #ffffff59; }

/* Charts use deeper green ink instead of the luminous dark-theme strokes. */
:root[data-theme="light"] .chart-grid { stroke: #5d87861f; }
:root[data-theme="light"] .chart-line { stroke: #4c9772; }
:root[data-theme="light"] .mini-chart stop { stop-color: #5d9f7e; }
:root[data-theme="light"] .mini-chart circle { fill: #4f926e; stroke: #edf5ef; }
:root[data-theme="light"] .bar { border-color: #7cac913b; background: linear-gradient(0deg, #7fb69638, #80b89abf); box-shadow: inset 1px 0 0 #ffffff70; }
:root[data-theme="light"] .bar:hover { background: linear-gradient(0deg, #75ab8f73, #6cae87de); }
:root[data-theme="light"] .bar-value { color: #325b46; }
:root[data-theme="light"] .bars-wrap { background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #769a9a14 25%); }
:root[data-theme="light"] .stat-card-head { color: #47595b; }
:root[data-theme="light"] .stat-card-head .icon { color: #426a54; }
:root[data-theme="light"] .stat-card[data-metric="spending"] .icon { color: #69587a; }
:root[data-theme="light"] .stat-card[data-metric="waste"] .icon { color: #745d40; }
:root[data-theme="light"] .stat-card small { color: #515f61; }
:root[data-theme="light"] .stat-card small span { color: #37634b; }
:root[data-theme="light"] .stat-card.active { border-color: #8fb7a578; background-color: #e9f6ed33; box-shadow: var(--glass-shadow), inset 0 1px 0 #fff, 0 0 28px #acd0b314; }
:root[data-theme="light"] :is(.stats-insight > .icon, .subtle-note .icon) { color: #486b53; }

/* Assistant, including a light glass orb and both conversation roles. */
:root[data-theme="light"] .ai-orb { background: radial-gradient(circle at 32% 23%, #ffffffed, transparent 36%), radial-gradient(circle at 68% 70%, #c4b2e1b3, transparent 62%), linear-gradient(140deg, #d8efe8bd, #a4c5d5a6, #cfbfea94); border-color: #ffffffc2; box-shadow: inset 0 0 22px #ffffff70, inset -7px -12px 20px #86a3b52e, 0 0 45px #baa9d12e, 0 0 0 10px #ffffff1a, 0 0 0 11px #96b6c117; animation-name: light-orb-breathe; }
:root[data-theme="light"] .ai-orb .icon { color: #4d6663; filter: drop-shadow(0 1px 4px #ffffffb3); }
:root[data-theme="light"] .assistant-welcome .eyebrow { color: #695977; }
:root[data-theme="light"] .assistant-welcome h1 span { color: #37614e; }
:root[data-theme="light"] .suggestion { color: #3b4e51; }
:root[data-theme="light"] .suggestion .icon { color: #4f6b5a; }
:root[data-theme="light"] .suggestion:nth-child(2) .icon { color: #6b567d; }
:root[data-theme="light"] .suggestion:nth-child(3) .icon { color: #745f45; }
:root[data-theme="light"] .send-button { color: #21493a; background: linear-gradient(135deg, #cae7d7, #afd6c5); border-color: #a0cbb44d; box-shadow: inset 0 1px 0 #ffffffb3, 0 3px 7px #5273750d; }
:root[data-theme="light"] .chat-message.user { color: #27433f; border-color: #91b3a529; background: linear-gradient(125deg, #ffffff80, #d1e8dc59); }
:root[data-theme="light"] .bot-name { color: #375c4c; }
:root[data-theme="light"] .typing span { background: #6ca287; }

/* Modal glass and native form controls. */
:root[data-theme="light"] .overlay { background: #667e7d3d; }
:root[data-theme="light"] .dialog { background: linear-gradient(126deg, rgba(255, 255, 255, calc(var(--glass-reflection-opacity, .045) * 4)), transparent 30.2%), radial-gradient(ellipse at 100% 0%, #c8e6d32e, transparent 80%), linear-gradient(145deg, rgba(251, 255, 251, var(--glass-dialog-opacity, .9)), rgba(240, 246, 242, var(--glass-dialog-opacity, .9))); }
:root[data-theme="light"] .dialog-header .eyebrow { color: #4e695b; }
:root[data-theme="light"] .upload-zone { border-color: #6d9b8a5e; background: #ffffff21; }
:root[data-theme="light"] :is(.upload-zone:hover, .upload-zone.drag-over) { border-color: #609c7c9c; background: #e4f5e940; }
:root[data-theme="light"] .upload-zone > .icon { color: #557260; }
:root[data-theme="light"] .upload-help .icon { color: #476b54; }
:root[data-theme="light"] .demo-notice { color: #5a5167; border-color: #a594bd33; background: #e8e0f12e; }
:root[data-theme="light"] .demo-notice strong { color: #574767; }
:root[data-theme="light"] :is(.field label, .result-total, .scan-result-label, .product-detail-top p, .product-details dt, .notification-empty) { color: #475b5b; }
:root[data-theme="light"] :is(.field input, .field select, .scan-result input) { color: #263c41; border-color: #88aaa545; background: linear-gradient(180deg, #c7dcd51a, #ffffff4d); box-shadow: inset 0 1px 4px #658b790b, 0 1px 0 #ffffff94; color-scheme: light; }
:root[data-theme="light"] .field select option { background: #f5f9f5; color: #263c41; }
:root[data-theme="light"] .field input[type="date"] { color-scheme: light; }
:root[data-theme="light"] :is(.field input:focus, .field select:focus) { border-color: #619b7e94; }
:root[data-theme="light"] .dialog .search-field { background-color: #ffffff3b; }
:root[data-theme="light"] .switch { background: #b5c6c4; border-color: #799c934d; }
:root[data-theme="light"] .switch::after { background: #f7fcf8; box-shadow: 0 1px 3px #4c6c5b24; }
:root[data-theme="light"] .switch[aria-checked="true"] { background: #86b59d; }
:root[data-theme="light"] .switch[aria-checked="true"]::after { background: #fbfffc; }
:root[data-theme="light"] .toast { color: #2c4d3a; border-color: #8caf9766; background: linear-gradient(125deg, #f4fff2eb, #e4f0e7e6 50%, #e8f2eceb); box-shadow: inset 0 1px 0 #fff, 0 12px 30px #52737524; }
:root[data-theme="light"] :is(.toast > .icon, .toast button) { color: #325c46; }

@keyframes light-orb-breathe {
  50% { box-shadow: inset 0 0 25px #ffffff8c, inset -7px -12px 20px #86a3b52e, 0 0 50px #baa9d13b, 0 0 0 10px #ffffff21, 0 0 0 11px #96b6c124; transform: translateY(-3px); }
}
@media (max-width: 600px) {
  :root[data-theme="light"] .app-shell { background: transparent; border: 0; box-shadow: none; }
  :root[data-theme="light"] .sidebar { background: linear-gradient(130deg, #fafff7c7, #f2f7f1e0 48%, #f6f1f9d9); border-top-color: #a6bfb070; box-shadow: inset 0 1px 0 #ffffffeb, inset 0 4px 0 #ffffff26, 0 -8px 28px #52737512; }
  :root[data-theme="light"] .nav-link .icon { filter: drop-shadow(0 1px 1px #ffffffb3); }
  :root[data-theme="light"] .nav-link.active { border-color: #81ad942e; }
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-theme="light"] :is(.glass:not(.recipe-hero), .glass.recipe-hero, .dialog) { background: #f4f9f3; }
}

/* Contrast and edges remain crisp over the translucent cool background. */
:root[data-theme="light"] :is(h1, h2, h3, .summary-item strong, .stat-card strong, .brand-name) { color: #172334; }
:root[data-theme="light"] :is(.button:not(.button-subtle), .filter, .theme-toggle, .topbar .icon-button, .top-avatar, .save-recipe, .field input, .field select, .scan-result input, .suggestion, .hero-food-label, .demo-notice, .upload-zone) { border-color: rgba(64, 86, 128, .35); }
:root[data-theme="light"] :is(.nav-link.active, .filter.active, .period-control button.active, .view-switch button.active) { border-color: #527b9273; }
:root[data-theme="light"] :is(.product-row, .urgent-item) { border-bottom-color: #536b842e; }
:root[data-theme="light"] :is(.button:focus-visible, .nav-link:focus-visible, .icon-button:focus-visible, .theme-toggle:focus-visible) { outline: 2px solid #3563ff; outline-offset: 3px; }
