:root {
  --bg: #eef3f5;
  --ink: #102027;
  --muted: #667783;
  --card: #ffffff;
  --line: #d9e2e7;
  --teal: #6f3df4;
  --blue: #7b3ff2;
  --amber: #b7791f;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-weight: 750;
}

button.ghost {
  color: var(--teal);
  background: #e8f5f3;
  border-color: #cce5e1;
}

.phone-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px calc(22px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  min-height: 280px;
  padding: 24px 18px;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 255, 255, 0.18) 0 62px, transparent 64px),
    linear-gradient(145deg, #7b3ff2, #5b22d6),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 300'%3E%3Crect width='420' height='300' fill='%230f766e'/%3E%3Cpath d='M30 220 C100 150 180 260 260 175 S360 150 420 96' fill='none' stroke='%23ffffff' stroke-width='18' stroke-linecap='round' opacity='.34'/%3E%3Ccircle cx='314' cy='119' r='28' fill='%23ffffff' opacity='.9'/%3E%3Cpath d='M73 86 h180 c26 0 49 17 57 42 l17 52 H46 l18-61 c6-20 17-33 9-33Z' fill='%23dff7f3' opacity='.9'/%3E%3Ccircle cx='103' cy='184' r='25' fill='%23102027'/%3E%3Ccircle cx='274' cy='184' r='25' fill='%23102027'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.brand-row,
.mini-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row span,
.mini-head span,
.hint,
small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.brand-row span {
  color: rgba(255, 255, 255, 0.8);
}

.app-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: var(--teal);
  background: #fff;
  font-weight: 900;
}

h1 {
  margin: 70px 0 10px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

p {
  margin: 0;
}

.hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
}

.card,
.balance,
.drive-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.compact-card {
  padding: 12px 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

#recaptcha-container {
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.card .primary {
  width: 100%;
  margin-top: 12px;
}

.status-line {
  min-height: 20px;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  line-height: 1.35;
}

.status-line.error {
  color: var(--red);
}

.hidden {
  display: none;
}

.mini-head {
  justify-content: space-between;
  min-height: 54px;
}

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

.icon-btn {
  width: 44px;
  padding: 0;
  font-size: 28px;
}

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

.grid2 label:nth-child(2) {
  grid-column: 1 / -1;
}

.tariff-list {
  display: grid;
  gap: 10px;
}

.tariff {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfe;
}

.tariff.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pay {
  min-height: 42px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.pay.selected {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.view-switch,
.mini-tabs {
  display: grid;
  gap: 8px;
}

.view-switch {
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.mini-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.view-switch button,
.mini-tabs button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: #fff;
}

.view-switch button.selected,
.mini-tabs button.selected {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.tariff strong {
  font-size: 17px;
}

.tariff span {
  color: var(--muted);
  font-size: 13px;
}

.sticky-action {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: 100%;
  margin-top: 14px;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.balance {
  color: #fff;
  background: #102027;
  border-color: #102027;
}

.balance.green {
  background: #11845b;
  border-color: #11845b;
}

.balance.yellow {
  background: #b7791f;
  border-color: #b7791f;
}

.balance.red {
  background: #b42318;
  border-color: #b42318;
}

.balance span,
.balance small {
  color: rgba(255, 255, 255, 0.72);
}

.balance strong {
  display: block;
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
}

.dash-hero {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #123337;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #102027, #0f766e);
}

.dash-hero span,
.dash-hero small {
  color: rgba(255, 255, 255, 0.74);
}

.dash-hero strong {
  display: block;
  margin: 8px 0;
  font-size: 38px;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.metric {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span,
.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.05;
}

.section-head {
  display: grid;
  gap: 10px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-height: 168px;
  margin-top: 12px;
  align-items: end;
}

.bar-col {
  display: grid;
  grid-template-rows: 22px 106px 22px;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.bar-value,
.bar-col span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: #edf4f6;
}

.bar-track div {
  width: 100%;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #7b3ff2, #0f766e);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(0, 1.25fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: right;
}

.mobile-progress {
  overflow: hidden;
  height: 10px;
  margin: 16px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.mobile-progress div {
  height: 100%;
  width: 0;
  background: #2dd4bf;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--amber);
  background: #fff7e6;
  font-size: 13px;
  font-weight: 800;
}

.pill.on {
  color: var(--teal);
  background: #e8f5f3;
}

.phone-map {
  position: relative;
  height: 170px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    #eaf2ef;
  background-size: 26px 26px;
}

.track {
  position: absolute;
  left: -15%;
  top: 78px;
  width: 130%;
  height: 26px;
  border-top: 3px dashed #75828c;
  transform: rotate(-12deg);
}

.pulse {
  position: absolute;
  left: 58%;
  top: 66px;
  width: 28px;
  height: 28px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 16px rgba(37, 99, 235, 0.14);
}

.drive-actions {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  margin-top: 12px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

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

.mini-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  font-size: 14px;
}

#mToast {
  position: fixed;
  right: 14px;
  bottom: 82px;
  left: 14px;
  display: none;
  max-width: 452px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  background: #102027;
  box-shadow: 0 12px 30px rgba(16, 32, 39, 0.25);
}

@media (max-width: 360px) {
  h1 {
    font-size: 28px;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }
}
