:root {
  --bg: #0e1014;
  --panel: #161a22;
  --fg: #e6e9ef;
  --muted: #8a93a4;
  --accent: #4ade80;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
  /* Referenced by onboarding/celebrate styles — previously undefined, so
     progress dots, tone borders and hints fell back to invalid colors. */
  --line: #2a3140;   /* hairlines, inactive progress dots */
  --good: #4ade80;   /* success text (matches --accent) */
  --ink: #e6e9ef;    /* strongest text (matches --fg) */
}
* { box-sizing: border-box; }
.link-back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.link-back:hover { color: var(--ink); }
/* Branded error pages (404/500/CSRF) — standalone template, same palette. */
.errpage { text-align: center; padding: 5rem 1rem; }
.errpage .code { font-size: 5rem; font-weight: 800; color: var(--line); line-height: 1; }
.errpage h1 { margin: 0.4rem 0 0.6rem; }
.errpage p { color: var(--muted); max-width: 34rem; margin: 0 auto 1.5rem; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif; }
main { max-width: 720px; margin: 1rem auto 4rem; padding: 0 1rem; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding: 0.75rem 1.25rem; background: var(--panel); border-bottom: 1px solid #222; position:sticky; top:0; }
.brand { color: var(--accent); text-decoration:none; font-weight:700; letter-spacing:0.5px; }
nav a, nav .hello { color: var(--fg); margin-left: 0.75rem; text-decoration:none; font-size: 0.9rem; }
button, .cta { font: inherit; cursor: pointer; padding: 0.6rem 1rem; border-radius: var(--radius); border: 0; background: #2a3140; color: var(--fg); }
button.primary, .cta { background: var(--accent); color:#08120c; font-weight:600; }
button.danger { background: var(--danger); color:#240b0b; }
button.link { background: transparent; color: var(--muted); padding: 0.4rem 0.6rem; }
.hero { text-align:center; padding: 4rem 1rem; }
.hero h1 { font-size: 2.4rem; margin: 0 0 0.4rem; }
.hero p { color: var(--muted); margin: 0 0 1.5rem; }
.panel { background: var(--panel); padding: 1.25rem; border-radius: var(--radius); margin: 1rem 0; }
.panel.narrow { max-width: 420px; margin: 2rem auto; }
.panel h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }
label { display:block; margin: 0.5rem 0; color: var(--muted); font-size: 0.85rem; }
input, select, textarea { width:100%; margin-top: 0.25rem; padding: 0.6rem 0.8rem; border-radius: 10px; border: 1px solid #2a3140; background:#0d1118; color: var(--fg); }
.tracker { background: var(--panel); padding: 1.25rem; border-radius: var(--radius); margin: 0.75rem 0; }
.tracker header { display:flex; justify-content:space-between; align-items:baseline; }
.tracker h3 { margin:0; }
.tracker .days { color: var(--accent); font-weight: 700; font-size: 1.4rem; }
.tracker .encouragement { font-size: 1.05rem; margin: 0.5rem 0; }
.meta { color: var(--muted); font-size: 0.85rem; }
.actions { display:flex; gap:0.5rem; margin-top:0.75rem; flex-wrap:wrap; }
.actions form { margin: 0; }
.flash { padding: 0.7rem 1rem; border-radius: 10px; margin: 0.5rem 0; }
.flash.error { background:#3a1313; color:#fbb; }
.flash.info { background:#0f2a1a; color:#aef; }
.empty { color: var(--muted); text-align:center; padding: 3rem 1rem; }
code { background:#0a0d12; padding: 0.4rem 0.6rem; border-radius: 8px; display:inline-block; user-select: all; }

/* ============================================================
 * Polish layer — added by the cross-project UI polish sweep.
 * Focus rings, mobile breakpoints, loading affordances, empty
 * states. Keep below your existing rules so it overrides them.
 * ============================================================ */

/* Accessible focus rings on every interactive element. The base CSS
 * uses platform-default outlines which disappear on most themes — this
 * restores a visible 2px ring without breaking native keyboard nav. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent, #5b8def);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Mobile: stack form rows, shrink hero padding, full-width buttons. */
@media (max-width: 600px) {
    main { padding: 0 0.75rem 3rem; }
    .panel, .request, .claim { padding: 1rem 0.9rem; }
    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.6rem; }
    .rowflex { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    button.primary, .cta { width: 100%; text-align: center; }
    nav { gap: 0.5rem; flex-wrap: wrap; }
}

/* Loading spinner — drop in next to a submit button via:
 *   <button class="primary" data-loading="Saving…">Save</button>
 * The aria-busy attribute is toggled by app.js when the form submits. */
[aria-busy="true"] { cursor: progress; opacity: 0.7; pointer-events: none; }
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: white;
    border-radius: 50%; animation: spin 0.8s linear infinite;
    vertical-align: -2px; margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty-state — use:
 *   <div class="empty-state">
 *     <h3>No items yet</h3><p>Add your first one to get started.</p>
 *   </div>  */
.empty-state {
    text-align: center; padding: 2.5rem 1rem;
    color: var(--muted, #888);
}
.empty-state h3 { margin: 0 0 0.4rem; color: var(--ink, inherit); font-weight: 600; }
.empty-state p  { margin: 0 auto; max-width: 360px; line-height: 1.45; }

/* Smooth card hover. Cheap polish that makes lists feel alive without
 * adding interactive surfaces we don't want clickable. */
.panel, .request, .claim, .card {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a:has(> .card):hover .card,
a.cardlink:hover { transform: translateY(-1px); }

/* Better flash bars — slightly larger, with a left bar to scan. */
.flash, .notice {
    border-left: 4px solid currentColor;
    padding-left: 0.9rem !important;
}

/* Skip-link for keyboard users — visible on focus only. */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--accent, #5b8def); color: white;
    padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { top: 0; }


/* Quit Me: streak number tabular-figures so it doesn't jitter. */
.tracker .days {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--accent, #5b8def);
}
.tracker .encouragement {
    font-size: 1.05rem;
    margin: 0.4rem 0 0.2rem;
}

/* ===========================================================
 * Social viral-loop layer: onboarding, celebrate, share UI.
 * ============================================================ */

/* Onboarding */
.onb { max-width: 520px; margin: 1rem auto 2rem; }
.onb h1 { font-size: 1.8rem; margin: 0.4rem 0; }
.onb .lede { color: var(--muted); margin: 0 0 1.2rem; line-height: 1.5; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 1rem; }
.onb-progress .dot { width: 28px; height: 4px; border-radius: 999px; background: var(--line); }
.onb-progress .dot.on { background: var(--accent); }
.tone-grid { display: grid; gap: 8px; margin: 0.5rem 0 1rem; }
.tone { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px;
        border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.tone:hover { border-color: var(--accent); }
.tone strong { display: block; font-weight: 500; }
.tone em { display: block; font-style: normal; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.onb .skip { text-align: center; margin: 1rem 0 0; color: var(--muted); font-size: 0.9rem; }
.onb textarea { font: inherit; resize: vertical; }

/* Celebrate */
.celebrate { text-align: center; padding: 1.5rem 1rem 3rem; position: relative; overflow: hidden; }
.celebrate .kicker { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.5rem; }
.celebrate .big-num { font-size: 7.5rem; font-weight: 500; line-height: 1; color: var(--accent);
                       font-variant-numeric: tabular-nums; margin: 0 0 0.2rem; }
.celebrate .sub { color: var(--muted); margin: 0 0 1.5rem; }
.celebrate .card-preview { width: 240px; height: 240px; border-radius: 16px;
                            box-shadow: 0 4px 24px rgba(31,29,26,.08); margin-bottom: 1.5rem; }
.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.share-btn { background: var(--accent); color: white; padding: 0.7rem 1.2rem;
              border-radius: 12px; text-decoration: none; font-weight: 500;
              border: 0; cursor: pointer; font: inherit; }
.share-btn:hover { filter: brightness(1.05); }
.copy-hint { color: var(--good); font-size: 0.9rem; margin: -0.5rem 0 0.5rem; }
.celebrate .back { display: inline-block; margin-top: 0.5rem; color: var(--muted); text-decoration: none; }
.celebrate .back:hover { color: var(--ink); }

/* Confetti — pure CSS, 24 pieces. */
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti .bit { position: absolute; top: -20px; width: 10px; height: 14px;
                  border-radius: 2px;
                  animation: fall 3.2s ease-in forwards;
                  opacity: 0.85; }
@keyframes fall {
    to { transform: translateY(120vh) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }


/* ---------------------------------------------------------------------------
   My Journey (web dashboard) — matches the iOS "My Journey" tab.
   Added when the dashboard was rebuilt: the API-token panel was removed (it
   printed a live bearer token on screen) and "new quit" was collapsed behind a
   disclosure so the page opens on your journeys, not on a form.
   --------------------------------------------------------------------------- */
.j-head { display: flex; align-items: flex-start; justify-content: space-between;
          gap: 1rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.j-title { margin: 0; font-size: 1.9rem; letter-spacing: -0.02em; }
.j-sub { margin: 0.35rem 0 0; color: var(--muted); font-style: italic; }

/* Disclosure styled as a button; the arrow marker is removed on both engines. */
.j-new { position: relative; }
.j-new-btn { list-style: none; cursor: pointer; display: inline-block;
             background: var(--accent); color: #06210f; font-weight: 700;
             padding: 0.6rem 1.1rem; border-radius: 999px; white-space: nowrap; }
.j-new-btn::-webkit-details-marker { display: none; }
.j-new[open] .j-new-btn { background: var(--panel); color: var(--fg);
                          border: 1px solid var(--line); }
.j-form { margin-top: 0.75rem; background: var(--panel); border: 1px solid var(--line);
          border-radius: var(--radius); padding: 1rem; min-width: min(420px, 90vw); }
.j-form label { display: block; margin-bottom: 0.75rem; color: var(--muted);
                font-size: 0.85rem; }
.j-form input, .j-form select { margin-top: 0.3rem; }

.j-card { border: 1px solid var(--line); }
.j-target { margin: 0.1rem 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.j-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.j-spacer { flex: 1 1 auto; }

/* Quiet tertiary action — replaces the raw underlined blue link that sat
   between two filled buttons. */
.j-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted);
           padding: 0.5rem 0.9rem; border-radius: 999px; font: inherit;
           font-size: 0.85rem; cursor: pointer; text-decoration: none;
           display: inline-block; line-height: 1.2; }
.j-ghost:hover { color: var(--fg); border-color: var(--muted); }

.j-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; }
.j-panel { margin-top: 1.5rem; }

/* ===================================================================
   Web-app parity screens
   -------------------------------------------------------------------
   The journey-detail, community, communities, achievements and buddies
   templates all shipped with class names that had NO rules behind them —
   the markup was semantic but rendered as unstyled browser defaults.
   This section is the missing half. Same palette + radii as the rest of
   the sheet, so the web app reads like the iOS app rather than a form
   dump.
   =================================================================== */

/* ---- shared button variants ---- */
a.primary, a.danger, a.ghost {
  display: inline-block; text-decoration: none; font: inherit;
  padding: 0.6rem 1.1rem; border-radius: 999px; line-height: 1.2;
}
a.primary { background: var(--accent); color: #06210f; font-weight: 700; }
a.danger  { background: var(--danger); color: #240b0b; font-weight: 700; }
button.ghost, a.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 0.5rem 0.9rem; border-radius: 999px; font: inherit;
  font-size: 0.85rem; cursor: pointer;
}
button.ghost:hover, a.ghost:hover { color: var(--fg); border-color: var(--muted); }

/* ---- journey detail (web twin of iOS TrackerDetailView) ---- */
.jd-hero { text-align: center; padding: 1.5rem 1.25rem 1.75rem; }
.jd-free { margin: 0; color: var(--muted); font-size: 0.9rem;
           letter-spacing: 0.08em; text-transform: uppercase; }
.jd-days { margin: 0 0 0.15rem; font-size: clamp(3.5rem, 11vw, 5.5rem);
           line-height: 0.95; font-weight: 800; color: var(--accent);
           letter-spacing: -0.03em; }
.jd-quote { margin: 0.75rem 0 0; color: var(--muted); font-style: italic; }

/* The encouragement line. It used to carry a bare `border-left` inside a
   centred hero, so the accent bar floated detached to the far left of the
   text with nothing attaching it — it read as a rendering glitch. It's a
   centred pill now. */
.jd-enc { display: inline-block; margin: 1rem auto 0; max-width: 34rem;
          padding: 0.7rem 1.1rem; border-radius: var(--radius);
          background: rgba(251, 191, 36, 0.08);
          border: 1px solid rgba(251, 191, 36, 0.22);
          color: var(--fg); font-size: 1rem; line-height: 1.45; }

/* Stats were two naked numbers floating under the buttons. Cards, like the
   app shows. */
.jd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
            margin: 1.5rem 0 1rem; }
.jd-stats div { text-align: center; background: var(--panel);
                border: 1px solid var(--line); border-radius: var(--radius);
                padding: 0.9rem 0.75rem; }
.jd-stats strong { display: block; font-size: 1.6rem; font-weight: 700;
                   line-height: 1.1; }
.jd-stats span { color: var(--muted); font-size: 0.75rem;
                 letter-spacing: 0.04em; text-transform: uppercase; }

/* Tool tiles — the grouped row that replaced the loose buttons. */
.jd-tools { display: grid; gap: 0.75rem;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.jd-tile { display: flex; flex-direction: column; align-items: center;
           gap: 0.4rem; text-align: center; text-decoration: none;
           background: var(--panel); border: 1px solid var(--line);
           border-radius: var(--radius); padding: 1.1rem 0.75rem;
           color: var(--fg); font-size: 0.9rem; font-weight: 600; }
.jd-tile:hover { border-color: var(--accent); }
.jd-tile span { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.jd-tile .ico { font-size: 1.6rem; line-height: 1; }

/* This was `display:block; text-align:center` and nothing else, so it
   rendered as a default browser link — blue, or purple once visited —
   with its <strong> and <span> running together on one line. */
.jd-accountability { display: block; margin-top: 0.75rem; padding: 1rem 1.15rem;
                     background: var(--panel); border: 1px solid var(--line);
                     border-radius: var(--radius); text-decoration: none;
                     color: var(--fg); }
.jd-accountability:hover { border-color: var(--accent); }
.jd-accountability strong { display: block; font-size: 0.95rem;
                            margin-bottom: 0.15rem; }
.jd-accountability span { display: block; color: var(--muted);
                          font-size: 0.85rem; line-height: 1.4; }

/* The daily-action block. The buttons used to sit loose and left-aligned at
   whatever width their text happened to be. */
.jd-primary { background: var(--panel); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 1.25rem;
              margin-bottom: 1.25rem; }
.jd-primary > .primary, .jd-checkin > .primary { width: 100%; }
.jd-checkin button.primary { width: 100%; padding: 0.85rem 1rem;
                             font-size: 1rem; }

.jd-why { border-left: 3px solid var(--accent); }
.jd-why blockquote { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.jd-savings { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.jd-payoff { font-size: 2rem; font-weight: 800; color: var(--good); }

.jd-checkin label { color: var(--muted); }

/* `.jd-mood` is a <fieldset>. Flex alone does NOT remove the browser's
   default fieldset border, so the whole mood row shipped inside a visible
   1px box with the legend notched into it — the single ugliest thing on the
   page. Reset the element, then style the legend as a normal label. */
.jd-mood { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.jd-mood > legend { padding: 0; margin-bottom: 0.5rem; color: var(--muted);
                    font-size: 0.85rem; }
.jd-mood-row { display: grid; gap: 0.5rem;
               grid-template-columns: repeat(5, 1fr); }
.jd-mood-opt { position: relative; text-align: center; cursor: pointer;
               border: 1px solid var(--line); border-radius: var(--radius);
               padding: 0.65rem 0.3rem; color: var(--fg);
               transition: border-color 0.12s ease, background 0.12s ease; }
.jd-mood-opt:hover { border-color: var(--muted); }
.jd-mood-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
/* The emoji and the word were jammed together on one line and the word was
   in <em>, so it rendered italic: "\U0001F612Rough". Stack them, kill the italic. */
.jd-mood-opt > span { display: flex; flex-direction: column;
                      align-items: center; gap: 0.3rem; font-size: 1.35rem;
                      line-height: 1; }
.jd-mood-opt em { font-style: normal; font-size: 0.72rem; color: var(--muted);
                  letter-spacing: 0.02em; }
.jd-mood-opt:has(input:checked) { border-color: var(--accent);
                                  background: rgba(74, 222, 128, 0.12); }
.jd-mood-opt:has(input:checked) em { color: var(--fg); }
.jd-mood-opt:has(input:focus-visible) { outline: 2px solid var(--accent);
                                        outline-offset: 2px; }
.jd-place { margin-bottom: 1.1rem; }
.jd-place > label { display: block; margin-bottom: 0.15rem; }

/* Relapse is a quiet, deliberate action — not a second primary button
   competing with "Lock in day N". */
/* Sits BELOW the check-in card with real space above it — it is a different
   decision, not the third option in a row of three. Quiet until hovered. */
.jd-relapse { display: block; width: fit-content; margin: 1.25rem auto 0;
              padding: 0.5rem 1.1rem; border-radius: 999px;
              background: transparent; border: 1px solid var(--line);
              color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.jd-relapse:hover { border-color: var(--danger); color: var(--danger); }
.jd-crisis { border: 1px solid var(--danger); }
.jd-crisis a { color: var(--danger); }
.jd-delete { margin-top: 2rem; }
.jd-risk { border-left: 3px solid var(--warn); }

/* ---- community ---- */
.c-rail { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.25rem 0 0.75rem; }
.c-pill { flex: 0 0 auto; text-decoration: none; white-space: nowrap;
          border: 1px solid var(--line); border-radius: 999px;
          padding: 0.4rem 0.9rem; color: var(--muted); font-size: 0.85rem; }
.c-pill:hover { color: var(--fg); }
.c-pill.on { background: var(--accent); border-color: var(--accent);
             color: #06210f; font-weight: 700; }
.c-post header { display: flex; gap: 0.4rem; align-items: baseline;
                 flex-wrap: wrap; margin-bottom: 0.4rem; }
.c-photo { display: block; width: 100%; max-height: 420px; object-fit: cover;
           border-radius: var(--radius); margin: 0.75rem 0; }
.c-check { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0;
           color: var(--fg); font-size: 0.9rem; }
.c-check input { width: auto; margin: 0; }
.c-comment { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.c-comment input { flex: 1 1 auto; margin: 0; }
.c-thread { list-style: none; margin: 0.75rem 0 0; padding: 0.75rem 0 0;
            border-top: 1px solid var(--line); }
.c-thread li { padding: 0.35rem 0; font-size: 0.9rem; line-height: 1.45; }
.c-thread strong { margin-right: 0.4rem; }

/* ---- achievements gallery ---- */
.ach-grid { display: grid; gap: 1rem;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ach-card { text-align: center; margin: 0; }
.ach-days { margin: 0; font-size: 3rem; line-height: 1; font-weight: 800;
            color: var(--accent); }
.ach-unit { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.8rem;
            text-transform: uppercase; letter-spacing: 0.08em; }
.ach-card h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.ach-share { color: var(--accent); text-decoration: none; font-size: 0.9rem; }

/* ---- buddies + referrals ---- */
.bd-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
          padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.bd-row:last-child { border-bottom: 0; }
.bd-row > div { flex: 1 1 200px; min-width: 0; }
.bd-row form { margin: 0; }
.bd-code { display: inline-block; max-width: 100%; overflow-wrap: anywhere;
           background: var(--bg); border: 1px solid var(--line);
           border-radius: 8px; padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.ref-code { font-size: 2rem; font-weight: 800; letter-spacing: 0.15em;
            color: var(--accent); margin: 0.5rem 0; }

/* ---- account deletion ---- */
.danger-panel { border: 1px solid var(--danger); }
.danger-panel h2 { color: var(--danger); }
.da-list { margin: 0.5rem 0 1rem; padding-left: 1.2rem; line-height: 1.7; }
.warn-note { border-left: 3px solid var(--warn); padding-left: 0.75rem;
             color: var(--muted); font-size: 0.9rem; }

/* Pending-deletion banner (base.html). Sticky across every page because the
   grace window is irreversible once it closes and signing in does NOT cancel. */
.pending-delete { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
                  border: 1px solid var(--danger); border-radius: var(--radius);
                  background: rgba(248, 113, 113, 0.10); padding: 0.9rem 1.1rem;
                  margin: 0 0 1rem; font-size: 0.9rem; }
.pending-delete form { margin: 0 0 0 auto; }

/* Link-styled primary buttons need the same full-width treatment as real
   buttons on phones, or CTAs sit inline and look broken next to them. */
@media (max-width: 560px) {
  a.primary, a.danger { display: block; width: 100%; text-align: center; }
}

/* ===================================================================
   Marketing landing page (templates/index.html)
   -------------------------------------------------------------------
   Scoped under .mk so nothing here can leak into the signed-in app.
   Uses the same palette variables as the rest of the sheet; the only
   additions are the wide type scale a landing page needs.

   No JS: the FAQ is native <details>, which matters because the CSP is
   script-src 'self' and this page must work with nothing loaded.
   =================================================================== */

.mk {
  /* Break out of the app's narrow content column — a landing page wants
     full-bleed bands. `main` centres at a reading width; this undoes it. */
  margin: -1rem calc(50% - 50vw) 0;
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
}
.mk section { padding: clamp(3rem, 8vw, 6.5rem) clamp(1.25rem, 6vw, 4rem); }
.mk h1, .mk h2, .mk h3 { line-height: 1.15; letter-spacing: -0.02em; }
.mk h1 { font-size: clamp(2.4rem, 6.5vw, 4.25rem); margin: 0 0 1rem; font-weight: 800; }
.mk h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); margin: 0 0 0.6rem; font-weight: 700; }
.mk h3 { font-size: 1.05rem; margin: 0 0 0.4rem; font-weight: 650; }
.mk p  { line-height: 1.6; }

.mk-eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  font-weight: 700; color: var(--accent); margin: 0 0 0.75rem;
}
.mk-lede { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--muted);
           max-width: 34rem; margin: 0 0 1.75rem; }
.mk-sub  { color: var(--muted); max-width: 42rem; margin: 0 0 2.25rem;
           font-size: 1.02rem; }
.mk-fineprint { color: var(--muted); font-size: 0.85rem; margin: 0.9rem 0 0; }
.mk-note { color: var(--muted); font-size: 0.92rem; border-left: 2px solid var(--accent);
           padding-left: 0.85rem; margin-top: 1.25rem; }

/* ---- calls to action ---- */
.mk-cta, .mk-cta-ghost {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: 0.85rem 1.6rem; border-radius: 999px; white-space: nowrap;
  font-size: 0.98rem; transition: transform 0.12s ease, background 0.12s ease;
}
.mk-cta { background: var(--accent); color: #06210f; }
.mk-cta:hover { transform: translateY(-1px); background: #6ee79b; }
.mk-cta-ghost { border: 1px solid var(--line); color: var(--fg); }
.mk-cta-ghost:hover { border-color: var(--accent); color: var(--accent); }
.mk-cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* ---- hero ---- */
.mk-hero {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(3rem, 9vw, 7rem) !important;
}
@media (min-width: 900px) {
  .mk-hero { grid-template-columns: 1.05fr 1fr; }
}
.mk-hero-art img, .mk-split-art img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--line);
}
.mk-hero-art-wide { max-width: 46rem; margin-inline: auto; }

/* ---- alternating band background ---- */
.mk-band-alt { background: var(--panel); }

/* ---- numbered steps ---- */
.mk-steps { list-style: none; margin: 0; padding: 0;
            display: grid; gap: 1.5rem;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mk-step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: #06210f; font-weight: 800;
  font-size: 0.9rem; margin-bottom: 0.9rem;
}
.mk-steps p { color: var(--muted); margin: 0; }

/* ---- category chips ---- */
.mk-chips { list-style: none; margin: 0; padding: 0;
            display: flex; flex-wrap: wrap; gap: 0.6rem; }
.mk-chips li {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1.05rem; font-size: 0.92rem; color: var(--fg);
  background: var(--bg);
}

/* ---- feature cards ---- */
.mk-grid { display: grid; gap: 1.1rem;
           grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mk-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem;
}
.mk-band-alt .mk-card { background: var(--bg); }
.mk-card p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ---- image + copy splits ---- */
.mk-split { display: grid; gap: clamp(1.75rem, 5vw, 3.5rem); align-items: center;
            grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .mk-split { grid-template-columns: 1fr 1fr; }
  /* Reverse puts the art on the right without reordering the DOM, so the
     reading order stays copy-then-image for screen readers. */
  .mk-split-rev .mk-split-art { order: 2; }
}
.mk-split-copy p { color: var(--muted); max-width: 32rem; }

/* ---- pricing ---- */
.mk-tiers { display: grid; gap: 1.25rem;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            max-width: 56rem; }
.mk-tier { background: var(--panel); border: 1px solid var(--line);
           border-radius: var(--radius); padding: 1.75rem;
           display: flex; flex-direction: column; }
.mk-tier-hi { border-color: var(--accent); }
.mk-price { font-size: 2.6rem; font-weight: 800; margin: 0.35rem 0 0;
            line-height: 1; }
.mk-price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.mk-tier-sub { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 1.1rem; }
.mk-tier ul { list-style: none; margin: 0 0 1.5rem; padding: 0;
              display: grid; gap: 0.55rem; }
.mk-tier li { color: var(--muted); font-size: 0.94rem; padding-left: 1.35rem;
              position: relative; }
.mk-tier li::before { content: "✓"; position: absolute; left: 0;
                      color: var(--accent); font-weight: 700; }
.mk-tier-cta { margin-top: auto; text-align: center; }

/* ---- FAQ (native <details>, no JS) ---- */
.mk-faq { max-width: 46rem; display: grid; gap: 0.5rem; }
.mk-faq details { border: 1px solid var(--line); border-radius: var(--radius);
                  background: var(--panel); }
.mk-faq summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600;
                  list-style: none; }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: "+"; float: right; color: var(--accent);
                         font-weight: 700; }
.mk-faq details[open] summary::after { content: "–"; }
.mk-faq details p { margin: 0; padding: 0 1.25rem 1.15rem; color: var(--muted); }

/* ---- safety block ---- */
.mk-safety { background: var(--panel); border-top: 1px solid var(--line); }
.mk-safety p { color: var(--muted); max-width: 46rem; }
.mk-safety-lines { line-height: 2; }
.mk-safety a { color: var(--accent); }

/* ---- final CTA ---- */
.mk-final { text-align: center; }
.mk-final p { color: var(--muted); margin: 0 0 1.75rem; }
.mk-final .mk-fineprint { margin-top: 1.25rem; }
.mk-final a:not(.mk-cta) { color: var(--accent); }

@media (max-width: 560px) {
  .mk-cta, .mk-cta-ghost { display: block; width: 100%; text-align: center; }
  .mk-cta-row { flex-direction: column; align-items: stretch; }
}

/* ===================================================================
   Brand mark
   -------------------------------------------------------------------
   The logo is the app icon's mark — a checkmark whose tail is a lit
   match — extracted from AppIcon-1024.png to a transparent PNG
   (app/static/brand/mark-*.png) so it composites on any surface
   instead of carrying the icon's dark square around with it.
   =================================================================== */

.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-mark { width: 1.65rem; height: 1.65rem; display: block; }

.ahd-footer { text-align: center; padding: 2rem 1rem; font-size: 0.8rem;
              display: flex; flex-direction: column; align-items: center;
              gap: 0.6rem; }
.ahd-footer p { margin: 0; opacity: 0.6; }
.ahd-footer a { color: inherit; }
.footer-mark { width: 1.75rem; height: 1.75rem; opacity: 0.5; }

/* Landing-page placements. The hero mark is the one that has to look
   deliberate — everything else is a quiet repeat. */
.mk-hero-mark { width: clamp(3.25rem, 6vw, 4.5rem); height: auto;
                display: block; margin: 0 0 1.25rem; }
.mk-final-mark { width: 4rem; height: auto; margin: 0 auto 1.5rem; display: block; }
.mk-section-mark { width: 2.5rem; height: auto; margin: 0 auto 1rem; display: block;
                   opacity: 0.85; }
.mk-band-centered { text-align: center; }
.mk-band-centered .mk-sub-centered { margin-inline: auto; }

/* ---- My Journey list: each card is a link to its detail page -----------
   Matches iOS, where DashboardView wraps TrackerRow in a NavigationLink.
   The card previously carried inline buttons and linked nowhere, which left
   the whole /journeys/<id> screen unreachable. */
.j-card-link {
  display: flex; align-items: center; gap: 1rem; text-decoration: none;
  color: inherit; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; margin: 0.75rem 0;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.j-card-link:hover, .j-card-link:focus-visible {
  border-color: var(--accent); transform: translateY(-1px);
}
.j-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.j-card-main { flex: 1 1 auto; min-width: 0; }
.j-card-main h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.j-card-main .j-target { margin: 0 0 0.5rem; }
.j-card-main .encouragement { margin: 0 0 0.4rem; }
.j-card-main .meta { margin: 0; }
.j-card-count { display: flex; flex-direction: column; align-items: center;
                flex: 0 0 auto; line-height: 1; }
.j-card-count strong { font-size: 2.4rem; font-weight: 800; color: var(--accent);
                       font-variant-numeric: tabular-nums; }
.j-card-count span { color: var(--muted); font-size: 0.75rem; margin-top: 0.2rem; }
.j-card-go { color: var(--muted); font-size: 1.5rem; margin-top: 0.35rem; }

/* ---- Journey detail: top bar + management block ---- */
.jd-topbar { display: flex; align-items: center; justify-content: space-between;
             gap: 1rem; margin-bottom: 0.5rem; }
.jd-label { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0.25rem 0 0;
            letter-spacing: -0.01em; }
.jd-manage { margin-top: 2rem; }
.jd-manage-actions { display: flex; gap: 0.75rem; flex-wrap: wrap;
                     margin-top: 0.9rem; }
.jd-manage-actions form { margin: 0; }

/* ===================================================================
   Profile — header, stats, whys  (iOS ProfileView parity)
   =================================================================== */
.pf-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
           margin: 0.5rem 0 1.5rem; }
.pf-avatar { flex: 0 0 auto; width: 112px; height: 112px; border-radius: 50%;
             overflow: hidden; background: var(--panel);
             border: 1px solid var(--line); display: grid; place-items: center; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-avatar-empty { font-size: 2.6rem; font-weight: 800; color: var(--muted); }
.pf-head-copy h1 { margin: 0 0 0.2rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.pf-head-copy .meta { margin: 0 0 0.6rem; }
.pf-badge { display: inline-block; font-size: 0.75rem; font-weight: 700;
            padding: 0.3rem 0.75rem; border-radius: 999px;
            background: var(--accent); color: #06210f; text-decoration: none; }
.pf-badge-free { background: transparent; color: var(--muted);
                 border: 1px solid var(--line); }
.pf-badge-free:hover { color: var(--accent); border-color: var(--accent); }

.pf-stats { display: grid; gap: 0.75rem; margin-bottom: 1.25rem;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.pf-stats div { background: var(--panel); border: 1px solid var(--line);
                border-radius: var(--radius); padding: 0.9rem; text-align: center; }
.pf-stats strong { display: block; font-size: 1.7rem; color: var(--accent);
                   font-variant-numeric: tabular-nums; line-height: 1.1; }
.pf-stats span { color: var(--muted); font-size: 0.75rem; }

.pf-tiles { display: grid; gap: 0.75rem; margin-bottom: 1.25rem;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pf-photo-form { display: flex; gap: 0.75rem; align-items: center;
                 flex-wrap: wrap; }
.pf-why { border-top: 1px solid var(--line); padding-top: 1rem;
          margin-top: 1rem; }
.pf-why:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.pf-why h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.pf-why h3 a { color: var(--fg); text-decoration: none; }
.pf-why h3 a:hover { color: var(--accent); }

/* ---- Settings rows ---- */
.st-rows { margin: 0 0 1rem; }
.st-rows div { display: flex; justify-content: space-between; gap: 1rem;
               padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.st-rows div:last-child { border-bottom: 0; }
.st-rows dt { color: var(--muted); font-size: 0.9rem; margin: 0; }
.st-rows dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }

/* ---- Account activity rows ---- */
.ac-row { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.ac-row:last-child { border-bottom: 0; }
.ac-row strong { text-transform: capitalize; }
.ac-ua { font-size: 0.75rem; opacity: 0.75; overflow-wrap: anywhere; }

/* ---- Check-in location chips (no JS — labels driving hidden radios) ---- */
.jd-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.jd-chip { position: relative; }
.jd-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.jd-chip span { display: inline-block; border: 1px solid var(--line);
                border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer;
                font-size: 0.88rem; color: var(--fg); }
.jd-chip input:checked + span { background: var(--accent); color: #06210f;
                                border-color: var(--accent); font-weight: 600; }
.jd-chip input:focus-visible + span { outline: 2px solid var(--accent);
                                      outline-offset: 2px; }

/* ===================================================================
   Crisis gate — the self-harm interstitial (iOS CrisisResourcesSheet)
   =================================================================== */
.cg { max-width: 44rem; margin-inline: auto; }
.cg h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2;
         margin: 0 0 0.75rem; }
.cg-lede { color: var(--muted); line-height: 1.6; margin: 0 0 1.5rem; }
.cg-resources { display: grid; gap: 0.75rem; margin-bottom: 1.25rem; }
.cg-res { display: block; text-decoration: none; background: var(--panel);
          border: 1px solid var(--line); border-radius: var(--radius);
          padding: 1rem 1.15rem; }
.cg-res:hover { border-color: var(--accent); }
.cg-res strong { display: block; color: var(--accent); font-size: 1.02rem;
                 margin-bottom: 0.2rem; }
.cg-res span { color: var(--muted); font-size: 0.9rem; }
.cg-emergency { border-left: 3px solid var(--danger); padding-left: 0.85rem;
                margin: 1.25rem 0; }
.cg-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
              margin: 1.75rem 0 1rem; }
.cg-actions form { margin: 0; }
.cg-note { border-top: 1px solid var(--line); padding-top: 1rem; }

/* Onboarding category picker — same shape as the tone grid above it. */
.cat-grid { display: grid; gap: 0.5rem; margin: 0.5rem 0 1.25rem;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cat { position: relative; display: block; }
.cat input { position: absolute; opacity: 0; }
.cat span { display: block; border: 1px solid var(--line); border-radius: var(--radius);
            padding: 0.8rem 0.9rem; cursor: pointer; }
.cat strong { display: block; font-size: 0.95rem; }
.cat em { display: block; font-style: normal; color: var(--muted);
          font-size: 0.82rem; margin-top: 2px; }
.cat input:checked + span { border-color: var(--accent);
                            background: rgba(74, 222, 128, 0.08); }
.cat input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- triggers
   Server-rendered bar chart. The Triggers page used to be a wall of
   paragraphs ("09:00 — 4 check-ins, 25% rough" x24), which is a data dump,
   not an insight. Widths come from inline styles, which the CSP's
   style-src 'unsafe-inline' permits — no JavaScript needed. */
.tg-chart { display: grid; gap: 0.35rem; margin-top: 0.75rem; }
.tg-legend { margin: 0.25rem 0 0; }
.tg-row { display: grid; align-items: center; gap: 0.6rem;
          grid-template-columns: 3.4rem 1fr 2.6rem 1.8rem; }
.tg-label { color: var(--muted); font-size: 0.8rem;
            font-variant-numeric: tabular-nums; }
.tg-track { background: var(--line); border-radius: 999px; height: 0.55rem;
            overflow: hidden; }
.tg-fill { display: block; height: 100%; border-radius: 999px;
           background: var(--accent); }
.tg-fill.tg-warm { background: var(--warn); }
.tg-fill.tg-hot  { background: var(--danger); }
.tg-val { font-size: 0.8rem; text-align: right;
          font-variant-numeric: tabular-nums; }
.tg-n { color: var(--muted); font-size: 0.7rem; text-align: right;
        font-variant-numeric: tabular-nums; }
.tg-row-peak .tg-label, .tg-row-peak .tg-val { color: var(--fg);
                                               font-weight: 600; }
.tg-pill { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
           font-size: 0.75rem; font-weight: 600;
           background: var(--line); color: var(--fg); }
.tg-pill-hot { background: rgba(248,113,113,0.18); color: var(--danger); }

/* ----------------------------------------------------- archived journeys */
.arch-list { display: grid; gap: 0.75rem; }
.arch-row { display: flex; align-items: center; justify-content: space-between;
            gap: 1rem; flex-wrap: wrap; }
.arch-meta h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.arch-actions { display: flex; align-items: center; gap: 0.6rem; }
.arch-actions form { margin: 0; }

/* ------------------------------------- step-up / consent interstitials
   Shared by the delete re-auth wall and the sponsor-accept page. */
.gate { max-width: 34rem; margin: 1rem auto; }
.gate-h { margin: 0 0 0.5rem; font-size: 1.45rem; }
.gate-lead { margin: 0 0 0.75rem; }
.gate-steps { color: var(--muted); font-size: 0.85rem; line-height: 1.6;
              padding-left: 1.1rem; margin: 1rem 0 0; }
.gate-out { margin-top: 1.25rem; }
.ach-live { color: var(--warn); }
.jd-share-on { display: inline; margin: 0; }
.jd-share-on button { padding: 0.35rem 0.7rem; }

/* ------------------------------------------------------------ share flow
   Web twin of iOS ShareStreakView. The card renderer has existed since the
   iOS share feature shipped; the web never displayed it. */
.sh-wrap { text-align: center; margin-bottom: 1.75rem; }
.sh-card { display: block; width: 100%; max-width: 380px; height: auto;
           aspect-ratio: 1 / 1; margin: 0.75rem auto 1.1rem;
           border-radius: var(--radius); border: 1px solid var(--line);
           background: var(--panel); }
.sh-actions { display: flex; gap: 0.6rem; justify-content: center;
              flex-wrap: wrap; }
.sh-btn { min-width: 11rem; text-align: center; text-decoration: none;
          padding: 0.8rem 1.2rem; border-radius: var(--radius);
          font-weight: 600; display: inline-block; }
a.sh-btn.primary { background: var(--accent); color: #08120c; }
.sh-privacy { margin-top: 1rem; }
.sh-link h2 { margin-top: 0; font-size: 1.05rem; }
.sh-copy { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.sh-copy input { flex: 1 1 auto; min-width: 0; background: var(--bg);
                 border: 1px solid var(--line); border-radius: var(--radius);
                 color: var(--fg); padding: 0.6rem 0.75rem;
                 font-size: 0.85rem; font-family: inherit; }
.sh-copy button { flex: 0 0 auto; }
.sh-copy button.sh-ok { border-color: var(--accent); color: var(--accent); }
.sh-targets { display: flex; flex-wrap: wrap; gap: 0.5rem;
              margin: 0.75rem 0 0.5rem; }
.sh-target { display: inline-block; padding: 0.5rem 0.9rem;
             border: 1px solid var(--line); border-radius: 999px;
             color: var(--fg); text-decoration: none; font-size: 0.85rem; }
.sh-target:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------- journey timeline
   Web twin of iOS JourneyView / JourneyTimeline. */
.jt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem;
            margin: 1rem 0 1.5rem; }
.jt-stats div { text-align: center; background: var(--panel);
                border: 1px solid var(--line); border-radius: var(--radius);
                padding: 0.85rem 0.5rem; }
.jt-stats strong { display: block; font-size: 1.5rem; font-weight: 700;
                   color: var(--accent); line-height: 1.1; }
.jt-stats span { color: var(--muted); font-size: 0.72rem;
                 letter-spacing: 0.04em; text-transform: uppercase; }
.jt-hint { letter-spacing: 0.06em; text-transform: uppercase;
           font-size: 0.7rem; margin: 0.5rem 0 0.6rem; }
.jt-quits { display: grid; gap: 0.6rem; margin-bottom: 1.5rem;
            grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.jt-quit { display: flex; align-items: baseline; gap: 0.5rem;
           background: var(--panel); border: 1px solid var(--line);
           border-radius: var(--radius); padding: 0.8rem 0.9rem;
           text-decoration: none; color: var(--fg); }
.jt-quit:hover { border-color: var(--accent); }
.jt-quit strong { font-size: 1.35rem; color: var(--accent); }
.jt-quit span { color: var(--muted); font-size: 0.85rem; }
.jt-line { list-style: none; margin: 0; padding: 0; }
.jt-node { display: grid; grid-template-columns: 30px 1fr; gap: 0.9rem;
           position: relative; padding-bottom: 1.4rem; }
/* The connector line between nodes — the visual spine of the timeline. */
.jt-node:not(.jt-last)::before { content: ""; position: absolute;
    left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.jt-dot { width: 30px; height: 30px; border-radius: 999px;
          display: grid; place-items: center; font-size: 0.8rem;
          background: var(--line); color: var(--fg); position: relative;
          z-index: 1; }
.jt-today .jt-dot { background: var(--accent); color: #08120c; }
.jt-milestone .jt-dot { background: var(--warn); color: #1a1400; }
.jt-commit .jt-dot { background: var(--panel); border: 1px solid var(--line); }
.jt-body { padding-top: 0.2rem; }
.jt-tag { color: var(--muted); font-size: 0.65rem; letter-spacing: 0.08em;
          margin: 0 0 0.15rem; }
.jt-title { margin: 0 0 0.2rem; font-weight: 600; font-size: 0.95rem; }
.jt-meta { margin: 0; color: var(--muted); font-size: 0.78rem; }

/* ----------------------------------------------- post-check-in confirmation */
.cd-wrap { text-align: center; padding: 2rem 1.25rem; }
.cd-day { margin: 0; font-size: 3.5rem; line-height: 1; font-weight: 800;
          color: var(--accent); }
.cd-h { margin: 0.4rem 0 0.3rem; font-size: 1.3rem; }
.cd-lead { margin: 0 auto 1.4rem; max-width: 26rem; color: var(--muted); }
.cd-actions { display: flex; gap: 0.6rem; justify-content: center;
              flex-wrap: wrap; }
.cd-btn { min-width: 11rem; text-align: center; text-decoration: none;
          padding: 0.8rem 1.1rem; border-radius: var(--radius);
          font-weight: 600; display: inline-block; }
a.cd-btn.primary { background: var(--accent); color: #08120c; }
.cd-foot { margin-top: 1.2rem; }
/* A quiet text link, not a second slab. Three stacked full-width bars made
   the primary action, the opt-out and the destructive action all shout at the
   same volume. */
.jd-skip { display: block; margin: 0.55rem auto 0; width: auto;
           background: none; border: 0; padding: 0.35rem 0.5rem;
           color: var(--muted); font-size: 0.85rem; text-decoration: underline;
           text-underline-offset: 3px; cursor: pointer; }
.jd-skip:hover { color: var(--fg); }

/* ------------------------------------------------------------- off-ramps */
.or-card h3 { display: flex; align-items: center; gap: 0.5rem;
              flex-wrap: wrap; margin-top: 0; }
.or-badge { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem;
            border-radius: 999px; background: var(--line); color: var(--fg); }
.or-badge-crisis { background: rgba(248,113,113,0.18); color: var(--danger); }
.or-actions { display: flex; align-items: center; gap: 0.6rem;
              flex-wrap: wrap; margin-top: 0.8rem; }
.or-actions form { margin: 0; }
.or-actions .primary { text-decoration: none; display: inline-block;
                       padding: 0.55rem 1rem; border-radius: var(--radius);
                       background: var(--accent); color: #08120c;
                       font-weight: 600; }
.or-gate { max-width: 34rem; margin: 1rem auto; }
.or-gate .primary { display: inline-block; text-decoration: none;
                    padding: 0.8rem 1.2rem; border-radius: var(--radius);
                    background: var(--accent); color: #08120c;
                    font-weight: 600; }
.or-meta { margin-top: -0.4rem; }
.or-min { color: var(--fg); }
.or-body { font-size: 1.05rem; line-height: 1.6; }
.or-done { width: 100%; padding: 0.85rem; }
.or-reminder { margin-top: 1rem; }

/* ------------------------------------------------------ encouragement inbox */
.en-list { list-style: none; margin: 0; padding: 0; display: grid;
           gap: 0.75rem; }
.en-item { border-left: 3px solid var(--accent); }
.en-body { margin: 0 0 0.4rem; font-size: 1.02rem; line-height: 1.5; }
.en-meta { margin: 0; }

/* --------------------------------------------------------------- paywall */
.pw-h { margin-top: 0; font-size: 1.05rem; }
.pw-benefits { margin: 0.5rem 0 1.25rem; padding-left: 1.15rem;
               line-height: 1.65; }
.pw-benefits li { margin-bottom: 0.3rem; }
.pw-price { margin: 0 0 1rem; font-size: 1.6rem; }
.pw-price strong { color: var(--accent); }
.pw-cta { width: 100%; padding: 0.9rem; font-size: 1rem; }
.pw-legal { margin-top: 1.25rem; padding-top: 1rem;
            border-top: 1px solid var(--line); }
.pw-legal p { margin: 0 0 0.5rem; }
.pw-links { display: flex; gap: 0.6rem; font-size: 0.8rem; font-weight: 600; }
.pw-cross { margin-top: 1rem; padding: 0.8rem 0.9rem; border-radius: var(--radius);
            background: var(--panel); border: 1px solid var(--line); }
.pw-badge { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px;
            background: rgba(74,222,128,0.16); color: var(--accent);
            font-size: 0.8rem; font-weight: 700; margin: 0 0 0.6rem; }
.pw-manage { margin-top: 1rem; }

/* -------------------------------------------------------------- feed ads */
.c-ad { border: 1px dashed var(--line); }
.c-ad-tag { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.68rem;
            font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.c-ad-h { margin: 0 0 0.35rem; font-size: 1.05rem; }
.c-ad-cta { text-decoration: none; display: inline-block;
            padding: 0.5rem 0.9rem; border-radius: var(--radius);
            background: var(--accent); color: #08120c; font-weight: 600;
            font-size: 0.9rem; }
.c-ad-report { font-size: 0.8rem; }

/* ------------------------------------------------------------ avatar crop */
.av-editor { display: none; margin-top: 0.75rem; }
.av-editor.av-open { display: block; }
.av-stage { position: relative; width: 240px; height: 240px; margin: 0 auto;
            border-radius: 999px; overflow: hidden; background: var(--bg);
            border: 1px solid var(--line); cursor: grab; touch-action: none; }
.av-stage canvas { display: block; width: 100%; height: 100%; }
.av-controls { display: flex; align-items: center; gap: 0.6rem;
               margin: 0.75rem auto 0; max-width: 240px; }
.av-controls input[type="range"] { flex: 1 1 auto; }
.av-hint { text-align: center; margin: 0.5rem 0 0; }
