/* shared shell — mk-static-web
   Spanish-first, mobile-first. One fix here fixes all six sites.
   Class contract (do not rename): .site-header .brand .tag, main, .lede, .tool,
   .result, .explain, .ad-slot, .site-footer. New classes are additive only. */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* color */
  --bg: #ffffff;
  --surface: #f8fafc;
  --card: var(--surface);            /* legacy alias, keep */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-ring: rgb(29 78 216 / 0.35);
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-ring: rgb(185 28 28 / 0.3);
  --note-bg: #fffbeb;
  --note-line: #f59e0b;
  --note-ink: #78350f;

  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;

  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.625rem);
  --fs-h1: clamp(1.625rem, 1.3rem + 1.6vw, 2.25rem);
  --fs-figure: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);

  /* space — 4px base */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;

  /* shape */
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;                       /* min touch target */
  --maxw: 720px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.05);
}

/* ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {

  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img, svg { max-width: 100%; height: auto; }

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {

  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: var(--s-2); color: #fff; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-3);
  /* aligns header content with the centered main column */
  padding: var(--s-1) max(var(--s-4), calc((100% - var(--maxw)) / 2 + var(--s-4)));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  color: var(--ink);

  text-decoration: none;
}
.site-header .brand:hover { color: var(--accent); }

.site-header .tag {
  color: var(--muted);
  font-size: var(--fs-sm);
  padding-bottom: var(--s-2);
}

@media (min-width: 480px) {
  .site-header .tag { padding-bottom: 0; }
}

/* ── Layout & type ──────────────────────────────────────────────────── */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-7);
}

@media (min-width: 640px) {
  main { padding-top: var(--s-6); }
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 var(--s-2);
  text-wrap: balance;

}

h2 {
  font-size: var(--fs-xl);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: var(--s-6) 0 var(--s-3);
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-lg);
  line-height: 1.3;
  margin: var(--s-5) 0 var(--s-2);
}

p { margin: 0 0 var(--s-4); }

.lede {
  color: var(--ink-2);
  font-size: var(--fs-lg);
  max-width: 60ch;
  margin: 0 0 var(--s-5);
}

/* ── Tool card ──────────────────────────────────────────────────────── */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-4);
  box-shadow: var(--shadow);

}
.tool > :first-child { margin-top: 0; }
.tool > :last-child { margin-bottom: 0; }

@media (min-width: 480px) {
  .tool { padding: var(--s-5); }
}

/* ── Forms ──────────────────────────────────────────────────────────── */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

legend,
label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin: var(--s-4) 0 var(--s-2);
  padding: 0;
}
fieldset:first-child legend { margin-top: 0; }

.field-group { margin-top: var(--s-4); }

input, select, textarea, button { font: inherit; }

input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-2) var(--s-3);
  font-size: max(16px, 1rem);        /* ≥16px prevents iOS zoom-on-focus */
  color: var(--ink);

  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 9rem;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-mono);
}

input:hover, select:hover, textarea:hover { border-color: #94a3b8; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

[aria-invalid="true"] { border-color: var(--danger); }
[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-ring); }

.input-lg {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.input-affix { position: relative; }
.input-affix > span {

  position: absolute;
  left: var(--s-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}
.input-affix > input { padding-left: 2.75rem; }

.hint {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: var(--s-2) 0 0;
}

.error {
  font-size: var(--fs-sm);
  color: var(--danger);
  font-weight: 600;
  margin: var(--s-2) 0 0;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
button {
  width: 100%;
  min-height: var(--tap);
  margin-top: var(--s-4);
  padding: var(--s-2) var(--s-4);
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;

  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s, border-color 0.15s;
}
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.actions > button { margin-top: 0; flex: 1 1 auto; width: auto; }

@media (min-width: 480px) {
  .actions > button { flex: 0 0 auto; }
}

/* ── Segmented control (radio-based, keyboard accessible) ───────────── */
.segmented {
  position: relative;

  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: #e9eef5;
  border-radius: var(--radius-sm);
}

.segmented input {
  position: absolute;
  width: 1px; height: 1px;
  min-height: 0;
  margin: 0; padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: var(--s-2) var(--s-3);
  border-radius: calc(var(--radius-sm) - 3px);
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;

  transition: background-color 0.15s, color 0.15s;
}
.segmented label:hover { color: var(--ink); }

.segmented input:checked + label {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.12);
}

.segmented input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

/* ── Results ────────────────────────────────────────────────────────── */
.result {
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.result:empty { display: none; }

.result-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);

}

.result-value {
  margin-top: var(--s-1);
  font-size: var(--fs-figure);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2) var(--s-4);
  margin: var(--s-4) 0 0;
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line-strong);
  font-size: var(--fs-base);
  font-weight: 400;
}
.breakdown dt { color: var(--ink-2); }
.breakdown dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.breakdown .total {
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);

  font-weight: 700;
  color: var(--ink);
}

.explain {
  margin: var(--s-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 400;
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}

/* ── Tables (bulk output) ───────────────────────────────────────────── */
.table-wrap {
  margin-top: var(--s-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: var(--s-2) var(--s-3);

  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

thead th {
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
}

tfoot th, tfoot td {
  background: var(--accent-soft);
  font-weight: 700;
  border-bottom: 0;
}

.text-left { text-align: left; }

.line-cell {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

tr.is-error td { color: var(--danger); background: var(--danger-soft); }

/* ── Notes ──────────────────────────────────────────────────────────── */
.note {
  margin: var(--s-4) 0 0;
  padding: var(--s-3) var(--s-4);

  background: var(--note-bg);
  border-left: 4px solid var(--note-line);
  border-radius: var(--radius-sm);
  color: var(--note-ink);
  font-size: var(--fs-sm);
}
.note a { color: inherit; font-weight: 600; }

/* ── Ad slot: reserved space, clearly labeled, separated from controls ─ */
.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100px + 2rem);    /* 320×100 mobile banner + label */
  margin: var(--s-6) 0;
  padding: var(--s-5) var(--s-3) var(--s-3);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--fs-xs);
  overflow: hidden;
  contain: layout;
}
.ad-slot::before {
  content: "Publicidad";
  position: absolute;
  top: var(--s-2);
  left: var(--s-3);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  color: var(--muted);
}

@media (min-width: 768px) {
  .ad-slot { min-height: calc(90px + 2rem); }  /* 728×90 leaderboard */
}

/* ── Long-form content ──────────────────────────────────────────────── */
.prose { margin-top: var(--s-6); }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); max-width: 65ch; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s-4); }
.prose li + li { margin-top: var(--s-2); }
.prose strong { color: var(--ink); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-sm);

}
.site-footer p { margin: 0 0 var(--s-2); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer small { display: block; margin-top: var(--s-1); line-height: 1.5; }

/* ── Preferences ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .ad-slot, .actions, .skip-link, .site-header .tag { display: none !important; }
  .tool { box-shadow: none; }
}

/* ── v2.1 additions: image tools (dropzone, preview, range) ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  margin: 0 0 var(--s-5);
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.dropzone {
  position: relative;
  background: #fff;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 9rem;
  margin: 0;
  padding: var(--s-5) var(--s-4);
  text-align: center;

  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
}
.dropzone label strong { color: var(--accent); font-size: var(--fs-lg); }
.dropzone-icon { font-size: 2rem; line-height: 1; }
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.dropzone.is-compact label {
  min-height: var(--tap);
  flex-direction: row;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
}
.dropzone.is-compact label strong { font-size: var(--fs-base); }
.dropzone.is-compact .dropzone-icon { font-size: 1.25rem; }
.dropzone.is-compact .dropzone-sub { display: none; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--s-3);
}

input[type="range"] {
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;

  accent-color: var(--accent);
  cursor: pointer;
}
input[type="range"]:focus { box-shadow: none; }
input[type="range"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input:disabled, select:disabled {
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
}

output { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.preview {
  margin: var(--s-4) 0 0;
  padding: var(--s-3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.preview img {
  display: inline-block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line);
}
.preview figcaption { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }


.result[aria-busy="true"],
.preview[aria-busy="true"] { opacity: 0.6; transition: opacity 0.15s; }

.explain.is-ok { color: #047857; }
.explain.is-warn { color: var(--note-ink); }

/* ── v2.2 additions: step-by-step breakdowns, checkboxes ────────────── */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-height: var(--tap);
  margin: var(--s-3) 0 0;
  padding: var(--s-2) 0;
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0;
  accent-color: var(--accent);
}
.check input:focus { box-shadow: none; }
.check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: var(--s-4) 0 0;
  padding: var(--s-2) 0 0;
  border-top: 1px dashed var(--line-strong);
  font-size: var(--fs-base);

  font-weight: 400;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: var(--s-1) var(--s-3);
  align-items: baseline;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.step-label { font-weight: 600; color: var(--ink); }
.step-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.step-how {

  grid-column: 2 / -1;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.steps li.is-total { border-bottom: 0; }
.steps li.is-total .step-label,
.steps li.is-total .step-value { font-weight: 800; }
.steps li.is-total::before { background: var(--accent); color: #fff; }

/* ── v2.3 additions: FAQ accordions, negative step values ──────────── */
.faq { margin: var(--s-3) 0 var(--s-5); border-top: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: var(--tap);
  padding: var(--s-3) 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }

.faq summary:hover { color: var(--accent); }
.faq details > :not(summary) { margin: 0 0 var(--s-3); }

.step-value.is-negative { color: var(--danger); }

/* ── v2.4 additions: tool hub (anchor nav, sections, swatches, diagrams) ─ */
.tool-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: var(--s-2);
  margin: 0 calc(-1 * var(--s-4)) var(--s-5);
  padding: var(--s-2) var(--s-4);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.tool-nav::-webkit-scrollbar { display: none; }
.tool-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.tool-nav a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.tool-section { scroll-margin-top: 4.5rem; }

.tool-section + .tool-section,
.ad-slot + .tool-section { margin-top: var(--s-7); }
.tool-section > h2 { margin-top: 0; }
.tool-section .prose { margin-top: var(--s-5); }
.prose h3:first-child { margin-top: 0; }

.band { margin-top: var(--s-4); }
.band legend strong { color: var(--ink); }

.swatches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: var(--s-2);
}
.swatches input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.swatch {
  display: block;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgb(15 23 42 / 0.2);

  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s;
}
.swatch:hover { transform: translateY(-1px); }
.swatches input:checked + .swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.swatches input:focus-visible + .swatch { outline: 3px solid var(--accent); outline-offset: 4px; }

.diagram {
  margin: var(--s-4) 0 0;
  padding: var(--s-3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.diagram svg { display: block; width: 100%; height: auto; max-height: 240px; margin: 0 auto; }
.diagram svg text { font-family: var(--font); font-size: 13px; fill: currentColor; }
.diagram figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
}

/* ── v2.5 additions: file hub (drop states, action cards, panels) ───── */
.dropzone.dropzone-lg label { min-height: 13rem; }
.dropzone.dropzone-lg.is-compact label { min-height: var(--tap); }
.dropzone[data-state="error"] { border-color: var(--danger); background: var(--danger-soft); }
.dropzone[data-state="loaded"] { border-style: solid; }
.dropzone[data-state="reading"] label { cursor: progress; }

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mtb-spin 0.8s linear infinite;
}
@keyframes mtb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.file-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin: var(--s-3) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.file-info .file-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.ext-badge {
  display: inline-flex;

  align-items: center;
  padding: 0.1rem var(--s-2);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.action-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.action-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0;

  font-size: var(--fs-lg);
}
.action-card p { flex: 1; margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.action-card button { margin-top: var(--s-2); }
.action-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.action-card.is-soon { background: var(--surface); border-style: dashed; }
.action-card.is-soon h3 { color: var(--ink-2); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem var(--s-2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.pill-soon { background: #eef2f6; color: var(--muted); }

.panel {
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: var(--s-4);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.panel-head h3 { margin: 0; }
.panel-head h3:focus { outline: none; }
.panel-head button { width: auto; margin: 0; }


.file-list {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.file-list li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
}
.file-list li:last-child { border-bottom: 0; }
.file-list .file-meta { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--muted); }
.file-list .file-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.btn-icon { flex: none; width: 44px; min-height: 44px; margin: 0; padding: 0; font-size: 1.05rem; }

.link-list { list-style: none; display: grid; gap: var(--s-2); margin: var(--s-3) 0 0; padding: 0; }
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);

  min-height: var(--tap);
  padding: var(--s-2) var(--s-3);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.link-list a:hover { background: var(--accent-soft); border-color: var(--accent); }
.link-list small { color: var(--muted); font-weight: 400; white-space: nowrap; }

.text-button {
  width: auto;
  min-height: var(--tap);
  margin: 0;
  padding: 0 var(--s-2);
  background: none;
  border: 0;
  color: var(--muted);
  font-weight: 400;
  text-decoration: underline;
}
.text-button:hover { background: none; color: var(--ink); }
