  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

  :root {
    /* Moleskine-inspired paper palette. Pushed firmly toward warm ivory
       — the old palette was a cool pinkish cream that read as "off-white";
       this is the unmistakable warm yellow-ivory of a Classic Notebook
       page. Anchored by observation of physical Moleskine ivory paper. */
    --paper: #ece2c0;
    --paper-shade: #ddd1a8;
    --paper-edge: #c9b98c;
    /* Translucent white over paper — card surfaces that need to feel
       lighter than the paper underneath without being opaque. Used by
       cleanup cards, loop cards, etc. */
    --paper-cream: rgba(255, 255, 255, 0.4);
    --ink: #2a2620;
    --ink-soft: #5c5448;
    --ink-faint: #8a8170;
    --rule: #c0ad7e;
    /* Navy accent family — warmed slightly to harmonize with the warm
       paper. accent-dark is the deepest tone (week card gradient header);
       accent is the primary accent; accent-soft is the lighter highlight
       used in gradients and active states. */
    --accent-dark: #1e2f47;
    --accent: #234668;
    --accent-soft: #2f568a;
    /* Gold family — used for emphasis and CTAs. gold-soft is the
       lighter highlight in gold gradient buttons. */
    --gold: #b8893a;
    --gold-soft: #c89944;
    /* Destructive red — earthy oxblood that harmonizes with warm paper.
       Used for delete confirms, destructive button warnings, etc. */
    --red: #8b3a2e;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Inter', -apple-system, sans-serif;
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
  }

  html, body {
    height: 100%;
    background: var(--paper);
    font-family: var(--serif);
    color: var(--ink);
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    height: 100dvh;
    padding-top: var(--safe-top);
  }

  /* Paper texture — Moleskine-style.
     Three stacked layers create the "real notebook page" feel:
       1. body::before — soft warm wash + subtle vignette so the page
          doesn't read as flat.
       2. body::after — fibrous noise grain from a real raster PNG.
          Earlier builds used inline SVG feTurbulence which iOS Safari
          renders inconsistently (sometimes invisibly). PNG is reliable.
       3. The base --paper color — warm ivory.
     All texture sits at z-index 1, content at z-index 2. */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      /* Warm highlight upper-left */
      radial-gradient(ellipse at 18% 12%, rgba(255, 248, 225, 0.45) 0%, transparent 55%),
      /* Faint shadow lower-right */
      radial-gradient(ellipse at 85% 88%, rgba(120, 90, 50, 0.06) 0%, transparent 55%),
      /* Subtle vignette around all edges — like the gutter of a bound page */
      radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(80, 60, 30, 0.08) 100%);
    pointer-events: none;
    z-index: 1;
  }
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url('paper-texture.png') repeat;
    /* The texture PNG is already alpha-encoded with dark warm pixels.
       Multiply blend so it darkens the paper subtly without washing
       out the warm ivory tone. */
    mix-blend-mode: multiply;
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
  }

  .app {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ─── HEADER ─────────────────── */
  /* Dark twilight band with the orb brand mark. */
  /* New-build update banner */
  .update-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: calc(var(--safe-top, 0px) + 9px) 16px 9px;
    background: linear-gradient(180deg, #1e2742, #161d36);
    border-bottom: 1px solid rgba(232,168,124,0.3);
    color: #f4ecd8;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 13px;
    cursor: pointer;
    transform: translateY(-100%);
    transition: transform 0.45s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 6px 20px -8px rgba(0,0,0,0.6);
  }
  .update-banner.show { display: flex; transform: translateY(0); }
  .update-banner .ub-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f4ecd8, #e8a87c 70%);
    box-shadow: 0 0 8px 1px rgba(232,168,124,0.7);
    flex-shrink: 0;
    animation: ubpulse 2s ease-in-out infinite;
  }
  @keyframes ubpulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
  .update-banner .ub-text { font-weight: 400; }
  .update-banner .ub-action { font-weight: 600; color: #e8a87c; letter-spacing: 0.02em; }
  @media (prefers-reduced-motion: reduce) { .update-banner .ub-dot { animation: none; } }

  /* Emotional day-closed completion state */
  .close-complete {
    position: fixed; inset: 0; z-index: 180;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse 120% 90% at 50% 42%, rgba(45,39,72,0.97), rgba(10,14,26,0.99));
    opacity: 0; pointer-events: none;
    transition: opacity 0.7s ease;
  }
  .close-complete.show { opacity: 1; pointer-events: auto; }
  .cc-inner {
    text-align: center; padding: 0 32px;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.8s cubic-bezier(.2,.7,.2,1);
  }
  .close-complete.show .cc-inner { transform: translateY(0) scale(1); }
  .cc-mark {
    width: 54px; height: 54px; margin: 0 auto 18px;
    border-radius: 50%; border: 1px solid rgba(232,168,124,0.5);
    display: flex; align-items: center; justify-content: center;
    color: #e8a87c; font-size: 22px;
    box-shadow: 0 0 34px rgba(232,168,124,0.3);
  }
  .close-complete.show .cc-mark {
    animation: ccMarkPulse 0.9s cubic-bezier(.2,.7,.2,1) both;
  }
  @keyframes ccMarkPulse {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  .cc-title {
    font-family: var(--serif); font-style: italic; font-size: 28px;
    color: #f4ecd8; margin-bottom: 6px;
  }
  .cc-time {
    font-family: 'IBM Plex Mono', monospace; font-size: 12px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: #6b7390; margin-bottom: 20px;
  }
  .cc-lines { display: flex; flex-direction: column; gap: 7px; margin-bottom: 22px; }
  .cc-lines:empty { display: none; }
  .cc-line {
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 13px;
    color: #a8b0c8;
  }
  .cc-line b { color: #e8a87c; font-weight: 500; }
  .cc-foot {
    font-family: var(--serif); font-style: italic; font-size: 15px;
    color: rgba(168,176,200,0.8);
  }
  @media (prefers-reduced-motion: reduce) { .cc-inner { transition: none; } }

  /* Visible accumulation strip */
  .accrue {
    margin-bottom: 22px; padding: 18px 18px 16px;
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(35,70,104,0.06), rgba(255,255,255,0.4));
  }
  .accrue-row { display: flex; justify-content: space-around; gap: 8px; }
  .accrue-stat { text-align: center; flex: 1; }
  .accrue-num {
    font-family: var(--serif); font-size: 26px; font-weight: 500;
    color: var(--accent); line-height: 1;
  }
  .accrue-lbl {
    font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--ink-faint); margin-top: 5px;
  }
  .accrue-foot {
    text-align: center; margin-top: 14px; padding-top: 12px;
    border-top: 1px dashed rgba(184,137,58,0.25);
    font-family: var(--serif); font-style: italic; font-size: 13px;
    color: var(--ink-soft);
  }

  .header {
    padding: 18px 22px 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
    background:
      radial-gradient(ellipse 120% 140% at 18% -40%, #2d2748 0%, transparent 60%),
      linear-gradient(180deg, #161d36 0%, #0a0e1a 100%);
    border-bottom: 1px solid rgba(232,168,124,0.16);
  }

  .header-left { display: flex; align-items: flex-end; gap: 11px; }
  .header-text { display: flex; flex-direction: column; gap: 2px; }

  /* the orb — the evening star, matches app icon */
  .header-orb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f4ecd8, #e8a87c 70%);
    box-shadow: 0 0 14px 2px rgba(232,168,124,0.6);
    animation: vesper-pulse 4s ease-in-out infinite;
    flex-shrink: 0;
    margin-bottom: 6px;
  }
  @keyframes vesper-pulse {
    0%,100% { box-shadow: 0 0 14px 2px rgba(232,168,124,0.5); }
    50%     { box-shadow: 0 0 22px 5px rgba(232,168,124,0.75); }
  }
  @media (prefers-reduced-motion: reduce) {
    .header-orb { animation: none; }
  }

  .header-date {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: rgba(168,176,200,0.85);
    text-transform: uppercase;
  }

  .header-title {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    color: #f4ecd8;
    letter-spacing: -0.02em;
    font-style: italic;
  }

  .header-btn {
    background: none;
    border: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(244,236,216,0.75);
    transition: background 0.15s;
  }
  .header-btn:active { background: rgba(255,255,255,0.08); }
  .header-btn svg { width: 18px; height: 18px; }

  .streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(232,168,124,0.2);
    border-radius: 18px;
    padding: 6px 12px 6px 9px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: #f4ecd8;
    margin-right: 4px;
    letter-spacing: 0.02em;
    font-feature-settings: "lnum";
  }
  .streak-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .streak-badge.muted {
    background: rgba(255,255,255,0.05);
    border-color: rgba(168,176,200,0.15);
    color: rgba(168,176,200,0.7);
  }
  .streak-badge.muted svg path { fill: rgba(168,176,200,0.6); }

  /* ─── SCOPE TABS ─────────────── */
  .scope-tabs {
    display: flex;
    margin: 0 22px 8px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 30px;
    padding: 3px;
    flex-shrink: 0;
  }

  .scope-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--ink-faint);
    cursor: pointer;
    border-radius: 24px;
    transition: all 0.2s;
  }

  .scope-tab.active {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }

  /* ─── BOTTOM NAV ─────────────── */
  .bottom-nav {
    display: flex;
    border-top: 1px solid var(--rule);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    background: var(--paper);
    flex-shrink: 0;
    position: relative;
    z-index: 5;
  }

  .nav-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.15s;
  }

  .nav-tab.active { color: var(--accent); }
  .nav-tab svg { width: 22px; height: 22px; }

  /* ─── VIEWS CONTAINER ────────── */
  .views {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
  }

  .view {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
  }

  .view.active { display: flex; }

  /* Scroll containers */
  .scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scroll::-webkit-scrollbar { display: none; }

  /* ─── DAYS LIST ──────────────── */
  .search-section { padding: 4px 22px 12px; }

  .search-input {
    width: 100%;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 20px;
    padding: 9px 16px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
  }
  .search-input:focus { border-color: var(--accent); }
  .search-input::placeholder { color: var(--ink-faint); }

  .days-list { padding: 0 22px 100px; }

  /* ─── WEEK IN REVIEW CARD ────── */
  .week-card {
    margin: 6px 20px 18px;
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 50%, var(--accent-soft) 100%);
    border-radius: 16px;
    color: var(--paper);
    box-shadow: 0 6px 24px rgba(25, 38, 60, 0.18), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    position: relative;
    overflow: hidden;
  }
  .week-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(184, 137, 58, 0.4) 50%, transparent 100%);
  }
  .week-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
  }
  .week-card-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: var(--gold);
    text-transform: uppercase;
  }
  .week-card-toggle {
    background: none;
    border: none;
    color: rgba(236, 226, 192, 0.5);
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    transition: transform 0.2s, color 0.15s;
    border-radius: 6px;
  }
  .week-card-toggle:active { color: rgba(236, 226, 192, 0.9); }
  .week-card-toggle svg { width: 16px; height: 16px; display: block; }
  .week-card.collapsed .week-card-toggle { transform: rotate(-90deg); }
  .week-card.collapsed .week-card-body { display: none; }

  .week-card-period {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: rgba(236, 226, 192, 0.78);
    margin-bottom: 14px;
    letter-spacing: 0.005em;
  }
  .week-card-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .week-generate-btn {
    flex: 1;
    background: var(--paper);
    color: var(--ink);
    border: none;
    border-radius: 12px;
    padding: 11px 14px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
  .week-generate-btn:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
  .week-generate-btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .week-custom-btn {
    background: rgba(236, 226, 192, 0.08);
    color: rgba(236, 226, 192, 0.78);
    border: 1px solid rgba(236, 226, 192, 0.16);
    border-radius: 12px;
    padding: 11px 16px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .week-custom-btn:active { background: rgba(236, 226, 192, 0.18); }

  .week-custom-panel {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: rgba(236, 226, 192, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(236, 226, 192, 0.08);
  }
  .week-custom-panel.show { display: block; }
  .week-custom-panel input[type="date"] {
    background: rgba(236, 226, 192, 0.94);
    color: var(--ink);
    border: none;
  }
  .week-custom-panel .filter-to {
    color: rgba(236, 226, 192, 0.5);
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
  }
  .week-apply-custom {
    background: var(--paper);
    color: var(--ink);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
  }

  .week-result {
    margin-top: 16px;
    padding: 18px 20px 16px;
    background: rgba(236, 226, 192, 0.97);
    border-radius: 12px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) inset;
  }
  .week-result p { margin: 0 0 10px 0; }
  .week-result p:last-child { margin-bottom: 0; }
  .week-result strong {
    display: block;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-transform: uppercase;
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(35, 70, 104, 0.15);
  }
  .week-result strong:first-child { margin-top: 0; }
  .week-result ul {
    list-style: none;
    padding: 0;
    margin: 0 0 6px 0;
  }
  .week-result li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.55;
  }
  .week-result li:last-child { margin-bottom: 0; }
  .week-result li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 8px;
    height: 1px;
    background: var(--accent);
    opacity: 0.55;
  }

  .week-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    align-items: center;
    padding: 0 4px;
  }
  .week-copy-btn {
    background: var(--paper);
    color: var(--ink);
    border: none;
    border-radius: 10px;
    padding: 9px 20px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s;
  }
  .week-copy-btn:active { transform: scale(0.96); }
  .week-result-meta {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: rgba(236, 226, 192, 0.62);
    margin-left: auto;
    letter-spacing: 0.01em;
  }

  /* ─── OPEN LOOPS ────────────── */
  .loop-card {
    padding: 14px 16px 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    margin-bottom: 10px;
    border-left: 3px solid var(--ink-faint);
    transition: border-color 0.15s, background 0.15s;
  }
  .loop-card.urgency-3 {
    border-left-color: var(--accent);
    background: rgba(35, 70, 104, 0.05);
  }
  .loop-card.urgency-2 {
    border-left-color: var(--gold);
    background: rgba(184, 137, 58, 0.04);
  }
  .loop-item {
    font-family: var(--serif);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: 0.005em;
  }
  .loop-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .loop-meta-pill {
    background: var(--paper-shade);
    padding: 3px 9px;
    border-radius: 8px;
    letter-spacing: 0.16em;
  }
  .loop-meta-pill.urgent {
    background: rgba(35, 70, 104, 0.13);
    color: var(--accent);
  }
  .loop-jump-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    transition: opacity 0.15s;
  }
  .loop-jump-btn:active { opacity: 0.6; }
  .loop-action {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
    padding-top: 8px;
    border-top: 1px dashed var(--rule);
  }
  .loop-action::before {
    content: '→ ';
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
    margin-right: 2px;
  }

  .loop-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--rule);
  }
  .loop-resolve-btn {
    flex: 1;
    background: rgba(184, 137, 58, 0.08);
    color: var(--gold);
    border: 1px solid rgba(184, 137, 58, 0.3);
    border-radius: 10px;
    padding: 7px 12px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
  }
  .loop-resolve-btn:active {
    background: rgba(184, 137, 58, 0.18);
    transform: scale(0.97);
  }
  .loop-dismiss-btn {
    background: none;
    color: var(--ink-faint);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 7px 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .loop-dismiss-btn:active {
    background: var(--paper-shade);
    transform: scale(0.97);
  }
  .loop-accept-btn {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(35, 70, 104, 0.18);
  }
  .loop-accept-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 3px rgba(35, 70, 104, 0.18);
  }
  .loop-reject-btn {
    background: none;
    color: var(--ink-faint);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .loop-reject-btn:active {
    background: var(--paper-shade);
    transform: scale(0.97);
  }
  .loops-empty {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-faint);
    text-align: center;
    padding: 30px 20px;
    line-height: 1.5;
  }
  .loops-meta {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
  }

  /* Resolve sheet */
  .resolve-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 38, 32, 0.5);
    backdrop-filter: blur(6px);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .resolve-sheet-overlay.show { opacity: 1; pointer-events: auto; }
  .resolve-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    z-index: 51;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 14px 20px;
    padding-bottom: max(20px, var(--safe-bottom));
    max-height: 80vh;
    overflow-y: auto;
  }
  .resolve-sheet.show { transform: translateY(0); }
  .resolve-sheet-handle {
    width: 38px;
    height: 4px;
    background: var(--paper-edge);
    border-radius: 2px;
    margin: 0 auto 14px;
  }
  .resolve-sheet-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 4px;
  }
  .resolve-sheet-item {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(184, 137, 58, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    line-height: 1.5;
  }
  .resolve-sheet-question {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 14px;
    line-height: 1.5;
  }
  .resolve-sheet-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    outline: none;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    margin-bottom: 12px;
  }
  .resolve-sheet-textarea:focus { border-color: var(--accent); }
  .resolve-sheet-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
  }
  .resolve-sheet-confirm {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(35, 70, 104, 0.18);
  }
  .resolve-sheet-confirm:active { transform: scale(0.98); }
  .resolve-sheet-skip {
    background: none;
    color: var(--ink-faint);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 18px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    cursor: pointer;
  }
  .resolve-sheet-skip:active { background: var(--paper-shade); }

  /* Picker sheet option rows — used for single-select choices like
     "which thread is the keeper?" Tapping picks and closes. */
  .picker-option {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 13px 16px;
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.08s;
    -webkit-tap-highlight-color: transparent;
  }
  .picker-option:active {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--accent);
    transform: scale(0.99);
  }

  /* Tag-on-note thread list */
  .tag-thread-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    border: 1px solid transparent;
  }
  .tag-thread-row:active { background: var(--paper-shade); }
  .tag-thread-row.selected {
    background: rgba(35, 70, 104, 0.08);
    border-color: rgba(35, 70, 104, 0.25);
  }
  .tag-thread-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--paper-edge);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.12s;
  }
  .tag-thread-row.selected .tag-thread-check {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
  }
  .tag-thread-check svg {
    width: 12px; height: 12px;
    opacity: 0;
    transition: opacity 0.12s;
  }
  .tag-thread-row.selected .tag-thread-check svg { opacity: 1; }
  .tag-thread-name {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink);
    flex: 1;
  }
  .tag-thread-create {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(184, 137, 58, 0.06);
    border: 1px dashed rgba(184, 137, 58, 0.3);
    margin-bottom: 6px;
  }
  .tag-thread-create:active { background: rgba(184, 137, 58, 0.12); }
  .tag-thread-create-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--gold);
  }
  .tag-thread-empty {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-faint);
    text-align: center;
    padding: 24px 12px;
  }

  /* ─── CLEANUP DUPLICATES VIEW ────────── */
  .cleanup-cluster {
    background: var(--paper-cream);
    border: 1px solid var(--paper-edge);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
  }
  .cleanup-cluster-header {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--rule);
  }
  .cleanup-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    align-items: flex-start;
    border-bottom: 1px dashed var(--rule);
  }
  .cleanup-item:last-child { border-bottom: none; }
  .cleanup-item-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
  }
  .cleanup-item-body {
    flex: 1;
    min-width: 0;
  }
  .cleanup-item-title {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink);
    line-height: 1.45;
    margin-bottom: 4px;
  }
  .cleanup-item-detail {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 4px;
  }
  .cleanup-item-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    text-transform: uppercase;
  }
  .cleanup-keep-badge {
    background: rgba(35, 70, 104, 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 6px;
  }
  .cleanup-edited-badge {
    background: rgba(184, 137, 58, 0.18);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 6px;
  }

  /* ─── LOOP FORM FIELDS (manual + edit + resolve date) ─── */
  .loop-form-label {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-top: 12px;
  }
  .loop-form-label:first-child { margin-top: 0; }
  .loop-form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
  }
  .loop-form-input:focus { border-color: var(--accent); }
  .loop-form-textarea {
    min-height: 70px;
    resize: vertical;
    font-family: var(--serif);
  }
  .loop-form-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }
  .loop-form-row .loop-form-input { flex: 1; }
  .loop-urgency-row {
    display: flex;
    gap: 6px;
    margin-top: 5px;
  }
  .loop-urgency-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 9px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
  }
  .loop-urgency-pill.selected {
    color: var(--paper);
    border-color: transparent;
  }
  .loop-urgency-pill.selected[data-urgency="3"] { background: var(--accent); }
  .loop-urgency-pill.selected[data-urgency="2"] { background: var(--gold); }
  .loop-urgency-pill.selected[data-urgency="1"] { background: var(--ink-soft); }
  .loop-urgency-pill:active { transform: scale(0.97); }

  .loop-edit-btn {
    background: none;
    color: var(--ink-faint);
    border: 1px solid var(--paper-edge);
    border-radius: 8px;
    padding: 4px 10px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
  }
  .loop-edit-btn:active { background: var(--paper-shade); }

  .resolved-card {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    margin-bottom: 6px;
    border-left: 2px solid var(--ink-faint);
    opacity: 0.85;
  }
  .resolved-card .loop-item {
    font-size: 13.5px;
    color: var(--ink-soft);
    text-decoration: line-through;
    text-decoration-color: var(--ink-faint);
    text-decoration-thickness: 1px;
    margin-bottom: 4px;
  }
  .resolved-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    text-transform: uppercase;
  }
  .resolved-card-restore {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
  }

  /* ─── WHERE THINGS STAND ───── */
  .stand-result {
    margin-top: 16px;
    padding: 16px 18px;
    background: rgba(184, 137, 58, 0.05);
    border: 1px solid rgba(184, 137, 58, 0.22);
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(184, 137, 58, 0.04) inset;
  }
  .stand-result-label {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .stand-result-text {
    font-family: var(--serif);
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--ink);
    letter-spacing: 0.005em;
  }
  .stand-result-meta {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11.5px;
    color: var(--ink-faint);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(184, 137, 58, 0.25);
  }

  /* ─── ON THIS DAY ────────────── */
  .day-card {
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
  }
  .day-card:active { opacity: 0.6; }
  .day-card:last-child { border-bottom: none; }

  .day-card-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
  }

  .day-card-num {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
    font-feature-settings: "lnum";
  }

  .day-card-month {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
  }

  .day-card-day {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-soft);
    margin-left: auto;
  }

  .day-card-preview {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Trip chip — small label shown on day cards and day detail headers
     when the date falls inside a defined trip. Subtle by default;
     uses the trip's color or accent navy if not set. */
  .trip-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(35, 70, 104, 0.08);
    border: 1px solid rgba(35, 70, 104, 0.18);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--accent);
    line-height: 1.4;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .trip-chip-icon {
    font-size: 9px;
    opacity: 0.7;
  }
  /* Day card variant — sits in the header row */
  .day-card-trip {
    margin-left: 6px;
  }
  /* Day detail variant — sits below the date header */
  .day-detail-trip {
    margin-top: 8px;
    display: inline-flex;
  }

  .day-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ink-faint);
  }

  .meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); }
  .composed-mark { color: var(--gold); font-weight: 500; }
  .open-mark { color: var(--accent-soft); font-weight: 500; }

  .day-card-today {
    margin: 0 -22px;
    padding: 16px 22px;
    background: linear-gradient(165deg, rgba(35, 70, 104, 0.05), rgba(255, 255, 255, 0.35));
    border-bottom-color: rgba(35, 70, 104, 0.15);
  }
  .day-card-today .day-card-num { color: var(--accent-dark); }

  .day-card-open::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  }

  /* Today strip — daily ritual anchor at top of logbook */
  .today-strip {
    margin: 0 22px 18px;
    animation: todayStripIn 0.45s cubic-bezier(.2,.7,.2,1) both;
  }
  @keyframes todayStripIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .today-strip-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--paper-edge);
    background: linear-gradient(155deg, rgba(255,255,255,0.55), rgba(35,70,104,0.04));
    box-shadow: 0 4px 18px rgba(42,38,32,0.06);
  }
  .today-strip-open {
    border-color: rgba(184, 137, 58, 0.35);
    background: linear-gradient(155deg, rgba(255,255,255,0.6), rgba(184,137,58,0.08));
  }
  .today-strip-main { flex: 1; min-width: 0; }
  .today-strip-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
  }
  .today-strip-open .today-strip-label { color: var(--gold); }
  .today-strip-preview {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .today-strip-quiet .today-strip-preview {
    font-style: italic;
    font-size: 13px;
    color: var(--ink-faint);
    -webkit-line-clamp: 3;
  }
  .today-strip-cta {
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--paper);
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    box-shadow: 0 3px 10px rgba(35, 70, 104, 0.28);
    cursor: pointer;
  }
  .today-strip-cta:active { transform: scale(0.97); }
  .today-strip-cta-quiet {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(35, 70, 104, 0.25);
    box-shadow: none;
  }
  @media (prefers-reduced-motion: reduce) {
    .today-strip { animation: none; }
  }

  /* ─── DATE RANGE FILTER ────── */
  .filter-bar {
    padding: 0 22px 8px;
    flex-shrink: 0;
  }

  .filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 0;
  }
  .filter-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
  .filter-toggle.open svg { transform: rotate(180deg); }
  .filter-toggle.has-filter { color: var(--accent); }

  .filter-dates {
    display: none;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 0 4px;
  }
  .filter-dates.show { display: flex; }

  .filter-date-input {
    flex: 1;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 8px 10px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
  }
  .filter-date-input:focus { border-color: var(--accent); }

  .filter-to {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ink-faint);
    flex-shrink: 0;
  }

  .filter-clear {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
  }

  /* ─── CALENDAR VIEW ──────────── */
  .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px 8px;
    flex-shrink: 0;
  }

  .cal-month-label {
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    color: var(--ink);
    letter-spacing: -0.01em;
  }

  .cal-nav {
    display: flex;
    gap: 4px;
  }

  .cal-nav-btn {
    background: none;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-soft);
    transition: background 0.15s;
  }
  .cal-nav-btn:active { background: var(--paper-shade); }
  .cal-nav-btn svg { width: 18px; height: 18px; }

  .cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 18px 6px;
    text-align: center;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    text-transform: uppercase;
    flex-shrink: 0;
  }

  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 18px;
    gap: 2px;
  }

  .cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s;
    position: relative;
  }
  .cal-cell:active { background: var(--paper-shade); }
  .cal-cell.empty { cursor: default; }
  .cal-cell.empty:active { background: transparent; }
  .cal-cell.today {
    background: rgba(35, 70, 104, 0.08);
  }

  .cal-cell-num {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--ink);
    font-feature-settings: "lnum";
    line-height: 1;
  }
  .cal-cell.empty .cal-cell-num { visibility: hidden; }
  .cal-cell.other-month .cal-cell-num { color: var(--ink-faint); opacity: 0.4; }
  .cal-cell.today .cal-cell-num { color: var(--accent); font-weight: 600; }

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

  .cal-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
  }
  .cal-dot.composed {
    background: var(--gold);
    opacity: 0.8;
  }
  /* Notes captured but no composed entry yet — flagged red so the
     user can see at a glance which days still need composing.
     Same size as composed dot (5px) so the calendar stays balanced;
     attention comes from the bright signal-red color and soft glow,
     not from being physically larger. */
  .cal-dot.notes-only {
    background: #d63d2e;
    opacity: 1;
    box-shadow: 0 0 4px rgba(214, 61, 46, 0.5);
  }

  .cal-summary {
    margin: 16px 22px 0;
    padding: 14px 16px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 14px;
  }

  .cal-summary-month {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .cal-summary-stat {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.6;
  }

  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px;
    gap: 14px;
    text-align: center;
    min-height: 300px;
  }

  .empty-mark {
    font-family: var(--serif);
    font-size: 44px;
    font-style: italic;
    color: var(--accent);
    opacity: 0.6;
  }

  .empty-state p {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    font-style: italic;
    max-width: 280px;
  }

  .empty-cta {
    margin-top: 6px;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 30px;
    padding: 12px 22px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(35, 70, 104, 0.22);
  }
  .empty-cta:active { transform: scale(0.98); }

  /* ─── FAB ────────────────────── */
  /* ─── FAB ──────────────────────
     Floating compose button. Sits low above the bottom nav so it's
     in easy thumb reach and never lands in the middle of the screen.
     Only appears on Logbook view (rendered inside daysView). */
  .fab {
    position: fixed;
    /* Anchor relative to bottom nav + safe area. Bottom nav is ~82px
       tall plus safe-bottom; we sit the FAB 92px above safe-bottom so
       there's a small gap above the nav and the button never gets
       covered on devices with safe-bottom: 0 (iPhone SE, iPad). */
    bottom: calc(var(--safe-bottom) + 92px);
    left: 50%;
    transform: translateX(-50%);
    /* Above bottom nav (z-index 5) so it stays tappable. */
    z-index: 6;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(35, 70, 104, 0.4), 0 2px 6px rgba(35, 70, 104, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    animation: fabPresence 2.8s ease-in-out infinite;
  }
  @keyframes fabPresence {
    0%, 100% { box-shadow: 0 8px 24px rgba(35, 70, 104, 0.4), 0 2px 6px rgba(35, 70, 104, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
    50% { box-shadow: 0 10px 28px rgba(35, 70, 104, 0.48), 0 2px 8px rgba(35, 70, 104, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
  }
  @media (prefers-reduced-motion: reduce) {
    .fab { animation: none; }
    .auth-mark { animation: none; }
    .close-complete.show .cc-mark { animation: none; }
    .onboarding.onboarding-enter,
    .onboarding.onboarding-exit,
    .onboarding-content.onboarding-step-in { animation: none; }
  }
  .fab:active {
    transform: translateX(-50%) scale(0.93);
    box-shadow: 0 4px 12px rgba(35, 70, 104, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .fab svg { width: 22px; height: 22px; }

  /* ─── DAY DETAIL VIEW ────────── */
  .day-detail-view {
    background: var(--paper);
  }

  .back-bar {
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rule);
    flex-shrink: 0;
  }

  .back-btn, .day-export-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
  }
  .back-btn svg, .day-export-btn svg { width: 14px; height: 14px; }
  .back-btn:active { background: var(--paper-shade); transform: scale(0.97); }
  .day-export-btn { color: var(--ink-soft); }
  .day-export-btn:active { background: var(--paper-shade); }

  .day-header {
    padding: 18px 22px 10px;
    text-align: center;
    flex-shrink: 0;
  }

  .day-header-num {
    font-family: var(--serif);
    font-size: 50px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 4px;
    font-feature-settings: "lnum";
  }

  .day-header-month {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 12px;
  }

  .day-header-rule {
    width: 50px;
    height: 1px;
    background: var(--ink-faint);
    margin: 0 auto;
    opacity: 0.4;
  }

  .day-content {
    padding: 16px 22px 100px;
  }

  /* ─── THREAD CHIPS ─────────────── */
  .thread-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 6px;
    align-items: center;
  }
  .thread-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(35, 70, 104, 0.07);
    border: 1px solid rgba(35, 70, 104, 0.18);
    border-radius: 14px;
    padding: 5px 11px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.15s;
  }
  .thread-chip:active { transform: scale(0.96); background: rgba(35, 70, 104, 0.12); }
  .thread-chip-remove {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 2px;
    opacity: 0.5;
    transition: opacity 0.15s;
  }
  .thread-chip-remove:active { opacity: 1; }
  .thread-add-btn {
    background: none;
    border: 1px dashed var(--paper-edge);
    border-radius: 14px;
    padding: 5px 11px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ink-faint);
    cursor: pointer;
    transition: background 0.15s;
  }
  .thread-add-btn:active { background: var(--paper-shade); }

  /* ─── PER-NOTE TAG STRIP ───────────
     Smaller, quieter chips than the entry-level thread chips. The
     whole strip is one click target — tapping anywhere in it opens
     the tag sheet for that note. When the note has no tags yet, we
     show a faint "+ Tag" affordance instead of leaving the row
     visually inert. */
  .note-tags {
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    cursor: pointer;
    padding: 2px 0;
    /* Allow the strip to feel like its own surface even when empty */
    min-height: 18px;
    align-items: center;
  }
  .note-tag-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(35, 70, 104, 0.06);
    border: 1px solid rgba(35, 70, 104, 0.14);
    border-radius: 10px;
    padding: 2px 8px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    pointer-events: none;  /* let clicks bubble to .note-tags */
  }
  .note-tags-empty {
    opacity: 0.55;
    transition: opacity 0.15s;
  }
  .note-tags-empty:hover { opacity: 0.85; }
  .note-tag-add {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ink-faint);
    pointer-events: none;
  }

  /* ─── ACCOMPLISHMENTS BOX ──────── */
  .accomplishments-box {
    margin-top: 24px;
    padding: 14px 16px;
    background: rgba(184,137,58,0.06);
    border: 1px solid rgba(184,137,58,0.2);
    border-radius: 14px;
  }
  .accomplishments-title {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .accomplishment-item {
    padding: 8px 0;
    border-top: 1px dashed rgba(184,137,58,0.2);
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .accomplishment-item:first-of-type { border-top: none; padding-top: 0; }
  .accomplishment-stars {
    flex-shrink: 0;
    color: var(--gold);
    font-size: 11px;
    line-height: 1.5;
    width: 30px;
  }
  .accomplishment-content { flex: 1; }
  .accomplishment-title {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
  }
  .accomplishment-detail {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 2px;
    line-height: 1.4;
  }
  .accomplishment-cat {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-top: 4px;
  }

  /* ─── REPORTS VIEW ─────────────── */
  .reports-view {
    /* Now a regular view — sits in the .views container.
       Inherits position/inset/display/flex-direction from .view base.
       Override overflow: the content section scrolls, header+tabs stay fixed. */
    background: var(--paper);
  }
  .reports-view .reports-header,
  .reports-view .reports-tabs {
    flex-shrink: 0;  /* header and tabs row keep their natural height */
  }
  .reports-view .reports-content {
    flex: 1;  /* content area takes remaining space */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px 40px;
  }

  .reports-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 8px;
    padding-top: max(14px, var(--safe-top));
  }
  .reports-back {
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 6px;
    margin-left: -6px;
  }
  .reports-back svg { width: 22px; height: 22px; }
  .reports-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: var(--ink);
  }

  .reports-tabs {
    display: flex;
    gap: 2px;
    padding: 0 18px 14px;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .reports-tabs::-webkit-scrollbar { display: none; }
  .reports-tab {
    background: none;
    border: none;
    padding: 8px 14px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s;
  }
  .reports-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .reports-tab:active:not(.active) { color: var(--ink-soft); }

  .report-section { display: none; }
  .report-section.active { display: block; }

  .acc-month-group {
    margin-bottom: 22px;
  }
  .acc-month-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
  }

  .acc-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--rule);
    cursor: pointer;
  }
  .acc-row:last-child { border-bottom: none; }
  .acc-row-stars {
    color: var(--gold);
    font-size: 11px;
    flex-shrink: 0;
    width: 26px;
    line-height: 1.5;
  }
  .acc-row-content { flex: 1; }
  .acc-row-title {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
  }
  .acc-row-meta {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-top: 3px;
  }

  .eval-form-row { margin-bottom: 14px; }
  .eval-form-label {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .eval-date-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .eval-date-row input {
    flex: 1;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ink);
    -webkit-appearance: none;
  }
  .eval-style-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .eval-style-pill {
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 14px;
    padding: 7px 14px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
  }
  .eval-style-pill.active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
  .eval-generate-btn {
    width: 100%;
    margin-top: 6px;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 14px;
    padding: 13px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(35, 70, 104, 0.18);
    transition: transform 0.1s, box-shadow 0.15s;
  }
  .eval-generate-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(35, 70, 104, 0.18);
  }
  .eval-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .eval-generate-btn.gold {
    background: linear-gradient(180deg, var(--gold-soft) 0%, var(--gold) 100%);
    box-shadow: 0 2px 8px rgba(184, 137, 58, 0.25);
  }
  .eval-generate-btn.gold:active {
    box-shadow: 0 1px 4px rgba(184, 137, 58, 0.25);
  }

  .eval-result {
    margin-top: 22px;
    padding: 18px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 14px;
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  .eval-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }
  .eval-copy-btn {
    background: var(--paper-shade);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 8px 16px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    cursor: pointer;
  }
  .eval-copy-btn:active { background: var(--paper-edge); }

  /* ─── THREAD PICKER SHEET ───── */
  .thread-picker-overlay {
    position: fixed; inset: 0;
    background: rgba(42,38,32,0.5);
    backdrop-filter: blur(6px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .thread-picker-overlay.show { opacity: 1; pointer-events: auto; }
  .thread-picker {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    z-index: 41;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 12px 20px;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: max(20px, var(--safe-bottom));
  }
  .thread-picker.show { transform: translateY(0); }
  .thread-picker-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 10px;
  }
  .thread-picker-input {
    width: 100%;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: var(--serif);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    box-sizing: border-box;
  }
  .thread-picker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .thread-picker-item {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
  }
  .thread-picker-item:active { background: var(--paper-shade); }
  .thread-picker-item-create {
    font-style: italic;
    color: var(--accent);
    border-style: dashed;
  }

  /* Composed entry */
  .composed-entry {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink);
    animation: fadeIn 0.5s ease;
    cursor: text;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 8px;
    transition: background 0.15s;
    position: relative;
  }
  .composed-entry:hover {
    background: rgba(255,255,255,0.3);
  }
  .composed-entry::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a7f6d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
  }
  .composed-entry:hover::after {
    opacity: 0.5;
  }

  .composed-edit-textarea {
    width: 100%;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink);
    outline: none;
    resize: vertical;
    min-height: 200px;
    box-sizing: border-box;
    transition: border-color 0.15s;
  }
  .composed-edit-textarea:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.7);
  }

  .composed-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
  }

  .composed-edit-save {
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 14px;
    padding: 9px 18px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
  }
  .composed-edit-save:active { transform: scale(0.97); }
  .composed-edit-save:disabled { opacity: 0.4; cursor: not-allowed; }

  .composed-edit-cancel {
    background: none;
    border: none;
    color: var(--ink-faint);
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    cursor: pointer;
    padding: 9px 12px;
  }

  .composed-edit-hint {
    margin-left: auto;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ink-faint);
  }

  .composed-entry p { margin-bottom: 14px; }
  .composed-entry p:last-child { margin-bottom: 0; }

  .composed-entry p:first-of-type::first-letter {
    font-family: var(--serif);
    font-style: italic;
    font-size: 3.2em;
    float: left;
    line-height: 0.85;
    margin: 4px 8px -4px 0;
    color: var(--accent);
    font-weight: 500;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .raw-section {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
  }

  .raw-section-title {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 12px;
    text-align: center;
  }

  .note-item {
    padding: 10px 0;
    border-bottom: 1px dashed var(--rule);
    position: relative;
  }
  .note-item:last-child { border-bottom: none; }

  .note-time {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .note-text {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
    padding-right: 24px;
    cursor: text;
    border-radius: 4px;
    transition: background 0.1s;
  }
  .note-item:not(.note-pending) .note-text:hover {
    background: rgba(192, 173, 126, 0.15);
  }

  /* Visual treatment for offline-queued notes — subtly distinguished
     so the user knows they exist locally but haven't synced yet.
     Uses a positioned pseudo-element rather than a negative margin so
     the gold bar sits at the visual edge of the note row regardless
     of parent padding. */
  .note-item.note-pending {
    background: rgba(184, 137, 58, 0.04);
    position: relative;
  }
  .note-item.note-pending::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gold);
    border-radius: 2px;
  }

  /* Offline / pending-sync badge in the header */
  .offline-badge {
    display: none;
    align-items: center;
    padding: 4px 10px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    line-height: 1;
    margin-right: 8px;
  }

  .note-delete {
    position: absolute;
    top: 10px;
    right: 0;
    background: none;
    border: none;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    opacity: 0.4;
  }
  .note-delete:active { opacity: 1; color: var(--accent); }

  .compose-hint {
    text-align: center;
    padding: 20px 16px;
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-faint);
    font-size: 14px;
    line-height: 1.6;
  }

  .btn-primary, .btn-subtle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 30px;
    padding: 13px 26px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    cursor: pointer;
    margin: 14px auto 0;
    transition: all 0.15s;
  }

  .btn-primary {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .btn-primary:active { transform: scale(0.97); }
  .btn-primary:disabled { opacity: 0.4; cursor: default; }

  .btn-subtle {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--paper-edge);
    font-size: 13px;
    padding: 10px 20px;
  }

  /* Compact "Add note to this day" affordance shown at the top of
     the day detail. Subtle so it doesn't compete with the composed
     entry but discoverable. */
  .btn-add-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--paper-edge);
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.15s, border-color 0.15s;
  }
  .btn-add-note:hover { background: rgba(255, 255, 255, 0.85); border-color: var(--ink-faint); }
  .btn-add-note:active { transform: scale(0.97); }

  .btn-primary svg, .btn-subtle svg { width: 15px; height: 15px; }

  .generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 50px 20px;
  }

  .gen-dots { display: flex; gap: 6px; }

  .gen-dot {
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse-dot 1.4s ease-in-out infinite;
  }
  .gen-dot:nth-child(2) { animation-delay: 0.2s; }
  .gen-dot:nth-child(3) { animation-delay: 0.4s; }

  /* Loading dots on dark surfaces */
  .week-card .gen-dot {
    background: var(--gold);
  }

  @keyframes pulse-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
  }

  .gen-label {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-faint);
    font-size: 13px;
  }
  /* Week card has a dark navy background; ink-faint (warm tan) is
     invisible on it. Override with a near-paper light tone. Keeps
     the inline style hack out of templates. */
  .week-card .gen-label {
    color: rgba(236, 226, 192, 0.85);
  }

  /* ─── ASK VIEW ───────────────── */
  .ask-view { padding: 0; }

  .ask-intro {
    padding: 12px 22px 0;
  }

  .ask-intro-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 6px;
  }

  .ask-intro-sub {
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
    margin-bottom: 16px;
  }

  .ask-input-wrap {
    padding: 0 22px 12px;
    flex-shrink: 0;
  }

  .ask-input {
    width: 100%;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    padding: 14px 16px;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.4;
    color: var(--ink);
    outline: none;
    resize: none;
    min-height: 60px;
    max-height: 140px;
  }
  .ask-input:focus { border-color: var(--accent); }
  .ask-input::placeholder { color: var(--ink-faint); font-style: italic; }

  .ask-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
  }

  .ask-submit {
    background: var(--accent);
    color: var(--paper);
    border: none;
    border-radius: 22px;
    padding: 9px 22px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(35, 70, 104, 0.3);
  }
  .ask-submit:disabled { opacity: 0.4; }
  .ask-submit:active:not(:disabled) { transform: scale(0.97); }

  .ask-suggestions {
    padding: 0 22px 12px;
  }

  .ask-suggestion-title {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .ask-suggestion {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
  }
  .ask-suggestion:active { background: var(--paper-shade); transform: scale(0.99); }

  /* ─── ASK FILTER BAR ─────────── */
  .ask-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .ask-filter-toggle {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    padding: 5px 11px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
  }
  .ask-filter-toggle.has-filter {
    background: rgba(35, 70, 104, 0.08);
    border-color: var(--accent);
    color: var(--accent);
  }
  .ask-filter-toggle svg { width: 11px; height: 11px; }

  .ask-filter-panel {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    gap: 8px;
    flex-direction: column;
  }
  .ask-filter-panel.show { display: flex; }

  .ask-filter-row-inner {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ask-filter-label {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .ask-date-input {
    flex: 1;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    padding: 8px 10px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
  }
  .ask-date-input:focus { border-color: var(--accent); }

  .ask-filter-clear {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 8px;
    align-self: flex-end;
  }

  /* ─── SAVED SEARCHES STRIP ───── */
  .saved-strip {
    padding: 0 22px 12px;
  }

  .saved-strip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .saved-strip-row::-webkit-scrollbar { display: none; }

  .saved-chip {
    flex-shrink: 0;
    background: var(--paper-shade);
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    padding: 7px 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
    scroll-snap-align: start;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    -webkit-user-select: none;
  }
  .saved-chip:active {
    background: var(--paper-edge);
    transform: scale(0.97);
  }
  .saved-chip-meta {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    font-style: normal;
    text-transform: uppercase;
  }

  /* ─── SAVE-SEARCH BUTTON ─────── */
  .save-search-row {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  .save-search-btn {
    background: transparent;
    border: 1px dashed var(--paper-edge);
    color: var(--ink-faint);
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    padding: 7px 16px;
    border-radius: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
  }
  .save-search-btn:active {
    background: var(--paper-shade);
    color: var(--accent);
    border-color: var(--accent);
  }
  .save-search-btn.saved {
    color: var(--accent);
    border-color: var(--accent);
    border-style: solid;
  }
  .save-search-btn svg { width: 12px; height: 12px; }

  /* ─── SAVE LABEL SHEET ───────── */
  .save-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42,38,32,0.5);
    backdrop-filter: blur(6px);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .save-sheet-overlay.show { opacity: 1; pointer-events: auto; }

  .save-sheet {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    z-index: 26;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 12px 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    padding-bottom: max(20px, var(--safe-bottom));
  }
  .save-sheet.show { transform: translateY(0); }

  .save-sheet-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 4px;
  }

  .save-sheet-sub {
    font-family: var(--serif);
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 14px;
    line-height: 1.4;
  }

  .save-sheet-input {
    width: 100%;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--serif);
    font-size: 15px;
    color: var(--ink);
    outline: none;
    margin-bottom: 14px;
  }
  .save-sheet-input:focus { border-color: var(--accent); }

  .ask-results {
    padding: 0 22px 100px;
  }

  .ask-answer {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    padding: 18px;
    margin-top: 14px;
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    animation: fadeIn 0.4s ease;
  }

  .ask-answer p { margin-bottom: 12px; }
  .ask-answer p:last-child { margin-bottom: 0; }
  .ask-answer ul, .ask-answer ol { padding-left: 22px; margin-bottom: 12px; }
  .ask-answer li { margin-bottom: 6px; }
  .ask-answer strong { color: var(--accent); font-weight: 500; }

  .ask-sources {
    margin-top: 14px;
  }

  .ask-sources-title {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .source-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--paper-shade);
    border: 1px solid var(--paper-edge);
    border-radius: 16px;
    padding: 5px 11px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ink-soft);
    margin: 0 4px 4px 0;
    cursor: pointer;
  }
  .source-pill:active { background: var(--paper-edge); }

  /* ─── COMPOSE SHEET ──────────── */
  .compose-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42,38,32,0.5);
    backdrop-filter: blur(6px);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .compose-overlay.show { opacity: 1; pointer-events: auto; }

  .compose-sheet {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    z-index: 21;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 12px 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    padding-bottom: max(20px, var(--safe-bottom));
  }
  .compose-sheet.show { transform: translateY(0); }

  .sheet-handle {
    width: 36px; height: 4px;
    background: var(--ink-faint);
    border-radius: 2px;
    margin: 0 auto 14px;
    opacity: 0.4;
  }

  .compose-prompt {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--ink-faint);
    margin-bottom: 10px;
  }

  .compose-input {
    width: 100%;
    background: transparent;
    border: none;
    font-family: var(--serif);
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink);
    resize: none;
    outline: none;
    min-height: 90px;
    max-height: 220px;
    padding: 0;
    margin-bottom: 14px;
  }
  .compose-input::placeholder { color: var(--ink-faint); font-style: italic; }

  .compose-actions { display: flex; gap: 10px; }
  .compose-kbd-hint {
    margin-top: 8px;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    text-align: center;
    opacity: 0.75;
  }
  @media (hover: none) {
    .compose-kbd-hint { display: none; }
  }

  .compose-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid var(--paper-edge);
    color: var(--ink-soft);
    padding: 12px;
    border-radius: 12px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    cursor: pointer;
  }

  .compose-save {
    flex: 2;
    background: var(--accent);
    border: none;
    color: var(--paper);
    padding: 12px;
    border-radius: 12px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(35, 70, 104, 0.3);
  }
  .compose-save:disabled { opacity: 0.4; }
  .compose-save:active:not(:disabled) { transform: scale(0.97); }

  /* ─── AUTH / SETUP ───────────── */
  .auth {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 30;
    display: flex;
    flex-direction: column;
    padding: 50px 26px;
    overflow-y: auto;
    padding-top: calc(50px + var(--safe-top));
  }

  .auth-mark {
    font-family: var(--serif);
    font-size: 56px;
    font-style: italic;
    color: var(--accent);
    opacity: 0.7;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 20px;
    animation: authMarkIn 0.7s cubic-bezier(.2,.7,.2,1) both;
  }

  @keyframes authMarkIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 0.7; transform: translateY(0) scale(1); }
  }

  .auth-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 30px;
    color: var(--ink);
    text-align: center;
    margin-bottom: 10px;
  }

  .auth-blurb {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    text-align: center;
    margin-bottom: 28px;
  }

  .auth-input {
    width: 100%;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink);
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s;
  }
  .auth-input:focus { border-color: var(--accent); }

  .auth-password-wrap {
    position: relative;
    margin-bottom: 12px;
  }
  .auth-password-input {
    margin-bottom: 0;
    padding-right: 72px;
  }
  .auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-soft);
    cursor: pointer;
    padding: 6px 4px;
  }
  .auth-password-toggle:active { opacity: 0.7; }

  .auth-submit {
    width: 100%;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 30px;
    padding: 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(35, 70, 104, 0.28);
    transition: transform 0.1s, box-shadow 0.15s;
  }
  .auth-submit:disabled { opacity: 0.4; cursor: not-allowed; }
  .auth-submit:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(35, 70, 104, 0.28);
  }

  /* Subtle text-link style for the auth back button ("Use a different email") */
  .setup-skip {
    background: none;
    border: none;
    color: var(--ink-faint);
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: color 0.15s;
  }
  .setup-skip:hover { color: var(--ink-soft); }
  .setup-skip:active { color: var(--accent); }

  .auth-help {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ink-faint);
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
  }

  .auth-success {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    color: var(--accent);
    text-align: center;
    line-height: 1.6;
    margin-top: 18px;
    padding: 14px;
    background: rgba(35, 70, 104, 0.06);
    border-radius: 12px;
  }

  /* ─── SETTINGS ───────────────── */
  .settings {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 28;
    display: none;
    flex-direction: column;
    padding-top: var(--safe-top);
  }
  .settings.show { display: flex; }

  .settings-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  /* The close X uses .header-btn, whose cream color is meant for the
     dark app header. On the cream settings background that makes it
     nearly invisible — override to dark ink here. */
  .settings-header .header-btn { color: var(--ink-soft); }
  .settings-header .header-btn:active { background: rgba(0,0,0,0.06); }

  .settings-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    color: var(--ink);
  }

  .settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    padding-bottom: calc(40px + var(--safe-bottom));
  }

  .settings-section { margin-bottom: 26px; }

  .settings-section-title {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  /* Import-mode tools — hidden by default. Shown when the toggle in
     Settings is on. These are one-shot tools for migrating historical
     data; once the import is complete, the toggle hides them again. */
  body:not(.import-mode) .import-mode-only { display: none !important; }

  /* Advanced settings disclosure. Native <details>/<summary> with
     custom styling — keeps maintenance/destructive actions out of
     the main settings flow but reachable when needed. */
  .settings-advanced {
    margin-bottom: 26px;
  }
  .settings-advanced > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--ink-soft);
    text-transform: uppercase;
    transition: background 0.15s;
  }
  .settings-advanced > summary::-webkit-details-marker { display: none; }
  .settings-advanced > summary:hover { background: rgba(255, 255, 255, 0.55); }
  .settings-advanced-chevron {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink-faint);
    transition: transform 0.15s;
    line-height: 1;
  }
  .settings-advanced[open] > summary > .settings-advanced-chevron {
    transform: rotate(90deg);
  }
  .settings-advanced-body {
    padding: 14px 4px 0;
  }

  .settings-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .settings-input, .settings-textarea {
    width: 100%;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    outline: none;
  }
  .settings-input:focus, .settings-textarea:focus { border-color: var(--accent); }

  .settings-textarea { min-height: 100px; resize: none; }

  .settings-help {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 6px;
    line-height: 1.5;
  }

  .settings-save {
    width: 100%;
    background: var(--accent);
    color: var(--paper);
    border: none;
    border-radius: 30px;
    padding: 13px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(35, 70, 104, 0.3);
  }
  .settings-save:active { transform: scale(0.98); }

  .settings-signout {
    width: 100%;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--paper-edge);
    border-radius: 30px;
    padding: 11px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    cursor: pointer;
    margin-top: 18px;
  }

  /* ─── TOAST ──────────────────── */
  .toast {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(200px);
    background: var(--ink);
    color: var(--paper);
    padding: 10px 18px;
    border-radius: 22px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    /* Above all sheets and overlays. Resolve sheet sits at 50/51,
       compose sheet at 50/51, tag-note sheet at 50/51 — toast at 100
       so feedback isn't buried when any of them are open. */
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    white-space: nowrap;
    max-width: 90%;
    opacity: 0;
  }
  .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

  .loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(236, 226, 192,0.85);
    backdrop-filter: blur(4px);
    z-index: 40;
    display: flex;            /* always laid out so transitions work */
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* ─── ONBOARDING ───────────────── */
  .onboarding {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 35;
    display: none;
    flex-direction: column;
    padding: 40px 26px calc(24px + var(--safe-bottom));
    overflow-y: auto;
    padding-top: calc(40px + var(--safe-top));
  }
  .onboarding.onboarding-enter {
    animation: onboardingFadeIn 0.35s ease both;
  }
  .onboarding.onboarding-exit {
    animation: onboardingFadeOut 0.22s ease both;
  }
  @keyframes onboardingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes onboardingFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  .onboarding-content {
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  .onboarding-content.onboarding-step-out {
    opacity: 0;
    transform: translateX(-12px);
  }
  .onboarding-content.onboarding-step-out-back {
    opacity: 0;
    transform: translateX(12px);
  }
  .onboarding-content.onboarding-step-in {
    animation: onboardingStepIn 0.28s cubic-bezier(.2,.7,.2,1) both;
  }
  @keyframes onboardingStepIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .onboarding-mark {
    font-family: var(--serif);
    font-size: 48px;
    font-style: italic;
    color: var(--accent);
    opacity: 0.75;
    text-align: center;
    margin: 12px 0 10px;
  }

  .onboarding-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 26px;
    color: var(--ink);
    text-align: center;
    margin-bottom: 12px;
  }

  .onboarding-body {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
    text-align: center;
    margin-bottom: 22px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }

  .onboarding-field-wrap {
    margin-bottom: 18px;
  }

  .onboarding-textarea {
    width: 100%;
    min-height: 88px;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--paper-edge);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    outline: none;
    resize: vertical;
  }
  .onboarding-textarea:focus { border-color: var(--accent); }

  .onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: auto 0 20px;
  }

  .onboarding-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--paper-edge);
    transition: background 0.2s, transform 0.2s;
  }
  .onboarding-dot.active {
    background: var(--accent);
    transform: scale(1.15);
  }

  .onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
  }

  .onboarding-nav {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .onboarding-back {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--ink-faint);
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    padding: 10px 12px;
    cursor: pointer;
  }

  .onboarding-next {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
    color: var(--paper);
    border: none;
    border-radius: 30px;
    padding: 14px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(35, 70, 104, 0.28);
  }
  .onboarding-next:active { transform: scale(0.98); }
