:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020b1b;
  color: #f5f9ff;
  --bg: #020b1b;
  --panel: rgba(246, 250, 255, 0.08);
  --panel-strong: rgba(246, 250, 255, 0.14);
  --line: rgba(210, 232, 255, 0.16);
  --muted: rgba(228, 240, 255, 0.68);
  --soft: rgba(228, 240, 255, 0.45);
  --green: #45f35f;
  --mint: #26d7ff;
  --amber: #ff9a24;
  --blue: #0e8dff;
  --navy: #061832;
  --shadow: 0 22px 70px rgba(0, 8, 24, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 72% 10%, rgba(38, 215, 255, 0.2), transparent 27rem),
    radial-gradient(circle at 10% 24%, rgba(69, 243, 95, 0.13), transparent 22rem),
    radial-gradient(circle at 92% 82%, rgba(255, 154, 36, 0.13), transparent 22rem),
    linear-gradient(145deg, #020814 0%, #04152c 48%, #06101e 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

.svg,
.svg svg {
  display: inline-block;
  width: 1em;
  height: 1em;
}

.svg svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: 34px;
  background:
    radial-gradient(circle at 50% 37%, rgba(12, 152, 255, 0.4), transparent 18rem),
    radial-gradient(circle at 35% 28%, rgba(69, 243, 95, 0.16), transparent 20rem),
    linear-gradient(160deg, #020a19 0%, #061a38 54%, #020812 100%);
  transition: opacity 0.42s ease, visibility 0.42s ease;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-mark {
  width: min(62vw, 238px);
  aspect-ratio: 1;
  border-radius: 28%;
  padding: 5px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 58px rgba(38, 215, 255, 0.34);
}

.splash-mark img,
.brand-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.splash-copy {
  width: min(100%, 330px);
  text-align: center;
}

.splash-copy p {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.splash-copy h1 {
  max-width: none;
  margin: 0;
  font-size: 38px;
}

.splash-copy span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.phone-shell {
  position: relative;
  width: 326px;
  max-width: calc(100% - 32px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 12px calc(env(safe-area-inset-bottom) + 92px);
  overflow-x: hidden;
}

.phone-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(210,232,255,0.035) 1px, transparent 1px);
  background-size: 100% 20px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, transparent 94%);
}

.top {
  margin-bottom: 14px;
}

.top > div {
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.brand-line img {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  box-shadow: 0 0 18px rgba(38, 215, 255, 0.22);
}

.app-label {
  margin: 0;
  color: var(--mint);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 280px;
  margin: 0;
  font-size: 31px;
  line-height: 0.98;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-button {
  padding: 4px;
  border-radius: 15px;
  overflow: hidden;
  display: none;
}

.hero-panel {
  position: relative;
  min-height: 194px;
  margin-bottom: 12px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(38, 215, 255, 0.36), transparent 13rem),
    linear-gradient(150deg, #03152d, #071a35 55%, #050b16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-icon-art {
  left: auto;
  top: 20px;
  right: 14px;
  bottom: auto;
  width: 112px;
  height: 112px;
  border-radius: 28px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 12, 27, 0.15), rgba(3, 12, 27, 0.05) 45%, rgba(3, 12, 27, 0.36)),
    linear-gradient(180deg, rgba(3, 12, 27, 0.02), rgba(3, 12, 27, 0.88));
}

.hero-copy {
  position: absolute;
  left: 18px;
  right: 132px;
  bottom: 17px;
  z-index: 1;
}

.hero-copy span,
.route-line span,
.field span,
.stat span,
.battery-head span,
.section-head span,
.recommendation span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.hero-copy p,
.battery-card p {
  margin: 8px 0 0;
  color: rgba(243, 247, 243, 0.74);
  font-size: 14px;
  line-height: 1.45;
}

.battery-card,
.controls,
.edit-trip {
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px);
}

.add-car input {
  min-width: 0;
  width: 100%;
  margin-top: 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(69, 243, 95, 0.13);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.battery-card {
  padding: 12px 14px;
  margin-bottom: 8px;
}

.battery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battery-head > .svg {
  color: var(--mint);
  font-size: 28px;
}

.battery-head strong {
  display: block;
  margin-top: 2px;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: 0;
}

.battery-range,
.field input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 8px 8px;
}

.stat {
  min-height: 86px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--line);
}

.stat svg {
  color: var(--mint);
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 21px;
}

.controls {
  padding: 6px;
}

.saved-trip-card {
  display: grid;
  gap: 10px;
  margin: 6px 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(210, 232, 255, 0.12);
}

.saved-trip-card.compact {
  padding: 10px;
}

.saved-trip-card.compact select {
  padding: 10px 12px;
}

.saved-trip-card.maintenance {
  margin-bottom: 10px;
}

.saved-trip-card label {
  display: grid;
  gap: 7px;
}

.saved-trip-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.saved-trip-card select,
.save-trip-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(210, 232, 255, 0.16);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(2, 11, 27, 0.46);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  outline: 0;
}

.save-trip-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.save-trip-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  width: 100%;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--mint));
  color: #061120;
  font-size: 13px;
  font-weight: 900;
}

.save-trip-row button span {
  color: inherit;
}

.primary-action {
  width: calc(100% - 24px);
  min-height: 44px;
  margin: 0 12px 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--green), var(--mint));
  color: #061120;
  font-size: 14px;
  font-weight: 900;
}

.text-field {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.text-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.text-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(210, 232, 255, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2, 11, 27, 0.42);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  outline: 0;
}

.trip-list {
  display: grid;
  gap: 8px;
  margin: 8px;
}

.trip-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  text-align: left;
}

.trip-row.selected {
  background: rgba(38, 215, 255, 0.14);
  outline: 1px solid rgba(38, 215, 255, 0.26);
}

.trip-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.trip-row strong {
  color: var(--muted);
  font-size: 13px;
}

.manual-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin: 8px;
  padding: 13px;
  border-radius: 18px;
  background: rgba(38, 215, 255, 0.1);
  border: 1px solid rgba(38, 215, 255, 0.18);
}

.manual-note > .svg {
  color: var(--mint);
  font-size: 18px;
  margin-top: 2px;
}

.manual-note strong {
  display: block;
  font-size: 14px;
}

.manual-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recommendation {
  margin: 0 8px 4px;
  padding: 13px;
  border-radius: 19px;
  background:
    linear-gradient(135deg, rgba(69, 243, 95, 0.14), rgba(38, 215, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(69, 243, 95, 0.18);
}

.recommendation strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.recommendation p {
  margin: 8px 0 0;
  color: rgba(228, 240, 255, 0.72);
  font-size: 13px;
  line-height: 1.42;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.field:last-child {
  border-bottom: 0;
}

.field strong {
  font-size: 14px;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.field-value input {
  width: 74px;
  min-width: 0;
  border: 1px solid rgba(210, 232, 255, 0.16);
  border-radius: 12px;
  padding: 7px 8px;
  background: rgba(2, 11, 27, 0.42);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-align: right;
  outline: 0;
}

.field input {
  grid-column: 1 / -1;
}

.field-value input {
  grid-column: auto;
}

.garage {
  display: grid;
  gap: 8px;
}

.car-row,
.add-car {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 13px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.car-row span,
.car-row strong,
.section-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-row.selected {
  background: rgba(38, 215, 255, 0.14);
  outline: 1px solid rgba(38, 215, 255, 0.3);
}

.car-row strong {
  color: var(--soft);
  font-size: 13px;
}

.add-car button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--mint));
  color: #061120;
}

.edit-car {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.edit-trip {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.section-head > div {
  min-width: 0;
}

.section-head strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.ghost-action {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 154, 36, 0.13);
  color: var(--amber);
}

.edit-car,
.battery-card,
.controls {
  max-width: 100%;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 326px;
  max-width: calc(100% - 44px);
  padding: 8px;
  transform: translateX(-50%);
  border-radius: 24px;
  background: rgba(11, 18, 18, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(24px);
}

.tabbar button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 50px;
  border-radius: 17px;
  background: transparent;
  color: var(--soft);
}

.tabbar button.active {
  background: rgba(38, 215, 255, 0.14);
  color: var(--mint);
}

.tabbar span {
  font-size: 10px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .splash {
    transition: none;
  }
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    min-height: 100vh;
  }

  .phone-shell {
    min-height: 880px;
    margin: 30px auto;
    border-radius: 46px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.55);
  }
}
