:root {
  --bg: #F4F6F9; --panel: #FFFFFF; --panel-2: #EEF1F5; --ink: #15212C; --muted: #5A6774; --line: #D6DCE3;
  --navy: #1F2A44; --accent: #E8772E; --accent-ink: #FFFFFF; --accent-soft: #FCE8DA;
  --good: #1B7F45; --good-soft: #DDF1E4; --bad: #B8322B; --bad-soft: #F8DEDC; --warn: #9A6418;
  --r: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E141B; --panel: #161F29; --panel-2: #1C2733; --ink: #E6ECF2; --muted: #95A3B1; --line: #2A3745;
    --navy: #0B1220; --accent: #F08A45; --accent-ink: #1A0E06; --accent-soft: #3A2418;
    --good: #45B978; --good-soft: #163323; --bad: #EA6A60; --bad-soft: #3A1A19; --warn: #E0A64A; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 .95rem var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.notice { border-radius: 10px; padding: 10px 14px; background: var(--accent-soft); border: 1px solid var(--accent); margin-bottom: 14px; }
.notice.err { background: var(--bad-soft); border-color: var(--bad); }
.notice.ok { background: var(--good-soft); border-color: var(--good); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); letter-spacing: .02em; }
.badge.trial { background: var(--accent-soft); color: var(--accent); }
.badge.paid { background: var(--good-soft); color: var(--good); }

/* tablas */
.scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.t th, .t td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.t th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.t .l { text-align: left; }
.t td.good { color: var(--good); font-weight: 700; } .t td.bad { color: var(--bad); font-weight: 700; }
.thr { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: .85rem; background: var(--panel-2); }
.thr.t5 { background: var(--bad); color: #fff; } .thr.t4 { background: var(--accent); color: #fff; } .thr.t3 { background: var(--accent-soft); color: var(--accent); }

/* app */
.topbar { background: var(--navy); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: #C9D1DE; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar select { width: auto; min-height: 36px; padding: 4px 10px; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); }
.topbar select option { color: #000; }
main.app { padding: 24px 0 64px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile h3 { margin: 0 0 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 16px; font: 600 .9rem var(--body); color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; background: var(--panel); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.choice { text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; font: inherit; color: inherit; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice b { display: block; font-family: var(--display); font-size: 1.05rem; margin-bottom: 4px; }
.formgrid input { min-height: 36px; padding: 6px; text-align: center; }
.formgrid td { padding: 3px; } .formgrid td:first-child input, .formgrid td:nth-child(2) input { text-align: left; }
.auth { max-width: 420px; margin: 48px auto; }
.center { text-align: center; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.lock { text-align: center; padding: 40px 20px; }

/* informes */
.report section { margin: 26px 0; }
.report .rh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; border-bottom: 3px solid var(--accent); padding-bottom: 12px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin: 0 0 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.finds { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 1.02rem; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 52px; gap: 10px; align-items: center; font-size: .9rem; }
.bar .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .bt { background: var(--panel-2); height: 12px; border-radius: 6px; overflow: hidden; }
.bar .bt i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
figure { margin: 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.court { width: 100%; max-width: 520px; display: block; background: var(--panel); border-radius: 10px; border: 1px solid var(--line); }
.court .cl { fill: none; stroke: var(--muted); stroke-width: 40; }
.court .paint { fill: var(--panel-2); stroke: var(--muted); stroke-width: 40; }
.court .rim { fill: none; stroke: var(--accent); stroke-width: 50; }
.court .sm { fill: var(--good); fill-opacity: .85; stroke: var(--panel); stroke-width: 40; }
.court .sx { stroke: var(--bad); stroke-width: 70; stroke-linecap: round; }
.lg { display: inline-flex; gap: 6px; align-items: center; }
.lg i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.lg .lm { background: var(--good); } .lg .lx { background: var(--bad); border-radius: 2px; }
.trend { width: 100%; max-width: 680px; }
.trend .ln { fill: none; stroke: var(--accent); stroke-width: 3; }
.trend circle { fill: var(--accent); }
.trend .ax { stroke: var(--line); }
.trend .tx { fill: var(--muted); font-size: 11px; }

/* portada */
.hero { background: var(--navy); color: #fff; padding: 72px 0 80px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 16ch; margin-bottom: .4em; }
.hero p.lead { font-size: 1.2rem; color: #C9D1DE; max-width: 52ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.hnav { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.hnav a.login { color: #fff; font-weight: 600; text-decoration: none; }
.sect { padding: 64px 0; }
.sect h2 { font-size: 1.7rem; margin-bottom: .6em; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.feat b { font-family: var(--display); font-size: 1.1rem; display: block; margin-bottom: 6px; }
.howto { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; }
.howto li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.howto li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 10px; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.price { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.price.hl { border: 2px solid var(--accent); }
.price .amt { font-family: var(--display); font-size: 2rem; font-weight: 700; }
.price ul { margin: 0; padding-left: 18px; flex: 1; }
.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.foot a { color: var(--muted); }
.demo-bar { background: var(--accent-soft); border-bottom: 1px solid var(--accent); padding: 10px 0; }

@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  .topbar, .noprint, .tabs, .demo-bar, nav, footer.site { display: none !important; }
  main.app { padding: 0; }
  .report section { break-inside: avoid; margin: 14px 0; }
  .card, .tile { box-shadow: none; }
  .court { max-width: 320px; }
}
