:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-deep: #050608;
  --surface: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .095);
  --line-soft: rgba(255, 255, 255, .055);
  --text: rgba(255, 255, 255, .94);
  --text-soft: rgba(255, 255, 255, .67);
  --text-muted: rgba(255, 255, 255, .42);
  --accent: #9cc0ff;
  --accent-bright: #c9dcff;
  --accent-soft: rgba(138, 180, 255, .13);
  --danger: #ffb3ba;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content-width: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(900px 560px at 8% -12%, rgba(105, 134, 255, .11), transparent 68%),
    radial-gradient(820px 560px at 94% 84%, rgba(68, 150, 255, .065), transparent 70%),
    linear-gradient(180deg, #090a0d 0%, #07080a 54%, #060709 100%);
  color: var(--text);
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button:disabled, input:disabled, select:disabled { cursor: wait; opacity: .64; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(138, 180, 255, .24); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-shell { width: min(100%, var(--content-width)); min-height: 100vh; margin: 0 auto; padding: 27px clamp(20px, 4vw, 56px) 32px; display: flex; flex-direction: column; }
.site-header { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 21px; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; background: rgba(255, 255, 255, .045); color: rgba(255, 255, 255, .92); font-size: 9px; font-weight: 760; letter-spacing: .07em; }
.brand-name { color: rgba(255, 255, 255, .83); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.site-nav, .nav-links, .nav-auth { display: inline-flex; align-items: center; gap: 3px; }
.site-nav { flex-wrap: wrap; justify-content: flex-end; }
.nav-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 6px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 10px; font-weight: 680; letter-spacing: .03em; text-decoration: none; transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.nav-button:hover, .nav-button:focus-visible, .nav-button.is-active { outline: none; background: rgba(255, 255, 255, .05); color: var(--text); }
.nav-dropdown { position: relative; }
.nav-dropdown summary { list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown-panel { position: absolute; z-index: 30; top: calc(100% + 9px); right: 0; display: grid; gap: 2px; min-width: 164px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, rgba(29, 31, 37, .97), rgba(13, 14, 18, .97)); box-shadow: 0 21px 52px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); }
.nav-dropdown-panel .nav-button { justify-content: flex-start; min-height: 34px; padding: 8px 10px; font-size: 11px; }

.dashboard-main { padding: clamp(48px, 7vw, 86px) 0 20px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 12px; color: var(--text-muted); font-size: 12px; font-weight: 650; letter-spacing: .14em; }
.dashboard-heading h1 { max-width: 780px; margin: 0; font-size: clamp(42px, 7vw, 82px); line-height: .95; font-weight: 720; letter-spacing: -.068em; }
.dashboard-heading p:not(.eyebrow) { max-width: 590px; margin: 20px 0 0; color: var(--text-soft); font-size: 17px; line-height: 1.7; letter-spacing: -.015em; }
.data-status { display: inline-flex; align-items: center; gap: 8px; flex: none; padding-bottom: 6px; color: var(--text-muted); font-size: 12px; font-weight: 650; letter-spacing: .10em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(138, 180, 255, .48); }

.control-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(180deg, rgba(255, 255, 255, .060), rgba(255, 255, 255, .035)); box-shadow: 0 24px 62px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .045); backdrop-filter: blur(26px) saturate(135%); -webkit-backdrop-filter: blur(26px) saturate(135%); }
.date-stepper { display: flex; align-items: center; min-width: 0; gap: 10px; }
.icon-button { width: 42px; height: 42px; display: grid; flex: none; place-items: center; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: rgba(5, 6, 8, .42); color: var(--text-soft); cursor: pointer; font-size: 19px; line-height: 1; transition: background 160ms ease, border-color 160ms ease, color 160ms ease; }
.icon-button:hover, .icon-button:focus-visible { border-color: rgba(138, 180, 255, .52); outline: none; background: var(--accent-soft); color: var(--accent-bright); }
.date-display { display: grid; gap: 4px; min-width: 0; cursor: pointer; }
.date-display > span, .dashboard-controls label { color: var(--text-muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.date-display time { overflow: hidden; color: var(--text); font-size: 16px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
.dashboard-controls { display: flex; align-items: end; gap: 10px; }
.dashboard-controls label { display: grid; gap: 7px; min-width: 74px; }
.date-input-label { min-width: auto !important; }
.dashboard-controls input, .dashboard-controls select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: rgba(5, 6, 8, .42); color: var(--text); font-size: 14px; outline: none; }
.dashboard-controls input { width: 42px; min-width: 42px; padding: 0 4px; color-scheme: dark; }
.dashboard-controls input:focus, .dashboard-controls select:focus { border-color: rgba(138, 180, 255, .52); box-shadow: 0 0 0 3px rgba(138, 180, 255, .10); }
.primary-button { min-height: 42px; padding: 9px 13px; border: 1px solid rgba(138, 180, 255, .30); border-radius: var(--radius-sm); background: rgba(138, 180, 255, .10); color: var(--accent-bright); cursor: pointer; font-size: 14px; font-weight: 700; white-space: nowrap; }
.primary-button:hover, .primary-button:focus-visible { border-color: rgba(138, 180, 255, .52); outline: none; background: rgba(138, 180, 255, .16); }
.control-note { grid-column: 1 / -1; min-height: 20px; margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.dashboard-grid { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(0, 1.72fr); gap: 18px; align-items: start; }
.surface-panel { min-width: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .025); box-shadow: 0 20px 52px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .025); }
.meals-panel, .learning-panel { padding: 24px; }
.panel-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading-row .eyebrow { margin-bottom: 8px; }
.panel-heading-row h2 { margin: 0; font-size: 26px; font-weight: 680; letter-spacing: -.045em; }
.panel-meta { flex: none; color: var(--text-muted); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-align: right; }
.meal-list { display: grid; gap: 10px; }
.meal-card { min-width: 0; padding: 17px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(255, 255, 255, .018); }
.meal-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); }
.meal-card h3 { margin: 0; color: var(--accent); font-size: 14px; font-weight: 720; }
.meal-calories { color: var(--text-muted); font-size: 12px; }
.dish-list { display: grid; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; color: var(--text-soft); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.dish-list li::before { content: "•"; margin-right: 8px; color: var(--accent); }
.meal-empty, .day-empty { margin: 13px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }

.academic-week-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.academic-day { min-width: 0; padding: 16px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255, 255, 255, .018); }
.academic-day.is-selected { border-color: rgba(138, 180, 255, .34); background: rgba(138, 180, 255, .055); }
.day-data-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-data-heading time { color: var(--text); font-size: 14px; font-weight: 680; }
.academic-section { min-width: 0; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.academic-label { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.lesson-list, .event-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.lesson-item { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: baseline; gap: 8px; }
.period { color: var(--text-muted); font-size: 12px; font-weight: 650; }
.subject { color: var(--text-soft); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.event-item { display: grid; gap: 4px; padding: 9px 10px; border-radius: 10px; background: var(--accent-soft); }
.event-name { color: rgba(205, 223, 255, .96); font-size: 14px; font-weight: 670; line-height: 1.4; overflow-wrap: anywhere; }
.event-description { color: var(--text-soft); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.empty-state { margin: 0; padding: 24px 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.empty-state.is-error { color: var(--danger); }
.source-note { margin: 16px 2px 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: auto; padding-top: 43px; color: rgba(255, 255, 255, .27); font-size: 8px; font-weight: 690; letter-spacing: .14em; }

@media (max-width: 1100px) {
  .control-panel { grid-template-columns: 1fr; }
  .dashboard-controls { justify-content: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-header, .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .site-nav { justify-content: flex-start; }
  .dashboard-main { padding-top: 48px; }
  .dashboard-heading h1 { font-size: clamp(42px, 14vw, 66px); }
  .dashboard-heading p:not(.eyebrow) { font-size: 16px; }
  .data-status { padding-bottom: 0; }
  .control-panel, .meals-panel, .learning-panel { padding: 18px; }
  .dashboard-controls { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; width: 100%; }
  .dashboard-controls label { min-width: 0; }
  .dashboard-controls .primary-button { padding-inline: 11px; }
  .panel-heading-row h2 { font-size: 23px; }
  .academic-week-grid { grid-template-columns: 1fr; }
}
@media (max-width: 570px) {
  .site-shell { padding-top: 20px; padding-bottom: 25px; }
  .site-header { gap: 14px; padding-bottom: 17px; }
  .brand-name { font-size: 10px; }
  .site-nav { gap: 1px; }
  .nav-links, .nav-auth { gap: 0; }
  .nav-button { min-height: 29px; padding: 5px 6px; font-size: 9px; }
  .nav-dropdown-panel { right: auto; left: 0; }
  .nav-auth .nav-dropdown-panel { right: 0; left: auto; }
  .site-footer { padding-top: 32px; }
}
@media (max-width: 430px) {
  .date-display time { font-size: 14px; }
  .dashboard-controls { grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); }
  .dashboard-controls .primary-button { grid-column: 2 / 4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
