/* Enduring Branches apps — shared look. Calm, warm, easy on the eyes. */
/* ---------- Themes (chosen per person in Settings → Look & Feel) ---------- */

:root {
  --t-p: #2C1654;
  --t-p2: #4A2D80;
  --t-pdk: #CDB6F5;
  --t-p2dk: #B99CF0;
  --t-a: #C9971E;
  --t-asoft: #F6E9C6;
  --t-aink: #7A5A0A;
  --t-adk: #E2B74A;
  --t-asoftdk: #3A3020;
  --t-heroa: #2C1654;
  --t-herob: #5B3A9B;
  --t-bg: #FBF7EF;
  --t-s2: #F4EEE2;
  --t-line: #E7DECF;
  --t-bgdk: #17121F;
  --t-sdk: #211A2C;
  --t-s2dk: #2A2236;
  --t-linedk: #3A3048;
  --t-psoft: #EDE6F8;
  --t-psoftdk: #3A2E52;
}

:root[data-theme="evergreen"] {
  --t-p: #1E4A3E;
  --t-p2: #2F6B57;
  --t-pdk: #9FD6BF;
  --t-p2dk: #86C7AC;
  --t-a: #B8862B;
  --t-asoft: #F3E6C8;
  --t-aink: #6E4F10;
  --t-adk: #E0B65A;
  --t-asoftdk: #33301E;
  --t-heroa: #163A31;
  --t-herob: #2F6B57;
  --t-bg: #F7F8F3;
  --t-s2: #EDF1E8;
  --t-line: #DCE3D6;
  --t-bgdk: #111915;
  --t-sdk: #1A241F;
  --t-s2dk: #22302A;
  --t-linedk: #31423A;
  --t-psoft: #E1EEE7;
  --t-psoftdk: #24382F;
}

:root[data-theme="ocean"] {
  --t-p: #173A5E;
  --t-p2: #24608F;
  --t-pdk: #A9CCF0;
  --t-p2dk: #8CBBE8;
  --t-a: #1C8C85;
  --t-asoft: #D7F0EC;
  --t-aink: #0F5C57;
  --t-adk: #5FD0C6;
  --t-asoftdk: #17302F;
  --t-heroa: #102B47;
  --t-herob: #24608F;
  --t-bg: #F5F8FB;
  --t-s2: #E9EFF5;
  --t-line: #D7E1EA;
  --t-bgdk: #0F161E;
  --t-sdk: #17212C;
  --t-s2dk: #1F2C3A;
  --t-linedk: #2E3E50;
  --t-psoft: #E2ECF6;
  --t-psoftdk: #22344A;
}

:root[data-theme="sunrise"] {
  --t-p: #7A2E1D;
  --t-p2: #A4472B;
  --t-pdk: #F3B8A3;
  --t-p2dk: #EFA388;
  --t-a: #D98A1C;
  --t-asoft: #FBEBCF;
  --t-aink: #7A4A06;
  --t-adk: #F2B552;
  --t-asoftdk: #3A2B17;
  --t-heroa: #6B2414;
  --t-herob: #B4532E;
  --t-bg: #FDF8F2;
  --t-s2: #F7EDE1;
  --t-line: #EDDCC9;
  --t-bgdk: #1C1410;
  --t-sdk: #261B16;
  --t-s2dk: #30231C;
  --t-linedk: #46342A;
  --t-psoft: #F8E3DA;
  --t-psoftdk: #43281E;
}

:root[data-theme="rose"] {
  --t-p: #6B2346;
  --t-p2: #94386A;
  --t-pdk: #F2B5D2;
  --t-p2dk: #EC9CC2;
  --t-a: #C76B85;
  --t-asoft: #F8E1E8;
  --t-aink: #7D2F45;
  --t-adk: #F09BB3;
  --t-asoftdk: #3A2029;
  --t-heroa: #5A1C3B;
  --t-herob: #9A3F6E;
  --t-bg: #FDF7F8;
  --t-s2: #F6EBEE;
  --t-line: #EDD9DF;
  --t-bgdk: #1B1216;
  --t-sdk: #251A1F;
  --t-s2dk: #2F2128;
  --t-linedk: #46303A;
  --t-psoft: #F6E2EC;
  --t-psoftdk: #43263A;
}

:root[data-theme="slate"] {
  --t-p: #263241;
  --t-p2: #3E5166;
  --t-pdk: #C3D0DE;
  --t-p2dk: #AABBCD;
  --t-a: #3B82C4;
  --t-asoft: #DFEBF7;
  --t-aink: #1F4F80;
  --t-adk: #7DB4EA;
  --t-asoftdk: #1C2A38;
  --t-heroa: #1E2833;
  --t-herob: #43566C;
  --t-bg: #F6F7F9;
  --t-s2: #ECEEF2;
  --t-line: #DADFE6;
  --t-bgdk: #121519;
  --t-sdk: #1A1F25;
  --t-s2dk: #222831;
  --t-linedk: #333C47;
  --t-psoft: #E4E9F0;
  --t-psoftdk: #2A3440;
}

:root {
  --bg: var(--t-bg); --surface: #FFFFFF; --surface-2: var(--t-s2); --line: var(--t-line);
  --ink: #241A33; --ink-soft: #5E5470;
  --purple: var(--t-p); --purple-2: var(--t-p2); --primary-soft: var(--t-psoft);
  --gold: var(--t-a); --gold-soft: var(--t-asoft); --accent-ink: var(--t-aink);
  --sage: #4F7A63; --sage-soft: #E1EEE5; --rose: #A8473F; --rose-soft: #F6E1DE; --on-accent: #FFFFFF;
  --shadow: 0 1px 2px rgba(36,26,51,.06), 0 6px 20px rgba(36,26,51,.06);
  color-scheme: light;
  --hero-a: var(--t-heroa); --hero-b: var(--t-herob);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-mode="dark"] {
  --bg: var(--t-bgdk); --surface: var(--t-sdk); --surface-2: var(--t-s2dk); --line: var(--t-linedk);
  --ink: #F1ECF7; --ink-soft: #B9AFC8;
  --purple: var(--t-pdk); --purple-2: var(--t-p2dk); --primary-soft: var(--t-psoftdk);
  --gold: var(--t-adk); --gold-soft: var(--t-asoftdk); --accent-ink: var(--t-adk);
  --sage: #8CC3A4; --sage-soft: #203229; --rose: #E79A92; --rose-soft: #3A2224; --on-accent: #17121F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]):not([data-mode="dark"]) {
  --bg: var(--t-bgdk); --surface: var(--t-sdk); --surface-2: var(--t-s2dk); --line: var(--t-linedk);
    --ink: #F1ECF7; --ink-soft: #B9AFC8;
    --purple: var(--t-pdk); --purple-2: var(--t-p2dk); --primary-soft: var(--t-psoftdk);
    --gold: var(--t-adk); --gold-soft: var(--t-asoftdk); --accent-ink: var(--t-adk);
    --sage: #8CC3A4; --sage-soft: #203229; --rose: #E79A92; --rose-soft: #3A2224; --on-accent: #17121F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

/* Viewing preferences */
:root[data-text="lg"] { font-size: 112.5%; }
:root[data-text="xl"] { font-size: 125%; }
:root[data-font="modern"] { --serif: var(--sans); }
:root[data-font="readable"] { --sans: Verdana, Tahoma, "Trebuchet MS", sans-serif; --serif: Verdana, Tahoma, sans-serif; letter-spacing: .015em; }
:root[data-contrast="high"] { --ink: #000; --ink-soft: #262626; --line: #8A8A8A; }
:root[data-contrast="high"][data-mode="dark"] { --ink: #FFF; --ink-soft: #E4E4E4; --line: #9A9A9A; }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:not([data-mode="light"]) { --ink: #FFF; --ink-soft: #E4E4E4; --line: #9A9A9A; } }
:root[data-density="compact"] .card { padding: 13px 14px; margin-bottom: 10px; }
:root[data-density="compact"] .list li { padding: 9px 0; }
:root[data-density="compact"] .check { padding: 8px 0; }
:root[data-density="compact"] label.field { margin-bottom: 10px; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--purple-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side { display: none; }
main {
  flex: 1; min-width: 0; outline: none;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(96px + env(safe-area-inset-bottom));
  max-width: 820px; margin: 0 auto;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 2px 8px; text-decoration: none; color: var(--ink-soft); font-size: .72rem; font-weight: 600;
}
.tabs a .ico { font-size: 1.35rem; line-height: 1; filter: grayscale(.4); }
.tabs a.on { color: var(--purple); }
.tabs a.on .ico { filter: none; }

@media (min-width: 900px) {
  .tabs { display: none; }
  .side {
    display: block; position: sticky; top: 0; height: 100vh; width: 260px; flex: none;
    background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; overflow-y: auto;
  }
  .brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 20px; }
  .brand img { border-radius: 10px; }
  .brand strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
  .brand span { font-size: .8rem; color: var(--ink-soft); }
  .side nav a {
    display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px;
    text-decoration: none; color: var(--ink); font-weight: 500;
  }
  .side nav a:hover { background: var(--surface-2); }
  .side nav a.on { background: var(--gold-soft); color: var(--ink); font-weight: 700; }
  .side nav hr { border: 0; border-top: 1px solid var(--line); margin: 10px 8px; }
  main { padding: 40px 40px 60px; }
}

/* ---------- Building blocks ---------- */
.page-head { margin-bottom: 18px; }
.page-head p { color: var(--ink-soft); margin: 0; }
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--gold); margin-bottom: 4px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.gold { background: var(--gold-soft); border-color: transparent; box-shadow: none; }
.card.sage { background: var(--sage-soft); border-color: transparent; box-shadow: none; }
.card.rose { background: var(--rose-soft); border-color: transparent; box-shadow: none; }
.card h2:last-child, .card p:last-child { margin-bottom: 0; }

.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid2 > .card { margin: 0; }
@media (max-width: 420px) { .grid2.stack-sm { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--purple); color: var(--on-accent); font-weight: 700; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.gold { background: var(--gold); color: #1d1626; }
.btn.ghost { background: transparent; color: var(--purple); border: 2px solid var(--line); }
.btn.danger { background: var(--rose); color: var(--on-accent); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }

.icon-btn {
  border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--ink-soft);
  min-width: 40px; min-height: 40px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Big friendly action tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); cursor: pointer; text-align: left;
}
.tile .ico { font-size: 1.6rem; }
.tile strong { font-size: 1rem; }
.tile span { font-size: .82rem; color: var(--ink-soft); }

/* Loved one header */
.person {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; border: 0;
}
.person h2 { color: #fff; margin: 0; }
.person .muted { color: rgba(255,255,255,.78); }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none; object-fit: cover;
  background: #ffffff22; display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; color: #fff;
  border: 2px solid var(--gold);
}

.verse { font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; }
.verse cite { display: block; margin-top: 8px; font-family: var(--sans); font-style: normal; font-size: .85rem; font-weight: 700; color: var(--gold); }

.stat { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--purple); }
.stat-label { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { font-size: .85rem; color: var(--ink-soft); }
.pill {
  display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft); white-space: nowrap;
}
.pill.gold { background: var(--gold-soft); color: var(--accent-ink); }
.pill.sage { background: var(--sage-soft); color: var(--sage); }
.pill.purple { background: var(--primary-soft); color: var(--purple-2); }
.empty { text-align: center; padding: 26px 10px; color: var(--ink-soft); }
.empty .ico { font-size: 2.2rem; display: block; margin-bottom: 6px; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
label.field > small { display: block; color: var(--ink-soft); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 260px; }
input:focus, select:focus, textarea:focus { border-color: var(--purple-2); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 6px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--sage); }
.check.done span { color: var(--ink-soft); text-decoration: line-through; }
.check.plain.done span { color: var(--ink); text-decoration: none; font-weight: 600; }

/* Progress */
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--sage)); border-radius: 999px; }

/* Parole packet sections */
.section-link {
  display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.section-link:last-child { border-bottom: 0; }
.section-link .ico { font-size: 1.4rem; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.section-link .grow { flex: 1; }
.section-link .chev { color: var(--ink-soft); font-size: 1.3rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .num {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--purple); color: var(--on-accent); font-weight: 700; font-size: .9rem; cursor: pointer; border: 0;
}
.steps li.done .num { background: var(--sage); }
.steps li.done strong { text-decoration: line-through; color: var(--ink-soft); }

.list-rows .lrow { display: flex; gap: 8px; margin-bottom: 8px; }
.list-rows .lrow input { flex: 1; }

/* Envelope */
.envelope {
  font-family: "Courier New", Courier, monospace; font-size: 1rem; line-height: 1.5; white-space: pre-line;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px;
}

/* Sheet (bottom drawer / dialog) */
.sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(23,18,31,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-body {
  background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up .22s ease-out;
}
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-body { border-radius: 24px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-body { animation: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 900px) { .toast { bottom: 30px; } }

.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-soft); font-weight: 600; margin-bottom: 12px; }

/* Welcome */
.welcome { text-align: center; padding-top: 20px; }
.welcome img { border-radius: 22px; box-shadow: var(--shadow); }
.welcome h1 { font-size: 2.1rem; margin-top: 18px; }
.promise { text-align: left; }
.promise ul { list-style: none; margin: 0; padding: 0; }
.promise li { margin-bottom: 8px; }

/* Always-visible crisis button (reentry app) */
.sos { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 12px; z-index: 30; background: var(--rose); color: #fff;
  padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; text-decoration: none; box-shadow: var(--shadow); }
.sos[hidden] { display: none; }
@media (max-width: 899px) { .has-sos main { padding-top: calc(env(safe-area-inset-top) + 54px); } }

/* Form engine pieces */
.flabel { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.field > small, .field small { display: block; color: var(--ink-soft); font-size: .82rem; margin: 2px 0 8px; }
.form-h { margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.tip { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; }
.tip ul { margin: 6px 0 0 18px; padding: 0; }
.group-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--bg); }
.group-card .field:last-child { margin-bottom: 0; }
.lnum { width: 26px; flex: none; padding-top: 12px; color: var(--ink-soft); font-size: .9rem; text-align: right; }
details.learn { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.learn:last-child { border-bottom: 0; }
details.learn summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; gap: 10px; align-items: center; }
details.learn summary::-webkit-details-marker { display: none; }
details.learn summary::after { content: '+'; margin-left: auto; font-size: 1.3rem; color: var(--ink-soft); }
details.learn[open] summary::after { content: '–'; }
details.learn .body { padding: 0 0 14px; }
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .dodont { grid-template-columns: 1fr; } }
.dodont > div { border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.dodont ul { margin: 6px 0 0 16px; padding: 0; }
.dodont .do { background: var(--sage-soft); } .dodont .dont { background: var(--rose-soft); }
.glossary dt { font-weight: 700; margin-top: 12px; } .glossary dd { margin: 2px 0 0; color: var(--ink-soft); }
.search { margin-bottom: 14px; }
.lock .stat { font-size: 2.4rem; }
.letter-out { white-space: pre-wrap; font-family: Georgia, serif; background: #fff; color: #111; border-radius: 12px; padding: 18px; border: 1px solid var(--line); line-height: 1.6; }

/* ---------- Print ---------- */
.print-area { display: none; }
@media print {
  @page { size: letter; margin: 0.9in 1in; @bottom-center { content: counter(page); font: 10pt "Times New Roman", serif; } }
  @page :first { @bottom-center { content: none; } }
  body { background: #fff; color: #000; font: 12pt/1.5 "Times New Roman", Times, serif; }
  .pp-text { line-height: 1.9; }
  .pp-group { margin: 6pt 0 10pt 12pt; padding-left: 8pt; border-left: 1.5pt solid #999; }
  .pp-group-h { font-weight: bold; font-size: 10.5pt; margin-bottom: 4pt; }
  .pp-checks { list-style: none; margin-left: 0 !important; }
  .pp-letter .pp-text { line-height: 1.6; }
  .shell, .tabs, .sheet, .toast, .sos { display: none !important; }
  .print-area { display: block; }
  .pp-page { page-break-after: always; break-after: page; }
  .pp-page:last-child { page-break-after: auto; break-after: auto; }
  .pp-cover { text-align: center; padding-top: 1.6in; }
  .pp-cover h1 { font-size: 26pt; margin-bottom: 4pt; }
  .pp-cover .sub { font-size: 14pt; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .6in; }
  .pp-cover table { margin: 0 auto; font-size: 13pt; }
  .pp-cover td { padding: 4pt 10pt; text-align: left; }
  .pp-cover td:first-child { font-weight: bold; text-align: right; }
  .pp-cover img { width: 2.2in; height: 2.6in; object-fit: cover; border: 1px solid #000; margin-bottom: .3in; }
  .pp-page h2 { font-size: 16pt; border-bottom: 2px solid #000; padding-bottom: 4pt; margin-bottom: 12pt; }
  .pp-head { font-size: 9pt; color: #444; display: flex; justify-content: space-between; margin-bottom: 14pt; }
  .pp-field { margin-bottom: 10pt; }
  .pp-field b { display: block; font-size: 10pt; text-transform: uppercase; letter-spacing: .04em; }
  .pp-text { white-space: pre-wrap; }
  .pp-page ul { margin: 4pt 0 0 18pt; padding: 0; }
  .pp-toc li { margin-bottom: 6pt; }
  .pp-sign { margin-top: 30pt; }
  h1, h2, h3 { color: #000; font-family: "Times New Roman", Times, serif; }
}

/* ---------- Look & Feel panel ---------- */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 560px) { .swatches { grid-template-columns: repeat(6, 1fr); } }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink); }
.swatch .dot { width: 40px; height: 40px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.swatch .dot i { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); }
.swatch.on { border-color: var(--purple-2); box-shadow: 0 0 0 3px var(--primary-soft); }
#prefsPanel .seg { margin-bottom: 16px; }

/* ---------- Encouragement ---------- */
.encourage { background: linear-gradient(160deg, var(--surface), var(--gold-soft)); border-color: transparent; }
.enc-title { font-size: 1.25rem; margin: 10px 0 6px; }
.enc-body { font-size: 1.02rem; line-height: 1.65; }
.enc-ref { font-size: .85rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.chip.on { background: var(--purple); color: var(--on-accent); border-color: var(--purple); }

/* ---------- Celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 80; background: rgba(15,10,22,.55); display: grid; place-items: center; padding: 20px; animation: fadein .2s ease-out; }
.celebrate.out { opacity: 0; transition: opacity .2s; }
.celebrate-card { background: var(--bg); border-radius: 26px; padding: 28px 24px; max-width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: pop .35s cubic-bezier(.2,1.4,.4,1); position: relative; z-index: 2; }
.celebrate-burst { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.4s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.pulse { animation: pulse 1.4s ease-in-out infinite; border-radius: 22px; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .75; } }

/* ---------- Brand header ---------- */
.brandbar { display: none; }
@media (max-width: 899px) {
  .brandbar { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; }
  .brandbar img { width: 30px; height: 30px; border-radius: 8px; }
  .brandbar strong { font-family: var(--serif); font-size: 1.05rem; }
}

/* ---------- Install bar ---------- */
.install-bar { position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.18); animation: up .25s ease-out; }
.install-bar > span:first-child { font-size: 1.5rem; }
.install-bar strong { display: block; font-size: .95rem; }
.install-bar small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
@media (min-width: 900px) { .install-bar { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }
.install-steps ol { margin: 6px 0 10px 20px; padding: 0; }
.install-steps li { margin-bottom: 8px; }
@media print { .install-bar { display: none !important; } }
