:root {
  color-scheme: dark;
  --bg: #050813;
  --panel: #0d1425;
  --panel-2: #111a2e;
  --line: #24314f;
  --text: #f6f8ff;
  --muted: #9aa7c4;
  --green: #2ee98a;
  --blue: #24a6ff;
  --warn: #ffd166;
  --bad: #ff6b8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 18px 14px;
}

.login-card {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px 18px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.login-card .login-logo {
  width: 101px;
  height: 101px;
  border-radius: 30px;
  margin: 0 auto 18px;
}

.login-card .login-logo::after {
  border-radius: 27px;
}

.login-card .login-logo .brand-logo {
  max-width: 81px;
  max-height: 81px;
}

.login-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #02100a;
  background: var(--green);
  font-weight: 900;
}

.login-button:disabled {
  opacity: 0.65;
}

.login-error {
  margin: 12px 0 0;
  border: 1px solid rgba(255, 107, 138, 0.42);
  border-radius: 8px;
  background: rgba(255, 107, 138, 0.08);
  color: #ffc1ce;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
  text-align: left;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 14px 96px;
}

.hero {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 2px 14px;
}

.logo-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: #10182a;
  border: 1px solid rgba(46, 233, 138, 0.34);
  overflow: hidden;
}

.logo-ring::before {
  content: "";
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 0deg, transparent, rgba(46, 233, 138, 0.95), transparent, rgba(36, 166, 255, 0.9), transparent);
  animation: spin 4s linear infinite;
}

.logo-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 21px;
  background: #07101f;
}

.brand-logo {
  position: relative;
  z-index: 1;
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(46, 233, 138, 0.24));
  animation: breathe 2.8s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: 23px;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
  letter-spacing: 0;
}

.subtitle,
.helper {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.logout-button {
  width: 48px;
  min-height: 38px;
  border: 1px solid #2a385b;
  border-radius: 8px;
  background: #090f1e;
  color: #cfe3ff;
  font-size: 12px;
  font-weight: 900;
}

.usage-pill {
  display: inline-grid;
  min-height: 32px;
  align-items: center;
  margin: 0 2px 14px;
  border: 1px solid rgba(36, 166, 255, 0.4);
  border-radius: 8px;
  background: rgba(36, 166, 255, 0.1);
  color: #b8e1ff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.progress-wrap {
  margin: 4px 0 16px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #121a2c;
  overflow: hidden;
  border: 1px solid #1d2944;
}

.progress-bar {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 220ms ease;
}

#stepText {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.screen {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
}

.screen.active {
  display: block;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #dbe5ff;
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid #2a385b;
  background: #070d1a;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 166, 255, 0.18);
}

.traffic-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  align-items: center;
  margin: -2px 0 14px;
  border: 1px solid #263553;
  border-radius: 8px;
  background: #0a1120;
  padding: 11px;
}

.traffic-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  min-width: 54px;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(36, 166, 255, 0.12);
  color: #a8dcff;
  font-size: 12px;
  font-weight: 900;
}

.traffic-card strong {
  font-size: 15px;
}

.traffic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.address-suggestions {
  display: grid;
  gap: 7px;
  margin: -6px 0 14px;
}

.address-suggestions:empty {
  display: none;
}

.address-suggestions button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  border: 1px solid #263553;
  border-radius: 8px;
  background: #091121;
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
}

.address-suggestions strong {
  color: #dfffea;
  font-size: 14px;
}

.address-suggestions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.confirmed-place {
  display: grid;
  gap: 4px;
  margin: -4px 0 14px;
  border: 1px solid rgba(46, 233, 138, 0.42);
  border-radius: 8px;
  background: rgba(46, 233, 138, 0.08);
  padding: 11px;
}

.confirmed-place span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.confirmed-place strong {
  font-size: 14px;
}

.confirmed-place p {
  margin: 0;
  color: #c8f5dd;
  font-size: 12px;
  line-height: 1.35;
}

.money-input {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid #2a385b;
  background: #070d1a;
  overflow: hidden;
}

.money-input span {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--green);
  font-weight: 900;
  border-right: 1px solid #1c2946;
}

.money-input input {
  border: 0;
  min-height: 46px;
  box-shadow: none;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.segmented button,
.variant-actions button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid #2a385b;
  color: var(--text);
  background: #090f1e;
}

.segmented button.selected {
  border-color: rgba(46, 233, 138, 0.65);
  background: #102719;
  color: #bff9d8;
  font-weight: 900;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #263553;
  border-radius: 8px;
  padding: 12px;
  background: #0a1120;
}

.switch-row input {
  width: 24px;
  min-height: 24px;
  accent-color: var(--green);
}

.ai-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #263553;
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
  margin-bottom: 14px;
}

.ai-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.pulse {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--green) 0 30%, rgba(46, 233, 138, 0.22) 31% 100%);
  animation: pulse 1.8s ease-in-out infinite;
}

.variant-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.variant-actions button {
  color: #cfe3ff;
  font-size: 14px;
  font-weight: 800;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
}

.notice-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.notice-list:empty {
  display: none;
}

.notice {
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.08);
  color: #ffe6a3;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

.store-downloads {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.store-downloads button {
  min-height: 44px;
  border: 1px solid rgba(46, 233, 138, 0.48);
  border-radius: 8px;
  background: #0d2418;
  color: #bff9d8;
  font-weight: 900;
}

.summary-tile {
  border: 1px solid #263553;
  border-radius: 8px;
  background: #0a1120;
  padding: 10px;
}

.summary-tile.wide {
  grid-column: 1 / -1;
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.summary-tile strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}

.filter-list {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}

.filter-row {
  border: 1px solid #22304d;
  border-radius: 8px;
  background: #090f1e;
  padding: 10px;
}

.filter-row strong {
  display: block;
  margin-bottom: 5px;
}

.filter-row span {
  display: inline-block;
  margin: 2px 6px 2px 0;
  color: #c5d1ec;
  font-size: 12px;
}

.bottom-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  width: min(100%, 520px);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(5, 8, 19, 0.92);
  border-top: 1px solid #1c2946;
  backdrop-filter: blur(14px);
}

.bottom-actions button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #02100a;
  background: var(--green);
  font-weight: 900;
}

.bottom-actions .ghost {
  color: var(--text);
  background: #111a2e;
  border: 1px solid #2a385b;
}

.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.06);
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 12px rgba(46, 233, 138, 0.08);
  }
}

@media (min-width: 430px) {
  .segmented {
    grid-template-columns: repeat(3, 1fr);
  }
}
