/* ============================================================================
   Full-Screen Kotitonttu Weather Canvas + Liquid Glass Translucent Cards
   ============================================================================ */
:root,
:root[data-theme="light"] {
  --canvas-bg: #e9e4da;
  --glass-bg: rgba(252, 249, 243, 0.78);
  --glass-bg-strong: rgba(253, 250, 245, 0.9);
  --glass-border: rgba(255, 255, 255, 0.62);
  --glass-inner-glow: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 20px 46px rgba(32, 28, 22, 0.14), 0 2px 10px rgba(32, 28, 22, 0.06);
  --ink: #221d18;
  --ink-soft: #4e463d;
  --ink-muted: #756c60;
  --accent: #b85a34;
  --sage: #3f664b;
  --ochre: #9f6b1b;
  --slate-blue: #395e7a;
  --berry: #a43b4b;
  --wash: rgba(34, 29, 24, 0.06);
  --hairline: rgba(34, 29, 24, 0.12);
  --nb-paper-top: #fdfaf1;
  --nb-paper-bottom: #f4eedf;
  --nb-paper-border: rgba(160, 146, 122, 0.42);
  --nb-stack-1: #e6dfd0;
  --nb-stack-2: #d6cebc;
  --nb-rule: rgba(114, 148, 188, 0.3);
  --nb-ink: #1e1a16;
  --nb-school: #2e5b41;
  --nb-muted: #766d61;
  --nb-orange: #cf5c14;
  --nb-ring-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='34' viewBox='0 0 38 34'%3E%3Ccircle cx='19' cy='24' r='4.4' fill='%2329241e' fill-opacity='0.62'/%3E%3Ccircle cx='19' cy='24.6' r='3.6' fill='%23161310' fill-opacity='0.48'/%3E%3Cpath d='M15.4 24.5 C12.8 18 13.4 4.5 19 4.5 C24.6 4.5 25.2 18 22.6 24.5' fill='none' stroke='%234c4943' stroke-width='3.2' stroke-linecap='round'/%3E%3Cpath d='M15.4 24.2 C13.2 18 13.8 5.2 19 5.2 C24.2 5.2 24.8 18 22.6 24.2' fill='none' stroke='%23d4cfc6' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --canvas-bg: #101624;
  --glass-bg: rgba(15, 20, 32, 0.74);
  --glass-bg-strong: rgba(18, 23, 36, 0.9);
  --glass-border: rgba(255, 247, 234, 0.16);
  --glass-inner-glow: rgba(255, 248, 235, 0.18);
  --glass-shadow: 0 22px 52px rgba(4, 7, 15, 0.48), 0 2px 10px rgba(4, 7, 15, 0.25);
  --ink: #f6efe4;
  --ink-soft: #d2c8ba;
  --ink-muted: #a1978b;
  --accent: #ea986b;
  --sage: #91c09d;
  --ochre: #e8ba62;
  --slate-blue: #95bddb;
  --berry: #e88997;
  --wash: rgba(255, 248, 236, 0.09);
  --hairline: rgba(255, 248, 236, 0.14);
  --nb-paper-top: #343840;
  --nb-paper-bottom: #2b2f36;
  --nb-paper-border: rgba(255, 255, 255, 0.12);
  --nb-stack-1: #23262d;
  --nb-stack-2: #1b1e24;
  --nb-rule: rgba(206, 216, 232, 0.14);
  --nb-ink: #f2eee7;
  --nb-school: #96c7a3;
  --nb-muted: #a3a7b0;
  --nb-orange: #f29446;
  --nb-ring-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='34' viewBox='0 0 38 34'%3E%3Ccircle cx='19' cy='24' r='4.4' fill='%230d1016' fill-opacity='0.82'/%3E%3Ccircle cx='19' cy='24.6' r='3.6' fill='%2306080c' fill-opacity='0.75'/%3E%3Cpath d='M15.4 24.5 C12.8 18 13.4 4.5 19 4.5 C24.6 4.5 25.2 18 22.6 24.5' fill='none' stroke='%23565c67' stroke-width='3.2' stroke-linecap='round'/%3E%3Cpath d='M15.4 24.2 C13.2 18 13.8 5.2 19 5.2 C24.2 5.2 24.8 18 22.6 24.2' fill='none' stroke='%23aeb4bf' stroke-width='1.15' stroke-linecap='round'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background-color: var(--canvas-bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--ink-muted);
}

/* ============================================================================
   Full-Viewport Edge-to-Edge Kotitonttu Scene Backdrop
   ============================================================================ */
.fullscreen-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--canvas-bg);
  pointer-events: none;
}

.fullscreen-scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  transform: scale(1.01);
  transition: opacity 0.45s ease;
}

.fullscreen-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(9, 13, 22, 0.56) 0%,
      rgba(9, 13, 22, 0.24) 22%,
      rgba(9, 13, 22, 0.06) 44%,
      rgba(9, 13, 22, 0.28) 100%
    );
}

/* ============================================================================
   Liquid Glass Surface Material
   Mostly hides underlying artwork for effortless legibility while letting
   soft weather colors & warm lantern light refract through the glass.
   ============================================================================ */
.liquid-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-inner-glow),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
}

/* ============================================================================
   Sign-In / Loading Gate
   ============================================================================ */
.gate-screen {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.gate-card {
  width: 100%;
  max-width: 390px;
  text-align: center;
  padding: 32px 26px;
  border-radius: 30px;
}

.gate-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.gate-card h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.gate-card p {
  margin: 0 0 26px;
  line-height: 1.55;
  font-size: 0.98rem;
}

.btn-google,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-google {
  width: 100%;
  background: var(--ink);
  color: var(--canvas-bg);
}

.btn-secondary {
  background: var(--wash);
  color: var(--ink);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: 100%;
}

.btn-google:active,
.btn-secondary:active {
  transform: scale(0.98);
}

.error-text {
  color: var(--berry);
  font-size: 0.9rem;
  margin-top: 14px !important;
  margin-bottom: 0 !important;
}

/* ============================================================================
   Immersive 4-Quarter Canvas
   - Quarter 1 (Top-Left): Completely open window onto the Kotitonttu scene
   - Quarters 2, 3, 4: Rounded Liquid Glass cards hovering over the scene
   ============================================================================ */
.quad-canvas {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(14px, 1.8vw, 22px);
  width: 100vw;
  height: 100dvh;
  padding:
    max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-top))
    max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-right))
    max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-bottom))
    max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-left));
  overflow: hidden;
}

.quad {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.quad-card {
  border-radius: 28px;
  padding: clamp(18px, 2.2vw, 28px) clamp(20px, 2.5vw, 32px);
}

.quad-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.quad-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 2vw, 1.72rem);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
}

.quad-sub {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.subtle-link {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.subtle-link:hover {
  text-decoration: underline;
}

/* Scrollable internal regions */
.scroll-region {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

.scroll-region::-webkit-scrollbar {
  width: 5px;
}

.scroll-region::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 999px;
}

/* ============================================================================
   Quarter 1: Open Window onto Kotitonttu Scene + Unified Boxless Heading Line
   ============================================================================ */
.quad-weather {
  color: #fbf5eb;
  overflow: visible;
}

.weather-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  padding: clamp(6px, 1vw, 14px) clamp(8px, 1.2vw, 14px);
  pointer-events: none;
}

.hero-heading-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 2.2vw, 28px);
  width: 100%;
}

.time-cluster {
  flex-shrink: 0;
}

.hero-clock {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 4.3vw, 3.9rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.62), 0 1px 4px rgba(0, 0, 0, 0.55);
}

.hero-date {
  margin-top: 5px;
  font-size: clamp(0.92rem, 1.18vw, 1.06rem);
  font-weight: 500;
  color: rgba(251, 245, 235, 0.94);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Boxless inline weather link on right side of heading line */
.weather-inline {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  color: #fbf5eb;
  text-decoration: none;
  min-width: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72), 0 1px 4px rgba(0, 0, 0, 0.65);
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.weather-inline:hover {
  opacity: 0.92;
}

.weather-inline:active {
  transform: scale(0.98);
}

.weather-glyph {
  font-size: clamp(3.1rem, 4.8vw, 4.4rem);
  line-height: 0.95;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.45));
}

.weather-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: clamp(0.92rem, 1.18vw, 1.06rem);
  line-height: 1.24;
}

.weather-line-head {
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-line-sub {
  font-weight: 500;
  color: rgba(251, 245, 235, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quiet Controls (Fullscreen + Account) stacked vertically on left below Time/Date */
.quiet-controls {
  pointer-events: auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.quiet-icon-btn,
.quiet-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(251, 245, 235, 0.28);
  background: rgba(15, 20, 32, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fbf5eb;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.86rem;
  opacity: 0.62;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.quiet-icon-btn:hover,
.quiet-user:hover {
  opacity: 1;
}

.quiet-user-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-popover {
  position: absolute;
  top: 112px;
  left: 52px;
  z-index: 25;
  width: 240px;
  background: var(--glass-bg-strong);
  color: var(--ink);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.account-email,
.account-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.account-meta {
  margin-bottom: 6px;
}

/* ============================================================================
   Quarter 2: School Lunch (Frameless over Scene + Prominent Illustrated Tiles)
   ============================================================================ */
.quad-lunch {
  padding: clamp(6px, 1vw, 14px) clamp(8px, 1.2vw, 14px);
  color: #fbf5eb;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72), 0 1px 4px rgba(0, 0, 0, 0.62);
}

.quad-lunch .quad-head {
  margin-bottom: 10px;
  padding: 0 6px;
}

.quad-lunch .quad-head h2 {
  color: #ffffff;
}

.quad-lunch .quad-sub {
  color: rgba(251, 245, 235, 0.88);
}

.lunch-pdf-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(251, 245, 235, 0.9);
  background: rgba(15, 20, 32, 0.34);
  border: 1px solid rgba(251, 245, 235, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}

.lunch-pdf-icon:hover {
  background: rgba(15, 20, 32, 0.56);
  color: #ffffff;
}

.lunch-pdf-icon:active {
  transform: scale(0.95);
}

.lunch-swipe-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  touch-action: pan-y;
  user-select: none;
}

.swipe-hint {
  flex-shrink: 0;
  width: 30px;
  height: 48px;
  border: none;
  background: transparent;
  color: rgba(251, 245, 235, 0.9);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 999px;
  opacity: 0.78;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.swipe-hint:hover:not(:disabled) {
  opacity: 1;
  background: rgba(15, 20, 32, 0.34);
}

.swipe-hint:disabled {
  opacity: 0.18;
  cursor: default;
}

.lunch-body {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 6px;
}

.lunch-stage-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lunch-stage-inner.cols-2 {
  max-width: 82%;
}

.lunch-day-caption {
  font-size: clamp(0.88rem, 1.12vw, 1rem);
  font-weight: 600;
  color: rgba(251, 245, 235, 0.94);
  text-align: left;
  padding-left: 2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.72);
}

.lunch-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.3vw, 18px);
  width: 100%;
  align-items: start;
}

.lunch-tiles.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lunch-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-width: 0;
}

.lunch-tile-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: clamp(122px, 20vh, 205px);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(15, 20, 32, 0.3);
  border: 1px solid rgba(255, 248, 238, 0.24);
  box-shadow: 0 14px 32px rgba(5, 8, 16, 0.42), 0 2px 8px rgba(5, 8, 16, 0.28);
}

.lunch-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lunch-tile-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 20, 32, 0.72);
  color: #f6efe4;
  text-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lunch-tile-badge.badge-vegan {
  background: rgba(45, 96, 58, 0.85);
  color: #f0faf2;
}

.lunch-tile-badge.badge-sides {
  background: rgba(126, 86, 32, 0.84);
  color: #fdf6ea;
}

.lunch-tile-label {
  font-size: clamp(0.84rem, 1.08vw, 0.96rem);
  font-weight: 600;
  line-height: 1.28;
  color: #fbf5eb;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82), 0 1px 3px rgba(0, 0, 0, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lunch-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 0 6px;
  flex-shrink: 0;
}

.lunch-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lunch-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(251, 245, 235, 0.45);
  transition: width 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.lunch-dot.active {
  width: 18px;
  background: #ffffff;
}

/* ============================================================================
   Quarter 3: Top-Ringed Lined Notebook 7-Day School & Hobby Schedule
   ============================================================================ */
.quad-schedule.notebook-card {
  position: relative;
  margin-top: 10px;
  border-radius: 14px 14px 20px 20px;
  padding: clamp(32px, 3.6vh, 40px) clamp(20px, 2.4vw, 30px) clamp(14px, 1.8vh, 22px);
  background: linear-gradient(180deg, var(--nb-paper-top) 0%, var(--nb-paper-bottom) 100%);
  border: 1px solid var(--nb-paper-border);
  box-shadow:
    0 3px 0 -1px var(--nb-stack-1),
    0 6px 0 -2px var(--nb-stack-2),
    0 18px 40px rgba(10, 12, 18, 0.32);
  color: var(--nb-ink);
  overflow: visible;
}

.notebook-rings {
  position: absolute;
  top: -13px;
  left: 20px;
  right: 20px;
  height: 34px;
  background-image: var(--nb-ring-svg);
  background-repeat: repeat-x;
  background-position: center top;
  background-size: 38px 34px;
  pointer-events: none;
  z-index: 3;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  min-height: 100%;
}

.sched-day {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(98px, 10.6vw, 124px) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(12px, 1.4vw, 20px);
  padding: 5px 4px;
  min-width: 0;
  border-bottom: 1px solid var(--nb-rule);
}

.sched-day:last-child {
  border-bottom: none;
}

.sched-day-name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(0.95rem, 1.22vw, 1.06rem);
  color: var(--nb-ink);
  white-space: nowrap;
}

.sched-day-summary {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.sched-school-hours {
  font-size: clamp(0.85rem, 1.08vw, 0.95rem);
  font-weight: 600;
  color: var(--nb-school);
}

.sched-school-hours.closed,
.sched-school-hours.early {
  color: var(--nb-orange);
}

.sched-school-hours.weekend {
  color: var(--nb-muted);
  font-weight: 500;
}

.sched-sep {
  color: var(--nb-muted);
  opacity: 0.7;
  font-weight: 600;
}

.sched-hobby {
  font-size: clamp(0.85rem, 1.08vw, 0.95rem);
  font-weight: 600;
  color: var(--nb-ink);
}

/* ============================================================================
   Quarter 4: Household Task List (Liquid Glass Card)
   ============================================================================ */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-bullet {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.8px solid var(--ink-muted);
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.65;
}

.task-row.overdue .task-bullet {
  border-color: var(--berry);
  opacity: 1;
}

.task-row.soon .task-bullet {
  border-color: var(--accent);
  opacity: 1;
}

.task-main {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.task-sub {
  font-size: 0.79rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.task-due {
  flex-shrink: 0;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--ink-muted);
  padding-top: 1px;
}

.task-row.overdue .task-due {
  color: var(--berry);
}

.task-row.soon .task-due {
  color: var(--accent);
}

.empty-note {
  color: var(--ink-muted);
  font-size: 0.94rem;
  font-style: italic;
}

/* ============================================================================
   Overnight Kitchen Night Rest Overlay (10:30 PM – 6:30 AM)
   ============================================================================ */
.night-rest {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #040507;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.85s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.night-rest.is-active {
  opacity: 1;
  pointer-events: auto;
}

.night-rest-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transform: translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0);
  transition: transform 4.5s ease-in-out;
  will-change: transform;
}

.night-kotitonttu-wrap {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 6px;
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 48%, rgba(0, 0, 0, 0) 96%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 48%, rgba(0, 0, 0, 0) 96%);
}

.night-kotitonttu-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 22%;
  opacity: 0.34;
  filter: brightness(0.62) saturate(0.72);
  display: block;
}

.night-clock {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.8rem, 5.2vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: rgba(236, 228, 214, 0.36);
}

.night-date {
  font-size: 0.96rem;
  font-weight: 500;
  color: rgba(236, 228, 214, 0.24);
}

.night-hint {
  margin-top: 8px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(236, 228, 214, 0.16);
}

/* ============================================================================
   Mobile Layout (< 820px): Full-Screen Scene Behind 1 Open Hero + 3 Glass Cards
   ============================================================================ */
@media (max-width: 819px) {
  .fullscreen-scene {
    object-position: 18% top;
  }

  .quad-canvas {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding:
      max(14px, env(safe-area-inset-top))
      14px
      calc(24px + env(safe-area-inset-bottom))
      14px;
    gap: 16px;
    overflow: visible;
  }

  .quad-weather {
    min-height: 290px;
  }

  .weather-overlay {
    min-height: 290px;
    padding: 4px 2px 6px;
  }

  .hero-heading-line {
    align-items: flex-start;
    gap: 10px;
  }

  .hero-clock {
    font-size: 2.35rem;
  }

  .hero-date,
  .weather-lines {
    font-size: 0.84rem;
  }

  .weather-glyph {
    font-size: 2.75rem;
  }

  #btn-fullscreen {
    display: none;
  }

  .quad-lunch {
    padding: 8px 2px 4px;
  }

  .quad-card {
    border-radius: 26px;
    padding: 20px 16px;
    overflow: visible;
  }

  .quad-schedule.notebook-card {
    border-radius: 14px 14px 18px 18px;
    padding: 32px 16px 16px;
    margin-top: 12px;
  }

  .sched-day {
    grid-template-columns: 92px minmax(0, 1fr);
    column-gap: 10px;
    padding: 7px 2px;
  }

  .lunch-tiles {
    gap: 10px;
  }

  .lunch-stage-inner.cols-2 {
    max-width: 100%;
  }

  .lunch-tile-frame {
    border-radius: 16px;
    max-height: 150px;
  }

  .lunch-tile-label {
    font-size: 0.78rem;
  }

  .scroll-region {
    overflow-y: visible;
    max-height: none;
  }

  .quad-schedule .scroll-region {
    max-height: 440px;
    overflow-y: auto;
  }
}
