/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
          "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #edeff4;
  --text: #1a1c22;
  --muted: #767c89;
  --line: rgba(22, 24, 32, .07);
  --accent: #4665e6;
  --on-accent: #ffffff;
  --accent-soft: #e9edfd;
  --danger: #d9564d;
  /* deep enough to read as gold on white and still pass contrast */
  --gold: #9b7215;
  --gold-soft: #fbf1dc;
  --on-gold: #ffffff;

  --shadow-card: 0 1px 2px rgba(18, 20, 28, .04), 0 14px 30px -22px rgba(18, 20, 28, .45);
  --shadow-sheet: 0 -12px 48px rgba(12, 14, 20, .2);
  --shadow-fab: 0 10px 24px -8px rgba(70, 101, 230, .75);
  --shadow-pill: 0 4px 10px -4px rgba(70, 101, 230, .6);

  --r-card: 18px;
  --r-day: 15px;
  --r-field: 15px;
  --r-btn: 16px;
  --r-sheet: 28px;

  --tap: 44px;
  --pad: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tabbar-h: 58px;

  --ease: cubic-bezier(.22, .78, .32, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
}

/* Pure black keeps the iOS status bar seamless on OLED screens. */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #131418;
  --surface-2: #1f2127;
  --text: #f1f2f5;
  --muted: #8b909c;
  --line: rgba(255, 255, 255, .08);
  --accent: #7f9dff;
  --on-accent: #0a0d18;   /* dark ink reads on the lighter dark-mode accent */
  --accent-soft: #1a2136;
  --danger: #ff6f68;
  --gold: #f2c86a;
  --gold-soft: #2a2113;
  --on-gold: #241b09;

  --shadow-card: none;
  --shadow-sheet: 0 -12px 48px rgba(0, 0, 0, .7);
  --shadow-fab: 0 10px 24px -10px rgba(127, 157, 255, .5);
  --shadow-pill: none;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 400 16px/1.45 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  min-height: 100vh;
}

body.is-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

button, input, textarea, select {
  font: inherit;
  font-family: var(--font);
  color: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.day, .tab, .topbar, .segmented, .btn, .link-btn, .check, .chev, .tag, .cal-week {
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px var(--pad);
  padding-top: calc(10px + var(--safe-top));
  padding-left: calc(var(--pad) + var(--safe-left));
  padding-right: calc(var(--pad) + var(--safe-right));
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}

.topbar.is-scrolled { border-bottom-color: var(--line); }

.title {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: clamp(19px, 5.6vw, 23px);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .18s var(--ease);
}

.title:active { transform: scale(.97); }

.topbar-actions { display: flex; align-items: center; gap: 0; }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 50%;
  transition: background-color .18s ease, transform .18s var(--ease), color .18s ease;
}

.icon-btn:active {
  background: var(--surface-2);
  transform: scale(.9);
}

.icon-btn[hidden] { display: none; }

#syncBtn.is-on { color: var(--accent); }
#syncBtn.is-bad { color: var(--danger); }
#syncBtn.is-busy { color: var(--accent); animation: breathe 1.4s ease-in-out infinite; }

@keyframes breathe { 50% { opacity: .35; } }

#themeBtn .i-sun { display: none; }
[data-theme="dark"] #themeBtn .i-sun { display: block; }
[data-theme="dark"] #themeBtn .i-moon { display: none; }

/* ---------- Layout ---------- */
main {
  /* bottom padding keeps the last row clear of the tab bar, and of the focus
     strip that floats above it during a session */
  padding: 2px calc(var(--pad) + var(--safe-left)) 96px calc(var(--pad) + var(--safe-right));
  max-width: 620px;
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 4px 10px;
}

.section-head:first-child { margin-top: 16px; }

.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  padding: 16px 4px;
  margin: 0;
}

/* ---------- Calendar ---------- */
.cal { margin-top: 10px; }

.cal-week, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-week { margin-bottom: 6px; }

.cal-week span {
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: .85;
}

.cal-grid {
  gap: 2px;
  touch-action: pan-y;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: clamp(46px, 12.8vw, 62px);
  padding-top: 6px;
  border-radius: var(--r-day);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.day.is-out { color: var(--muted); opacity: .4; }
.day.is-today .dnum { color: var(--accent); font-weight: 750; }

.dnum {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1;
  transition: background-color .22s var(--ease), color .22s var(--ease),
              transform .22s var(--ease), box-shadow .22s var(--ease);
}

.day:active .dnum { transform: scale(.88); }

.day.is-selected .dnum {
  background: var(--text);
  color: var(--bg);
  font-weight: 650;
}

.day.is-selected.is-today .dnum {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-pill);
}

.dots {
  display: flex;
  gap: 3px;
  height: 5px;
  align-items: center;
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18);
}

/* class colours are picked for a light background; lift them on black */
[data-theme="dark"] .dots i,
[data-theme="dark"] .swatch { filter: saturate(1.1) brightness(1.35); }

/* ---------- Cards & rows ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card.top { margin-top: 16px; }
.card.gap { margin-top: 12px; }
.card.gap-lg { margin-top: 30px; }
.back { margin: 10px 4px 0; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  min-height: 58px;
  transition: background-color .18s ease;
}

/* .row.block (the schedule's plain period list) is the only row with no
   action of its own — everything else responds to a tap somewhere */
.row:not(.block) { cursor: pointer; }

/* hairline separators, inset like a native list */
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--line);
}

.row:active { background: var(--surface-2); }

.row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.row-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s ease;
}

.row-title.accent { color: var(--accent); font-weight: 550; }

.row-sub {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub.is-late { color: var(--danger); }

.chev { color: var(--muted); opacity: .45; flex: none; }
.chev svg { width: 18px; height: 18px; stroke-width: 2.1; }

.swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  /* a near-white class colour would otherwise vanish into a white card */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.check {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: transparent;
  background: transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}

[data-theme="dark"] .check { border-color: #3a3d46; }

.check svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.8;
  transform: scale(.4);
  opacity: 0;
  transition: transform .22s var(--ease), opacity .16s ease;
}

.row.is-done .check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.row.is-done .check svg { transform: scale(1); opacity: 1; }
.row.is-done .row-title { color: var(--muted); text-decoration: line-through; }

.check.pop { animation: pop .34s var(--ease); }
@keyframes pop { 40% { transform: scale(1.18); } }

.tag {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 999px;
}

.plus {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--accent);
  stroke-width: 2.3;
}

.note-body {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.link-btn {
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 10px;
  transition: background-color .18s ease, transform .18s var(--ease);
}

.link-btn:active { background: var(--accent-soft); transform: scale(.95); }

/* ---------- Tasks ---------- */
.section-head .count {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  opacity: .65;
  font-variant-numeric: tabular-nums;
}

.row.task { gap: 11px; }

/* whole row is interactive, so it lights up as one on a mouse */
@media (hover: hover) {
  .row.task:hover { background: var(--surface-2); }
}

.due {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface-2);
  padding: 4px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.due.is-late {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 13%, transparent);
}

.row.is-done .due { opacity: .5; }

/* finished work stays readable but stops competing with what is still open */
.card.is-finished { opacity: .62; }

/* the half-filled state of a project's status circle */
.check { position: relative; }

.check.is-project::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .22s var(--ease);
}

.check.is-project.is-mid::before { transform: scale(1); }

/* groups fade up in sequence when the list is built */
.task-in { animation: softIn .26s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  padding-bottom: var(--safe-bottom);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: color .2s ease;
}

.tab svg {
  width: 22px;
  height: 22px;
  transition: transform .22s var(--ease);
}

.tab:active svg { transform: scale(.88); }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { transform: translateY(-1px); }

/* ---------- Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-wrap[hidden] { display: none; }

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 13, .4);
  touch-action: none;
  animation: fade .28s ease;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 8px calc(var(--pad) + var(--safe-left)) calc(16px + var(--safe-bottom)) calc(var(--pad) + var(--safe-right));
  scroll-behavior: smooth;
  scroll-padding-bottom: 68px;
  animation: rise .42s var(--ease-sheet);
}

@media (min-width: 620px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: 520px;
    transform: translateX(-50%);
    border-radius: var(--r-sheet);
    animation: fade .2s ease;
  }
}

.grabber {
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  margin: 4px auto 9px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 9px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 4px 5px;
}

.field label .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--r-field);
  padding: 13px 14px;
  -webkit-appearance: none;
  appearance: none;
  min-height: var(--tap);
  transition: border-color .18s ease, background-color .18s ease;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767c89' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

.field textarea { resize: none; line-height: 1.5; }

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field .is-bad { border-color: var(--danger); }

.colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px;
}

.color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  /* a near-white swatch needs its own edge to read against the sheet */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.color:active { transform: scale(.88); }
.color.is-on {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 0 0 3px var(--surface), 0 0 0 5.5px var(--text);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  gap: 3px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 12px;
}

.segmented button {
  padding: 10px 4px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s ease, background-color .2s ease, transform .2s var(--ease);
}

.segmented button:active { transform: scale(.96); }

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}

[data-theme="dark"] .segmented button.is-active {
  background: #33363f;
  box-shadow: none;
}

.btn {
  display: block;
  width: 100%;
  min-height: 48px;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  margin-top: 6px;
  box-shadow: var(--shadow-pill);
  transition: transform .18s var(--ease), opacity .18s ease;
}

.btn:active { transform: scale(.98); opacity: .9; }

/* ---------- Sync ---------- */
.sync-code {
  margin: 4px 0 10px;
  padding: 16px 12px;
  border-radius: var(--r-field);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: clamp(20px, 6.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .18s var(--ease);
}

.sync-code:active { transform: scale(.98); }
.sync-code[data-copied]::after { content: " ✓ copied"; font-size: 13px; letter-spacing: 0; }

.sync-status {
  margin: 0 4px 14px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.sync-status.is-bad { color: var(--danger); }

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 2px 4px 14px;
}

/* When the form is taller than the sheet (small screens, or the iOS keyboard
   eating half the height), the primary action stays put instead of being
   scrolled out of reach. The surface-coloured shadow hides fields passing
   underneath it. */
.sheet form > .btn:last-child:not(.is-ghost) {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -16px 16px -4px var(--surface), 0 -28px 12px -12px var(--surface), var(--shadow-pill);
}

.btn.is-soft {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.btn.is-ghost {
  background: none;
  color: var(--danger);
  font-weight: 600;
  min-height: 46px;
  box-shadow: none;
  margin-top: 2px;
}

/* ---------- What's next (paged announcement) ---------- */
.news-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 4px 0 15px;
  border-radius: 17px;
  background: var(--accent-soft);
  color: var(--accent);
}

.news-icon svg { width: 25px; height: 25px; }

.news-eyebrow {
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-title {
  margin: 0;
  font-size: clamp(22px, 6.2vw, 27px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.news-body {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.news-list {
  list-style: none;
  margin: 17px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.news-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14.5px;
  line-height: 1.5;
}

.news-list svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent);
  stroke-width: 2.6;
}

/* the promise screen */
.news.is-gold .news-icon { background: var(--gold-soft); color: var(--gold); }
.news.is-gold .news-eyebrow,
.news.is-gold .news-title { color: var(--gold); }

.news.is-gold .news-next {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: none;
}

.news-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.55;
}

.news-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.news-dots {
  display: flex;
  flex: 1;
  margin-left: -5px;
}

.news-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.news-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-2);
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}

[data-theme="dark"] .news-dot::before { background: #363943; }
.news-dot.is-on::before { background: var(--accent); transform: scale(1.3); }
.news.is-gold .news-dot.is-on::before { background: var(--gold); }

.news-next {
  width: auto;
  min-width: 116px;
  margin-top: 0;
}

/* ---------- Motion ---------- */
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes softIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes fromRight { from { opacity: 0; transform: translateX(22px); } }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-22px); } }

.anim-view { animation: viewIn .3s var(--ease) both; }
.anim-soft { animation: softIn .22s var(--ease) both; }
.anim-right { animation: fromRight .28s var(--ease) both; }
.anim-left { animation: fromLeft .28s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Schedule ---------- */
.hero {
  margin-top: 16px;
  padding: 22px 20px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.hero.is-live {
  background: var(--accent-soft);
  box-shadow: none;
}

.hero-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero.is-live .hero-label { color: var(--accent); }

.hero-title {
  margin-top: 6px;
  font-size: clamp(20px, 6vw, 25px);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-time {
  margin-top: 4px;
  font-size: clamp(46px, 15vw, 62px);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.hero-sub {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}

.hero-bar {
  display: block;
  height: 6px;
  margin-top: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  overflow: hidden;
}

.hero-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 1s linear;
}

.block-time {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 72px;
  white-space: nowrap;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.block-time b { font-weight: 650; color: var(--text); }
.block.is-past .block-time b { color: var(--muted); }

.block.is-now { background: var(--accent-soft); }
.block.is-now .block-time,
.block.is-now .row-title { color: var(--accent); }
.block.is-past { opacity: .45; }
.row-title.is-muted { color: var(--muted); font-weight: 400; }

.tick-on { color: var(--accent); display: grid; place-items: center; }
.tick-on svg { width: 19px; height: 19px; stroke-width: 2.6; }

/* ---------- Panels: a soft box per section ---------- */
.panel {
  margin-top: 18px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel .row:first-of-type::before { display: none; }
.panel .empty { padding: 4px 16px 16px; font-size: 14.5px; }

/* ---------- Home ---------- */
.hero-link {
  display: block;
  width: 100%;
  text-align: inherit;
  transition: transform .2s var(--ease);
}

.hero-link:active { transform: scale(.99); }
.hero-link .hero { margin-top: 14px; }

.hero-meta {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.quick { margin-top: 16px; }
.quick .btn { margin-top: 0; }

.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  flex: 1;
  min-height: 42px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 550;
  transition: transform .18s var(--ease), background-color .18s ease;
}

.chip:active { transform: scale(.96); background: var(--surface-2); }

/* ---------- Raised Home button in the tab bar ---------- */
.tabbar { overflow: visible; }

.tab-home {
  gap: 2px;
  justify-content: flex-start;
  padding-top: 6px;
}

.home-orb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-fab);
  transition: transform .2s var(--ease);
}

.home-orb svg { width: 25px; height: 25px; stroke-width: 2; }
.tab-home:active .home-orb { transform: scale(.92); }
.tab-home.is-active .home-orb { transform: translateY(-2px); }

/* two fields side by side (room + teacher) */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sync-or {
  text-align: center;
  margin: 8px 4px 18px;
  font-size: 13px;
}

/* ---------- Focus ---------- */
/* the strip that tells a computer a session is running */
.focus-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  /* clears the Home orb, which rises 26px above the bar */
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 42px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
  padding: 11px 18px;
  border-radius: 999px;
  background: #1c2333;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(10, 14, 25, .6);
}

.focus-bar.is-break { background: #1d4ed8; }
.focus-bar .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff6b6b;
  animation: breathe 1.8s ease-in-out infinite;
}
.focus-bar.is-break .dot { background: #93c5fd; }
.focus-bar-note { font-weight: 450; opacity: .75; }
@media (max-width: 380px) { .focus-bar-note { display: none; } }

/* ---------- The phone's full-screen states ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: calc(34px + var(--safe-top)) 30px calc(34px + var(--safe-bottom));
  text-align: center;
  color: #fff;
  overflow: hidden;
  transition: background-color .6s ease;
}

.lock[hidden] { display: none; }
.lock.is-focus { background: #a8231d; }
.lock.is-alarm { background: #8f1a15; }
.lock.is-break { background: #1e478f; }

.lock-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .5;
  margin-bottom: 26px;
}

.lock-big {
  font-size: clamp(34px, 10.5vw, 54px);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.1;
}

.lock-time {
  margin-top: 30px;
  font-size: clamp(58px, 19vw, 92px);
  font-weight: 250;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  opacity: .96;
}

.lock-note {
  margin-top: 22px;
  font-size: 15.5px;
  font-weight: 400;
  opacity: .72;
  max-width: 20em;
  line-height: 1.6;
}

/* the single rotating reminder */
.lock-line {
  margin: 34px 0 0;
  max-width: 17em;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  opacity: 0;
  letter-spacing: .01em;
}

.lock-line.is-in { animation: lineIn 1.2s ease forwards; }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); } to { opacity: .78; transform: none; } }

/* hold-to-confirm, with the fill showing progress */
.hold, .lock-out {
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  color: #fff;
  font-weight: 750;
  letter-spacing: .02em;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.hold {
  width: min(320px, 84vw);
  min-height: 62px;
  margin-top: 34px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38);
}

.lock-out {
  position: absolute;
  bottom: calc(26px + var(--safe-bottom));
  min-height: 38px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .04em;
  opacity: .32;
  background: rgba(0, 0, 0, .16);
}

.hold-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(255, 255, 255, .34);
}

.is-holding .hold-fill { width: 100%; transition: width var(--hold, 3000ms) linear; }
.hold-text { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .is-holding .hold-fill { transition: width var(--hold, 3000ms) linear !important; }
  .lock-line.is-in { animation: none; opacity: .78; }
}


/* ---------- Focus, in session (computer) ---------- */
.calm {
  margin-top: 12vh;
  text-align: center;
  padding: 0 8px;
}

.calm-label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.calm-time {
  margin: 26px 0 0;
  font-size: clamp(64px, 16vw, 120px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.calm-note {
  margin: 24px auto 0;
  max-width: 22em;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.calm-bar {
  display: block;
  width: min(320px, 70%);
  height: 3px;
  margin: 40px auto 0;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.calm-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 1s linear;
}

.calm.is-break .calm-bar > span { background: #2f6fed; }

/* ---------- Focus setup: − value + ---------- */
.focus-setup { margin-top: 8vh; }

.step { margin: 0 auto 26px; max-width: 340px; }

.step-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .18s var(--ease), background-color .18s ease;
}

.step-btn:active { transform: scale(.9); background: var(--surface-2); }

.step-value {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.step-input {
  width: 2.6ch;
  padding: 0;
  border: 0;
  background: none;
  text-align: right;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}

.step-input:focus { outline: none; color: var(--accent); }

.step-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.focus-summary {
  margin: 30px 6px 22px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.focus-setup .btn { max-width: 340px; margin-left: auto; margin-right: auto; }

/* stop control on the computer's session screen */
.stop-btn {
  position: relative;
  overflow: hidden;
  display: block;
  width: min(260px, 70%);
  min-height: 50px;
  margin: 46px auto 0;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: .1em;
  color: var(--muted);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  transition: color .2s ease;
}

.stop-btn:hover { color: var(--text); }
.stop-btn .hold-fill { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.stop-btn.is-holding { color: var(--danger); }

.stop-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  opacity: .7;
}

/* the phone's sync nudge, deliberately quiet */
.lock-sync {
  margin-top: 30px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  opacity: .5;
  background: rgba(255, 255, 255, .14);
  transition: opacity .2s ease;
}

.lock-sync:active { opacity: .8; }
.lock-sync.is-busy { animation: breathe 1.4s ease-in-out infinite; }
.lock.is-alarm .lock-sync { margin-top: 22px; }

/* ---------- v2: tray emoji icons ---------- */
.tab-emoji {
  font-size: 20px;
  line-height: 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.home-orb .tab-emoji { font-size: 22px; }
#editBtn.is-on { color: var(--accent); background: var(--accent-soft); }

/* ---------- v2: edit mode ---------- */
.blk {
  position: relative;
  margin-top: 14px;
  border-radius: var(--r-card);
  box-shadow: 0 0 0 1.5px var(--line);
  background: var(--bg);
  animation: softIn .22s var(--ease) both;
}

.blk-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.blk-handle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  border-radius: 10px;
}

.blk-handle svg { width: 18px; height: 18px; stroke-width: 2.6; }

.blk-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* every block carries the same row of controls, in the same order */
.blk-acts { display: flex; align-items: center; gap: 1px; flex: none; }

.blk-a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 9px;
  transition: color .18s ease, background-color .18s ease;
}

.blk-a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

.blk-a:active { color: var(--accent); background: var(--surface-2); }
.blk-a.is-del:active { color: var(--danger); }
.blk-a[disabled] { opacity: .28; }

@media (hover: hover) and (pointer: fine) {
  .blk-a:hover { color: var(--text); background: var(--surface-2); }
  .blk-a.is-del:hover { color: var(--danger); }
  .blk-a[disabled]:hover { color: var(--muted); background: none; }
}

/* The bar above already names the block, so its own top heading is the same
   words twice. Only the first one goes — a block with several sections keeps
   the headings that tell those sections apart. */
.blk-body > .panel:first-child > .panel-head:first-child,
.blk-body > .card:first-child > .section-head:first-child,
.blk-body > .section-head:first-child,
.blk-body > .panel-head:first-child { display: none; }

.blk-x {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 10px;
  transition: color .18s ease, background-color .18s ease;
}

.blk-x:active { color: var(--danger); background: var(--surface-2); }
.blk-x svg { width: 16px; height: 16px; stroke-width: 2.4; }

/* the block itself is inert while editing: layout is the only concern */
.blk-body { pointer-events: none; padding: 0 10px 10px; }
.blk-body > * { margin-top: 0 !important; }

.blk.is-drag {
  z-index: 30;
  box-shadow: 0 0 0 1.5px var(--accent), 0 18px 40px -18px rgba(10, 14, 30, .5);
  transition: none;
}

.pg-row.is-drag {
  z-index: 30;
  background: var(--surface);
  box-shadow: 0 12px 30px -14px rgba(10, 14, 30, .45);
  transition: none;
}

.add-blk {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border-radius: var(--r-card);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  transition: background-color .18s ease, transform .18s var(--ease);
}

.add-blk:active { background: var(--accent-soft); transform: scale(.985); }
.blk-spacer { height: 26px; }


/* ---------- v2: pages sheet ---------- */
.pg-list { display: grid; gap: 6px; margin-bottom: 12px; }

.pg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--r-field);
  background: var(--surface-2);
}

.pg-ic {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.pg-ic svg { width: 20px; height: 20px; }

.pg-name {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 8px 6px;
  font-weight: 550;
}

.pg-name:focus { outline: none; color: var(--accent); }

.ic-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 4px 0 8px;
}

.ic-opt {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 22px;
  transition: transform .18s var(--ease), background-color .18s ease;
}

.ic-opt:active { transform: scale(.9); background: var(--accent-soft); }
.ic-opt svg { width: 22px; height: 22px; }
.ic-opt .tab-emoji { font-size: 22px; width: auto; height: auto; }

/* ---------- v2: next-up & countdown blocks ---------- */
.nextup { min-height: 50px; font-size: 15px; }
.nextup b { font-weight: 650; }
.hero.cd .hero-time { font-size: clamp(52px, 17vw, 72px); }

/* ---------- v2: first-run setup ---------- */
.setup {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow-y: auto;
  background: var(--bg);
  padding: calc(20px + var(--safe-top)) 22px calc(30px + var(--safe-bottom));
}

.setup.is-out { animation: fade .3s ease reverse both; }

.su {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  animation: viewIn .3s var(--ease) both;
}

.su-skip {
  align-self: flex-end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.su-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }

.su .news-icon { width: 58px; height: 58px; border-radius: 19px; }
.su h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 7.4vw, 32px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.su p { margin: 0 0 10px; font-size: 16px; line-height: 1.6; color: var(--muted); }

/* ---------- home-screen instructions: one drawn step at a time ---------- */
.a2-card {
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.a2-frame {
  display: grid;
  place-items: center;
  min-height: 196px;
  padding: 16px 0 12px;
  background: var(--surface-2);
}

.a2-art { width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3; }

/* a phone is drawn portrait, so it gets the frame's full height instead of
   sitting small in a landscape box */
.a2-art.is-phone { max-width: 148px; aspect-ratio: 108 / 146; }

/* the drawing: flat shapes, one accent ring on the thing to press */
.a2-body { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.a2-screen { fill: var(--bg); }
.a2-bar { fill: var(--surface-2); }
.a2-row { fill: var(--line); }
.a2-row.is-on { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.a2-ico { fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.a2-ico circle, svg circle.a2-ico { fill: var(--text); stroke: none; }
.a2-tick { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

.a2-hi {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  animation: a2Pulse 1.9s ease-in-out infinite;
}

.a2-arrow { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }

@keyframes a2Pulse {
  50% { opacity: .35; }
}

.a2-say { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px 16px; }

.a2-num {
  flex: none;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.a2-txt { min-width: 0; }
.a2-txt b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.a2-txt i { font-style: normal; display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.a2-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }

.a2-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background-color .2s ease, transform .2s var(--ease);
}

.a2-dots i.is-on { background: var(--accent); transform: scale(1.35); }

.su-foot { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.su-foot .btn { width: 100%; }
.su-foot .link-btn { align-self: center; padding: 9px; }

.su-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 14px; }

/* ---------- v2.1: settings ---------- */
.set-card { padding: 2px 0; }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 54px;
}

.set-row + .set-row { border-top: 1px solid var(--line); }
.set-info { min-width: 0; }

.set-seg {
  flex: none;
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
}

.set-seg button {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color .18s ease, background-color .18s ease;
}

.set-seg button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
[data-theme="dark"] .set-seg button.is-active { background: #33363f; box-shadow: none; }
.set-about { text-align: center; margin-top: 22px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 12px;
  font-size: 14.5px;
  cursor: pointer;
}

.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* density + motion preferences */
body.is-compact .row { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
body.is-compact .hero { padding: 14px 16px 16px; }
body.is-compact .section-head { margin-top: 16px; }
body.is-compact .panel { margin-top: 12px; }
body.no-motion *, body.no-motion *::before, body.no-motion *::after {
  animation: none !important;
  transition-duration: .01ms !important;
}

/* ══════════ the block organizer ══════════
   Search and the tab strip ride together at the top of the sheet, so the
   navigation never scrolls away from the list it controls. Below them the
   view shows exactly one thing: a family of blocks, or search results. */
.bp-bar {
  position: sticky;
  top: -8px;                       /* the sheet's own top padding */
  z-index: 4;
  margin: 0 -2px;
  padding: 2px 2px 0;
  background: var(--surface);
}

.bp-bar .sheet-head { margin-bottom: 10px; }
.bp-search { margin-bottom: 8px; }

/* the bar is fixed above the list, so anything scrolled to must clear it */
.bpc { scroll-margin-top: 132px; }
.bp-group { scroll-margin-top: 132px; }

.bp-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bp-tabs::-webkit-scrollbar { display: none; }

/* a soft edge says there are more tabs than fit */
.bp-tabs {
  -webkit-mask: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.bp-tabs[hidden] { display: none; }

.bp-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 11px;
  border-bottom: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .18s ease, border-color .18s ease;
}

.bp-tab i {
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
}

.bp-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.bp-tab.is-on i { background: var(--accent-soft); color: var(--accent); }

/* ---------- a family of blocks ---------- */
.bp-group + .bp-group { margin-top: 22px; }

/* a single-family view needs no heading, so its list starts at the top */
.bp-group:only-child > .bp-list:first-child { padding-top: 14px; }

.bp-gh {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 2px 10px;
}

.bp-gh h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.bp-gh span { font-size: 12px; font-weight: 600; color: var(--muted); opacity: .6; }

.bp-list { display: grid; gap: 10px; }

.bp-count { padding: 14px 2px 10px; font-size: 13px; color: var(--muted); }

/* ---------- one block, as a card you can read ---------- */
.bpc {
  padding: 13px 14px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.bpc.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.bpc-top { display: flex; align-items: flex-start; gap: 11px; }

.bpc-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}

.bpc-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

.bpc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bpc-txt b { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.bpc-txt i { font-style: normal; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.bpc-add {
  flex: none;
  min-height: 32px;
  padding: 0 15px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 650;
  transition: transform .16s var(--ease), opacity .16s ease;
}

.bpc-add:active { transform: scale(.94); }

.bpc-done {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.bpc-done svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; }

/* the one-line "what makes this block smart" note */
.bpc-sm {
  margin: 9px 0 0;
  padding-left: 45px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.bpc-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding-left: 45px;
}

.bpc-pv {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.bpc-pv .chev { width: 15px; height: 15px; transition: transform .22s var(--ease); }
.bpc.is-open .bpc-pv .chev { transform: rotate(90deg); }

.bpc-on {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  opacity: .8;
}

.bpc-undo { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 0; }

/* a real render of the block, inert, on the app's own background */
.bpc-prev {
  margin-top: 11px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
  pointer-events: none;
  overflow: hidden;
  animation: softIn .24s var(--ease) both;
}

.bpc-frame > * { margin-top: 0 !important; }
.bpc-prev * { animation: none !important; }

.bp-none {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.bp-none b { font-size: 15px; color: var(--text); }
.bp-none span { font-size: 13px; line-height: 1.5; max-width: 30ch; }
.bp-none .btn { margin-top: 6px; width: auto; padding: 0 20px; }

/* ---------- block settings sheet ---------- */
.bo-lede { margin: -2px 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

.bo-sec + .bo-sec { margin-top: 20px; }

.bo-sec h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.bo-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.bo-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .18s ease, transform .16s var(--ease);
}

.bo-b svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }

.bo-b:active { transform: scale(.98); }
.bo-b[disabled] { opacity: .38; }
.bo-b.is-wide { width: 100%; justify-content: flex-start; }
.bo-b.is-wide + .bo-b.is-wide { margin-top: 8px; }
.bo-b.is-danger { color: var(--danger); }

.bo-note { margin-top: 9px; font-size: 12px; color: var(--muted); }

/* ---------- v2.1: block visuals ---------- */
.blk-btn { margin-top: 14px; }

.reward {
  padding: 18px 17px;
  display: grid;
  gap: 3px;
}

.reward b { font-size: 16.5px; letter-spacing: -0.015em; }
.reward span { font-size: 13.5px; color: var(--muted); }

.est { padding: 16px 17px; display: grid; gap: 5px; }
.est b { font-size: 17px; letter-spacing: -0.015em; }
.est span { font-size: 13.5px; color: var(--muted); }
.est i { font-style: normal; font-size: 12px; color: var(--muted); opacity: .7; }

.live-row { min-height: 56px; }

/* progress ring */
.ring-card .row { justify-content: center; }
.ring-wrap { position: relative; display: grid; place-items: center; padding: 10px 0; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring-mid { position: absolute; display: grid; place-items: center; text-align: center; }
.ring-mid b { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ring-mid i { font-style: normal; font-size: 11.5px; color: var(--muted); max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-idle { font-size: 28px; color: var(--muted); }
.ring-sub { font-size: 12px; color: var(--muted); }

/* week at a glance */
.wg { display: flex; gap: 6px; padding: 10px; }
.wg-col {
  flex: 1;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 9px 2px;
  border-radius: 12px;
  transition: background-color .18s ease, transform .18s var(--ease);
}
.wg-col:active { transform: scale(.94); }
.wg-col i { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.wg-col b { font-size: 17px; font-weight: 700; }
.wg-col em { font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; }
.wg-col.is-odd { background: var(--accent-soft); }
.wg-col.is-odd em { color: var(--accent); font-weight: 700; }

/* schedule comparison */
.cmp { padding: 12px 14px; }
.cmp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 0; font-size: 13px; }
.cmp-row i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-row.is-diff { background: var(--accent-soft); border-radius: 8px; padding-left: 6px; margin-left: -6px; }
.cmp-row.is-diff i { color: var(--accent); font-weight: 650; }

/* master add */
.mstr { display: flex; gap: 8px; padding: 12px; flex-wrap: wrap; }
.mstr-b {
  flex: 1 1 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  border-radius: 14px;
  background: var(--surface-2);
  font-weight: 600;
  font-size: 14.5px;
  transition: transform .18s var(--ease);
}
.mstr-b:active { transform: scale(.96); }
.mstr-b.is-main { flex-basis: 100%; background: var(--accent); color: var(--on-accent); }
.mstr-b.is-main .plus { color: var(--on-accent); }

/* spotlight + flashcards */
.spot .spot-acts { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.spot .chip, .fc .chip { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-height: 38px; padding: 0 16px; flex: none; }
.hero.spot { text-align: center; }
.fc { cursor: pointer; }
.fc-body { margin: 14px 0 6px; font-size: 19px; font-weight: 600; line-height: 1.45; white-space: pre-wrap; }
.fc-next { margin-top: 12px; }

/* workload meter + heat map */
.meter { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding: 14px 14px 6px; }
.mt-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.mt-col i { width: 100%; max-width: 26px; border-radius: 6px 6px 0 0; background: var(--accent);
  opacity: .8; min-height: 2px; transform-origin: bottom; animation: growUp .4s var(--ease) both; }
.mt-col b { font-size: 10.5px; color: var(--muted); }
.mt-sub { margin: 4px 14px 12px; font-size: 11.5px; color: var(--muted); }
.hm { padding: 12px 14px 4px; }
.hm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 4px; }
.hm-day {
  aspect-ratio: 1.15;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent) calc(var(--h) * 55%), var(--surface-2));
  color: var(--text);
}
.hm-day.is-out { opacity: .3; }

/* triage */
.tri-h { width: 30px; height: 30px; }
.tri-n { flex: none; width: 20px; font-size: 13px; font-weight: 750; color: var(--accent);
  font-variant-numeric: tabular-nums; }

/* done-this-week / streaks */
.dw { padding: 14px 16px; }
.dw-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dw-top b { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.dw-top span { font-size: 12.5px; color: var(--muted); margin-right: 10px; }
.dw-dots { display: flex; gap: 5px; margin-top: 10px; }
.dw-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); }
.dw-dots i.is-on { background: var(--accent); }

/* quick capture / pinned / reference */
.cap { padding: 8px; }
.cap-in { width: 100%; border: 0; background: none; padding: 10px 8px; font-size: 15px; }
.cap-in:focus { outline: none; }
.pinned { display: flex; gap: 10px; padding: 14px 16px; align-items: flex-start;
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.pin-ic { flex: none; }
.pin-t { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.ref { padding: 14px 16px; }
.ref pre { margin: 0; font: 13.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; color: var(--text); }

/* links */
.lnk { text-decoration: none; color: inherit; }
.lnk-now { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 7px;
  margin-left: 6px; vertical-align: 2px; }

/* photos */
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 14px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph i { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 9.5px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 8px 5px 3px; }
.ph-full { width: 100%; border-radius: var(--r-card); }

/* mood */
.mood { padding: 14px 16px; }
.mood-row { display: flex; gap: 8px; justify-content: space-between; }
.mood-b { font-size: 26px; width: 46px; height: 46px; border-radius: 50%; display: grid;
  place-items: center; transition: transform .18s var(--ease), background-color .18s ease; filter: grayscale(.65); }
.mood-b:active { transform: scale(.85); }
.mood-b.is-on { background: var(--accent-soft); filter: none; transform: scale(1.08); }
.mood-strip { display: flex; gap: 4px; align-items: flex-end; margin-top: 14px; height: 34px; }
.mood-c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.mood-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mood-bar { width: 5px; border-radius: 3px 3px 0 0; background: var(--surface-2); min-height: 2px; }
[data-theme="dark"] .mood-bar { background: #33363f; }

/* review */
.rev { padding: 15px 17px; }
.rev b { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rev p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; }

/* search */
.srch { padding: 8px; }
.search-in { width: 100%; border: 0; background: var(--surface-2); border-radius: 12px;
  padding: 11px 13px; font-size: 15px; }
.search-in:focus { outline: 2px solid var(--accent); }
.search-out { margin-top: 4px; }

/* stickers + alerts + misc */
.sticker { font-size: 56px; text-align: center; padding: 8px 0; }
.panel.is-alert, .card.is-alert { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 45%, transparent); }
.add-blk.is-ghosted { border-style: dashed; color: var(--muted); font-weight: 500; font-size: 13.5px; pointer-events: none; }
.focus-sug { display: block; margin: 0 auto 14px; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cc-meet { margin: 2px 16px 8px; font-size: 13.5px; color: var(--muted); }
.cc-meet b { color: var(--accent); }
.cc-note { margin: 6px 16px; font-size: 13px; color: var(--muted); font-style: italic; }
.cc-links { margin: 4px 16px 14px; font-size: 13.5px; }
.cc-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.panel-head h2 .swatch, .section-head h2 .swatch { display: inline-block; vertical-align: 1px; margin-right: 4px; }
.qd { min-height: 52px; }
.qd-c { width: 30px; height: 30px; }
.hero.wi .hero-time { font-size: clamp(40px, 13vw, 56px); }

/* week calendar */
.wc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wc { display: flex; gap: 8px; padding: 12px; min-width: 560px; }
.wc-col { flex: 1; min-width: 72px; border-radius: 12px; padding: 8px 7px; background: var(--surface-2); }
.wc-col.is-today { background: var(--accent-soft); }
.wc-col b { display: block; font-size: 12px; }
.wc-col i { display: block; font-style: normal; font-size: 10px; color: var(--muted); margin: 1px 0 6px; }
.wc-it { display: block; font-size: 10.5px; line-height: 1.3; padding: 3px 5px; margin-top: 3px;
  border-left: 2.5px solid var(--muted); background: var(--surface); border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* icon sheet */
.ic-own { display: flex; gap: 10px; align-items: flex-start; }
.ic-own .field { flex: 1; margin: 0; }
.ic-own .btn { width: auto; margin: 0; min-height: 46px; padding: 0 18px; }

/* spacer collapses where space is scarce */
@media (max-width: 480px) { .blk-spacer { height: 14px; } }
@keyframes growUp { from { transform: scaleY(0); opacity: 0; } }

/* settings rows may wrap on narrow screens instead of crushing their labels */
.set-row { flex-wrap: wrap; }
.set-row .set-info { flex: 1 1 130px; }
.set-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.set-seg::-webkit-scrollbar { display: none; }

/* previews: buttons shouldn't drag their page margins into the little pane */
.bpc-frame > * { margin-top: 0 !important; }

/* ---------- Spotlight (first-use guide) ----------
   The dim is one enormous box-shadow around a transparent hole, so there is
   no second overlay to keep in sync and the cutout can animate as one box. */
.spot {
  position: fixed;
  inset: 0;
  z-index: 55;
  animation: fade .22s ease;
}

.spot[hidden] { display: none; }

.sp-hole {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(8, 9, 13, .66);
  outline: 2px solid var(--accent);
  outline-offset: 0;
  pointer-events: none;
  transition: top .3s var(--ease), left .3s var(--ease),
              width .3s var(--ease), height .3s var(--ease);
}

.sp-card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  padding: 17px 18px 15px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: 0 22px 55px -20px rgba(6, 8, 16, .65);
  animation: softIn .3s var(--ease) both;
}

.sp-card b {
  display: block;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.sp-card p {
  margin: 7px 0 13px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.sp-card .btn { min-height: 44px; font-size: 15.5px; margin: 0; }

/* ---------- v2.2: school picker in setup ---------- */
.su-schools {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
  max-height: 48vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.su-school {
  position: relative;
  display: block;
  text-align: left;
  padding: 13px 44px 13px 15px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .18s ease, transform .18s var(--ease);
}

.su-school:active { transform: scale(.985); }
.su-school.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.su-school b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.su-school i { font-style: normal; font-size: 12.5px; color: var(--muted); }

.su-school .su-check {
  position: absolute;
  top: 50%;
  right: 13px;
  margin-top: -11px;
}

/* only the chosen school wears the tick */
.su-school .su-check {
  color: transparent;
  transform: scale(.6);
  transition: color .18s ease, transform .18s var(--ease);
}

.su-school .su-check svg { width: 18px; height: 18px; stroke-width: 2.8; }
.su-school.is-on .su-check { color: var(--accent); transform: none; }

/* ---------- v2.3: block rotation ---------- */
.rot-chip {
  flex: none;
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: transform .18s var(--ease), background-color .18s ease;
}

.rot-chip:active { transform: scale(.94); }

/* not anchored yet: it's a question, so make it look like one */
.rot-chip.is-unset {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
  text-transform: none;
  letter-spacing: 0;
}

.section-head .rot-chip + .link-btn { margin-left: 12px; }

/* a period that isn't meeting today steps back, but stays reachable */
.row.is-offday { opacity: .5; }
.row.is-offday .rot-dot { display: none; }

.rot-dot {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ══════════════════ Notebook Style ══════════════════
   Everything below is scoped to [data-style="notebook"], so Default costs
   nothing and renders byte-identically. The paper is built from gradients
   and one ~300-byte inline-SVG grain — no images, no network. Only the
   handwritten face downloads, and only once this style is chosen. */

[data-style="notebook"] {
  --font-hand: 'Shantell Sans', 'Segoe Print', 'Bradley Hand', 'Comic Neue', var(--font);

  --bg: #f3efe3;                     /* warm paper */
  --surface: #fbf8ef;                /* a lighter sheet on the desk */
  --surface-2: #ece7d7;
  --text: #33302a;                   /* soft ink, not laser black */
  --muted: #8a8371;
  --line: rgba(70, 60, 35, .14);
  --accent: #3f5bc7;                 /* fountain-pen blue */
  --on-accent: #fdfcf7;
  --accent-soft: #e5e9f7;
  --danger: #c1493c;                 /* red pen */
  --gold: #96721c;
  --gold-soft: #f1e7cd;

  --nb-margin: rgba(214, 116, 108, .5);          /* the classic red rule */
  --nb-rule: rgba(84, 116, 180, .1);             /* faint ruled lines */
  --nb-hole: rgba(70, 60, 35, .1);
  --nb-grain: .05;

  --shadow-card: 0 1px 0 rgba(70, 60, 35, .06), 0 8px 18px -14px rgba(70, 60, 35, .5);
  --shadow-sheet: 0 -10px 40px rgba(60, 50, 25, .22);
  --shadow-fab: 0 8px 18px -8px rgba(63, 91, 199, .55);
  --shadow-pill: 0 3px 8px -3px rgba(63, 91, 199, .45);

  /* squared-off like cut paper, not app-store pills */
  --r-card: 10px;
  --r-day: 10px;
  --r-field: 9px;
  --r-btn: 10px;
  --r-sheet: 16px;
}

[data-style="notebook"][data-theme="dark"] {
  --bg: #16140e;                     /* a notebook by lamplight */
  --surface: #201d15;
  --surface-2: #2b271d;
  --text: #e9e2d2;
  --muted: #99917d;
  --line: rgba(233, 226, 210, .12);
  --accent: #8fa4e8;
  --on-accent: #14120c;
  --accent-soft: #262a3c;
  --danger: #e2796c;
  --gold: #d9b86a;
  --gold-soft: #2c2513;

  --nb-margin: rgba(214, 116, 108, .32);
  --nb-rule: rgba(140, 160, 210, .07);
  --nb-hole: rgba(233, 226, 210, .07);
  --nb-grain: .04;

  --shadow-card: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, .6);
  --shadow-pill: none;
}

/* ---------- the desk: grain, ruled lines, margin, punch holes ---------- */
[data-style="notebook"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    /* paper grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    /* the red margin rule */
    linear-gradient(to right, transparent 44px, var(--nb-margin) 44px, var(--nb-margin) 45.5px, transparent 45.5px),
    /* ruled lines, spaced like a real college rule */
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--nb-rule) 31px, var(--nb-rule) 32.5px);
  background-size: 180px 180px, 100% 100%, 100% 32.5px;
  opacity: 1;
}

[data-style="notebook"] body::after {
  /* punch holes down the left edge, only where there's room for them */
  content: "";
  position: fixed;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle 8px at 9px 16px,
    var(--nb-hole) 0 7px, transparent 8px);
  background-size: 18px 25vh;
  background-position: 0 12vh;
  background-repeat: repeat-y;
}

@media (max-width: 419px) {
  [data-style="notebook"] body::after { display: none; }
}

/* content sits above the desk layer (the setup overlay is already fixed
   at z-70, so it must NOT be dragged into the flow here) */
[data-style="notebook"] main { position: relative; z-index: 1; }

/* ---------- handwriting where it reads as writing ---------- */
[data-style="notebook"] body {
  font-family: var(--font-hand);
  letter-spacing: 0;
}

/* the base sheet pins buttons and fields to the UI face; hand them the pen too
   (the structural exemptions just below win where they apply) */
[data-style="notebook"] button,
[data-style="notebook"] input,
[data-style="notebook"] textarea,
[data-style="notebook"] select {
  font-family: var(--font-hand);
}

/* structure stays typeset: small-caps labels, tabs, chrome, and anything
   that ticks every second (handwritten digits jitter) */
[data-style="notebook"] .section-head h2,
[data-style="notebook"] .panel-head h2,
[data-style="notebook"] .hero-label,
[data-style="notebook"] .hero-time,
[data-style="notebook"] .hero-sub,
[data-style="notebook"] .calm-time,
[data-style="notebook"] .lock,
[data-style="notebook"] .block-time,
[data-style="notebook"] .cal-week,
[data-style="notebook"] .tab span,
[data-style="notebook"] .tag,
[data-style="notebook"] .due,
[data-style="notebook"] .count,
[data-style="notebook"] .blk-name,
[data-style="notebook"] .step-label,
[data-style="notebook"] .news-eyebrow,
[data-style="notebook"] .rot-chip,
[data-style="notebook"] .sync-code,
[data-style="notebook"] .field label,
[data-style="notebook"] input[type="date"],
[data-style="notebook"] input[type="number"] {
  font-family: var(--font);
}

/* the desk shows through between the sheets */
[data-style="notebook"] .topbar,
[data-style="notebook"] .tabbar {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
}

[data-style="notebook"] .tabbar { border-top-style: dashed; }
[data-style="notebook"] .topbar.is-scrolled { border-bottom-style: dashed; }

/* ---------- sheets of paper, not app cards ---------- */
[data-style="notebook"] .card,
[data-style="notebook"] .panel,
[data-style="notebook"] .hero {
  border: 1px solid var(--line);
}

[data-style="notebook"] .row + .row::before {
  background: none;
  border-top: 1px dashed var(--line);
  height: 0;
}

/* a hand-drawn check circle: slightly wobbly, thicker ink */
[data-style="notebook"] .check {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--text) 40%, transparent);
  border-radius: 46% 54% 52% 48% / 52% 47% 53% 48%;
}

/* the pencil that draws through a finished line is defined with the rest of
   the ink further down; here we only clear the browser's own strike */
[data-style="notebook"] .row-title { position: relative; }
[data-style="notebook"] .row.is-done .row-title { text-decoration: none; }

/* selected calendar day: an ink circle around the number, not a filled pill */
[data-style="notebook"] .day.is-selected .dnum {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
  border-radius: 48% 52% 53% 47% / 52% 46% 54% 48%;
}

[data-style="notebook"] .day.is-selected.is-today .dnum {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* buttons read as marker on paper */
[data-style="notebook"] .btn {
  border-radius: 10px 12px 10px 13px / 12px 10px 13px 10px;
}

[data-style="notebook"] .chip,
[data-style="notebook"] .mstr-b {
  border-radius: 9px 11px 9px 12px / 11px 9px 12px 9px;
}

/* a few things are allowed to sit a hair off-square, like real desk objects */
[data-style="notebook"] .pinned { rotate: -.6deg; }
[data-style="notebook"] .sticker { rotate: 2deg; }
[data-style="notebook"] .reward { rotate: -.35deg; }

/* the bottom sheet becomes a page with a strip of washi tape */
[data-style="notebook"] .grabber {
  width: 74px;
  height: 14px;
  margin: 0 auto 10px;
  border-radius: 2px;
  rotate: -1.2deg;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ---------- paper-physical motion ---------- */
@keyframes nbPageIn {
  from { opacity: 0; transform: translateY(10px) rotate(-.35deg); }
}

@keyframes nbSlipRight {
  from { opacity: 0; transform: translateX(26px) rotate(.5deg); }
}

@keyframes nbSlipLeft {
  from { opacity: 0; transform: translateX(-26px) rotate(-.5deg); }
}

@keyframes nbSettle {
  from { transform: translateY(100%) rotate(.6deg); }
}

[data-style="notebook"] .anim-view { animation: nbPageIn .32s var(--ease) both; }
[data-style="notebook"] .anim-soft { animation: nbPageIn .24s var(--ease) both; }
[data-style="notebook"] .anim-right { animation: nbSlipRight .3s var(--ease) both; }
[data-style="notebook"] .anim-left { animation: nbSlipLeft .3s var(--ease) both; }

@media (max-width: 619px) {
  [data-style="notebook"] .sheet { animation: nbSettle .46s var(--ease-sheet); }
}

/* dragging a block feels like sliding a card of paper */
[data-style="notebook"] .blk.is-drag { rotate: .8deg; }
[data-style="notebook"] .pg-row.is-drag { rotate: -.6deg; }

/* checking off gets a small pencil-flick instead of a pop */
@keyframes nbTick {
  35% { transform: scale(1.14) rotate(-7deg); }
  70% { transform: scale(.97) rotate(2deg); }
}

[data-style="notebook"] .check.pop { animation: nbTick .4s var(--ease); }

/* the spotlight card sits like a sticky note */
[data-style="notebook"] .sp-card { rotate: -.5deg; }
[data-style="notebook"] .sp-hole { outline-style: dashed; }

/* ---------- style previews (setup + settings) ---------- */
.stylep {
  flex: none;
  width: 52px;
  height: 40px;
  border-radius: 7px;
  position: relative;
  overflow: hidden;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}

.stylep i {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 2px;
}

.stylep i:nth-child(1) { top: 9px; }
.stylep i:nth-child(2) { top: 18px; }
.stylep i:nth-child(3) { top: 27px; right: 20px; }

.stylep-def { background: #f6f7f9; }
.stylep-def i { background: #c9d2f1; }
.stylep-def i:nth-child(1) { background: #4665e6; }

.stylep-nb {
  background:
    linear-gradient(to right, transparent 11px, rgba(214, 116, 108, .55) 11px, rgba(214, 116, 108, .55) 12px, transparent 12px),
    repeating-linear-gradient(to bottom, #f6f1e2 0, #f6f1e2 8px, rgba(84, 116, 180, .18) 8px, rgba(84, 116, 180, .18) 9px);
}

.stylep-nb i {
  left: 16px;
  background: #6b6353;
  rotate: -1deg;
}

.stylep-nb i:nth-child(1) { background: #3f5bc7; }

/* setup's style cards share the school-card skeleton */

.style-note {
  padding: 10px 14px;
  border-radius: var(--r-field);
  background: var(--gold-soft);
  color: var(--gold);
  line-height: 1.55;
}

.su-hint.style-note { margin-top: 14px; font-size: 13px; }

/* settings rows reuse the preview swatch */
.set-card .stylep, .card .stylep { margin-left: 2px; }

/* the pen stroke ends where the words do, not at the card edge */
[data-style="notebook"] .row-title {
  width: fit-content;
  max-width: 100%;
}

/* ---------- notebook: erase, scratch, page-marking ---------- */

/* removing a block is a rub-out: two quick passes, then it's gone */
@keyframes nbErase {
  0%   { opacity: 1; }
  30%  { transform: translateX(-3px) rotate(-.5deg); }
  55%  { transform: translateX(3px) rotate(.5deg); }
  80%  { transform: translateX(-2px) rotate(-.3deg); opacity: .45; }
  100% { opacity: 0; transform: translateY(-5px) scale(.97); filter: blur(1.4px); }
}

[data-style="notebook"] .blk.is-erasing,
[data-style="notebook"] .pg-row.is-erasing {
  animation: nbErase .34s var(--ease) forwards;
  pointer-events: none;
}

/* default style still gets a clean, quick removal */
@keyframes fadeOutUp {
  to { opacity: 0; transform: translateY(-5px) scale(.98); }
}

.blk.is-erasing, .pg-row.is-erasing {
  animation: fadeOutUp .2s var(--ease) forwards;
  pointer-events: none;
}

/* a scribble scratched across the tick as it lands */
@keyframes nbScratch {
  from { transform: scaleX(0) rotate(-8deg); opacity: .9; }
  to   { transform: scaleX(1) rotate(-8deg); opacity: 0; }
}

[data-style="notebook"] .check { position: relative; overflow: visible; }

[data-style="notebook"] .check.pop::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: 48%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left center;
  animation: nbScratch .45s var(--ease) forwards;
}

/* page-marking: the page you're on wears a little paper tab */
[data-style="notebook"] .tab { position: relative; }

[data-style="notebook"] .tab.is-active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 30px;
  height: 5px;
  margin-left: -15px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
  animation: nbMark .28s var(--ease) both;
}

@keyframes nbMark {
  from { transform: translateY(-5px); opacity: 0; }
}

/* the raised Home button keeps its own marker out of the way */
[data-style="notebook"] .tab-home.is-active::before { display: none; }


/* ══════════ notebook: fluid paper, drawn ink, stationery ══════════ */

/* The page scales with the window instead of jumping at breakpoints: it
   tracks the viewport, never narrower than the content column, and stops
   growing before it looks stretched on an ultrawide desk. Ruled spacing and
   the margin inset scale with it, so the paper looks the same "size" whether
   you're on a phone or a 34-inch monitor. */
[data-style="notebook"] {
  --nb-page: min(100%, max(680px, 58vw));
  --nb-rule-h: clamp(30px, 1.4vw + 26px, 38px);
  --nb-margin-x: clamp(30px, 4.2vw, 62px);
  --nb-hole-x: clamp(12px, 1.6vw, 22px);
  --nb-desk: #e7e1d2;
}

[data-style="notebook"][data-theme="dark"] { --nb-desk: #100e09; }

/* phones: the screen simply is the page */
@media (max-width: 719px) {
  [data-style="notebook"] { --nb-page: 100%; --nb-margin-x: 44px; }
}

/* ultrawide: stop growing, stay a page rather than a banner */
@media (min-width: 1700px) {
  [data-style="notebook"] { --nb-page: 1080px; }
}

[data-style="notebook"] body::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(to right, transparent var(--nb-margin-x),
      var(--nb-margin) var(--nb-margin-x), var(--nb-margin) calc(var(--nb-margin-x) + 1.5px),
      transparent calc(var(--nb-margin-x) + 1.5px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--nb-rule-h) - 1.5px),
      var(--nb-rule) calc(var(--nb-rule-h) - 1.5px), var(--nb-rule) var(--nb-rule-h));
  background-size: 180px 180px, 100% 100%, 100% var(--nb-rule-h);
}

[data-style="notebook"] body::after {
  left: var(--nb-hole-x);
  width: 20px;
  /* an explicit pixel radius — a percentage one turns into a tall ellipse
     as the repeat interval grows, which reads as bars, not holes */
  background-image: radial-gradient(circle 7px at 10px 22px,
    var(--nb-hole) 0 99%, transparent 100%);
  background-size: 20px clamp(112px, 13vh, 150px);
}

/* from tablet up the sheet becomes a bounded page resting on a desk */
@media (min-width: 720px) {
  [data-style="notebook"] body { background-color: var(--nb-desk); }

  [data-style="notebook"] body::before {
    inset: 0 auto 0 50%;
    width: var(--nb-page);
    transform: translateX(-50%);
    background-color: var(--bg);
    box-shadow: 0 0 0 1px var(--line), 0 24px 70px -44px rgba(60, 50, 25, .55);
  }

  [data-style="notebook"] body::after {
    left: calc(50% - var(--nb-page) / 2 + var(--nb-hole-x));
  }

  [data-style="notebook"] .topbar,
  [data-style="notebook"] .tabbar {
    background: color-mix(in srgb, var(--nb-desk) 88%, transparent);
  }

  /* content follows the page, so it never drifts off the paper */
  [data-style="notebook"] main { max-width: min(680px, calc(var(--nb-page) - 132px)); }
}

/* ---------- a pencil draws through what you finish ----------
   A hand-wobbled stroke, revealed left to right by clip-path so the squiggle
   never distorts. It's a transition, not an animation, so with reduced motion
   the line is simply there — the state still reads correctly. */
[data-style="notebook"] .row .row-title::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -5px;
  top: 44%;
  height: 11px;
  border-radius: 0;
  background: currentColor;
  opacity: .72;
  rotate: -.5deg;
  transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 11' preserveAspectRatio='none'%3E%3Cpath d='M3 6.6C29 4.1 53 8.6 79 6.1s47-3.4 73 .9 52 1.6 85-2.2' fill='none' stroke='%23000' stroke-width='2.7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 11' preserveAspectRatio='none'%3E%3Cpath d='M3 6.6C29 4.1 53 8.6 79 6.1s47-3.4 73 .9 52 1.6 85-2.2' fill='none' stroke='%23000' stroke-width='2.7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .42s cubic-bezier(.35, .6, .3, 1);
}

[data-style="notebook"] .row.is-done .row-title::after { clip-path: inset(0 -3% 0 0); }

/* ---------- the tick writes itself ---------- */
[data-style="notebook"] .check svg path {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset .32s var(--ease) .06s;
}

[data-style="notebook"] .row.is-done .check svg path,
[data-style="notebook"] .check.is-mid svg path { stroke-dashoffset: 0; }
[data-style="notebook"] .check svg { rotate: -5deg; }

/* ---------- pen and pencil under the cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  /* rows lift a hair, like paper under a fingertip */
  [data-style="notebook"] .row:not(.block):hover {
    background: color-mix(in srgb, var(--accent) 4%, transparent);
  }

  /* links get an ink underline drawn under them */
  [data-style="notebook"] .link-btn { position: relative; }

  [data-style="notebook"] .link-btn::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: .55;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .26s var(--ease);
  }

  [data-style="notebook"] .link-btn:hover::after { transform: scaleX(1); }

  /* the pencil in the top bar tilts, as if picked up */
  [data-style="notebook"] #editBtn:hover svg { rotate: -12deg; }
  [data-style="notebook"] .icon-btn svg { transition: rotate .2s var(--ease); }

  /* chips and buttons press into the paper rather than float */
  [data-style="notebook"] .chip:hover { rotate: -.6deg; }
}

/* ---------- sticky notes ---------- */
[data-style="notebook"] .pinned {
  background: #fdf0a8;
  color: #4a4326;
  border: 0;
  border-radius: 2px 2px 3px 3px;
  rotate: -1.4deg;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 12px 20px -14px rgba(70, 60, 20, .6);
}

[data-theme="dark"][data-style="notebook"] .pinned { background: #6c5f2a; color: #f6efd2; }
[data-style="notebook"] .pinned .pin-t { color: inherit; }

/* the corner curl */
[data-style="notebook"] .pinned::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, .1) 50%);
}

[data-style="notebook"] .pinned { position: relative; overflow: hidden; }

/* the reward card reads as a torn-off note */
[data-style="notebook"] .reward {
  background: #fdf0a8;
  color: #4a4326;
  rotate: -.8deg;
  border: 0;
}

[data-theme="dark"][data-style="notebook"] .reward { background: #6c5f2a; color: #f6efd2; }
[data-style="notebook"] .reward span { color: inherit; opacity: .75; }

/* ---------- gentle ink ---------- */
/* section labels sit on a drawn rule that grows in with the page */
@keyframes nbInk { from { transform: scaleX(0); } }

[data-style="notebook"] .section-head h2 { position: relative; }

[data-style="notebook"] .section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: -6px;
  bottom: -4px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: .3;
  transform-origin: left center;
  animation: nbInk .5s var(--ease) both;
}

/* ══════════ half notebook: the paper moves too ══════════
   With cards on the page the sheet is a fixed backdrop, so on its own it sits
   dead still while the writing scrolls over it — the one piece of paper
   physics full mode gets for free. Drifting the ruled lines and the punch
   holes a fraction of the scroll distance hands it back. The gradients repeat,
   so any offset tiles seamlessly and there is nothing to reset; --nb-sy is the
   scroll position, written once a frame and only while a half page scrolls. */
[data-style="notebook"]:not([data-full="1"]) body::before {
  background-position: 0 0, 0 0, 0 calc(var(--nb-sy, 0) * -.34px);
}

[data-style="notebook"]:not([data-full="1"]) body::after {
  background-position: 0 calc(12vh + var(--nb-sy, 0) * -.34px);
}

/* ---------- and the sheets themselves behave like paper ---------- */
@media (hover: hover) and (pointer: fine) {
  [data-style="notebook"]:not([data-full="1"]) .card,
  [data-style="notebook"]:not([data-full="1"]) .panel {
    transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  }

  /* a sheet lifts a hair and settles off-square under the cursor */
  [data-style="notebook"]:not([data-full="1"]) .card:hover,
  [data-style="notebook"]:not([data-full="1"]) .panel:hover {
    transform: translateY(-1.5px) rotate(-.12deg);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 14px 24px -18px rgba(70, 60, 20, .55);
  }
}

/* pressing a row presses the page, in either notebook mode */
[data-style="notebook"] .row:not(.block):active {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* ---------- page turns (opt-in, Settings) ---------- */
@keyframes nbTurn {
  from { opacity: 0; transform: perspective(1400px) rotateY(-14deg) translateX(18px); }
}

.anim-turn { animation: viewIn .3s var(--ease) both; }

[data-style="notebook"] .anim-turn {
  transform-origin: left center;
  animation: nbTurn .36s cubic-bezier(.3, .7, .3, 1) both;
}

/* ══════════ Full notebook ══════════
   The paper stops being a backdrop and becomes the page itself: <main> is
   the sheet, so the grain, margin rule and ruled lines are laid out in flow
   and scroll with what's written on them. Nothing floats in a white card —
   content sits directly on the paper, and the rules pass behind it. */

[data-style="notebook"][data-full="1"] body::before,
[data-style="notebook"][data-full="1"] body::after { display: none; }

[data-style="notebook"][data-full="1"] body { background: var(--nb-desk); }

@media (max-width: 719px) {
  [data-style="notebook"][data-full="1"] body { background: var(--bg); }
}

[data-style="notebook"][data-full="1"] main {
  position: relative;
  width: var(--nb-page);
  max-width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - var(--tabbar-h) - var(--safe-bottom));
  padding: 8px clamp(16px, 2.4vw, 30px) calc(var(--tabbar-h) + 60px)
           calc(var(--nb-margin-x) + clamp(12px, 1.6vw, 22px));
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(to right, transparent var(--nb-margin-x),
      var(--nb-margin) var(--nb-margin-x), var(--nb-margin) calc(var(--nb-margin-x) + 1.5px),
      transparent calc(var(--nb-margin-x) + 1.5px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--nb-rule-h) - 1.5px),
      var(--nb-rule) calc(var(--nb-rule-h) - 1.5px), var(--nb-rule) var(--nb-rule-h));
  background-size: 180px 180px, 100% 100%, 100% var(--nb-rule-h);
  background-repeat: repeat, no-repeat, repeat;
}

/* punch holes ride the page, so they scroll with it */
[data-style="notebook"][data-full="1"] main::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--nb-hole-x);
  width: 20px;
  pointer-events: none;
  background-image: radial-gradient(circle 7px at 10px 22px,
    var(--nb-hole) 0 99%, transparent 100%);
  background-size: 20px clamp(112px, 13vh, 150px);
}

@media (min-width: 720px) {
  [data-style="notebook"][data-full="1"] main {
    box-shadow: 0 0 0 1px var(--line), 0 24px 70px -44px rgba(60, 50, 25, .55);
  }
}

/* ---------- nothing floats: cards dissolve into the page ---------- */
[data-style="notebook"][data-full="1"] .card,
[data-style="notebook"][data-full="1"] .panel,
[data-style="notebook"][data-full="1"] .hero,
[data-style="notebook"][data-full="1"] .agenda > div,
[data-style="notebook"][data-full="1"] .cmp,
[data-style="notebook"][data-full="1"] .wc-wrap,
[data-style="notebook"][data-full="1"] .dw,
[data-style="notebook"][data-full="1"] .est,
[data-style="notebook"][data-full="1"] .meter,
[data-style="notebook"][data-full="1"] .hm,
[data-style="notebook"][data-full="1"] .mood,
[data-style="notebook"][data-full="1"] .rev,
[data-style="notebook"][data-full="1"] .srch,
[data-style="notebook"][data-full="1"] .dg-list,
[data-style="notebook"][data-full="1"] .dsel-list,
[data-style="notebook"][data-full="1"] .dsel-empty,
[data-style="notebook"][data-full="1"] .cap {
  background: none;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

/* the ruled lines do the separating now */
[data-style="notebook"][data-full="1"] .row + .row::before { display: none; }

/* rows land on the rule grid instead of sitting in a box */
[data-style="notebook"][data-full="1"] .row {
  min-height: calc(var(--nb-rule-h) * 2);
  padding-left: 0;
  padding-right: 4px;
}

[data-style="notebook"][data-full="1"] .row:active {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

[data-style="notebook"][data-full="1"] .panel-head,
[data-style="notebook"][data-full="1"] .section-head {
  padding-left: 0;
  padding-right: 4px;
  margin-left: 0;
  margin-right: 0;
}

[data-style="notebook"][data-full="1"] .panel .empty,
[data-style="notebook"][data-full="1"] .empty { padding-left: 0; padding-right: 4px; }

/* the hero is just words written at the top of the page */
[data-style="notebook"][data-full="1"] .hero {
  padding: 10px 0 14px;
  text-align: left;
}

[data-style="notebook"][data-full="1"] .hero.is-live {
  background: none;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

[data-style="notebook"][data-full="1"] .hero-bar {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* the calendar grid reads as ruled squares, like the reference */
[data-style="notebook"][data-full="1"] .cal-grid { gap: 0; }

[data-style="notebook"][data-full="1"] .dsel {
  min-height: calc(var(--nb-rule-h) * 3);
  border-radius: 0;
}

/* blocks keep a little air between them without becoming cards */
[data-style="notebook"][data-full="1"] .panel { margin-top: 22px; }
[data-style="notebook"][data-full="1"] .card.gap,
[data-style="notebook"][data-full="1"] .card.top { margin-top: 14px; }
[data-style="notebook"][data-full="1"] .card.gap-lg { margin-top: 28px; }

/* chips and the tab bar join the page */
[data-style="notebook"][data-full="1"] .chip {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--line);
}

[data-style="notebook"][data-full="1"] .tabbar {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px dashed var(--line);
}

@media (min-width: 720px) {
  [data-style="notebook"][data-full="1"] .tabbar,
  [data-style="notebook"][data-full="1"] .topbar {
    background: color-mix(in srgb, var(--nb-desk) 90%, transparent);
  }
}

/* sticky notes stay objects on the page — they should still lift off it */
[data-style="notebook"][data-full="1"] .pinned,
[data-style="notebook"][data-full="1"] .reward {
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 12px 20px -14px rgba(70, 60, 20, .6);
  padding: 14px 16px;
}

/* the tasks "Done" group fades rather than sitting in a tinted box */
[data-style="notebook"][data-full="1"] .card.is-finished { opacity: .55; }

/* edit mode still needs visible block boundaries to drag against */
[data-style="notebook"][data-full="1"] .blk {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border-radius: 8px;
}

/* on a full page, hover must tint the paper — an opaque fill reads as a
   selection box sitting on top of the sheet, which breaks the illusion */
@media (hover: hover) and (pointer: fine) {
  [data-style="notebook"][data-full="1"] .row.task:hover,
  [data-style="notebook"][data-full="1"] .row:not(.block):hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
  }
}

[data-style="notebook"][data-full="1"] .row.task { border-radius: 6px; }

/* ══════════ dated lists: a day is a section ══════════
   The date is stated once, in the heading, and everything that falls on it
   sits underneath. Rows inside a group drop their own date label, so a day
   with four things on it reads as one day rather than four repetitions. */
.dg + .dg { margin-top: 14px; }

/* the groups bring their own surfaces, so the panel around them must not be
   a second card — a card inside a card is the nesting that reads as clutter */
.panel.is-grouped {
  background: none;
  box-shadow: none;
  border: 0;                 /* notebook draws one on every .panel */
  border-radius: 0;
  overflow: visible;
}

.panel.is-grouped > .panel-head { padding-left: 4px; padding-right: 4px; }

.dg-h {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 4px 8px;
}

.dg-date {
  flex: none;
  width: 42px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 5px 0 6px;
  border-radius: 10px;
  background: var(--surface-2);
  line-height: 1;
}

.dg-date b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }

.dg-date i {
  font-style: normal;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dg-when { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dg-when b { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.dg-when i { font-style: normal; font-size: 12px; color: var(--muted); }

.dg-n {
  flex: none;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}

.dg-list {
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

/* today is the one day that gets colour */
.dg.is-today .dg-date { background: var(--accent); color: #fff; }
.dg.is-today .dg-date i { color: rgba(255, 255, 255, .82); }
.dg.is-today .dg-when b { color: var(--accent); }

.dg.is-past .dg-date { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.dg.is-past .dg-date i,
.dg.is-past .dg-when i { color: var(--danger); }

/* ---------- the selected day, at the top of the agenda ---------- */
.dsel { margin-top: 4px; }

.dsel-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 12px;
}

.dsel-date {
  flex: none;
  width: 50px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 0 8px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  line-height: 1;
}

.dsel-date b { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }

.dsel-date i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}

.dsel-when { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dsel-when b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.dsel-when i { font-style: normal; font-size: 12.5px; color: var(--muted); }

.dsel-add {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform .16s var(--ease);
}

.dsel-add:active { transform: scale(.93); }
.dsel-add svg { width: 19px; height: 19px; }

.dsel-list {
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

.dsel-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 18px 16px;
  border-radius: var(--r-card);
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}

.panel.is-late-sec .panel-head h2 { color: var(--danger); }


/* ---------- the organizer and dated lists, on paper ---------- */
[data-style="notebook"] .bpc {
  border-radius: 12px 14px 12px 15px / 14px 12px 15px 12px;
  background: none;
}

[data-style="notebook"] .bpc-ico {
  border-radius: 10px 12px 10px 13px / 12px 10px 13px 10px;
}

/* the date chip reads as something written in the margin */
[data-style="notebook"] .dg-date,
[data-style="notebook"] .dsel-date {
  border-radius: 11px 13px 11px 14px / 13px 11px 14px 11px;
}

[data-style="notebook"] .bp-tab.is-on { border-bottom-width: 2.5px; }

/* on one continuous sheet a day is separated by its heading and the ruled
   line under it, not by a panel edge */
[data-style="notebook"][data-full="1"] .dg-h,
[data-style="notebook"][data-full="1"] .dsel-h {
  padding-left: 0;
  padding-right: 4px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 6px;
}

[data-style="notebook"][data-full="1"] .dg + .dg { margin-top: 20px; }

/* an untouched page explains what a block is before asking for one */
.pg-blank {
  display: grid;
  gap: 7px;
  justify-items: center;
  text-align: center;
  padding: 34px 22px 30px;
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--muted);
}

.pg-blank b { font-size: 15.5px; font-weight: 650; color: var(--text); }
.pg-blank span { font-size: 13px; line-height: 1.55; max-width: 34ch; }

[data-style="notebook"][data-full="1"] .pg-blank { background: none; padding-left: 0; padding-right: 0; }

/* ══════════ share banner ══════════
   Sits where the update banner used to, between the top bar and the page.
   Stacked on a phone and one line from 430px up: both strings stay whole at a
   readable size either way, since fitting them on one line at 360px would
   mean 9.5px type. */
.banner-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 8px calc(var(--pad) + var(--safe-right)) 0 calc(var(--pad) + var(--safe-left));
}

.share-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
  padding: 7px 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform .18s var(--ease), background-color .18s ease;
}

.share-banner:active { transform: scale(.985); }
.share-banner > * { position: relative; z-index: 1; }

.sb-line { display: flex; align-items: center; gap: 7px; max-width: 100%; }

.sb-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: breathe 1.9s ease-in-out infinite;
}

.sb-title {
  min-width: 0;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .045em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-cta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  white-space: nowrap;
  opacity: .72;
}

.sb-chev { flex: none; width: 12px; height: 12px; stroke-width: 2.8; }

@media (min-width: 430px) {
  .share-banner {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    min-height: 37px;
    padding: 8px 14px;
    border-radius: 999px;
  }

  /* a middot ties the two halves into one sentence on the wider layout */
  .sb-cta::before { content: "·"; margin-right: 8px; opacity: .75; }
}

/* a slow sweep of light, so the strip reads as alive without shouting */
.share-banner::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 45%;
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--accent) 15%, transparent), transparent);
  animation: sbSweep 4.2s ease-in-out infinite;
}

@keyframes sbSweep {
  0%, 18% { transform: translateX(0); }
  72%, 100% { transform: translateX(330%); }
}

/* the share sheet's own footer: the action, then the way out */
.news-foot.is-share {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.news-foot.is-share .btn { width: 100%; }
.news-foot.is-share .link-btn { align-self: center; padding: 8px; }

/* on paper the strip is a taped-on note, not a pill */
[data-style="notebook"] .share-banner {
  border-radius: 11px 13px 11px 14px / 13px 11px 14px 11px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 26%, transparent);
}

@media (min-width: 430px) {
  [data-style="notebook"] .share-banner {
    border-radius: 999px 999px 998px 999px / 999px 998px 999px 999px;
  }
}

/* full notebook: the banner rides the desk above the sheet, so it keeps the
   page's own width instead of running the whole window */
[data-style="notebook"][data-full="1"] .banner-wrap {
  width: var(--nb-page);
  max-width: 100%;
}

/* a row that happens to be a link still reads as a row, not as body-text HTML */
a.row { color: inherit; text-decoration: none; }
a.row .row-title { color: var(--text); }


/* ---------- the tour's own two pieces ---------- */
/* a step that asks you to press something says so under the button */
.sp-hint {
  display: block;
  margin-top: 9px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* a short cheer when the sample task is checked off */
.cheer {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 22px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 12px 30px -12px rgba(10, 14, 30, .5);
  animation: cheerIn .3s var(--ease) both;
}

.cheer.is-out { animation: cheerIn .28s var(--ease) reverse both; }

@keyframes cheerIn {
  from { opacity: 0; transform: translate(-50%, 12px) scale(.94); }
}

[data-style="notebook"] .cheer { border-radius: 999px 999px 998px 999px / 999px 998px 999px 999px; }

/* ---------- the install guide, as a sheet ---------- */
.ins-lede { margin: -2px 0 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ins-seg { margin-bottom: 14px; }

.ins-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.ins-foot .btn { width: 100%; }
.ins-foot .link-btn { align-self: center; padding: 9px; }

/* inside a sheet the drawing has less room than it did full screen */
.sheet .a2-frame { min-height: 168px; padding: 12px 0 8px; }
.sheet .a2-art.is-phone { max-width: 128px; }
.sheet .a2-art { max-width: 240px; }
.sheet .a2-dots { margin-top: 14px; }
