/* HeavyPark Driver — Mobile Mock
   Responsive app emulation with safe areas
*/

:root {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-card: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --header-h: 52px;
  --tab-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ----- Offline banner ----- */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + var(--safe-top));
  background: var(--danger);
  color: #fff;
  text-align: center;
  font-weight: 500;
  font-size: 0.9375rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease-out;
}
.offline-banner[hidden] {
  display: none;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ----- Screens ----- */
.screen {
  display: none;
  min-height: 100dvh;
  flex: 1;
}

.screen--active {
  display: flex;
}

/* ----- Welcome ----- */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  padding-top: calc(3rem + var(--safe-top));
  padding-bottom: calc(2rem + var(--safe-bottom));
}

.welcome-brand {
  text-align: center;
  margin-bottom: 3rem;
}

.brand-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.5rem;
}

.brand-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.brand-tagline {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 400;
}

.welcome-actions {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ----- Buttons ----- */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 48px;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn--outline:hover {
  background: rgba(245, 158, 11, 0.15);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn--danger.btn--outline {
  border-color: #dc3545;
  color: #dc3545;
}

.btn--danger.btn--outline:hover {
  background: rgba(220, 53, 69, 0.15);
}

.btn--full {
  width: 100%;
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 44px;
}

/* ----- App Shell ----- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.header {
  padding-top: var(--safe-top);
  padding: calc(0.75rem + var(--safe-top)) 1rem 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ----- Content ----- */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 1rem);
  -webkit-overflow-scrolling: touch;
}

/* ----- Views ----- */
.view {
  display: none;
}

.view--active {
  display: block;
}

/* ----- Vehicle Switcher ----- */
.vehicle-switcher {
  margin-bottom: 1rem;
}

.vehicle-switcher-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vehicle-switcher-scroll::-webkit-scrollbar {
  display: none;
}

.vehicle-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-width: 140px;
}

.vehicle-chip:hover {
  background: var(--bg-card);
}

.vehicle-chip--active {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

.vehicle-chip-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.vehicle-chip-plate {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ----- Active Session Banner ----- */
.active-session-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.banner-lot {
  font-weight: 600;
  font-size: 1rem;
}

.banner-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.banner-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
}

.banner-action {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ----- QR Section ----- */
.qr-section {
  text-align: center;
  padding: 1rem 0;
}

.qr-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: inline-block;
  margin-bottom: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.qr-container canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 280px;
  max-height: 280px;
}

.qr-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge--sm {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
}

.plan-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ----- History ----- */
.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.month-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.month-nav {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.month-nav:hover {
  background: var(--bg-card);
}

.month-label {
  font-weight: 600;
}

.history-lot-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.history-lot-filter .filter-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-lot-filter select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 1rem;
  cursor: pointer;
}

.session-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-lot {
  font-weight: 600;
}

.session-times {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.session-duration {
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', monospace;
}

.session-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.session-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-cost {
  font-weight: 600;
}

/* ----- Account ----- */
.account-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.plan-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.plan-card .plan-name {
  font-size: 1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.plan-card .badge {
  margin-bottom: 0.5rem;
}

.plan-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.plan-actions {
  display: flex;
  gap: 0.5rem;
}

.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.vehicle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.vehicle-item:hover {
  background: var(--bg-card);
}

.vehicle-detail-info {
  margin-bottom: 1rem;
}

.vehicle-detail-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.vehicle-detail-meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.vehicle-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.vehicle-item-name {
  font-size: 0.9375rem;
}

.payment-methods {
  margin-bottom: 0.75rem;
}

.payment-card {
  min-height: 44px;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.payment-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.payment-card-default {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-height: 44px;
}

.payment-card-default input {
  cursor: pointer;
}

.payment-card-default span {
  pointer-events: none;
}

.payment-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.payment-card-remove {
  color: var(--text-muted);
}

.payment-card-remove:hover {
  color: #dc3545;
}

.payment-card-type {
  font-weight: 600;
}

.payment-card-number {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.profile-info {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.profile-info p {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

#btn-logout {
  margin-top: 1.5rem;
}

/* ----- Tab Bar ----- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg-elevated);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
  min-height: var(--tab-h);
  transition: color 0.2s;
}

.tab-item:hover {
  color: var(--text);
}

.tab-item--active {
  color: var(--accent);
}

.tab-icon {
  font-size: 1.25rem;
}

.tab-label {
  font-weight: 500;
}

/* ----- Links ----- */
.link-daypass {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 1rem;
}

.link-daypass:hover {
  text-decoration: underline;
}

.link-small {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
}

/* ----- Form screens ----- */
.form-screen {
  flex: 1;
  padding: 1.5rem;
  padding-top: calc(1rem + var(--safe-top));
  padding-bottom: calc(2rem + var(--safe-bottom));
  overflow-y: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input {
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.billing-address-section {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----- Vehicle type dropdown with icons ----- */
.vehicle-type-dropdown {
  position: relative;
}

.vehicle-type-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s;
}

.vehicle-type-trigger:hover,
.vehicle-type-trigger:focus {
  outline: none;
  border-color: var(--accent);
}

.vehicle-type-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.vehicle-type-label {
  flex: 1;
}

.vehicle-type-chevron {
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.vehicle-type-dropdown.open .vehicle-type-chevron {
  transform: rotate(180deg);
}

.vehicle-type-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
  overflow: hidden;
}

.vehicle-type-options[hidden] {
  display: none;
}

.vehicle-type-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.vehicle-type-opt:hover,
.vehicle-type-opt:focus {
  background: var(--bg-card);
  outline: none;
}

.vehicle-type-opt.selected {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

.strength-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
}

.strength-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.2s, background 0.2s;
}

.strength-fill--weak { background: var(--danger); }
.strength-fill--fair { background: #f59e0b; }
.strength-fill--good { background: #84cc16; }
.strength-fill--strong { background: var(--success); }

.otp-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.otp-digit {
  width: 2.75rem;
  min-width: 44px;
  height: 2.75rem;
  min-height: 44px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.resend-area {
  margin-bottom: 1.5rem;
}

.resend-timer {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.resend-timer[hidden] {
  display: none;
}

.resend-btn {
  margin-top: 0;
}

.resend-btn[hidden] {
  display: none;
}

/* ----- Plan cards (onboarding) ----- */
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.plan-card-select {
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius);
  min-height: 44px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-card-select:hover,
.plan-card-select.selected {
  border-color: var(--accent);
}

.plan-card-select-content {
  flex: 1;
}

.plan-features-list {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.plan-select-btn {
  align-self: flex-start;
}

#plan-management-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.plan-card-select .plan-price {
  font-size: 1.25rem;
  font-weight: 700;
}

.link-plan-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  color: var(--accent);
  font-size: 0.9375rem;
}

/* ----- Confirmation ----- */
.confirmation-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.qr-reveal {
  margin-bottom: 1.5rem;
}

.qr-reveal-in {
  animation: qrReveal 0.5s ease-out;
}

@keyframes qrReveal {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirmation-screen h2 {
  margin-bottom: 0.5rem;
}

.confirmation-vehicle {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.confirmation-instructions {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ----- Day Pass ----- */
.lot-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lot-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 1rem;
  cursor: pointer;
}

.lot-card:hover {
  background: var(--bg-card);
}

.lot-card-name {
  font-weight: 600;
}

.lot-card-address {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.lot-card-price {
  font-size: 0.875rem;
  color: var(--accent);
  margin-top: 0.25rem;
}

.daypass-payment-summary {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.daypass-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.daypass-summary-row:last-child {
  margin-bottom: 0;
}

.daypass-summary-total {
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.daypass-wallet-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn--wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  font-weight: 600;
}

.btn--apple-pay {
  background: #000;
  color: #fff;
  border: none;
}

.btn--apple-pay:hover {
  background: #333;
}

.btn--google-pay {
  background: #fff;
  color: #1a73e8;
  border: 2px solid #dadce0;
}

.btn--google-pay:hover {
  background: #f8f9fa;
}

.btn--google-pay .wallet-icon {
  font-weight: 700;
  font-size: 1.125rem;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.daypass-pay-divider {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

/* ----- Skeleton loaders ----- */
.app-skeletons {
  display: none;
  padding: 1.5rem 1rem;
}

.content--loading .app-skeletons {
  display: block;
}

.content--loading .view {
  opacity: 0;
  pointer-events: none;
  min-height: 0;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-chips {
  height: 48px;
  margin-bottom: 1rem;
}

.skeleton-banner {
  height: 80px;
  margin-bottom: 1.5rem;
}

.skeleton-qr {
  width: 280px;
  height: 280px;
  margin: 0 auto 1rem;
}

.skeleton-label {
  height: 24px;
  width: 180px;
  margin: 0 auto 0.5rem;
}

.daypass-qr-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.daypass-instructions {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
}

.daypass-sms {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----- Overlays ----- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.overlay-panel h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.overlay-session {
  position: relative;
}

.session-detail-content {
  margin-bottom: 1rem;
}

.session-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.session-map-placeholder {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  margin-bottom: 1rem;
}

.session-map-iframe {
  width: 100%;
  height: 140px;
  border: none;
  display: block;
}

.session-map-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.session-map-link:hover {
  text-decoration: underline;
}

.session-qr-tab {
  text-align: center;
  padding: 1rem 0;
}

.qr-small {
  display: inline-block;
  padding: 0.75rem;
}

.qr-small canvas {
  max-width: 120px;
  max-height: 120px;
}

/* ----- History detail ----- */
.history-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ----- Badges ----- */
.badge--suspended {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge--disputed {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

.badge--completed {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.badge--cancelled {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.badge--pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

/* ----- Confirm modal ----- */
.confirm-message {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.overlay-panel--sm {
  max-width: 360px;
}

/* ----- Empty state ----- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

/* ----- Settings ----- */
.settings-block {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row select {
  background: var(--bg);
  border: none;
  color: var(--text);
  font-family: inherit;
}

/* ----- Toggle list ----- */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.toggle-row input {
  accent-color: var(--accent);
}

/* ----- Invoice list ----- */
.invoice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.invoice-item a {
  color: var(--accent);
  font-size: 0.875rem;
}

.invoice-item[role="button"] {
  cursor: pointer;
}

.invoice-item-chevron {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.invoice-detail-info {
  margin-bottom: 1.5rem;
}

.invoice-detail-number {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.invoice-detail-period,
.invoice-detail-total,
.invoice-detail-meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.invoice-detail-total {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ----- Tab bar (fix) ----- */
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
}

.tab-item span {
  font-weight: 500;
}

/* ----- Pull to refresh ----- */
.pull-refresh-indicator {
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.2s ease-out;
}

.pull-refresh-indicator.pulling {
  overflow: visible;
}

.pull-refresh-indicator.refreshing .pull-refresh-text::before {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  border: 2px solid var(--text-muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: pull-refresh-spin 0.8s linear infinite;
  vertical-align: -0.2em;
}

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

.pull-refresh-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pull-indicator {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.banner-cost {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ----- Responsive: tablet / desktop ----- */
@media (min-width: 480px) {
  .app {
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

@media (min-width: 768px) {
  .app {
    max-width: 420px;
    margin: 2rem auto;
    min-height: 90dvh;
    border-radius: 24px;
    overflow: hidden;
  }
}
