/* GGC Planners. How to be THAT Planner Girly.
   Matches the live PDP brand system (dybl-redesign-css / reset-css).
   Instrument Serif + DM Sans + DM Mono. No cursive script. */

:root {
  /* ------- Palette (exact PDP tokens) ------- */
  --bg:           #fef6ec;   /* warm cream */
  --ink:          #2a1c10;   /* deep brown */
  --ink-2:        #3d2817;   /* cocoa */
  --muted:        #7a6b5d;   /* warm gray-brown */
  --line:         #e8dfcd;   /* warm hairline */
  --card:         #f4ecdf;   /* light beige card */
  --accent:       #e64a8a;   /* hot pink */
  --accent-soft:  #fde2ed;   /* pale pink */
  --hl:           #ffd654;   /* yellow highlighter */
  --surface-dark: #3d2817;   /* dark cocoa for inverted blocks */

  /* Components */
  --radius:    20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --maxw:      1200px;
  --read-max:  68ch;

  /* Type */
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:    "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    "DM Mono", ui-monospace, Menlo, Monaco, monospace;

  /* Motion. Ease-out only. */
  --ease-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --t-fast: 180ms;
  --t-med:  360ms;
  --t-slow: 720ms;
}

/* ============ RESET ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease-quart); }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
::selection { background: var(--hl); color: var(--ink); }

/* ============ READING PROGRESS BAR ============ */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  z-index: 60;
  pointer-events: none;
}
.read-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 80ms linear;
}

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

/* ------- Sidebar ------- */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 28px 20px 36px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 304px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--t-med) var(--ease-expo);
  z-index: 40;
}
.sidebar.open { transform: translateX(0); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  transition: opacity var(--t-fast);
}
.sidebar-logo:hover { opacity: 0.7; }
.sidebar-logo img { height: 44px; width: auto; }

.sidebar-home-link {
  display: block;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background var(--t-fast) var(--ease-quart), color var(--t-fast) var(--ease-quart);
}
.sidebar-home-link:hover {
  background: var(--ink);
  color: var(--bg);
}

.progress-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 26px;
}
.progress-card .label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.progress-card .value {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
}
.progress-bar {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  margin-top: 12px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transform-origin: left center;
  transition: transform var(--t-slow) var(--ease-expo);
}

.nav-module { margin-bottom: 22px; }
.nav-module-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px 10px;
}

.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list li a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.35;
  transition: background var(--t-fast) var(--ease-quart), color var(--t-fast) var(--ease-quart);
}
.nav-list li a:hover { background: var(--card); }
.nav-list li a.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.nav-list li a .num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.nav-list li a.active .num { color: var(--accent); }
.nav-list li a .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-list li a .done {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.nav-list li.completed a .done { opacity: 1; }
.nav-list li.completed a .label { opacity: 0.55; }

.sidebar-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.sidebar-footer button {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  transition: all var(--t-fast) var(--ease-quart);
}
.sidebar-footer button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.sidebar-footer .credit {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 16px;
  text-align: center;
  line-height: 1.5;
}

/* ------- Top bar (mobile) ------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar img { height: 32px; width: auto; }
.topbar .title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.menu-btn {
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: all var(--t-fast) var(--ease-quart);
}
.menu-btn:hover { background: var(--ink); color: var(--bg); }

.backdrop {
  position: fixed; inset: 0;
  background: rgba(42, 28, 16, 0.42);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med) var(--ease-quart);
  z-index: 35;
  backdrop-filter: blur(4px);
}
.backdrop.show { opacity: 1; pointer-events: all; }

/* ------- Main ------- */
.main {
  padding: 26px 22px 120px;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ============ HOME ============ */
.cover-hero {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 56px;
  padding: 56px 28px 52px;
  text-align: center;
}
.cover-hero .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.cover-hero .logo-wrap {
  background: var(--bg);
  padding: 22px 30px;
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}
.cover-hero .logo-wrap img { height: 70px; width: auto; }
.cover-hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 auto 18px;
  color: var(--ink);
  max-width: 16ch;
}
.cover-hero h1 em {
  font-style: italic;
  background-image: linear-gradient(transparent 62%, var(--hl) 62%, var(--hl) 96%, transparent 96%);
  padding: 0 0.06em;
}
.cover-hero p {
  color: var(--muted);
  max-width: 52ch;
  margin: 18px auto 0;
  font-size: 16px;
  line-height: 1.55;
}
.cover-hero .author {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 28px;
}
.cover-hero .author::before { content: "— "; opacity: 0.5; }

.dashboard-intro {
  text-align: center;
  margin-bottom: 36px;
}
.dashboard-intro .kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.dashboard-intro h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 10px 0 14px;
}
.dashboard-intro h2 em {
  font-style: italic;
  color: var(--accent);
}
.dashboard-intro .lead {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto;
}

.overview-progress {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 0 auto 44px;
  max-width: 640px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}
.overview-progress .small {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.overview-progress .big {
  font-family: var(--display);
  font-size: 24px;
  color: var(--ink);
  line-height: 1.05;
  margin-top: 4px;
}
.overview-progress .pct-pill {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border-radius: 999px;
}
.overview-progress .progress-bar {
  grid-column: 1 / -1;
  margin: 0;
  height: 4px;
}

/* Module cards. First spans 2 columns on desktop for hierarchy. */
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.module-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-quart),
              transform var(--t-med) var(--ease-expo),
              box-shadow var(--t-med) var(--ease-expo);
  position: relative;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  text-decoration: none;
}
.module-card .img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--card);
  position: relative;
}
.module-card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-expo);
}
.module-card:hover .img-wrap img { transform: scale(1.03); }

.module-card .body {
  padding: 24px 26px 26px;
}
.module-card .kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.module-card h3 {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 8px 0 10px;
}
.module-card p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.5;
}
.module-card .progress-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.module-card .progress-mini .pct {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.module-card .progress-mini .progress-bar {
  flex: 1;
  height: 3px;
  margin: 0;
}

/* ============ LESSON VIEW ============ */
.lesson-frame {
  position: relative;
}

.lesson-hero {
  position: relative;
  margin: 0 -22px 56px;
  overflow: hidden;
  background: var(--card);
}
.lesson-hero .hero-img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--card);
}
.lesson-hero .hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-expo);
}
.lesson-hero:hover .hero-img { transform: scale(1.02); }
.lesson-hero .hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(42, 28, 16, 0) 28%,
    rgba(42, 28, 16, 0.45) 70%,
    rgba(42, 28, 16, 0.78) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 26px 36px;
  color: var(--bg);
}
.lesson-hero .chapter-mark {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 14px;
}
.lesson-hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.005em;
  margin: 0 0 10px;
  max-width: 18ch;
}
.lesson-hero h1 em { font-style: italic; }
.lesson-hero .tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  color: var(--accent-soft);
  max-width: 32ch;
}

/* Body */
.lesson-body {
  max-width: var(--read-max);
  margin: 0 auto;
  position: relative;
}

/* Section default */
.section {
  margin: 0 auto 56px;
  position: relative;
}
.section .heading {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 22px;
}
.section .heading em {
  font-style: italic;
  background-image: linear-gradient(transparent 62%, var(--hl) 62%, var(--hl) 96%, transparent 96%);
  padding: 0 0.06em;
}
.section .heading::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 18px;
}
.section p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.68;
}
.section p:last-child { margin-bottom: 0; }

/* Lead section: bigger heading, no rule before. */
.section.is-lead .heading {
  font-size: clamp(34px, 5vw, 48px);
}
.section.is-lead .heading::before { display: none; }
.section.is-lead > p:first-of-type {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
}

/* Numbered subsections: PDP numlist pattern. */
.section.is-numbered .sub-stack {
  margin-top: 8px;
}
.section.is-numbered .sub-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.section.is-numbered .sub-stack .sub-item:last-child {
  border-bottom: 1px solid var(--line);
}
.section.is-numbered .sub-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 5px;
}
.section.is-numbered .sub-body strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 6px;
}
.section.is-numbered .sub-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

/* Subsection grid: hairline-separated rows */
.section.is-subgrid .sub-stack {
  margin-top: 6px;
}
.section.is-subgrid .sub-item {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.section.is-subgrid .sub-item:first-child { border-top: none; padding-top: 8px; }
.section.is-subgrid .sub-body strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 8px;
}
.section.is-subgrid .sub-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

/* Bullet list */
.section.is-list ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 14px;
}
.section.is-list li {
  position: relative;
  padding-left: 28px;
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.6;
}
.section.is-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 14px;
  height: 1px;
  background: var(--accent);
}

/* Tinted sections for rhythm */
.section.is-blush {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 38px 32px 36px;
  margin-left: -16px;
  margin-right: -16px;
}
.section.is-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 38px 32px 36px;
  margin-left: -16px;
  margin-right: -16px;
}
.section.is-dark {
  background: var(--surface-dark);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 42px 32px 40px;
  margin-left: -16px;
  margin-right: -16px;
}
.section.is-dark .heading { color: var(--bg); }
.section.is-dark .heading::before { background: var(--hl); }
.section.is-dark .heading em {
  /* On dark backgrounds, skip the highlighter and use yellow italic text instead. */
  background: none;
  padding: 0;
  color: var(--hl);
}
.section.is-dark p { color: rgba(254, 246, 236, 0.78); }
.section.is-dark .sub-body strong { color: var(--bg); }
.section.is-dark .sub-body p { color: rgba(254, 246, 236, 0.68); }
.section.is-dark .sub-num { color: var(--hl); }
.section.is-dark .sub-item { border-color: rgba(254, 246, 236, 0.15); }

/* Section divider */
.section-divider {
  text-align: center;
  margin: 0 auto 56px;
}
.section-divider::after {
  content: "";
  display: inline-block;
  width: 56px;
  height: 1px;
  background: var(--line);
  vertical-align: middle;
}

/* ---- Action step ---- */
.action-step {
  position: relative;
  margin: 64px auto 32px;
  padding: 38px 32px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  max-width: var(--read-max);
}
.action-step .label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hl);
  margin-bottom: 14px;
}
.action-step h3 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 14px;
}
.action-step h3 em {
  font-style: italic;
  color: var(--hl);
  background: none;
  padding: 0;
}
.action-step p {
  margin: 0;
  color: rgba(254, 246, 236, 0.84);
  font-size: 16.5px;
  line-height: 1.65;
}

/* ---- Notes ---- */
.notes {
  margin: 48px auto 0;
  max-width: var(--read-max);
  padding: 32px;
  background: var(--card);
  border-radius: var(--radius);
}
.notes .label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.notes h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 16px;
}
.notes textarea {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  transition: border-color var(--t-fast) var(--ease-quart);
}
.notes textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.notes .saved {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 10px;
  min-height: 16px;
}

/* ---- Lesson controls ---- */
.lesson-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 48px auto 0;
  padding-top: 32px;
  max-width: var(--read-max);
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-quart),
              background var(--t-fast) var(--ease-quart),
              color var(--t-fast) var(--ease-quart);
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-primary.completed {
  background: var(--accent);
  border-color: var(--accent);
}
.lesson-controls .spacer { flex: 1; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-quart),
              transform var(--t-med) var(--ease-expo);
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ TOOL BLOCK (interactive widgets) ============ */
.tool-block {
  margin: 56px auto 32px;
  max-width: var(--read-max);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tool-block-head {
  padding: 28px 28px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tool-block-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.tool-block-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 3.5vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 8px;
}
.tool-block-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.tool-block-body {
  padding: 28px;
}
.tool-block-saved {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* Generic tool field */
.tool-field {
  display: block;
  margin-bottom: 18px;
}
.tool-field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.tool-field-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--t-fast);
}
.tool-field-input:focus {
  outline: none;
  border-color: var(--accent);
}
textarea.tool-field-input { min-height: 80px; }

/* ===== LIFE AUDIT ===== */
.audit-block { margin-bottom: 32px; }
.audit-block:last-child { margin-bottom: 0; }
.audit-block-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.audit-block-help {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}
.audit-rows {
  display: grid;
  gap: 22px;
}
.audit-row {
  display: grid;
  gap: 8px;
}
.audit-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.audit-row-label {
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.audit-row-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.audit-slider-track {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.audit-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  cursor: pointer;
  position: absolute; inset: 0;
}
.audit-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(42,28,16,0.18);
}
.audit-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: grab;
}
.audit-row-note {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  transition: border-color var(--t-fast);
}
.audit-row-note:focus {
  outline: none;
  border-color: var(--accent);
}

.audit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.audit-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--t-fast);
}
.audit-chip:hover { border-color: var(--ink); }
.audit-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.audit-priority {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.audit-priority:first-child { border-top: none; padding-top: 8px; }
.audit-priority-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 14px;
}
.audit-priority-body {
  display: grid;
  gap: 8px;
}
.audit-priority-area {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 6px 0;
  border-radius: 0;
}
.audit-priority-area:focus { outline: none; border-bottom-color: var(--accent); }
.audit-priority-why {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  resize: vertical;
}
.audit-priority-why:focus { outline: none; border-color: var(--accent); }

/* ===== SMARTH BUILDER ===== */
.smarth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.smarth-tab {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
}
.smarth-tab:hover { border-color: var(--ink); }
.smarth-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.smarth-fields { display: grid; gap: 18px; }
.smarth-field {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
}
.smarth-field-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}
.smarth-field-body { min-width: 0; }
.smarth-field-label {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 2px;
}
.smarth-field-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.smarth-field-input {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  resize: vertical;
}
.smarth-field-input:focus { outline: none; border-color: var(--accent); }

.smarth-preview-wrap {
  margin-top: 28px;
  padding: 22px 24px;
  background: var(--ink);
  border-radius: 14px;
}
.smarth-preview-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hl);
  margin-bottom: 10px;
}
.smarth-preview {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.5;
  color: var(--bg);
}

/* ===== HABIT TRACKER ===== */
.habit-card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.habit-head { margin-bottom: 14px; }
.habit-name {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  padding: 6px 0;
  letter-spacing: -0.005em;
}
.habit-name:focus { outline: none; border-bottom-color: var(--accent); }
.habit-name::placeholder { color: var(--muted); }

.habit-stats {
  display: flex;
  gap: 18px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}
.habit-stat { min-width: 0; }
.habit-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.habit-stat-value {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
  margin-top: 4px;
}

.habit-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.habit-dot {
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.habit-dot:hover { background: var(--accent-soft); }
.habit-dot.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.habit-rule {
  margin-top: 4px;
  padding: 14px 18px;
  background: var(--hl);
  color: var(--ink);
  border-radius: 12px;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  text-align: center;
}

/* ===== SUNDAY CHECKLIST ===== */
.checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.check-row {
  display: grid;
  grid-template-columns: 36px 24px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all var(--t-fast);
}
.check-row:hover { border-color: var(--ink); }
.check-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.check-box {
  width: 22px; height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.check-row.is-done .check-box {
  background: var(--ink);
}
.check-row.is-done .check-box::after {
  content: "✓";
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.check-text { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.check-row.is-done .check-text { opacity: 0.55; text-decoration: line-through; }

.checklist-inputs {
  display: grid;
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ===== TODAY'S PLAN ===== */
.today-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.today-box {
  background: var(--card);
  border-radius: 14px;
  padding: 18px 20px;
}
.today-box--nn {
  background: var(--ink);
  color: var(--bg);
}
.today-box--nn .today-box-label { color: var(--hl); }
.today-box--nn .today-box-help { color: rgba(254,246,236,0.72); }
.today-box--nn .today-input {
  background: rgba(254,246,236,0.08);
  border-color: rgba(254,246,236,0.2);
  color: var(--bg);
}
.today-box-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.today-box-help {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.today-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
}
.today-input:last-child { margin-bottom: 0; }
.today-input:focus { outline: none; border-color: var(--accent); }
.today-input--theme {
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  text-align: center;
}
.today-input--nn {
  font-family: var(--display);
  font-size: 18px;
}

@media (min-width: 700px) {
  .today-grid {
    grid-template-columns: 1fr 1fr;
  }
  .today-box--box1 { grid-column: 1 / 2; grid-row: 1 / 3; }
  .today-box--date { grid-column: 2; grid-row: 1; }
  .today-box--box2 { grid-column: 2; grid-row: 2; }
  .today-box--nn { grid-column: 1 / -1; }
}

/* ===== AFFIRMATIONS ===== */
.aff-counter {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 18px;
}
.aff-counter strong {
  color: var(--accent);
  font-weight: 500;
}
.aff-list {
  display: grid;
  gap: 10px;
}
.aff-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all var(--t-fast);
}
.aff-row.is-picked {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.aff-pick {
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.aff-pick:hover { background: var(--ink); color: var(--bg); }
.aff-row.is-picked .aff-pick {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.aff-text {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.aff-weekly {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.aff-weekly:hover { border-color: var(--ink); color: var(--ink); }
.aff-weekly.is-weekly {
  background: var(--hl);
  border-color: var(--hl);
  color: var(--ink);
}

@media (max-width: 600px) {
  .aff-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .aff-pick, .aff-weekly { justify-self: start; }
}

/* ============ SCROLL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-expo),
              transform 800ms var(--ease-expo);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease-expo),
              transform 700ms var(--ease-expo);
}
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 70ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 140ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 210ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 280ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 350ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 420ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(n+8) { transition-delay: 490ms; opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============ DESKTOP ============ */
@media (min-width: 900px) {
  .app { grid-template-columns: 304px 1fr; }
  .sidebar {
    position: sticky;
    inset: auto;
    height: 100vh;
    top: 0;
    transform: none;
  }
  .topbar { display: none; }
  .main {
    padding: 56px 56px 140px;
    max-width: 1080px;
  }

  .lesson-hero { margin: 0 -56px 64px; }
  .lesson-hero .hero-overlay { padding: 48px 56px 52px; }

  .module-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  .module-grid > .module-card:first-child {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
  .module-grid > .module-card:first-child .img-wrap {
    aspect-ratio: auto;
    height: 100%;
  }
  .module-grid > .module-card:first-child .body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 44px;
  }
  .module-grid > .module-card:first-child h3 {
    font-size: 36px;
  }

  .section.is-blush,
  .section.is-card,
  .section.is-dark {
    margin-left: -32px;
    margin-right: -32px;
    padding: 48px 44px;
  }
}

/* Print */
@media print {
  .sidebar, .topbar, .lesson-controls, .notes, .read-progress { display: none; }
  .main { padding: 0; }
  .lesson-hero { margin: 0 0 32px; }
}
