/* Día Uno — hoja de estilos
   Principios: una columna centrada, cifras como contenido, una sola marca visual
   (la regla de marcas que cuenta preguntas y días), sin decoración que no informe. */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/fonts/hanken-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations'), url('/fonts/hanken-grotesk-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f4f6f3;
  --surface: #ffffff;
  --ink: #16202a;
  --ink-2: #4a5661;
  --ink-3: #75808a;
  --line: #dde2dc;
  --line-2: #c3cac2;
  --pine: #265b4d;
  --pine-hover: #1c4a3e;
  --pine-on: #ffffff;
  --pine-wash: #e3eee8;
  --amber: #85590a;
  --amber-wash: #f6eedb;
  --red: #9e3527;
  --red-wash: #f7e6e2;
  --focus: #2b6cb0;
  --radius: 6px;
  --font: 'Hanken Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lead: 1.25rem;
  --t-h3: 1.1875rem;
  --t-h2: 1.5rem;
  --t-h1: 2.125rem;
  --t-display: 4.25rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #11171c;
    --surface: #171f25;
    --ink: #e6ebe8;
    --ink-2: #a7b1b8;
    --ink-3: #7f8a92;
    --line: #273139;
    --line-2: #3a464f;
    --pine: #6db39d;
    --pine-hover: #86c4b0;
    --pine-on: #0d1714;
    --pine-wash: #1a2c27;
    --amber: #d9a64a;
    --amber-wash: #2b2416;
    --red: #e88b77;
    --red-wash: #2f1c19;
    --focus: #7fb0e8;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #11171c;
  --surface: #171f25;
  --ink: #e6ebe8;
  --ink-2: #a7b1b8;
  --ink-3: #7f8a92;
  --line: #273139;
  --line-2: #3a464f;
  --pine: #6db39d;
  --pine-hover: #86c4b0;
  --pine-on: #0d1714;
  --pine-wash: #1a2c27;
  --amber: #d9a64a;
  --amber-wash: #2b2416;
  --red: #e88b77;
  --red-wash: #2f1c19;
  --focus: #7fb0e8;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: 'kern';
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--pine);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--t-h2);
}
h3 {
  font-size: var(--t-h3);
}
h4 {
  font-size: var(--t-body);
}
p {
  margin: 0 0 1em;
  text-wrap: pretty;
}
ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}
li + li {
  margin-top: 0.35em;
}
small,
.small {
  font-size: var(--t-small);
}
.muted {
  color: var(--ink-2);
}
.faint {
  color: var(--ink-3);
}
.num {
  font-variant-numeric: tabular-nums;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus {
  top: 12px;
  color: var(--paper);
}

/* ───────── Estructura ───────── */
.bar {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 14px;
  height: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.brand-mark i {
  background: var(--line-2);
  border-radius: 1px;
}
.brand-mark i:first-child {
  background: var(--pine);
}
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.9375rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 6px 0;
}
.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--ink);
}
.nav a[aria-current='page'] {
  box-shadow: inset 0 -2px 0 var(--pine);
}
.nav .count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  margin-left: 4px;
  border-radius: 99px;
  background: var(--pine);
  color: var(--pine-on);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
  font-weight: 600;
}
.nav-inline-form {
  display: inline;
  margin: 0;
}
.nav-logout {
  font: inherit;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
}
.nav-logout:hover {
  color: var(--ink);
}
.bar .nav-toggle {
  display: none;
}

main {
  display: block;
  min-height: 60vh;
}
.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 24px 16px 72px;
}
.wrap--wide {
  max-width: 1000px;
}
.wrap--narrow {
  max-width: 440px;
}
.center {
  text-align: center;
}
.stack > * + * {
  margin-top: 16px;
}
.section {
  margin-top: 48px;
}
.section:first-child {
  margin-top: 0;
}
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.foot {
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.foot .bar {
  font-size: var(--t-small);
  color: var(--ink-3);
  flex-wrap: wrap;
}
.foot a {
  color: var(--ink-2);
}
.foot-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.env-banner {
  background: var(--amber-wash);
  color: var(--amber);
  font-size: 0.8125rem;
  text-align: center;
  padding: 6px 16px;
}

/* ───────── Botones ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
}
.btn-primary {
  background: var(--pine);
  color: var(--pine-on);
}
.btn-primary:hover {
  background: var(--pine-hover);
  color: var(--pine-on);
}
.btn-secondary {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-secondary:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  padding-left: 8px;
  padding-right: 8px;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 500;
}
.btn-quiet:hover {
  color: var(--ink);
}
.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.9375rem;
}
.btn-block {
  width: 100%;
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.actions--split {
  justify-content: space-between;
}
.actions--center {
  justify-content: center;
}
.inline-form {
  display: inline;
}

/* ───────── Formularios ───────── */
.field {
  margin: 0 0 20px;
}
.field > label,
.label {
  display: block;
  font-weight: 560;
  margin-bottom: 6px;
}
.hint {
  display: block;
  color: var(--ink-2);
  font-size: var(--t-small);
  margin-top: -2px;
  margin-bottom: 8px;
}
.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  appearance: none;
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
textarea.input {
  min-height: 120px;
  line-height: 1.5;
}
.input:hover {
  border-color: var(--ink-3);
}
.input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}
.input[aria-invalid='true'] {
  border-color: var(--red);
}
.input--num {
  font-variant-numeric: tabular-nums;
}
.error-text {
  display: block;
  color: var(--red);
  font-size: var(--t-small);
  margin-top: 6px;
  font-weight: 500;
}
.money {
  display: flex;
  align-items: stretch;
}
.money .prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.money .input {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.pair {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.45;
}
.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--pine);
  flex: none;
}
.unknown {
  margin-top: 16px;
  color: var(--ink-2);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend {
  padding: 0;
}

.options {
  display: grid;
  gap: 8px;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  line-height: 1.35;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.option:hover {
  border-color: var(--ink-3);
}
.option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pine);
  flex: none;
}
.option:has(input:checked) {
  border-color: var(--pine);
  background: var(--pine-wash);
}
.option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.error-summary {
  border: 1px solid var(--red);
  background: var(--red-wash);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.error-summary h2 {
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--red);
}
.error-summary ul {
  margin: 0;
}
.error-summary a {
  color: var(--red);
}

/* ───────── Regla de marcas (progreso de preguntas y días) ───────── */
.ticks {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ticks li {
  flex: 0 0 3px;
  height: 10px;
  margin: 0;
  background: var(--line-2);
  border-radius: 1px;
}
.ticks li.done {
  background: var(--ink);
}
.ticks li.skip {
  background: var(--line);
}
.ticks li.now {
  background: var(--pine);
  height: 22px;
}
.ticks--days {
  height: 30px;
}
.ticks--days li {
  flex-basis: 2px;
  height: 14px;
}
.ticks--days li.week {
  height: 20px;
}
.ticks--days li.now {
  height: 30px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: var(--t-small);
  color: var(--ink-2);
}

/* ───────── Portada ───────── */
.hero {
  text-align: center;
  padding: 56px 0 32px;
}
.hero h1 {
  font-size: clamp(2.125rem, 5.4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin: 0 auto 20px;
  font-weight: 620;
}
.hero .lead {
  max-width: 34em;
  margin: 0 auto 32px;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--ink-2);
}
.hero-ticks {
  max-width: 420px;
  margin: 48px auto 0;
}
.hero-ticks .progress-meta {
  justify-content: center;
}
.journey {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.journey li {
  list-style: none;
  padding: 18px 16px 4px 0;
  margin: 0;
}
.journey li + li {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.journey .step {
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  font-size: var(--t-small);
}
.journey h3 {
  font-size: 1rem;
  margin: 2px 0 4px;
}
.journey p {
  font-size: var(--t-small);
  color: var(--ink-2);
  margin: 0;
}
.price-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--pine);
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.split h3 {
  font-size: 1rem;
}
.ticklist {
  list-style: none;
  padding: 0;
}
.ticklist li {
  position: relative;
  padding-left: 22px;
}
.ticklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 2px;
  background: var(--pine);
}
.ticklist--muted li::before {
  background: var(--line-2);
}

/* ───────── Pregunta ───────── */
.q-head {
  margin-bottom: 36px;
}
.q-section {
  color: var(--pine);
  font-weight: 600;
  font-size: var(--t-small);
  margin: 0 0 8px;
}
.q-title {
  font-size: var(--t-h2);
  line-height: 1.25;
  margin-bottom: 10px;
}
.q-help {
  color: var(--ink-2);
  margin-bottom: 24px;
}
.previous {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9375rem;
}
.saved-note {
  font-size: var(--t-small);
  color: var(--ink-3);
  text-align: center;
  margin-top: 28px;
}

.rows {
  display: grid;
  gap: 16px;
}
.row-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}
.row-card .row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.breakdown .field {
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.breakdown .field > label {
  margin: 0;
  font-weight: 450;
}
.breakdown .error-text {
  grid-column: 1 / -1;
  margin-top: -4px;
}

/* ───────── Revisión ───────── */
.review {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.review li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 4px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.review .n {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
  padding-top: 2px;
}
.review .q {
  font-weight: 500;
}
.review .a {
  grid-column: 2;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.review .missing {
  color: var(--red);
}
.review .edit {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: center;
  font-size: var(--t-small);
}

/* ───────── Resultados y cifras ───────── */
.label-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-small);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 99px;
  padding: 2px 10px;
}
.figures {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  border-top: 1px solid var(--line);
}
.figures li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.figures .k {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.figures .v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.figures li.total {
  border-bottom: 2px solid var(--ink);
}
.figures li.total .v {
  font-size: 1.125rem;
}
.figures li.sub .k {
  padding-left: 14px;
  color: var(--ink-2);
}
.figures li.sub .v {
  font-weight: 450;
  color: var(--ink-2);
}
.neg {
  color: var(--red);
}
.pos {
  color: var(--pine);
}

.src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-weight: 450;
}
.src::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.src--dato::before {
  background: var(--ink);
}
.src--calculo::before {
  background: var(--pine);
}
.src--supuesto::before {
  border: 1.5px solid var(--amber);
  width: 5px;
  height: 5px;
}
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 8px 0 24px;
}

.findings {
  list-style: none;
  padding: 0;
  margin: 0;
}
.findings li {
  position: relative;
  padding: 0 0 0 22px;
  margin: 0 0 12px;
}
.findings li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pine);
}
.findings--risk li::before {
  background: transparent;
  border: 2px solid var(--red);
  width: 7px;
  height: 7px;
}
.findings--risk li.medio::before {
  border-color: var(--amber);
}
.findings--risk li.bajo::before {
  border-color: var(--line-2);
}
.findings--missing li::before {
  background: transparent;
  border: 1.5px dashed var(--ink-3);
}

.priority-list {
  list-style: none;
  counter-reset: p;
  padding: 0;
  margin: 0;
}
.priority-list li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 2rem 1fr;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.priority-list li::before {
  content: counter(p);
  font-variant-numeric: tabular-nums;
  color: var(--pine);
  font-weight: 650;
}

.action-card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.action-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 4px;
}
.action-card p {
  margin: 0;
  color: var(--ink-2);
}
.action-card .meta {
  margin-top: 10px;
  font-size: var(--t-small);
  color: var(--ink-3);
  display: grid;
  gap: 4px;
}
.action-card .meta strong {
  color: var(--ink-2);
  font-weight: 560;
}

.note {
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin: 0 0 16px;
}
.note > :last-child {
  margin-bottom: 0;
}
.note--ok {
  background: var(--pine-wash);
  border-color: transparent;
}
.note--warn {
  background: var(--amber-wash);
  border-color: transparent;
}
.note--warn strong:first-child {
  color: var(--amber);
}
.note--risk {
  background: var(--red-wash);
  border-color: transparent;
}
.note--risk strong:first-child {
  color: var(--red);
}
.flash {
  margin-bottom: 24px;
}

/* ───────── Oferta ───────── */
.offer {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
}
.offer + .offer {
  margin-top: 16px;
}
.offer--featured {
  border-color: var(--pine);
  box-shadow: 0 0 0 1px var(--pine);
}
.offer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.offer-head h3 {
  margin: 0;
}
.offer .price {
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.offer .price small {
  font-size: var(--t-small);
  font-weight: 450;
  color: var(--ink-2);
  margin-left: 4px;
}
.terms {
  font-size: var(--t-small);
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}
.terms dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0;
}
.terms dt {
  color: var(--ink-3);
}
.terms dd {
  margin: 0;
}

/* ───────── Inicio y Día Uno ───────── */
.day {
  text-align: center;
  padding: 24px 0 8px;
}
.day-number {
  font-size: var(--t-display);
  font-weight: 280;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.day-number span {
  font-size: 1.25rem;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--ink-3);
  margin-left: 6px;
}
.day-caption {
  color: var(--ink-2);
  margin: 10px 0 24px;
}
.next-step {
  border: 1px solid var(--pine);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
  margin: 28px 0;
}
.next-step .kicker {
  font-size: var(--t-small);
  color: var(--pine);
  font-weight: 600;
  margin: 0 0 4px;
}
.next-step h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.journey-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.journey-list li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.journey-list .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}
.journey-list .done .dot {
  background: var(--pine);
  border-color: var(--pine);
}
.journey-list .current .dot {
  border-color: var(--pine);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 6px var(--pine);
}
.journey-list .title {
  font-weight: 500;
}
.journey-list .sub {
  display: block;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.journey-list .go {
  font-size: var(--t-small);
}

/* ───────── Tablero ───────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 0 32px;
}
.stat {
  padding: 16px 16px 16px 0;
}
.stat + .stat {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.stat .k {
  font-size: var(--t-small);
  color: var(--ink-2);
  display: block;
}
.stat .v {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  display: block;
  line-height: 1.3;
}
.stat .s {
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.meter {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--pine);
  border-radius: 3px;
}
.goal {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.goal:first-child {
  border-top: 1px solid var(--line);
}
.goal-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.task:first-child {
  border-top: 1px solid var(--line);
}
.task-title {
  font-weight: 560;
}
.task-meta {
  font-size: var(--t-small);
  color: var(--ink-2);
}
.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task.is-done .task-title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart text {
  font-family: var(--font);
  font-size: 11px;
  fill: var(--ink-3);
}
.tabs {
  display: flex;
  gap: 4px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.tabs a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 10px 0;
  font-size: 0.9375rem;
}
.tabs a[aria-current='page'] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--pine);
  font-weight: 560;
}

/* ───────── Tablas ───────── */
.table-wrap {
  width: 100%;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-weight: 560;
  color: var(--ink-2);
  font-size: var(--t-small);
}
table.data td.r,
table.data th.r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.data tr:last-child td {
  border-bottom: 0;
}

/* ───────── Plan ───────── */
.plan-block {
  margin-top: 56px;
}
.plan-block > h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.narrative {
  color: var(--ink-2);
  font-size: 1.0625rem;
}
.narrative-note {
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.alloc {
  display: flex;
  height: 12px;
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 10px;
  background: var(--line);
}
.alloc span {
  display: block;
  height: 100%;
}
.alloc span + span {
  border-left: 2px solid var(--paper);
}
.alloc .a1 {
  background: var(--ink);
}
.alloc .a2 {
  background: var(--pine);
}
.alloc .a3 {
  background: var(--ink-3);
}
.alloc .a4 {
  background: var(--line-2);
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: baseline;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.timeline .when {
  font-variant-numeric: tabular-nums;
  color: var(--pine);
  font-weight: 600;
  font-size: 0.9375rem;
}
.timeline h3 {
  font-size: 1.0625rem;
  margin-bottom: 4px;
}
.timeline p {
  margin: 0 0 4px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.timeline .meta {
  font-size: var(--t-small);
  color: var(--ink-3);
}
.versions {
  font-size: var(--t-small);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-2);
  border-top-color: var(--pine);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.9s linear infinite;
  vertical-align: -3px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ───────── Coach ───────── */
.chat {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 24px 0;
}
.msg {
  max-width: 88%;
}
.msg--usuario {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 12px 12px 3px 12px;
}
.msg--coach,
.msg--sistema {
  align-self: flex-start;
}
.msg--coach .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px 12px 12px 3px;
}
.msg--sistema .bubble {
  background: var(--amber-wash);
  color: var(--amber);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.msg .who {
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.msg .bubble > :last-child {
  margin-bottom: 0;
}
.msg-tag {
  display: inline-block;
  font-size: 0.75rem;
  border: 1px dashed var(--amber);
  color: var(--amber);
  border-radius: 99px;
  padding: 0 8px;
  margin-bottom: 6px;
}
.proposal {
  margin-top: 12px;
  border: 1px solid var(--pine);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--pine-wash);
  color: var(--ink);
}
.proposal h4 {
  margin: 0 0 4px;
  font-size: 0.9375rem;
}
.proposal p {
  font-size: 0.9375rem;
  margin: 0 0 8px;
}
.proposal .actions {
  margin-top: 8px;
}
.composer {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
}
.composer form {
  display: flex;
  gap: 8px;
}
.composer textarea {
  min-height: 46px;
  height: 46px;
  resize: vertical;
}
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.suggestions button {
  font: inherit;
  font-size: var(--t-small);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
}
.suggestions button:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}
.compare th:not(:first-child),
.compare td:not(:first-child) {
  text-align: right;
}

/* ───────── Administración ───────── */
.admin-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
}
.admin-grid > *,
.cols > *,
.split > * {
  min-width: 0;
}
table.data td {
  overflow-wrap: anywhere;
}
.links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9375rem;
}
.admin-nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: var(--radius);
}
.admin-nav a[aria-current='page'] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 560;
  box-shadow: inset 2px 0 0 var(--pine);
}
.funnel {
  list-style: none;
  padding: 0;
  margin: 0;
}
.funnel li {
  display: grid;
  grid-template-columns: 13rem 1fr 4rem 4rem;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  font-size: 0.9375rem;
}
.funnel .bar-fill {
  height: 10px;
  background: var(--pine);
  border-radius: 2px;
  min-width: 2px;
}
.funnel .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.funnel .p {
  text-align: right;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
}
.code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.875rem;
}
textarea.code {
  min-height: 420px;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  border-radius: 99px;
  padding: 1px 8px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge--ok {
  border-color: var(--pine);
  color: var(--pine);
}
.badge--warn {
  border-color: var(--amber);
  color: var(--amber);
}
.badge--bad {
  border-color: var(--red);
  color: var(--red);
}
.prose h2 {
  font-size: 1.25rem;
  margin-top: 1.6em;
}
.prose h3 {
  font-size: 1.0625rem;
  margin-top: 1.4em;
}
.prose ul {
  padding-left: 1.2em;
}
.empty {
  text-align: center;
  padding: 40px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-2);
}
.empty h3 {
  color: var(--ink);
}
details.more > summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
details.more[open] > summary {
  margin-bottom: 12px;
}
.sandbox {
  border: 2px dashed var(--amber);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}

/* ───────── Pantallas pequeñas (desde 360 px) ───────── */
@media (max-width: 760px) {
  :root {
    --t-h1: 1.75rem;
    --t-h2: 1.3125rem;
    --t-display: 3.5rem;
  }
  .wrap {
    padding-top: 12px;
  }
  .hero {
    padding-top: 28px;
  }
  .journey {
    grid-template-columns: 1fr 1fr;
  }
  .journey li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .journey li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .split,
  .cols,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .breakdown .field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .funnel li {
    grid-template-columns: 1fr 3.5rem 3.5rem;
  }
  .funnel .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .bar .nav-toggle {
    display: inline-flex;
  }
  .js .nav[data-collapsible] {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    z-index: 5;
  }
  .js .nav[data-collapsible].open {
    display: flex;
  }
  .bar {
    position: relative;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  table.data.stack-sm thead {
    display: none;
  }
  table.data.stack-sm tr {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  table.data.stack-sm td {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    border: 0;
    padding: 4px 0;
    text-align: right;
  }
  table.data.stack-sm td::before {
    content: attr(data-label);
    color: var(--ink-3);
    text-align: left;
    font-size: var(--t-small);
    flex: none;
  }
  table.data.stack-sm td:first-child {
    display: block;
    text-align: left;
    padding-bottom: 6px;
  }
  table.data.stack-sm td:first-child::before {
    display: none;
  }
  table.data.stack-sm td:empty {
    display: none;
  }
  table.data.stack-sm td.r {
    text-align: right;
  }
}
@media (max-width: 420px) {
  .pair,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .actions--split {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .actions--split .btn {
    width: 100%;
  }
  .msg {
    max-width: 96%;
  }
  .offer {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .bar nav,
  .foot,
  .actions,
  .composer,
  .env-banner {
    display: none !important;
  }
  body {
    background: #fff;
  }
}

.input--short {
  max-width: 200px;
}
.money--suffix .input {
  border-radius: var(--radius) 0 0 var(--radius);
}
.money--suffix .prefix {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 0;
  border-right: 1px solid var(--line-2);
}
.offer-note {
  margin-top: 12px;
}
.swatch.alloc-a1 {
  background: var(--ink);
}
.swatch.alloc-a2 {
  background: var(--pine);
}
.swatch.alloc-a3 {
  background: var(--ink-3);
}
.swatch.alloc-a4 {
  background: var(--line-2);
}
