/* =============================================================
   Sietito — styles.css
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede6;
  --ink: #15171c;
  --muted: #5b606e;
  --line: #e2dfd6;
  --line-strong: #c9c5ba;
  --accent: #3a45ee;
  --accent-ink: #ffffff;
  --accent-soft: #e7e9fe;
  --ok: #0e7c53;
  --ok-soft: #dcf2e7;
  --bad: #c33528;
  --bad-soft: #fbe4e0;
  --warn: #7d5300;
  --warn-soft: #fff2cc;
  --hl: #ffe14d;
  --hl-ink: #2a2400;
  --res-idle: #15171c;
  --res-ink: #ffffff;
  --pray: #b25e06;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 10px 30px rgba(21, 23, 28, .07);
  --shadow-pop: 0 10px 40px rgba(21, 23, 28, .22);

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --surface-2: #22262e;
    --ink: #f1f1ec;
    --muted: #a3a8b4;
    --line: #2c3039;
    --line-strong: #444a56;
    --accent: #8b95ff;
    --accent-ink: #0f1230;
    --accent-soft: #252a52;
    --ok: #2fbf83;
    --ok-soft: #12301f;
    --bad: #ff7a69;
    --bad-soft: #3a1a15;
    --warn: #ffd166;
    --warn-soft: #3a2f12;
    --hl: #e9c93a;
    --hl-ink: #1d1800;
    --res-idle: #2a2e37;
    --res-ink: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent); text-underline-offset: 3px; }
p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
::selection { background: var(--hl); color: var(--hl-ink); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg); border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }
[hidden] { display: none !important; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); font-weight: 750; margin-bottom: .6em; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 1.6em 0 .5em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose strong { font-weight: 650; }
.lead { color: var(--muted); font-size: 1.02rem; margin-top: .5rem; max-width: 62ch; }

/* =============================================================
   5. Components
   ============================================================= */

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.lm-bg { fill: var(--accent); }
.lm-7 { stroke: var(--accent-ink); }
.lm-dot { fill: var(--hl); }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 550; font-size: .92rem;
  padding: 8px 11px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav .nav-long { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; font-weight: 650; font-size: .97rem;
  text-decoration: none; transition: transform .15s var(--ease-out), background-color .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn-line { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-text { color: var(--muted); padding: 0 12px; }
.btn-text:hover { color: var(--ink); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .5; pointer-events: none; }

/* Form fields */
.field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--line-strong); font-size: 1.05rem;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 14%, transparent); }
.select {
  padding-right: 38px; cursor: pointer;
  background-image: 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 1.5l5 5 5-5' fill='none' stroke='%235b606e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input-suffix { position: relative; display: block; }
.input-suffix .input { padding-right: 34px; }
.input-suffix .unit { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: .95rem; user-select: none; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
  position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px;
  background: var(--line-strong); transition: background-color .2s var(--ease-out);
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease-out);
}
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); gap: 2px; }
.seg button {
  min-height: 38px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted);
  transition: background-color .15s, color .15s;
}
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Tool card */
.tool { padding: 22px 0 8px; }
.tool-card {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.noscript { padding: 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 600; margin-bottom: 12px; }

.tool-grid { display: flex; flex-direction: column; gap: 16px; }
.settings { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 10px; }
.settings .select { font-size: 1rem; padding-left: 12px; padding-right: 30px; background-position: right 11px center; }
.toggles { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 8px; }

/* Rows (promedio) */
.rows-head, .row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center;
}
.rows-head { font-size: .78rem; font-weight: 650; color: var(--muted); padding: 10px 0 4px; }
.rows-head span:nth-child(2), .rows-head span:nth-child(3) { padding-left: 4px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-n { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; font-size: .95rem; }
.row .cell { position: relative; display: block; min-width: 0; }
.row .input { font-size: 1.1rem; font-weight: 550; }
.row .cell .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.row .cell.has-unit .input { padding-right: 30px; }
.row-del {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  transition: background-color .15s, color .15s;
}
.row-del:hover { background: var(--bad-soft); color: var(--bad); }
.row-del svg { width: 16px; height: 16px; }
.row-msg { grid-column: 2 / -1; font-size: .82rem; color: var(--bad); font-weight: 550; margin-top: -2px; }
.is-equal .col-w { display: none !important; }
.is-equal .rows-head, .is-equal .row { grid-template-columns: 22px minmax(0, 1fr) 40px; }

.rows-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }

.hint { font-size: .87rem; line-height: 1.45; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); }
.hint:empty { display: none; }
.hint[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.hint[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.hint[data-tone="info"] { background: var(--surface-2); color: var(--muted); }

.exam { margin-top: 12px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.exam-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 4px; max-width: 260px; }

/* Result */
.res-main {
  position: sticky; bottom: 10px; z-index: 6;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  padding: 12px 16px; border-radius: 16px;
  background: var(--res-idle); color: var(--res-ink);
  box-shadow: 0 8px 24px rgba(21, 23, 28, .18);
  transition: background-color .25s var(--ease-out);
}
.res-main[data-status="ok"] { background: var(--ok); }
.res-main[data-status="bad"] { background: var(--bad); }
.res-main[data-status="partial"], .res-main[data-status="study"] { background: var(--accent); color: var(--accent-ink); }
.res-main[data-status="pray"] { background: var(--pray); color: #ffffff; }
@media (prefers-color-scheme: dark) {
  .res-main[data-status="ok"], .res-main[data-status="bad"] { color: #0b0d10; }
}
.res-label { font-size: .78rem; font-weight: 650; opacity: .85; letter-spacing: .02em; }
.res-status { font-family: var(--display); font-weight: 750; font-size: 1.1rem; line-height: 1.2; }
.res-big {
  grid-row: 1 / span 2; grid-column: 2; font-family: var(--display); font-weight: 800;
  font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.res-details { display: flex; flex-direction: column; gap: 10px; }
.res-exact { font-size: .88rem; color: var(--muted); }
.res-exact:empty { display: none; }
.res-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .93rem; line-height: 1.45; }
.res-box strong { font-family: var(--display); font-size: 1.15em; }
.res-box[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.res-box[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }
.res-box[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.res-box .res-box-title { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-bottom: 2px; }
.res-actions { display: flex; flex-direction: column; gap: 6px; }
.res-actions .btn { width: 100%; }
.dl-status { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.dl-status[data-tone="bad"] { color: var(--bad); }

.privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: .88rem; color: var(--muted); }
.privacy svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ok); }

/* Scale tool */
.scale-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scale-form .span-2 { grid-column: 1 / -1; }
.scale-form .mode-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.scale-error { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: .9rem; }
.lookup {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px;
  margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2);
}
.lookup-res { min-width: 108px; text-align: right; }
.lookup-res .res-label { color: var(--muted); opacity: 1; }
.lookup-big { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lookup-big[data-tone="ok"] { color: var(--ok); }
.lookup-big[data-tone="bad"] { color: var(--bad); }
.lookup-msg { grid-column: 1 / -1; font-size: .84rem; color: var(--bad); font-weight: 550; }
.lookup-msg:empty { display: none; }

.scale-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: .88rem; color: var(--muted); }
.chip b { color: var(--ink); font-family: var(--display); font-size: 1.05rem; }
.chip-hl { background: var(--hl); color: var(--hl-ink); }
.chip-hl b { color: var(--hl-ink); }

.scale-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.scale-actions .btn { padding: 0 10px; }

.scale-table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-top: 22px; }
.scale-table-head h2 { font-size: 1.25rem; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .lg-fail { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
.legend .lg-pass { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend .lg-th { background: var(--hl); }

.scale-list {
  list-style: none; padding: 0; margin-top: 10px;
  columns: 6.4rem auto; column-gap: 10px;
  font-variant-numeric: tabular-nums;
}
.scale-list li {
  break-inside: avoid; display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 9px; border-radius: 8px; margin-bottom: 3px; font-size: .95rem;
}
.scale-list li:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.scale-list .pts { color: var(--muted); }
.scale-list .nota { font-weight: 700; }
.scale-list .is-fail .nota { color: var(--bad); }
.scale-list li.is-threshold { background: var(--hl); color: var(--hl-ink); }
.scale-list li.is-threshold .pts, .scale-list li.is-threshold .nota { color: var(--hl-ink); }
.print-head { display: none; }

/* Ads (placeholders) */
.ad-slot {
  position: relative; display: grid; place-items: center; width: 100%;
  border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted);
  background: repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--surface-2) 70%, transparent) 12px 24px);
}
.ad-label { font-size: .72rem; font-weight: 700; letter-spacing: .18em; }
.ad-leaderboard { min-height: 100px; max-width: 970px; margin: 28px auto; }
.ad-incontent { min-height: 250px; margin: 36px 0; }
.ad-rect { width: 300px; max-width: 100%; height: 250px; margin-inline: auto; }
.ad-small { height: 90px; }

.ad-dialog {
  width: min(380px, calc(100vw - 32px)); margin: auto; padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.ad-dialog::backdrop { background: rgba(10, 12, 16, .55); }
.ad-dialog-inner { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 18px 18px; }
.ad-dialog-msg { font-weight: 650; display: flex; align-items: center; gap: 8px; padding-right: 34px; }
.ad-dialog-msg svg { width: 20px; height: 20px; color: var(--ok); flex: none; }
.ad-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink);
}
.ad-close:hover { background: var(--line); }
.ad-close svg { width: 16px; height: 16px; }

.ad-toast {
  position: fixed; z-index: 50; top: 70px; right: 12px; width: min(300px, calc(100vw - 24px));
  padding: 12px; padding-top: 30px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  animation: toast-in .45s var(--ease-out) both;
}
.ad-toast .ad-close { top: 4px; right: 4px; width: 28px; height: 28px; }
.ad-toast .ad-close svg { width: 13px; height: 13px; }
.ad-toast-tag { position: absolute; top: 9px; left: 14px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); }

/* Content sections */
.section { padding: 34px 0; }
.section + .section { border-top: 1px solid var(--line); }
.steps { display: grid; gap: 12px; margin-top: 8px; counter-reset: step; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.step-n {
  grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-weight: 800; font-size: 1.2rem;
}
.step h3 { margin: 2px 0 0; font-size: 1.05rem; }
.step p { color: var(--muted); font-size: .93rem; }

.formula {
  margin: 1em 0 1.2em; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.calc-list { list-style: none; padding: 0 !important; display: grid; gap: 4px; }
.calc-list li { font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
code, .code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere;
}
.note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--warn-soft); color: var(--warn);
  font-size: .93rem; margin-top: 20px;
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.faq { display: grid; gap: 8px; margin-top: 8px; }
.faq details { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 650; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 16px 16px; color: var(--muted); }

.tools-grid { display: grid; gap: 12px; margin-top: 8px; }
.tool-link {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s var(--ease-out);
}
.tool-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-link .tl-icon { grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tool-link .tl-icon svg { width: 24px; height: 24px; }
.tool-link strong { font-family: var(--display); font-size: 1.08rem; }
.tool-link span { color: var(--muted); font-size: .9rem; }
.tool-link[aria-current="page"] { opacity: .6; pointer-events: none; }

/* Footer */
.site-footer { margin-top: 20px; border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: .88rem; }
.site-footer .container { display: flex; flex-direction: column; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* Legal pages */
.legal { padding: 28px 0 10px; }
.legal h1 { margin-bottom: .4em; }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }
.legal .todo { background: var(--hl); color: var(--hl-ink); padding: 0 4px; border-radius: 4px; }

/* =============================================================
   7. Effects
   ============================================================= */
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.bump { animation: bump .35s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (max-width: 539px) {
  .logo { font-size: 1.08rem; gap: 7px; }
  .logo-mark { width: 28px; height: 28px; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 9px; font-size: .88rem; }
}

@media (min-width: 540px) {
  .nav .nav-long { display: inline; }
  .nav .nav-short { display: none; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-n { grid-row: auto; margin-bottom: 6px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scale-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scale-form .span-2 { grid-column: span 3; }
}

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .tool { padding-top: 34px; }
  .tool-card { padding: 22px; }
  .ad-leaderboard { min-height: 90px; }
  .site-footer .container { flex-direction: row; justify-content: space-between; align-items: center; }
  .ad-toast { top: auto; bottom: 20px; right: 20px; }
}

@media (min-width: 960px) {
  .tool-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "inputs main" "inputs details"; grid-template-rows: auto 1fr;
    column-gap: 26px; row-gap: 0;
  }
  .tool-inputs { grid-area: inputs; }
  .res-main {
    grid-area: main; position: static; display: flex; flex-direction: column; align-items: flex-start;
    padding: 22px 24px 20px; border-radius: 18px 18px 0 0; box-shadow: none;
  }
  .res-big { order: 1; font-size: 5.6rem; margin: 6px 0 8px; }
  .res-status { order: 2; }
  .res-status { font-size: 1.35rem; }
  .res-details {
    grid-area: details; align-self: stretch; padding: 16px 18px 18px; border-radius: 0 0 18px 18px;
    background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); border: 1px solid var(--line); border-top: 0;
  }
  .scale-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scale-form .span-2 { grid-column: span 2; }
  .scale-actions { display: flex; flex-wrap: wrap; }
}

/* =============================================================
   9. Reduced motion (solo lo intrusivo)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .ad-toast { animation: none; }
  .bump { animation: none; }
}

/* =============================================================
   10. Print (escala de notas)
   ============================================================= */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .site-footer, .ad-slot, .ad-toast, .ad-dialog, .no-print, .section, .skip-link { display: none !important; }
  .tool { padding: 0; }
  .tool-card { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .print-head { display: block; margin-bottom: 10px; }
  .print-head .print-title { font-size: 18pt; font-weight: 800; color: #000; }
  .print-head p { font-size: 10pt; color: #333; }
  .scale-list { columns: 5; column-gap: 8px; }
  .scale-list li { padding: 1px 6px; margin: 0; font-size: 9.5pt; background: none !important; }
  .scale-list li.is-threshold { background: #ffe14d !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .scale-list .is-fail .nota { color: #b0281c; }
}
