/* PAKTAI — identidad: fondo negro, gradiente violeta -> azul, tipografia limpia */
:root {
  --bg: #050609;
  --bg-panel: #0d0f18;
  --bg-panel-2: #12152230;
  --bg-card: #111424;
  --border: #232741;
  --text: #e8eaf2;
  --muted: #9aa0b5;
  --violet: #8b5cf6;
  --blue: #2d4fe0;
  --grad: linear-gradient(135deg, #9d6bff 0%, #7c5cfc 45%, #2d4fe0 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 92, 252, .13), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(45, 79, 224, .12), transparent 60%);
  pointer-events: none; z-index: 0;
}
#app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
aside {
  width: 250px; flex-shrink: 0; padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: rgba(10, 11, 18, .75); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.logo-row { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.logo-row svg { width: 44px; height: 44px; }
.logo-row .name { font-size: 20px; font-weight: 700; letter-spacing: 6px; }
.nav-step {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); border: 1px solid transparent;
  font-size: 14px; user-select: none; transition: all .15s;
}
.nav-step:hover:not(.disabled) { background: var(--bg-card); color: var(--text); }
.nav-step.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(45, 79, 224, .16));
  border-color: #3b3f63; color: var(--text); font-weight: 600;
}
.nav-step.disabled { opacity: .38; cursor: not-allowed; }
.nav-step .n {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border);
}
.nav-step.done .n { background: var(--grad); border: none; color: white; }
.side-footer { margin-top: auto; font-size: 11px; color: #565c78; padding: 0 8px; line-height: 1.6; }

/* ---------- Main ---------- */
main { flex: 1; padding: 30px 38px 80px; max-width: 1200px; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
h3 { font-size: 15.5px; margin: 18px 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.card.accent { border-image: none; position: relative; overflow: hidden; }
.card.accent::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .grid2, .grid3 { grid-template-columns: 1fr; } main { padding: 20px; } }

/* ---------- Hero / landing ---------- */
.hero { text-align: center; padding: 44px 20px 24px; }
.hero svg { width: 108px; height: 108px; }
.hero h1 { font-size: 34px; letter-spacing: 10px; margin: 18px 0 6px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 26px; line-height: 1.65; }
.dropzone {
  border: 2px dashed #3a3f63; border-radius: var(--radius);
  padding: 42px 24px; text-align: center; cursor: pointer; transition: all .2s;
  background: rgba(17, 20, 36, .5);
}
.dropzone:hover, .dropzone.drag { border-color: var(--violet); background: rgba(124, 92, 252, .07); }
.dropzone .big { font-size: 17px; font-weight: 600; }
.dropzone .small { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 11px; border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: white; background: var(--grad);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124, 92, 252, .35); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid #3a3f63; color: var(--text); }
.btn.ghost:hover { border-color: var(--violet); box-shadow: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ---------- Forms ---------- */
label.fld { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
select, input[type=text], input[type=date], textarea {
  width: 100%; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 14px;
}
textarea { resize: vertical; min-height: 74px; font-family: inherit; }
select:focus, input:focus { outline: none; border-color: var(--violet); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-card); cursor: pointer; font-size: 13px; color: var(--muted); transition: all .15s;
}
.chip.on { background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(45,79,224,.25));
  border-color: var(--violet); color: var(--text); font-weight: 600; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: rgba(124, 92, 252, .05); }
.mono { font-family: Consolas, monospace; }

/* ---------- Badges / semaforos ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(52, 211, 153, .15); color: var(--ok); }
.badge.warn { background: rgba(251, 191, 36, .15); color: var(--warn); }
.badge.bad { background: rgba(248, 113, 113, .15); color: var(--bad); }
.badge.info { background: rgba(96, 165, 250, .15); color: #60a5fa; }
.light { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.light.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.light.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.kpi { text-align: center; padding: 18px 10px; }
.kpi .v { font-size: 26px; font-weight: 700; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 4px; }

.equation {
  font-family: Consolas, monospace; font-size: 14.5px; padding: 14px 18px;
  background: rgba(124, 92, 252, .09); border: 1px solid rgba(124, 92, 252, .35);
  border-radius: 10px; overflow-x: auto; white-space: nowrap;
}

/* ---------- Iteraciones / timeline ---------- */
.iter { border-left: 3px solid var(--border); padding-left: 18px; margin: 0 0 18px 6px; position: relative; }
.iter::before {
  content: ""; position: absolute; left: -8.5px; top: 4px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--bg-panel); border: 3px solid #4b5178;
}
.iter.final { border-left-color: var(--violet); }
.iter.final::before { background: var(--grad); border-color: var(--violet); }
.iter h3 { margin-top: 0; }

.story-step { display: flex; gap: 16px; margin-bottom: 18px; }
.story-step .num {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.story-step .cite { color: #a78bfa; font-size: 12.5px; }
.story-step .tech { color: var(--muted); font-size: 13px; margin-top: 6px; }

.canvas-box { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.canvas-box h3 { margin: 0 0 4px; }
.canvas-box .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 320px; }

iframe.report { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: white; }

.alert { padding: 12px 16px; border-radius: 10px; margin: 10px 0; font-size: 13.5px; line-height: 1.55; }
.alert.error { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4); }
.alert.warning { background: rgba(251, 191, 36, .09); border: 1px solid rgba(251, 191, 36, .35); }
.alert.info { background: rgba(96, 165, 250, .09); border: 1px solid rgba(96, 165, 250, .35); }
.alert b.lv { text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.25);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-panel { text-align: center; padding: 50px; color: var(--muted); }
.feature { padding: 18px; }
.feature .ic { font-size: 22px; }
.feature b { display: block; margin: 8px 0 4px; }
.feature span { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- Usuario / sidebar ---------- */
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 14px;
  width: 100%; color: inherit; font: inherit; text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.user-chip:hover { background: var(--bg-card); border-color: var(--border); }
.user-chip .uinfo { flex: 1; min-width: 0; }
.profile-arrow { color: var(--muted); font-size: 22px; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: white; flex-shrink: 0;
}
.user-chip .uname { font-size: 13.5px; font-weight: 600; }
.user-chip .umail { font-size: 11px; color: var(--muted); word-break: break-all; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #565c78; padding: 14px 12px 6px; }
.side-footer a { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px;
  text-decoration: none; }
.side-footer a:hover { color: var(--bad); }

/* ---------- Landing comercial ---------- */
.trust-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 18px 0 6px; }
.trust-chip { font-size: 11.5px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg-card); }
.how-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 10px 0; }
@media (max-width: 980px) { .how-row { grid-template-columns: 1fr 1fr; } }
.how-step { position: relative; padding: 18px; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius); }
.how-step .hn { width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.how-step b { display: block; margin-bottom: 4px; font-size: 14px; }
.how-step span { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.price-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 420px));
  justify-content: center; gap: 16px; margin: 14px 0; }
@media (max-width: 980px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { position: relative; padding: 26px 22px; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.price-card.featured { border-color: var(--violet);
  background: linear-gradient(180deg, rgba(139,92,246,.10), rgba(17,20,36,.6));
  box-shadow: 0 8px 40px rgba(124,92,252,.18); }
.price-card .plan { font-size: 13px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.price-card .price { font-size: 34px; font-weight: 800; margin: 10px 0 2px; }
.price-card .per { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.price-card ul { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; }
.price-card li { font-size: 13px; color: var(--muted); padding: 5px 0 5px 24px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }
.price-card .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--grad); font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 999px; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 430px; margin: 40px auto; }
.auth-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 28px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tabs .tab { flex: 1; text-align: center; padding: 10px; border-radius: 10px;
  cursor: pointer; color: var(--muted); border: 1px solid var(--border); font-size: 14px; }
.auth-tabs .tab.on { background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(45,79,224,.18));
  border-color: var(--violet); color: var(--text); font-weight: 600; }
input[type=email], input[type=password] {
  width: 100%; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 14px;
}
input[type=email]:focus, input[type=password]:focus { outline: none; border-color: var(--violet); }

/* ---------- Proyectos ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.proj-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; transition: all .15s; }
.proj-card:hover { border-color: var(--violet); transform: translateY(-2px); }
.proj-card .pt { font-weight: 600; font-size: 15px; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card .pd { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.proj-card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.proj-card .actions { display: flex; gap: 8px; }
.proj-card .actions .btn { padding: 8px 16px; font-size: 13px; }
.new-proj { display: grid; place-items: center; min-height: 150px; cursor: pointer;
  border: 2px dashed #3a3f63; background: rgba(17,20,36,.4); }
.new-proj:hover { border-color: var(--violet); }
.new-proj .plus { text-align: center; color: var(--muted); }
.new-proj .plus .ic { font-size: 30px; display: block; margin-bottom: 6px; }
.locked-project { min-height: 150px; display: grid; place-items: center; text-align: center;
  cursor: pointer; border-style: dashed; background: rgba(251,191,36,.035); }
.locked-project .plus { color: var(--muted); }
.locked-project .ic { font-size: 24px; display: block; margin-bottom: 8px; }

/* ---------- Plan Gratis / contenido protegido ---------- */
.nav-step.paylocked { opacity: .72; cursor: pointer; }
.nav-step.paylocked::after { content: "PRO"; margin-left: auto; padding: 2px 5px;
  border-radius: 5px; font-size: 8px; font-weight: 800; letter-spacing: .6px;
  color: #1e1435; background: #c4b5fd; }
.locked-preview { position: relative; min-height: 390px; margin: 18px 0;
  border: 1px solid var(--violet); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-panel); }
.locked-content { padding: 28px; filter: blur(8px); opacity: .36; user-select: none;
  pointer-events: none; transform: scale(1.02); }
.locked-overlay { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px; text-align: center;
  background: linear-gradient(180deg, rgba(12,14,27,.42), rgba(12,14,27,.94)); }
.locked-overlay h2 { margin: 6px 0; }
.locked-overlay p { margin: 4px 0; color: var(--muted); }
.locked-overlay ul { columns: 2; text-align: left; color: var(--muted); font-size: 13px;
  line-height: 1.55; margin: 10px 0 16px; }
.locked-overlay .btn { margin: 4px; }
.lock-icon { font-size: 30px; }

/* ---------- Asistente guiado determinista ---------- */
.guide-fab { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex;
  align-items: center; gap: 8px; border: 1px solid #a78bfa; border-radius: 999px;
  padding: 11px 16px; color: white; background: linear-gradient(135deg,#7c3aed,#2d4fe0);
  box-shadow: 0 10px 35px rgba(76,29,149,.45); cursor: pointer; font: inherit;
  font-weight: 700; }
.guide-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(76,29,149,.6); }
.guide-fab small { padding-left: 8px; border-left: 1px solid rgba(255,255,255,.28);
  font-size: 10px; font-weight: 500; opacity: .86; }
.guide-spark { font-size: 20px; }
.guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guide-head h2 { margin: 7px 0 0; }
.guide-close { border: 0; background: transparent; color: var(--muted); font-size: 28px;
  cursor: pointer; }
.guide-quota { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; color: var(--muted); background: var(--bg-card); }
.guide-quota b { color: #c4b5fd; font-size: 18px; }
.guide-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide-topics .btn { justify-content: center; }
.guide-answer { margin-top: 14px; }
.guide-empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--border);
  border-radius: 10px; }
.guide-items { display: grid; gap: 7px; margin: 12px 0; }
.guide-item { padding: 10px 12px; border-left: 3px solid var(--violet); border-radius: 8px;
  background: var(--bg-card); }
.guide-item.ok { border-color: var(--ok); }
.guide-item.warning { border-color: var(--warn); }
.guide-item b, .guide-item span { display: block; }
.guide-item span { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.loading-panel.compact { min-height: 90px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100;
  display: grid; place-items: center; backdrop-filter: blur(3px); }
.modal-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; width: min(560px, 92vw);
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.profile-plan { padding: 16px; margin: 14px 0; border: 1px solid var(--violet);
  border-radius: 12px; background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(45,79,224,.08)); }
.profile-plan .price { font-size: 26px; font-weight: 800; margin: 4px 0; }
.recovery-code { font-family: Consolas, monospace; font-size: 20px; letter-spacing: 2px;
  text-align: center; padding: 14px; margin: 12px 0; border-radius: 10px;
  background: rgba(124,92,252,.12); border: 1px dashed var(--violet); color: var(--text); }
.otl-row { display: grid; grid-template-columns: 1.4fr 1fr 2fr; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.otl-row select, .otl-row input { padding: 7px 9px; }

/* ---------- Flujo controlado / expediente ---------- */
.scope-box { padding: 16px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(124,92,252,.045); margin: 12px 0 18px; }
.scope-box h3, .workflow-head h3 { margin: 0 0 4px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.workflow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workflow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.workflow-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.workflow-mark { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center;
  border-radius: 50%; font-weight: 800; font-size: 12px; }
.workflow-item.done .workflow-mark { color: #052e24; background: var(--ok); }
.workflow-item.pending .workflow-mark { color: #3b2500; background: var(--warn); }
.workflow-item b { display: block; font-size: 12.5px; }
.workflow-item span:not(.workflow-mark) { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.version-list > div { display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.version-list .btn { padding: 5px 10px; font-size: 11px; }
.iso-row { display: grid; grid-template-columns: 100px minmax(190px,1.1fr) 150px 160px minmax(180px,1fr);
  gap: 8px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.iso-row .clause { font-weight: 800; color: #a78bfa; }
.iso-row .expected { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.iso-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }

/* ---------- Móvil/tablet ---------- */
@media (max-width: 760px) {
  #app { display: block; }
  aside { width: 100%; height: auto; min-height: 0; position: sticky; z-index: 20;
    padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .logo-row { padding: 2px 6px 6px; }
  .logo-row svg { width: 32px; height: 32px; }
  .logo-row .name { font-size: 16px; letter-spacing: 4px; }
  .user-chip { display: flex; width: 44px; padding: 3px; }
  .user-chip .uinfo, .user-chip .profile-arrow { display: none; }
  #userBox[style*="block"] { display: flex !important; }
  #navProjects { min-width: 140px; }
  #stepsNav { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  #stepsNav[style*="block"] { display: flex !important; }
  .nav-label { display: none; }
  .nav-step { min-width: max-content; padding: 8px 10px; font-size: 12px; }
  .nav-step .n { width: 21px; height: 21px; }
  .side-footer { display: none; }
  main { width: 100%; max-width: none; padding: 18px 14px 60px; overflow-x: hidden; }
  h1 { font-size: 22px; }
  .hero { padding: 24px 4px 12px; }
  .hero svg { width: 78px; height: 78px; }
  .hero h1 { font-size: 28px; }
  .how-row, .workflow-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .btn { min-height: 44px; justify-content: center; }
  .btn-row .btn, .btn-row a.btn { width: 100%; }
  .otl-row, .otl-row.sf-row { grid-template-columns: 1fr !important; }
  .iso-row { grid-template-columns: 1fr; }
  .chart-wrap, .chart-wrap.tall { height: 245px; }
  iframe.report { height: 68vh; }
  table { min-width: 620px; }
  .canvas-box { overflow-x: auto; }
  .guide-fab { right: 12px; bottom: 12px; padding: 11px 13px; }
  .guide-fab > span:nth-child(2) { display: none; }
  .guide-topics { grid-template-columns: 1fr; }
  .locked-overlay ul { columns: 1; }
}

/* ---------- Diagnósticos expandibles (explicación en lenguaje simple) ---------- */
.diag-head { cursor: pointer; }
.diag-head:hover td { background: rgba(124, 92, 252, .09); }
.diag-head:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.diag-caret { display: inline-block; width: 14px; color: var(--violet); font-size: 11px; }
.diag-body > td { background: rgba(124, 92, 252, .05); padding: 0; }
.diag-exp { padding: 12px 16px 14px 30px; font-size: 13px; line-height: 1.55; }
.diag-exp p { margin: 0 0 8px; }
.diag-exp .diag-rec { background: rgba(96, 165, 250, .1); border-left: 3px solid #60a5fa;
  padding: 8px 12px; border-radius: 0 8px 8px 0; }
.diag-exp .cite { color: #a78bfa; font-size: 11.5px; margin-bottom: 0; }
.ok-txt { color: var(--ok); font-weight: 700; }
.bad-txt { color: var(--bad); font-weight: 700; }

/* ---------- Tablas legibles en móvil ----------
   Antes, columnas como p, IC 95% y Sig. quedaban FUERA de la pantalla y eran
   inalcanzables (tabla de 620px en un viewport de 375px). Ahora cada tabla puede
   desplazarse horizontalmente dentro de su tarjeta. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .card table, .iter table, .canvas-box table { min-width: 520px; }
  .card, .iter > .grid2 > div, .canvas-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .iter table { font-size: 12px; }
  .diag-exp { padding: 12px 12px 14px 16px; }
  /* aviso de desplazamiento para que el usuario sepa que hay más columnas */
  .card table + .scroll-hint, .iter table + .scroll-hint { display: block; }
}
.scroll-hint { display: none; font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }

/* ---------- Consumo del plan en el perfil ---------- */
.uso-row { margin-bottom: 10px; }
.uso-top { display: flex; justify-content: space-between; font-size: 12.5px;
  color: var(--muted); margin-bottom: 4px; }
.uso-bar { height: 6px; border-radius: 999px; background: var(--bg-card);
  border: 1px solid var(--border); overflow: hidden; }
.uso-bar i { display: block; height: 100%; border-radius: 999px; transition: width .3s; }

/* ---------- Contacto comercial en la landing ---------- */
.contacto-box { max-width: 680px; margin: 26px auto 0; text-align: center; }
.contacto-box .btn-row { justify-content: center; }
