/* Cappataz · estilo "Obra": concreto, franjas de precaución, bordes gruesos y señales de obra.
   Colores en un solo lugar. Modo claro por defecto; modo oscuro automático según el teléfono. */
:root {
  --bg: #e9e7e1;            /* concreto */
  --dots: rgba(22, 23, 26, 0.07);
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --text: #16171a;
  --muted: #55524b;
  --line: #16171a;          /* bordes gruesos de las tarjetas */
  --line-soft: #c9c5bb;     /* separadores finos */
  --hard: #16171a;          /* sombra dura de las tarjetas */
  --bar: #16171a;           /* barra superior */
  --bar-ink: #f4f2ec;
  --accent: #e8a33d;        /* ámbar de Cappataz: rellenos (botones, rombos, cinta) */
  --accent-ink: #16171a;    /* texto sobre el ámbar */
  --accent-text: #8a5300;   /* ámbar oscuro para texto pequeño sobre claro */
  --accent-soft: #f7e6c4;
  --ok: #2f7d4f;
  --ok-soft: #dcf1e4;
  --warn-soft: #fff1c7;
  --danger: #a8392a;
  --radius: 0px;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --stencil: 'Saira Stencil One', 'Barlow Condensed', system-ui, sans-serif;
  --brand: 'Archivo', 'Barlow', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121316;
    --dots: rgba(242, 239, 233, 0.05);
    --surface: #1c1e22;
    --surface-2: #24272c;
    --text: #f2efe9;
    --muted: #b3afa6;
    --line: #5c5f66;
    --line-soft: #34373d;
    --hard: #000000;
    --bar: #0b0c0e;
    --bar-ink: #f2efe9;
    --accent: #e8a33d;
    --accent-ink: #16171a;
    --accent-text: #f0b45a;
    --accent-soft: #3a2c16;
    --ok: #5cc28a;
    --ok-soft: #173326;
    --warn-soft: #33290f;
    --danger: #ef7d68;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #121316;
  --dots: rgba(242, 239, 233, 0.05);
  --surface: #1c1e22;
  --surface-2: #24272c;
  --text: #f2efe9;
  --muted: #b3afa6;
  --line: #5c5f66;
  --line-soft: #34373d;
  --hard: #000000;
  --bar: #0b0c0e;
  --bar-ink: #f2efe9;
  --accent: #e8a33d;
  --accent-ink: #16171a;
  --accent-text: #f0b45a;
  --accent-soft: #3a2c16;
  --ok: #5cc28a;
  --ok-soft: #173326;
  --warn-soft: #33290f;
  --danger: #ef7d68;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 9px 9px;
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

#root {
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.05;
  margin: 0;
}

a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Franjas de precaución arriba y abajo */
.stripe {
  flex: none;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, #16171a 14px 28px);
}

/* Barra superior negra */
.topbar {
  background: var(--bar);
  color: var(--bar-ink);
  padding-top: env(safe-area-inset-top);
}

.topbar-in {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.brand img {
  border-radius: 7px;
}

/* Logo de texto de Cappataz: todo en minúscula y "app" en ámbar, más grueso (Archivo, como en la marca). */
.wordmark {
  font-family: var(--brand);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.wordmark .wm-app {
  color: var(--accent);
  font-weight: 800;
}

.pill {
  font-family: var(--stencil);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 3px 8px;
  white-space: nowrap;
}

.app {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 12px 16px env(safe-area-inset-bottom);
}

.draft {
  font-size: 13px;
  line-height: 1.4;
  background: var(--warn-soft);
  border: 1.5px solid var(--line);
  padding: 8px 12px;
}

main {
  flex: 1;
}

.screen {
  padding: 18px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Inicio */
.kicker {
  margin: 0;
  font-family: var(--stencil);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro h1.hero {
  font-weight: 800;
  font-size: clamp(38px, 11.5vw, 56px);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.hero mark {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-en {
  margin: -4px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  text-transform: uppercase;
  color: var(--muted);
}

.screen h2 {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 6px;
}

.lead {
  font-size: 17px;
  margin: 0;
}

.muted {
  color: var(--muted);
  margin: 0;
}

/* Opciones grandes, fáciles de tocar */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 64px;
  box-shadow: 4px 4px 0 var(--hard);
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}

.choice:hover:not(:disabled) {
  background: var(--accent-soft);
}

.choice:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--hard);
}

.choice:disabled {
  cursor: not-allowed;
  box-shadow: none;
  border-style: dashed;
  border-color: var(--line-soft);
  background: var(--surface-2);
  color: var(--muted);
}

.choice-icon {
  font-size: 24px;
  line-height: 1;
}

.choice-label {
  flex: 1;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  flex-direction: column;
}

.choice-label small,
.choice-badge small {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.choice-badge {
  font-family: var(--stencil);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  display: flex;
  flex-direction: column;
  max-width: 45%;
}

.zone-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-group.is-soon .choice {
  min-height: 52px;
  padding: 10px 16px;
}

.zone-state {
  font-family: var(--stencil);
  font-weight: 400;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 10px;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 8px 0;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.link-btn.danger {
  color: var(--danger);
  margin-top: 8px;
}

/* Contexto: zona, ID, idioma */
.context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--surface);
  border: 1.5px solid var(--line);
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
}

/* Avance: una cinta métrica que se llena de ámbar */
.progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 10px 12px;
}

.progress-bar {
  position: relative;
  height: 26px;
  background: var(--accent-soft);
  border: 2px solid var(--line);
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 13px;
  background-image: linear-gradient(90deg, var(--text) 2px, transparent 2px), linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 40px 13px, 10px 7px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 2px 0 0 var(--line);
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 15px;
  color: var(--muted);
}

.progress-text strong {
  color: var(--text);
}

/* Elegir camino: con ayuda o por mi cuenta */
.path-choice {
  margin-top: 4px;
}

.path-q {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.path-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.path-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--surface-2);
  border: 2px solid var(--line);
  padding: 12px;
  min-height: 64px;
}

.path-btn:hover {
  background: var(--accent-soft);
}

.path-btn.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.path-btn.on small {
  color: var(--accent-ink);
}

.path-icon {
  font-size: 22px;
  line-height: 1.2;
}

.path-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.path-text small {
  color: var(--muted);
  font-size: 13px;
}

.path-intro {
  margin: 14px 0 0;
}

/* Capa 2 (negocio) */
.l2-card {
  margin-top: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--accent);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.l2-card h3,
.exp-card h3,
.exp-zone h3 {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}

.l2-card p {
  margin: 0;
}

.l2-card .progress {
  border: 0;
  padding: 4px 0 0;
}

.l2-card.is-locked,
.exp-card.is-locked {
  box-shadow: none;
  border: 2px dashed var(--line-soft);
  background: repeating-linear-gradient(-45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px);
}

.state-rule {
  margin-top: 14px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  padding: 10px 14px;
}

.step-body .state-rule h4 {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* Calculadora de precios */
.calc-open {
  margin-top: 14px;
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--line);
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  min-height: 52px;
}

.calc {
  margin-top: 14px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--hard);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.calc-head .link-btn {
  white-space: nowrap;
}

.step-body .calc-head h4 {
  margin: 0;
}

.calc p {
  margin: 0;
}

.calc-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 600;
}

.calc-toggle input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
}

.calc-toggle small {
  display: block;
  font-weight: 400;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.calc-field:has(select),
.calc-field:has(.link-btn) {
  grid-column: 1 / -1;
}

.calc-field small {
  font-weight: 400;
  font-size: 12px;
}

.calc-field input,
.calc-field select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 17px;
}

.calc-field input:focus,
.calc-field select:focus {
  outline: 3px solid var(--accent);
  outline-offset: 0;
}

.calc-results {
  border-top: 2px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-big {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
  text-align: center;
}

.calc-big > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  padding: 8px 4px;
}

.calc-big strong {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
}

.calc-price {
  background: var(--accent) !important;
  color: var(--accent-ink);
}

.calc-warn {
  color: var(--danger);
  font-weight: 700;
}

.calc-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 6px;
}

.calc-detail td {
  padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
}

.calc-detail td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Zonas de expansión (DC, Virginia) */
.exp-card {
  margin-top: 8px;
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-card p {
  margin: 0;
}

.exp-unlock {
  align-self: flex-start;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--hard);
  padding: 10px 14px;
  font-weight: 700;
  min-height: 48px;
}

.exp-unlock:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--hard);
}

.exp-choose {
  font-weight: 700;
}

.exp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-chip {
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 10px 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
  min-height: 48px;
}

.exp-chip.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.exp-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.small {
  font-size: 13px;
}

.id-banner {
  background: var(--ok-soft);
  border: 1.5px solid var(--ok);
  padding: 10px 12px;
  font-size: 15px;
}

.celebrate {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--ok-soft);
  border: 2px solid var(--ok);
  box-shadow: 4px 4px 0 var(--ok);
  padding: 14px 16px;
}

.celebrate span {
  font-size: 28px;
}

.celebrate p {
  margin: 4px 0 0;
}

/* Pasos: cada número es una señal de obra (rombo) */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  background: var(--surface);
  border: 2px solid var(--line);
}

.step.is-open {
  box-shadow: 5px 5px 0 var(--accent);
}

.step.is-done:not(.is-open) {
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 14px 14px 18px;
  min-height: 68px;
  text-align: left;
}

.step-num {
  flex: none;
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}

.step-num > span {
  transform: rotate(-45deg);
  line-height: 1;
}

.is-open .step-num {
  background: var(--accent);
  color: var(--accent-ink);
}

.is-done .step-num {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.step-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.step-next {
  font-family: var(--stencil);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.step-title {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
}

.is-done .step-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.step-summary {
  font-size: 14px;
  color: var(--muted);
}

.chevron {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  transition: transform 0.2s;
}

.is-open .chevron {
  transform: rotate(90deg);
}

.step-body {
  padding: 0 16px 16px 68px;
  border-top: 1.5px solid var(--line-soft);
  padding-top: 4px;
}

.step-body h4 {
  font-family: var(--stencil);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 16px 0 6px;
}

.step-body p {
  margin: 0;
}

/* Franja de números clave del paso */
.facts {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
}

.fact {
  background: var(--surface);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fact.is-key {
  background: var(--accent);
  color: var(--accent-ink);
}

.fact dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
}

.fact dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted);
}

.fact.is-key dd {
  color: var(--accent-ink);
}

.todo,
.links {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo li::marker {
  color: var(--accent-text);
  font-weight: 700;
}

.links {
  list-style: none;
  padding-left: 0;
  gap: 10px;
}

.links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  font-weight: 700;
  text-decoration: none;
}

.links a:hover {
  background: var(--accent-soft);
}

.link-guide {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--line-soft);
  padding: 2px 0 2px 10px;
  user-select: text;
}

.callout,
.tip {
  padding: 10px 12px;
  font-size: 15px;
  margin-top: 14px;
}

.callout {
  background: var(--accent-soft);
  border: 1.5px solid var(--line);
}

.tip {
  background: var(--bar);
  color: var(--bar-ink);
}

.tip strong {
  font-family: var(--stencil);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.done-btn {
  margin-top: 18px;
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--hard);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: var(--accent-ink);
}

.done-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--hard);
}

.done-btn.on {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
  box-shadow: none;
}

/* Pie */
.footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0 20px;
  border-top: 2px solid var(--line);
}

.footer p {
  margin: 2px 0;
}

.footer a {
  color: inherit;
}

@media (max-width: 400px) {
  .step-body {
    padding-left: 16px;
  }
  .fact dt {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Ícono de zona: silueta del estado con su sigla en una placa negra */
.state-icon {
  flex: none;
  position: relative;
  width: 52px;
  height: 52px;
}

.state-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.state-icon path {
  fill: var(--accent);
  stroke: var(--text);
  stroke-width: 4;
  stroke-linejoin: round;
}

.state-icon b {
  position: absolute;
  right: -6px;
  bottom: -4px;
  background: #16171a;
  color: #f4f2ec;
  border: 1.5px solid var(--surface);
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 3px 4px 2px;
}

.state-icon.is-soon path {
  fill: var(--surface-2);
  stroke: var(--muted);
  stroke-dasharray: 6 5;
}

.state-mini {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}

.state-mini path {
  fill: var(--accent);
  stroke: var(--text);
  stroke-width: 6;
  stroke-linejoin: round;
}

/* ---------- Calculadora v2: secciones con subtotal, resumen, plan de pagos y barra fija ---------- */
.calc {
  position: relative;
  gap: 14px;
}

.calc-sec {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 12px;
}

.calc-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px solid var(--line-soft);
  padding-bottom: 8px;
}

.calc-sec-head h5 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
}

.calc-sec-head b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.calc-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
}

.calc-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--line);
}

.calc-switch button {
  min-height: 44px;
  background: var(--surface);
  border: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
}

.calc-switch button + button {
  border-left: 2px solid var(--line);
}

.calc-switch button.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.calc-empty {
  margin: 0;
  padding: 12px;
  border: 2px dashed var(--line-soft);
  color: var(--muted);
  font-size: 15px;
}

.calc-results {
  border-top: 0;
  padding-top: 0;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--surface);
  border: 2px solid var(--line);
}

.calc-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.calc-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-table tr.sum td {
  font-weight: 700;
  border-top: 2px solid var(--line);
  background: var(--surface-2);
}

.calc-plan tr.balance td {
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
}

.calc-actions {
  flex-direction: column;
  align-items: stretch;
}

.calc-actions .exp-unlock,
.calc-actions .link-btn {
  align-self: flex-start;
}

.calc-copy {
  margin-top: 0;
}

.calc-copied {
  margin: 0;
  font-weight: 700;
  color: var(--ok);
}

.calc-copytext {
  width: 100%;
  min-height: 160px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: 15px/1.4 var(--body);
  padding: 8px;
}

/* Barra fija: el precio en vivo mientras se baja por la calculadora */
.calc-bar {
  position: sticky;
  bottom: env(safe-area-inset-bottom);
  z-index: 2;
  margin: 0 -14px -14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  background: var(--bar);
  color: var(--bar-ink);
  border-top: 3px solid var(--accent);
  padding: 8px 10px;
}

.calc-bar span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calc-bar small {
  font-size: 11px;
  color: var(--bar-ink);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-bar b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.calc-bar span:first-child b {
  color: var(--accent);
}

.calc-bar .calc-bar-empty {
  grid-column: 1 / -1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.85;
}

/* ---------- Estimados y facturas ---------- */
.calc-to-est {
  background: var(--accent-soft);
}

.est .calc-sec + .calc-sec {
  margin-top: 2px;
}

.est-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.est-wide {
  grid-column: 1 / -1;
}

.est textarea,
.est-notes {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: 500 16px/1.4 var(--body);
  resize: vertical;
}

.est-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.est-logo img,
.est-logo-empty {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #ffffff;
  border: 2px solid var(--line);
  flex: none;
}

.est-logo-empty {
  display: grid;
  place-items: center;
  font-family: var(--stencil);
  font-size: 12px;
  color: #8a8f99;
  border-style: dashed;
}

.est-logo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.est-file {
  position: relative;
  cursor: pointer;
}

.est-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.est-colors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.est-swatches {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  max-width: 360px;
}

.est-swatch {
  width: 100%;
  aspect-ratio: 1;
  min-height: 32px;
  border: 2px solid var(--line);
  padding: 0;
}

.est-swatch.on {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.est-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed var(--line-soft);
}

.est-item-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.est-item-row .calc-field {
  flex: 1;
}

.est-sub {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
}

.est-warn {
  margin: 0;
  padding: 10px 12px 10px 28px;
  background: var(--warn-soft);
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
}

.est-ok {
  margin: 0;
  padding: 10px 12px;
  background: var(--ok-soft);
  border: 2px solid var(--ok);
  color: var(--ok);
  font-weight: 700;
}

/* Vista previa: una hoja blanca, igual en modo claro y oscuro */
.est-preview-wrap {
  overflow-x: auto;
  border: 2px solid var(--line);
  background: #d9d6cf;
  padding: 10px;
}

.est-doc {
  min-width: 320px;
  background: #ffffff;
  color: #1b1d22;
  font: 12px/1.45 Arial, Helvetica, sans-serif;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.est-doc .doc-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.est-doc .doc-co {
  display: flex;
  gap: 10px;
  min-width: 0;
  color: #5f636d;
}

.est-doc .doc-co img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: none;
}

.est-doc .doc-name {
  font-size: 15px;
  font-weight: 700;
  color: #1b1d22;
}

.est-doc .doc-meta {
  text-align: right;
  white-space: nowrap;
}

.est-doc .doc-type {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.est-doc .doc-rule {
  height: 3px;
  margin: 10px 0 12px;
}

.est-doc .doc-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

.est-doc .doc-h {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 8px 0 3px;
}

.est-doc .doc-strong {
  font-weight: 700;
}

.est-doc table {
  width: 100%;
  border-collapse: collapse;
}

.est-doc .doc-items th {
  color: #ffffff;
  font-size: 10px;
  text-align: left;
  padding: 5px 6px;
}

.est-doc .doc-items td {
  padding: 6px;
  border-bottom: 1px solid #d9dce1;
  vertical-align: top;
}

.est-doc .doc-items tr:nth-child(even) td {
  background: #f4f5f7;
}

.est-doc .doc-items td.d {
  white-space: pre-line;
}

.est-doc .r {
  text-align: right;
  white-space: nowrap;
}

.est-doc .doc-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
  align-items: start;
}

.est-doc .doc-sum td {
  padding: 4px 6px;
  border-bottom: 1px solid #d9dce1;
}

.est-doc .doc-sum tr.big td {
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  border: 0;
}

.est-doc .doc-sum tr.big {
  background: #1b1d22;
}

.est-doc .doc-notes {
  margin: 0;
  white-space: pre-line;
}

.est-doc .doc-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 34px;
}

.est-doc .doc-sign div {
  border-top: 1px solid #1b1d22;
  padding-top: 4px;
  font-size: 10px;
  color: #5f636d;
}

.est-doc .doc-thanks {
  text-align: center;
  font-weight: 700;
  margin: 16px 0 0;
}

.est-doc .doc-made {
  margin: 14px 0 0;
  font-size: 9px;
  color: #8a8f99;
}

/* Pestañas dentro de un paso: Qué hacer · Dónde · Por qué · Consejo · Tu estado */
.step-tabs {
  display: flex;
  gap: 0;
  margin-top: 14px;
  border: 2px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.step-tab {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  white-space: nowrap;
}

.step-tab + .step-tab {
  border-left: 2px solid var(--line);
}

.step-tab.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.step-panel {
  padding-top: 12px;
}

.step-panel > .tip,
.step-panel > .state-rule {
  margin-top: 0;
}
