:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #1d232a;
  --muted: #6c747d;
  --line: #e6e9ec;
  --accent: #1e6f5c;
  --accent-soft: #eaf5f1;
  --danger: #9f2f2f;
  --danger-soft: #fff0f0;
  --shadow: 0 10px 30px rgba(27, 39, 48, .08);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(30,111,92,.25);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  background: rgba(246, 247, 248, .94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(230, 233, 236, .8);
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
}
h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; }

.content { padding: 18px 16px calc(104px + env(safe-area-inset-bottom)); }

.welcome-card {
  padding: 22px;
  background: linear-gradient(145deg, #ffffff, #edf7f3);
  border: 1px solid #deebe6;
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.welcome-card h2 { margin: 0 0 8px; font-size: 25px; }
.welcome-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.quick-card {
  min-height: 132px;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(27,39,48,.045);
  cursor: pointer;
}
.quick-card:active { transform: scale(.985); }
.quick-card .emoji { font-size: 28px; margin-bottom: 18px; display: block; }
.quick-card strong { display: block; font-size: 16px; line-height: 1.22; }
.quick-card small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.35; }
.quick-card.alert { background: var(--danger-soft); border-color: #f4cccc; }

.section-label {
  margin: 26px 2px 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.list-card .emoji { font-size: 23px; width: 34px; text-align: center; }
.list-card .copy { flex: 1; min-width: 0; }
.list-card strong { display: block; }
.list-card small { color: var(--muted); line-height: 1.35; display: block; margin-top: 3px; }
.list-card .chevron { color: #98a0a8; font-size: 22px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 30;
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.nav-item {
  border: 0;
  background: transparent;
  color: #7b838b;
  padding: 7px 4px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.nav-icon { display: block; font-size: 23px; line-height: 1; margin-bottom: 4px; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 26px;
  color: var(--accent);
  cursor: pointer;
}
.hidden { display: none !important; }

.install-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  margin-top: 14px;
  padding: 14px 15px;
  border: 1px solid #cfe4dc;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.install-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-size: 24px;
  font-weight: 800;
}
.install-card-copy { flex: 1; min-width: 0; }
.install-card-copy strong, .install-card-copy small { display: block; }
.install-card-copy small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.install-card .chevron { color: var(--accent); font-size: 24px; }

.install-open { overflow: hidden; }
.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 31, .48);
  backdrop-filter: blur(3px);
}
.install-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 45px rgba(20, 27, 31, .2);
}
.install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #f0f2f3;
  color: #5e666d;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.install-app-icon { width: 62px; height: 62px; margin-bottom: 14px; }
.install-app-icon img { display: block; width: 100%; height: 100%; border-radius: 17px; }
.install-panel h2 { margin: 0 48px 7px 0; font-size: 23px; }
.install-lead { margin: 0; color: var(--muted); line-height: 1.5; }
.install-steps { margin: 16px 0; padding: 15px 16px; border-radius: 16px; background: #f6f8f8; }
.install-steps ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.install-steps li, .install-steps p { line-height: 1.45; }
.install-steps p { margin: 0; }

.back-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  padding: 6px 0 16px;
  cursor: pointer;
}
.section-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.section-emoji { font-size: 34px; }
.section-kicker { font-size: 11px; letter-spacing: .08em; font-weight: 800; color: var(--accent); text-transform: uppercase; }
.section-title { margin: 4px 0 6px; font-size: 25px; }
.section-subtitle { margin: 0; color: var(--muted); line-height: 1.45; }
.section-body { margin-top: 14px; }

.info-block {
  padding: 17px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.info-block h3 { margin: 0 0 9px; font-size: 17px; }
.info-block p { margin: 0; color: #444c54; line-height: 1.55; }
.info-block p + p { margin-top: 8px; }

.action-row { display: grid; gap: 10px; margin-top: 13px; }
.action-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.action-button.secondary { background: var(--accent-soft); color: var(--accent); }
.action-button.danger { background: var(--danger); }
.action-button.disabled { background: #eef0f2; color: #8d949a; pointer-events: none; }
.pending-action {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 13px 15px;
  border: 1px dashed #cdd3d7;
  border-radius: 14px;
  background: #f7f8f9;
  color: #626b73;
}
.pending-action strong { font-size: 14px; }
.pending-action small { color: var(--muted); line-height: 1.35; }

.checklist { display: grid; gap: 9px; margin-top: 8px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: #fafbfb;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
}
.check-item input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.check-item span { line-height: 1.4; }
.check-item.done span { color: #7a8289; text-decoration: line-through; }

.progress-wrap { margin-top: 12px; }
.progress-line { height: 9px; background: #edf0f1; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .2s ease; }
.progress-caption { margin-top: 7px; font-size: 12px; color: var(--muted); }

.phase-grid { display: grid; gap: 12px; }
.phase-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.phase-card:hover { border-color: #b8d3ca; }
.phase-card:active { transform: scale(.99); }
.phase-card.selected { border: 2px solid var(--accent); background: var(--accent-soft); }
.phase-copy { flex: 1; min-width: 0; }
.phase-card strong { display: block; font-size: 17px; }
.phase-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.phase-status {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #eef1f2;
  color: #596169;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.phase-card.selected .phase-status { background: var(--accent); color: white; }
.selected-route-head {
  display: grid;
  gap: 4px;
  margin: 18px 0 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--accent);
  color: white;
}
.selected-route-head small { font-weight: 800; opacity: .82; text-transform: uppercase; letter-spacing: .06em; }
.selected-route-head strong { font-size: 18px; }
.selected-route-head span { font-size: 13px; opacity: .9; }

.access-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 15px;
  border: 1px solid #d8e3e8;
  border-radius: 18px;
  background: #f8fbfc;
}
.access-status.participant { border-color: #cde2da; background: var(--accent-soft); }
.access-status-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #e8f1f5;
  color: #4f6c79;
  font-weight: 900;
  font-size: 20px;
}
.access-status.participant .access-status-icon { background: var(--accent); color: white; }
.access-status-copy { display: grid; gap: 2px; min-width: 0; }
.access-status-copy small { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.access-status-copy strong { font-size: 16px; line-height: 1.3; }
.access-status-copy span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.access-link {
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.phase-card.locked { background: #f5f6f7; border-style: dashed; }
.phase-card.locked .phase-copy { opacity: .72; }
.phase-card.locked .phase-status { background: #e5e8ea; color: #687179; }

.access-welcome { background: linear-gradient(145deg, #ffffff, #f0f6f9); border-color: #d9e7ed; }
.access-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 19px;
  border: 1px solid #d8e3e8;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}
.access-lock {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #edf4f7;
  font-size: 22px;
}
.access-panel-copy small { color: #59727e; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.access-panel-copy h3 { margin: 4px 0 7px; font-size: 21px; }
.access-panel-copy p { margin: 0; color: var(--muted); line-height: 1.5; }
.access-form { display: grid; gap: 9px; }
.access-form label { font-size: 13px; font-weight: 800; }
.access-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cbd5da;
  border-radius: 14px;
  background: #fbfcfd;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.access-form input:focus { border-color: #83b5a7; box-shadow: 0 0 0 3px rgba(30,111,92,.08); }
.access-form input[aria-invalid="true"] { border-color: #cf7777; }
.access-feedback { min-height: 20px; font-size: 13px; font-weight: 750; line-height: 1.4; }
.access-feedback.error { color: var(--danger); }
.access-feedback.success { color: var(--accent); }
.demo-code { padding: 11px 13px; border-radius: 13px; background: #fff8da; color: #665613; font-size: 13px; }
.demo-code strong { letter-spacing: .08em; }
.access-safety { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.access-search-note { padding: 12px 14px; border-radius: 14px; background: #edf4f7; color: #536b76; font-size: 13px; line-height: 1.4; }

.search-box {
  position: sticky;
  top: 86px;
  z-index: 10;
  padding: 8px 0 13px;
  background: var(--bg);
}
.search-input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  padding: 0 15px;
  color: var(--text);
  outline: none;
}
.search-input:focus { border-color: #9ecabd; box-shadow: 0 0 0 3px rgba(30,111,92,.08); }
.empty-state { padding: 28px 18px; color: var(--muted); text-align: center; }

.note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f7f8;
  color: #565e66;
  font-size: 13px;
  line-height: 1.45;
}

.doctor-card { display: grid; gap: 8px; }
.quote {
  padding: 12px 14px;
  border-left: 3px solid #c7dcd5;
  background: #f8fbfa;
  border-radius: 10px;
  color: #4c545c;
  line-height: 1.45;
}

.clinic-picker { display: grid; gap: 14px; }
.picker-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.picker-step > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 800;
}
.picker-step strong, .picker-step small { display: block; }
.picker-step small { margin-top: 2px; color: var(--muted); }
.city-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.city-button {
  min-height: 50px;
  padding: 11px 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}
.city-button.selected { border-color: #80b8a8; background: var(--accent-soft); color: var(--accent); }
.clinic-picker-result:empty { display: none; }
.clinic-step { margin: 4px 0 10px; }
.clinic-option-grid { display: grid; gap: 9px; margin-bottom: 12px; }
.clinic-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.clinic-option.selected { border-color: #80b8a8; box-shadow: 0 0 0 2px rgba(30,111,92,.08); }
.clinic-option span { color: var(--accent); font-size: 22px; }
.clinic-details {
  padding: 17px;
  background: var(--surface);
  border: 1px solid #d8e8e2;
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(27,39,48,.055);
}
.clinic-choice-title { display: flex; align-items: flex-start; gap: 11px; }
.clinic-choice-title small { display: block; margin-bottom: 3px; color: var(--muted); }
.clinic-choice-title h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.clinic-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}
.clinic-full-name { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.clinic-note { margin-bottom: 2px; }
.clinic-locations { display: grid; gap: 12px; margin-top: 14px; }
.clinic-location { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfc; }
.clinic-location-head { display: flex; align-items: flex-start; gap: 10px; }
.location-pin { color: var(--accent); font-size: 18px; line-height: 1.1; }
.clinic-location h4 { margin: 0 0 4px; font-size: 16px; }
.clinic-address { margin: 0; color: var(--text); font-weight: 700; line-height: 1.4; }
.clinic-hint { margin: 11px 0 0; color: #505960; font-size: 14px; line-height: 1.48; }
.clinic-actions { margin-top: 13px; }
.source-date { margin: 12px 1px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

.app-error {
  margin: 14px 16px 0;
  padding: 14px 16px;
  border: 1px solid #efbaba;
  border-radius: 14px;
  background: var(--danger-soft);
  color: #7a2525;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 112px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 21px; }
  .content { padding-left: 13px; padding-right: 13px; }
  .welcome-card { padding: 19px; border-radius: 22px; }
  .welcome-card h2 { font-size: 23px; }
}

@media (max-width: 430px) {
  .city-grid { grid-template-columns: 1fr; }
  .phase-card { align-items: flex-start; gap: 12px; }
  .phase-status { min-width: 78px; }
  .access-status { grid-template-columns: auto minmax(0, 1fr); }
  .access-link { grid-column: 1 / -1; width: 100%; }
}
