:root {
  --bg: #f7f8f5;
  --paper: #ffffff;
  --ink: #121212;
  --soft: #6b7280;
  --line: #e6e8e3;
  --green: #1fad58;
  --mint: #a8f5dc;
  --blush: #ffb8cc;
  --peach: #ffc7a8;
  --lavender: #d4bfff;
  --sky: #b7e4ff;
  --lemon: #ffe59a;
  --sans: "Bricolage Grotesque", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  background: var(--bg);
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--green); font-weight: 650; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.app {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(36px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.brand {
  margin: 0;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; }

p { margin: 0; }

.lede, .lead { color: var(--soft); font-size: 1.05rem; max-width: 38rem; }

.lede { margin-bottom: 18px; }

.kicker {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.card {
  background: var(--paper);
  border-radius: 24px;
  padding: 18px 16px 16px;
}

.tone-mint { background: var(--mint); }
.tone-blush { background: var(--blush); }
.tone-peach { background: var(--peach); }
.tone-lavender { background: var(--lavender); }
.tone-sky { background: var(--sky); }
.tone-lemon { background: var(--lemon); }

.stack { display: flex; flex-direction: column; gap: 12px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding: 22px 18px;
  border-radius: 28px;
  background: #fff;
}

.drop.over, .drop.busy { outline: 2px solid var(--green); }

.drop-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.drop-sub, .note, .fine, .range, .mini { color: var(--soft); font-size: 0.92rem; }

.note { margin-top: 10px; }

#screen-home > .fine { display: block; margin-top: 14px; }

.primary, .ghost {
  border-radius: 999px;
  padding: 13px 16px;
  width: 100%;
  font-weight: 700;
}

.primary {
  border: 0;
  background: var(--ink);
  color: #fff;
}

.primary:hover { background: #000; }

.primary:disabled { opacity: 0.65; cursor: wait; }

.ghost {
  border: 1px solid var(--line);
  background: #fff;
}

.text-btn {
  display: block;
  width: 100%;
  margin: 2px 0 16px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
  text-align: center;
}

.steps-list { display: flex; flex-direction: column; gap: 10px; }

.step h2 { font-size: 1.15rem; margin-bottom: 4px; }

.step p:last-child { color: var(--soft); }

.install { margin-top: 14px; }
.install summary { cursor: pointer; font-weight: 800; }
.install p { margin-top: 8px; color: var(--soft); }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field span { font-size: 0.92rem; }

input[type="password"], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font-weight: 500;
}

fieldset { margin: 0; border: 0; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pills label {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 700;
}

.pills input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pills label:has(input:checked) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.pills label:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }

.error, .notice { border-radius: 16px; padding: 12px 14px; }

.error { background: var(--blush); color: #121212; }
.notice { background: var(--lemon); color: #121212; }

.report-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.report-top h1 { font-size: clamp(2.2rem, 7vw, 3.3rem); margin-bottom: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { width: auto; flex: 1; min-width: 0; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.span-2 { grid-column: 1 / -1; }

.hero-numbers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hero-numbers strong,
.pair strong,
.meter strong,
.trace strong {
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero-numbers strong {
  display: block;
  font-size: clamp(3rem, 10vw, 4.2rem);
  line-height: 0.85;
}

.hero-numbers div:last-child { text-align: right; }
.hero-numbers span, .who { color: rgba(18, 18, 18, 0.62); }

.track {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.12);
}

.track.slim { height: 10px; }
.track > span { display: block; height: 100%; flex: none; }
.track .you, .swatch.you { background: #121212; }
.track .them, .swatch.them { background: var(--green); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.side { min-width: 0; }

.who {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pair strong {
  display: block;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.insight { margin-top: 8px; }
.insight p { margin: 0; }

.insight.alert,
.insight.ok,
.insight.neutral {
  border-radius: 16px;
  padding: 12px 14px;
}

.insight.alert { background: var(--blush); }
.insight.ok { background: var(--mint); }
.insight.neutral { background: rgba(18, 18, 18, 0.05); }

.quote {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.trace {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.trace:first-of-type { border-top: 0; }
.trace span { color: var(--soft); }
.trace strong { font-size: 1rem; text-align: right; }

.words { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.06);
  padding: 6px 10px;
  font-weight: 650;
}

.chip b { margin-left: 5px; color: var(--soft); font-weight: 800; }

.emoji-line { margin-top: 8px; font-size: 1.2rem; letter-spacing: 0.08em; }

.legend { display: flex; gap: 14px; margin-bottom: 8px; color: var(--soft); font-size: 0.88rem; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }

.month {
  display: grid;
  grid-template-columns: 92px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.month-label, .month-n { color: var(--soft); font-size: 0.82rem; font-weight: 650; }
.month-n { text-align: right; }

.meters { display: flex; flex-direction: column; gap: 8px; }
.meter-top { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 700; }

.signal { margin-top: 8px; padding: 12px 14px; border-radius: 16px; background: rgba(18, 18, 18, 0.04); }
.signal-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.signal h3 { font-size: 1rem; }

.badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.alta { background: var(--blush); }
.badge.media { background: var(--peach); }
.badge.baja { background: var(--mint); }

.clean { margin: 8px 0 0; padding-left: 1.1rem; }
.veredicto {
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.disclaimer { color: var(--soft); font-size: 0.84rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 700px) {
  .report-top, .grid, .words { display: flex; flex-direction: column; }
  .actions { width: 100%; }
  .span-2 { grid-column: auto; }
}

@media (max-width: 380px) {
  .pair strong { font-size: 1.55rem; }
  .month { grid-template-columns: 78px 1fr 28px; }
}

@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .card { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
