/* The daylight composition has its own ink, glass and optical hierarchy.
   Scope every rule to light mode so the approved dark composition stays intact. */
[data-theme="light"] {
  --bg: #f4f4f4;
  --bg-deep: #e7e8e9;
  --surface: rgb(255 255 255 / .46);
  --surface-solid: #fafafa;
  --surface-2: rgb(255 255 255 / .68);
  --surface-3: rgb(53 57 66 / .07);
  --sidebar: rgb(255 255 255 / .48);
  --heading: #252830;
  --text: #30343c;
  --text-2: #545962;
  --text-3: #686d75;
  --hairline: rgb(49 54 64 / .16);
  --hairline-strong: #969ba3;
  /* A small iris accent belongs to actions, not to the background or body text. */
  --blue: #605aac;
  --blue-strong: #504994;
  --blue-soft: #e9e6f3;
  --green: #427460;
  --orange: #7d6537;
  --red: #a34b59;
  --tint-bg: #e9eaed;
  --tint-text: #606672;
  --homework-accent: #454b56;
  --glass: rgb(255 255 255 / .48);
  --glass-edge: rgb(255 255 255 / .92);
  --glass-rim: rgb(55 61 73 / .26);
  --glass-highlight: rgb(255 255 255 / .96);
  --shadow-sm: 0 2px 4px rgb(32 36 44 / .025), 0 7px 20px -12px rgb(32 36 44 / .12);
  --shadow-md: 0 12px 30px -20px rgb(32 36 44 / .22), 0 2px 5px rgb(32 36 44 / .035);
  --shadow-lg: 0 28px 80px -28px rgb(32 36 44 / .24);
  --daylight-glass: linear-gradient(135deg, rgb(255 255 255 / .7), rgb(255 255 255 / .34));
  --daylight-shadow: inset 0 1px 0 #fff, inset 1px 0 0 rgb(255 255 255 / .75), 0 8px 24px -18px rgb(32 36 44 / .24);
}

/* Graphite fibres give the light canvas depth while the glass stays clear. */
[data-theme="light"] #ambient-canvas { opacity: .62; }
[data-theme="light"][data-background-mode="threads"] #ambient-canvas { opacity: 0; }
[data-theme="light"][data-reading="true"] #ambient-canvas { opacity: .32; }
[data-theme="light"] .ambient-background::before {
  background: radial-gradient(ellipse at 16% 38%, #454e5c19, transparent 56%), radial-gradient(ellipse at 84% 70%, #535d6a15, transparent 60%);
}
[data-theme="light"] .threads-effect::before { background: #424a57; opacity: .34; }
[data-theme="light"] .threads-effect > canvas { opacity: .56; }
[data-theme="light"] .threads-effect {
  mask-image: radial-gradient(ellipse 40% 36% at 58% 42%, #0006 8%, #000c 60%, #000 100%);
  -webkit-mask-image: radial-gradient(ellipse 40% 36% at 58% 42%, #0006 8%, #000c 60%, #000 100%);
}
[data-theme="light"] body:has(.has-conversation) .threads-effect > canvas { opacity: .18; }

/* Quiet frame, a definite selection, and neutral identity marks. */
[data-theme="light"] .sidebar { border-right-color: #363c461f; box-shadow: inset -1px 0 #fff9, 5px 0 24px -24px #24283040; }
[data-theme="light"] :is(.brand-icon, .topbar-brand img) { opacity: 1; }
[data-theme="light"] .assistant-mark {
  filter: none; background: linear-gradient(145deg, #8c82c8, #55549d 58%, #7d91bf);
  mask: url('assets/assistant.svg') center/contain no-repeat;
  -webkit-mask: url('assets/assistant.svg') center/contain no-repeat;
}
[data-theme="light"] .nav-orb { filter: hue-rotate(18deg) saturate(.8); }
[data-theme="light"] .nav-item { color: #5b606a; }
[data-theme="light"] .nav-item.is-active {
  color: #57529c; background: linear-gradient(115deg, #eeebf68c, #ffffff4d);
  box-shadow: inset 0 0 0 1px #7971ac2b, inset 0 1px #fff, 0 3px 9px -6px #60569329;
}
[data-theme="light"] .nav-item.is-active::before { opacity: 1; background: #7369b5; }
[data-theme="light"] .nav-item.is-active > .ic { stroke-width: 1.9; }
[data-theme="light"] .nav-tag { color: #6960a5; background: #7c70b90e; border: 1px solid #7c70b929; }
[data-theme="light"] .group-monogram { background: linear-gradient(140deg, #fff9, #dbd7ee99); color: #635a99; border: 1px solid #7e74b333; box-shadow: inset 0 1px #fff; }
[data-theme="light"] .group-mini { background: #ffffff40; box-shadow: inset 0 1px #fff; }
[data-theme="light"] .avatar { background: hsl(var(--avatar-h) 28% 89%); color: hsl(var(--avatar-h) 32% 36%); box-shadow: inset 0 0 0 1px #50576312, inset 0 1px #fff9; }
[data-theme="light"] :is(.side-profile, .topbar) .avatar { background: #e7e2f2; color: #71619a; }
[data-theme="light"] .greeting-name { color: #7063ad; font-weight: 730; }
[data-theme="light"] .title-period { color: #8a909b; }
[data-theme="light"] .date-dot { background: #56816b; box-shadow: 0 0 0 3px #56816b12; }
[data-theme="light"] .eyebrow { color: #606570; }
[data-theme="light"] .ai-launcher-kicker { color: #7063ad; }
[data-theme="light"] kbd { background: #fff6; border-color: #42495629; box-shadow: 0 1px 1px #25283008; }

/* Depth comes from different glass densities and a silver edge. */
[data-theme="light"] :is(.card, .panel, .subject-card, .today-note-list, .entry-row, .lesson, .lesson.is-long, .ai-launcher) {
  background: var(--daylight-glass); border-color: var(--glass-rim); box-shadow: var(--daylight-shadow);
  backdrop-filter: blur(16px) saturate(1.05); -webkit-backdrop-filter: blur(16px) saturate(1.05);
}
[data-theme="light"] .ai-launcher { background: linear-gradient(115deg, #ffffff80, #ffffff36); border-color: #7972a55c; }
[data-theme="light"] .ai-launcher::after { background: radial-gradient(300px circle at var(--spot-x, 50%) var(--spot-y, 50%), #ffffff75, transparent 80%); }
[data-theme="light"] .ai-launcher-arrow { background: #ffffff70; border: 1px solid #8274b84d; box-shadow: inset 0 1px #fff; color: #6e5da5; }
[data-theme="light"] .homework-card { background: linear-gradient(135deg, #ffffffbb, #ffffff75); }
[data-theme="light"] .homework-card-date { background: #ffffff70; border: 1px solid #535b6921; }
[data-theme="light"] .homework-card-subject {
  width: fit-content; padding: 4px 8px; margin-left: -2px; border-radius: 8px;
  color: hsl(var(--h-light, var(--h)) 35% 40%); background: hsl(var(--h-light, var(--h)) 45% 94% / .8);
  box-shadow: inset 0 0 0 1px hsl(var(--h-light, var(--h)) 30% 55% / .16);
}
[data-theme="light"] .homework-card-subject > .ic { color: #6165a6; }
[data-theme="light"] .homework-card-open { color: #635a9d; }
[data-theme="light"] .today-note-list { background: linear-gradient(135deg, #ffffff99, #ffffff55); }
[data-theme="light"] :is(.subject-card, .entry-row):hover { background: linear-gradient(135deg, #ffffffd9, #ffffff99); border-color: #6169758c; box-shadow: var(--shadow-md); }
[data-theme="light"] .tint {
  color: hsl(var(--h-light, var(--h)) 48% 38%); background: hsl(var(--h-light, var(--h)) 58% 91% / .85);
  box-shadow: inset 0 0 0 1px hsl(var(--h-light, var(--h)) 42% 58% / .26), inset 0 1px #ffffffb3;
}
[data-theme="light"] .tint .ic { stroke-width: 1.8; }
[data-theme="light"] .today-note-subject { color: hsl(var(--h-light, var(--h)) 34% 42%); }
[data-theme="light"] .subject-card.is-empty .tint { opacity: .72; }
[data-theme="light"] .filter-input { background: #ffffff80; border-color: #555e6d40; box-shadow: inset 0 1px #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
[data-theme="light"] .entry-date { background: #535e7010; border: 1px solid #535e7014; color: #4d5563; }

/* Iris actions, clear secondary controls, and a separate subject palette. */
[data-theme="light"] .btn-primary { background: #655ba4; color: #fff; border-color: #594e96; box-shadow: inset 0 1px #ffffff26, 0 3px 7px -3px #62508f40; }
[data-theme="light"] .btn-primary:hover { background: #564c91; }
[data-theme="light"] .btn-secondary { background: #ffffff80; box-shadow: inset 0 1px #fff; }
[data-theme="light"] .segmented { background: #4d56650a; border-color: #454d5b29; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
[data-theme="light"] .segmented button.is-on { background: #ffffffd9; color: #5e559e; box-shadow: 0 1px 4px #242a351a, inset 0 0 0 1px #75699e29; }
[data-theme="light"] .badge-notes { background: #e9edf6b3; color: #4f6090; }
[data-theme="light"] .badge-homework { background: #eeebdfb3; color: #706133; }
[data-theme="light"] .lesson { background: linear-gradient(135deg, #ffffffb8, #ffffff80); border-color: #454c5b3d; }
[data-theme="light"] .lesson::before { width: 3px; top: 13px; bottom: 13px; background: hsl(var(--h-light, var(--h)) 45% 54%); }
[data-theme="light"] .lesson-time { color: #646b77; }
[data-theme="light"] .is-today .day-date { background: #655ba4; color: #fff; box-shadow: inset 0 1px #ffffff26; }

/* The assistant uses graphite threads, a legible stage, and a denser composer. */
[data-theme="light"] .chat-welcome h1 { color: #2e333d; background: none; -webkit-text-fill-color: currentColor; }
[data-theme="light"] .chat-welcome .eyebrow { color: #7063ad; }
[data-theme="light"] .chat-welcome .lede { color: #505763; text-shadow: 0 1px 9px #f4f4f4, 0 0 5px #f4f4f4; }
[data-theme="light"] .conversation-toolbar { background: linear-gradient(115deg, #ffffffa6, #ffffff66); border-color: #454c5a36; box-shadow: inset 0 1px #fff, 0 5px 20px -16px #2d34405c; }
[data-theme="light"] .chat-composer {
  background: linear-gradient(120deg, #ffffffc7, #ffffff99); border-color: #424b5c66;
  box-shadow: inset 0 1px #fff, inset 1px 0 #fff, 0 10px 32px -19px #3038464d;
  backdrop-filter: blur(22px) saturate(1.05); -webkit-backdrop-filter: blur(22px) saturate(1.05);
}
[data-theme="light"] .chat-composer::before { background: linear-gradient(115deg, #fff, #7d859340 35%, #fff9 65%, #646c7b66); }
[data-theme="light"] .chat-composer:focus-within { border-color: #555f73; box-shadow: inset 0 1px #fff, 0 0 0 3px #505c7010, 0 12px 34px -18px #3038464d; }
[data-theme="light"] .composer-context { background: #535e7009; border: 1px solid #535e701c; border-radius: 999px; padding: 3px 8px; color: #5a6270; }
[data-theme="light"] .composer-context > .ic { color: #7b6ba9; }
[data-theme="light"] .context-dot { background: #8d949f; }
[data-theme="light"] .chat-send { background: #59627309; border-color: #59627324; color: #7b8390; }
[data-theme="light"] .has-draft .chat-send,
[data-theme="light"][data-assistant-state="generating"] .chat-send { color: #fff; background: #655ba4; border-color: #594e96; box-shadow: inset 0 1px #ffffff26, 0 2px 5px #62508f26; }
[data-theme="light"] .chat-send:not(:disabled):hover { color: #fff; background: #564c91; }
[data-theme="light"] .chat-starters > button { background: linear-gradient(130deg, #ffffffa6, #ffffff66); border-color: #454c5a42; box-shadow: var(--daylight-shadow); }
[data-theme="light"] .chat-starters > button:hover { border-color: #69738580; box-shadow: var(--shadow-md); }
[data-theme="light"] .chat-starters > button > .ic:first-child { color: hsl(var(--suggestion-h-light, var(--suggestion-h)) 45% 42%); }
[data-theme="light"] .user-message-bubble { background: linear-gradient(135deg, #e6e8edcc, #eceef2b3); border-color: #fff; box-shadow: 0 0 0 1px #505b7030, inset 0 1px #fff; }
[data-theme="light"] .chat-source { background: #ffffff8c; }
[data-theme="light"] .citation { background: #ffffffa6; border-color: #fff; color: #454e60; }
[data-theme="light"] .citation:hover { background: #eef0f4; }
[data-theme="light"] :is(.chat-thinking > span, .chat-message-body.is-streaming > :last-child::after) { background: #616d83; }

/* Reading surfaces are quieter and denser; the existing freeze/blur policy stays. */
[data-theme="light"] :is(.article-card, .window-body .article-card) { background: linear-gradient(130deg, #ffffffd9, #ffffffad); border-color: #515b6b38; box-shadow: var(--daylight-shadow); }
[data-theme="light"] .article-text { color: #363b44; }
[data-theme="light"] .photo { background: #5c657507; border-color: #69738252; color: #67707e; }
[data-theme="light"] .window-toolbar { background: #ffffff8c; border-color: #49536326; box-shadow: inset 0 -1px #fff; }
[data-theme="light"] .modal-backdrop:not(:has(.sheet-window)) { background: #242a351f; }
[data-theme="light"] .toast { background: #fafafae8; border-color: #49536338; color: #343b48; }

@media (max-width: 760px) {
  [data-theme="light"] .topbar { background: #ffffff85; border-color: #424b5929; box-shadow: inset 0 -1px #fff; }
  [data-theme="light"] .tabbar {
    background: linear-gradient(120deg, #ffffffa3, #ffffff5c); border-color: #545e7159;
    box-shadow: inset 0 1px #fff, inset 0 -1px #626d8014, 0 10px 30px -14px #27303f4d;
    backdrop-filter: blur(24px) saturate(1.05); -webkit-backdrop-filter: blur(24px) saturate(1.05);
  }
  [data-theme="light"] .tab-item.is-active { color: #64579f; background: linear-gradient(135deg, #ffffffa6, #b2a3db24); box-shadow: inset 0 0 0 1px #8c7caf26; }
  [data-theme="light"] .tab-item.is-active .ic { stroke-width: 1.9; }
  [data-theme="light"] .tab-item-ai.is-active { background: transparent; box-shadow: none; }
  [data-theme="light"] .day-chip.is-on { background: #655ba4; color: #fff; }
  [data-theme="light"] .threads-effect {
    mask-image: radial-gradient(ellipse 80% 30% at 50% 37%, #0006 8%, #000c 60%, #000 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 30% at 50% 37%, #0006 8%, #000c 60%, #000 100%);
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-theme="light"] :is(.tabbar, .topbar, .chat-composer, .conversation-toolbar, .article-card) { background: #f9f9f9; }
}
