/* ==========================================================================
   RODARIO · El diario de tu vehículo
   Mobile-first. Tema oscuro deportivo. Sin dependencias.
   ========================================================================== */

:root {
  --bg: #07090c;
  --bg-soft: #0b0f14;
  --surface: #11161d;
  --surface-2: #171e27;
  --surface-3: #1e2732;
  --line: #26313d;
  --line-soft: #1c252f;
  --text: #f2f5f7;
  --muted: #94a3b1;
  --muted-2: #6e7d8b;
  --accent: #c8ff2e;
  --accent-2: #9ee600;
  --accent-ink: #0a1200;
  --danger: #ff5c63;
  --warn: #ffb020;
  --info: #5ec8ff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --topbar-h: 60px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 55vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(200, 255, 46, .10), transparent 70%),
    radial-gradient(50% 50% at 90% 10%, rgba(94, 200, 255, .07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
}

@media (min-width: 600px) {
  body { background: #040608; }
  .app-shell {
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    min-height: 100vh;
  }
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(var(--safe-t) + 10px) 18px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(7, 9, 12, .96) 55%, rgba(7, 9, 12, 0));
  backdrop-filter: blur(14px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  min-width: 0;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), #8fd400);
  box-shadow: 0 6px 18px rgba(200, 255, 46, .22);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name {
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 16px;
}
.brand-sub {
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(23, 30, 39, .8);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

.lang-btn {
  height: 38px;
  padding: 0 10px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(23, 30, 39, .8);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.lang-btn svg { width: 16px; height: 16px; opacity: .8; }

.pro-pill svg { width: 11px; height: 11px; }
.pro-pill {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #a8ef00);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .1em;
  border: 0;
  cursor: pointer;
}

/* ---------- View ---------- */

.view {
  flex: 1;
  padding: 4px 18px calc(var(--nav-h) + var(--safe-b) + 28px);
  outline: none;
  animation: view-in .22s ease both;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.view.no-nav { padding-bottom: calc(var(--safe-b) + 28px); }
.view.onboard-view { padding: 0; }

details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; float: right; color: var(--muted-2); font-weight: 800; }
details[open] summary::after { content: '−'; }

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(9, 12, 16, .93);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-soft);
}
.bottom-nav button {
  position: relative;
  border: 0;
  background: none;
  color: var(--muted-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px 4px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  font-family: inherit;
}
.bottom-nav button svg { width: 21px; height: 21px; }
.bottom-nav button.on { color: var(--accent); }
.bottom-nav button.on::after {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}
.bottom-nav .dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 2px rgba(9, 12, 16, .9);
}

/* ---------- Typography / blocks ---------- */

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p { margin: 0; }

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 17px; }
.section-head .link {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.page-head { padding: 10px 0 18px; }
.page-head .kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.page-head.with-back {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
}
.page-head.with-back h1 { font-size: 20px; }
.page-head.with-back p { margin-top: 2px; font-size: 12.5px; }
.page-head.with-back .icon-btn { flex: 0 0 38px; }
.page-head .grow { min-width: 0; flex: 1; }

.mega {
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1;
}

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, var(--surface), #0d1218);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card.flat { background: var(--surface); }
.card.pad-lg { padding: 20px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}
.kpi .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted-2);
  font-weight: 700;
}
.kpi .value { font-size: 22px; font-weight: 850; letter-spacing: -.03em; margin-top: 5px; }
.kpi .value small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi.wide { grid-column: span 2; }

/* ---------- Vehicle card ---------- */

.vehicle-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: transform .16s ease, border-color .16s ease;
  margin-bottom: 14px;
}
.vehicle-card:active { transform: scale(.985); }
.vehicle-hero {
  position: relative;
  height: 156px;
  background: #10161d;
  overflow: hidden;
}
.vehicle-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vehicle-hero .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(75% 90% at 70% 10%, rgba(200, 255, 46, .16), transparent 70%),
    linear-gradient(135deg, #17202a, #0d1218 65%);
}
.vehicle-hero .placeholder svg { width: 118px; height: 64px; opacity: .55; color: var(--accent); }
.vehicle-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 12, 16, .92) 2%, rgba(9, 12, 16, .12) 55%, transparent);
  pointer-events: none;
}
.vehicle-card .hero-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(9, 12, 16, .72);
  border: 1px solid rgba(255, 255, 255, .11);
  backdrop-filter: blur(8px);
  color: var(--text);
  white-space: nowrap;
}
.badge.accent { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.badge.warn { background: rgba(255, 176, 32, .16); border-color: rgba(255, 176, 32, .4); color: var(--warn); }
.badge.danger { background: rgba(255, 92, 99, .16); border-color: rgba(255, 92, 99, .4); color: var(--danger); }
.badge.lock { color: var(--muted); }
.badge svg { width: 11px; height: 11px; }
.hero-plate {
  margin-left: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 6px;
}
.vehicle-card .hero-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.vehicle-card .hero-bottom h3 { font-size: 18px; font-weight: 850; letter-spacing: -.02em; }
.vehicle-card .hero-bottom .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.vehicle-card .hero-bottom .spend { margin-left: auto; text-align: right; }
.vehicle-card .hero-bottom .spend b { font-size: 17px; font-weight: 850; letter-spacing: -.02em; display: block; }
.vehicle-card .hero-bottom .spend span { font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; }

.vehicle-card .v-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  background: #0d1218;
}
.vehicle-card .v-alert b { color: var(--text); font-weight: 700; }
.vehicle-card .v-alert .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.vehicle-card .v-alert .dot.danger { background: var(--danger); }
.vehicle-card .v-alert .dot.ok { background: var(--accent); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, background .14s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #b3ef00);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(200, 255, 46, .16);
}
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.danger { color: var(--danger); border-color: rgba(255, 92, 99, .35); background: rgba(255, 92, 99, .08); }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; font-size: 12.5px; padding: 0 13px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(calc(-50% + 180px));
  z-index: 30;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(200, 255, 46, .3);
  cursor: pointer;
}
@media (max-width: 599px) {
  .fab { transform: none; left: auto; right: 18px; }
}
.fab svg { width: 24px; height: 24px; }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px 16px;
  padding: 0 18px 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--muted);
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.tabs button.on {
  background: var(--text);
  border-color: var(--text);
  color: #0a0d11;
}

/* ---------- Vehicle detail header ---------- */

.v-head {
  position: relative;
  margin: 0 -18px 18px;
  height: 210px;
  overflow: hidden;
  background: #10161d;
}
.v-head img { width: 100%; height: 100%; object-fit: cover; }
.v-head .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 90% at 70% 0%, rgba(200, 255, 46, .18), transparent 70%),
    linear-gradient(135deg, #1a242f, #0c1117 70%);
}
.v-head .placeholder svg { width: 170px; height: 92px; color: var(--accent); opacity: .6; }
.v-head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 3%, rgba(7, 9, 12, .3) 48%, rgba(7, 9, 12, .55));
}
.v-head .head-actions {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}
.v-head .head-actions .icon-btn { background: rgba(9, 12, 16, .6); backdrop-filter: blur(10px); }
.v-head .head-actions .spacer { margin-left: auto; }
.v-head .head-info {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 10px;
}
.v-head .head-info h1 { font-size: 24px; }
.v-head .head-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.v-head .head-info .meta span { display: inline-flex; align-items: center; gap: 5px; }
.v-head .head-info .meta svg { width: 13px; height: 13px; opacity: .8; }

.readonly-banner {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(255, 176, 32, .13), rgba(255, 176, 32, .04));
  border: 1px solid rgba(255, 176, 32, .28);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #f3d9a8;
}
.readonly-banner svg { width: 18px; height: 18px; flex: none; color: var(--warn); margin-top: 1px; }
.readonly-banner b { color: #fff; display: block; margin-bottom: 2px; font-size: 13px; }
.readonly-banner .btn { margin-top: 9px; }

/* ---------- Lists ---------- */

.list { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.row:last-child { border-bottom: 0; }
button.row { cursor: pointer; }
.row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  flex: none;
  color: var(--muted);
}
.row-icon svg { width: 19px; height: 19px; }
.row-icon.accent { color: var(--accent); background: rgba(200, 255, 46, .08); border-color: rgba(200, 255, 46, .18); }
.row-icon.warn { color: var(--warn); background: rgba(255, 176, 32, .09); border-color: rgba(255, 176, 32, .2); }
.row-main { min-width: 0; flex: 1; }
.row-main .t { font-size: 14px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main .s { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: right; flex: none; }
.row-end .amount { font-weight: 800; font-size: 14.5px; letter-spacing: -.02em; }
.row-end .when { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.row .chev { width: 16px; height: 16px; color: var(--muted-2); flex: none; }
.row-end .amount.refund { color: var(--accent); }

.empty {
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(17, 22, 29, .5);
}
.empty svg { width: 42px; height: 42px; color: var(--muted-2); margin-bottom: 10px; }
.empty h3 { font-size: 15px; margin-bottom: 5px; }
.empty p { font-size: 12.5px; color: var(--muted); max-width: 30ch; margin: 0 auto; }
.empty .btn { margin-top: 14px; }

/* ---------- Record / photo tiles ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 0;
  cursor: pointer;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .pt-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 6px 5px;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-add {
  aspect-ratio: 1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(23, 30, 39, .4);
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.photo-add svg { width: 20px; height: 20px; }

.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.thumbs img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .opt { color: var(--muted-2); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 10.5px; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 13px;
  min-height: 46px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(200, 255, 46, .55);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, .1);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { min-height: 88px; resize: vertical; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 46px; }
.input-suffix span {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}
.hint { font-size: 11px; color: var(--muted-2); margin-top: -2px; }
.error-msg { font-size: 11.5px; color: var(--danger); font-weight: 600; display: none; }
.field.invalid .input, .field.invalid .select { border-color: rgba(255, 92, 99, .55); }
.field.invalid .error-msg { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip svg { width: 14px; height: 14px; }
.chip.on {
  background: rgba(200, 255, 46, .12);
  border-color: rgba(200, 255, 46, .5);
  color: var(--accent);
}
.chip.on.warn { background: rgba(255, 176, 32, .12); border-color: rgba(255, 176, 32, .45); color: var(--warn); }

.upload-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(23, 30, 39, .35);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.upload-box svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.upload-box .t { font-size: 13px; font-weight: 700; display: block; }
.upload-box .s { font-size: 11px; color: var(--muted-2); margin-top: 1px; display: block; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 14px;
}
.segmented button {
  border: 0;
  background: none;
  color: var(--muted);
  height: 38px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.segmented button.on { background: var(--surface-3); color: var(--text); }

/* ---------- Alerts ---------- */

.alert-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  margin-bottom: 10px;
  align-items: flex-start;
}
.alert-card.danger { border-color: rgba(255, 92, 99, .35); background: linear-gradient(135deg, rgba(255, 92, 99, .09), var(--surface) 60%); }
.alert-card.warn { border-color: rgba(255, 176, 32, .3); background: linear-gradient(135deg, rgba(255, 176, 32, .08), var(--surface) 60%); }
.alert-card.ok { opacity: .7; }
.alert-main { flex: 1; min-width: 0; }
.alert-main .t { font-weight: 750; font-size: 14px; }
.alert-main .v { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.alert-main .due {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 700;
}
.alert-main .due.danger { color: var(--danger); }
.alert-main .due.warn { color: var(--warn); }
.alert-main .due.ok { color: var(--accent); }
.alert-main .due svg { width: 13px; height: 13px; }
.alert-actions { display: flex; gap: 6px; flex: none; }

.paywall-card {
  position: relative;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid rgba(200, 255, 46, .24);
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(200, 255, 46, .15), transparent 60%),
    linear-gradient(180deg, #151c12, #0c1116);
  overflow: hidden;
}
.paywall-card h3 { font-size: 17px; margin-bottom: 4px; }
.paywall-card p { font-size: 12.5px; color: var(--muted); }
.paywall-card .btn { margin-top: 14px; }
.paywall-card .lock-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(200, 255, 46, .12);
  border: 1px solid rgba(200, 255, 46, .25);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.paywall-card .lock-ic svg { width: 20px; height: 20px; }

/* ---------- Charts ---------- */

.bars { display: flex; align-items: flex-end; gap: 7px; height: 120px; margin-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(to top, rgba(200, 255, 46, .3), var(--accent));
  min-height: 3px;
  transition: height .4s ease;
}
.bar-col.dim .bar { background: linear-gradient(to top, #2a3542, #3a4756); }
.bar-col .bl { font-size: 9px; color: var(--muted-2); font-weight: 700; text-transform: uppercase; }
.bar-col .bv { font-size: 9.5px; color: var(--muted); font-weight: 700; }

.cat-bar { margin-top: 12px; }
.cat-bar .cb-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; gap: 10px; }
.cat-bar .cb-top .n { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cat-bar .cb-top .n svg { width: 13px; height: 13px; }
.cat-bar .cb-top .v { font-weight: 750; }
.cat-bar .track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cat-bar .fill { height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- Pro screen ---------- */

.pro-hero {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  padding: 26px 22px 24px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(200, 255, 46, .3), transparent 55%),
    radial-gradient(90% 100% at 0% 100%, rgba(94, 200, 255, .12), transparent 60%),
    linear-gradient(160deg, #1a2318, #0b1014 70%);
  border: 1px solid rgba(200, 255, 46, .22);
}
.pro-hero .pro-word {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .18em;
  line-height: 1;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pro-hero .pro-sub { margin-top: 6px; color: #cfd9c4; font-size: 13.5px; }
.pro-hero .pro-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.pro-hero .pro-ribbon svg { width: 12px; height: 12px; }

.plan-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}
.plan-opt {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.plan-opt.on {
  border-color: var(--accent);
  background: rgba(200, 255, 46, .07);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.plan-opt .pt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.plan-opt .pp { font-size: 25px; font-weight: 900; letter-spacing: -.04em; margin-top: 4px; }
.plan-opt .pp small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-opt .ps { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }
.plan-opt .save {
  position: absolute;
  top: -9px;
  right: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 3px 8px;
  text-transform: uppercase;
}

.feature-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.feature {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.feature .fic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(200, 255, 46, .1);
  border: 1px solid rgba(200, 255, 46, .2);
  color: var(--accent);
  flex: none;
}
.feature .fic svg { width: 15px; height: 15px; }
.feature .ft { font-size: 13.5px; font-weight: 750; }
.feature .fs { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.feature .tag {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--accent);
  border: 1px solid rgba(200, 255, 46, .3);
  padding: 2px 5px;
  border-radius: 5px;
  flex: none;
  margin-top: 2px;
}

.fineprint { font-size: 10.5px; color: var(--muted-2); margin-top: 12px; text-align: center; line-height: 1.5; }

/* ---------- Sheet / modal ---------- */

.sheet-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, .7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: auto;
}
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  transform: translate(-50%, 105%);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(22px + var(--safe-b));
  transition: transform .28s cubic-bezier(.22, .9, .25, 1);
  pointer-events: auto;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet .handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 4px auto 16px;
}
.sheet h2 { font-size: 20px; margin-bottom: 6px; }
.sheet .sheet-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.sheet .close-x { position: absolute; top: 14px; right: 14px; }
.sheet .sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sheet .sheet-actions .row {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: 14px;
  padding: 13px 14px;
}
.sheet .sheet-actions .row.active { border-color: var(--accent); background: rgba(200, 255, 46, .06); }
.sheet .sheet-actions .row.active .t { color: var(--accent); }
.sheet .sheet-actions .check { width: 18px; height: 18px; color: var(--accent); }
.sheet .sheet-actions .row .flag { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; background: var(--surface-3); color: var(--muted); }

.lang-list .row { padding: 12px 14px; }

/* ---------- Onboarding ---------- */

.onboard {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 26px) 22px calc(var(--safe-b) + 24px);
  position: relative;
  overflow: hidden;
}
.onboard .ob-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 55% at 75% 0%, rgba(200, 255, 46, .17), transparent 65%),
    linear-gradient(180deg, transparent 40%, rgba(200, 255, 46, .035));
  pointer-events: none;
}
.onboard .ob-top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.onboard .ob-brand { display: flex; align-items: center; gap: 10px; }
.onboard .ob-brand .n { font-weight: 900; letter-spacing: .2em; font-size: 15px; }
.onboard .ob-brand .d { font-size: 9px; letter-spacing: .13em; color: var(--muted); text-transform: uppercase; }
.onboard .ob-main { position: relative; margin-top: auto; }
.onboard .ob-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.onboard h1 { font-size: clamp(34px, 10.5vw, 46px); line-height: .98; letter-spacing: -.045em; }
.onboard h1 em { font-style: normal; color: var(--accent); }
.onboard .ob-desc { color: var(--muted); font-size: 14.5px; margin-top: 14px; max-width: 34ch; }
.onboard .ob-feats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.onboard .ob-feats span {
  font-size: 11px;
  color: #d4ddd3;
  border: 1px solid var(--line);
  background: rgba(23, 30, 39, .55);
  padding: 6px 10px;
  border-radius: 99px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.onboard .ob-feats svg { width: 12px; height: 12px; color: var(--accent); }
.onboard .ob-actions { margin-top: 26px; position: relative; }
.onboard .ob-note { margin-top: 12px; font-size: 10.5px; color: var(--muted-2); text-align: center; }
.onboard .ob-art {
  margin: 20px 0 4px;
  position: relative;
  display: grid;
  place-items: center;
}
.onboard .ob-art svg { width: min(78vw, 330px); height: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); }

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: #e9f0e6;
  color: #0d1309;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: toast-in .25s ease both;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.err { background: #ffdfe0; color: #4a0d10; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */

.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt0 { margin-top: 0 !important; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 10.5px; }
.strong { font-weight: 800; }
.accent-text { color: var(--accent); }
.danger-text { color: var(--danger); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.progress-ring {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--surface-3) 0);
  flex: none;
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 12px; font-weight: 850; }

.sticky-save {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  margin-top: 4px;
}

.plan-status {
  display: flex;
  align-items: center;
  gap: 12px;
}
.plan-status .ps-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(200, 255, 46, .1);
  border: 1px solid rgba(200, 255, 46, .25);
  color: var(--accent);
  flex: none;
}
.plan-status .ps-ic svg { width: 20px; height: 20px; }
.plan-status > svg { width: 18px; height: 18px; flex: none; color: var(--muted-2); }
.plan-status .ps-main { flex: 1; min-width: 0; }
.plan-status .ps-main b { display: block; font-size: 14px; }
.plan-status .ps-main span { font-size: 11.5px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
