/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #f4f8f6;
  --bg-card:   #ffffff;
  --bg-input:  #edf2ef;
  --bg-raised: #e5ede9;
  --border:    rgba(0,0,0,0.08);
  --border-md: rgba(0,0,0,0.13);

  --green:      #0891b2;
  --green-dim:  #0e7490;
  --green-glow: rgba(8,145,178,0.15);
  --green-bg:   rgba(8,145,178,0.10);

  --amber:      #c47d0a;
  --amber-bg:   rgba(196,125,10,0.10);
  --red:        #d94040;
  --red-bg:     rgba(217,64,64,0.10);
  --blue:       #2173cc;
  --blue-bg:    rgba(33,115,204,0.10);

  --text:       #1a2420;
  --text-2:     #4a6558;
  --text-3:     #8aaa9e;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h:       68px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  /* Prevent layout shift from scrollbar */
  scrollbar-width: none;
}
body::-webkit-scrollbar { display: none; }

/* ── App Shell ─────────────────────────────────────────────────────────────── */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

.page {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  min-height: 100dvh;
}

.page--full {
  padding-bottom: 0;
}

/* ── Bottom Nav ────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(244,248,246,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg { transition: transform 0.2s; }
.nav-item:active svg { transform: scale(0.88); }

.nav-label {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-3);
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.nav-item.active .nav-label { color: var(--green); }
.nav-item.active svg path,
.nav-item.active svg rect,
.nav-item.active svg circle { stroke: var(--green); }

.nav-pip {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

/* ── Top Bar ───────────────────────────────────────────────────────────────── */
.topbar {
  padding: calc(var(--safe-top) + 12px) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar--transparent {
  background: transparent;
  border-bottom: none;
  position: absolute;
  width: 100%;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.topbar-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card--raised {
  background: var(--bg-raised);
  border-color: var(--border-md);
}

.card--green {
  background: linear-gradient(135deg, #bfe6f5 0%, #a8dff0 50%, #b8ecf5 100%);
  border-color: rgba(8,145,178,0.25);
  position: relative;
  overflow: hidden;
}

.card--green::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(8,145,178,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Hero Header (Home) ────────────────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(180deg, #d0eef7 0%, #f4f8f6 100%);
  padding: calc(var(--safe-top) + 16px) 20px 28px;
  position: relative;
  overflow: hidden;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green-dim), transparent);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(8,145,178,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,145,178,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.hero-greeting {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 2px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dim), #065f78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-decoration: none;
}

.hero-limit-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.hero-amount {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.hero-amount span {
  font-size: 20px;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0;
}

.hero-sublabel {
  font-size: 12px;
  color: var(--text-3);
}

.limit-bar-wrap {
  margin-top: 16px;
}

.limit-bar {
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.limit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ── Quick Actions ─────────────────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 10px;
  padding: 20px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.quick-actions::-webkit-scrollbar { display: none; }

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.qa-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.qa-btn:active .qa-icon {
  background: var(--green-bg);
  border-color: rgba(8,145,178,0.3);
  transform: scale(0.93);
}

.qa-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Section Headers ───────────────────────────────────────────────────────── */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-action {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
  text-decoration: none;
}

/* ── Loan Cards ────────────────────────────────────────────────────────────── */
.loan-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.loan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.loan-card:active {
  background: var(--bg-raised);
  border-color: var(--border-md);
}

.loan-card--overdue {
  border-color: rgba(255,87,87,0.25);
  background: rgba(255,87,87,0.04);
}

.loan-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.loan-purpose {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.loan-due {
  font-size: 12px;
  color: var(--text-2);
}

.loan-due--overdue { color: var(--red); }

.loan-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  text-align: right;
}

.loan-amount--overdue { color: var(--red); }

.progress-wrap { margin-top: 14px; }

.progress-track {
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
}

.progress-fill--overdue {
  background: linear-gradient(90deg, #cc3333, var(--red));
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge--active   { background: var(--green-bg);  color: var(--green); }
.badge--overdue  { background: var(--red-bg);    color: var(--red);   }
.badge--pending  { background: var(--amber-bg);  color: var(--amber); }
.badge--closed   { background: rgba(138,158,148,0.1); color: var(--text-2); }
.badge--approved { background: var(--blue-bg);   color: var(--blue);  }

/* ── Score Ring ────────────────────────────────────────────────────────────── */
.score-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
}

.score-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.score-ring svg {
  transform: rotate(-135deg);
}

.score-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.score-max {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.score-label {
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
}

.score-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 20px;
}

.score-stat {
  background: var(--bg-card);
  padding: 16px 12px;
  text-align: center;
}

.score-stat-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.score-stat-key {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Score Bars ────────────────────────────────────────────────────────────── */
.score-bar-item {
  margin-bottom: 16px;
}

.score-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.score-bar-label { color: var(--text-2); }
.score-bar-value { color: var(--text); font-weight: 600; }

.score-bar-track {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 6px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: rgba(8,145,178,0.5);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.08);
}

.form-input::placeholder { color: var(--text-3); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%234a5e54' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}

/* ── PIN Input ─────────────────────────────────────────────────────────────── */
.pin-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pin-cell {
  width: 48px;
  height: 56px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.2s;
}

.pin-cell.active { border-color: rgba(8,145,178,0.5); }
.pin-cell.filled::after { content: '●'; font-size: 12px; }

/* ── Sliders ───────────────────────────────────────────────────────────────── */
.slider-wrap { padding: 4px 0; }

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.slider-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
}

.slider-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.10);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(8,145,178,0.15);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

input[type=range]:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(8,145,178,0.25);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
}

.btn:active { transform: scale(0.97); }

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-md);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(255,87,87,0.2);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 13px;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}

/* ── Loan Calculator Card ──────────────────────────────────────────────────── */
.calc-card {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  border: 1px solid rgba(8,145,178,0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  margin: 0 20px;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
}

.calc-amount {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1;
}

.calc-amount sup {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0.7;
  margin-right: 4px;
}

.calc-meta {
  display: flex;
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: 16px;
}

.calc-meta-item {
  flex: 1;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.25);
}

.calc-meta-item:last-child { border-right: none; }

.calc-meta-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.calc-meta-key {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Installment List ──────────────────────────────────────────────────────── */
.installment-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.installment-item:last-child { border-bottom: none; }

.inst-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.inst-number--paid {
  background: var(--green-bg);
  border-color: rgba(8,145,178,0.3);
  color: var(--green);
}

.inst-number--overdue {
  background: var(--red-bg);
  border-color: rgba(255,87,87,0.3);
  color: var(--red);
}

.inst-info { flex: 1; }

.inst-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.inst-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.inst-amount {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* ── Notifications ─────────────────────────────────────────────────────────── */
.notif-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item.unread { background: rgba(8,145,178,0.05); }
.notif-item:active { background: var(--bg-card); }

.notif-dot-wrap {
  padding-top: 4px;
  flex-shrink: 0;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.notif-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.notif-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}

/* ── Alert Banners ─────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}

.alert--success { background: var(--green-bg);  color: var(--green); border: 1px solid rgba(8,145,178,0.25); }
.alert--warning { background: var(--amber-bg);  color: var(--amber); border: 1px solid rgba(196,125,10,0.25); }
.alert--danger  { background: var(--red-bg);    color: var(--red);   border: 1px solid rgba(217,64,64,0.25);  }
.alert--info    { background: var(--blue-bg);   color: var(--blue);  border: 1px solid rgba(33,115,204,0.25); }

.alert-icon { flex-shrink: 0; margin-top: 1px; }

/* ── Steps ─────────────────────────────────────────────────────────────────── */
.steps-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 0;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1.5px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--green-bg);
  border-color: var(--green-dim);
  color: var(--green);
}

.step-dot.done {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  transition: background 0.3s;
}

.step-line.done { background: var(--green-dim); }

/* ── Purpose Tags ──────────────────────────────────────────────────────────── */
.purpose-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purpose-tag {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.purpose-tag.selected {
  background: var(--green-bg);
  border-color: rgba(8,145,178,0.4);
  color: var(--green);
}

/* ── Profile ───────────────────────────────────────────────────────────────── */
.profile-header {
  padding: calc(var(--safe-top) + 32px) 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #d0eef7 0%, var(--bg) 100%);
}

.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dim), #065f78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  border: 3px solid rgba(8,145,178,0.3);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.profile-phone {
  font-size: 14px;
  color: var(--text-2);
  margin-top: -4px;
}

.menu-group { margin-bottom: 8px; }

.menu-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-card); }

.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-label {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.menu-arrow { color: var(--text-3); }

/* ── Login / Auth ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(8,145,178,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.auth-brand {
  padding: calc(var(--safe-top) + 40px) 28px 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.auth-headline {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.auth-headline em {
  color: var(--green);
  font-style: normal;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

.auth-form {
  padding: 36px 28px;
  flex: 1;
}

.auth-footer {
  padding: 16px 28px calc(var(--safe-bottom) + 24px);
  text-align: center;
}

.auth-footer-text {
  font-size: 13px;
  color: var(--text-2);
}

.auth-footer-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

/* ── Empty States ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.empty-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── Bottom Sheet ──────────────────────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,36,32,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border-md);
  padding: 12px 24px calc(var(--safe-bottom) + 28px);
  z-index: 201;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-md);
  border-radius: 2px;
  margin: 0 auto 20px;
}

/* ── Review table ──────────────────────────────────────────────────────────── */
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.review-row:last-child { border-bottom: none; }
.review-key { color: var(--text-2); }
.review-val { color: var(--text); font-weight: 600; }
.review-val--green { color: var(--green); }

/* ── Utility ───────────────────────────────────────────────────────────────── */
.px-20  { padding-left: 20px; padding-right: 20px; }
.py-16  { padding-top: 16px; padding-bottom: 16px; }
.mt-20  { margin-top: 20px; }
.mt-12  { margin-top: 12px; }
.mt-8   { margin-top: 8px; }
.gap-10 { gap: 10px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-2); font-size: 13px; }
.text-tiny   { font-size: 11px; color: var(--text-3); }
.font-display { font-family: var(--font-display); }
.fw-700 { font-weight: 700; }
.color-green { color: var(--green); }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(8,145,178,0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Pull to refresh indicator ─────────────────────────────────────────────── */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 0.2s;
  font-size: 12px;
  color: var(--green);
  gap: 8px;
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
}

.animate-in-1 { animation-delay: 0.05s; }
.animate-in-2 { animation-delay: 0.10s; }
.animate-in-3 { animation-delay: 0.15s; }
.animate-in-4 { animation-delay: 0.20s; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 390px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

.toast--success { border-left: 3px solid var(--green); color: var(--green); }
.toast--error   { border-left: 3px solid var(--red);   color: var(--red);   }
.toast--info    { border-left: 3px solid var(--blue);  color: var(--blue);  }
