/* Ingresos IA — estilo SaaS financiero */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --faint: #8a98ab;
  --navy: #0b1b33;
  --navy-2: #12284a;
  --primary: #0e9f6e;
  --primary-ink: #ffffff;
  --primary-soft: #e3f6ee;
  --blue: #2563eb;
  --blue-soft: #e6eefe;
  --amber: #c27c0e;
  --amber-soft: #fdf3e1;
  --red: #d64545;
  --red-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 268px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --surface: #111b2c; --surface-2: #0e1727; --border: #22314a;
    --text: #e8eef7; --muted: #9aabc2; --faint: #6f819b;
    --navy: #070e1a; --navy-2: #0f1d33;
    --primary: #22c38e; --primary-ink: #04150e; --primary-soft: #0f2e25;
    --blue: #5b8cff; --blue-soft: #15254a; --amber: #e3a23b; --amber-soft: #33270f;
    --red: #ef6b6b; --red-soft: #3a1717;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #111b2c; --surface-2: #0e1727; --border: #22314a;
  --text: #e8eef7; --muted: #9aabc2; --faint: #6f819b;
  --navy: #070e1a; --navy-2: #0f1d33;
  --primary: #22c38e; --primary-ink: #04150e; --primary-soft: #0f2e25;
  --blue: #5b8cff; --blue-soft: #15254a; --amber: #e3a23b; --amber-soft: #33270f;
  --red: #ef6b6b; --red-soft: #3a1717;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 .8em; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
/* La app ocupa exactamente la ventana: el contenido se desplaza en .scroller y el aviso
   legal queda fijo debajo, sin tapar nunca botones ni campos. */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  background: var(--navy); color: #cfd9e8; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #22c38e, #2563eb); display: grid; place-items: center; font-size: .9rem; color: #fff; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f93b2; padding: 14px 10px 6px; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px;
  color: #cfd9e8; text-decoration: none; font: inherit; font-size: .9rem; background: none; border: 0; text-align: left; cursor: pointer;
}
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 #22c38e; }
.nav .mod-num { flex: 0 0 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: #1b3358; color: #fff; }
.nav a.active .mod-num { background: #22c38e; color: #04150e; }
.nav .locked { opacity: .62; }
.nav .soon { display: block; margin-top: 3px; width: max-content; font-size: .62rem; padding: 1px 7px; border-radius: 99px; background: #1b3358; color: #9fb4d4; white-space: nowrap; }
.nav .mod-title { flex: 1; min-width: 0; line-height: 1.3; }
.nav .locked { align-items: flex-start; }
.nav .locked .mod-num { margin-top: 1px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #1b2c48; font-size: .85rem; }
.sidebar-foot .who { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot button { margin-top: 10px; }

.topbar { display: none; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 28px 32px; }

.disclaimer {
  flex: 0 0 auto; z-index: 5; background: var(--amber-soft); color: var(--text);
  border-top: 1px solid var(--border); padding: 9px 28px; font-size: .8rem; display: flex; gap: 8px; align-items: flex-start;
}
.disclaimer strong { color: var(--amber); }

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .section + .section { margin-top: 18px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px;
  padding: 10px 16px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--faint); }
.btn-ghost { background: transparent; color: inherit; border-color: transparent; }
.btn-dark { background: var(--navy-2); color: #fff; border-color: #1b2c48; width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .88rem; }
.field .opt { font-weight: 400; color: var(--faint); font-size: .8rem; }
.field .hint { color: var(--muted); font-size: .8rem; }
.field .err { color: var(--red); font-size: .8rem; min-height: 0; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .93rem;
}
.textarea { min-height: 86px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--red); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .85rem; pointer-events: none; }
.input-prefix .input { padding-left: 52px; }

.choice-group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: block; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; font-weight: 600; background: var(--surface); }
.choice span small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; }
.step b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: .75rem; }
.step.current { border-color: var(--primary); color: var(--text); }
.step.current b { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.step.done b { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.form-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Badges / KPIs ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 650; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi .value { font-size: 1.2rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: break-word; line-height: 1.3; }
.kpi .value .nb { white-space: nowrap; }
.kpi .sub { color: var(--faint); font-size: .74rem; margin-top: 2px; }
.kpi .sub .ok { color: var(--primary); font-weight: 700; }
.kpi .sub .warn { color: var(--amber); font-weight: 700; }
.grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.est { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--amber); background: var(--amber-soft); padding: 1px 6px; border-radius: 5px; vertical-align: middle; }

.callout { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .88rem; border: 1px solid var(--border); background: var(--surface-2); }
.callout.amber { background: var(--amber-soft); border-color: transparent; }
.callout.red { background: var(--red-soft); border-color: transparent; }
.callout.blue { background: var(--blue-soft); border-color: transparent; }

/* ---------- Indicators ---------- */
.ind { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 8px; font-size: .78rem; margin: 5px 0; }
.ind .track { height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.ind .fill { height: 100%; border-radius: 99px; background: var(--primary); }
.ind .fill.blue { background: var(--blue); }
.ind .fill.amber { background: var(--amber); }
.ind .fill.red { background: var(--red); }
.ind .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Sources ---------- */
.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.source { display: flex; flex-direction: column; gap: 10px; }
.source-head { display: flex; gap: 12px; align-items: flex-start; }
.prio { flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; background: var(--navy); color: #fff; }
.source-head h3 { margin: 0 0 4px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fact .l { font-size: .7rem; color: var(--muted); font-weight: 600; }
.fact .v { font-weight: 650; font-size: .88rem; overflow-wrap: anywhere; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: .88rem; }
details.more[open] summary { margin-bottom: 8px; }
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 3px 0; }
ol.steps { margin: 0; padding-left: 20px; }

/* ---------- Income range chart ---------- */
.range-row { display: grid; grid-template-columns: minmax(110px, 220px) 1fr minmax(120px, auto); gap: 12px; align-items: center; margin: 9px 0; font-size: .85rem; }
.range-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.range-track { position: relative; height: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; }
.range-bar { position: absolute; top: -1px; bottom: -1px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 55%, transparent), var(--primary)); min-width: 6px; }
.range-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Goal meter ---------- */
.meter { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); margin: 26px 0 30px; }
.meter .band { position: absolute; top: -1px; bottom: -1px; background: color-mix(in srgb, var(--blue) 35%, transparent); border-radius: 99px; }
.meter .mark { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--primary); }
.meter .mark span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.meter .tick { position: absolute; top: 18px; font-size: .7rem; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }

/* ---------- Phases / timeline ---------- */
.phase { position: relative; padding-top: 18px; }
.phase::before { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 4px; border-radius: 99px; background: var(--primary); }
.phase.p2::before { background: var(--blue); }
.phase.p3::before { background: #7c5cff; }
.phase.p4::before { background: var(--amber); }
.phase .period { color: var(--muted); font-size: .8rem; font-weight: 600; }
.phase h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 4px; }
.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 18px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline .when { font-size: .76rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 820px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.r, table.data th.r { text-align: right; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at -10% -10%, #1d3e70 0%, transparent 60%), var(--navy); color: #d9e4f3; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h1 { color: #fff; font-size: 2.1rem; }
.auth-side ul { padding-left: 18px; color: #b9c8de; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form .card { width: 100%; max-width: 420px; }
.auth-form form { display: grid; gap: 14px; }

/* ---------- Generating ---------- */
.gen { max-width: 640px; margin: 30px auto; text-align: center; }
.ring { width: 76px; height: 76px; margin: 6px auto 18px; border-radius: 50%; border: 6px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1.1s linear infinite; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 18px 0 8px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--blue)); border-radius: 99px; transition: width .6s ease; }
/* Mientras trabaja, franjas en movimiento: la barra nunca parece congelada aunque avance despacio. */
.progress.working > div {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 10px, transparent 10px 20px), linear-gradient(90deg, var(--primary), var(--blue));
  background-size: 28px 28px, 100% 100%;
  animation: progress-stripes 1s linear infinite;
}
@keyframes progress-stripes { from { background-position: 0 0, 0 0; } to { background-position: 28px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .progress.working > div { animation: none; } }
.stages { list-style: none; padding: 0; margin: 18px auto 0; text-align: left; max-width: 360px; }
.stages li { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--faint); font-size: .9rem; }
.stages li i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex: 0 0 18px; display: grid; place-items: center; font-style: normal; font-size: .65rem; }
.stages li.done { color: var(--text); }
.stages li.done i { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.stages li.now { color: var(--text); font-weight: 600; }
.stages li.now i { border-color: var(--primary); border-top-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5, 12, 24, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 520px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal .actions { justify-content: flex-end; margin-top: 18px; }
/* pointer-events: none → los avisos nunca tapan los clics sobre botones que queden debajo. */
.toasts { position: fixed; right: 16px; bottom: 60px; z-index: 60; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .88rem; }
.toast.error { background: var(--red); }
.toast.ok { background: var(--primary); color: var(--primary-ink); }

.empty { text-align: center; padding: 40px 20px; }
.empty .big { font-size: 2.2rem; }
.mock-banner { background: repeating-linear-gradient(45deg, var(--amber-soft), var(--amber-soft) 12px, transparent 12px, transparent 24px); border: 1px dashed var(--amber); color: var(--amber); font-weight: 700; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

/* ---------- Módulo 2: ideas ---------- */
.nav .soon.st-completed { background: #134e3a; color: #8ff0c6; }
.nav .soon.st-in_progress { background: #1e3a6b; color: #b9d0ff; }
.nav .soon.st-available { background: #1b3358; color: #cfe0ff; }
.nav a.mod-completed .mod-num { background: #134e3a; color: #8ff0c6; }

/* Opportunity Score: tonos sobrios (sin rojos alarmistas) */
.score { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; }
.score b { font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.score span { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.score.big { min-width: 104px; padding: 10px 12px; }
.score.big b { font-size: 2rem; }
.score.tier-excellent { background: var(--primary-soft); border-color: transparent; }
.score.tier-excellent b, .score.tier-excellent span { color: var(--primary); }
.score.tier-verygood { background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); border-color: transparent; }
.score.tier-verygood b { color: var(--primary); }
.score.tier-good { background: var(--blue-soft); border-color: transparent; }
.score.tier-good b { color: var(--blue); }
.score.tier-interesting b { color: var(--text); }
.score.tier-evaluate b { color: var(--muted); }

.ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.idea { display: flex; flex-direction: column; gap: 10px; }
.idea .idea-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.idea .idea-head h3 { margin: 0; }
.idea.is-discarded { opacity: .55; }
.idea > .btn { align-self: flex-start; }
.card.best { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }

.idea-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.idea-actions .act { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 5px 10px; font: inherit; font-size: .8rem; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.idea-actions .act:hover { border-color: var(--faint); }
.idea-actions .act.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 700; }
.idea-actions .act-develop.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.idea-actions .act-discarded.on { background: var(--surface-2); border-color: var(--faint); color: var(--muted); }
.idea-actions .act:disabled { opacity: .6; }

.top10 { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.top10 li { display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); }
.top10 .rank { grid-row: 1 / 3; font-weight: 800; font-size: 1.05rem; color: var(--muted); text-align: center; }
.top10 li:first-child .rank { color: var(--primary); }
.top10 .t-name { font-weight: 650; color: var(--text); text-decoration: none; }
.top10 .t-name:hover { text-decoration: underline; }
.top10 .t-meta { grid-column: 2; }
.top10 .score { grid-column: 3; grid-row: 1 / 3; min-width: 64px; padding: 4px 6px; }
.top10 .score b { font-size: 1.1rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; }
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.toolbar .select { width: auto; min-width: 190px; padding: 7px 10px; font-size: .86rem; }
.toolbar label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; padding-bottom: 8px; }
.toolbar #count { margin-left: auto; padding-bottom: 8px; }
.ind.wide { grid-template-columns: minmax(150px, 230px) 1fr 34px; }
.choice input[type=checkbox] + span { text-align: left; font-weight: 600; }
#prios { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 1080px) { .ideas { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .toolbar .select { min-width: 0; width: 100%; }
  .toolbar label { flex: 1 1 100%; }
  .toolbar #count { margin-left: 0; }
  .ind.wide { grid-template-columns: 1fr 60px 30px; }
  .top10 li { grid-template-columns: 34px 1fr auto; }
}

/* ---------- Módulo 3: productos ---------- */
.req { list-style: none; margin: 16px auto; padding: 0; max-width: 560px; text-align: left; display: grid; gap: 8px; }
.req li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.req li i { font-style: normal; width: 22px; text-align: center; }
.req li span { flex: 1 1 200px; }
.req li.ok { opacity: .7; }
.req li.ok i { color: var(--primary); font-weight: 800; }
.opps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.opp { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); }
.opp input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opp.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.opp:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.opp .opp-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.opp h3 { margin: 0; }
.opp.skills { border-style: dashed; }
.prefs { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.rec .facts { margin-top: 4px; }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; counter-reset: rm; }
.roadmap li { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; min-width: 0; }
.roadmap li strong { font-size: .74rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.roadmap li .small { overflow-wrap: anywhere; }
.roadmap .rm-n { width: 24px; height: 24px; border-radius: 99px; background: var(--primary); color: #fff; font-weight: 800; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; }
.roadmap li.cont .rm-n { background: var(--blue); }
.roadmap li:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 12px; color: var(--muted); font-size: .8rem; z-index: 1; }
.launch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.launch .phase { padding-top: 22px; }
table.data.matrix { min-width: 980px; }
table.data .th-sort { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; white-space: nowrap; }
table.data .th-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
table.data th[aria-sort="ascending"], table.data th[aria-sort="descending"] { color: var(--text); }
table.data tr.is-discarded { opacity: .55; }
table.data.history { min-width: 760px; }
table.data.weights { min-width: 460px; font-size: .8rem; }
table.data.weights th, table.data.weights td { padding: 7px 9px; }
table.data.weights tr.up td { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
table.data.weights tfoot td { border-top: 1px solid var(--border); }
.card.own { border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); margin-bottom: 16px; }
.prio-note { color: var(--primary); font-weight: 600; }
.choice.is-off span { opacity: .45; border-style: dashed; }
.prio-msg { color: var(--amber); font-weight: 600; }
.prio-count { font-variant-numeric: tabular-nums; }
.modal .prio-group { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.modal .prio-group .choice span { padding: 9px 10px; font-size: .85rem; }
@media (max-width: 1080px) {
  .roadmap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .roadmap li:nth-child(4)::after { display: none; }
  .launch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) { .opps { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .roadmap { grid-template-columns: 1fr; }
  .roadmap li { flex-direction: row; align-items: flex-start; gap: 10px; }
  .roadmap li::after { display: none; }
  .launch { grid-template-columns: 1fr; }
  .score.big { min-width: 84px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sources { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: min(86vw, 300px); transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(5, 12, 24, .5); }
  .topbar { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; z-index: 30; background: var(--navy); color: #fff; padding: 10px 16px; }
  .topbar .brand { padding: 0; font-size: 1rem; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 4px 6px; }
  .content { padding: 20px 16px; }
  .disclaimer { padding: 8px 16px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 20px; }
  .auth-side h1 { font-size: 1.6rem; }
}
@media (max-width: 560px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-row { grid-template-columns: 1fr; gap: 4px; }
  .range-row .val { text-align: left; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; }
}
