/* ============================================================== Tokens */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e5e8ed;
  --text: #0a0b0d;
  --text-2: #3b3f47;
  --muted: #6b7079;
  --line: #e3e6eb;
  --accent: #2563eb;
  --accent-btn: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e7eeff;
  --hero-bg: #0a0b0d;
  --pos: #137a45;
  --pos-soft: #e1f2e8;
  --neg: #c0392f;
  --neg-soft: #fbe6e3;
  --warn: #9a6400;
  --warn-soft: #fbefd6;
  --live: #16a34a;
  --delay: #2563eb;
  /* Paleta categórica validada (dataviz): azul, naranja, aguamarina, amarillo, magenta, violeta */
  --k1: #2a78d6; --k2: #eb6834; --k3: #1baf7a; --k4: #eda100; --k5: #e87ba4; --k6: #6250d6; --k7: #a3a197;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(10, 15, 30, 0.04), 0 8px 24px rgba(10, 15, 30, 0.05);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0e0f12;
    --surface-2: #17191e;
    --surface-3: #22252c;
    --text: #f4f5f7;
    --text-2: #c3c7cf;
    --muted: #8a8f99;
    --line: #1e2127;
    --accent: #5b96ff;
    --accent-btn: #2563eb;
    --accent-ink: #ffffff;
    --accent-soft: #101c38;
    --hero-bg: #0e0f12;
    --pos: #4cd58a;
    --pos-soft: #16301f;
    --neg: #ff8478;
    --neg-soft: #3a1c19;
    --warn: #f0be55;
    --warn-soft: #3a2e14;
    --live: #4cd58a;
    --delay: #5b96ff;
    --k1: #3987e5; --k2: #d95926; --k3: #199e70; --k4: #c98500; --k5: #d55181; --k6: #9085e9; --k7: #6c6e68;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ================================================================ Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
button, a, [role="button"], .chip, summary {
  touch-action: manipulation;
}
button, .seg button, summary {
  -webkit-user-select: none;
  user-select: none;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { letter-spacing: -0.01em; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px calc(48px + var(--sab));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap > * + * { margin-top: 14px; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }

/* ============================================================ App bar */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: var(--sat);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar-in {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px;
}
.brand { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.brand h1 { font-size: 19px; margin: 0; line-height: 1.2; }
.appbar-actions { display: flex; gap: 4px; align-items: center; }
.appbar-actions form { margin: 0; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  transition: background 0.12s, transform 0.12s var(--ease-out);
}
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--surface-3); transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.5; }
#refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#privacy .eye-off { display: none; }
#privacy[aria-pressed="true"] .eye-off { display: inline; }
#privacy[aria-pressed="true"] .eye-open { display: none; }

.live {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0; margin-top: 1px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.live.is-live .dot { background: var(--live); box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); animation: pulse 2s infinite; }
.live.is-delay .dot { background: var(--delay); }
.live.is-closed .dot { background: var(--muted); }
.live.is-error .dot { background: var(--warn); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ===================================================== Segmented control */
.seg {
  display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-3);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: 0; background: transparent; border-radius: 9px;
  padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer;
  white-space: nowrap; transition: background 0.15s, color 0.15s, transform 0.12s var(--ease-out);
}
.seg button:active { transform: scale(0.96); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.seg-sm { border-radius: 10px; padding: 2px; }
.seg-sm button { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; flex: 0 0 auto; }

/* =============================================================== Hero */
/* Tarjeta negra con brillo azul. Los tokens se redefinen dentro para que
   textos, píldoras y colores de ganancia/pérdida funcionen sobre fondo oscuro. */
.hero {
  --text: #ffffff; --text-2: #c9cdd6; --muted: #9ba1ad;
  --pos: #4ade80; --pos-soft: rgba(74, 222, 128, 0.14);
  --neg: #ff7b72; --neg-soft: rgba(255, 123, 114, 0.14);
  --warn: #fbbf24; --surface-2: rgba(255, 255, 255, 0.08); --surface-3: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(37, 99, 235, 0.55), transparent 58%),
    radial-gradient(90% 90% at 0% 100%, rgba(37, 99, 235, 0.16), transparent 60%),
    var(--hero-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(10, 20, 50, 0.18);
}
.hero-label { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.hero-total {
  font-size: clamp(34px, 10vw, 46px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  margin: 2px 0 10px; font-variant-numeric: tabular-nums;
}
.hero-total .cents { font-size: 0.55em; letter-spacing: -0.01em; color: var(--text-2); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: baseline; gap: 6px; border-radius: 99px; padding: 6px 12px;
  background: var(--surface-2); font-size: 14px; font-weight: 600;
}
.pill small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.pill.pos { background: var(--pos-soft); }
.pill.neg { background: var(--neg-soft); }
.hero-meta { margin-top: 10px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* =============================================================== Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { font-size: 17px; margin: 0; }
.head-tools { display: flex; gap: 8px; align-items: center; }

.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; font-size: 15px; font-weight: 500; line-height: 1.2;
  transition: transform 0.12s var(--ease-out), background 0.12s;
}
.btn:active { transform: scale(0.97); background: var(--surface-2); }
.btn.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-ink); font-weight: 600; }
.btn.primary:active { background: var(--accent-btn); filter: brightness(0.92); }
.btn.danger { color: var(--neg); }
.btn.small { padding: 6px 11px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ============================================================== Gráfico */
.chart-change { font-size: 14px; font-weight: 600; min-height: 20px; margin: -4px 0 6px; }
.chart-change small { color: var(--muted); font-weight: 500; }
.chart-wrap { position: relative; min-height: 190px; }
.chart-wrap svg { display: block; width: 100%; height: 190px; overflow: visible; touch-action: pan-y; }
.chart-wrap .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart-wrap .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .line.down { stroke: var(--neg); }
.chart-wrap .cost { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-wrap .area-stop { stop-color: var(--accent); }
.chart-wrap .area-stop.down { stop-color: var(--neg); }
.chart-wrap .cross { stroke: var(--text-2); stroke-width: 1; }
.chart-wrap .marker { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-wrap .marker.down { fill: var(--neg); }
.chart-wrap .hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute; top: 0; pointer-events: none; background: var(--text); color: var(--bg);
  border-radius: 10px; padding: 6px 9px; font-size: 12.5px; line-height: 1.35; white-space: nowrap;
  transform: translateX(-50%); opacity: 0; transition: opacity 0.12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-size: 14px; display: block; }
.chart-tip .k { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; background: currentColor; }
.chart-empty { color: var(--muted); font-size: 13.5px; height: 190px; display: grid; place-items: center; text-align: center; padding: 0 20px; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 5px; }
.chart-legend i.cost { border-top: 2px dashed var(--muted); }

/* =========================================================== Posiciones */
.list-card { padding: 16px 0 6px; }
.list-card .card-head { padding: 0 16px; }
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name spark val" "sub spark chg";
  align-items: center; gap: 1px 12px; width: 100%; text-align: left;
  padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: background 0.12s;
}
.row:active { background: var(--surface-2); }
.row .name { grid-area: name; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { grid-area: sub; color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.row .sub > span { overflow: hidden; text-overflow: ellipsis; }
.row .spark { grid-area: spark; width: 52px; height: 26px; }
.row .val { grid-area: val; text-align: right; font-weight: 600; font-size: 15.5px; }
.row .chg { grid-area: chg; text-align: right; font-size: 13px; font-weight: 600; }
.row .chg.muted { font-weight: 500; }
.row.flash-up .val { animation: flashUp 0.9s var(--ease-out); }
.row.flash-down .val { animation: flashDown 0.9s var(--ease-out); }
@keyframes flashUp { 0% { color: var(--pos); } 100% { color: inherit; } }
@keyframes flashDown { 0% { color: var(--neg); } 100% { color: inherit; } }

.spark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .up { stroke: var(--pos); }
.spark .down { stroke: var(--neg); }
.spark .base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 2; }

.bank {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 1px 6px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.bank.alt { background: var(--surface-3); color: var(--text-2); }
.fresh { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.fresh i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.fresh.rt i { background: var(--live); }
.fresh.delay i { background: var(--delay); }
.fresh.manual i, .fresh.old i { background: var(--warn); }
.fresh.old { color: var(--warn); }

.list-foot { padding: 10px 16px 8px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ============================================================== Reparto */
.alloc-bar { display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.alloc-bar span { display: block; height: 100%; min-width: 2px; }
.alloc-rows { margin-top: 12px; display: grid; gap: 2px; }
.alloc-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.alloc-row i { width: 10px; height: 10px; border-radius: 3px; }
.alloc-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alloc-row .p { font-weight: 600; text-align: right; min-width: 52px; }
.alloc-row .e { color: var(--muted); text-align: right; min-width: 84px; font-size: 13px; }

/* ============================================================= Noticias */
.news h2 { font-size: 17px; margin: 0 0 2px; }
.news .date { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.news ul { list-style: none; margin: 0; padding: 0; }
.news li { padding: 12px 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; }
.news a.title { color: var(--text); text-decoration: none; font-weight: 600; display: block; }
.news .why { font-size: 13px; color: var(--accent); margin-top: 3px; }
.news .src { font-size: 12px; color: var(--muted); margin-top: 3px; }
.news .src a { color: var(--text-2); }
.news details { margin-top: 6px; }
.news summary, .status summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 8px 0; }

/* =============================================================== Estado */
.status { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.status table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.status td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.status td:last-child { text-align: right; white-space: nowrap; }
.status ul { margin: 6px 0 0; padding-left: 18px; }

/* ===================================================== Hojas (diálogos) */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 620px;
  max-height: 92dvh; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetIn 0.32s var(--ease-out); }
dialog.sheet::backdrop { background: rgba(8, 10, 9, 0.45); animation: fadeIn 0.25s ease-out; }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; border-radius: 22px; max-height: calc(100dvh - 48px); }
  dialog.sheet[open] { animation: popIn 0.22s var(--ease-out); }
  @keyframes popIn { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}
.grab, .dlg-head { touch-action: none; }
.grab { width: 38px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 18px 8px; flex: none; }
.dlg-head h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.dlg-head .muted { font-size: 13px; margin-top: 2px; }
.dlg-body {
  padding: 4px 18px calc(20px + var(--sab)); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.close {
  border: 0; background: var(--surface-2); border-radius: 99px; width: 34px; height: 34px; cursor: pointer;
  font-size: 20px; line-height: 1; flex: none; color: var(--text-2);
}
.close:active { background: var(--surface-3); }

.detail-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 10px; }
.detail-hero .big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.detail-hero .sm { color: var(--muted); font-size: 13px; }
.detail-spark { width: 100%; height: 70px; display: block; margin: 4px 0 6px; }
.detail-spark polyline { stroke-width: 2; }
.src-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.kv div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.kv .v small { font-weight: 400; color: var(--muted); }
.desc { margin: 10px 0; color: var(--text-2); }
.role { font-size: 13.5px; color: var(--muted); }
.facts { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.actions .wide { grid-column: 1 / -1; }

form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
form.grid .full { grid-column: 1 / -1; }
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
form input, form select, form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 16px; /* 16 px: el iPhone no hace zoom al escribir */
  -webkit-appearance: none; appearance: none;
}
form select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px;
}
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
form textarea { min-height: 72px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lookup-results { display: grid; gap: 6px; margin-top: 6px; }
.lookup-results button { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 13.5px; }
.lookup-results button:active { border-color: var(--accent); }
.form-error { color: var(--neg); font-size: 13.5px; min-height: 1em; }
.form-actions { display: flex; gap: 8px; }
.form-actions .btn { flex: 1; }

/* ================================================================ Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--sab)); transform: translate(-50%, 12px);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px;
  font-size: 14px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; z-index: 50;
  transition: opacity 0.2s, transform 0.25s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ======================================================= Modo privado */
body.private .amt-svg { visibility: hidden; }
body.private .amt { display: inline-block; filter: blur(0.42em); transition: filter 0.2s; -webkit-user-select: none; user-select: none; }

/* ============================================================ Esqueleto */
.sk { display: inline-block; height: 1em; width: 90px; border-radius: 8px; background: var(--surface-3); animation: skp 1.2s ease-in-out infinite alternate; }
.sk-lg { width: 220px; height: 0.9em; }
@keyframes skp { from { opacity: 0.55; } to { opacity: 1; } }

.loading { opacity: 0.6; transition: opacity 0.2s; }

/* ============================================================== Hover (ratón) */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--surface-2); }
  .btn:hover { border-color: var(--muted); }
  .btn.primary:hover { filter: brightness(1.08); border-color: var(--accent-btn); }
  .row:hover { background: var(--surface-2); }
  .seg button:hover:not([aria-pressed="true"]) { color: var(--text); }
  .news a.title:hover { text-decoration: underline; }
  .lookup-results button:hover { border-color: var(--accent); }
  .close:hover { background: var(--surface-3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 400px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .row { padding: 12px 12px; gap: 1px 10px; }
  .list-card .card-head { padding: 0 12px; }
  .row .spark { width: 44px; }
  .kv { grid-template-columns: 1fr 1fr; }
  form.grid { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .list-card { padding: 14px 0 6px; }
}

/* ================================================================ Login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; padding-bottom: calc(16px + var(--sab)); }
.login .card { width: min(380px, 100%); padding: 26px 22px; }
.login .logo { width: 48px; height: 48px; border-radius: 14px; display: block; margin-bottom: 14px; }
.login h1 { font-size: 24px; margin: 0 0 2px; }
.login input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  margin: 18px 0 10px; font-size: 16px;
}
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .btn { width: 100%; padding: 13px; font-size: 16px; }
.login .msg { font-size: 13.5px; margin-top: 10px; min-height: 1.2em; }
.login .msg.neg { color: var(--neg); }
