:root {
  --fg: #1a1a1a; --muted: #6b6b6b; --bg: #f6f5f2; --panel: #ffffff; --line: #e4e2dc;
  --ok: #2e7d4f; --warn: #b7791f; --bad: #c0392b; --grid: #ebe9e3; --muted-bar: #b9b6ad;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #ecebe7; --muted: #a3a19a; --bg: #161615; --panel: #1f1f1d; --line: #33322f; --grid: #2c2b28; --muted-bar: #55534d;
    --ok: #5cc28a; --warn: #e0a84a; --bad: #e66b5c; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; }
.ct { max-width: 1100px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 24px; }
.ct-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.ct-title { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; }
.ct-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.ct-take { font-size: 18px; margin: 10px 0 0; max-width: 60ch; line-height: 1.4; }
.ct-pick { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ct-pick select { font: inherit; font-size: 15px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ct-error { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); border: 1px solid var(--bad); color: var(--fg); padding: 12px 14px; border-radius: var(--radius); }
.ct-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ct-card, .ct-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.ct-card-lab, .ct-card-note, .ct-hint, .ct-chip-lab { font-size: 12px; color: var(--muted); }
.ct-card-val { font-family: var(--serif); font-size: 28px; font-variant-numeric: tabular-nums; margin: 4px 0; }
#nichos { display: flex; flex-direction: column; gap: 24px; }
.ct-sec { display: flex; flex-direction: column; gap: 14px; }
.ct-sec-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.ct-h2 { font-size: 18px; font-weight: 600; margin: 0; }
.ct-sec-kpi { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-sec-kpi b { color: var(--fg); font-weight: 600; }
.ct-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ct-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ct-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ct-num, .ct-table th.ct-num { text-align: right; }
.ct-vend tbody tr { cursor: pointer; }
.ct-vend tbody tr:hover td, .ct-vend tbody tr.ct-on td { background: var(--bg); }
.ct-vend tbody tr.ct-on td:first-child { box-shadow: inset 3px 0 0 var(--fg); }
.ct-av { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 11px; font-weight: 600; margin-right: 8px; vertical-align: middle; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.ct-det { border-top: 1px dashed var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ct-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.ct-chip { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.ct-chip-val { font-size: 18px; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.ct-chip-of { font-size: 12px; color: var(--muted); margin-left: 4px; }
.ct-bar { height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.ct-bar > div { height: 100%; border-radius: 3px; }
.ct-cli-wrap { max-height: 440px; overflow-y: auto; }
.ct-cli td:first-child { white-space: normal; min-width: 180px; }
.ct-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ct-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.ct-form input, .ct-form select, .ct-form button, .ct-quitar { font: inherit; font-size: 14px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.ct-form button { background: var(--fg); color: var(--panel); border-color: var(--fg); cursor: pointer; font-weight: 600; }
.ct-quitar { padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ct-form-msg { font-size: 13px; min-height: 1em; }
.ct-foot { font-size: 12px; color: var(--muted); }
.ct-foot summary { cursor: pointer; }
.ct-foot td { padding: 2px 16px 2px 0; }
.ct-actualizado { font-size: 11px; color: var(--muted); text-align: center; }
.cargando .ct-card-val, .cargando #nichos { opacity: .45; transition: opacity .2s; }
@media (max-width: 520px) {
  .ct-title { font-size: 24px; }
  .ct-card-val { font-size: 22px; }
  .ct-table td, .ct-table th { padding-left: 6px; padding-right: 6px; }
}
