/* ========================================
   Daily Log & Planner — Full Styles
   Phase 1 + Phase 2: search, tags, delight
   cards, dark mode, settings bar, static
   gradient background layer
   ======================================== */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --primary: #3d5ae6;
  --primary-light: #eef1ff;
  --primary-text: #ffffff;
  --success: #2ec4b6;
  --success-light: #e8f8f6;
  --danger: #e63946;
  --danger-light: #fdeaec;
  --amber: #e9a84c;
  --amber-light: #fef6e8;
  --purple: #7c5cbf;
  --purple-light: #f0ecf8;
  /* *-text variants are the same hues darkened until they read at 4.5:1 on
     the translucent cards and on their *-light tints; the base colours stay
     for fills, borders and dots. */
  --danger-text: #b42332;
  --success-text: #157a70;
  --amber-text: #946012;
  --purple-text: #6a4aad;
  --text: #1d1d1f;
  --text-secondary: #5a5a61;
  --text-muted: #69696f;
  --border: #e5e5ea;
  --border-light: #f2f2f4;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --tab-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Background layer (#bg). --bg-scrim/--bg-blur are transparent/off for the
     static gradient; set them when a video is dropped behind .bg-scrim. */
  --bg-gradient: linear-gradient(165deg, #f8f3ec 0%, #f3f2f3 45%, #e9eef6 100%);
  --bg-scrim: transparent;
  --bg-blur: 0px;

  /* Frosted glass. --glass-bg is for the many small surfaces (cards, list
     rows, inputs): translucent only, never blurred. --glass-bg-strong is for
     the handful of large blurred surfaces (header, tab bar, settings bar,
     menus, dialogs). --glass-bg-login is the sign-in card, which must stay
     readable over any video frame. --glass-solid replaces all three when
     backdrop-filter is unavailable or the user prefers less transparency. */
  --glass-bg: rgba(255, 255, 255, 0.52);
  --glass-bg-strong: rgba(255, 255, 255, 0.70);
  --glass-bg-login: rgba(255, 255, 255, 0.78);
  --glass-solid: #fbfbfd;
  --glass-well: rgba(29, 29, 31, 0.06);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-blur: 12px;
  --glass-shadow: 0 6px 20px rgba(40, 50, 90, 0.10);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  /* Login card only: a diagonal sheen over the base fill, a brighter edge, a
     deeper lift shadow and a saturate() in the backdrop so the frosted look
     reads even over a dark frame. The sheen never lowers the fill below
     --glass-bg-login, which is what the contrast figures are measured at. */
  --glass-sheen: linear-gradient(155deg, rgba(255, 255, 255, 0.60) 0%, rgba(255, 255, 255, 0) 48%, rgba(255, 255, 255, 0.22) 100%);
  --glass-border-login: rgba(255, 255, 255, 0.95);
  --glass-shadow-login: 0 24px 60px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  --glass-saturate: 1.6;
  --accent-glow: rgba(61, 90, 230, 0.30);
  --accent-glow-soft: rgba(61, 90, 230, 0.14);
  --scrim-opacity: 0.40;
  /* Resolved per theme (a var() inside a custom property is computed where it
     is declared, so body.dark must restate it). */
  --card-shadow: var(--glass-highlight), inset 0 0 0 1px var(--glass-border), var(--shadow);
}

/* ── Dark mode ── */
body.dark {
  --bg: #1a1a2e;
  --surface: #222240;
  --primary: #7d98ff;
  --primary-light: #2a2a50;
  --primary-text: #0f1330;  /* white on this blue is only ~3:1 */
  --success: #3dd9c9;
  --success-light: #1e3a36;
  --danger: #ff6b7a;
  --danger-light: #3a2028;
  --amber: #f0b060;
  --amber-light: #3a3020;
  --purple: #a88de0;
  --purple-light: #2e2848;
  --danger-text: #ff8d99;
  --success-text: #5ae3d5;
  --amber-text: #f0b060;
  --purple-text: #b8a0ea;
  --text: #e8e8f0;
  --text-secondary: #a6a6bf;
  --text-muted: #9494ad;
  --border: #333355;
  --border-light: #282845;
  --shadow: 0 1px 4px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --bg-gradient: linear-gradient(165deg, #1f2238 0%, #1a1f36 45%, #121a2c 100%);

  --glass-bg: rgba(44, 46, 80, 0.50);
  --glass-bg-strong: rgba(30, 32, 58, 0.72);
  --glass-bg-login: rgba(30, 32, 58, 0.82);
  --glass-solid: #24264a;
  --glass-well: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-sheen: linear-gradient(155deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 48%, rgba(255, 255, 255, 0.04) 100%);
  --glass-border-login: rgba(255, 255, 255, 0.22);
  --glass-shadow-login: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --glass-saturate: 1.4;
  --accent-glow: rgba(125, 152, 255, 0.38);
  --accent-glow-soft: rgba(125, 152, 255, 0.16);
  --scrim-opacity: 0.46;
  --card-shadow: var(--glass-highlight), inset 0 0 0 1px var(--glass-border), var(--shadow);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

/* ── Background layer ── */
#bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: var(--bg-gradient);
  transition: background .3s;
}
#bg > video, #bg > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.bg-scrim {
  position: absolute; inset: 0;
  background: var(--bg-scrim);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
}

/* ── Screens ── */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  padding: 16px 16px calc(var(--tab-height) + var(--safe-bottom) + 16px);
  min-height: 100dvh;
  animation: fadeIn .18s ease;
}
.screen.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }

/* ── Header ── */
.screen-header {
  padding: 12px 0 6px; position: sticky; top: 0; z-index: 10;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 1px 0 var(--glass-border);
}
.header-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.header-controls { display:flex; align-items:center; gap:8px; }
.screen-header h1 {
  font-size:1.65rem; font-weight:700; letter-spacing:-.02em;
  display:flex; align-items:center; gap:8px;
}
.subtitle { font-size:.85rem; color:var(--text-secondary); margin-top:2px; }

/* ── App Logo ── */
.app-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.app-logo svg {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

/* ── Days logged badge ── */
.days-badge {
  font-size:.7rem; font-weight:600; padding:3px 10px;
  background:var(--success-light); color:var(--success-text);
  border-radius:12px; white-space:nowrap;
}
/* Title + badge + date + account do not fit side by side under ~420px; the
   badge is the one decorative piece, so it steps aside. */
@media (max-width:420px) { .days-badge { display:none; } }

/* ── Inputs & Date Picker Wrapper (Consistent DD/MM/YYYY) ── */
.date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.date-picker-display {
  font-family: inherit;
  font-size: .85rem;
  padding: 6px 30px 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text);
  min-width: 110px;
  max-width: 130px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.date-picker-display:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.date-picker-display::placeholder {
  color: var(--text-muted);
}
.date-picker-btn {
  position: absolute;
  right: 8px;
  font-size: .85rem;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
.date-picker-native {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
}
.task-date-wrap {
  flex: 0 0 auto;
}
.task-date-display {
  font-size: .95rem;
  padding: 14px 50px 14px 14px;
  border-radius: var(--radius);
  min-width: 155px;
  max-width: 185px;
}
.date-clear-btn {
  position: absolute;
  right: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .75rem;
  width: 20px;
  height: 20px;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  z-index: 2;
}
.date-clear-btn:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.input-area { margin:6px 0 14px; }
.big-input {
  width:100%; font-family:inherit; font-size:1.05rem; padding:14px 16px;
  border:1.5px solid var(--border); border-radius:var(--radius);
  background:var(--glass-bg); color:var(--text); resize:none;
  transition:border-color .15s,box-shadow .15s; box-shadow:var(--glass-highlight), var(--shadow);
}
.big-input::placeholder { color:var(--text-muted); }
.big-input:hover { border-color:var(--primary); }
.big-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--accent-glow),var(--shadow); }

.search-input { font-size:.92rem; padding:10px 14px; }

.task-input-area { display:flex; gap:8px; flex-wrap:wrap; }
.task-input-area .big-input { flex:1; min-width:0; }

.jump-highlight {
  animation: jumpPulse 1.8s ease;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin: -4px -8px;
}
@keyframes jumpPulse {
  0% { background: var(--primary-light); }
  50% { background: var(--amber-light); }
  100% { background: transparent; }
}

/* ── Filter bar ── */
.filter-bar {
  display:flex; gap:6px; overflow-x:auto; padding:4px 0 12px;
  -webkit-overflow-scrolling:touch; scrollbar-width:none;
}
.filter-bar::-webkit-scrollbar { display:none; }
.filter-chip {
  font-family:inherit; font-size:.8rem; font-weight:500; padding:5px 13px;
  border:1.5px solid var(--border); border-radius:20px;
  background:var(--glass-bg); color:var(--text-secondary);
  cursor:pointer; white-space:nowrap; transition:all .15s;
}
.filter-chip:hover { border-color:var(--primary); color:var(--primary); box-shadow:0 0 0 3px var(--accent-glow-soft); }
.filter-chip.active { background:var(--primary); border-color:var(--primary); color:var(--primary-text); }
.filter-chip.tag-chip { border-color:var(--purple); color:var(--purple-text); }
.filter-chip.tag-chip.active { background:var(--purple); border-color:var(--purple); color:#fff; }

/* ── Delight cards (reflection, OTD, random lesson) ── */
.delight-card {
  padding:14px 16px; border-radius:var(--radius);
  background:var(--glass-bg); box-shadow:var(--card-shadow); margin-bottom:12px;
}
.delight-header { display:flex; align-items:center; gap:6px; margin-bottom:8px; font-size:.85rem; }
.delight-icon { font-size:1.1rem; }
.delight-text { font-size:.88rem; color:var(--text-secondary); line-height:1.5; font-style:italic; }

.reflection-card { border-left:3px solid var(--amber); }
.otd-card { border-left:3px solid var(--primary); }
.otd-entries { display:flex; flex-direction:column; gap:6px; }
.otd-entry { font-size:.85rem; color:var(--text); }
.otd-entry-date { font-size:.7rem; color:var(--text-muted); font-weight:600; }
.random-card { border-left:3px solid var(--purple); }

/* ── Carry-over banner ── */
.carryover-banner {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:10px 14px; border-radius:var(--radius-sm);
  background:var(--amber-light); font-size:.85rem; color:var(--text);
  margin-bottom:10px;
}

/* ── Weekly rhythm view ── */
.rhythm-view {
  display:flex; gap:3px; align-items:flex-end; margin-top:4px;
}
.rhythm-day {
  width:12px; height:12px; border-radius:3px;
  background:var(--border-light); transition:background .15s;
}
.rhythm-day.has-entries { background:var(--success); opacity:.7; }
.rhythm-day.today { outline:2px solid var(--primary); outline-offset:1px; }

/* ── Entry items (Today) ── */
.entries-list { display:flex; flex-direction:column; gap:6px; }
.entry-item {
  padding:12px 14px; background:var(--glass-bg); border-radius:var(--radius);
  box-shadow:var(--card-shadow); animation:slideIn .2s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.entry-row { display:flex; align-items:flex-start; gap:10px; }
.entry-time { font-size:.72rem; font-weight:600; color:var(--primary); white-space:nowrap; padding-top:3px; min-width:38px; }
.entry-text { flex:1; font-size:.925rem; color:var(--text); word-break:break-word; line-height:1.45; }
.entry-text[contenteditable="true"] {
  outline:none; background:var(--primary-light); border-radius:4px; padding:2px 4px; margin:-2px -4px;
}
.entry-actions { display:flex; gap:2px; flex-shrink:0; }
.entry-btn, .lesson-btn {
  font-size:.8rem; width:30px; height:30px; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:50%; background:transparent; color:var(--text-muted);
  cursor:pointer; transition:all .15s;
}
.entry-btn:hover, .lesson-btn:hover { background:var(--border-light); color:var(--text-secondary); }
.entry-btn.delete:hover, .lesson-btn.delete:hover { background:var(--danger-light); color:var(--danger); }
.entry-btn.saved { color:var(--success); cursor:default; font-size:.7rem; }

/* ── Transfer forms (inline) ── */
.transfer-form {
  margin-top:8px; padding-top:8px; border-top:1px solid var(--border-light);
  display:flex; gap:6px; align-items:center; flex-wrap:wrap;
}
.transfer-input {
  flex:1; min-width:120px; font-family:inherit; font-size:.82rem; padding:7px 10px;
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:var(--glass-bg); color:var(--text); transition:border-color .15s, box-shadow .15s;
}
.transfer-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--accent-glow); }
.btn-sm {
  font-family:inherit; font-size:.78rem; font-weight:600; padding:6px 12px;
  border:none; border-radius:var(--radius-sm); cursor:pointer; transition:all .15s; white-space:nowrap;
}
.btn-primary { background:var(--primary); color:var(--primary-text); }
.btn-primary:hover { opacity:.9; box-shadow:0 0 0 3px var(--accent-glow-soft); }
.btn-ghost { background:transparent; color:var(--text-muted); }
.btn-ghost:hover { color:var(--text-secondary); }
.btn-danger-ghost { background:transparent; color:var(--amber-text); font-weight:500; }
.btn-danger-ghost:hover { color:var(--danger); }
.hidden { display:none !important; }

/* ── Task list ── */
.task-list { display:flex; flex-direction:column; gap:6px; }
.task-section-label {
  font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); padding:12px 0 4px;
}
.task-item {
  display:flex; align-items:center; gap:10px; padding:12px 14px;
  background:var(--glass-bg); border-radius:var(--radius); box-shadow:var(--card-shadow);
  animation:slideIn .2s ease;
}
.task-checkbox {
  width:22px; height:22px; flex-shrink:0; appearance:none; -webkit-appearance:none;
  border:2px solid var(--border); border-radius:6px; cursor:pointer; transition:all .15s; position:relative;
}
.task-checkbox:checked { background:var(--success); border-color:var(--success); }
.task-checkbox:checked::after {
  content:'✓'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  font-size:14px; color:#06302b; font-weight:700;
}
.task-content { flex:1; min-width:0; }
.task-text { font-size:.925rem; color:var(--text); word-break:break-word; }
.task-item.done .task-text { text-decoration:line-through; color:var(--text-muted); }
.task-text[contenteditable="true"] {
  outline:none; background:var(--primary-light); border-radius:4px; padding:2px 4px; margin:-2px -4px;
}
.task-due { font-size:.68rem; font-weight:500; color:var(--text-muted); margin-top:2px; }
.task-due.overdue { color:var(--amber-text); }
.task-due.today { color:var(--primary); font-weight:600; }
.task-recurring-badge { font-size:.6rem; font-weight:600; color:var(--purple-text); margin-left:4px; }
.task-delete {
  font-size:1rem; width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:50%; background:transparent; color:var(--text-muted);
  cursor:pointer; flex-shrink:0; transition:all .15s;
}
.task-delete:hover { background:var(--danger-light); color:var(--danger); }

/* ── Completed section (collapsed by default) ── */
.completed-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 4px;
}
.completed-section > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 2px;
}
.completed-section > summary::-webkit-details-marker { display: none; }
.completed-section > summary::before {
  content: '›'; display: inline-block; width: 14px; font-size: 1rem; line-height: 1;
  transition: transform .15s;
}
.completed-section[open] > summary::before { transform: rotate(90deg); }
.completed-section > summary:hover { color: var(--text-secondary); }
.completed-section .task-section-label .completed-count {
  font-size: .65rem;
  font-weight: 700;
  background: var(--text-muted);
  color: var(--surface);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.completed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
}

/* ── Planner ── */
.planner-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nav-btn {
  font-size:1.4rem; width:38px; height:38px; display:flex; align-items:center; justify-content:center;
  border:1.5px solid var(--border); border-radius:50%; background:var(--glass-bg); color:var(--text);
  cursor:pointer; transition:all .15s;
}
.nav-btn:hover { border-color:var(--primary); color:var(--primary); box-shadow:0 0 0 3px var(--accent-glow-soft); }
.link-btn {
  font-family:inherit; font-size:.8rem; background:none; border:none;
  color:var(--primary); cursor:pointer; padding:4px 0;
}
.link-btn:hover { text-decoration:underline; }
.planner-grid { display:flex; flex-direction:column; gap:8px; padding:8px 0; }
.planner-day { background:var(--glass-bg); border-radius:var(--radius); box-shadow:var(--card-shadow); overflow:hidden; }
.planner-day.is-today { border-left:3px solid var(--primary); }
.planner-day.is-past { opacity:.85; }
.planner-day-header {
  display:flex; align-items:center; justify-content:space-between; padding:10px 14px;
  background:var(--glass-well); cursor:pointer; transition:background .15s;
}
.planner-day-header:hover { background:var(--accent-glow-soft); }
.planner-day-name { font-size:.8rem; font-weight:600; color:var(--text); }
.planner-day.is-today .planner-day-name { color:var(--primary); }
.planner-day-date { font-size:.72rem; color:var(--text-secondary); }
.planner-day-tasks { padding:6px 14px 10px; display:flex; flex-direction:column; gap:4px; }
.planner-task { display:flex; align-items:center; gap:8px; padding:3px 0; font-size:.85rem; color:var(--text); }
.planner-task.done { color:var(--text-secondary); text-decoration:line-through; }
.planner-task-dot { width:6px; height:6px; border-radius:50%; background:var(--primary); flex-shrink:0; }
.planner-task.done .planner-task-dot { background:var(--success); }
.planner-day-empty { padding:6px 14px 6px; font-size:.8rem; color:var(--text-muted); font-style:italic; }
.planner-day-add-btn {
  font-family: inherit;
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  margin: 4px 14px 10px;
  text-align: center;
  transition: all .15s;
}
.planner-day-add-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ── Lessons ── */
.lessons-list { display:flex; flex-direction:column; gap:8px; }
.lesson-card {
  padding:14px; background:var(--glass-bg); border-radius:var(--radius);
  box-shadow:var(--card-shadow); border-left:3px solid var(--purple); animation:slideIn .2s ease;
}
.lesson-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.lesson-date { font-size:.72rem; font-weight:500; color:var(--text-muted); }
.lesson-tags { display:flex; gap:4px; flex-wrap:wrap; }
.tag-pill {
  font-size:.65rem; font-weight:600; padding:2px 8px; border-radius:10px;
  background:var(--purple-light); color:var(--purple-text);
}
.lesson-text { font-size:.925rem; color:var(--text); line-height:1.45; margin-bottom:8px; word-break:break-word; }
.lesson-text[contenteditable="true"] {
  outline:none; background:var(--purple-light); border-radius:4px; padding:2px 4px; margin:-2px -4px;
}
.lesson-actions { display:flex; gap:2px; }

/* ── Plans ── */
.sort-bar { align-items:center; }
.sort-label { font-size:.72rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-right:4px; }
.plans-list { display:flex; flex-direction:column; gap:8px; }
.plan-card {
  display:flex; align-items:flex-start; gap:8px; padding:12px 10px 12px 14px;
  background:var(--glass-bg); border-radius:var(--radius); box-shadow:var(--card-shadow);
  border-left:3px solid var(--border); animation:slideIn .2s ease; transition:opacity .2s;
}
.plan-card.status-dreaming { border-left-color:var(--purple); }
.plan-card.status-progress { border-left-color:var(--primary); }
.plan-card.status-done { border-left-color:var(--success); opacity:.88; }
.plan-card.status-paused { border-left-color:var(--amber); }
.plan-card-main { flex:1; min-width:0; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.plan-title { font-size:.95rem; font-weight:600; color:var(--text); word-break:break-word; line-height:1.35; }
.plan-card.status-done .plan-title { color:var(--text-secondary); }
.plan-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-top:4px; font-size:.7rem; color:var(--text-muted); }
.plan-desc { font-size:.82rem; color:var(--text-secondary); margin-top:6px; line-height:1.4; word-break:break-word;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.plan-note-hit { font-size:.76rem; color:var(--text-secondary); margin-top:6px; font-style:italic; word-break:break-word; }
.plan-actions { display:flex; flex-direction:column; gap:0; flex-shrink:0; }
.status-pill {
  font-size:.65rem; font-weight:600; padding:2px 8px; border-radius:10px; white-space:nowrap;
  background:var(--border-light); color:var(--text-secondary);
}
.status-pill.status-dreaming { background:var(--purple-light); color:var(--purple-text); }
.status-pill.status-progress { background:var(--primary-light); color:var(--primary); }
.status-pill.status-done { background:var(--success-light); color:var(--success-text); }
.status-pill.status-paused { background:var(--amber-light); color:var(--amber-text); }
.plan-target.soon { color:var(--primary); font-weight:600; }
.done-section { margin-top:16px; border-top:1px solid var(--border-light); padding-top:4px; }
.done-section > summary { list-style:none; cursor:pointer; user-select:none; display:flex; align-items:center; gap:2px; }
.done-section > summary::-webkit-details-marker { display:none; }
.done-section > summary::before { content:'›'; display:inline-block; width:14px; font-size:1rem; line-height:1; transition:transform .15s; }
.done-section[open] > summary::before { transform:rotate(90deg); }
.done-section .done-list { display:flex; flex-direction:column; gap:8px; padding-top:6px; }

/* Detail view */
.back-btn {
  font-family:inherit; font-size:.95rem; font-weight:600; color:var(--primary); background:none; border:none;
  cursor:pointer; padding:6px 4px 6px 0; -webkit-tap-highlight-color:transparent;
}
.back-btn:hover { text-decoration:underline; }
.plan-detail {
  padding:16px; background:var(--glass-bg); border-radius:var(--radius); box-shadow:var(--card-shadow);
  border-left:3px solid var(--border); margin-bottom:14px; animation:slideIn .2s ease;
}
.plan-detail.status-dreaming { border-left-color:var(--purple); }
.plan-detail.status-progress { border-left-color:var(--primary); }
.plan-detail.status-done { border-left-color:var(--success); }
.plan-detail.status-paused { border-left-color:var(--amber); }
.plan-detail-head { display:flex; align-items:flex-start; gap:8px; }
.plan-detail-title { flex:1; font-size:1.25rem; font-weight:700; color:var(--text); line-height:1.3; word-break:break-word; }
.plan-detail-title[contenteditable="true"], .plan-detail-desc[contenteditable="true"], .note-text[contenteditable="true"] {
  outline:none; background:var(--primary-light); border-radius:4px; padding:2px 4px; margin:-2px -4px;
}
.plan-detail-desc { font-size:.9rem; color:var(--text-secondary); line-height:1.5; margin-top:8px; white-space:pre-wrap; word-break:break-word; min-height:1.4em; }
.plan-detail-desc.placeholder { color:var(--text-muted); font-style:italic; }
.plan-field-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; }
.plan-field-label { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); min-width:52px; }
.status-chips { display:flex; flex-wrap:wrap; gap:6px; }
.status-chips .filter-chip { padding:4px 10px; font-size:.72rem; }
.plan-target-wrap .date-picker-display { width:132px; }
.plan-detail-actions { display:flex; gap:6px; margin-top:14px; padding-top:12px; border-top:1px solid var(--border-light); flex-wrap:wrap; }
.plan-created { font-size:.7rem; color:var(--text-muted); margin-left:auto; align-self:center; }

/* Notes */
.notes-list { display:flex; flex-direction:column; gap:6px; }
.note-item {
  display:flex; align-items:flex-start; gap:10px; padding:12px 10px 12px 14px;
  background:var(--glass-bg); border-radius:var(--radius); box-shadow:var(--card-shadow); animation:slideIn .2s ease;
}
.note-date {
  font-size:.72rem; font-weight:600; color:var(--primary); white-space:nowrap; padding-top:3px; min-width:72px;
  background:none; border:none; font-family:inherit; cursor:pointer; text-align:left; position:relative;
}
.note-date:hover { text-decoration:underline; }
.note-date-native { position:absolute; inset:0; opacity:0; width:100%; height:100%; pointer-events:none; }
.note-body { flex:1; min-width:0; }
.note-text { font-size:.925rem; color:var(--text); line-height:1.45; word-break:break-word; }
.note-actions { display:flex; gap:2px; flex-shrink:0; }
.plan-note-area .task-date-display { min-width:132px; max-width:150px; }
/* On phones the date and actions share the first line and the text gets the full width below. */
@media (max-width: 480px) {
  .note-item { flex-wrap:wrap; row-gap:4px; }
  .note-date { min-width:0; }
  .note-actions { margin-left:auto; }
  .note-body { order:1; flex-basis:100%; }
}
.notes-section-label { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); padding:4px 0 8px; }

/* ── All Logs timeline ── */
.timeline { display:flex; flex-direction:column; gap:2px; }
.timeline-date-header {
  font-size:.75rem; font-weight:600; color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.04em; padding:16px 0 6px;
}
/* Rows are plain translucent fills: no blur, no shadow, so a long timeline
   scrolls without compositing cost. */
.timeline-item {
  display:flex; align-items:flex-start; gap:10px; padding:10px 14px;
  background:var(--glass-bg); border-radius:var(--radius-sm); animation:slideIn .15s ease;
}
.timeline-item + .timeline-item { margin-top:2px; }
.timeline-link { cursor:pointer; transition:background .15s; }
.timeline-link:hover { background:var(--accent-glow-soft); }
.timeline-icon { font-size:.85rem; flex-shrink:0; padding-top:1px; }
.timeline-time { font-size:.68rem; font-weight:600; color:var(--text-muted); white-space:nowrap; padding-top:2px; min-width:36px; }
.timeline-body { flex:1; min-width:0; }
.timeline-text { font-size:.88rem; color:var(--text); word-break:break-word; }
.timeline-tags { display:flex; gap:4px; flex-wrap:wrap; margin-top:4px; }
mark { background:var(--amber-light); color:var(--text); border-radius:2px; padding:0 2px; }

/* ── Settings bar ── */
.settings-bar {
  position:fixed; bottom:calc(var(--tab-height) + var(--safe-bottom)); left:0; right:0;
  display:flex; justify-content:center; gap:8px; padding:6px 16px;
  background:var(--glass-bg-strong); backdrop-filter:blur(var(--glass-blur)); -webkit-backdrop-filter:blur(var(--glass-blur));
  box-shadow:var(--glass-highlight); z-index:99;
}
.settings-btn {
  font-family:inherit; font-size:.72rem; font-weight:600; padding:5px 12px;
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:var(--glass-bg); color:var(--text-secondary);
  cursor:pointer; transition:all .15s; white-space:nowrap;
}
.settings-btn:hover { border-color:var(--primary); color:var(--primary); box-shadow:0 0 0 3px var(--accent-glow-soft); }

/* ── Empty states ── */
.empty-state { text-align:center; padding:48px 24px; color:var(--text-secondary); }
.empty-icon { font-size:2.5rem; display:block; margin-bottom:12px; }
.empty-state p { font-size:.925rem; margin-bottom:4px; }
.empty-hint { font-size:.8rem; color:var(--text-muted); }

/* ── Tab bar ── */
#tab-bar {
  position:fixed; bottom:0; left:0; right:0;
  height:calc(var(--tab-height) + var(--safe-bottom)); padding-bottom:var(--safe-bottom);
  display:flex; align-items:stretch;
  background:var(--glass-bg-strong); backdrop-filter:blur(var(--glass-blur)); -webkit-backdrop-filter:blur(var(--glass-blur));
  border-top:1px solid var(--glass-border); box-shadow:0 -4px 16px rgba(0,0,0,.05); z-index:100;
}
/* Six tabs must fit a 320px-wide phone: every tab keeps a ≥48px touch target
   and labels shrink/ellipsize instead of wrapping. */
.tab-btn {
  flex:1 1 0; min-width:0; padding:0 2px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  border:none; background:transparent; color:var(--text-muted); cursor:pointer;
  font-family:inherit; -webkit-tap-highlight-color:transparent; transition:color .15s;
  border-radius:12px; position:relative;
}
.tab-btn:focus-visible { outline:none; box-shadow:inset 0 0 0 3px var(--accent-glow); }
.tab-btn.active { color:var(--primary); }
.tab-btn.active .tab-icon { text-shadow:0 0 10px var(--accent-glow); }
.tab-btn.active::before {
  content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:28px; height:2px; border-radius:0 0 2px 2px; background:var(--primary);
  box-shadow:0 0 8px var(--accent-glow);
}
.tab-icon { font-size:1.2rem; line-height:1; }
.tab-label {
  font-size:.58rem; font-weight:600; letter-spacing:.01em; line-height:1.1;
  max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
@media (max-width:359px) {
  .tab-icon { font-size:1.1rem; }
  .tab-label { font-size:.54rem; letter-spacing:0; }
}

/* ── Responsive ── */
@media (min-width:600px) {
  .screen { max-width:640px; margin:0 auto; padding-left:24px; padding-right:24px; }
  .planner-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
  .planner-day-header { flex-direction:column; align-items:flex-start; gap:2px; }
  .settings-bar { max-width:640px; margin:0 auto; }
}
@media (min-width:1024px) { .screen { max-width:800px; } .settings-bar { max-width:800px; } }

/* Adjust screen bottom padding for settings bar */
.screen {
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 50px);
}

/* ══════════════════════════════════════════════════════
   Cloud: loading / login overlays, account menu, sync
   status, offline banner, dialogs, toasts
   ══════════════════════════════════════════════════════ */

/* ── Overlay screens (loading, login) ── */
.overlay-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex;
  padding: 24px 16px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  animation: fadeIn .25s ease;
}
/* margin:auto centres the card yet still lets it scroll on short screens */
.overlay-card {
  margin: auto; width: 100%; max-width: 400px;
  background: var(--glass-sheen), var(--glass-bg-login); border-radius: 20px;
  border: 1px solid var(--glass-border-login);
  box-shadow: var(--glass-highlight), var(--glass-shadow-login); padding: 28px 24px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}
.app-logo-lg svg { width: 56px; height: 56px; border-radius: 14px; }

/* Loading */
.loading-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  background: transparent; border: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.loading-text { font-size: .9rem; color: var(--text-secondary); }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .35;
  animation: loadingPulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes loadingPulse { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Login */
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-app-name { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.login-config-warning {
  font-size: .82rem; line-height: 1.45; padding: 10px 12px; margin-bottom: 16px;
  background: var(--amber-light); color: var(--text); border-left: 3px solid var(--amber); border-radius: var(--radius-sm);
}
.login-config-warning code { font-size: .78rem; background: var(--border-light); padding: 1px 5px; border-radius: 4px; }
.login-tabs { display: flex; background: var(--glass-well); border-radius: 10px; padding: 3px; margin-bottom: 18px; }
.login-tab {
  flex: 1; font-family: inherit; font-size: .85rem; font-weight: 600; padding: 8px;
  border: none; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: all .15s;
}
.login-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.login-tab.active { background: var(--glass-bg-strong); color: var(--text); box-shadow: var(--glass-highlight), var(--shadow); }
.login-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.login-subtitle { font-size: .88rem; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.45; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field span { font-size: .78rem; font-weight: 600; color: var(--text-secondary); }
.login-field input {
  font-family: inherit; font-size: 1rem; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-bg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.login-field input:hover { border-color: var(--primary); }
.login-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-field input::placeholder { color: var(--text-muted); }
.login-message {
  display: none; font-size: .84rem; line-height: 1.45; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--glass-well); color: var(--text-secondary);
}
.login-message.show { display: block; }
.login-message.error { background: var(--danger-light); color: var(--danger-text); }
.login-message.success { background: var(--success-light); color: var(--success-text); }
.login-submit {
  font-family: inherit; font-size: 1rem; font-weight: 600; padding: 13px;
  border: none; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-text);
  cursor: pointer; transition: opacity .15s, transform .1s, box-shadow .15s; margin-top: 4px;
}
.login-submit:hover { opacity: .92; box-shadow: 0 0 0 3px var(--accent-glow-soft); }
.login-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.login-submit:active { transform: scale(.99); }
.login-link { align-self: center; font-size: .82rem; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--text-muted); font-size: .75rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-size: .95rem; font-weight: 600; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--glass-bg); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-google:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-glow-soft); }
.login-google:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-footnote { font-size: .74rem; color: var(--text-muted); text-align: center; margin-top: 18px; line-height: 1.45; }
#login-screen.busy .login-submit, #login-screen.busy .login-google { opacity: .6; cursor: progress; }

/* ── Login background video ──
   Lives inside #login-screen only; #bg (the app's calm gradient) is untouched.
   The scrim reuses the --bg-scrim variable, scoped dark here so the card and
   the toggle stay readable over any frame. No filters or blend modes on the
   video so it stays on the GPU's fast path. */
#login-screen {
  --bg-scrim: linear-gradient(180deg,
    rgba(12, 14, 28, calc(var(--scrim-opacity) - .08)) 0%,
    rgba(12, 14, 28, calc(var(--scrim-opacity) + .08)) 100%);
}
/* The card is translucent, so its text tokens are darkened (light) or
   lightened (dark) to stay AA over the darkest and brightest video frames.
   Only the card is affected; the rest of the app keeps the normal palette. */
.login-card {
  --text-secondary: #4b4b52;
  --text-muted: #52525a;
  --primary: #2a41b8;
  --accent-glow: rgba(42, 65, 184, .30);
  --accent-glow-soft: rgba(42, 65, 184, .14);
}
body.dark .login-card {
  --text-secondary: #c2c2d6;
  --text-muted: #b6b6cc;
  --primary: #8ea4ff;
}
.login-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: #0c0e1c;
}
.login-bg > img, .login-bg > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.login-bg > video { opacity: 0; transition: opacity .5s ease; }
.login-bg.is-playing > video { opacity: 1; }
.login-bg-scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }
.login-card { position: relative; z-index: 1; }
.login-video-toggle {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-bottom)); z-index: 2;
  min-height: 44px; padding: 10px 16px;
  font-family: inherit; font-size: .85rem; font-weight: 600;
  color: #fff; background: rgba(12, 14, 28, .55); border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px; cursor: pointer; transition: background .15s;
}
.login-video-toggle:hover { background: rgba(12, 14, 28, .75); }
.login-video-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .login-bg > video { transition: none; }
}
button:disabled, input:disabled { cursor: not-allowed; }

/* ── Account button (header) ── */
.account-btn {
  position: relative; width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-family: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.account-btn:hover, .account-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.account-btn .sync-dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid var(--surface); }
.sync-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--success); transition: background .3s;
}
body[data-sync="syncing"] .sync-dot { background: var(--amber); animation: syncPulse 1s ease-in-out infinite; }
body[data-sync="offline"] .sync-dot { background: var(--text-muted); animation: none; }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Account menu (popover) ── */
.account-menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: calc(100vw - 16px);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--glass-highlight), var(--glass-shadow); padding: 12px 14px;
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  display: flex; flex-direction: column; gap: 10px;
  animation: fadeIn .15s ease;
}
.account-email { font-size: .85rem; font-weight: 600; color: var(--text); word-break: break-all; }
.account-sync { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-secondary); }
.account-logout { align-self: flex-start; padding-left: 0; color: var(--danger-text); }
.account-logout:hover { color: var(--danger-text); text-decoration: underline; }

/* ── Offline banner ── */
.offline-banner {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; font-size: .82rem; font-weight: 500;
  background: var(--amber-light); color: var(--text); border-bottom: 1px solid var(--amber);
  animation: slideIn .2s ease;
}
.offline-banner::before { content: '⚠️'; font-size: .9rem; }

/* ── Confirm dialog ── */
.confirm-dialog {
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 22px 22px 18px;
  width: min(92vw, 420px); background: var(--glass-bg-strong); color: var(--text);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
}
.confirm-dialog::backdrop { background: rgba(15, 18, 35, .45); backdrop-filter: blur(2px); }
.confirm-dialog h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.confirm-dialog p { font-size: .88rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 18px; }
.confirm-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.confirm-buttons .btn-sm { font-size: .85rem; padding: 9px 14px; }
.confirm-buttons .btn-ghost { color: var(--text-secondary); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-height) + var(--safe-bottom) + 64px);
  transform: translateX(-50%) translateY(12px); z-index: 120;
  max-width: min(92vw, 420px); padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-size: .85rem; line-height: 1.4;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }

/* Planner header: nav group grows, account button stays right */
.header-row .planner-nav { flex: 1; }

/* ══════════════════════════════════════════════════════
   Glass: shared focus glow, fallbacks, user preferences
   ══════════════════════════════════════════════════════ */

/* Keyboard focus on any button gets the same calm accent glow as inputs.
   Inputs and the tab bar define their own above. */
.btn-sm:focus-visible, .filter-chip:focus-visible, .settings-btn:focus-visible, .nav-btn:focus-visible,
.entry-btn:focus-visible, .lesson-btn:focus-visible, .task-delete:focus-visible, .back-btn:focus-visible,
.link-btn:focus-visible, .planner-day-add-btn:focus-visible, .date-clear-btn:focus-visible,
.task-checkbox:focus-visible, .note-date:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-glow);
}

/* No backdrop-filter (older Firefox / Android WebView, Firefox with the
   feature disabled): swap every glass fill for a near-solid one so text
   never sits on a see-through panel. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, body.dark {
    --glass-bg: var(--glass-solid);
    --glass-bg-strong: var(--glass-solid);
    --glass-bg-login: var(--glass-solid);
    --glass-sheen: none;
  }
}

/* OS-level "reduce transparency": same solid fills, blur switched off. */
@media (prefers-reduced-transparency: reduce) {
  :root, body.dark {
    --glass-bg: var(--glass-solid);
    --glass-bg-strong: var(--glass-solid);
    --glass-bg-login: var(--glass-solid);
    --glass-sheen: none;
  }
  .screen-header, #tab-bar, .settings-bar, .overlay-card, .account-menu, .confirm-dialog {
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}

/* Reduced motion: no entrance animations or glow transitions (video
   crossfade is handled with the login video rules). */
@media (prefers-reduced-motion: reduce) {
  .screen, .overlay-screen, .account-menu, .entry-item, .task-item, .lesson-card, .plan-card,
  .plan-detail, .note-item, .timeline-item, .offline-banner { animation: none; }
  .tab-btn, .filter-chip, .settings-btn, .nav-btn, .big-input, .date-picker-display, .transfer-input,
  .login-field input, .login-submit, .login-google, .login-tab, .account-btn, .btn-sm, .toast { transition: none; }
}
