:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #667085;
  --surface: #ffffff;
  --line: #d8dee8;
  --soft: #f4f7fb;
  --green: #138a5b;
  --green-dark: #0d6b46;
  --red: #c2413d;
  --orange: #f97316;
  --orange-dark: #c2410c;
  --amber: #b86b00;
  --blue: #2457c5;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, #eef3f8 0%, #f8fafc 48%, #eef3f8 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  width: 132px;
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.view {
  animation: enter 180ms ease-out;
}

#homeView {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 96px);
}

.hidden {
  display: none !important;
}

.hero-panel,
.status-band,
.confirm-panel,
.result-panel,
.busy-panel,
.info-panel {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel,
.confirm-panel,
.result-panel,
.busy-panel {
  padding: 24px;
}

.status-band {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  border-top: 5px solid var(--green);
}

.info-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 16px;
}

h1 {
  margin: 4px 0 10px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

#welcomeTitle {
  font-size: clamp(28px, 8vw, 38px);
}

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

.muted {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

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

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.field span {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  outline: none;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(19, 138, 91, 0.14);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.auth-tab {
  min-height: 42px;
  background: transparent;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.10);
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary.rent-cta {
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: center;
  min-height: 78px !important;
  background: var(--orange) !important;
  color: #fff !important;
  font-size: 23px;
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.28);
}

.primary:active {
  background: var(--green-dark);
}

.primary.rent-cta:active {
  background: var(--orange-dark);
}

.primary.danger {
  background: var(--red);
}

.secondary {
  background: #e8eef8;
  color: #173b84;
}

.map-cta {
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: center;
  min-height: 64px;
  background: #dfeafb;
}

.btn-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0.86;
  text-transform: uppercase;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.danger-action {
  background: var(--red) !important;
  color: #fff !important;
}

.logout-area {
  margin-top: auto;
  padding-top: 28px;
}

.logout-area button {
  width: 100%;
}

#scanStartBtn {
  min-height: 78px !important;
  background: var(--orange) !important;
  color: #fff !important;
  font-size: 23px;
}

#logoutBtn {
  background: var(--red) !important;
  color: #fff !important;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.scan-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.scan-head h1 {
  margin-bottom: 0;
}

#reader {
  overflow: hidden;
  width: 100%;
  min-height: 300px;
  border-radius: 8px;
  background: #05070b;
  border: 1px solid #1f2937;
}

.summary {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.summary dt {
  color: var(--muted);
  font-size: 14px;
}

.summary dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.pill {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.active {
  background: #e3f7ec;
  color: var(--green-dark);
}

.result-panel.success {
  border-top: 5px solid var(--green);
}

.result-panel.error {
  border-top: 5px solid var(--red);
}

.result-panel.warning {
  border-top: 5px solid var(--amber);
}

.busy-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-top: 50px;
}

.loader {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border: 5px solid #dbe4ef;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 488px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 8px;
  background: #111827;
  color: white;
  box-shadow: var(--shadow);
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .shell {
    padding-top: 34px;
  }

  .hero-panel,
  .confirm-panel,
  .result-panel,
  .busy-panel {
    padding: 30px;
  }
}

@media (max-width: 420px) {
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand img {
    width: 112px;
  }

  .status-band,
  .info-panel,
  .hero-panel,
  .confirm-panel,
  .result-panel,
  .busy-panel {
    border-radius: 8px;
  }

  .primary.rent-cta,
  #scanStartBtn {
    min-height: 74px !important;
    font-size: 21px;
  }
}
