/* PostMicroTools · estilos del sitio
   Tokens inlineados (el repo es standalone; no se importa shared/design-tokens.css).
   Tema oscuro hi-tech + light auto opcional. */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap");

:root {
  --bg:           #0f1115;
  --bg-elevated:  #171a21;
  --bg-elevated-2:#1f232c;
  --border:       #2a2f3a;
  --border-bright:#3a4150;
  --text:         #e6e8ec;
  --text-muted:   #9aa3b2;
  --text-dim:     #6b7280;

  --accent:       #6ea8ff;
  --accent-2:     #9d7cff;
  --accent-on:    #0c1018;

  --success:      #2fbf71;
  --warning:      #f3c969;
  --danger:       #ff6b6b;

  --font-sans:  "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head:  "Space Grotesk", var(--font-sans);
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs: 12px;  --fs-sm: 13px;  --fs-base: 16px; --fs-md: 17px;
  --fs-lg: 20px;  --fs-xl: 24px;  --fs-2xl: 32px;  --fs-3xl: 44px;

  --lh-tight: 1.15; --lh-base: 1.55;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --shadow-md: 0 6px 18px rgba(0,0,0,.38);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.5);
  --shadow-glow: 0 0 0 1px rgba(110,168,255,.25), 0 10px 30px rgba(110,168,255,.12);

  --t-fast: 130ms ease;
  --t-base: 220ms ease;

  --container-max: 1100px;
  --container-pad: var(--sp-5);
}

/* ───── Light mode ─────
   Forzado con [data-theme="light"]; automático con el sistema salvo que se haya
   forzado "dark". El toggle del header persiste la elección en localStorage. */
:root[data-theme="light"] {
  --bg:#fafbfc; --bg-elevated:#ffffff; --bg-elevated-2:#eef1f5;
  --border:#dfe3ea; --border-bright:#c4cbd6;
  --text:#0f1115; --text-muted:#475569; --text-dim:#6b7280;
  --accent:#2f6fe0; --accent-2:#7c4ddb;
  --shadow-sm:0 1px 2px rgba(0,0,0,.05);
  --shadow-md:0 6px 18px rgba(0,0,0,.08);
  --shadow-lg:0 18px 44px rgba(0,0,0,.12);
  --shadow-glow:0 0 0 1px rgba(47,111,224,.35), 0 10px 30px rgba(47,111,224,.12);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#fafbfc; --bg-elevated:#ffffff; --bg-elevated-2:#eef1f5;
    --border:#dfe3ea; --border-bright:#c4cbd6;
    --text:#0f1115; --text-muted:#475569; --text-dim:#6b7280;
    --accent:#2f6fe0; --accent-2:#7c4ddb;
    --shadow-sm:0 1px 2px rgba(0,0,0,.05);
    --shadow-md:0 6px 18px rgba(0,0,0,.08);
    --shadow-lg:0 18px 44px rgba(0,0,0,.12);
    --shadow-glow:0 0 0 1px rgba(47,111,224,.35), 0 10px 30px rgba(47,111,224,.12);
  }
}

/* ───── Reset ───── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: var(--lh-tight); margin: 0 0 var(--sp-4); font-weight: 600; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-lg); }
p  { margin: 0 0 var(--sp-4); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ───── Header / footer ───── */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4); position: relative;
  padding: var(--sp-4) var(--container-pad);
  max-width: var(--container-max); margin: 0 auto; width: 100%;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; font-size: var(--fs-md);
}
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 26px; height: 26px; }
.site-header > nav { display: flex; gap: var(--sp-4); align-items: center; }
.site-header > nav > a { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; }
.site-header > nav > a:hover, .site-header > nav > a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Controles del header (idioma + tema) */
.hdr-controls { display: inline-flex; align-items: center; gap: var(--sp-3); }
.lang-toggle { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r-full); overflow: hidden; font-family: var(--font-head); }
.lang-toggle a, .lang-toggle span { display: inline-flex; align-items: center; padding: 5px 10px; font-size: var(--fs-xs); font-weight: 600; line-height: 1; color: var(--text-muted); text-decoration: none; transition: color var(--t-fast), background var(--t-fast); }
.lang-toggle .active { background: var(--bg-elevated-2); color: var(--text); }
.lang-toggle a:hover { color: var(--text); background: var(--bg-elevated-2); text-decoration: none; }
.theme-toggle { width: 36px; height: 36px; min-height: 36px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: var(--r-full); background: transparent; color: var(--text-muted); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast); }
.theme-toggle:hover { color: var(--text); border-color: var(--border-bright); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Menú de grupos con desplegable */
.menu { display: inline-flex; gap: var(--sp-1); align-items: center; flex-wrap: wrap; }
.menu-group { position: relative; }
.menu-group > button {
  background: transparent; border: 0; color: var(--text-muted); font: inherit;
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer; padding: 6px 8px;
  border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 4px; line-height: 1;
}
.menu-group > button:hover { color: var(--text); }
.menu-group > button .chev { width: 13px; height: 13px; transition: transform var(--t-fast); }
.menu-group:hover > button .chev, .menu-group.open > button .chev { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: 100%; right: 0; left: auto; min-width: 210px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: var(--sp-2); margin: 0; list-style: none;
  display: none; z-index: 50;
}
.menu-group:hover .menu-panel, .menu-group:focus-within .menu-panel, .menu-group.open .menu-panel { display: block; }
.menu-panel li { margin: 0; }
.menu-panel a { display: block; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
.menu-panel a:hover { background: var(--bg-elevated-2); color: var(--text); text-decoration: none; }
.menu-panel a[aria-current="page"] { color: var(--accent); background: var(--bg-elevated-2); }

/* Botón hamburguesa (oculto en escritorio) */
.menu-toggle { display: none; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: var(--r-full); background: transparent; color: var(--text-muted); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast); }
.menu-toggle:hover { color: var(--text); border-color: var(--border-bright); }
.menu-toggle svg { width: 18px; height: 18px; }

/* Colapsar el menú en hamburguesa cuando no caben las categorías */
@media (max-width: 820px) {
  .menu-toggle { display: grid; }
  .site-header > nav { gap: var(--sp-2); }
  .menu {
    display: none; position: absolute; top: 100%; left: var(--container-pad); right: var(--container-pad);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow-lg); padding: var(--sp-2); margin-top: var(--sp-2); z-index: 50;
  }
  .menu.open-mobile { display: flex; }
  .menu-group { width: 100%; }
  .menu-group > button { width: 100%; justify-content: space-between; padding: 10px 12px; font-size: var(--fs-md); }
  .menu-panel { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 var(--sp-3) var(--sp-4); min-width: 0; }
  .menu-group:hover .menu-panel, .menu-group:focus-within .menu-panel { display: none; }
  .menu-group.open .menu-panel { display: block; }
  .menu-panel a { padding: 9px 10px; }
}

main { max-width: var(--container-max); margin: 0 auto; padding: var(--sp-6) var(--container-pad) var(--sp-8); width: 100%; flex: 1; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-6) var(--container-pad);
  text-align: center; color: var(--text-muted); font-size: var(--fs-sm);
}
.site-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text); }

/* ───── Hero ───── */
.hero { text-align: center; margin: var(--sp-6) 0 var(--sp-7); }
.hero h1 {
  font-size: clamp(2rem, 6vw, var(--fs-3xl));
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .intro { color: var(--text-muted); font-size: var(--fs-md); max-width: 620px; margin: 0 auto; }

/* ───── Bento grid de tools (home) ───── */
.tool-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.tool-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  color: var(--text); text-decoration: none;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--border-bright);
  background: var(--bg-elevated-2);
  box-shadow: var(--shadow-glow);
}
.tool-card .icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(110,168,255,.18), rgba(157,124,255,.18));
  color: var(--accent);
}
.tool-card .icon svg { width: 22px; height: 22px; }
.tool-card h3 { margin: 0; font-size: var(--fs-lg); }
.tool-card p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.tool-card .cta { margin-top: auto; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; display: inline-flex; align-items: center; gap: var(--sp-1); }
.tool-card.soon { opacity: .55; cursor: not-allowed; }
.tool-card.soon .cta { color: var(--text-dim); }

.section-label { font-family: var(--font-head); font-size: var(--fs-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: var(--sp-7) 0 var(--sp-3); }

/* ───── Layout de herramienta (inputs | resultados) ───── */
.tool-head { margin-bottom: var(--sp-6); }
.tool-head .eyebrow { font-family: var(--font-head); font-size: var(--fs-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-2); }
.tool-head h1 { font-size: clamp(1.75rem, 5vw, var(--fs-2xl)); margin-bottom: var(--sp-2); }
.tool-head p { color: var(--text-muted); max-width: 640px; margin: 0; }

.tool-layout { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 800px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.panel h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-4); }

.results-panel { position: sticky; top: var(--sp-4); }

/* ───── Form controls ───── */
.field { margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); margin-bottom: var(--sp-2); }
.field .hint { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-1); }

.control, select.control, input.control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-height: 44px;
}
.control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,168,255,.18); }
select.control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (max-width: 480px) { .field-row-3 { grid-template-columns: 1fr 1fr; } }

/* Segmented control (chips) */
.segmented { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.segmented button {
  flex: 1 1 auto; min-width: 64px; min-height: 40px;
  background: var(--bg); border: 1px solid var(--border-bright);
  border-radius: var(--r-md); padding: 8px 12px; cursor: pointer;
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500;
  transition: all var(--t-fast);
}
.segmented button:hover { color: var(--text); border-color: var(--accent); }
.segmented button[aria-pressed="true"] { background: rgba(110,168,255,.14); border-color: var(--accent); color: var(--text); }

/* ───── Results ───── */
.result-main {
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.result-main .result-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: var(--sp-1); }
.result-main .result-value { font-family: var(--font-mono); font-size: clamp(1.75rem, 7vw, var(--fs-2xl)); font-weight: 700; color: var(--text); word-break: break-word; }
.result-main .result-value .unit { font-size: var(--fs-lg); color: var(--accent); margin-left: 4px; }

.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.result-list li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.result-list li:last-child { border-bottom: 0; }
.result-list .k { color: var(--text-muted); font-size: var(--fs-sm); }
.result-list .v { font-family: var(--font-mono); font-weight: 500; text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 10px 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-bright);
  background: var(--bg-elevated-2); color: var(--text);
  font-weight: 600; cursor: pointer; transition: all var(--t-fast);
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn.copied { border-color: var(--success); color: var(--success); }

.note { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-3); }

/* ───── Prose / FAQ ───── */
.prose { max-width: 680px; margin: var(--sp-7) auto 0; }
.prose h2 { font-size: var(--fs-xl); }
.prose details { border-top: 1px solid var(--border); padding: var(--sp-3) 0; }
.prose details summary { cursor: pointer; font-weight: 600; font-family: var(--font-head); list-style: none; }
.prose details summary::-webkit-details-marker { display: none; }
.prose details summary::before { content: "+"; color: var(--accent); margin-right: var(--sp-2); font-family: var(--font-mono); }
.prose details[open] summary::before { content: "−"; }
.prose details p { color: var(--text-muted); margin: var(--sp-3) 0 0; }

.breadcrumbs { font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: var(--sp-4); }
.breadcrumbs a { color: var(--text-muted); }

/* ───── Rich footer (interlinking) ───── */
.site-footer .footer-grid {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--sp-6); text-align: left;
}
.site-footer .footer-brand { flex: 1 1 260px; }
.site-footer .footer-tools { flex: 1 1 150px; }
.site-footer .footer-brand p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 32ch; margin-top: var(--sp-3); }
.site-footer h4 { font-family: var(--font-head); font-size: var(--fs-sm); letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 var(--sp-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.site-footer ul a { color: var(--text-muted); font-size: var(--fs-sm); text-decoration: none; }
.site-footer ul a:hover { color: var(--text); text-decoration: underline; }
.site-footer .footer-legal { margin: var(--sp-6) 0 0; text-align: center; font-size: var(--fs-xs); color: var(--text-dim); }

/* ───── Dropzone (selección de ficheros, sin subida) ───── */
.dropzone {
  border: 2px dashed var(--border-bright); border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-5); text-align: center; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast); color: var(--text-muted);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(110,168,255,.06); color: var(--text); }
.dropzone svg { width: 36px; height: 36px; margin: 0 auto var(--sp-3); color: var(--accent); }
.dropzone strong { color: var(--text); display: block; font-family: var(--font-head); }
.dropzone .sub { font-size: var(--fs-sm); margin-top: var(--sp-2); }

/* ───── Tablas de datos ───── */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data-table th, table.data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table th { font-family: var(--font-head); color: var(--text-muted); font-weight: 600; position: sticky; top: 0; background: var(--bg-elevated); }
table.data-table td { font-family: var(--font-mono); }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tr.bad td { background: rgba(255,107,107,.08); }
table.data-table tr.warn td { background: rgba(243,201,105,.08); }

/* ───── Badges de estado ───── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px; border-radius: var(--r-full); font-family: var(--font-head); letter-spacing: .02em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok   { color: var(--success); background: rgba(47,191,113,.14); }
.badge.warn { color: var(--warning); background: rgba(243,201,105,.16); }
.badge.bad  { color: var(--danger);  background: rgba(255,107,107,.14); }
.badge.info { color: var(--accent);  background: rgba(110,168,255,.14); }

/* ───── Checklist (validador) ───── */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.checklist li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.checklist .ck-name { font-size: var(--fs-sm); }
.checklist .ck-name small { display: block; color: var(--text-dim); font-size: var(--fs-xs); }
.checklist .ck-val { font-family: var(--font-mono); font-size: var(--fs-sm); text-align: right; color: var(--text-muted); }

/* ───── Verdict (Can My Mac) ───── */
.verdict { border-radius: var(--r-lg); padding: var(--sp-5); text-align: center; border: 1px solid var(--border-bright); background: var(--bg); }
.verdict .v-emoji { font-family: var(--font-head); font-size: var(--fs-sm); letter-spacing: .1em; text-transform: uppercase; }
.verdict .v-title { font-family: var(--font-head); font-size: var(--fs-2xl); margin: var(--sp-2) 0; }
.verdict .v-desc { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.verdict.ok   { border-color: var(--success); }
.verdict.ok   .v-title, .verdict.ok .v-emoji { color: var(--success); }
.verdict.mid  { border-color: var(--warning); }
.verdict.mid  .v-title, .verdict.mid .v-emoji { color: var(--warning); }
.verdict.bad  { border-color: var(--danger); }
.verdict.bad  .v-title, .verdict.bad .v-emoji { color: var(--danger); }

.meter { height: 8px; border-radius: var(--r-full); background: var(--bg-elevated-2); overflow: hidden; margin: var(--sp-4) 0 var(--sp-2); }
.meter > span { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width var(--t-base); }

/* ───── Bloque de salida monospace + copiar ───── */
.output-block { position: relative; }
.output-block textarea, .output-block pre {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--bg); border: 1px solid var(--border-bright); border-radius: var(--r-md);
  padding: var(--sp-4); color: var(--text); font-family: var(--font-mono); font-size: var(--fs-sm);
  line-height: 1.7; white-space: pre; overflow: auto;
}
.output-block pre { margin: 0; }

/* ───── Aspect ratio previewer ───── */
.ar-stage { background: repeating-conic-gradient(var(--bg-elevated-2) 0% 25%, var(--bg) 0% 50%) 50% / 24px 24px; border: 1px solid var(--border); border-radius: var(--r-md); display: grid; place-items: center; padding: var(--sp-5); min-height: 220px; }
.ar-outer { position: relative; background: #000; box-shadow: var(--shadow-md); max-width: 100%; max-height: 320px; overflow: hidden; }
.ar-inner { position: absolute; inset: 0; margin: auto; background: linear-gradient(135deg, rgba(110,168,255,.5), rgba(157,124,255,.5)); overflow: hidden; }
.ar-inner.has-media { background: #000; }
.ar-inner img, .ar-inner video { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; }
.ar-safe { position: absolute; border: 1px dashed rgba(255,255,255,.7); pointer-events: none; z-index: 2; }
.ar-legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: center; font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-3); }
.ar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ar-legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }

/* Aspect tool full-width layout (footage on top, result wide below) */
.aspect-layout { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); align-items: start; }
.aspect-layout .results-panel { position: static; }
.ar-stage--wide { min-height: 360px; padding: var(--sp-5); }
.ar-stage--wide .ar-outer { max-height: 520px; }

.panel-head-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.panel-head-row h2 { margin: 0; }
.badge-privacy { font-size: var(--fs-xs); color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

.field-row-4 { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .field-row-4 { grid-template-columns: repeat(4, 1fr); } }

.result-list-h { display: grid; gap: var(--sp-2); grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .result-list-h { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.result-list-h li { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-elevated); }
.result-list-h .k { color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.result-list-h .v { font-family: var(--font-mono); font-weight: 500; color: var(--text); font-size: var(--fs-md); }

/* Media dropzone (load image/video, fully local) */
.media-dropzone { position: relative; border: 1px dashed var(--border-bright); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; background: var(--bg-elevated); cursor: pointer; transition: border-color .15s, background .15s; }
.media-dropzone:hover, .media-dropzone.is-drag { border-color: var(--accent); background: var(--bg-elevated-2); }
.media-dropzone svg { width: 28px; height: 28px; opacity: .7; margin-bottom: var(--sp-1); display: block; margin-left: auto; margin-right: auto; }
.media-dropzone .dz-title { font-weight: 600; color: var(--text); margin: 0 0 4px; }
.media-dropzone .dz-hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.media-dropzone-loaded { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); text-align: left; }
.media-dropzone-loaded .dz-name { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.media-dropzone-loaded .dz-meta { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.media-dropzone-loaded button { background: transparent; border: 1px solid var(--border-bright); color: var(--text); padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); }
.media-dropzone-loaded button:hover { background: var(--bg); }

/* Video scrubber */
.media-scrubber { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; margin-top: var(--sp-3); padding: var(--sp-3); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); }
.media-scrubber button { min-width: 44px; min-height: 44px; background: var(--bg); border: 1px solid var(--border-bright); color: var(--text); border-radius: var(--r-sm); cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.media-scrubber button:hover { background: var(--bg-elevated-2); }
.media-scrubber input[type=range] { width: 100%; min-height: 32px; }
.media-scrubber .scrub-time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); min-width: 96px; text-align: right; }

.result-actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
@media (min-width: 600px) { .result-actions { grid-template-columns: 1fr 1fr; } }

/* ───── Image preview / LUT ───── */
.img-compare { position: relative; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg); touch-action: none; }
.img-compare canvas { display: block; width: 100%; height: auto; }
.img-compare .after-wrap { position: absolute; inset: 0; overflow: hidden; width: 50%; border-right: 2px solid var(--accent); }
.img-compare .after-wrap canvas { width: auto; }
.img-compare .slider { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.img-compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--accent); pointer-events: none; }
.img-compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--accent); color: var(--accent-on); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.tag { display: inline-block; font-size: var(--fs-xs); color: var(--text-dim); background: var(--bg); padding: 2px 8px; border-radius: var(--r-sm); border: 1px solid var(--border); }

.stack { display: grid; gap: var(--sp-4); }
.divider-h { border: 0; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }

/* ───── RAID widget ───── */
.raid-widget { display: grid; gap: var(--sp-4); }
.raid-disks { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; padding: var(--sp-4); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); min-height: 120px; align-items: center; }
.raid-disk { width: 52px; height: 80px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-xs); color: #fff; font-weight: 600; box-shadow: var(--shadow-md); position: relative; transition: transform .15s; }
.raid-disk:hover { transform: translateY(-2px); }
.raid-disk.data { background: linear-gradient(135deg, #6ea8ff, #4a7fd1); }
.raid-disk.parity { background: linear-gradient(135deg, #9d7cff, #6f4ad1); }
.raid-disk.mirror { background: linear-gradient(135deg, #4ed1a1, #2da377); }
.raid-disk.spare { background: linear-gradient(135deg, #888, #555); opacity: .7; }
.raid-disk .label { font-size: 9px; opacity: .85; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.raid-stats { display: grid; gap: var(--sp-2); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .raid-stats { grid-template-columns: repeat(4, 1fr); } }
.raid-stat { padding: var(--sp-2) var(--sp-3); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-sm); }
.raid-stat .k { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.raid-stat .v { display: block; font-family: var(--font-mono); font-size: var(--fs-md); color: var(--text); font-weight: 600; margin-top: 2px; }
.raid-stat.warn .v { color: #ff8e6e; }
.raid-stat.ok .v { color: #4ed1a1; }
.raid-proscons { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 600px) { .raid-proscons { grid-template-columns: 1fr 1fr; } }
.raid-proscons div { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-elevated); }
.raid-proscons h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.raid-proscons ul { margin: 0; padding-left: var(--sp-4); font-size: var(--fs-sm); color: var(--text-muted); }
.raid-proscons li { margin-bottom: 4px; }

/* LUT preset chips */
.lut-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.lut-presets button { padding: 6px 12px; background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text); border-radius: 999px; cursor: pointer; font-size: var(--fs-sm); transition: background .15s, border-color .15s; font-family: var(--font-sans); }
.lut-presets button:hover { background: var(--bg-elevated-2); border-color: var(--accent); }
.lut-presets button.is-active { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.lut-links { padding-left: var(--sp-4); margin: 0; }
.lut-links li { margin-bottom: 6px; }
.lut-links a { color: var(--accent); text-decoration: none; }
.lut-links a:hover { text-decoration: underline; }

/* CIE 1931 + gamut toggles */
.cie-wrap { display: grid; gap: var(--sp-3); }
.cie-stage { background: #0b0d10; border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); }
.cie-stage canvas { display: block; width: 100%; height: auto; max-width: 100%; }
.cie-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.gamut-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); border-radius: 999px; cursor: pointer; font-size: var(--fs-xs); font-family: var(--font-sans); transition: opacity .15s, color .15s, border-color .15s; opacity: .55; }
.gamut-toggle.is-on { opacity: 1; color: var(--text); border-color: var(--border-bright); background: var(--bg-elevated-2); }
.gamut-toggle .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cie-hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }

/* Log curve fact-cards (small data list inside the result panel) */
.factlist { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-2); margin: var(--sp-3) 0 0; padding: 0; list-style: none; }
.factlist li { padding: var(--sp-2) var(--sp-3); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-sm); }
.factlist .k { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.factlist .v { display: block; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); margin-top: 2px; }
.factlist li.wide { grid-column: 1 / -1; }

/* Pro ad-gate — hide AdSense for paying users */
.pmt-is-pro ins.adsbygoogle,
.pmt-is-pro .adsbygoogle,
.pmt-is-pro iframe[src*="googlesyndication"],
.pmt-is-pro iframe[src*="googleadservices"] { display: none !important; visibility: hidden !important; }

/* Auth / Dashboard UI */
.auth-form { display: grid; gap: var(--sp-3); max-width: 420px; margin: 0 auto; }
.auth-form .control { width: 100%; }
.auth-message { padding: var(--sp-3); border-radius: var(--r-sm); margin-top: var(--sp-3); font-size: var(--fs-sm); }
.auth-message.ok { background: rgba(78,209,161,.10); border: 1px solid rgba(78,209,161,.30); color: #4ed1a1; }
.auth-message.err { background: rgba(255,142,110,.10); border: 1px solid rgba(255,142,110,.30); color: #ff8e6e; }

.tier-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tier-badge.free { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.tier-badge.pro  { background: linear-gradient(135deg, #6ea8ff, #9d7cff); color: #fff; border: 0; }

.preset-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-2); align-items: center; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-elevated); margin-bottom: var(--sp-2); }
.preset-row .preset-name { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-row .preset-meta { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }

.rename-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-2); align-items: center; padding: 6px var(--sp-3); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--fs-xs); }
.rename-row:last-child { border-bottom: 0; }
.rename-old { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename-new { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename-arrow { color: var(--accent); font-weight: 700; }
#rename-list { max-height: 320px; overflow-y: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-sm); margin-top: var(--sp-3); padding: 0; }
#rename-list > .hint { padding: var(--sp-2) var(--sp-3); margin: 0; border-bottom: 1px solid var(--border); background: var(--bg-elevated-2); }

/* ───── Pipelines / workflows ───── */
.pipe { scroll-margin-top: 90px; }
.pipe-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.pipe-head h2 { margin: 0; font-size: var(--fs-lg); }
.pipe-sub { color: var(--text-muted); font-size: var(--fs-sm); margin: 0 0 var(--sp-4); }
.pipe-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: st; }
.stages li { display: grid; grid-template-columns: 28px 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); align-items: start; }
.stages li:last-child { border-bottom: 0; }
.stages li::before { counter-increment: st; content: counter(st); width: 26px; height: 26px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--bg-elevated-2); color: var(--accent); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; }
.stages .st-name { font-family: var(--font-head); font-weight: 600; font-size: var(--fs-sm); }
.stages .st-rec { color: var(--text-muted); font-size: var(--fs-sm); margin: 2px 0 0; }
.copy-hash { background: transparent; border: 1px solid var(--border-bright); color: var(--text-muted); border-radius: var(--r-md); padding: 6px 12px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 0; transition: color var(--t-fast), border-color var(--t-fast); }
.copy-hash:hover { color: var(--text); border-color: var(--accent); }
.copy-hash.copied { color: var(--success); border-color: var(--success); }
.copy-hash svg { width: 14px; height: 14px; }

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