/* ==========================================================================
   UniSync — Editorial Magazine design
   Warm cream paper, bold serif display type, terracotta ink, bento grid.
   Deliberately not a dark SaaS template.
   ========================================================================== */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* paper & ink */
  --bg: #faf8f5;
  --paper: #ffffff;
  --paper-warm: #f5f0e8;
  --ink: #211d19;
  --ink-soft: #5d564d;
  --ink-faint: #8d857a;
  --line: #e5ded2;
  --line-strong: #cfc6b8;

  /* accents */
  --accent: #e07a5f;          /* terracotta */
  --accent-deep: #b85c44;
  --accent-wash: #f7e7e0;
  --forest: #3d5a4a;
  --forest-wash: #e8efe9;

  /* status */
  --ok: #3d5a4a;
  --warn: #c98a2b;
  --bad: #b0452f;

  /* type */
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* shape & depth — flat, print-like */
  --radius: 2px;
  --shadow: 0 1px 0 rgba(33, 29, 25, 0.06);

  /* spacing rhythm */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 3rem;
}

/* ── Reset / base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

button { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--paper-warm); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--paper-warm); color: var(--ink); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 1.625rem; font-size: 1rem; }

/* ── Form controls ───────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.input-sm { padding: 0.4rem 0.625rem; font-size: 0.8125rem; }
.input-lg { padding: 0.875rem 1rem; font-size: 1.25rem; font-family: var(--font-serif); }

textarea.input { resize: vertical; min-height: 4rem; }
select.input { cursor: pointer; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.125rem; }
.form-group label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.form-row { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.form-row .input { flex: 1 1 auto; min-width: 8rem; }
.form-row .input-sm { flex: 0 0 auto; min-width: 5.5rem; width: 7rem; }

/* ── Sync status dots ────────────────────────────────────────────────────── */
.sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}
.sync-dot[data-state="ok"],
.sync-dot[data-state="synced"],
.sync-dot[data-state="connected"] { background: var(--ok); }
.sync-dot[data-state="syncing"],
.sync-dot[data-state="pending"] { background: var(--warn); }
.sync-dot[data-state="error"],
.sync-dot[data-state="failed"] { background: var(--bad); }

/* ==========================================================================
   AUTH
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(33, 29, 25, 0.028) 31px 32px),
    var(--bg);
}

.auth-card {
  max-width: 28rem;
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow: 8px 8px 0 var(--accent-wash);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  text-align: center;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.auth-title {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.auth-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--accent-deep);
}

.auth-desc {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.auth-local-notice {
  background: var(--accent-wash);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--accent-deep);
  text-align: left;
}

.auth-card .btn { width: 100%; }
.auth-card .btn-ghost { border: 1.5px solid var(--line-strong); }
.auth-card .btn-auth { width: 100%; }
.auth-card .btn-local { width: 100%; border: 1.5px solid var(--line-strong); }

/* ==========================================================================
   APP SHELL — masthead topbar + left rail + main paper
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "masthead masthead"
    "rail     main";
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

/* ── Masthead (topbar) ───────────────────────────────────────────────────── */
.topbar {
  grid-area: masthead;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  height: 4.75rem;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.topbar-brand {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--line-strong);
}

.topbar-view-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper-warm);
}

/* mobile bar — hidden on desktop */
.mobile-bar { display: none; }
.mobile-title { font-family: var(--font-serif); font-weight: 700; font-size: 1.125rem; }

/* ── Left rail (sidebar) ─────────────────────────────────────────────────── */
.sidebar {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.5rem 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.nav-item svg { flex: none; opacity: 0.75; }
.nav-item:hover { background: var(--paper-warm); color: var(--ink); }
.nav-item.active {
  background: var(--accent-wash);
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}
.nav-item.active svg { opacity: 1; }

.sidebar-data {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-data-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding: 0 0.5rem;
  margin-bottom: 0.25rem;
}
.sidebar-data .btn-ghost {
  justify-content: flex-start;
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.sidebar-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.sync-label { font-weight: 500; }

/* ── Main canvas ─────────────────────────────────────────────────────────── */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: 2.5rem 3rem 4rem;
  scroll-behavior: smooth;
}

/* ── Views ───────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: view-in 240ms ease both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.view-title {
  font-size: 3rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.view-sub {
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Panels — the card primitive ─────────────────────────────────────────── */
.panel {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.125rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-size: 1.125rem;
  position: relative;
  padding-left: 0.875rem;
}
.panel-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.125rem;
  bottom: 0.125rem;
  width: 4px;
  background: var(--accent);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-hint {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.9375rem;
  padding: 0.5rem 0;
}

/* ==========================================================================
   DASHBOARD — bento grid
   ========================================================================== */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
}

.stat-row {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.panel-wide {
  grid-column: span 8;
}
.dash-grid > .panel:not(.panel-wide) {
  grid-column: span 4;
}

/* event list */
.event-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}
.event-item:last-child { border-bottom: none; }

.event-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.event-info { min-width: 0; flex: 1; }
.event-title {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.event-meta {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.event-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
  margin-top: 0.125rem;
}

/* task preview */
.task-preview, .fc-preview {
  display: flex;
  flex-direction: column;
}

.task-preview .task-item,
.fc-preview .fc-list-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line);
}
.task-preview .task-item:last-child,
.fc-preview .fc-list-item:last-child { border-bottom: none; }

/* ==========================================================================
   CALENDAR
   ========================================================================== */
.cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.cal-label {
  min-width: 9.5rem;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
}

.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: 1.25rem;
  align-items: start;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.cal-day-header {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line-strong);
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-align: center;
}

.cal-cell {
  min-height: 5.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  cursor: pointer;
  transition: background 120ms ease;
  background: var(--paper);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--paper-warm); }
.cal-cell.other-month { background: var(--bg); }
.cal-cell.other-month .cal-cell-num { color: var(--ink-faint); }
.cal-cell.today { background: var(--accent-wash); }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }

.cal-cell-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.cal-cell.today .cal-cell-num {
  color: var(--accent-deep);
  font-weight: 700;
}

.cal-event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex: none;
}

.cal-event-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.4rem;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }

.cal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.day-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.day-event {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg);
}
.day-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  margin-top: 0.3rem;
}
.day-event-info { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.day-event-title { font-weight: 600; font-size: 0.9375rem; }
.day-event-meta { font-size: 0.8125rem; color: var(--ink-soft); }
.day-event-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; }

/* subjects */
.subject-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.subject-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.subject-item:hover { background: var(--paper-warm); }
.subject-item.active { background: var(--accent-wash); border-color: var(--accent); font-weight: 600; }

.subject-color {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(33, 29, 25, 0.25);
}

.subject-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   DAILY PLANNER
   ========================================================================== */
.daily-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.daily-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.25rem;
  align-items: start;
}

/* time grid */
.time-grid {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.time-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  border-bottom: 1px solid var(--line);
  min-height: 3.25rem;
}
.time-row:last-child { border-bottom: none; }
.time-row.current { background: var(--accent-wash); }

.time-label {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  border-right: 1px solid var(--line);
  background: var(--paper-warm);
  display: flex;
  align-items: flex-start;
}
.time-row.current .time-label { color: var(--accent-deep); font-weight: 700; }

.time-slot {
  padding: 0.375rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.time-slot-event {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.time-slot-event .tse-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.875rem; }
.tse-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); white-space: nowrap; }

/* sidebar */
.daily-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.task-list { display: flex; flex-direction: column; gap: 0.25rem; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.task-item:last-child { border-bottom: none; }

.task-check {
  appearance: none;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.1rem 0 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease;
}
.task-check:hover { border-color: var(--accent-deep); }
.task-check:checked { background: var(--forest); border-color: var(--forest); }
.task-check:checked::after {
  content: "";
  position: absolute;
  left: 0.22rem;
  top: 0.06rem;
  width: 0.45rem;
  height: 0.75rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-label { flex: 1; min-width: 0; font-size: 0.9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.task-item.done .task-label { text-decoration: line-through; color: var(--ink-faint); }

.task-badge {
  flex: none;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.task-badge.high { background: #f3d9d2; color: #8f3a24; }
.task-badge.medium { background: #f2e4c8; color: #8a6116; }
.task-badge.low { background: var(--forest-wash); color: var(--forest); }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.task-row-delete {
  flex: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  border-radius: 2px;
}
.task-row-delete:hover { color: var(--bad); background: #f3d9d2; }

/* day stats */
.day-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
}
.day-stat { display: flex; flex-direction: column; gap: 0.2rem; }
.day-stat-num {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.day-stat-label {
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* ==========================================================================
   VAULT (tutor Q&A)
   ========================================================================== */
.vault-layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.vault-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.module-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }

.module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.module-item:hover { background: var(--paper-warm); }
.module-item.active { background: var(--accent-wash); border-color: var(--accent); font-weight: 600; }

.module-count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.vault-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.question-card {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.question-card.answered { border-left: 4px solid var(--forest); }
.question-card.asked { border-left: 4px solid var(--warn); }
.question-card.open { border-left: 4px solid var(--accent); }
.question-card.archived { opacity: 0.72; border-left: 4px solid var(--ink-faint); }

.question-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.question-module {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.question-status {
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.question-status.open { background: var(--accent-wash); color: var(--accent-deep); }
.question-status.asked { background: #f2e4c8; color: #8a6116; }
.question-status.answered { background: var(--forest-wash); color: var(--forest); }
.question-status.archived { background: var(--paper-warm); color: var(--ink-faint); }

.question-text {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.question-answer {
  padding: 0.875rem 1rem;
  background: var(--forest-wash);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.question-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ==========================================================================
   FLASHCARDS
   ========================================================================== */
.fc-layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.fc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.deck-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }

.deck-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.deck-item:hover { background: var(--paper-warm); }
.deck-item.active { background: var(--accent-wash); border-color: var(--accent); font-weight: 600; }

.deck-count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.fc-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  text-align: center;
}
.fc-stat-num {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
  display: block;
  font-variant-numeric: tabular-nums;
}
.fc-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.fc-main { min-width: 0; }

.fc-review { display: flex; flex-direction: column; gap: 1.25rem; }

.fc-progress {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.fc-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 300ms ease;
}

.fc-card-area { display: flex; justify-content: center; padding: 0.5rem 0; }

.fc-card {
  perspective: 1200px;
  width: min(26rem, 100%);
  height: 15rem;
  cursor: pointer;
}
.fc-card-face,
.fc-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--accent-wash);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  backface-visibility: hidden;
  transform: rotateY(0deg);
  transition: transform 350ms ease;
}
.fc-card-back {
  transform: rotateY(180deg);
  background: var(--forest);
  color: #fff;
  border-color: #2c4437;
  box-shadow: 6px 6px 0 var(--forest-wash);
}
.fc-card.flipped .fc-card-face { transform: rotateY(-180deg); }
.fc-card.flipped .fc-card-back { transform: rotateY(0deg); }
.fc-card:not(.flipped) .fc-card-back,
.fc-card.flipped .fc-card-face { pointer-events: none; }

.fc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.fc-grade { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.fc-grade-btn {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
.fc-grade-btn[data-grade="again"]:hover { background: #f3d9d2; color: #8f3a24; border-color: #b0452f; }
.fc-grade-btn[data-grade="hard"]:hover { background: #f2e4c8; color: #8a6116; border-color: #c98a2b; }
.fc-grade-btn[data-grade="good"]:hover { background: var(--forest-wash); color: var(--forest); border-color: var(--forest); }
.fc-grade-btn[data-grade="easy"]:hover { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent-deep); }

.fc-list { display: flex; flex-direction: column; gap: 0.5rem; }

.fc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
}

.fc-list-front {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-list-due {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.fc-list-due.overdue { color: var(--bad); }
.fc-list-due.soon { color: var(--warn); }
.fc-list-due.due, .fc-due.due { color: var(--forest); }

/* preview items inside dashboard */
.fc-preview .fc-due {
  flex: none;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.fc-preview .fc-due.overdue { color: var(--bad); font-weight: 700; }
.fc-preview .fc-due.soon { color: var(--warn); font-weight: 700; }
.fc-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line);
}
.fc-preview-item:last-child { border-bottom: none; }
.fc-preview-item .fc-list-front { flex: 1; min-width: 0; font-size: 0.875rem; }

/* ==========================================================================
   POMODORO
   ========================================================================== */
.pomo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.25rem;
  align-items: start;
}

.pomo-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}

.pomo-ring-wrap {
  position: relative;
  width: 280px;
  height: 280px;
}

.pomo-ring {
  display: block;
  transform: rotate(-90deg);
  overflow: visible;
}

.pomo-ring-bg,
.pomo-ring-fg {
  fill: none;
  stroke-width: 10;
}
.pomo-ring-bg { stroke: var(--line); }
.pomo-ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 754;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 500ms linear, stroke 200ms ease;
}
.pomo-ring-wrap.break .pomo-ring-fg { stroke: var(--forest); }

.pomo-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
}

.pomo-mode {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-deep);
}
.pomo-ring-wrap.break .pomo-mode { color: var(--forest); }

.pomo-time {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pomo-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

.pomo-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pomo-sessions {
  display: flex;
  gap: 0.5rem;
}
.pomo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  border: 1.5px solid var(--line-strong);
}
.pomo-dot.done { background: var(--accent); border-color: var(--accent-deep); }

.pomo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.pomo-today {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pomo-today-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.pomo-today-item:last-child { border-bottom: none; }
.pomo-today-label { font-size: 0.875rem; color: var(--ink-soft); }
.pomo-today-value {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SYLLABUS
   ========================================================================== */
.syl-layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.syl-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.syl-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.syl-resource {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.syl-resource-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
}

.syl-resource-title {
  flex: 1;
  min-width: 0;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

.syl-resource-type {
  flex: none;
  padding: 0.2rem 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  background: var(--paper-warm);
}
.syl-resource-type.syllabus { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); }
.syl-resource-type.reading { border-color: var(--forest); color: var(--forest); background: var(--forest-wash); }
.syl-resource-type.pdf { border-color: var(--bad); color: var(--bad); background: #f3d9d2; }
.syl-resource-type.link { border-color: #31588a; color: #31588a; background: #e3ebf5; }
.syl-resource-type.other { border-color: var(--line-strong); color: var(--ink-soft); background: var(--paper-warm); }

.syl-resource-content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.syl-resource-url {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   NOTES
   ========================================================================== */
.notes-layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.notes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
}

.notes-list { display: flex; flex-direction: column; gap: 0.25rem; }

.note-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.note-item:hover { background: var(--paper-warm); }
.note-item.active { background: var(--accent-wash); border-color: var(--accent); font-weight: 600; }

.note-item-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-item-meta {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.notes-main { min-width: 0; }

.note-editor {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.75rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.note-editor-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-meta { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.note-meta .input { flex: 1 1 8rem; }

.note-body {
  width: 100%;
  min-height: 22rem;
  resize: vertical;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(0deg, transparent 0 1.5rem, rgba(33, 29, 25, 0.04) 1.5rem calc(1.5rem + 1px));
  padding: 0.75rem 1rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 2.4rem;
  color: var(--ink);
  background-attachment: local;
}
.note-body:focus {
  outline: none;
  border-color: var(--accent-deep);
  border-style: solid;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   MODALS — broadsheet dialog
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1.5rem 2rem;
  background: rgba(33, 29, 25, 0.45);
  overflow-y: auto;
}

.modal-card {
  width: 100%;
  max-width: 32rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--accent-wash);
  animation: modal-in 180ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.modal-title { font-size: 1.5rem; }

.modal-body {
  padding: 1.5rem;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.125rem 1.5rem;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   TOAST — footer ribbon
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.875rem 1.5rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(33, 29, 25, 0.25);
  animation: toast-in 200ms ease both;
  text-align: center;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.toast.success { border-left-color: var(--forest); }
.toast.error { border-left-color: var(--bad); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .cal-layout,
  .daily-layout,
  .pomo-layout { grid-template-columns: 1fr; }
  .cal-sidebar, .daily-sidebar, .pomo-sidebar { position: static; }

  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .panel-wide { grid-column: span 12; }
  .dash-grid > .panel:not(.panel-wide) { grid-column: span 6; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "masthead"
      "mobilebar"
      "main";
  }

  .topbar {
    display: none;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    grid-area: mobilebar;
    height: 3.75rem;
    padding: 0 1rem;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
  }
  .mobile-bar .btn-ghost { border: 1px solid var(--line-strong); padding: 0.5rem; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 110;
    width: min(18rem, 85vw);
    transform: translateX(-102%);
    transition: transform 220ms ease;
    box-shadow: 8px 0 32px rgba(33, 29, 25, 0.2);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 1.5rem 1.25rem 3rem; }

  .view-title { font-size: 2.25rem; }
  .view-header { margin-bottom: 1.75rem; padding-bottom: 1.125rem; }

  .vault-layout, .fc-layout, .syl-layout, .notes-layout {
    grid-template-columns: 1fr;
  }
  .vault-sidebar, .fc-sidebar, .syl-sidebar, .notes-sidebar { position: static; }
}

@media (max-width: 560px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .dash-grid { gap: 0.875rem; }
  .panel-wide, .dash-grid > .panel:not(.panel-wide) { grid-column: span 12; }

  .stat-num { font-size: 2.125rem; }
  .stat-card { padding: 1.125rem 1.25rem; }

  .view-title { font-size: 2rem; }
  .view-header { flex-direction: column; align-items: flex-start; }

  .view-actions { width: 100%; }
  .view-actions .btn { flex: 1 1 auto; }

  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-cell { min-height: 3.5rem; padding: 0.3rem; }
  .cal-event-pill { display: none; }
  .cal-cell.has-events::after {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: auto;
  }
  .cal-day-header { font-size: 0.5625rem; letter-spacing: 0.06em; padding: 0.375rem 0.25rem; }
  .cal-label { min-width: 7rem; font-size: 0.9rem; }

  .time-row { grid-template-columns: 3.5rem 1fr; }
  .time-label { padding: 0.375rem 0.5rem; font-size: 0.6875rem; }

  .auth-card { padding: 2.25rem 1.5rem; box-shadow: 6px 6px 0 var(--accent-wash); }
  .auth-title { font-size: 2.5rem; }

  .pomo-main { padding: 1.75rem 1.25rem; }
  .pomo-ring-wrap { width: 220px; height: 220px; }
  .pomo-ring { width: 220px; height: 220px; }
  .pomo-time { font-size: 3rem; }

  .fc-card { height: 13rem; }
  .fc-card-face, .fc-card-back { font-size: 1.125rem; padding: 1.25rem; }

  .note-editor { padding: 1.25rem 1.25rem 1.25rem; }
  .note-body { min-height: 14rem; font-size: 1rem; line-height: 2rem;
    background: repeating-linear-gradient(0deg, transparent 0 2rem, rgba(33, 29, 25, 0.04) 2rem calc(2rem + 1px)); }

  .day-stats { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }

  .form-row .input-sm { width: auto; flex: 1 1 auto; }
}

/* ==========================================================================
   PRINT — clean broadsheet
   ========================================================================== */
@media print {
  * { box-shadow: none !important; text-shadow: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }

  .auth-overlay, .sidebar, .topbar, .mobile-bar, .btn, .view-actions,
  .form-row, .form-group, .task-row-delete, .day-event-actions,
  .question-actions, .note-actions, .pomo-controls, .fc-controls, .toast {
    display: none !important;
  }

  .app { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .view { display: none; }
  .view.active { display: block; }

  .view-header { border-bottom: 2px solid #000; margin-bottom: 1.5rem; padding-bottom: 1rem; }
  .view-title { font-size: 24pt; }
  .view-sub { font-size: 11pt; }

  .panel { border: 1px solid #999; break-inside: avoid; padding: 1rem; }
  .panel-title { font-size: 13pt; }

  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .stat-card { border: 1px solid #999; }
  .dash-grid { grid-template-columns: 1fr; gap: 1rem; }
  .panel-wide, .dash-grid > .panel:not(.panel-wide) { grid-column: auto; }

  .cal-layout, .daily-layout, .vault-layout, .fc-layout, .pomo-layout,
  .syl-layout, .notes-layout { display: block; }
  .cal-sidebar, .daily-sidebar, .pomo-sidebar, .vault-sidebar,
  .fc-sidebar, .syl-sidebar, .notes-sidebar { display: block; margin-top: 1rem; }

  .cal-grid { border: 1px solid #000; }
  .cal-cell { border-color: #ccc; min-height: 0; }

  .modal { position: static; display: none; padding: 0; background: none; }

  a { color: #000; }
  .question-card, .syl-resource, .note-editor, .fc-card-area { break-inside: avoid; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fc-card-face, .fc-card-back { transition: none !important; }
}
