:root {
  --bg: #121815; --panel: #1b231e; --panel2: #243029; --line: #2f3a33;
  --cream: #f3ece0; --text: #e4ddd0; --muted: #a9b0a6; --terra: #e0a07c; --terra-d: #b8603f; --sage: #9fb58f;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif; --sans: Lato, system-ui, -apple-system, sans-serif;
  --r: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* header + tabs */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px; background: rgba(18, 24, 21, .95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.brand .title { font-size: 21px; font-weight: 900; }
.top-btns { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--terra); color: #1a120d; font-size: 11px; font-weight: 900; display: grid; place-items: center; padding: 0 4px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px;
  background: rgba(18, 24, 21, .97); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.tabs a { flex: 1; max-width: 110px; text-align: center; padding: 10px 4px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs a.on { background: var(--panel2); color: var(--cream); }

main { padding: 4px 18px 24px; outline: none; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.14; margin: 6px 0 8px; }
.h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.2; margin-bottom: 6px; }
.hook { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; line-height: 1.4; margin-bottom: 14px; }
.lbl { font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--terra); text-transform: uppercase; margin: 20px 0 8px; }
.part { margin: 22px 0 10px; font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--terra); text-transform: uppercase; }
p.body { font-size: 16px; line-height: 1.6; color: var(--text); }
.sub { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 0 0 14px; }
.small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; line-height: 1.6; }
.empty a { color: var(--terra); }
.disc { color: #7e877d; font-size: 12px; line-height: 1.5; margin: 24px 0 8px; font-style: italic; }

/* search + shelf */
.search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; margin: 6px 0 18px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; color: var(--cream); font-size: 16px; outline: none; min-width: 0; }
.search input::placeholder { color: #7e877d; }
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.cover .img { aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; position: relative; background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.cover .img img { width: 100%; height: 100%; object-fit: cover; }
.cover .box { position: absolute; left: 7%; top: 5%; right: 16%; background: #f8f3ea; color: #2e4a3b; padding: 6px 7px; font-family: var(--serif); font-size: 12px; line-height: 1.12; }
.cover .band { position: absolute; left: 7%; right: 7%; bottom: 5%; height: 7%; }
.cover .label { margin-top: 8px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.25; }
.cover.locked .img img { filter: saturate(.6) brightness(.75); }
.lockb { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(18,24,21,.85); display: grid; place-items: center; color: var(--cream); }
.cover.big { width: 52%; margin: 8px auto 18px; }
.cover.big .box { font-size: 17px; padding: 9px 10px; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.sec-head h2 { font-size: 20px; font-weight: 900; line-height: 1.2; }
.sec-head a { color: var(--terra); font-weight: 700; font-size: 14px; white-space: nowrap; }
.row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 18px; margin: 0 -18px; padding: 0 18px 6px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 62%; scroll-snap-align: start; background: var(--panel); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.tile .ph { aspect-ratio: 3/2; background: var(--panel2); }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.tile .t { padding: 11px 13px 13px; }
.tile .t b { display: block; font-size: 16px; line-height: 1.25; }
.tile .t span { color: var(--muted); font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 9px; }
.item .th { width: 74px; height: 74px; border-radius: 10px; overflow: hidden; flex: none; background: var(--panel2); }
.item .th img { width: 100%; height: 100%; object-fit: cover; }
.item .meta { flex: 1; min-width: 0; }
.item .meta b { display: block; font-size: 16px; line-height: 1.25; }
.item .meta span { color: var(--muted); font-size: 13px; }
.item .meta .num { display: block; color: var(--terra); font-weight: 900; font-size: 11px; letter-spacing: .1em; }

/* detail */
.hero { margin: 0 -18px 4px; aspect-ratio: 3/2; position: relative; overflow: hidden; }
.hero.short { aspect-ratio: 2/1; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(18,24,21,0) 60%, var(--bg)); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 700; margin: 8px 0 6px; }
.strip, .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip { background: var(--panel2); border: 1px solid var(--line); color: var(--sage); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; }
.card.warn { border-color: var(--terra-d); }
.card ul, .card ol { padding-left: 20px; }
.card li { font-size: 16px; line-height: 1.5; margin: 6px 0; color: var(--text); }
.card ol li::marker { color: var(--terra); font-weight: 900; }
.card p { font-size: 15px; line-height: 1.55; color: var(--text); margin: 6px 0; }
.card p b { color: var(--cream); }
.careful, .card p.careful { color: #f0b392; }
.flags li::marker { color: var(--terra); }
.types { display: grid; gap: 10px; }
.type { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--sage); border-radius: 12px; padding: 12px 14px 4px; }
.type b { font-family: var(--serif); font-weight: 400; font-size: 18px; }

/* buttons, checks, forms */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 14px; font-weight: 900; font-size: 15px; margin: 10px 0; border: 1px solid var(--line); background: var(--panel); color: var(--cream); cursor: pointer; text-align: center; }
.btn.primary { background: var(--terra); color: #1d130d; border: 0; }
.btn.saved { color: var(--terra); border-color: var(--terra-d); }
.btn:disabled { opacity: .5; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--sage); flex: none; display: grid; place-items: center; margin-top: 1px; }
.check.on .box { background: var(--sage); }
.check.on .box::after { content: "✓"; color: var(--bg); font-weight: 900; font-size: 14px; }
.check.on .txt { color: var(--muted); text-decoration: line-through; }
.check .txt { font-size: 16px; line-height: 1.35; color: var(--text); }
.check .cards { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; text-decoration: none; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form input, .form select, .form textarea, .select, .scores input { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 16px; color: var(--cream); outline: none; width: 100%; }
.form input:focus, .form textarea:focus, .select:focus { border-color: var(--terra); }
.row2b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2b .btn { margin: 0; }
.seg { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 12px 0; }
.seg a, .seg button { flex: 1; text-align: center; padding: 10px 4px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer; }
.seg .on { background: var(--panel2); color: var(--cream); }

/* plans */
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; }
.daynav div { text-align: center; }
.daynav b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.daynav span { color: var(--terra); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.daynav button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 22px; cursor: pointer; }
.daynav button:disabled { opacity: .3; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.scores label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.step { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.step b { color: var(--cream); }
.sn { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); color: var(--terra); font-weight: 900; display: grid; place-items: center; flex: none; }
.steps3 { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.steps3 li { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.steps3 b { display: block; margin-bottom: 2px; }
.tracker { overflow-x: auto; margin: 10px -18px; padding: 0 18px; }
.tracker table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.tracker th { background: var(--panel2); color: var(--sage); font-size: 11px; font-weight: 900; padding: 8px 6px; text-align: center; line-height: 1.2; }
.tracker td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: center; color: var(--text); }
.tracker td:first-child { color: var(--terra); font-weight: 900; }
.tracker tr.now td { background: rgba(224, 160, 124, .12); }
.tracker tr.future td { color: #5d665e; }

/* misc */
.nudge { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 4px 0 8px; }
.nudge .ic { color: var(--terra); }
.nudge b { display: block; }
.nudge .row2 { display: flex; gap: 16px; margin-top: 8px; }
.nudge .row2 a, .nudge .row2 button { color: var(--terra); font-weight: 900; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 0; }
.nudge .row2 button { color: var(--muted); }
.signin, .locked-screen { padding-top: 10px; }
.signin h1, .locked-screen h1 { text-align: center; }
.locked-screen .hook { text-align: center; }
#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s;
  background: var(--cream); color: #1a1a17; font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 999px; pointer-events: none; z-index: 30; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }
[hidden]{display:none!important}
