/* ============================================================
   RADIANT · polish.css — Auditoría UI/UX (accesibilidad + aire)
   Se carga LA ÚLTIMA en app.html y coach.html.
   Reglas: texto ≥11,5px (micro-badges) / ≥12px (labels) / AA 4,5:1
   en texto pequeño; tap targets ≥30px desktop, ≥36px móvil.
   ============================================================ */

/* ---------- Tokens accesibles (sobrescriben :root previos) ---------- */
:root {
  --ink-2: #5f4e3e;        /* 6,8:1 sobre crema */
  --ink-3: #75614d;        /* 5,0:1 sobre crema · 5,7:1 sobre card */
  --ember-text: #94570f;   /* dorado legible para texto pequeño */
  --ok-text: #3f6631;
  --warn-text: #8a5210;
  --danger-text: #a63b2c;
}

/* ============================================================
   1 · TIPOGRAFÍA — suelos de tamaño
   ============================================================ */

/* Micro-badges (chapas): mínimo 10,5–11px, siempre bold */
.side-badge, .h1-badge, .pr-new, .fn-pill { font-size: 10.5px; }
.lead-status { font-size: 11px; }

/* Labels uppercase con tracking: 12px */
.eyebrow-label, .goal-lab, .schedule-lab, .ai-tag, .axis-lab,
.calc-lab, .stat-lab, .stat-label, .draft-eyebrow, .anchor-label,
.fb-title, .srss-kind, .load-gauge-zone, .cycle-priv,
.e1rm-inputs label, .calc-grid label, .m-label, .m-label--sm,
.note-for, .weight-sub { font-size: 12px; }
.m-or { font-size: 11.5px; }
th { font-size: 11.5px; }
.wordmark small { font-size: 11px; }
.side-count { font-size: 11.5px; }
.side-role { font-size: 12px; }

/* Tags y pills de estado */
.xtag, .tag, .draft-tag, .bl-tag { font-size: 11.5px; }
.tri-flag, .wl-badge, .habit-streak, .pl, .mini-up { font-size: 12px; }
.ex-media-label { font-size: 12px; }
.avatar--sm { font-size: 11.5px; }

/* Texto secundario / meta: 12,5–13px */
.chat-day, .demo-note, .tca-note, .schedule-note { font-size: 12.5px; }
.bubble time { font-size: 11.5px; }
.meal-time, .signal-label { font-size: 12px; }
.signal-note, .day-meta, .pr-detail, .lead-meta, .coach-role,
.note-when, .cycle-sub, .nutri-sub, .weight-delta { font-size: 12.5px; }
.triage-sub, .lib-foot, .load-legend, .forms-hint, .fb-block-detail,
.modal-sub, .chart-label { font-size: 13px; }
.load-stat, .load-verdict, .ai-note, .lib-avisar, .nutri-sugg,
.draft-reason { font-size: 13.5px; }
.block-note, .tip { font-size: 13px; }

/* Controles con texto */
.ai-chip, .chip { font-size: 12.5px; }
.obj-chip, .fb-section, .fb-field { font-size: 13px; }
.session-label { font-size: 12.5px; }
.ex-stats span, .macro-cell span { font-size: 11px; }
.week-strip .wday span { font-size: 12px; }
.ring-center span { font-size: 11.5px; }
.chart-x span { font-size: 11px; }

/* Lectura de carga (la captura de Humberto) */
.load-matrix th { font-size: 12px; }
.load-matrix td { font-size: 13.5px; padding: 16px 6px 20px; }
.load-matrix td.is-here i { font-size: 10.5px; bottom: 4px; letter-spacing: 0.02em; }
.load-stat strong { font-size: 18px; }
.load-gauge { margin: 16px 0 26px; }

/* ============================================================
   2 · CONTRASTE — acentos como texto pequeño
   ============================================================ */
.card-link, .mention, .water-count strong, .cycle-priv,
.draft-eyebrow, .habit-streak, .coach-count, .ai-tag,
.ex-sendvideo, .lib-video, .fn-pill, .goal-ico,
.session-label, .greeting-date, .food-amount, .slot-amount { color: var(--ember-text); }
.tag-ember, .draft-tag { color: var(--ember-text); }
.tri-flag.f-rem, .tri-flag.f-check { color: var(--warn-text); }
.tri-flag.f-pr, .lead-status.s-nuevo, .wl-ok { color: var(--ok-text); }
.draft-dir.d-up, .signal-trend.t-up { color: var(--ok-text); }
.load-matrix .m-up { color: var(--ok-text); }
.load-matrix .m-flat { color: var(--warn-text); }
.load-matrix .m-down, .tag-excl { color: var(--danger-text); }
.load-verdict strong { color: var(--ok-text); }
.wl-warn, .stat-card--alert .stat-big, .tca-head { color: var(--warn-text); }
.chart-delta.tag-up, .tag-up { color: var(--ok-text); background: #e7efe0; border: none; }
.live-dot { background: #4f7a3f; }
.chat-status .pulse-dot { background: #4f7a3f; }
.pill small { color: inherit; opacity: 0.75; }

/* ============================================================
   3 · TAP TARGETS
   ============================================================ */
.col-actions button { width: 30px; height: 30px; }
input[type="checkbox"] { width: 18px; height: 18px; }
.affin-star { width: 34px; height: 34px; display: inline-grid; place-items: center; font-size: 19px; }
.note-resolve { width: 34px; height: 34px; }
.stepper button { width: 26px; height: 26px; }
.glass svg { width: 34px; height: 42px; }
.chip { padding: 9px 14px; }
.ai-chip { padding: 9px 14px; }
.obj-chip { padding: 10px 16px; }
.lib-upload { padding: 8px 13px; }
.ex-sendvideo { padding: 10px 16px; }
.rest-toast button { padding: 8px 4px 8px 10px; }

/* ============================================================
   4 · AIRE — respiración general
   ============================================================ */

/* App clienta */
.screen { padding-left: 22px; padding-right: 22px; }
.card { padding: 19px; }
.card--mini { padding: 17px; }
.meal-card { padding: 18px; }
.signal-card { padding: 15px 16px; }
.signals-grid { gap: 12px; }
.stat-grid { gap: 12px; }
.duo { gap: 12px; }
.screen-sub { margin-bottom: 22px; }
.exercise-card { padding: 0 0 18px; }
.exercise-card .exercise-head, .exercise-card .exercise-tags,
.exercise-card .ex-stats, .exercise-card .set-grid, .exercise-card .ex-foot { margin-left: 18px; margin-right: 18px; }
.exercise-card .exercise-tags { margin-bottom: 14px; }
.set-grid { gap: 8px; }
.block-note { padding: 16px 18px; line-height: 1.6; }

/* Panel coach */
.goal-bar { padding: 15px 20px; margin-bottom: 24px; }
.tabs { margin-bottom: 22px; }
.builder-top { margin-bottom: 16px; }
.hint { padding: 13px 16px; margin-bottom: 16px; line-height: 1.55; }
.editorial-note { padding: 14px 16px; margin-bottom: 16px; }
.builder-actions { margin-top: 20px; gap: 14px; }
.schedule-note { margin-top: 12px; }
.calc-out { margin-top: 22px; padding-top: 20px; }
.calc-macros { margin-top: 18px; padding-top: 16px; }
.portions-table th, .portions-table td { padding: 11px 8px; }
.tpl-card { padding: 22px; }
.lib-controls { margin-bottom: 18px; }
.triage-list { gap: 14px; }
.triage-card { padding: 16px 18px; }
.tri-flag { padding: 4px 10px 4px 8px; }
.settings-card .row-item { padding: 17px 0; }

/* Legibilidad general */
.note-body, .lead-meta, .signal-note, .tca-note, .cycle-note { line-height: 1.55; }
.draft-reason { line-height: 1.45; }

/* ============================================================
   5 · RONDA FINAL — suelo 12px, acentos AA, controles
   ============================================================ */

/* Suelo tipográfico 12px en todas las chapas y micro-textos */
.side-badge, .h1-badge, .pr-new, .fn-pill, .lead-status,
.pl, .xtag, .tag, .bl-tag, .draft-tag, .side-count,
th, .m-or, .bubble time, .avatar--sm, .wordmark small,
.pill small, .ex-stats span, .macro-cell span, .ring-center span,
.chart-x span, .load-matrix td.is-here i { font-size: 12px; }
.load-matrix td { padding-bottom: 24px; }

/* Acentos que seguían por debajo de AA */
:root { --warn-text: #774608; --danger-text: #8f3325; --celeste-text: #4e6970; }
.tri-flag.f-msg { color: var(--celeste-text); }
.calc-hero--rations .calc-big { color: var(--celeste-text); }
.fb-field.is-special { color: var(--ember-text); }
.log-table .e1 { color: var(--ember-text); }
.wl-alert { color: var(--danger-text); }
.cycle-priv { color: var(--celeste-text); }
.lead-wa { color: var(--ok-text); }

/* Botón deshabilitado legible (no fantasma) */
.btn-ember:disabled { background: #cdbba1; color: #503d2a; box-shadow: none; cursor: default; filter: none; opacity: 1; }

/* Controles de escritorio ≥34px */
.chip, .ai-chip { padding: 10px 15px; }
.pill { min-height: 36px; }
.lib-upload { padding: 9px 14px; }
.col-actions button { width: 32px; height: 32px; }
input[type="checkbox"] { width: 20px; height: 20px; }
.stepper button { width: 28px; height: 28px; }
.stepper b { font-size: 15px; }

/* Restos finales detectados por el escáner */
.nav-item span { font-size: 12px; }
.set-head span { font-size: 12px; }
.portion-legend .pl { font-size: 12px; }
.summary-stats span { font-size: 12px; color: rgba(246, 236, 222, 0.75); }
.dropzone span { font-size: 12.5px; }
.tri-flag.f-warn { color: var(--warn-text); }

/* ============================================================
   6 · SUPER PRO — nitidez, micro-tipografía, estados
   ============================================================ */

/* Selección de texto de marca */
::selection { background: #ecd9b8; color: #33251a; }

/* Focus visible elegante (teclado) — accesible y premium */
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* Números tabulares: datos que alinean en columna perfecta */
table, .stat-big, .stat-num, .calc-big, .load-stat, .e1rm-inputs input,
.ex-stats, .set-row input, .rest-toast strong, .ring-center, .chart-big,
.summary-stats, .week-strip, .signal-value, .adh-num, .coach-count,
.pr-value, .habit-streak, .water-count { font-variant-numeric: tabular-nums; }

/* Titulares equilibrados, párrafos sin viudas feas */
h1, h2, h3, .screen-title, .greeting-title, .draft-title, .triage-title { text-wrap: balance; }
p, .view-sub, .screen-sub, .note-text, .block-note, .ai-note { text-wrap: pretty; }

/* Cards nítidas: hairline + sombra (recorte limpio sobre crema) */
.card, .stat-card, .table-card, .triage-card, .draft-card, .coach-card,
.note-item, .lead-card, .tpl-card, .signal-card, .meal-card, .day-card,
.ai-copilot, .fb-sections, .fb-fields, .fb-canvas, .goal-bar, .modal,
.exercise-card, .editorial-note, .door {
  border: 1px solid rgba(58, 42, 28, 0.07);
}
.card--hero, .card--anchor { border-color: rgba(58, 42, 28, 0.18); }

/* Jerarquía de titulares un punto más rotunda */
.view-head h1, .client-id h1 { font-size: 28px; letter-spacing: -0.025em; }
.greeting-title { font-size: 32px; letter-spacing: -0.025em; }
.screen-title { font-size: 28px; letter-spacing: -0.025em; }
.stat-big { letter-spacing: -0.02em; }

/* Transición unificada en todo lo interactivo */
button, a, .chip, .pill, .tab, .slot-row, .day-card, .hd, .glass,
.side-item, .obj-chip, .fb-field, .fb-section { transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .2s ease; }
button:active { transform: scale(0.975); }

/* Rejilla del coach: look hoja limpia — el control aparece al usarlo */
.builder-table select, .builder-table input {
  background: transparent; border-color: transparent;
}
.builder-table tbody tr:hover { background: #fbf5ea; }
.builder-table tbody tr:hover select, .builder-table tbody tr:hover input:not(.load-input) {
  background: var(--card); border-color: var(--line);
}
.builder-table select:focus, .builder-table input:focus {
  background: var(--card); border-color: var(--ember);
}
.builder-table .load-input { background: var(--ember-soft); border-color: transparent; }
.builder-table .sel-block.is-main { background: var(--ember-soft); color: var(--ember-text); font-weight: 700; }

/* Tablas: hover de fila y cabecera respirada */
.client-table tbody tr:hover, .lib-table tbody tr:hover, .log-table tbody tr:hover { background: #fbf5ea; }
thead th { padding-top: 16px; padding-bottom: 14px; }

/* Scrollbars finos y discretos (panel) */
* { scrollbar-width: thin; scrollbar-color: #d8c8b0 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d8c8b0; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* App: nav inferior con blur (sensación nativa) */
.bottom-nav { background: rgba(255, 252, 247, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid rgba(58, 42, 28, 0.07); }

/* Imágenes nítidas dentro de cards */
.hero-media, .day-thumb, .ex-media img, .card--plan img { filter: saturate(0.94); }

/* Botones primarios: presencia consistente */
.btn-ember { letter-spacing: 0.01em; box-shadow: 0 2px 8px rgba(43, 30, 20, 0.18); }
.btn-ember:hover { box-shadow: 0 4px 14px rgba(43, 30, 20, 0.24); }
