:root {
  --bg: #12151C;
  --panel: #1B1F29;
  --panel-2: #242938;
  --border: #2F3646;
  --text: #EDEFF4;
  --muted: #9BA3B5;
  --accent: #3DDC97;
  --accent-ink: #0B1410;
  --danger: #FF6B6B;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(255,107,107,.12); color: var(--danger); border: 1px solid rgba(255,107,107,.35); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero h1 span { color: var(--accent); }
.hero-kicker {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 14px;
}
.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 28px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards / sections ---------- */
.section { padding: 48px 0; }
.section h2 { font-size: 24px; margin: 0 0 8px; }
.section .lead { color: var(--muted); margin: 0 0 28px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(61,220,151,.12);
  font-size: 19px;
  margin-bottom: 12px;
}

.step-card { position: relative; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}

.cta-band {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 20px;
  margin: 8px 0;
  text-align: center;
  border-radius: var(--radius);
}
.cta-band h2 { margin: 0 0 10px; font-size: 26px; }
.cta-band p { color: var(--muted); margin: 0 0 24px; }
.cta-band .hero-actions { justify-content: center; }

.founder-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 24px;
}
.founder-box p { margin: 0 0 10px; color: var(--text); font-size: 14.5px; line-height: 1.6; }
.founder-box p:last-child { margin-bottom: 0; }
.founder-sign { color: var(--muted) !important; font-size: 13px !important; font-weight: 600; }

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.screens img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.faq { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.faq-item h3 { margin: 0 0 6px; font-size: 15px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.disclaimer-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 8px 0 32px;
}
.disclaimer-box h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.disclaimer-box p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.disclaimer-box p:last-child { margin-bottom: 0; }
.disclaimer-box a { color: var(--accent); font-weight: 600; text-decoration: none; }
.disclaimer-box a:hover { text-decoration: underline; }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; text-align: center; }
.auth-card .sub { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--border);
  gap: 10px;
}
.btn-google:hover { background: #f5f5f5; }

.msg { font-size: 13px; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.msg-error { background: rgba(255,107,107,.12); color: var(--danger); }
.msg-ok { background: rgba(61,220,151,.12); color: var(--accent); }

/* ---------- App shell ---------- */
.app-shell { display: none; min-height: 100vh; }
.app-shell.active { display: block; }
.auth-shell.active {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-shell { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.topbar .user-email { color: var(--muted); font-size: 13px; margin-right: 10px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 20px;
}
.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-tile .label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat-tile .value { font-size: 22px; font-weight: 700; }
.stat-tile .value.pos { color: var(--accent); }
.stat-tile .value.neg { color: var(--danger); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 20px 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.panel h2 { font-size: 16px; margin: 0 0 14px; }
.panel-compact { margin: 0 20px 12px; padding: 14px 18px; }
.panel-compact:has(#riskAlerts:empty) .goal-progress { margin-bottom: 0; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card { transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ---------- Metas y progreso ---------- */
.goal-progress { margin-bottom: 18px; }
.goal-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.progress-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
  width: 0%;
}
.progress-bar-fill.neg { background: var(--danger); }

#riskAlerts:empty { display: none; }
#riskAlerts .msg { margin-bottom: 10px; }
#riskAlerts .msg:last-child { margin-bottom: 14px; }

/* ---------- Calendario ---------- */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.calendar-month-label { font-weight: 700; font-size: 14px; text-align: center; flex: 1; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-dow {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  padding-bottom: 4px;
}
.calendar-cell {
  min-height: 56px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px;
  background: var(--bg);
}
.calendar-cell.empty { border: none; background: transparent; }
.calendar-cell.pos { background: rgba(61,220,151,.12); border-color: rgba(61,220,151,.35); }
.calendar-cell.neg { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); }
.calendar-daynum { font-size: 11px; color: var(--muted); }
.calendar-pnl { font-size: 12px; font-weight: 700; margin-top: 4px; }
.calendar-cell.pos .calendar-pnl { color: var(--accent); }
.calendar-cell.neg .calendar-pnl { color: var(--danger); }
.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.calendar-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot-pos { background: var(--accent); }
.dot-neg { background: var(--danger); }
.dot-neutral { background: var(--border); }

@media (max-width: 640px) {
  .calendar-cell { min-height: 44px; padding: 4px; }
  .calendar-pnl { font-size: 10px; }
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.filter-row .field { margin-bottom: 0; min-width: 160px; }
.filter-row input, .filter-row select { min-width: 160px; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 880px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pill.call { background: rgba(61,220,151,.16); color: var(--accent); }
.pill.put { background: rgba(255,107,107,.16); color: var(--danger); }
.pill.pasivo { background: rgba(61,220,151,.16); color: var(--accent); }
.pill.agresivo { background: rgba(255,107,107,.16); color: var(--danger); }

.active-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 0;
  font-size: 13px;
  color: var(--muted);
}
.active-account-row select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.row-actions { white-space: nowrap; }
.row-actions button { margin-right: 4px; }

.chart-body { height: 260px; }
.chart-body svg { width: 100%; height: 100%; display: block; overflow: visible; }
@media (max-width: 640px) {
  .chart-body { height: 200px; }
}
.chart-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 0; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  max-width: 220px;
  transform: translate(-50%, -100%);
}
.chart-tooltip[hidden] { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pnl-pos { color: var(--accent); font-weight: 600; }
.pnl-neg { color: var(--danger); font-weight: 600; }
.row-actions button {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px;
}
.row-actions button:hover { color: var(--danger); }
.row-actions button.link-edit:hover { color: var(--accent); }

.empty-state { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.foto-preview-wrap { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.foto-preview-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.field input[type="file"] { color: var(--muted); font-size: 13px; padding: 8px 0; }

.foto-link { text-decoration: none; font-size: 16px; }

.period-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 14px; }
.period-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* ---- Registrar operación: pasos, contratos, entradas y salidas ---- */
.trade-form { display: flex; flex-direction: column; gap: 4px; }
.form-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; margin: 14px 0 10px; }
.form-step:first-child { margin-top: 0; }
.form-step .step-num { margin: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; flex: none; }
.step-sub { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.form-note { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.panel-lead { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: -6px 0 14px; max-width: 70ch; }
.field textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.how-to { border: 1px solid var(--border); border-radius: 12px; background: rgba(61,220,151,.06); margin-bottom: 12px; }
.how-to summary { cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 8px; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to summary::before { content: "?"; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.how-to[open] summary { border-bottom: 1px solid var(--border); }
.how-to-body { padding: 12px 16px 14px; font-size: 13px; color: var(--muted); line-height: 1.6; display: flex; flex-direction: column; gap: 10px; max-width: 78ch; }
.how-to-body strong { color: var(--text); }
.how-to-body ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.how-to-example { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-variant-numeric: tabular-nums; }

.positions { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.pos-card { border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); padding: 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pos-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pos-title { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pos-num { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pos-fields { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.pos-fields .field { margin-bottom: 0; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.seg button { font: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 16px; border: none; background: transparent; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg.lado button[data-lado="compra"][aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg.lado button[data-lado="venta"][aria-pressed="true"] { background: var(--danger); color: #1a0b0b; }
.seg.tipo button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tipo-fixed { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 10px; border: 1px dashed var(--border); font-size: 13.5px; font-weight: 700; color: var(--text); }

.fills-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fills-col { border-radius: 12px; background: var(--panel); border: 1px solid var(--border); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fills-col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fills-col-head h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.fills-col-head .avg { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.fill-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.1fr) 30px; gap: 6px; align-items: end; }
.mini { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini span { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini input { font: inherit; font-size: 13px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; min-width: 0; color-scheme: dark; }
.mini input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pos-fields input { color-scheme: dark; }
#f_fecha { color-scheme: dark; }
.fill-remove { width: 30px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.fill-remove:hover { color: var(--danger); border-color: var(--danger); }
.fill-remove:disabled { opacity: .35; cursor: default; color: var(--muted); border-color: var(--border); }
.add-fill { align-self: flex-start; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); background: none; border: none; padding: 2px 0; cursor: pointer; }
.add-fill:hover { text-decoration: underline; }
.fills-empty { font-size: 12.5px; color: var(--muted); }
.pos-remove { font: inherit; font-size: 12px; background: none; border: 1px solid rgba(255,107,107,.35); color: var(--danger); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.add-pos { align-self: flex-start; margin-bottom: 12px; }

.rh-sum { border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.rh-sum.no-top { border-top: none; }
.rh-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rh-row:last-child { border-bottom: none; padding-bottom: 0; }
.rh-val { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.rh-val small { color: var(--muted); font-size: 11.5px; }
.rh-row.result { font-weight: 700; }
.rh-val .pos { color: var(--accent); }
.rh-val .neg { color: var(--danger); }
.rh-warn { font-size: 12.5px; color: #F5B544; padding-top: 8px; }
.op-total { border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px 12px; background: var(--panel-2); margin-bottom: 12px; }
.op-total-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-top: 10px; }

/* ---- Historial ---- */
.strategy-tag { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.reg-date { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
td.date-cell { white-space: nowrap; }
.pill.multi { background: rgba(120,140,255,.16); color: #9DB0FF; }
.pill.open { background: rgba(245,181,68,.16); color: #F5B544; }
.muted-cell { color: var(--muted); }
.legs-toggle { display: block; background: none; border: none; padding: 3px 0 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }
.legs-detail > td { background: var(--panel-2); padding: 12px 14px; }
.legs-detail-wrap { position: sticky; left: 14px; width: min(760px, calc(100vw - 90px)); display: flex; flex-direction: column; gap: 12px; white-space: normal; }
.legs-detail-pos { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.legs-detail-pos h5 { margin: 0 0 6px; font-size: 13.5px; }
.table-scroll .legs-detail-pos table { width: 100%; min-width: 0; font-size: 12.5px; }
.legs-detail-pos th, .legs-detail-pos td { padding: 4px 6px; background: transparent; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legs-detail-pos .rh-row { font-size: 12.5px; padding: 6px 0; }

@media (max-width: 760px) {
  .fills-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pos-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fill-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
  .fill-row .mini-fecha { grid-column: 1 / 2; grid-row: 2; }
  .fill-row .mini-hora { grid-column: 2 / 4; grid-row: 2; }
  .mini input { padding: 7px 6px; font-size: 13px; }
}

[hidden] { display: none !important; }
.legs-detail-pos th.num, .legs-detail-pos td.num { text-align: right; }

/* ---- Portada: anuncio, novedades y Bitácora Rentable Pro ---- */
.announce {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 18px auto 0; padding: 8px 8px 8px 8px; max-width: max-content;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
  font-size: 13.5px; color: var(--text); text-decoration: none; text-align: center;
}
.announce:hover { border-color: var(--accent); }
.announce-tag { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.announce-text { padding-right: 10px; }
.announce-text strong { color: var(--accent); }

.roadmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.roadmap-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.roadmap-col h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.status { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.status-new { background: rgba(61,220,151,.16); color: var(--accent); }
.status-soon { background: rgba(245,181,68,.16); color: #F5B544; }
.roadmap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.roadmap-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.roadmap-list li strong { color: var(--text); display: block; font-weight: 600; }
.roadmap-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; justify-self: center; }
.roadmap-col.is-new .roadmap-list li::before { background: var(--accent); }
.roadmap-col.is-soon .roadmap-list li::before { background: #F5B544; }

.pro-card {
  margin-top: 16px; position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 28px 24px;
  background: linear-gradient(135deg, rgba(61,220,151,.14), rgba(61,220,151,0) 55%), var(--panel);
  border: 1px solid rgba(61,220,151,.45);
}
.pro-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.pro-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.pro-head h3 span { color: var(--accent); }
.pro-badge { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.pro-sub { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; max-width: 64ch; line-height: 1.55; }
.pro-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 20px; margin: 0 0 18px; padding: 0; list-style: none; }
.pro-features li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 14px; color: var(--text); line-height: 1.45; }
.pro-features li::before { content: "★"; color: var(--accent); font-size: 13px; line-height: 1.6; }
.pro-note { font-size: 13px; color: var(--muted); margin: 0; border-top: 1px solid var(--border); padding-top: 14px; }
.pro-note strong { color: var(--text); }

.feedback-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.feedback-box p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 60ch; }

/* ---- Modo demo ---- */
.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 20px 0; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(61,220,151,.45); background: rgba(61,220,151,.08); font-size: 13.5px; }
.demo-tag { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.demo-text { flex: 1 1 260px; color: var(--text); line-height: 1.45; }

/* ---- Portada: video y demo ---- */
.video-section { text-align: center; }
.video-section .lead { margin-left: auto; margin-right: auto; max-width: 640px; }
.video-wrap { max-width: 960px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.video-wrap video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #12151C; }
.video-cta { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.video-cta p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---- Video flotante (sigue a la persona mientras baja) ---- */
.video-holder { max-width: 960px; margin: 0 auto; }
.video-wrap { position: relative; }
.video-close, .video-back { display: none; }
.video-wrap.floating {
  position: fixed; z-index: 40; right: 20px; bottom: 20px; width: 360px; max-width: calc(100vw - 40px);
  border-color: rgba(61,220,151,.55); box-shadow: 0 16px 40px rgba(0,0,0,.6);
  animation: videoIn .35s ease-out;
}
.video-wrap.floating .video-close {
  display: flex; align-items: center; justify-content: center; position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: rgba(18,21,28,.85);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
}
.video-wrap.floating .video-back {
  display: block; position: absolute; top: 6px; left: 6px; z-index: 2; border: 1px solid var(--border);
  background: rgba(18,21,28,.85); color: var(--accent); font: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
@keyframes videoIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .video-wrap.floating { width: 56vw; right: 12px; bottom: 12px; }
  .video-wrap.floating .video-back { display: none; }
}
@media (prefers-reduced-motion: reduce) { .video-wrap.floating { animation: none; } }
