/* Outurge — test site styles */
:root {
  --paper: #F2F4F3;
  --paper-2: #E8ECEB;
  --white: #FFFFFF;
  --ink: #0F1B24;
  --ink-2: #2E3A44;
  --muted: #4A5560;
  --line: #D5DBDD;
  --line-2: #C3CBCF;
  --field: #9AA5AD;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --dark-line: #2A3944;
  --on-dark: #E9EEF0;
  --on-dark-muted: #A9B6BF;
  --highlight: #FDBA74;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.narrow { max-width: 680px; margin: 0 auto; padding-inline: 24px; }

/* Type */
.eyebrow { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.display { margin: 0; font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 0.92; letter-spacing: -0.005em; text-wrap: balance; }
.h-hero { font-size: clamp(56px, 7.4vw, 108px); }
.h-section { font-size: clamp(40px, 4.6vw, 64px); line-height: 1; }
.h-step { font-size: clamp(40px, 6vw, 56px); line-height: 1; }
.h-card { margin: 0; font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.05; text-transform: uppercase; }
.lead { margin: 0; font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 38ch; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
p { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none;
  border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #22323E; color: #FFFFFF; }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-link { min-height: 48px; padding: 0 4px; background: transparent; color: var(--ink-2); font-weight: 500; }
.btn-link:hover { color: var(--accent); }
.btn[disabled] { background: #DDE2E4; color: var(--muted); cursor: not-allowed; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links a { text-decoration: none; }
.nav-links .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* Layout helpers */
.section { padding-block: 112px; }
.section-sm { padding-block: 96px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 64px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-lg { display: flex; flex-direction: column; gap: 48px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.dark { background: var(--ink); color: var(--on-dark); }
.dark .muted { color: var(--on-dark-muted); }
.tint { background: var(--paper-2); border-block: 1px solid var(--line); }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }

/* Hero */
.hero { padding-block: 88px 96px; }
.hero .stack { gap: 28px; }

/* Scoreboard */
.scoreboard {
  margin: 0; background: var(--ink); color: var(--on-dark); border-radius: 10px; padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
  background-image: repeating-linear-gradient(90deg, rgba(233,238,240,0.05) 0 1px, transparent 1px 64px);
}
.scoreboard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.scoreboard-title { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; }
.tag { font-family: var(--mono); font-size: 12px; color: var(--on-dark-muted); border: 1px solid #3A4954; padding: 4px 8px; border-radius: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 1px; background: var(--dark-line); border: 1px solid var(--dark-line); border-radius: 6px; overflow: hidden; }
.stat { background: var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; color: var(--on-dark-muted); }
.stat-value { font-family: var(--mono); font-size: 34px; line-height: 1.1; }
.stat-value.hl { color: var(--highlight); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week span { height: 36px; border-radius: 3px; background: var(--on-dark); }
.week span.todo { background: transparent; border: 1px dashed var(--on-dark-muted); }
.coach-line { border-top: 1px solid var(--dark-line); padding-top: 20px; display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--dark-line); color: var(--on-dark); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.avatar.light { background: var(--ink); color: var(--paper); }

/* Recognition list */
.recognize { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); border-top: 1px solid #3A4954; }
.recognize p { padding: 28px 28px 28px 0; font-size: 20px; line-height: 1.45; border-bottom: 1px solid #3A4954; }
.big-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; font-size: 15px; }
.big-stat strong { font-family: var(--mono); font-weight: 500; font-size: 44px; color: var(--highlight); line-height: 1; }

/* Steps */
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.steps li { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 3px solid var(--ink); }
.steps .num { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.steps p { color: var(--ink-2); }

/* Line list */
.lines { border-top: 1px solid var(--ink); }
.lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid #B9C3C8; flex-wrap: wrap; }
.lines > div > span:first-child { font-weight: 600; }
.lines > div > span:last-child { font-size: 15px; color: var(--ink-2); }

/* Slip card */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.bar { height: 10px; border-radius: 5px; background: #E1E6E8; }
.bar-split { display: grid; grid-template-columns: 30fr 1fr 33fr; gap: 3px; height: 10px; }
.bar-split span { background: var(--ink); }
.bar-split span:first-child { border-radius: 5px 0 0 5px; }
.bar-split span:last-child { border-radius: 0 5px 5px 0; }
.bar-split span.slip { background: var(--accent); }

/* Pricing */
.price-card { display: flex; flex-direction: column; gap: 24px; padding: 36px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price strong { font-family: var(--display); font-weight: 700; font-size: 72px; line-height: 1; }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks svg { flex: 0 0 auto; margin-top: 3px; }

/* FAQ */
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid #B9C3C8; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-size: 19px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { font-size: 26px; font-weight: 400; line-height: 1; transition: transform 150ms ease; }
.faq details[open] .plus { transform: rotate(45deg); }
.faq details p { margin: 0 0 24px; color: var(--ink-2); max-width: 62ch; }

/* Footer */
.site-footer { background: #0A131A; color: var(--on-dark-muted); font-size: 14px; }
.site-footer .wrap { padding-block: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer a { color: var(--on-dark); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer .links a { color: var(--on-dark-muted); }

/* ---------- Onboarding ---------- */
.ob-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.ob-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.ob-header .brand span { font-size: 24px; }
.progress { height: 3px; background: var(--line); }
.progress > div { height: 3px; width: 4%; background: var(--accent); transition: width 300ms ease; }
.ob-main { padding-block: 64px 96px; }
.ob-step { display: flex; flex-direction: column; gap: 28px; }
.ob-step[hidden] { display: none; }
.ob-step h1:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.chip, .option {
  font: inherit; cursor: pointer; color: var(--ink); background: var(--white);
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chip { min-height: 48px; padding: 0 20px; font-size: 16px; font-weight: 500; border: 1px solid var(--field); border-radius: 999px; }
.option { min-height: 56px; padding: 0 20px; font-size: 17px; font-weight: 500; text-align: left; border: 1px solid var(--line-2); border-radius: 8px; }
.chip:hover, .option:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .option[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); font-weight: 600; }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0; margin-bottom: 12px; font-weight: 600; }
.ob-nav { margin-top: 36px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); }
.ticks li { display: flex; gap: 12px; align-items: center; }

.reveal { background: var(--ink); color: var(--on-dark); border-radius: 10px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 24px; }
.reveal-grid strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 44px; line-height: 1.1; }
.reveal-grid strong.hl { color: var(--highlight); }
.reveal .foot { font-size: 15px; color: #D4DCE0; border-top: 1px solid var(--dark-line); padding-top: 18px; }
.risk-list { border-top: 1px solid var(--ink); }
.risk-list div { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.risk-list div span:first-child { font-weight: 600; }
.risk-list div span:last-child { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.moves { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.moves li { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.moves .n { flex: 0 0 auto; font-family: var(--mono); font-size: 14px; color: var(--accent); padding-top: 2px; }
.moves strong { display: block; }
.moves span.d { font-size: 15px; color: var(--muted); }
.outline-box { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 2px solid var(--ink); border-radius: 10px; }

.chat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #E1E6E8; }
.chat-head strong { display: block; font-size: 15px; }
.bubble { margin: 0; max-width: 82%; padding: 12px 16px; font-size: 16px; line-height: 1.5; animation: pop 220ms ease both; }
.bubble.coach { align-self: flex-start; background: #EEF1F2; border-radius: 4px 14px 14px 14px; }
.bubble.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-radius: 14px 4px 14px 14px; }
.replies { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 6px; }
.replies button { min-height: 44px; padding: 0 16px; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--white); border: 1px solid var(--ink); border-radius: 999px; cursor: pointer; }
.replies button:hover { background: var(--ink); color: var(--white); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: #EEF1F2; border-radius: 4px 14px 14px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 150ms; }
.typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble, .typing i, .progress > div { animation: none; transition: none; } }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.form label { font-size: 15px; font-weight: 600; }
.form input[type="email"], .form input[type="text"] {
  min-height: 52px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1px solid var(--field); border-radius: 6px;
}
.form input::placeholder { color: #6B767F; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; font-weight: 500; background: var(--white); border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; }
.radio-list input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-error { color: #B42318; font-size: 15px; font-weight: 500; }
.hp { display: none; }

/* Language menu */
.i18n-loading body { visibility: hidden; }
.lang-select {
  min-height: 44px; padding: 0 32px 0 12px; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230F1B24' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line-2); border-radius: 6px; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.lang-select:hover { border-color: var(--ink); }
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Mobile refinements */
.radio-list input { flex: 0 0 auto; }
.radio-list label { padding-block: 10px; line-height: 1.35; }
@media (max-width: 520px) {
  .ob-header .wrap { flex-wrap: nowrap; }
  .ob-header #step-label { display: none; }
  .ob-header .brand span { font-size: 22px; }
}

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 18px; padding: 32px; background: var(--white); border: 1px solid var(--line-2); border-radius: 10px; }
.plan .checks { flex: 1 1 auto; font-size: 16px; }
.plan-featured { border: 2px solid var(--ink); box-shadow: 0 0 0 4px rgba(15, 27, 36, 0.06); }
.plan-name { margin: 0; font-family: var(--display); font-weight: 700; font-size: 30px; text-transform: uppercase; line-height: 1; }
.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.plan-price strong { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 12vw, 64px); line-height: 1; }
.badge-soon { background: var(--muted); }
.plan-soon { opacity: .75; }
.badge { font-size: 12px; font-weight: 600; color: #FFFFFF; background: var(--accent); padding: 4px 10px; border-radius: 999px; }
.plan-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px 40px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-2); }
.plan-notes p { padding-top: 16px; }
.price strong { font-size: clamp(48px, 14vw, 72px); }

/* ---------- Money plan ---------- */
.mp-main { padding-block: 56px 96px; display: flex; flex-direction: column; gap: 40px; }
.mp-setup { max-width: 680px; display: flex; flex-direction: column; gap: 32px; }
.mp-setup[hidden], .mp-dash[hidden] { display: none; }
.mp-dash { display: flex; flex-direction: column; gap: 32px; }
.mp-form { max-width: 520px; }
.money-input { display: flex; align-items: center; background: var(--white); border: 1px solid var(--field); border-radius: 6px; }
.money-input:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.money-input span { padding-left: 16px; color: var(--muted); font-weight: 500; }
.money-input input { flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 0 16px 0 6px; font: inherit; font-size: 16px; color: var(--ink); background: transparent; border: 0; outline: none; }
.form input[type="date"] { min-height: 52px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 6px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.mp-grid .card { padding: 28px; }
.bar { overflow: hidden; }
.bar-fill { height: 10px; width: 0; background: var(--accent); border-radius: 5px; transition: width 400ms ease; }
.milestones { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.milestones li { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 500; border-radius: 999px; border: 1px dashed var(--field); color: var(--muted); }
.milestones li.done { border: 1px solid var(--ink); background: var(--ink); color: var(--white); }
.history { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.history li { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.history .h-date { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 96px; }
.history .h-what { flex: 1 1 160px; }
.history .h-amt { font-family: var(--mono); font-size: 15px; }
.history .h-amt.neg { color: var(--accent-dark); }
.history button { min-height: 36px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; }
.history button:hover { color: var(--ink); border-color: var(--ink); }
.mp-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); }
.scoreboard .stat .stat-label:last-child { font-size: 12px; }
#move-msg, #slip-msg { min-height: 1.5em; color: var(--ink-2); }
.mp-grid .card, .mp-grid .form, .mp-grid .row { min-width: 0; max-width: 100%; }
.mp-grid .row > .btn { flex: 0 0 auto; }
@media (max-width: 420px) { .mp-grid .card { padding: 20px; } .mp-grid .row > .btn { width: 100%; } }

/* ---------- Coach ---------- */
.tag-proto { font-family: var(--mono); font-size: 12px; color: var(--accent-dark); border: 1px solid #F3D3BD; background: #FFF4EC; padding: 4px 8px; border-radius: 4px; }
.coach-main { min-height: calc(100vh - 81px); }
.chat-wrap { max-width: 820px; margin: 0 auto; padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 81px); box-sizing: border-box; }
.chat-wrap[hidden] { display: none; }
.chat-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.chat-who { display: flex; align-items: center; gap: 12px; }
.chat-title { margin: 0; font-size: 18px; font-weight: 600; }
.chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ctx-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.ctx-toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.chat-log { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; padding-block: 8px; }
.msg { max-width: 86%; padding: 14px 18px; font-size: 16px; line-height: 1.55; border-radius: 16px; }
.msg p { margin: 0 0 10px; } .msg p:last-child { margin-bottom: 0; }
.msg.coach { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-radius: 16px 4px 16px 16px; white-space: pre-wrap; }
.thinking { align-self: flex-start; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding: 10px 4px; }
.thinking .dots { display: inline-flex; gap: 4px; }
.thinking .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
.thinking .dots i:nth-child(2) { animation-delay: 150ms; } .thinking .dots i:nth-child(3) { animation-delay: 300ms; }
.help-card { align-self: stretch; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #FFF4EC; border: 1px solid #F3D3BD; border-radius: 10px; }
.help-card.crisis { background: #0F1B24; color: var(--on-dark); border-color: #0F1B24; }
.help-card .row { gap: 8px; }
.help-card .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.help-card.crisis .btn-outline { background: transparent; color: var(--on-dark); border-color: var(--on-dark); }
.starters { display: flex; flex-wrap: wrap; gap: 8px; }
.starters button { min-height: 44px; padding: 0 16px; font: inherit; font-size: 15px; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 999px; cursor: pointer; }
.starters button:hover { border-color: var(--ink); }
.composer { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end; padding: 12px 0 4px; background: var(--paper); }
.composer textarea { flex: 1 1 auto; min-height: 52px; max-height: 200px; padding: 14px 16px; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 10px; resize: none; }
.composer textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.composer .btn { min-height: 52px; }
.composer-note { text-align: center; }
.msg-error { align-self: center; font-size: 14px; color: #B42318; }
@media (max-width: 520px) { .msg { max-width: 94%; } .chat-wrap { padding-inline: 16px; } .tag-proto { display: none; } }

/* ---------- Account ---------- */
.ac-main { padding-block: 56px 96px; max-width: 560px; }
.ac-view { gap: 22px; }
.ac-view[hidden] { display: none; }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--ink); }
.form input[type="password"] { min-height: 52px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 6px; }
.form-notice { margin-bottom: 24px; padding: 14px 16px; background: #E5F4E4; border: 1px solid #B9DDB6; border-radius: 8px; font-weight: 500; }
.header-right a { font-size: 15px; font-weight: 500; text-decoration: none; }
.sync-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--ink-2); }
.sync-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--field); }
.sync-line.ok .dot { background: #2E7D32; }
.sync-line.warn .dot { background: var(--accent); }

/* Launch bar */
.launch-bar { background: var(--ink); color: var(--on-dark); font-size: 14px; }
.launch-bar .wrap { padding-block: 10px; text-align: center; }
.launch-bar strong { color: var(--highlight); }
.check.consent { font-size: 14px; font-weight: 400; line-height: 1.45; }

/* Legal pages */
.legal { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.legal article { display: flex; flex-direction: column; gap: 14px; }
.legal h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.1; margin: 22px 0 0; }
.legal h3 { font-size: 17px; font-weight: 600; margin: 10px 0 0; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal-summary { border: 2px solid var(--ink); border-radius: 8px; padding: 18px 20px; background: #fff; }
.legal-summary p { margin: 0 0 8px; }
.legal-note { border-left: 4px solid var(--accent); padding: 10px 14px; background: #fff; }
.ticks li svg, .checks li svg { flex: 0 0 auto; }

/* Long words (French, Spanish) must never push the page sideways on small phones */
.display { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 380px) { .h-section { font-size: 34px; } }

/* ===== App-style landing ===== */
.app-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding-block: 72px 80px; }
.app-hero-text { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.btn-hero { min-height: 60px; padding: 0 32px; font-size: 18px; }
.hero-meta { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.phone { justify-self: center; width: min(340px, 100%); background: var(--ink); color: var(--on-dark); border-radius: 28px; padding: 26px 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -30px rgba(15, 27, 36, 0.55); border: 6px solid #1B2A35; }
.phone-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
.phone-big span, .phone-row span { display: block; font-size: 13px; color: var(--on-dark-muted); }
.phone-big strong { font-family: var(--mono); font-weight: 500; font-size: 46px; color: var(--highlight); line-height: 1.1; }
.phone-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--dark-line); padding-top: 16px; }
.phone-row strong { font-family: var(--mono); font-weight: 500; font-size: 24px; }
.phone-cta { background: var(--accent); color: #fff; text-align: center; font-weight: 600; border-radius: 10px; padding: 14px; }
.section-tight { padding-block: 64px; display: flex; flex-direction: column; gap: 28px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.tile-ic { font-family: var(--mono); font-size: 14px; color: var(--accent); margin-bottom: 6px; }
.tile strong { font-size: 18px; }
.tile span:last-child { color: var(--muted); font-size: 15px; }
.slip-line { margin: 0; font-size: 17px; color: var(--ink-2); }
.plans-compact .plan { padding: 24px; gap: 14px; }
.plans-compact .checks { gap: 8px; font-size: 15px; }
.final { align-items: flex-start; }
@media (max-width: 860px) {
  .app-hero { grid-template-columns: 1fr; gap: 40px; padding-block: 44px 56px; }
  .tiles { grid-template-columns: 1fr; }
  .btn-hero { width: 100%; }
}
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ===== Scoreboard (bilan) ===== */
.bilan { background: var(--ink); color: var(--on-dark); border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; gap: 22px; }
.bilan span { display: block; font-size: 14px; color: var(--on-dark-muted); }
.bilan-main strong { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(48px, 12vw, 72px); line-height: 1.05; color: var(--highlight); }
.bilan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--dark-line); padding-top: 20px; }
.bilan-row strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 30px; line-height: 1.15; margin-top: 4px; }
.bilan-row em { display: block; font-style: normal; font-size: 14px; color: var(--on-dark-muted); }
.bilan-also { border-top: 1px solid var(--dark-line); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.bilan-also[hidden] { display: none; }
.bilan-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bilan-tags span { display: inline-block; font-size: 14px; color: var(--on-dark); border: 1px solid #3A4954; border-radius: 999px; padding: 6px 12px; }
.bilan-note { margin: 0; font-size: 12px; color: var(--on-dark-muted); font-family: var(--mono); }
.bilan-turn { margin: 0; font-size: 20px; font-weight: 600; }
.btn-block { width: 100%; }
.move-link { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--accent); }
@media (max-width: 420px) { .bilan-row { grid-template-columns: 1fr; } }
.ob-main { padding-block: 40px 80px; }

/* Daily journal (journal.html) */
.jr-main { padding-block: 56px 96px; display: flex; flex-direction: column; gap: 40px; max-width: 860px; }
.jr-main[hidden], .jr-main section[hidden] { display: none; }
.jr-form { display: flex; flex-direction: column; gap: 28px; }
.jr-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.jr-form legend { padding: 0; margin-bottom: 12px; font-size: 17px; font-weight: 600; }
.jr-form textarea { width: 100%; min-height: 130px; padding: 14px 16px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 8px; resize: vertical; }
.jr-form textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.jr-urge { display: flex; align-items: center; gap: 16px; }
.jr-urge input[type="range"] { flex: 1 1 auto; accent-color: var(--accent); min-height: 44px; }
.jr-urge output { font-family: var(--mono); font-size: 28px; min-width: 3ch; text-align: right; }
.jr-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.jr-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 4px; }
.jr-strip span { aspect-ratio: 1; border-radius: 4px; background: var(--line); }
.jr-strip span.free { background: #2E7D32; }
.jr-strip span.bet { background: var(--accent); }
.jr-strip span.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.jr-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.jr-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--line); }
.jr-legend i.free { background: #2E7D32; }
.jr-legend i.bet { background: var(--accent); }
.jr-entries { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.jr-entries li { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.jr-entries .jr-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.jr-entries .h-date { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 110px; }
.jr-entries .jr-tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.jr-entries .jr-tag.bet { border-color: var(--accent); color: var(--accent-dark); }
.jr-entries .jr-note { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.jr-entries .jr-actions { display: flex; gap: 8px; margin-left: auto; }
.jr-entries button { min-height: 36px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; }
.jr-entries button:hover { color: var(--ink); border-color: var(--ink); }
.jr-relapse { background: #FFF4EC; border-color: #F3D3BD; }
.jr-relapse .stats { margin-block: 4px; }

/* "Log in" / "My account" link in the header (assets/site.js) */
.nav-account { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-account:hover { color: var(--accent); }

/* Account page, signed in: wider layout with a side menu */
.ac-main.ac-wide { max-width: 1160px; }
.ac-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.ac-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.ac-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; }
.ac-nav a { padding: 11px 14px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; border: 1px solid transparent; }
.ac-nav a:hover { color: var(--ink); background: var(--paper-2); }
.ac-nav a.is-active { color: var(--ink); background: var(--white); border-color: var(--line); }
.ac-panels { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ac-card { gap: 16px; scroll-margin-top: 24px; }
.ac-card .form { max-width: 520px; }
.ac-sub { margin: 0; font-size: 18px; font-weight: 600; }
#ac-security > form + form, #ac-security > form + .stack, #ac-data .ac-sub { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }
.form select { min-height: 52px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 6px; }
.form-ok { margin: 0; color: #166534; font-weight: 500; }
.btn-danger { background: #B91C1C; color: #FFFFFF; }
.btn-danger:hover { background: #991B1B; color: #FFFFFF; }
@media (max-width: 860px) {
  .ac-layout { grid-template-columns: 1fr; gap: 20px; }
  .ac-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .ac-nav a { white-space: nowrap; padding: 9px 12px; }
}
@media (max-width: 520px) { .ac-card { padding: 22px; } }
.ac-card .form > .btn { align-self: flex-start; }
select[data-currency] { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
label:has(> select[data-currency]) { min-width: 0; max-width: 100%; }

/* Home page, signed in: the person's own space (assets/home.js) */
.app-only { display: none; }
.signed-in .app-only { display: flex; }
.signed-in .mk-only { display: none !important; }
.home-app { flex-direction: column; gap: 36px; padding-block: 48px 88px; }
.ha-head { display: flex; flex-direction: column; gap: 10px; }
.ha-head .eyebrow::first-letter { text-transform: uppercase; }
.ha-h2 { margin: 0 0 14px; font-family: var(--display); font-size: 28px; text-transform: uppercase; letter-spacing: 0.01em; }
.ha-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ha-stat { display: flex; flex-direction: column; gap: 4px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.ha-stat:hover { border-color: var(--accent); color: var(--ink); }
.ha-stat-label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ha-stat strong { font-family: var(--display); font-size: clamp(36px, 4.5vw, 52px); line-height: 1.05; overflow-wrap: anywhere; }
.ha-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ha-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); transition: border-color 150ms, transform 150ms; }
a.ha-tile:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.ha-tile strong { font-size: 19px; }
.ha-tile-main { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.ha-tile-main .muted { color: var(--on-dark-muted); }
a.ha-tile-main:hover { color: var(--on-dark); }
.ha-tile-main .tile-ic { color: var(--highlight); }
.ha-tile-soon { opacity: 0.6; }
.ha-lock { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.ha-tile-main .ha-lock { background: var(--dark-line); color: var(--on-dark-muted); }
.ha-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 32px; background: #FFF4EC; border: 1px solid #F6C9A8; border-radius: 14px; }
.ha-help p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.ha-numbers { font-size: 15px; color: var(--ink-2); }
@media (max-width: 860px) {
  .ha-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ha-stats, .ha-grid { grid-template-columns: 1fr; }
  .ha-stat { padding: 18px 20px; }
  .home-app { padding-block: 32px 64px; gap: 28px; }
  .ha-help { padding: 22px; }
}

/* Streak and badges (assets/streak.js) */
.st-head .ha-h2 { margin-bottom: 14px; }
.st-card { display: flex; flex-direction: column; gap: 18px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.st-msg { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ink); max-width: 62ch; }
.st-progress { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.st-bar { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.st-bar > div { height: 100%; min-width: 6px; border-radius: 999px; background: var(--accent); transition: width 400ms ease; }
.st-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.st-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); }
.st-badge strong { font-size: 14px; font-weight: 600; }
.st-badge.is-earned { border: 1px solid #F6C9A8; background: #FFF4EC; color: var(--ink); }
.st-medal { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; font-family: var(--display); font-size: 22px; font-weight: 700; background: var(--paper-2); color: var(--muted); }
.st-badge.is-earned .st-medal { background: var(--accent); color: #FFFFFF; box-shadow: 0 0 0 4px #FDBA74; }
.st-celebrate { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 12px; background: var(--ink); color: var(--on-dark); animation: st-pop 400ms ease both; }
.st-celebrate p { margin: 0; color: var(--on-dark); max-width: 52ch; }
.st-celebrate .stack { flex: 1 1 240px; }
.st-celebrate .btn-outline { color: var(--on-dark); border-color: var(--on-dark-muted); background: transparent; }
.st-new { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--highlight); }
.st-medal-big { width: 64px; height: 64px; font-size: 28px; background: var(--accent); color: #FFFFFF; box-shadow: 0 0 0 5px #FDBA74; }
@keyframes st-pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .st-celebrate { animation: none; } .st-bar > div { transition: none; } }
@media (max-width: 600px) { .st-card { padding: 20px; } .st-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .st-medal { width: 44px; height: 44px; font-size: 19px; } }

/* Home tools: same card for every tool, with an icon and a clear button */
.ha-grid .ha-tile { gap: 10px; padding: 26px; border-radius: 16px; background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,27,36,.04); transition: border-color 150ms, box-shadow 150ms, transform 150ms; }
.ha-grid a.ha-tile:hover, .ha-grid a.ha-tile:focus-visible { border-color: var(--accent); box-shadow: 0 10px 24px rgba(15,27,36,.08); transform: translateY(-3px); color: var(--ink); }
.ha-grid .ha-tile .muted { color: var(--muted); }
.ha-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ha-ic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: #FFF4EC; color: var(--accent); }
.ha-tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.ha-tag-soon { background: var(--paper-2); }
.ha-go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 10px; background: var(--ink); color: #FFFFFF; font-weight: 600; font-size: 15px; transition: background 150ms; }
.ha-go svg { transition: transform 150ms; }
.ha-grid a.ha-tile:hover .ha-go, .ha-grid a.ha-tile:focus-visible .ha-go { background: var(--accent); }
.ha-grid a.ha-tile:hover .ha-go svg { transform: translateX(3px); }
.ha-grid .ha-tile .ha-lock { margin-top: 0; }
.ha-grid .ha-tile-soon { opacity: 1; background: transparent; border-style: dashed; box-shadow: none; }
.ha-grid .ha-tile-soon .ha-ic { background: var(--paper-2); color: var(--muted); }
.ha-grid .ha-tile-soon strong { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ha-grid .ha-tile, .ha-go svg { transition: none; } .ha-grid a.ha-tile:hover { transform: none; } }

/* Netlify's free plan pins a "Powered by Netlify" badge to the bottom corner
   (it can't be moved or hidden on that plan). Leave room under the footer so it
   never covers our content or buttons. */
.site-footer { padding-bottom: 72px; }


/* Signed-in menu (assets/site.js, appNav) */
.signed-in .site-header :is(.header-right, .nav-links) > a { display: none !important; }
.app-nav { position: relative; display: flex; align-items: center; }
.app-nav-links { display: flex; align-items: center; gap: 4px; }
.app-nav-links a { padding: 9px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.app-nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.app-nav-links a[aria-current="page"] { color: var(--ink); background: var(--white); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.app-nav-toggle { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 900px) {
  .app-nav-toggle { display: inline-flex; }
  .app-nav-links { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; flex-direction: column; align-items: stretch; min-width: 220px; padding: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,27,36,.14); }
  .app-nav.open .app-nav-links { display: flex; }
  .app-nav-links a { padding: 12px 14px; }
}
@media (max-width: 900px) {
  /* The dropdown spans the header width, under it, whatever wraps where. */
  .signed-in .site-header nav.wrap { position: relative; }
  .app-nav { position: static; }
  .app-nav-links { left: 24px; right: 24px; top: calc(100% - 4px); min-width: 0; }
}


/* Questions: personal money plan preview and the plans at the end */
.sp-card { display: flex; flex-direction: column; gap: 20px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.sp-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; }
.sp-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.sp-bar { width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), #E0773F); transform-origin: bottom; animation: sp-grow 600ms ease both; }
.sp-lab { font-family: var(--mono); font-size: 11px; color: var(--muted); }
@keyframes sp-grow { from { transform: scaleY(0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sp-bar { animation: none; } }
.sp-marks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-marks div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--paper); }
.sp-marks span { font-size: 13px; color: var(--muted); }
.sp-marks strong { font-family: var(--display); font-size: clamp(26px, 4vw, 36px); line-height: 1; }
.sp-marks strong.acc { color: var(--accent); }
.sp-goal { margin: 0; color: var(--ink-2); }
.sp-badges { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sp-value { margin: 0; padding: 16px 18px; border-radius: 12px; background: #FFF4EC; border: 1px solid #F6C9A8; font-weight: 600; color: var(--ink); }
.sp-incl { margin: 0; }
@media (max-width: 520px) { .sp-card { padding: 20px; } .sp-marks div { padding: 10px; } .sp-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Badge families */
.st-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-count { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--muted); }
.st-progress-list { display: flex; flex-direction: column; gap: 14px; }
.st-fam { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.st-fam-title { margin: 0; font-size: 15px; font-weight: 600; }
.st-badge.is-earned.st-fam-k .st-medal, .st-medal-big.st-fam-k { background: #15803D; box-shadow: 0 0 0 4px #BBF7D0; }
.st-badge.is-earned.st-fam-s .st-medal, .st-medal-big.st-fam-s { background: #0F766E; box-shadow: 0 0 0 4px #99F6E4; }
.st-badge.is-earned.st-fam-g .st-medal, .st-medal-big.st-fam-g { background: #B45309; box-shadow: 0 0 0 4px #FDE68A; }
.st-badge.is-earned.st-fam-j .st-medal, .st-medal-big.st-fam-j { background: #4338CA; box-shadow: 0 0 0 4px #C7D2FE; }
.st-badge.is-earned.st-fam-k, .st-badge.is-earned.st-fam-s { border-color: #BBF7D0; background: #F0FDF4; }
.st-badge.is-earned.st-fam-g { border-color: #FDE68A; background: #FFFBEB; }
.st-badge.is-earned.st-fam-j { border-color: #C7D2FE; background: #EEF2FF; }
.st-medal { font-size: 18px; }

/* ---------- Quiz and program (plan.html, assets/plan.js) ---------- */
.qz-opts { display: grid; gap: 10px; }
.qz-opts.multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.qz-opt { display: flex; align-items: center; gap: 12px; padding: 14px 18px; text-align: left; line-height: 1.35; }
.qz-tick { flex: 0 0 auto; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; background: var(--white); }
.qz-multi .qz-tick { border-radius: 6px; }
.qz-opt[aria-pressed="true"] .qz-tick { border-color: var(--white); background: var(--accent); }
.qz-opt[aria-pressed="true"] .qz-tick::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--white); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.qz-grid { display: flex; flex-direction: column; gap: 12px; }
.qz-row { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.qz-row p { margin: 0; font-weight: 500; }
.qz-cells { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-cell { min-height: 40px; padding: 0 14px; font-size: 15px; }
.qz-range { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.qz-range output { font-family: var(--display); font-size: 56px; font-weight: 700; line-height: 1; }
.qz-range input { width: 100%; accent-color: var(--accent); }
.qz-scale { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.qz-why { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); font-size: 15px; color: var(--ink-2); }
.qz-hero .h-step { color: var(--on-dark); }
.qz-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 16px; }
.qz-facts div { display: flex; flex-direction: column; gap: 4px; }
.qz-facts span { font-size: 14px; color: var(--on-dark-muted); }
.qz-facts strong { font-family: var(--mono); font-weight: 500; font-size: 30px; line-height: 1.1; color: var(--highlight); font-variant-numeric: tabular-nums; }
.qz-alert { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); }
.qz-alert.warn { background: #FFF7E6; border-color: #F2C879; }
.qz-alert p { margin: 0; }
.qz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.qz-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.qz-h3 { margin: 0; font-size: 18px; }
.qz-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.qz-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.qz-pill.lv-low { background: #DCF2E3; color: #15803D; }
.qz-pill.lv-mid { background: #FDF0D5; color: #B45309; }
.qz-pill.lv-high { background: #FBE1E1; color: #B91C1C; }
.qz-pill.lv-none { background: var(--paper-2); color: var(--muted); }
.qz-meter { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.qz-meter div { height: 100%; }
.qz-meter .lv-low { background: #15803D; } .qz-meter .lv-mid { background: #B45309; } .qz-meter .lv-high { background: #B91C1C; } .qz-meter .lv-none { background: var(--field); }
.qz-kv { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.qz-kv strong { text-align: right; font-variant-numeric: tabular-nums; }
.qz-tl { gap: 0; padding-block: 6px; }
.qz-tl-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding-block: 12px; border-top: 1px solid var(--line); }
.qz-tl-row:first-child { border-top: 0; }
.qz-tl-row strong, .qz-tl-row span { display: block; }
.qz-days { display: flex; flex-direction: column; gap: 8px; }
.qz-day { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.qz-dnum { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; text-transform: uppercase; }
.qz-dnum small { display: block; margin-top: 4px; font-family: var(--body); font-size: 12px; font-weight: 500; text-transform: none; color: var(--muted); }
.qz-day ul, .qz-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.qz-tag { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.qz-scroll { overflow-x: auto; }
.qz-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.qz-table th, .qz-table td { padding: 10px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.qz-table th { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.qz-save { padding-top: 24px; border-top: 1px solid var(--line); }

/* ---------- My gains: one card per habit (money.html) ---------- */
.mp-tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-bottom: 24px; }
.mp-track { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mp-track-title { font-size: 24px; }
.mp-track-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.mp-track-stats div { display: flex; flex-direction: column; gap: 2px; }
.mp-track-stats strong { font-family: var(--mono); font-weight: 500; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mp-habit { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 18px; border: 1px solid var(--line); }
.mp-habit-check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.mp-habit-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.mp-habit-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.mp-habit-body[hidden] { display: none; }
.mp-habit-body > p { grid-column: 1 / -1; margin: 0; }
.mp-select { min-height: 50px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--field); border-radius: 6px; }
.st-habits { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.st-habits li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
/* Journal: one block per habit */
.jr-habit { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; }
.jr-habit legend { padding: 0 6px; font-weight: 600; }
.jr-ask { margin: 6px 0 0; font-weight: 500; }
/* Homepage: the four habits, each opens the quiz with it preselected */
.m-habits { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.m-habits .tile { color: inherit; text-decoration: none; transition: border-color .15s; }
.m-habits .tile:hover, .m-habits .tile:focus-visible { border-color: var(--accent); }
/* Bilan: costs, gains, first step, timeline, locked part */
.qz-cost-head { margin: 4px 0 0; font-weight: 600; }
.qz-cost, .qz-health { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.qz-around { font-size: 14px; color: var(--ink-2); }
.qz-gain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qz-gain-grid div { display: flex; flex-direction: column; gap: 2px; }
.qz-gain-grid span { font-size: 12px; color: var(--muted); }
.qz-gain-grid strong { font-family: var(--mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.qz-h4 { margin: 6px 0 0; font-weight: 600; font-size: 15px; }
.qz-first { border-color: var(--accent); border-width: 2px; }
.qz-today { border-color: var(--accent); border-width: 2px; }
.qz-frise { gap: 10px; overflow-x: auto; }
.qz-fr-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; min-width: 520px; }
.qz-fr-name { font-size: 13px; font-weight: 600; }
.qz-fr-ticks { position: relative; height: 18px; }
.qz-fr-ticks span { position: absolute; font-family: var(--mono); font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.qz-fr-track { position: relative; height: 30px; background: var(--paper-2); border-radius: 6px; }
.qz-fr-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; overflow: hidden; display: flex; align-items: center; padding: 0 6px; }
.qz-fr-seg span { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qz-ph-0 { background: #FED7AA; color: #7C2D12; } .qz-ph-1 { background: #FDBA74; color: #7C2D12; } .qz-ph-2 { background: #F97316; color: #fff; } .qz-ph-3 { background: #C2410C; color: #fff; } .qz-ph-4 { background: #7C2D12; color: #fff; }
.qz-fr-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.qz-tl-row.is-past { opacity: .55; }
.qz-locked { position: relative; border-radius: 12px; overflow: hidden; min-height: 420px; }
.qz-skel { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; filter: blur(5px); user-select: none; }
.qz-skel-row { display: flex; gap: 16px; align-items: center; }
.qz-skel-date { width: 56px; height: 10px; border-radius: 4px; background: var(--line); flex: none; }
.qz-skel-bar { height: 10px; border-radius: 4px; background: var(--line-2); }
.qz-lock-card { position: absolute; inset: 24px; margin: auto; max-width: 460px; height: fit-content; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 27, 36, .12); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.qz-lock-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
@media (max-width: 520px) { .qz-gain-grid { grid-template-columns: repeat(2, 1fr); } .qz-lock-card { inset: 12px; padding: 18px; } .qz-locked { min-height: 520px; } }
/* Missions done on the site (program.html) */
.qz-missions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.qz-mission { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--white); display: flex; flex-direction: column; gap: 10px; }
.qz-mission.is-done { border-color: #86C99A; background: #F3FBF5; }
.qz-m-head { display: flex; gap: 10px; align-items: flex-start; }
.qz-m-tick { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.qz-mission.is-done .qz-m-tick { background: #15803D; border-color: #15803D; }
.qz-mission.is-done .qz-m-tick::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.qz-m-text { font-weight: 500; }
.qz-m-body { display: flex; flex-direction: column; gap: 8px; padding-left: 30px; }
.qz-m-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qz-m-row input[type="range"] { flex: 1 1 160px; accent-color: var(--accent); }
.qz-m-input { width: 100%; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--white); color: var(--ink); }
.qz-m-row .qz-m-input { flex: 1 1 200px; width: auto; }
.qz-m-small { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--field); border-radius: 6px; background: var(--white); color: var(--ink); max-width: 140px; }
.qz-m-btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
.qz-m-out { font-family: var(--mono); font-size: 20px; min-width: 2ch; text-align: center; }
.qz-m-clock { font-family: var(--mono); font-size: 32px; }
.qz-m-log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.qz-m-lab { display: flex; flex-direction: column; gap: 4px; }
.qz-m-ifthen { display: flex; flex-direction: column; gap: 10px; }
.qz-m-itrow { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.qz-day .qz-missions .qz-m-body { padding-left: 0; }
@media (max-width: 520px) { .qz-m-body { padding-left: 0; } .qz-day { grid-template-columns: 1fr; } }
