/* Rodibio — calm medical prototype */
:root {
  --rose: #bd8783;
  --rose-soft: #f3e6e4;
  --sage: #aac2af;
  --sage-soft: #e8f0ea;
  --mist: #ced5ce;
  --mist-soft: #f0f3f0;
  --ink: #2c3330;
  --muted: #6b756f;
  --line: #e4e9e4;
  --white: #ffffff;
  --bg: #f7f8f6;
  --danger: #c45c5c;
  --danger-soft: #fceeee;
  --ok: #4a8f6a;
  --warn: #c4923a;
  --shadow: 0 8px 24px rgba(44, 51, 48, 0.08);
  --shadow-sm: 0 2px 10px rgba(44, 51, 48, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --header-h: 60px;
  --footer-h: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI", "SF Pro Display", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: #1a1e1c;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

a {
  color: var(--rose);
  text-decoration: none;
}

#app {
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 1;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
}

.screen.overlay {
  z-index: 20;
  background: var(--bg);
}

/* Role select */
#screen-role {
  background:
    radial-gradient(120% 80% at 10% 0%, var(--rose-soft), transparent 55%),
    radial-gradient(100% 70% at 100% 100%, var(--sage-soft), transparent 50%),
    var(--bg);
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}

.brand {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
}

.brand span {
  color: var(--rose);
}

.tagline {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 48px;
  line-height: 1.45;
}

.role-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.role-btn > * {
  pointer-events: none;
}

.role-btn:active {
  transform: scale(0.98);
}

.role-btn .icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.role-btn.midwife .icon {
  background: var(--rose-soft);
}

.role-btn.patient .icon {
  background: var(--sage-soft);
}

.role-btn__text {
  display: block;
  min-width: 0;
}

.role-btn strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.role-btn small {
  color: var(--muted);
}

/* App shell */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  z-index: 12;
  pointer-events: none;
  transition:
    background 0.25s ease,
    backdrop-filter 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.app-header > * {
  pointer-events: auto;
}

.app-header.is-scrolled {
  background: rgba(247, 248, 246, 0.12);
  backdrop-filter: blur(2px) saturate(1.3);
  -webkit-backdrop-filter: blur(2px) saturate(1.3);
  border-bottom-color: rgba(44, 51, 48, 0.05);
  box-shadow:
    0 10px 28px rgba(44, 51, 48, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  background: var(--rose);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar.has-photo {
  background: var(--mist-soft);
}

.avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 0.7rem;
}

.avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 1.1rem;
}

.header-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--ink);
  font-size: 1.25rem;
}

.icon-btn:active {
  background: var(--mist-soft);
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--header-h) + 8px) 16px calc(var(--footer-h) + 16px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}

.app-content.no-footer {
  padding-top: calc(var(--header-h) + 8px);
  padding-bottom: 24px;
}

.app-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 0 14px calc(12px + var(--safe-b));
  pointer-events: none;
  background: transparent;
  border: none;
  height: auto;
  min-height: calc(var(--footer-h) + var(--safe-b));
}

.footer-dock {
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(2px) saturate(1.2);
  -webkit-backdrop-filter: blur(2px) saturate(1.2);
  box-shadow:
    0 10px 28px rgba(44, 51, 48, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(255, 255, 255, 0.65);
  flex: 1;
  max-width: 280px;
}

.footer-dock--wide {
  max-width: none;
  flex: 1;
}

.footer-fab {
  pointer-events: auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(2px) saturate(1.2);
  -webkit-backdrop-filter: blur(2px) saturate(1.2);
  box-shadow:
    0 10px 28px rgba(44, 51, 48, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.1;
}

.footer-fab .tab-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--rose);
  font-weight: 400;
}

.footer-fab:active {
  transform: scale(0.96);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab .tab-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.tab.active {
  color: var(--rose);
  background: rgba(189, 135, 131, 0.12);
}

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

.tab--demo {
  color: var(--rose);
  border: 1px dashed rgba(189, 135, 131, 0.45);
  background: rgba(189, 135, 131, 0.06);
}

.tab--demo .tab-demo-label {
  font-size: 0.58rem;
  line-height: 1.15;
  max-width: 5.2em;
  text-align: center;
}

.tab--demo:active {
  background: rgba(189, 135, 131, 0.14);
}

/* Cards & sections */
.section {
  margin-bottom: 22px;
  animation: fadeUp 0.4s ease both;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  justify-content: space-between;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease;
  border-left: 4px solid transparent;
  position: relative;
}

.card-row:active {
  transform: scale(0.985);
}

.card-row.prio-critical {
  border-left-color: var(--rose);
  background: linear-gradient(90deg, var(--rose-soft), var(--white) 48%);
}

.card-row.prio-high {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, var(--danger-soft), var(--white) 48%);
}

.card-row.prio-medium {
  border-left-color: var(--sage);
  background: linear-gradient(90deg, var(--sage-soft), var(--white) 48%);
}

.card-row.prio-low {
  border-left-color: #8aa0b0;
  background: linear-gradient(90deg, #e8eef2, var(--white) 48%);
}

.card-row .prio-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.card-row.prio-critical .prio-tag {
  background: var(--rose-soft);
  color: #9a5a56;
}

.card-row.prio-high .prio-tag {
  background: var(--danger-soft);
  color: var(--danger);
}

.card-row.prio-medium .prio-tag {
  background: var(--sage-soft);
  color: var(--ok);
}

.card-row.prio-low .prio-tag {
  background: #e8eef2;
  color: #5a7080;
}

.section-title .count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 4px;
}

.count-pill.today {
  background: var(--sage-soft);
  color: var(--ok);
}

.count-pill.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.count-pill.birth {
  background: var(--rose-soft);
  color: #9a5a56;
}

.count-pill.lead {
  background: #e8eef2;
  color: #5a7080;
}

.check-item.prio-high {
  background: var(--danger-soft);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
  border-bottom-color: transparent;
}

.check-item.prio-medium {
  background: var(--sage-soft);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
  border-bottom-color: transparent;
}

.check-item .prio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
}

.check-item.prio-high .prio-dot {
  background: var(--danger);
}

.check-item.prio-medium .prio-dot {
  background: var(--sage);
}

.check-item.prio-low .prio-dot {
  background: #8aa0b0;
}

.consult-card {
  border-left: 4px solid var(--sage);
  background: linear-gradient(90deg, var(--sage-soft), var(--white) 55%);
}

.card-row .meta {
  flex: 1;
  min-width: 0;
}

.card-row .meta strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-row .meta span {
  color: var(--muted);
  font-size: 0.8rem;
}

.card-row .time {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--mist-soft);
  color: var(--muted);
}

.pill.ok {
  background: var(--sage-soft);
  color: var(--ok);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.pill.warn {
  background: #fff4e5;
  color: var(--warn);
}

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

.stat {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--rose);
  line-height: 1.1;
}

.stat .label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Patient hero */
.hero {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.hero-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero .gestation {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.85rem;
}

.hero-facts dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-facts dd {
  font-weight: 600;
  margin-bottom: 4px;
}

.linkish {
  color: var(--rose);
  font-weight: 600;
}

.attention {
  background: #fff8f0;
  border: 1px solid #f0dcc4;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  position: relative;
}

.attention--banner {
  padding-right: 48px;
  overflow: visible;
}

.banner-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: #8a5a3a;
  cursor: pointer;
}

/* .banner-close:hover,
.banner-close:active {
  border-color: var(--rose);
} */

.banner-close--danger {
  color: var(--danger);
}

.banner-close--danger:hover,
.banner-close--danger:active {
  color: var(--danger);
}

.attention h3 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--warn);
}

.attention li {
  list-style: none;
  padding: 4px 0;
  font-size: 0.9rem;
  display: flex;
  gap: 8px;
}

.attention li::before {
  content: "•";
  color: var(--warn);
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.fact {
  background: var(--white);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.fact .k {
  font-size: 0.72rem;
  color: var(--muted);
}

.fact .v {
  font-weight: 700;
  margin-top: 2px;
}

.analysis-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

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

.timeline {
  padding-left: 8px;
}

.tl-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}

.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mist);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.tl-item.done .tl-dot {
  background: var(--sage);
}

.tl-item.current .tl-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--sage-soft);
}

.tl-item.todo .tl-dot {
  background: #fff;
  border: 2px solid var(--mist);
}

.tl-label {
  font-size: 0.92rem;
  font-weight: 500;
}

.ai-box {
  background: linear-gradient(135deg, var(--sage-soft), var(--mist-soft));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 14px;
}

.notes-box {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

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

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

.btn-secondary {
  background: var(--mist-soft);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

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

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 18px 20px;
  font-size: 1.05rem;
  border-radius: 16px;
}

/* Check list */
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}

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

.check {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--mist);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #fff;
}

.check-item.done .check {
  background: var(--sage);
  border-color: var(--sage);
}

.check-item.done .txt {
  color: var(--muted);
  text-decoration: line-through;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

/* Bottom sheet */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 32, 30, 0.45);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(24px + var(--safe-b));
  z-index: 41;
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  max-height: 85%;
  overflow-y: auto;
  pointer-events: none;
  visibility: hidden;
}

.sheet.open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--mist);
  margin: 4px auto 16px;
}

.sheet h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.sheet-option {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  margin-bottom: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-option:active {
  background: var(--rose-soft);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--rose);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

/* Notifications panel */
.notif-panel {
  position: absolute;
  top: var(--header-h);
  left: 12px;
  right: 12px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  max-height: 60%;
  overflow-y: auto;
  display: none;
  padding: 8px;
}

.notif-panel.open {
  display: block;
  animation: fadeUp 0.25s ease;
}

.notif-item {
  padding: 12px;
  border-radius: 12px;
  text-align: left;
  width: 100%;
}

.notif-item.unread {
  background: var(--rose-soft);
}

.notif-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.notif-item span {
  font-size: 0.78rem;
  color: var(--muted);
}

.notif-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

/* Contractions */
.tracker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.pulse-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(189, 135, 131, 0.45);
  position: relative;
  z-index: 1;
}

.pulse-btn.tracking {
  background: var(--danger);
  animation: pulse 1.6s ease infinite;
}

.pulse-btn .sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 4px;
}

.tracker-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin: 24px 0 16px;
}

.tracker-stats .stat {
  text-align: center;
}

.contraction-list {
  width: 100%;
}

.contraction-list li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

/* Success overlay */
.success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(247, 248, 246, 0.96);
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.success-overlay.open {
  display: flex;
  animation: fadeUp 0.35s ease;
}

.success-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  margin-bottom: 20px;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.success-overlay h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.success-overlay p {
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.45;
}

/* Loading / skeleton */
.loading-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.35s ease;
}

.loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--mist);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton-list .sk {
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #ecefec 25%, #f6f7f5 50%, #ecefec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  margin-bottom: 10px;
}

.toast-wrap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--footer-h) + 16px + var(--safe-b));
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.subpage-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  flex-shrink: 0;
  background: transparent;
  transition:
    background 0.25s ease,
    backdrop-filter 0.25s ease,
    box-shadow 0.25s ease;
  z-index: 12;
  pointer-events: none;
}

.subpage-header > * {
  pointer-events: auto;
}

.subpage-header.is-scrolled {
  background: rgba(247, 248, 246, 0.12);
  backdrop-filter: blur(2px) saturate(1.3);
  -webkit-backdrop-filter: blur(2px) saturate(1.3);
  box-shadow:
    0 10px 28px rgba(44, 51, 48, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.subpage-header h2 {
  flex: 1;
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.text-sm {
  font-size: 0.85rem;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.comp-list,
.role-list {
  list-style: none;
}

.comp-list li,
.role-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.comp-list li::before {
  content: "✓ ";
  color: var(--ok);
  font-weight: 700;
}

.contact-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-btns a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-weight: 600;
}

.gestation-hero {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 4px;
}

.gestation-hero span {
  color: var(--rose);
}

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

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

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(196, 92, 92, 0.45);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(196, 92, 92, 0);
  }
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (min-width: 500px) and (max-width: 959px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  #app {
    height: min(900px, 100%);
    border-radius: 28px;
    overflow: hidden;
  }
}

.card-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-layout__main,
.card-layout__side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.patients-grid {
  display: flex;
  flex-direction: column;
}

.desk-grid {
  display: flex;
  flex-direction: column;
}


