/* Alias Author. Every colour lives here. Brand palette is not chosen yet:
   the default is neutral, and ?pal=C12 (etc.) previews one of Chrissy's cards. */
:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --text: #1f1d1b;
  --muted: #6b6560;
  --line: #e8e3de;
  --accent: #1f1d1b;          /* buttons, active nav, progress fill */
  --accent-text: #ffffff;
  --accent-2: #8a817a;        /* second colour: part badges, highlights */
  --tint: #efe9e3;            /* soft fills */
  --tint-2: #f3efea;
  --done: #2f855a;
  --held-bg: #fef3c7;
  --held-text: #92400e;
  --screen-bg: #f5f5f4;
  --screen-line: #a8a29e;
  --error: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,29,27,.04), 0 6px 20px rgba(31,29,27,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --read-size: 1.1875rem;     /* 19px reading text */
}
/* Chrissy's palette cards, preview only (drafts/brand/palette-cards-2026-10-14/).
   Calm build: white UI, one strong card colour (--accent) for buttons, progress, active nav;
   the card's other colours only as small part badges. */
:root { --p1: var(--tint); --p2: var(--tint); --p3: var(--tint); --p4: var(--tint); --p5: var(--tint);
  --t1: var(--text); --t2: var(--text); --t3: var(--text); --t4: var(--text); --t5: var(--text); }
:root[data-pal] { --bg:#f6f6f7; --surface:#ffffff; --text:#2d3232; --muted:#6b7070; --line:#e7e7ea; --accent-text:#ffffff; }
:root[data-pal="C17"] { --accent:#558188; --accent-2:#558188; --done:#558188; --tint:#fde8e7; --tint-2:#f8f4f3;
  --p1:#f8aba9; --t1:#2d3232; --p2:#cfb1a6; --t2:#2d3232; --p3:#abb9b9; --t3:#2d3232; --p4:#558188; --t4:#fff; --p5:#f8aba9; --t5:#2d3232; }
:root[data-pal="C12"] { --accent:#a08fc4; --accent-2:#f0679b; --done:#69c5c1; --tint:#fbe6f0; --tint-2:#f6f4f8;
  --p1:#69c5c1; --t1:#fff; --p2:#a08fc4; --t2:#fff; --p3:#f0679b; --t3:#fff; --p4:#ecb6d4; --t4:#2d3232; --p5:#a26851; --t5:#fff; }
:root[data-pal="C15"] { --accent:#5278bb; --accent-2:#e45097; --done:#5278bb; --tint:#e9edf7; --tint-2:#f5f6fa;
  --p1:#b080b9; --t1:#fff; --p2:#e45097; --t2:#fff; --p3:#5278bb; --t3:#fff; --p4:#e58284; --t4:#fff; --p5:#b080b9; --t5:#fff; }
:root[data-pal="C11"] { --accent:#3f9fc9; --accent-2:#77c9ec; --done:#3f9fc9; --tint:#e3f3fb; --tint-2:#f7f9fa;
  --p1:#77c9ec; --t1:#2d3232; --p2:#f8b2b7; --t2:#2d3232; --p3:#77c9ec; --t3:#2d3232; --p4:#f8b2b7; --t4:#2d3232; --p5:#2d3232; --t5:#fff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input { font: inherit; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; padding-top: max(12px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar .mark { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.bar .mark .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 600; }
.bar nav { display: flex; gap: 6px; font-size: .92rem; align-items: center; }
.bar nav a, .linkbtn { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 7px 12px; border-radius: 99px; cursor: pointer; font-weight: 500; }
.bar nav a:hover, .linkbtn:hover { background: var(--tint-2); color: var(--text); }

/* Layout: sidebar + content on wide screens */
.shell { max-width: 1180px; margin: 0 auto; padding: 28px 24px 72px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: start; }
.shell.solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; background: var(--surface); color: var(--text); border-radius: 20px; padding: 18px 12px; border: 1px solid var(--line); }
.side h4 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px; margin: 0 0 10px; font-weight: 600; }
.side .snav { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side .snav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: .95rem; }
.side .snav a:hover { background: var(--tint-2); }
.side .snav a.on { background: var(--tint); color: var(--text); font-weight: 600; }
.side .snav .pn { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--tint-2); color: inherit; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.side .snav a.on .pn { background: var(--accent); color: #fff; }
.side .snav .pc { margin-left: auto; font-size: .78rem; opacity: .75; font-variant-numeric: tabular-nums; }
.side .slessons a { font-size: .9rem; padding: 7px 10px; align-items: flex-start; }
.side .slessons .tick { flex-basis: 18px; height: 18px; font-size: .65rem; margin-top: 2px; background: transparent; border-color: currentColor; opacity: .9; }
.side .slessons .tick.on { background: var(--done); border-color: var(--done); color: #fff; }

.side .num { color: inherit; opacity: .7; }
.side .mod { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 14px 10px 4px; }
.content { min-width: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 64px; gap: 0; }
  .side { display: none; }
  .bar { padding-left: 16px; padding-right: 16px; }
}

h1 { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.015em; margin: .15em 0 .45em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .4em; }
.crumbs { font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.muted { color: var(--muted); }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }

/* Dashboard */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -90px; bottom: -120px; width: 300px; height: 300px; border-radius: 50%; background: var(--tint); opacity: .6; z-index: 0; }
.hero .eyebrow, .hero .next-up { color: inherit; opacity: .85; }
.hero .next-up b { color: inherit; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: .2em 0 .35em; font-size: 1.9rem; }
.hero .next-up { font-size: 1.02rem; color: var(--muted); margin: 0 0 18px; }
.hero .next-up b { font-weight: 600; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--tint) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); color: var(--text); display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--serif); font-size: 1.7rem; line-height: 1; display: block; }
.ring span { font-size: .75rem; color: var(--muted); }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; padding: 22px; } .ring { width: 108px; height: 108px; } .ring > div { width: 84px; height: 84px; } }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { font-family: var(--serif); font-size: 1.5rem; display: block; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }

.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .parts { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.pcard { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pcard .top { display: flex; align-items: center; justify-content: space-between; }
.pcard { --pc: var(--tint); --pt: var(--text); }
.pcard:nth-child(1) { --pc: var(--p1); --pt: var(--t1); } .pcard:nth-child(2) { --pc: var(--p2); --pt: var(--t2); }
.pcard:nth-child(3) { --pc: var(--p3); --pt: var(--t3); } .pcard:nth-child(4) { --pc: var(--p4); --pt: var(--t4); }
.pcard:nth-child(5) { --pc: var(--p5); --pt: var(--t5); }
.pcard .badge { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; background: var(--pc); color: var(--pt); }
.parts > .pcard:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pcard.done .badge { background: var(--done); color: #fff; }
.pcard .title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.pcard .meta { font-size: .85rem; color: var(--muted); }

.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; color: var(--text); text-decoration: none; }
a.card:active { background: var(--tint-2); }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .title { font-weight: 600; text-decoration: none; color: var(--text); }
.card .count { font-size: .85rem; color: var(--muted); white-space: nowrap; }

.progress { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; min-width: 0; }

.lessons { list-style: none; padding: 0; margin: 8px 0 0; }
.lessons li a { display: flex; gap: 12px; align-items: flex-start; padding: 11px 6px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); border-radius: 8px; }
.lessons li a:hover { background: var(--tint-2); }
.lessons li:first-child a { border-top: 0; }
.tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; margin-top: 2px; background: var(--surface); }
.tick.on { border-color: var(--done); background: var(--done); color: #fff; }
.num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 2px; }

.badge-held { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--held-bg); color: var(--held-text); margin-left: 6px; }
mark.verify { background: var(--held-bg); color: var(--held-text); padding: 0 4px; border-radius: 4px; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 99px; padding: 12px 22px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .6; }

/* Lesson reading */
.lesson-head { margin-bottom: 18px; }
.lesson-head .eyebrow { display: block; margin: 10px 0 2px; }
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 34px; box-shadow: var(--shadow); }
@media (max-width: 640px) { .paper { padding: 20px 18px; border-radius: 14px; } h1 { font-size: 1.75rem; } }
.lesson { font-size: var(--read-size); line-height: 1.7; }
.lesson > :first-child { margin-top: 0; }
.lesson ol, .lesson ul { padding-left: 1.5em; }
.lesson li { margin: .45em 0; }
.lesson li::marker { color: var(--accent-2); font-weight: 600; }
.lesson li > ul, .lesson li > ol { margin: .3em 0; }
.lesson h2 { font-size: 1.35rem; }
.lesson strong { font-weight: 650; }
.lesson code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--tint-2); padding: 1px 5px; border-radius: 4px; }
.lesson pre { background: var(--tint-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.lesson pre code { background: none; padding: 0; font-size: inherit; }
.table-wrap { overflow-x: auto; margin: 1em 0; }
.lesson table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.lesson th, .lesson td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.lesson th { background: var(--tint-2); }

.youhave { background: var(--tint-2); border-left: 4px solid var(--accent-2); border-radius: 8px; padding: 12px 14px; margin: 0 0 1.2em; }
.youhave b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }

.screen-todo { margin: .8em 0; padding: 14px; border: 2px dashed var(--screen-line); border-radius: 8px; background: var(--screen-bg); display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.screen-label { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.video { position: relative; padding-top: 56.25%; margin: 0 0 1.2em; border-radius: 12px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.downloads { margin-top: 1.4em; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0 0; padding: 0; list-style: none; }
.dl { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--text); }
.dl:hover { box-shadow: var(--shadow); }
.dl .ic { flex: 0 0 40px; height: 40px; border-radius: 10px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.dl .t { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.dl .s { font-size: .8rem; color: var(--muted); }
.dl.locked { opacity: .55; }

.done-box { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; padding: 16px 18px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 1.1rem; font-weight: 600; cursor: pointer; }
.done-box input { width: 26px; height: 26px; accent-color: var(--done); margin: 0; }
.done-box.on { border-color: var(--done); background: color-mix(in srgb, var(--done) 8%, var(--surface)); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.pager a { flex: 1; font-size: .92rem; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.pager a small { display: block; color: var(--muted); font-size: .78rem; }
.pager a.next { text-align: right; }

form.stack { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 24px; }
label { font-weight: 600; font-size: .95rem; }
input[type=email], input[type=text], input[type=number] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 1rem; }
.msg { min-height: 1.4em; font-size: .95rem; }
.msg.err { color: var(--error); }
.msg a { word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.admin table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.admin th, .admin td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 400; }

/* Lesson checklists */
.lesson li.task { list-style: none; margin-left: -1.4em; }
.lesson li.task label { display: flex; gap: .6em; align-items: flex-start; cursor: pointer; font-weight: 400; }
.lesson li.task input { width: 1.25em; height: 1.25em; margin-top: .25em; flex: none; accent-color: var(--done); }

/* Phone polish */
@media (max-width: 560px) {
  .bar .mark { font-size: 1.12rem; white-space: nowrap; gap: 8px; }
  .bar .mark .logo { width: 26px; height: 26px; font-size: .85rem; }
  .bar nav { gap: 0; font-size: .85rem; }
  .bar nav a, .linkbtn { padding: 6px 8px; white-space: nowrap; }
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 20px; align-items: start; }
  .hero::after { display: none; }
  .hero h1 { font-size: 1.45rem; }
  .hero .next-up { font-size: .95rem; }
  .hero .ring { width: 78px; height: 78px; }
  .hero .ring > div { width: 60px; height: 60px; }
  .hero .ring b { font-size: 1.15rem; }
  .hero .ring span { font-size: .65rem; }
  .stat { padding: 12px; }
  .stat b { font-size: 1.25rem; }
  .stat span { font-size: .75rem; line-height: 1.3; display: block; }
}

/* Calm build extras */
.side > .snav:first-of-type li:nth-child(2) .pn { background: var(--p1); color: var(--t1); }
.side > .snav:first-of-type li:nth-child(3) .pn { background: var(--p2); color: var(--t2); }
.side > .snav:first-of-type li:nth-child(4) .pn { background: var(--p3); color: var(--t3); }
.side > .snav:first-of-type li:nth-child(5) .pn { background: var(--p4); color: var(--t4); }
.side > .snav:first-of-type li:nth-child(6) .pn { background: var(--p5); color: var(--t5); }
.pcard.done .badge { background: var(--done); color: #fff; }
.part-head .eyebrow { color: var(--accent); }
