/* Theme: "Warm Notebook" (design/style-templates.html, option 3).
   Dotted journal paper, a strip of tape on the big cards, a squiggle under headlines,
   earthy colors, Fraunces for headings and Lexend for text.
   The old token names are kept so the views don't need changes:
   brand = terracotta, pink = rose clay, sun = mustard, mint = sage, sky = slate blue. */
:root {
  --bg: #efe5d3;
  --dot: #dbcdb4;
  --surface: #f7efe1;
  --surface-2: #e9ddc8;
  --ink: #2e2a26;
  --ink-2: #62594f;
  --ink-3: #74685c;
  --line: #dccdb4;
  --brand: #a8432d;
  --brand-ink: #ffffff;
  --brand-soft: #f7e4da;
  --pink: #c8553d;
  --pink-soft: #f5ddd4;
  --pink-ink: #9c3f2b;
  --sun: #e0a458;
  --sun-soft: #f8ead3;
  --sun-ink: #8a5a14;
  --mint: #6b8f71;
  --mint-soft: #e4ece3;
  --mint-ink: #46684c;
  --sky: #5b7c99;
  --sky-soft: #e3e9ef;
  --sky-ink: #3e5b74;
  --danger: #b23b32;
  --danger-soft: #f7e1dd;
  --tape: rgba(224, 164, 88, .6);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 2px 0 var(--line);
  --font-body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --tabbar-h: 68px;
  /* Always the cream notebook, even when the phone or computer is in dark mode. */
  color-scheme: light only;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 16px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.18; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.7rem); margin-top: 1.4em; font-style: italic; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-tag { font-family: var(--font-body); font-size: .74rem; font-weight: 400; color: var(--ink-2); letter-spacing: .01em; }
@media (max-width: 520px) { .brand-tag { display: none; } }
.hero-tag { display: inline-block; margin: 0 0 12px; font-weight: 600; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.flyer-tag { font-family: var(--font-head); font-weight: 600; color: #b84a33; font-size: 1.2rem; margin: 0; }
.mode-toggle {
  border: 1.5px solid var(--ink); background: var(--bg); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: .88rem;
}
.mode-toggle:hover { background: var(--surface-2); }
.topbar-actions { display: flex; gap: 8px; }
.mode-toggle { white-space: nowrap; }
.mode-toggle .short { display: none; }
@media (max-width: 560px) {
  .mode-toggle { padding: 6px 10px; }
  .mode-toggle .long { display: none; }
  .mode-toggle .short { display: inline; }
}

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1.5px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: .76rem; font-weight: 400;
}
.tabbar .ti { display: grid; place-items: center; line-height: 1; }
.ico { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a:hover { color: var(--ink-2); }
.tabbar a.active { color: var(--brand); font-weight: 600; }
.tabbar a.active span:last-child { text-decoration: underline wavy var(--brand); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }

/* On bigger screens the tabs move up into the header as a plain row of links, so pages get the full width. */
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .topbar { padding-left: 28px; padding-right: 28px; gap: 20px; }
  .tabbar {
    position: static; display: flex; gap: 4px; height: auto; padding: 0;
    background: none; border: 0; margin: 0 auto;
  }
  .tabbar a { flex-direction: row; gap: 7px; padding: 8px 12px; font-size: .95rem; color: var(--ink-2); border-radius: var(--radius-sm); }
  .tabbar a:hover { background: var(--surface-2); color: var(--ink); }
  .tabbar .ico { width: 19px; height: 19px; }
  .toast { bottom: 24px; }
}
@media (min-width: 1000px) and (max-width: 1239px) {
  .brand-tag { display: none; }
  .mode-toggle .long { display: none; }
  .mode-toggle .short { display: inline; }
}

/* Layout */
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin-bottom: 10px; font-weight: 600; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
a.card { display: block; text-decoration: none; color: inherit; font-weight: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--ink-3); transform: rotate(-.4deg); }
.card h3 { margin-bottom: .25em; }
.card p:last-child { margin-bottom: 0; }
.card .emoji { font-size: 1.5rem; line-height: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); margin-bottom: 10px; }
.card.row .emoji { margin-bottom: 0; flex-shrink: 0; }
/* Tinted cards stay paper; the color goes in the icon circle. Tinted cards with no icon keep a soft wash. */
.card[class*="tint-"] { background: var(--surface); }
.card.tint-brand .emoji { background: var(--brand-soft); }
.card.tint-pink .emoji { background: var(--pink-soft); }
.card.tint-sun .emoji { background: var(--sun-soft); }
.card.tint-mint .emoji { background: var(--mint-soft); }
.card.tint-sky .emoji { background: var(--sky-soft); }
/* Duotone icons: a soft fill under the line drawing, both in the card's ink color. */
.card .emoji { color: var(--brand); }
.card .emoji .ico { width: 26px; height: 26px; stroke-width: 1.6; }
.ico .a { fill: currentColor; stroke: none; opacity: .2; }
.card.tint-pink .emoji { color: var(--pink-ink); }
.card.tint-sun .emoji { color: var(--sun-ink); }
.card.tint-mint .emoji { color: var(--mint-ink); }
.card.tint-sky .emoji { color: var(--sky-ink); }

/* Home grid: two wide featured cards, then smaller ones three to a row. */
.grid-feature { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid-feature { grid-template-columns: repeat(6, 1fr); }
  .grid-feature > .card { grid-column: span 2; }
  .grid-feature > .card.featured { grid-column: span 3; }
}
.card.featured { position: relative; overflow: hidden; padding: 24px 24px 26px; min-height: 190px; }
.card.featured .emoji { width: 60px; height: 60px; margin-bottom: 14px; }
.card.featured .emoji .ico { width: 32px; height: 32px; }
.card.featured h3 { font-size: 1.45rem; }
.card.featured p { max-width: 30ch; position: relative; }
.card.featured .spot { position: absolute; right: -18px; bottom: -22px; width: 150px; height: 150px; stroke-width: 1; opacity: .16; transform: rotate(-8deg); pointer-events: none; }
.card.featured.tint-brand .spot { color: var(--brand); }
.card.featured.tint-sun .spot { color: var(--sun-ink); }
.card.featured .spot .a { opacity: .35; }

.card.tint-brand:not(:has(.emoji)) { background: var(--brand-soft); }
.card.tint-pink:not(:has(.emoji)) { background: var(--pink-soft); }
.card.tint-sun:not(:has(.emoji)) { background: var(--sun-soft); }
.card.tint-mint:not(:has(.emoji)) { background: var(--mint-soft); }
.card.tint-sky:not(:has(.emoji)) { background: var(--sky-soft); }

/* Big header cards: a page of paper with a strip of tape, or a solid colored page. */
.hero {
  border-radius: var(--radius-sm); padding: 34px 26px 28px; color: var(--ink); position: relative; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; top: -6px; left: 50%; width: 96px; height: 24px; margin-left: -48px;
  background: var(--tape); transform: rotate(-3deg);
}
.hero h1 { color: inherit; font-weight: 600; }
.hero h1::after {
  content: ''; display: block; width: 130px; height: 9px; margin-top: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Cpath d='M2 5 Q 12 0, 22 5 T 42 5 T 62 5 T 82 5 T 102 5 T 118 5' fill='none' stroke='%23e0a458' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.hero p { max-width: 580px; font-size: 1.05rem; }
.hero .btn.ghost { color: var(--ink); border-color: var(--ink); }
.hero.hero-sage, .hero.hero-slate, .hero.hero-clay { color: #fffdf8; border-color: transparent; box-shadow: none; }
.hero.hero-sage { background: #6b8f71; }
.hero.hero-slate { background: #5b7c99; }
.hero.hero-clay { background: #b84a33; }
.hero.hero-sage .btn, .hero.hero-slate .btn, .hero.hero-clay .btn { background: #fffdf8; color: #2e2a26; }
.hero.hero-sage .btn.ghost, .hero.hero-slate .btn.ghost, .hero.hero-clay .btn.ghost { background: transparent; color: #fffdf8; border-color: #fffdf8; }
.callout { border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; border-left: 4px solid var(--brand); background: var(--brand-soft); }
.callout.warn { border-color: var(--sun); background: var(--sun-soft); }
.callout.danger { border-color: var(--danger); background: var(--danger-soft); }
.callout.mint { border-color: var(--mint); background: var(--mint-soft); }
.callout p:last-child { margin: 0; }

/* Buttons & form */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: 6px; padding: 10px 18px;
  background: var(--brand); color: var(--brand-ink); font-weight: 500; cursor: pointer;
  text-decoration: none; min-height: 44px;
}
.btn:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { border: 0; background: transparent; cursor: pointer; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); font-weight: 700; font-size: .85rem; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=search], input[type=password], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); min-height: 46px;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { margin-top: 5px; width: 20px; height: 20px; accent-color: var(--brand); }

/* Chips / pills */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px;
  font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; color: var(--ink);
}
.chip { border-radius: 6px; font-weight: 500; }
.chip:hover { border-color: var(--ink-3); }
.chip.active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pill { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.mint { background: var(--mint-soft); color: var(--mint-ink); }
.pill.pink { background: var(--pink-soft); color: var(--pink-ink); }
.pill.sun { background: var(--sun-soft); color: var(--sun-ink); }
.pill.sky { background: var(--sky-soft); color: var(--sky-ink); }

/* Story */
.story-chapter { display: grid; grid-template-columns: 56px 1fr; gap: 14px; margin: 20px 0; }
.story-dot {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem;
  background: var(--surface); border: 1.5px solid var(--line); position: relative;
}
.story-chapter:not(:last-child) .story-dot::after {
  content: ''; position: absolute; top: 60px; left: 26px; width: 0; height: calc(100% + 120px);
  border-left: 2px dashed var(--line); z-index: -1;
}
.story-chapter .card { box-shadow: none; }
.quote { font-family: var(--font-head); font-style: italic; font-size: 1.3rem; color: var(--ink); border-left: 3px solid var(--pink); padding: 4px 0 4px 16px; margin: 14px 0; }

/* Accordion */
details.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; }
details.acc summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: '+'; font-size: 1.3rem; color: var(--brand); line-height: 1; }
details.acc[open] summary::after { content: '–'; }
details.acc .acc-body { padding: 0 16px 14px; }

ul.clean { padding-left: 1.2em; margin: 0 0 1em; }
ul.clean li { margin: 4px 0; }
ul.checks { list-style: none; padding: 0; }
ul.checks li { padding-left: 30px; position: relative; margin: 8px 0; }
ul.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--mint-soft); color: var(--mint-ink); font-weight: 700; display: grid; place-items: center; font-size: .8rem; }

/* Treatment table */
.tx { display: grid; gap: 12px; }
.tx .card { box-shadow: none; }
.tx-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }

/* Journey stepper */
.phases { display: grid; gap: 12px; }
.phase { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: center; }
.phase-num { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; }

/* State picker */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.state-grid a { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.state-grid a:hover { border-color: var(--ink-2); }
.state-grid a b { color: var(--brand); margin-right: 6px; }
.resource { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.resource:last-child { border-bottom: 0; }
.resource .ricon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--surface-2); }
.resource h4 { margin: 0 0 2px; font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.resource p { margin: 0 0 4px; color: var(--ink-2); font-size: .95rem; }

/* Community */
.room-list { display: grid; gap: 10px; }
.room { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center; }
.room .ricon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--brand-soft); }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin: 12px 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-color: var(--brand); }

.chat { display: flex; flex-direction: column; height: min(62vh, 560px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; grid-template-columns: 38px 1fr; gap: 10px; max-width: 88%; }
.msg.me { margin-left: auto; grid-template-columns: 1fr 38px; }
.msg.me .avatar { order: 2; }
.msg .bubble { background: var(--surface-2); border-radius: 16px; padding: 8px 12px; }
.msg.me .bubble { background: var(--brand); color: var(--brand-ink); }
.msg .who { font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 2px; }
.msg.me .who { color: inherit; opacity: .85; }
.msg .bubble p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.msg-actions { display: flex; gap: 2px; margin-top: 2px; }
.msg.me .msg-actions .iconbtn { color: inherit; opacity: .8; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; background: var(--sun-soft); flex-shrink: 0; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; }
.system-msg { text-align: center; font-size: .82rem; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 4px 12px; align-self: center; }

.thread { display: grid; grid-template-columns: 44px 1fr; gap: 12px; }
.thread + .thread { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.thread h4 { margin: 0 0 4px; font-size: 1.05rem; }
.thread-meta { font-size: .82rem; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.meetup { display: grid; grid-template-columns: 64px 1fr; gap: 14px; }
.datebox { width: 64px; border-radius: 10px; overflow: hidden; text-align: center; border: 1.5px solid var(--line); background: var(--surface); }
.datebox .m { background: var(--pink); color: #fff; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 2px; }
.datebox .d { font-family: var(--font-head); font-size: 1.6rem; font-weight: 600; line-height: 1.4; }

.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.avatar-pick button { font-size: 1.7rem; height: 54px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.avatar-pick button[aria-pressed=true] { border-color: var(--brand); background: var(--brand-soft); }

/* Quiz */
.quiz-opt { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 12px 16px; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.quiz-opt:hover { border-color: var(--ink-2); }
.quiz-opt.right { border-color: var(--mint); background: var(--mint-soft); }
.quiz-opt.wrong { border-color: var(--danger); background: var(--danger-soft); }

/* Toast & modal */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 520px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(30,20,10,.25); }
dialog::backdrop { background: rgba(30, 24, 16, .5); }
dialog .dlg { padding: 22px; }

.footer-note { margin-top: 36px; font-size: .85rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 14px; }
.footer-links { font-size: .85rem; color: var(--ink-3); margin-top: -6px; }
.legal { max-width: 70ch; }
.legal h2 { font-size: 1.3rem; }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: 4px; }

/* Moderation */
.mod-item { box-shadow: none; }
.mod-item.alert { border: 2px solid var(--danger); background: var(--danger-soft); }
pre.mod-text { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.pending-pill { display: inline-block; margin-top: 6px; }

/* Review badge */
.review-badge { font-size: .88rem; margin: 10px 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); }
.review-badge.ok { background: var(--mint-soft); color: var(--ink); }

/* Lessons */
ol.steps { padding-left: 1.4em; margin: 0; }
ol.steps li { margin: 10px 0; padding-left: 4px; }
ol.steps li::marker { font-weight: 700; color: var(--brand); }

/* Letters */
.letter-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .letter-layout { grid-template-columns: 340px 1fr; align-items: start; } }
pre.letter {
  white-space: pre-wrap; word-wrap: break-word; font-family: Georgia, 'Times New Roman', serif; font-size: .98rem; line-height: 1.6;
  background: #fff; color: #1b1b1b; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 24px; margin: 0; box-shadow: var(--shadow);
}

/* Tracker */
.mood-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood-pick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 2px; font-size: 1.7rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.mood-pick button span { font-size: .7rem; font-weight: 600; color: var(--ink-2); }
.mood-pick button[aria-checked=true] { border-color: var(--brand); background: var(--brand-soft); }
label.chip { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.tchart { width: 100%; height: auto; display: block; }
.tchart .grid-line { stroke: var(--line); stroke-width: 1; }
.tchart .axis { fill: var(--ink-2); font-size: 12px; font-family: var(--font-body); }
.tchart .line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tchart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }
.tentry { display: grid; grid-template-columns: auto 1fr; gap: 14px; box-shadow: none; }
.tentry:not(:has(.tphoto)) { grid-template-columns: 1fr; }
.tphoto { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.lines { border-bottom: 1px solid var(--line); height: 34px; }

/* Flyer */
.flyer { background: #fffdf8; color: #2e2a26; border-radius: 6px; padding: 32px 26px; text-align: center; border: 3px solid #b84a33; max-width: 720px; margin: 0 auto; }
.flyer h1 { color: #2e2a26; font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 10px 0 6px; }
.flyer-sub { font-size: 1.2rem; }
.flyer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; text-align: left; margin: 20px 0; }
.flyer-grid div { background: #f8ead3; border-radius: 4px; padding: 10px 14px; font-weight: 600; }
.flyer-qr { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.flyer-qr #qr { padding: 8px; background: #fff; border: 1.5px solid #e2d8c9; border-radius: 10px; min-width: 120px; min-height: 120px; display: grid; place-items: center; }
.flyer .muted { color: #6b6157; }

code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.print-only { display: none; }

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #444; --line: #ccc; --shadow: none; }
  body { padding: 0 !important; background: #fff !important; font-size: 12pt; }
  .hero::before, .hero h1::after { display: none; }
  .topbar, .tabbar, .toast, .no-print, .footer-note, .skip { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  .view { animation: none; }
  .card, .callout, details.acc { break-inside: avoid; box-shadow: none; }
  .hero { color: #000 !important; background: #efe8dc !important; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hero h1, .hero p { color: #000 !important; }
  details.acc > .acc-body { display: block; }
  pre.letter { border: 0; box-shadow: none; padding: 0; font-size: 12pt; }
  .letter-layout { display: block; }
  .flyer { border-width: 3px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
