/* Unlock Claude — mobile-first PWA styles */

:root {
  --bg: #F6F1EA;
  --surface: #FFFDF9;
  --surface-2: #EFE7DC;
  --ink: #1D1915;
  --ink-2: #5B5249;
  --ink-3: #8C8277;
  --line: #E4DACD;
  --accent: #C8553D;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7E1D9;
  --good: #2F7D57;
  --good-soft: #DDEFE4;
  --bad: #B33A3A;
  --bad-soft: #F6DEDC;
  --warn-soft: #FBEBC8;
  --code-bg: #2A241F;
  --code-ink: #F4ECE2;
  --shadow: 0 1px 2px rgba(40, 28, 16, .06), 0 4px 16px rgba(40, 28, 16, .06);
  --radius: 16px;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --top-h: 56px;
  --tab-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130F; --surface: #211C17; --surface-2: #2B251F; --ink: #F3ECE3; --ink-2: #C3B8AB;
    --ink-3: #8F8478; --line: #3A322A; --accent: #E8775C; --accent-ink: #1A1410; --accent-soft: #3B241C;
    --good: #6BC495; --good-soft: #1D3328; --bad: #EE8A84; --bad-soft: #3A1F1E; --warn-soft: #3A2F18;
    --code-bg: #0F0C0A; --code-ink: #F4ECE2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16130F; --surface: #211C17; --surface-2: #2B251F; --ink: #F3ECE3; --ink-2: #C3B8AB;
  --ink-3: #8F8478; --line: #3A322A; --accent: #E8775C; --accent-ink: #1A1410; --accent-soft: #3B241C;
  --good: #6BC495; --good-soft: #1D3328; --bad: #EE8A84; --bad-soft: #3A1F1E; --warn-soft: #3A2F18;
  --code-bg: #0F0C0A; --code-ink: #F4ECE2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ——— Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title {
  flex: 1; min-width: 0; padding-left: 8px;
  font: 600 17px/1.2 var(--serif); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon-btn:active { background: var(--surface-2); }
.lang-btn { width: auto; min-width: 44px; padding: 0 10px; font: 800 13px/1 var(--sans); letter-spacing: .06em; }
.lang-btn::after { content: ""; width: 0; height: 0; margin-left: 5px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); display: inline-block; }
.lang-btn { display: inline-flex; align-items: center; }
.lang-list { margin: 8px 0 4px; box-shadow: none; border: 1px solid var(--line); }
.lang-list .row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; }
.lang-list .row svg { color: var(--good); }
.read-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--accent); transition: width .1s linear;
}

/* ——— Main view */
main {
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--top-h) + env(safe-area-inset-top) + 8px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px);
  outline: none;
  animation: fade .22s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ——— Tab bar */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 6px 4px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  border-radius: 12px;
}
.tabbar a.active { color: var(--accent); }
.tabbar a.active svg { stroke-width: 2.4; }

/* ——— Typography */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.015em; line-height: 1.2; margin: 0; }
.h-display { font-size: 34px; font-weight: 700; }
.h-page { font-size: 28px; font-weight: 700; margin: 8px 0 4px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
.eyebrow { font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { font-size: 20px; }
.section-title a { font-size: 14px; font-weight: 600; }
.muted { color: var(--ink-3); }

/* ——— Hero */
.hero {
  position: relative; overflow: hidden;
  margin: 4px 0 8px; padding: 26px 22px 22px;
  border-radius: 24px;
  background: var(--code-bg); color: var(--code-ink);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,119,92,.55), transparent 70%);
}
.hero .eyebrow { color: #F0A58F; }
.hero h1 { font-size: 34px; margin: 10px 0 6px; position: relative; z-index: 1; }
.hero h1 em { font-style: normal; color: #F0A58F; }
.hero p { margin: 0 0 18px; color: #CFC4B7; font-size: 15px; position: relative; z-index: 1; }
.hero .btn { position: relative; z-index: 1; }

/* ——— Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 650; font-size: 15px;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ——— Cards & lists */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 112px;
  padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink);
}
.tile:active { transform: scale(.98); }
.tile .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile .ico svg { width: 20px; height: 20px; }
.tile b { font-size: 15px; line-height: 1.25; }
.tile small { color: var(--ink-3); font-size: 13px; margin-top: auto; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 4px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font: 700 22px/1.1 var(--serif); }
.stat span { font-size: 12px; color: var(--ink-3); }

.continue {
  display: flex; align-items: center; gap: 14px; color: var(--ink);
}
.continue .num {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font: 700 16px var(--serif);
}
.continue .t { flex: 1; min-width: 0; }
.continue .t small { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.continue .t div { font-weight: 650; line-height: 1.3; }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row .badge {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font: 700 14px var(--serif);
  background: var(--surface-2); color: var(--ink-2);
}
.row.done .badge { background: var(--good-soft); color: var(--good); }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-weight: 650; line-height: 1.3; }
.row .body small { color: var(--ink-3); font-size: 13px; }
.row .chev { color: var(--ink-3); width: 18px; height: 18px; }

.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }

/* ——— Reader */
.reader-head { margin: 8px 0 22px; }
.reader-head .eyebrow { display: block; margin-bottom: 8px; }
.reader-head h1 { font-size: 30px; font-weight: 700; }
.reader-head .meta { margin-top: 8px; font-size: 14px; color: var(--ink-3); }
.prose { font-size: 17px; line-height: 1.65; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 22px; margin: 32px 0 12px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 700; }

.callout {
  display: flex; gap: 12px; padding: 14px 16px; margin: 0 0 18px;
  border-radius: 14px; font-size: 15.5px; line-height: 1.5;
  background: var(--accent-soft);
}
.callout .ci { flex-shrink: 0; margin-top: 1px; }
.callout .ci svg { width: 20px; height: 20px; }
.callout b.lbl { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.callout.try { background: var(--accent-soft); }
.callout.try .ci, .callout.try b.lbl { color: var(--accent); }
.callout.pro { background: var(--good-soft); }
.callout.pro .ci, .callout.pro b.lbl { color: var(--good); }
.callout.warn { background: var(--bad-soft); }
.callout.warn .ci, .callout.warn b.lbl { color: var(--bad); }
.callout.goal { background: var(--warn-soft); }
.callout.goal .ci, .callout.goal b.lbl { color: #A86A0C; }
.callout .btn { margin-top: 10px; }

.promptbox {
  position: relative; margin: 0 0 18px; border-radius: 14px; overflow: hidden;
  background: var(--code-bg); color: var(--code-ink);
}
.promptbox pre {
  margin: 0; padding: 16px 16px 8px; white-space: pre-wrap; word-wrap: break-word;
  font: 14px/1.6 var(--mono);
}
.promptbox .ph { color: #F0A58F; }
.promptbox .pb-actions { display: flex; gap: 6px; padding: 8px 10px 10px; justify-content: flex-end; }
.pb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 10px; border: 0; cursor: pointer; font-size: 13px; font-weight: 650;
  background: rgba(255,255,255,.1); color: var(--code-ink);
}
.pb-btn svg { width: 16px; height: 16px; }
.pb-btn.primary { background: #E8775C; color: #1A1410; }

.compare { display: grid; gap: 10px; margin: 0 0 18px; }
.compare > div { padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.compare .b { background: var(--bad-soft); }
.compare .a { background: var(--good-soft); }
.compare small { display: block; font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.compare .b small { color: var(--bad); }
.compare .a small { color: var(--good); }

.tric { display: grid; gap: 10px; margin: 0 0 18px; }
.tric > div { display: flex; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.tric .k {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 22px var(--serif);
}
.tric b { display: block; font-size: 16px; }
.tric p { margin: 2px 0 4px !important; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.tric small { font-size: 13px; color: var(--ink-3); font-style: italic; }

.levels { display: grid; gap: 10px; margin: 0 0 18px; }
.level { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.level summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.level summary::-webkit-details-marker { display: none; }
.level .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.level .lv { flex: 1; }
.level .lv small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; }
.level .lv b { font-size: 16px; }
.level .inner { padding: 0 16px 16px; font-size: 15px; }
.level .inner .q { font: 14px/1.55 var(--mono); background: var(--surface-2); padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.level .inner p { margin: 0 !important; color: var(--ink-2); }
details[open] .chev-d { transform: rotate(90deg); }
.chev-d { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; }

.mistakes { counter-reset: m; display: grid; gap: 8px; margin: 0 0 18px; }
.mistake { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; line-height: 1.45; }
.mistake::before { counter-increment: m; content: counter(m); font: 700 18px/1.2 var(--serif); color: var(--accent); width: 18px; flex-shrink: 0; }
.mistake s { text-decoration: none; display: block; font-weight: 650; }
.mistake span { color: var(--good); }

.checklist { list-style: none; padding: 0 !important; margin: 0 0 18px; display: grid; gap: 8px; }
.checklist li { margin: 0 !important; }
.check {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  padding: 13px 14px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow);
  font-size: 15.5px; line-height: 1.4;
}
.check .box {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px var(--line); transition: background .15s, box-shadow .15s;
}
.check .box svg { width: 16px; height: 16px; stroke-width: 3; opacity: 0; color: #fff; }
.check[aria-pressed="true"] .box { background: var(--good); box-shadow: none; }
.check[aria-pressed="true"] .box svg { opacity: 1; }
.check[aria-pressed="true"] .lbl { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.check-foot { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 18px; font-size: 13px; color: var(--ink-3); }
.check-foot button { background: none; border: 0; color: var(--accent); font-weight: 650; cursor: pointer; padding: 6px 0; }

.technique { margin: 0 0 22px; padding: 18px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.technique h2 { margin: 0 0 8px !important; font-size: 21px !important; display: flex; align-items: center; gap: 10px; }
.technique h2 .n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.technique p { font-size: 15.5px; }
.technique .when { font-size: 14.5px; color: var(--ink-2); }
.technique h3 { font: 800 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }
.tries { display: grid; gap: 6px; }
.try-chip {
  text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--surface-2); font: 13.5px/1.45 var(--mono); color: var(--ink);
  display: flex; gap: 8px; align-items: flex-start;
}
.try-chip svg { width: 15px; height: 15px; color: var(--ink-3); margin-top: 2px; }
.avoid { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); font-size: 14px; line-height: 1.45; }
.avoid b { color: var(--bad); }

.steps { margin: 0 0 18px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.steps h3 { font-size: 16px; margin-bottom: 12px; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.step .sn { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }
.step b { display: block; font-size: 15px; }
.step span { font-size: 14px; color: var(--ink-2); font-style: italic; }

.combos { display: grid; gap: 10px; margin: 0 0 18px; }
.combo { padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.combo b { font-size: 15.5px; }
.combo .for { display: inline-block; margin: 4px 0 8px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.combo p { margin: 0 !important; font: 13.5px/1.5 var(--mono); color: var(--ink-2); }

.spectrum { display: grid; gap: 10px; margin: 0 0 18px; }
.spectrum > div { padding: 14px 16px; border-radius: 14px; border-left: 4px solid; background: var(--surface); box-shadow: var(--shadow); }
.spectrum .bad { border-color: var(--bad); }
.spectrum .good { border-color: var(--good); }
.spectrum small { font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.spectrum .bad small { color: var(--bad); }
.spectrum .good small { color: var(--good); }
.spectrum p { margin: 4px 0 0 !important; font-size: 15px; }

.trouble { display: grid; gap: 8px; margin: 0 0 18px; }
.trouble details { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.trouble summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 14px 16px; font-weight: 650; font-size: 15.5px; }
.trouble summary::-webkit-details-marker { display: none; }
.trouble summary span { flex: 1; }
.trouble .ans { padding: 0 16px 14px; font-size: 15px; }
.trouble .ans div { display: flex; gap: 8px; margin-top: 6px; }
.trouble .ans small { flex-shrink: 0; width: 52px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.trouble .ans .fix { color: var(--good); font-weight: 600; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.tools > div { padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
.tools b { display: block; font-size: 15px; margin-bottom: 4px; }
.tools > div:first-child { background: var(--accent-soft); }

.formula { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 18px; }
.formula span { padding: 8px 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.formula i { color: var(--ink-3); font-style: normal; font-weight: 700; }

.defs { display: grid; gap: 0; margin: 0 0 18px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.defs > div { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.defs > div:last-child { border-bottom: 0; }
.defs b { width: 104px; flex-shrink: 0; }
.defs span { color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
  padding: 8px 13px; border-radius: 99px; border: 0; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 550; color: var(--ink);
}
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }

.words { display: grid; gap: 10px; margin: 0 0 18px; }
.words > div { padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; }
.words b { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }

.reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 32px; }
.reader-nav a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink); min-height: 72px;
}
.reader-nav a small { color: var(--ink-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.reader-nav a b { font-size: 14.5px; line-height: 1.3; }
.reader-nav a.next { text-align: right; grid-column: 2; }
.done-banner { margin-top: 28px; padding: 18px; border-radius: 16px; text-align: center; background: var(--good-soft); color: var(--good); font-weight: 650; }

/* ——— Prompt library */
.search {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 5;
  margin: 0 -16px; padding: 4px 16px 10px; background: var(--bg);
}
.search label {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); font-size: 16px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 6px -16px 0; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .chip { flex-shrink: 0; }

.pcard {
  display: block; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
}
.pcard + .pcard { margin-top: 10px; }
.pcard .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pcard .cat { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pcard .fav { margin-left: auto; color: var(--accent); }
.pcard .fav svg { width: 18px; height: 18px; fill: currentColor; }
.pcard b { display: block; font: 700 17px/1.3 var(--serif); }
.pcard p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.count { font-size: 13px; color: var(--ink-3); margin: 14px 2px 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; stroke-width: 1.5; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ——— Prompt detail */
.pd-head { margin: 8px 0 18px; }
.pd-head h1 { font-size: 28px; margin: 8px 0 6px; }
.pd-head p { margin: 0; color: var(--ink-2); }
.fields { display: grid; gap: 14px; margin: 0 0 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 14px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  font: inherit; font-size: 16px; color: var(--ink); outline: 0; resize: vertical;
}
.field textarea { min-height: 96px; }
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.info { display: grid; gap: 10px; margin: 20px 0; }
.info > div { padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; line-height: 1.5; }
.info small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.sticky-actions {
  position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px); z-index: 4;
  display: flex; gap: 8px; padding: 8px; margin: 18px -8px 0; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.sticky-actions .btn { flex: 1; padding: 0 10px; white-space: nowrap; }
.sticky-actions .btn:last-child { flex: 1.5; }
.sticky-actions .btn.sq { flex: 0 0 46px; padding: 0; }
.btn.sq.on svg { fill: currentColor; }

/* ——— Plan */
.plan-hero { display: flex; align-items: center; gap: 18px; margin: 4px 0 20px; padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.ring { --p: 0; width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring div { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1; }
.ring b { font: 700 22px var(--serif); }
.ring small { display: block; font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.plan-hero .t b { display: block; font: 700 18px/1.25 var(--serif); }
.plan-hero .t span { font-size: 14px; color: var(--ink-2); }
.week { margin: 0 0 22px; }
.week h2 { font-size: 19px; display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.week h2 small { font: 700 12px var(--sans); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.week h2 em { margin-left: auto; font: 600 13px var(--sans); color: var(--ink-3); font-style: normal; }
.day .lbl small { display: block; font-size: 11.5px; font-weight: 800; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1px; }
.check[aria-pressed="true"] .lbl small { color: var(--ink-3); }
.day.today { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }

/* ——— Builder */
.preview { margin: 18px 0 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg .chip { font-size: 13px; padding: 6px 11px; }

/* ——— Toast & sheet */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 99px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); animation: fadeIn .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  background: var(--surface); animation: up .25s ease;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 16px; }
.sheet h2 { font-size: 22px; margin-bottom: 8px; }
.sheet ol { padding-left: 20px; }
.sheet li { margin-bottom: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

/* ——— Gate (login / compra / offline) */
body.gated .tabbar { display: none; }
body.gated main { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
.gate { max-width: 420px; margin: 0 auto; padding: 24px 0 8px; text-align: center; animation: fade .25s ease; }
.gate-logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: var(--shadow); display: block; margin: 8px auto 20px; }
.gate h1 { font-size: 27px; font-weight: 700; margin-bottom: 8px; }
.gate-lead { margin: 0 auto 22px; color: var(--ink-2); font-size: 15.5px; }
.gate-form { display: grid; gap: 12px; text-align: left; }
.gate-err { min-height: 1.2em; margin: -2px 2px 0; font-size: 14px; color: var(--bad); }
.gate-err:empty { display: none; }
.gate-who { margin: 22px 0 0; font-size: 13.5px; color: var(--ink-3); }
.gate-foot { margin: 28px 0 0; font-size: 12.5px; color: var(--ink-3); }
.linkish { border: 0; background: none; padding: 6px 0; cursor: pointer; font: inherit; font-weight: 650; color: var(--accent); }
.opop-btn { gap: 10px; min-height: 52px; font-size: 16px; }
.opop-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-ink); color: var(--accent); font: 800 15px/1 var(--sans); }
.gate .spinner { margin: 8px auto 20px; }
.btn:disabled { opacity: .55; pointer-events: none; }
.spinner { width: 36px; height: 36px; margin: 32px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot.account { margin-top: 28px; margin-bottom: -24px; }

/* ——— Welcome popup */
.welcome { text-align: center; padding-top: 4px; }
.w-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); margin: 4px auto 14px; display: block; }
.welcome h2 { font-size: 24px; margin-bottom: 8px; }
.w-lead { margin: 0 auto 18px; max-width: 420px; color: var(--ink-2); font-size: 15px; }
.w-steps { display: grid; gap: 10px; margin-bottom: 14px; text-align: left; }
.w-step { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--bg); }
.w-step.ok { background: var(--good-soft); }
.w-step.muted-step .w-txt { opacity: .75; }
.w-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.w-step.ok .w-ico { background: var(--surface); color: var(--good); }
.w-ico svg { width: 20px; height: 20px; }
.w-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.w-txt b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 1px; }
.w-done { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #fff; }
.w-done svg { width: 16px; height: 16px; stroke-width: 3; }
.w-step .btn { flex-shrink: 0; }
.welcome-sheet { animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) {
  .sheet.welcome-sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 480px; transform: translate(-50%, -50%); border-radius: 24px; padding: 28px 28px 24px; animation: popc .3s ease; }
  .sheet.welcome-sheet .grab { display: none; }
  @keyframes popc { from { opacity: 0; transform: translate(-50%, -46%); } }
}

.remind {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: -6px 0 22px; padding: 12px 14px;
  border: 0; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; font-size: 14.5px;
  background: var(--accent-soft); color: var(--ink);
}
.remind > svg:first-child { color: var(--accent); }
.remind span { flex: 1; }
.remind b { color: var(--accent); font-size: 14px; }
.remind.on { background: var(--good-soft); cursor: default; }
.remind.on > svg { color: var(--good); }

.install-card { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.install-card .ico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; overflow: hidden; }
.install-card .ico img { width: 100%; height: 100%; display: block; }
.install-card .t { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); }
.install-card .t b { display: block; color: var(--ink); font-size: 15px; }

.foot { margin-top: 36px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 14px; border-radius: 22px; border: 1px solid var(--line); height: var(--tab-h); padding-bottom: 6px; }
  main { padding-bottom: calc(var(--tab-h) + 48px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
