/* Tema visual de ganstreport: tokens por variables (themes.css define 15 temas × claro/oscuro/sistema).
   Ningún componente usa colores fijos: todo sale de estas variables. */
@import url("themes.css");
@import url("ui.css");
@font-face { font-family: "Manrope"; src: url(manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/JetBrainsMono-Regular.ttf); }

:root {
  --canvas: #eef1ee; --surface: #ffffff; --surface-2: #f5f7f5; --panel: #ffffff; --panel-ink: #17201b;
  --ink: #17201b; --ink-muted: #56625b; --border: #e2e7e3; --control-border: #8a968f;
  --primary: #1f6f4a; --primary-ink: #ffffff; --accent: #d9efe2; --accent-ink: #14402b; --hero: #1f6f4a; --hero-ink: #ffffff; --focus: #1f6f4a;
  --success: #dcf3e5; --success-ink: #14532d; --warning: #fdf0d2; --warning-ink: #7a4b00; --danger: #fde2e0; --danger-ink: #8f1d17;
  --chart-1: #2f8a5b; --chart-2: #74c69d; --chart-3: #b7e4c7; --chart-4: #1b4332; --chart-5: #95a99c; --chart-6: #d8f3dc;
  --radius-card-v: 24px; --shadow-card-v: 0 1px 2px rgb(16 24 20 / 0.04), 0 8px 24px rgb(16 24 20 / 0.04);
  /* series categóricas (paleta validada, orden fijo): 1 IA · 2 Python · 3 Flow */
  --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #f2a600;
  --font: "Manrope", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
[data-mode="dark"] { --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #d28e05; }
@media (prefers-color-scheme: dark) { [data-mode="system"] { --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #d28e05; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--canvas); }
body { display: grid; grid-template-columns: 256px 1fr; font: 14px/1.5 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font); margin: 0 0 .4em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 15px; font-weight: 700; }
a { color: inherit; }
small, .muted { color: var(--ink-muted); }
code, .mono { font-family: "JetBrains Mono", monospace; font-size: 12px; }
.tabular, .kpi, td.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }

/* sidebar (como ganstreport: panel claro, ítem activo en primario) */
.side { background: var(--panel); color: var(--panel-ink); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.logo { display: flex; gap: 10px; align-items: center; margin: 0 6px 20px; }
.logo b { font-size: 18px; font-weight: 800; display: block; letter-spacing: -.02em; }
.logo small { color: var(--ink-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--hero); color: var(--hero-ink); display: grid; place-items: center; font: 800 18px var(--font); flex: none; }
.brand-pick { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); margin: 0 6px 16px; }
.brand-pick select { margin-top: 6px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); margin: 14px 12px 4px; }
nav a { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-muted); font-weight: 600; }
nav a i { font-style: normal; width: 18px; text-align: center; }
nav a:hover { background: var(--surface-2); color: var(--ink); }
nav a.on { background: var(--primary); color: var(--primary-ink); }
.side-foot { margin-top: auto; padding: 14px 6px 0; font-size: 11px; color: var(--ink-muted); }
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.theme-pick select { min-height: 34px; padding: 4px 10px; font-size: 12px; }
.theme-pick .modes { grid-column: 1 / -1; display: flex; gap: 4px; }
.theme-pick .modes button { flex: 1; justify-content: center; }

main { padding: 28px 32px 60px; overflow: auto; height: 100vh; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 0; color: var(--ink-muted); max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card-v); padding: 20px; box-shadow: var(--shadow-card-v); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 8px; }
.pcard .row { gap: 6px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sp { flex: 1; }
section.block { margin-top: 26px; }
section.block > .block-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
section.block > .block-h h2 { margin: 0; }

/* formularios: controles redondeados, alto mínimo 44px */
input, select, textarea { font: inherit; min-height: 44px; padding: 9px 14px; border: 1px solid var(--control-border); border-radius: 16px; background: var(--surface); color: var(--ink); width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input[type=color] { padding: 3px; height: 40px; min-height: 40px; width: 56px; border-radius: 12px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--primary); }
input[type=range] { padding: 0; min-height: 28px; border: none; accent-color: var(--primary); background: transparent; }
input[type=file] { border-style: dashed; max-width: 100%; min-width: 0; } /* el selector de archivo no empuja la fila en el teléfono */
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; }
label.f > small { display: block; font-weight: 500; margin-top: 4px; }
label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form .wide { grid-column: 1 / -1; }

/* botones píldora */
button, .btn { font: 700 13px var(--font); min-height: 40px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
button:hover, .btn:hover { filter: brightness(1.06); }
button.ghost, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); filter: none; }
button.accent { background: var(--hero); border-color: var(--hero); color: var(--hero-ink); }
button.green { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.sm, .btn.sm { min-height: 32px; padding: 4px 12px; font-size: 12px; }
button.danger { background: var(--danger); color: var(--danger-ink); border-color: var(--danger); }
button:disabled { opacity: .5; cursor: progress; }

/* tablas */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); padding: 10px 8px; border-bottom: 1px solid var(--border); font-weight: 700; }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--border); }
.st-completado, .pill.ok { background: var(--success); color: var(--success-ink); border-color: transparent; }
.st-error, .pill.bad { background: var(--danger); color: var(--danger-ink); border-color: transparent; }
.st-en_proceso, .st-en_flow, .pill.warn { background: var(--warning); color: var(--warning-ink); border-color: transparent; }
.st-pendiente { background: var(--surface-2); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; border: 1px solid var(--border); }

/* pestañas: una sola fila que se desliza en pantallas angostas */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); padding: 4px; border-radius: 999px; width: fit-content; max-width: 100%; border: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { flex: none; background: none; color: var(--ink-muted); border: none; min-height: 36px; padding: 6px 16px; border-radius: 999px; font: 700 13px var(--font); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.tabs button:hover, .tabs a:hover { color: var(--ink); filter: none; }
.tabs button.on, .tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card-v); }
.tabs .count { font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--border); }
.tabs.sub { background: none; border: none; padding: 0; gap: 6px; }
.tabs.sub a, .tabs.sub button { border: 1px solid var(--border); background: var(--surface); min-height: 32px; padding: 4px 12px; font-size: 12px; }
.tabs.sub a.on, .tabs.sub button.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); box-shadow: none; }
.tab-panes > [hidden] { display: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 6px 8px; }
.toolbar .group > small { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; padding: 0 4px; }
.toolbar select { min-height: 32px; padding: 4px 12px; font-size: 12px; width: auto; max-width: 220px; }
details.tools > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 700; font-size: 13px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); width: fit-content; margin-bottom: 12px; }
details.tools > summary::-webkit-details-marker { display: none; }
details.tools > summary::after { content: "▾"; color: var(--ink-muted); }
details.tools[open] > summary::after { content: "▴"; }
details.tools[open] > summary { display: none; }
.split { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap.sticky th:first-child, .table-wrap.sticky td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin: 0; }
.facts div { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.agenda .wk { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); font-weight: 700; margin: 16px 0 6px; }
.agenda .dayrow { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.agenda .dayrow .d { font-weight: 800; font-size: 13px; }
.agenda .dayrow .d small { display: block; font-weight: 600; }
.agenda .chip { margin-top: 0; margin-bottom: 6px; font-size: 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; padding: 6px 8px; }
.agenda .chip b { white-space: normal; }
.agenda .chip img { grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 55px; margin: 0; }
.occ-list .row { padding: 8px 0; border-bottom: 1px solid var(--border); }

/* barra superior y menú deslizable (móvil y tablet) */
.topbar { display: none; }
.scrim { display: none; }
button.icon { min-height: 40px; width: 40px; padding: 0; justify-content: center; font-size: 18px; }

/* modal y avisos */
.modal { position: fixed; inset: 0; background: rgb(10 14 12 / .55); display: grid; place-items: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: var(--surface); color: var(--ink); border-radius: var(--radius-card-v); padding: 26px; width: min(880px, 94vw); max-height: 90vh; overflow: auto; position: relative; box-shadow: var(--shadow-card-v); }
.modal-box .x { position: absolute; right: 14px; top: 12px; background: none; color: var(--ink); border: none; font-size: 22px; min-height: 0; padding: 4px 10px; }
#toast { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
#toast div { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow-card-v); max-width: 440px; font-weight: 600; }
#toast div.err { background: var(--danger); color: var(--danger-ink); }

/* panel / KPIs */
.kpi { font: 800 30px var(--font); letter-spacing: -.02em; }
.kpi-card small { font-weight: 600; }
.kpi-card .sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.hero-card { background: var(--hero); color: var(--hero-ink); border-color: transparent; }
.hero-card small, .hero-card .sub { color: var(--hero-ink); opacity: .85; }
.brand-card { display: flex; gap: 12px; align-items: center; }
.stage-chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.statline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.statline div { background: var(--surface-2); border-radius: 14px; padding: 8px 4px; }
.statline b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.statline small { font-size: 11px; }

/* gráficos simples (barras HTML): marcas finas, extremos redondeados, 2px de separación */
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.legend-row span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.sbar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: var(--surface-2); min-width: 60px; }
.sbar i { display: block; height: 100%; background: var(--c); }
.hbars { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 90px; gap: 8px 12px; align-items: center; font-size: 13px; }
.hbars .track { height: 10px; background: var(--surface-2); border-radius: 4px; position: relative; }
.hbars .fill { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbars .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--border); }
.cols .col { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; position: relative; }
.cols .col i { display: block; background: var(--c); border-radius: 4px 4px 0 0; min-height: 0; }
.cols .col:hover { background: var(--surface-2); border-radius: 4px; }
.cols-x { display: flex; gap: 2px; font-size: 10px; color: var(--ink-muted); }
.cols-x span { flex: 1; text-align: center; }
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-card-v); }
.tip b { display: block; margin-bottom: 2px; }

/* procesos: qué es IA, qué es Python, qué es Flow */
.proc { margin: 6px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 16px; font-size: 12px; }
.proc .proc-h { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; }
.proc ol, ol.proc { margin: 0; padding-left: 18px; }
ol.proc { padding: 12px 14px 12px 30px; }
.proc li { margin: 4px 0; }
.eng { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; margin-right: 4px; }
.eng-ia { background: var(--series-1); }
.eng-py { background: var(--series-2); }
.eng-flow { background: var(--series-3); color: #0b0b0b; }

/* conexiones (Nexo, Flow) */
.light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--ink-muted); }
.light.verde { background: #0aac23; } .light.ambar { background: #e8a317; } .light.roja { background: #dc3c3d; } .light.gris { background: #9c9c9c; } .light.apagada { background: var(--border); border: 1px solid var(--control-border); }
.code-big { font: 800 34px "JetBrains Mono", monospace; letter-spacing: .12em; padding: 14px 18px; background: var(--accent); color: var(--accent-ink); border-radius: 18px; text-align: center; }
.role { border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.role .chain { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

/* calendario */
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-card-v); }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card-v); overflow: hidden; min-width: 760px; }
.cal-head, .cal-week { display: grid; grid-template-columns: 34px repeat(7, 1fr); }
.cal-head div { padding: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); border-bottom: 1px solid var(--border); font-weight: 700; }
.cal-week { border-bottom: 1px solid var(--border); min-height: 118px; }
.stage-band { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 10px var(--font); text-transform: uppercase; letter-spacing: .08em; color: #fff; display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.day { padding: 6px; border-left: 1px solid var(--border); position: relative; min-width: 0; }
.day.out { opacity: .35; }
.day .n { font: 800 12px var(--font); color: var(--ink-muted); }
.day.drop { outline: 2px dashed var(--primary); outline-offset: -3px; }
.legend-inline { flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.agenda .occ { display: inline-block; margin: 0 0 4px; font-size: 11.5px; font-weight: 700; border: 1px dashed var(--border); border-radius: 8px; padding: 2px 8px; }
.fmts label { width: 48%; min-width: 200px; }
.day .occ { margin-top: 3px; font-size: 10.5px; font-weight: 700; line-height: 1.2; color: var(--ink); background: var(--surface-strong, var(--surface)); border: 1px dashed var(--border); border-radius: 8px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.chip { display: block; margin-top: 4px; padding: 5px 6px; border-radius: 10px; font-size: 11px; line-height: 1.25; cursor: pointer; border-left: 4px solid; overflow: hidden; }
.chip b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .meta { display: flex; gap: 4px; align-items: center; margin-top: 2px; opacity: .9; }
.chip img { width: 100%; border-radius: 6px; margin-top: 4px; display: block; aspect-ratio: 4/5; object-fit: cover; }
.chip:hover { filter: brightness(.96); }
.legend .row { margin: 3px 0; font-size: 12px; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 6px 0 10px; gap: 2px; }
.funnel-key { display: flex; gap: 4px; }
.funnel-key span { flex: 1; text-align: center; font-size: 11px; padding: 3px; border-radius: 8px; color: #fff; font-weight: 700; }

/* estudio */
.studio { display: grid; grid-template-columns: 250px 1fr 290px; gap: 14px; align-items: start; }
.canvas-stage { background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0 / 22px 22px; border-radius: var(--radius-card-v); border: 1px solid var(--border); display: grid; place-items: center; padding: 18px 18px 58px; min-height: 70vh; overflow: auto; position: relative; }
.canvas-stage .canvas-container { box-shadow: 0 20px 50px -20px #0006; }
.hist { position: absolute; left: 10px; bottom: 10px; z-index: 5; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 20px -12px #0006; }
.hist button { border-radius: 999px; margin: 0; }
.hist button:disabled { opacity: .4; cursor: default; }
.hist-sep { width: 1px; margin: 4px 2px; background: var(--border); }
#zoomFit { min-width: 58px; font-variant-numeric: tabular-nums; }
#zoomFit.on { background: var(--surface-2); }
.pending { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5; background: var(--warning); color: var(--warning-ink); border-radius: 14px; padding: 8px 12px; font-size: 12px; font-weight: 600; }
.layers li { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 12px; font-size: 12px; cursor: pointer; }
.layers li.on { background: var(--accent); color: var(--accent-ink); }
.layers li button { min-height: 24px; padding: 1px 6px; font-size: 11px; }
.layers ul { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-grid button { justify-content: center; }
details.fx { border-top: 1px solid var(--border); padding-top: 10px; }
details.fx summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
details.fx > * + * { margin-top: 8px; }

/* galería */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.tile .media { background: var(--panel-ink); aspect-ratio: 4/5; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.tile .media img, .tile .media video { width: 100%; height: 100%; object-fit: contain; }
.tile .body { padding: 8px 10px; font-size: 12px; }
.tree { font-size: 13px; }
.tree details { margin-left: 12px; }
.tree summary { cursor: pointer; padding: 2px 0; }
.tree .file { margin-left: 26px; display: block; color: var(--primary); }
.scene { display: grid; grid-template-columns: 40px 1fr 1fr 70px; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.scene .num { font: 800 20px var(--font); color: var(--primary); }
.prompt-out { background: var(--panel-ink); color: var(--surface); padding: 12px; border-radius: 14px; white-space: pre-wrap; font: 12px/1.5 "JetBrains Mono", monospace; }
.empty { padding: 40px; text-align: center; color: var(--ink-muted); }

/* estudio en pantallas angostas: lienzo arriba y paneles en pestañas */
.studio-tabs { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .studio { grid-template-columns: 220px 1fr 260px; }
}
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .studio { grid-template-columns: 1fr; }
  .studio > .canvas-stage { order: -2; min-height: 50vh; }
  .studio-tabs { display: flex; order: -1; margin: 0; }
  .studio > .stack > [data-panel] { display: none; }
  .studio > .stack > [data-panel].show { display: block; }
  .studio > .stack:empty { display: none; }
  .studio > .stack > * + * { margin-top: 0; }
}
@media (max-width: 900px) {
  body { display: block; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; background: var(--panel); border-bottom: 1px solid var(--border); padding: 8px 12px; }
  .topbar .logo-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .topbar b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; z-index: 46; transform: translateX(-105%); transition: transform .22s ease; box-shadow: none; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .25); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(10 14 12 / .45); }
  main { height: auto; overflow: visible; padding: 18px 16px 80px; }
  .grid2, .split { grid-template-columns: 1fr; }
  .head { align-items: flex-start; }
  .head > .row { width: 100%; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; } h2 { font-size: 18px; }
  .grid3 { grid-template-columns: 1fr; }
  .grid4 { gap: 10px; }
  .kpi { font-size: 22px; }
  .card { padding: 16px; border-radius: 20px; }
  .form { grid-template-columns: 1fr; }
  .statline { grid-template-columns: repeat(3, 1fr); }
  .hbars { grid-template-columns: minmax(80px, 120px) 1fr 76px; font-size: 12px; gap: 6px 8px; }
  .scene { grid-template-columns: 1fr; }
  .modal { place-items: end center; }
  .modal-box { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 20px 16px; }
  details.tools[open] > summary { display: flex; }
  .toolbar .group { width: 100%; }
  .toolbar select { max-width: none; flex: 1; }
  .head > .row > select, .head > .row > input { flex: 1 1 100%; width: 100% !important; }
  #toast { left: 12px; right: 12px; } #toast div { max-width: none; }
  .agenda .dayrow { grid-template-columns: 58px 1fr; }
}

/* ---------- cuentas sociales (spec 003) ---------- */
.net { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font: 800 13px var(--font); color: #fff; background: var(--ink-muted); flex: none; }
.net-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); }
.net-facebook { background: #1877f2; } .net-tiktok { background: #111; } .net-youtube { background: #e62117; } .net-linkedin { background: #0a66c2; }
.net-x { background: #000; } .net-pinterest { background: #e60023; } .net-demo { background: var(--primary); }
.flag.ok { background: var(--success); color: var(--success-ink); }
.sa-cards, .sa-gone { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sa-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; display: grid; gap: 10px; align-content: start; box-shadow: var(--shadow-card-v); }
.sa-card.st-vencida, .sa-card.st-revocada { border-color: color-mix(in srgb, var(--danger-ink) 35%, var(--border)); }
.sa-card.st-por_vencer { border-color: color-mix(in srgb, var(--warning-ink) 35%, var(--border)); }
.sa-card.st-desconectada { opacity: .78; }
.sa-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.sa-pic { position: relative; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); flex: none; display: grid; place-items: center; }
.sa-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.sa-pic .sa-net { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; font-size: 11px; border-radius: 7px; border: 2px solid var(--surface); }
.sa-pic:not(:has(img)) .sa-net { position: static; width: 48px; height: 48px; font-size: 20px; border-radius: 14px; border: 0; }
.sa-id { display: grid; min-width: 0; }
.sa-id b { overflow-wrap: anywhere; }
.sa-id small { color: var(--ink-muted); }
.sa-st { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sa-reason { margin: 0; font-size: 13px; color: var(--ink-muted); }
.sa-tag { margin: 0; justify-self: start; }
.sa-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-connect { margin-bottom: 4px; }
.sa-connect h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.sa-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.sa-btn { display: grid; gap: 4px; align-content: start; }
.sa-btn > button { justify-content: flex-start; min-height: 48px; width: 100%; }
.sa-btn > button:disabled { color: var(--ink-muted); cursor: not-allowed; filter: none; }
.sa-btn > button .net { width: 24px; height: 24px; }
.sa-why { display: flex; gap: 4px; align-items: center; color: var(--ink-muted); font-size: 12px; padding-left: 8px; }
.sa-why .ico, .sa-cfg .ico { width: 14px; height: 14px; flex: none; }
.sa-cfg { display: flex; gap: 6px; align-items: center; margin: 12px 0 0; font-size: 13px; }
.sa-more { margin: 12px 0; }
.sa-empty { margin-bottom: 14px; }
.sa-soon { margin: 0 0 12px; }
/* elegir cuentas (#/conectar) */
.cands { display: grid; gap: 8px; }
.cand { display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 16px; cursor: pointer; background: var(--surface); }
.cand:has(input:checked) { border-color: var(--primary); background: var(--accent); color: var(--accent-ink); }
.cand.child { margin-left: 28px; }
.cand.off { cursor: not-allowed; background: var(--surface-2); color: var(--ink-muted); }
.cand input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--primary); }
.cand-t { display: grid; min-width: 0; }
.cand-t b { overflow-wrap: anywhere; }
.cand-tag { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; }
.cand-tag .ico { width: 14px; height: 14px; }
.cand-tag.bad { color: var(--danger-ink); }
.sa-pick-actions { margin-top: 16px; }
.sa-missing .sm { flex: none; }
/* avisos */
.sa-attn { padding: 6px 16px; }
.sa-attn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sa-attn-row:last-child { border-bottom: 0; }
.sa-attn-row .sa-id { flex: 1 1 160px; }
.sa-confirm h2 { display: flex; gap: 8px; align-items: center; }
.sa-confirm .limit-band { margin: 12px 0; }
/* Configuración → Redes sociales */
.sx-intro { margin-bottom: 14px; }
.sx-intro p { margin: 4px 0 0; }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sx-app { display: grid; gap: 12px; align-content: start; }
.sx-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sx-head b { font-size: 16px; }
.sx-app > .f { display: grid; gap: 4px; }
.sx-saved { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sx-copy { display: flex; gap: 6px; }
.sx-copy input { flex: 1; min-width: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.sx-det summary { cursor: pointer; font-weight: 700; font-size: 13px; min-height: 36px; display: flex; align-items: center; }
.sx-scopes, .sx-guide { margin: 6px 0 10px; padding-left: 18px; font-size: 13px; }
.sx-scopes li, .sx-guide li { margin: 4px 0; overflow-wrap: anywhere; }
.sx-switch { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; min-height: 40px; cursor: pointer; }
.sx-switch input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.sx-foot { border-top: 1px solid var(--border); padding-top: 10px; }
/* resultados (spec 004): indicador de la pieza, celda de Publicaciones, tabla por red y mini-evolución */
.res-badge { display: inline-flex; gap: 3px; align-items: center; margin-top: 4px; padding: 1px 7px 1px 5px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 10.5px; font-weight: 800; line-height: 1.5; font-variant-numeric: tabular-nums; max-width: 100%; }
.res-badge .ico { width: 12px; height: 12px; flex: none; }
.res-badge.live { background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--ink-muted); outline: 1px dashed color-mix(in srgb, var(--ink-muted) 45%, transparent); outline-offset: -1px; }
.agenda .chip .res-badge { grid-column: 1 / -1; justify-self: start; }
.res-cell { display: grid; gap: 4px; justify-items: start; min-width: 170px; }
.res-mini { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.res-mini > span { display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.res-mini .ico { width: 14px; height: 14px; color: var(--ink-muted); }
.res-mini .res-pm { font-weight: 800; }
.res-err { display: block; max-width: 280px; }
.res-flag { white-space: nowrap; }
.res-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.res-head > span:nth-child(2) { display: grid; flex: 1 1 180px; min-width: 0; }
.res-big { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.res-notice { margin: 0; }
.res-table table { min-width: 420px; }
.res-table th[scope="row"] { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--ink); }
.res-table td { font-variant-numeric: tabular-nums; }
.res-table thead th { vertical-align: bottom; }
.res-table thead small { display: block; font-weight: 500; }
.res-evo { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.res-evo-i { border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface); min-width: 0; }
.res-evo-i details summary { cursor: pointer; font-size: 13px; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.res-spark { margin: 6px 0 0; }
.res-spark svg { display: block; width: 100%; height: auto; max-width: 420px; overflow: visible; }
.res-spark figcaption { font-size: 12px; margin-top: 2px; }
.sp-base { stroke: var(--border); stroke-width: 1; }
.sp-area { fill: var(--chart-1); opacity: .1; stroke: none; }
.sp-line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.sp-hit { fill: transparent; cursor: help; }
.sp-pt:hover .sp-dot { stroke-width: 3; r: 5; }
.sp-x { fill: var(--ink-muted); font-size: 10px; text-anchor: middle; }
.sp-end { fill: var(--ink); font-size: 11px; font-weight: 800; }
/* resultados de la marca (US2): barra de período, tarjetas de objetivos, indicadores, piezas y seguidores */
.ico.up { transform: rotate(-90deg); }
.ico.down { transform: rotate(90deg); }
button.link { background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--primary); font-weight: 700; border-radius: 6px; }
button.link:hover { text-decoration: underline; filter: none; }
button.link .ico { width: 15px; height: 15px; }
.res-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.res-sel { min-width: 180px; flex: 0 1 240px; }
.res-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.res-stage { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.res-stage small { flex-basis: 100%; }
.res-month h3, .res-month h3 small { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.res-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.res-goal { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card-v); min-width: 0; }
.res-goal header { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%; }
.res-goal header b { font-size: 14px; }
.res-goal.st-cumple { border-color: color-mix(in srgb, var(--success-ink) 35%, var(--border)); }
.res-goal.st-no_cumple { border-color: color-mix(in srgb, var(--danger-ink) 30%, var(--border)); }
.res-goals.sec .res-goal { box-shadow: none; padding: 12px 14px; }
.res-goals.sec .res-big { font-size: 24px; }
.res-meta { margin: 0; font-size: 13px; color: var(--ink-muted); }
.res-delta { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.res-delta .ico { width: 14px; height: 14px; }
.res-delta.good { color: var(--success-ink); }
.res-delta.bad { color: var(--danger-ink); }
.res-why { color: var(--ink-muted); }
.res-goal-a { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.res-ind { margin-bottom: 10px; }
.res-ind caption { text-align: left; font-weight: 800; font-size: 13px; padding: 4px 8px 6px; }
.res-ind table { table-layout: fixed; width: 100%; min-width: 0; }
.res-ind td, .res-ind th { overflow-wrap: anywhere; }
.res-ind .flag { overflow-wrap: normal; white-space: nowrap; }
.res-ind thead th:first-child { width: 50%; }
.res-ind td:last-child, .res-ind th:last-child { color: var(--ink-muted); }
.res-foot { margin: 0; }
.res-bw .card h3, .res-plist + .res-pager { margin-top: 0; }
.res-plist { display: grid; gap: 4px; }
.res-prow { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; font-weight: 500; }
.res-prow:hover:not(:disabled) { background: var(--surface-2); filter: none; }
.res-prow:disabled { cursor: default; opacity: 1; }
.res-sw { width: 10px; height: 34px; border-radius: 4px; }
.res-pt, .res-pv { display: grid; min-width: 0; }
.res-pt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-pv { text-align: right; font-variant-numeric: tabular-nums; }
.res-pager { justify-content: space-between; margin-top: 10px; }
.res-line { margin: 0; }
.res-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-bottom: 6px; }
.res-legend span, .lc-tip span { display: inline-flex; gap: 6px; align-items: center; }
.res-legend i, .lc-tip i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.res-line-box { position: relative; }
.res-line-box svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.lc-grid { stroke: var(--border); stroke-width: 1; }
.lc-y { fill: var(--ink-muted); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.lc-x { fill: var(--ink-muted); font-size: 11px; text-anchor: middle; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { stroke: var(--surface); stroke-width: 2; }
.lc-end { fill: var(--ink); font-size: 11px; font-weight: 800; }
.lc-cross { stroke: var(--ink-muted); stroke-width: 1; }
.lc-hit { fill: transparent; cursor: crosshair; }
.lc-tip[hidden] { display: none; }
.lc-tip { position: absolute; top: 4px; z-index: 2; display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 20px -12px #0006; font-size: 12px; pointer-events: none; white-space: nowrap; }
.res-goalt table { min-width: 560px; }
.res-goalt th[scope="row"] small { display: block; font-weight: 500; font-size: 11px; }
.res-goalt select, .res-goalt input[type=number] { min-height: 38px; padding: 6px 10px; border-radius: 12px; }
.res-goalt td:last-child small { display: block; }
.res-target { display: inline-flex; gap: 4px; align-items: center; max-width: 130px; }
.res-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; min-height: 40px; }
.res-goal-actions { flex-wrap: wrap; gap: 8px; }
.res-add { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.res-add h3 { grid-column: 1 / -1; margin: 0; }
.res-line-sum { display: flex; gap: 10px; align-items: center; width: 100%; margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-card-v); background: var(--surface); color: var(--ink); border: 1px solid var(--border); font-weight: 500; font-size: 14px; text-align: left; }
.res-line-sum:hover { background: var(--surface-2); filter: none; }
/* resultados del negocio (US5) */
.res-bizg { align-items: start; }
.res-bizg h3 { margin-top: 0; }
.res-biz-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.res-biz-warn:empty { display: none; }
.res-biz .res-sel { max-width: 320px; }
.res-bizg td small, .res-bizg th small { display: block; }
.res-log { list-style: none; margin: 0; padding: 0; display: grid; }
.res-log li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.res-log .ico { width: 14px; height: 14px; vertical-align: -2px; }
.biz-alert button { flex: none; }
/* recomendaciones e historial de etapas (US3) */
.res-rec { display: grid; gap: 12px; }
.res-rec.st-pendiente { border: 1px solid color-mix(in srgb, var(--warning-ink) 35%, var(--border)); }
.res-rec th[scope="row"] small { display: block; font-weight: 500; }
.res-rec-h { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.res-rec-h h3 { margin: 2px 0 0; }
.res-rec-ico, .rec-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); flex: none; }
.res-stages { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res-miss { display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.res-miss ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.res-miss li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.res-miss li > .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink-muted); }
.res-rec-a { gap: 8px; flex-wrap: wrap; }
.res-conf { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.res-hist { list-style: none; margin: 0; padding: 0; display: grid; }
.res-hist li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.res-hist-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; box-shadow: 0 0 0 3px var(--surface); }
.rec-home { display: grid; padding: 6px; }
.rec-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; color: var(--ink); text-decoration: none; min-height: 52px; }
.rec-row:hover { background: var(--surface-2); }
.rec-row .sp { display: grid; min-width: 0; }
/* mezcla personalizada (US4) */
.res-mix td:last-child { color: var(--ink); }
.res-mix th[scope="row"] .res-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.res-mix thead th:first-child { width: 40%; }
.res-mix .res-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.res-mix .res-delta .ico { width: 14px; height: 14px; }
.res-mix-note { margin: 0; }
.res-mix-x { display: grid; gap: 12px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.res-mix-x > div { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-size: 13px; }
.res-mix-x b { display: inline-flex; align-items: center; gap: 6px; }
.res-mix-x ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.res-mix-x p { margin: 0; text-transform: capitalize; }
.res-mix-x .ico { width: 16px; height: 16px; }
.res-mixline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--ink-muted); }
.res-mixline[hidden] { display: none; }
.res-mixline > .ico { width: 16px; height: 16px; }
/* cuenta que publica sin permiso de resultados */
.sa-metrics { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--warning); color: var(--warning-ink); font-size: 13px; }
.sa-metrics > .ico { width: 20px; height: 20px; flex: none; }
.sa-metrics > span { display: grid; flex: 1 1 170px; min-width: 0; }
.sa-metrics small { opacity: .92; }
@media (max-width: 640px) {
  .res-big { font-size: 28px; }
  .res-evo, .res-goals, .res-bw { grid-template-columns: 1fr; }
  .res-sel { flex: 1 1 100%; }
  .res-flags { margin-left: 0; }
  .res-goal-actions button { flex: 1 1 auto; justify-content: center; }
  .res-ind th, .res-ind td { padding-left: 6px; padding-right: 6px; }
  .res-ind thead th:first-child { width: 46%; }
  .res-rec .res-ind thead th:first-child { width: 38%; }
  .res-rec .res-ind thead th:nth-child(2) { width: 34%; }
  /* objetivos y negocio: cada fila como una tarjeta (sin desplazamiento lateral) */
  .res-cards table { min-width: 0; }
  .res-cards thead { display: none; }
  .res-cards tbody { display: block; }
  .res-cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .res-cards th[scope="row"] { grid-column: 1 / -1; padding: 0; border: 0; }
  .res-cards td { display: grid; gap: 4px; align-content: start; padding: 0; border: 0; }
  .res-cards td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
  .res-cards select { width: 100%; }
  .res-target { max-width: none; }
  .res-biz-f { grid-template-columns: 1fr 1fr; }
  .sa-metrics button { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .sa-cards, .sa-gone, .sa-btns, .sx-grid { grid-template-columns: 1fr; }
  .cand.child { margin-left: 16px; }
  .sa-pick-actions { flex-direction: column-reverse; align-items: stretch; }
  .sa-pick-actions .sp { display: none; }
  .sa-pick-actions button { justify-content: center; min-height: 48px; }
  .sa-actions button { flex: 1 1 auto; justify-content: center; min-height: 40px; }
}
