:root {
  color-scheme: light;
  --blue: #0566c8;
  --blue-dark: #044f9f;
  --green: #0f8a5f;
  --mint: #e8f8f2;
  --red: #b42335;
  --red-soft: #fff1f2;
  --ink: #142033;
  --muted: #5e6d82;
  --line: #d8e2ee;
  --panel: #ffffff;
  --soft: #f5f8fb;
  --shadow: 0 18px 60px rgba(16, 33, 55, 0.14);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #63b3ff;
  --blue-dark: #9ed0ff;
  --green: #6ee7b7;
  --mint: #12332d;
  --red: #fda4af;
  --red-soft: #3b1820;
  --ink: #f2f7fb;
  --muted: #bdd0df;
  --line: #385268;
  --panel: #172433;
  --soft: #101b28;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #edf5f7;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

:root[data-theme="dark"] body {
  background: #0f1b28;
}

:focus-visible {
  outline: 4px solid #f59e0b;
  outline-offset: 4px;
}

button,
a,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hub-shell {
  min-height: 100vh;
  padding: 18px;
}

.exit-demo-link {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 450;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid rgba(4, 79, 159, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-dark);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 34px rgba(16, 33, 55, 0.18);
}

.exit-demo-link:hover {
  color: #ffffff;
  background: var(--blue);
}

.hub-shell[data-role="patient"] {
  display: grid;
  align-items: center;
  padding: 14px;
}

.hub-shell[data-role="patient"] .hub-topbar,
.hub-shell[data-role="patient"] .prototype-note,
.hub-shell[data-role="patient"] .pairing-panel {
  display: none;
}

.hub-shell[data-role="caregiver"] {
  display: grid;
  align-items: center;
  padding: 14px;
}

.hub-shell[data-role="caregiver"] .hub-topbar,
.hub-shell[data-role="caregiver"] .prototype-note,
.hub-shell[data-role="caregiver"] .pairing-panel {
  display: none;
}

.hub-topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto 12px;
}

.brand-lockup,
.home-link {
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup img {
  width: 54px;
  height: 54px;
}

.brand-lockup strong {
  display: block;
  font-size: 1.15rem;
}

.brand-lockup small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
}

.mode-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.mode-btn,
.home-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--blue);
  color: #fff;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
}

.prototype-note {
  max-width: 1360px;
  margin: 0 auto 18px;
  border-left: 5px solid var(--green);
  background: var(--mint);
  padding: 12px 16px;
  color: #244254;
  font-weight: 700;
}

.patient-notice {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto 14px;
  border: 2px solid #b45309;
  border-radius: 14px;
  background: #ffedd5;
  padding: 14px 16px;
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(22, 45, 73, 0.16);
}

.patient-notice[hidden] {
  display: none;
}

.patient-notice strong {
  color: #7c2d12;
}

.patient-notice span {
  color: #7c2d12;
  font-weight: 800;
}

.patient-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(9, 22, 40, 0.72);
  padding: 18px;
}

.patient-alert-modal[hidden] {
  display: none;
}

.patient-alert-box {
  width: min(760px, 100%);
  border: 4px solid #b45309;
  border-radius: 24px;
  background: #fff7ed;
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.patient-alert-box h2 {
  margin: 0;
  color: #7c2d12;
  font-size: clamp(2.1rem, 3.6vw, 3.7rem);
  line-height: 1.04;
}

.patient-alert-box p:not(.eyebrow) {
  margin: 18px 0 0;
  color: #7c2d12;
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.28;
  font-weight: 800;
}

.patient-alert-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.patient-quick-replies,
.patient-card-replies {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.patient-card-replies {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patient-reply-status {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 900;
}

.patient-alert-actions button {
  min-height: 86px;
  border: 0;
  border-radius: 16px;
  background: #c2410c;
  color: #fff;
  padding: 14px 18px;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  font-weight: 900;
  cursor: pointer;
}

.patient-quick-replies button,
.patient-card-replies button {
  min-height: 64px;
  border: 2px solid #fdba74;
  border-radius: 14px;
  background: #ffedd5;
  color: #7c2d12;
  padding: 10px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 900;
  cursor: pointer;
}

.patient-alert-actions button:nth-child(2) {
  background: #9a3412;
}

.patient-alert-actions button:nth-child(3),
.patient-alert-actions button:nth-child(4) {
  border: 2px solid #fdba74;
  background: #fff7ed;
  color: #7c2d12;
}

.patient-alert-box small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.pairing-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 1360px;
  margin: 0 auto 18px;
}

.pairing-side {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(22, 45, 73, 0.08);
}

.pairing-side span,
.pairing-side label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pairing-side strong {
  display: block;
  margin: 4px 0;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.12em;
}

.pairing-side p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.pairing-warning {
  border-left: 4px solid #c48200;
  background: #fff8e6;
  padding: 10px;
  color: #6b4b00 !important;
}

.pairing-warning[hidden] {
  display: none;
}

.pairing-actions,
.join-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pairing-actions button,
.join-code-row button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.join-code-row input,
#sharedLinkInput {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 800;
}

.join-code-row input {
  width: 160px;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

#sharedLinkInput {
  width: 100%;
  margin-bottom: 10px;
}

.interface-panel {
  display: none;
  max-width: 1360px;
  margin: 0 auto;
}

.interface-panel.active {
  display: block;
}

.station-frame {
  min-height: min(720px, calc(100vh - 220px));
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 18px;
  border: 2px solid #c7d6e7;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #eef9f4 100%);
  box-shadow: var(--shadow);
}

.patient-rail {
  display: grid;
  align-content: start;
  gap: 12px;
}

.rail-btn {
  min-height: 86px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.rail-btn.active {
  border-color: var(--blue);
  background: #e6f1ff;
}

.rail-btn.help {
  border-color: #f0b5be;
  background: var(--red-soft);
  color: var(--red);
}

.rail-code {
  display: grid;
  min-height: 86px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 2px dashed #b9d8ff;
  border-radius: 16px;
  background: #f7fbff;
  color: var(--blue-dark);
  text-align: center;
}

.rail-code span {
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-code strong {
  font-size: 1.8rem;
  letter-spacing: 0.08em;
}

.patient-screen {
  display: none;
  min-height: min(680px, calc(100vh - 260px));
  padding: clamp(24px, 4vw, 56px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.patient-screen.active {
  display: block;
}

.patient-hero {
  max-width: 930px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient-hero h1,
.patient-screen h2,
.phone-header h1 {
  margin: 0;
  color: var(--ink);
  line-height: 1.04;
}

.patient-hero h1 {
  font-size: clamp(4rem, 8vw, 7.8rem);
}

.patient-screen h2 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  max-width: 980px;
}

.patient-summary {
  margin: 18px 0 20px;
  max-width: 920px;
  color: #2d4057;
  font-size: clamp(1.5rem, 2.7vw, 2.35rem);
  line-height: 1.28;
  font-weight: 700;
}

.care-day-label {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  border-radius: 999px;
  background: #e9fbf1;
  color: var(--green);
  padding: 0 20px;
  font-size: 1.1rem;
  font-weight: 900;
}

.patient-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
  margin-top: 30px;
}

.patient-card,
.large-choice-row button,
.large-choice-row a,
.relax-grid button,
.help-grid button,
.start-day-btn {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 24px rgba(22, 45, 73, 0.08);
}

.patient-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  column-gap: 18px;
  align-items: center;
  height: 100%;
  min-height: 150px;
  padding: 22px;
}

.patient-card strong {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.patient-card small {
  display: block;
  grid-column: 2;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.patient-card.urgent {
  border-color: #efb5bd;
  background: linear-gradient(135deg, #fff 0%, var(--red-soft) 100%);
}

.card-mark {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #e5f2ff;
  color: var(--blue-dark);
  font-size: 2.1rem;
  font-weight: 900;
}

.urgent .card-mark {
  background: #ffe4e8;
  color: var(--red);
}

.start-day-btn {
  display: block;
  width: min(460px, 100%);
  min-height: 78px;
  margin-top: 24px;
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 1.65rem;
  font-weight: 900;
  text-align: center;
}

@media (min-width: 901px) and (max-height: 1250px) {
  .patient-screen {
    padding: 32px;
  }

  .patient-hero h1 {
    font-size: clamp(3.4rem, 5.2vw, 5.6rem);
  }

  .patient-summary {
    margin: 12px 0 12px;
    font-size: clamp(1.28rem, 2vw, 1.8rem);
    line-height: 1.2;
  }

  .care-day-label {
    min-height: 38px;
    font-size: 1rem;
  }

  .patient-primary-grid {
    gap: 14px;
    margin-top: 18px;
  }

  .patient-card {
    min-height: 122px;
    padding: 18px;
  }

  .patient-card strong {
    font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  }

  .patient-card small {
    font-size: 0.98rem;
  }

  .card-mark {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }

  .start-day-btn {
    min-height: 62px;
    margin-top: 16px;
    font-size: 1.35rem;
  }
}

.soft-message,
.incoming-card,
.request-status,
.caregiver-card-large,
.caregiver-status-card,
.caregiver-quick,
.caregiver-plan,
.caregiver-message-panel,
.activity-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 20px;
}

.soft-message {
  margin: 24px 0;
  color: #2d4057;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.35;
  font-weight: 800;
}

.plan-preview,
.care-plan-list {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.plan-preview div,
.plan-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
}

.plan-preview span,
.plan-item span {
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 900;
}

.plan-preview strong,
.plan-item strong {
  font-size: 1.35rem;
}

.plan-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.plan-item button {
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.large-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.large-choice-row.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.large-choice-row button,
.large-choice-row a,
.relax-grid button,
.help-grid button {
  min-height: 74px;
  padding: 16px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.caregiver-card-large {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
}

.caregiver-photo {
  display: inline-flex;
  width: 128px;
  height: 128px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dff3ff;
  color: var(--blue-dark);
  font-size: 2.2rem;
  font-weight: 900;
}

.caregiver-card-large strong {
  display: block;
  font-size: 1.65rem;
}

.caregiver-card-large p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}

.relax-grid,
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hub-media-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eaf4ff;
  padding: 10px 14px;
}

.hub-media-header strong {
  color: var(--blue-dark);
  font-size: 1.08rem;
}

.hub-media-header button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: #0b66c3;
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.hub-spotify-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #b9d8ff;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 73, 124, 0.16);
}

.hub-spotify-panel.large-player {
  width: min(760px, calc(100vw - 32px));
}

.hub-spotify-panel iframe {
  display: block;
  width: 100%;
  height: 352px;
  border: 0;
  background: #111;
}

.spotify-note {
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--muted);
  font-weight: 800;
}

.player-playing .patient-screen.active {
  padding-bottom: 320px;
}

.help-grid button:first-child {
  border-color: #f0b5be;
  background: var(--red-soft);
  color: var(--red);
}

.incoming-card {
  margin-top: 22px;
  border-color: #fdba74;
  background: #fff7ed;
}

.incoming-card strong {
  color: #7c2d12;
  font-size: 1.45rem;
}

.incoming-card p {
  color: #7c2d12;
  font-weight: 700;
}

.incoming-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.incoming-card button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #c2410c;
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.danger-text {
  color: var(--red);
}

.request-status {
  margin-top: 20px;
  border-color: #f0b5be;
  background: #fff8f9;
}

.request-status strong {
  font-size: 1.35rem;
}

.emergency-link {
  border-color: var(--red) !important;
  background: var(--red) !important;
  color: #fff !important;
}

.phone-frame {
  max-width: 520px;
  min-height: 760px;
  margin: 0 auto;
  padding: 18px;
  border: 12px solid #172033;
  border-radius: 36px;
  background: #f4f7fb;
  box-shadow: var(--shadow);
}

.setup-form {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.setup-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.setup-header button,
.setup-card button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setup-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
}

.setup-wide {
  grid-column: 1 / -1;
}

.setup-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.setup-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.setup-card input,
.setup-card textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 700;
}

.schedule-input-grid {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 150px 76px;
  gap: 10px;
  align-items: center;
}

.check-label {
  display: flex !important;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink) !important;
}

.check-label input {
  min-height: auto;
}

.setup-save-status {
  margin: 16px 0 0;
  border-left: 4px solid var(--blue);
  background: #eef7ff;
  padding: 12px;
  color: var(--ink);
  font-weight: 800;
}

.phone-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.phone-header h1 {
  font-size: 1.8rem;
}

.online-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  background: #ddf7ec;
  color: var(--green);
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.caregiver-status-card,
.caregiver-quick,
.caregiver-plan,
.caregiver-message-panel,
.activity-panel,
.urgent-alert-card {
  margin-top: 12px;
}

.caregiver-status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.caregiver-status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.caregiver-status-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 700;
}

.urgent-alert-card {
  border: 4px solid #b42335;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e8 100%);
  padding: 24px;
  box-shadow: 0 18px 48px rgba(180, 35, 53, 0.24);
}

.urgent-alert-card.needs-ack {
  animation: caregiverAlertPulse 1.35s ease-in-out infinite;
}

.urgent-alert-card p {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.urgent-alert-card h2 {
  margin: 0 0 14px;
  color: #7f1d1d;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
}

.caregiver-quick h2,
.caregiver-plan h2,
.caregiver-message-panel h2,
.activity-panel h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.urgent-alert-card span {
  display: block;
  color: #65323a;
  font-size: 1.2rem;
  font-weight: 800;
}

.urgent-alert-card.needs-ack span::after {
  content: "  Alert sound continues until acknowledged.";
  color: #b42335;
}

.caregiver-actions,
.caregiver-action-grid {
  display: grid;
  gap: 10px;
}

.caregiver-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.caregiver-message-panel .caregiver-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.caregiver-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.caregiver-actions button,
.caregiver-action-grid button,
#clearDemo {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.caregiver-actions button:nth-child(1),
.caregiver-action-grid button:nth-child(1),
.caregiver-action-grid button:nth-child(3),
.caregiver-action-grid button:nth-child(5) {
  background: var(--green);
}

@keyframes caregiverAlertPulse {
  0%,
  100% {
    box-shadow: 0 18px 48px rgba(180, 35, 53, 0.24);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 20px 58px rgba(180, 35, 53, 0.42);
    transform: translateY(-1px);
  }
}

.mini-plan {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 5px 10px;
  align-items: start;
}

.mini-plan span {
  color: var(--blue-dark);
  font-weight: 900;
}

.mini-plan strong {
  font-size: 0.95rem;
}

.mini-plan small {
  grid-column: 2;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#clearDemo {
  min-height: 34px;
  background: #e7eef6;
  color: var(--ink);
  font-size: 0.8rem;
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.timeline-item.urgent {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.timeline-item.important {
  border-left-color: #c48200;
  background: #fff9e8;
}

.timeline-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.timeline-text {
  font-weight: 800;
  line-height: 1.28;
}

@media (max-width: 900px) {
  .exit-demo-link {
    top: 10px;
    right: 10px;
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.92rem;
  }

  .hub-shell {
    padding: 10px;
  }

  .hub-topbar {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
    padding: 0 8px;
  }

  .station-frame {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 10px;
  }

  .pairing-panel {
    grid-template-columns: 1fr;
  }

  .patient-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-btn,
  .rail-code {
    min-height: 56px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .rail-code strong {
    font-size: 1.1rem;
  }

  .patient-screen {
    min-height: 0;
    padding: 18px;
  }

  .patient-hero h1 {
    font-size: 3.25rem;
  }

  .patient-screen h2 {
    font-size: 2.1rem;
  }

  .patient-summary {
    font-size: 1.25rem;
  }

  .patient-primary-grid,
  .large-choice-row,
  .large-choice-row.compact,
  .relax-grid,
  .help-grid,
  .plan-preview div,
  .plan-item {
    grid-template-columns: 1fr;
  }

  .patient-card {
    grid-template-columns: 58px 1fr;
    min-height: 120px;
    padding: 16px;
  }

  .card-mark {
    width: 58px;
    height: 58px;
    font-size: 1.7rem;
  }

  .caregiver-card-large {
    align-items: flex-start;
  }

  .caregiver-photo {
    width: 84px;
    height: 84px;
    font-size: 1.5rem;
  }

  .phone-frame {
    max-width: 100%;
    border-width: 6px;
    border-radius: 24px;
    padding: 12px;
  }

  .patient-alert-actions {
    grid-template-columns: 1fr;
  }

  .hub-spotify-panel,
  .hub-spotify-panel.large-player {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 46vh;
  }

  .hub-spotify-panel iframe {
    height: 260px;
  }

  .player-playing .patient-screen.active {
    padding-bottom: 300px;
  }

  .patient-quick-replies,
  .patient-card-replies {
    grid-template-columns: 1fr;
  }

  .patient-alert-actions button {
    min-height: 72px;
  }

  .caregiver-message-panel .caregiver-actions {
    grid-template-columns: 1fr;
  }

  .setup-header,
  .setup-grid,
  .schedule-input-grid {
    grid-template-columns: 1fr;
  }

  .setup-header {
    display: grid;
  }

  .setup-wide {
    grid-column: auto;
  }
}
/* Reference-style ComCare Recovery Hub screens */
.hub-shell[data-interface="patient"] .station-frame,
.hub-shell[data-role="patient"] .station-frame {
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1180px;
  min-height: min(760px, calc(100vh - 48px));
  margin: 0 auto;
  overflow: hidden;
  border: 14px solid #111827;
  border-radius: 34px;
  background: #f7fafc;
  box-shadow: 0 28px 80px rgba(1, 24, 43, 0.28);
}

.hub-shell[data-interface="patient"] .patient-rail,
.hub-shell[data-role="patient"] .patient-rail {
  order: 2;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: center;
  gap: 0;
  border-top: 1px solid #dde5ee;
  background: #ffffff;
}

.hub-shell[data-interface="patient"] .rail-btn,
.hub-shell[data-role="patient"] .rail-btn {
  min-height: 72px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #637083;
  font-size: 0.9rem;
  box-shadow: none;
}

.hub-shell[data-interface="patient"] .rail-btn.active,
.hub-shell[data-role="patient"] .rail-btn.active {
  background: #ffffff;
  color: var(--blue);
}

.hub-shell[data-interface="patient"] .rail-btn.help,
.hub-shell[data-role="patient"] .rail-btn.help {
  background: #ffffff;
  color: var(--red);
}

.hub-shell[data-interface="patient"] .rail-code,
.hub-shell[data-role="patient"] .rail-code {
  display: none;
}

.patient-home-screen {
  padding: 0;
  background: #f7fafc;
}

.patient-home-screen > .patient-hero,
.patient-home-screen > .patient-primary-grid,
.patient-home-screen > .start-day-btn {
  display: none;
}

.patient-reference-home {
  min-height: 100%;
  padding: clamp(20px, 3vw, 34px);
}

.patient-tablet-header {
  display: grid;
  grid-template-columns: 190px 1fr 150px;
  gap: 22px;
  align-items: start;
  margin-bottom: 28px;
}

.patient-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0b6f5b;
  font-weight: 900;
}

.patient-brand img {
  width: 54px;
  height: 54px;
}

.patient-brand b,
.patient-brand small {
  display: block;
}

.patient-brand b {
  font-size: 1.45rem;
  line-height: 1;
}

.patient-brand small {
  color: #3e7181;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient-greeting {
  text-align: center;
}

.patient-greeting h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
}

.patient-greeting .patient-summary {
  margin: 8px 0 0;
  color: #2f3d52;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  font-weight: 800;
}

.patient-clock {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: #172033;
  font-weight: 900;
}

.patient-clock small {
  color: #42536a;
  font-size: 0.82rem;
}

.patient-clock button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
}

.patient-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.patient-reference-grid .patient-card {
  min-height: 138px;
  border: 1px solid #dce5ee;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(22, 45, 73, 0.08);
}

.patient-reference-grid .patient-card strong {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.patient-reference-grid .patient-card small {
  font-size: 0.95rem;
}

.patient-reference-grid .card-mark {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0;
}

.mark-plan { background: #64748b; }
.mark-med,
.mark-team { background: #22b3a9; }
.mark-edu,
.mark-msg,
.mark-progress { background: #2276bd; }
.mark-relax { background: #356fd0; }
.mark-equipment { background: #7464c7; }
.mark-help { background: #db4c53; }

.daily-tip {
  width: min(680px, 90%);
  margin: 34px auto 0;
  border: 1px solid #e1e8f0;
  border-radius: 999px;
  background: #ffffff;
  padding: 13px 18px;
  color: #172033;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(22, 45, 73, 0.06);
}

.phone-frame {
  border-color: #111827;
  border-radius: 42px;
  background: #f8fafc;
}

.caregiver-app-header > div:not(.caregiver-brand) {
  display: none;
}

.caregiver-app-header {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #dde5ee;
}

.caregiver-brand img {
  width: 44px;
  height: 44px;
}

.caregiver-brand b {
  font-size: 1.25rem;
}

.caregiver-profile-card,
.caregiver-next-task {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.caregiver-profile-card {
  grid-template-columns: 78px 1fr;
  align-items: center;
  margin-top: 14px;
  border-color: transparent;
  box-shadow: none;
}

.caregiver-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: #dce5eb;
  color: #304256;
  font-size: 1.3rem;
  font-weight: 900;
}

.caregiver-profile-card h1 {
  margin: 0;
  color: #172033;
  font-size: 1.55rem;
}

.caregiver-profile-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1rem;
}

.caregiver-profile-card p {
  margin: 5px 0 0;
  color: #4d5f75;
  line-height: 1.35;
  font-weight: 800;
}

.caregiver-next-task {
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  box-shadow: 0 8px 24px rgba(22, 45, 73, 0.06);
}

.caregiver-next-task span,
.caregiver-next-task b,
.caregiver-next-task small,
.caregiver-next-task strong {
  display: block;
}

.caregiver-next-task span {
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.caregiver-next-task strong {
  margin-top: 8px;
  font-size: 1.18rem;
}

.caregiver-next-task small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.caregiver-next-task button,
.section-head button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: #eef6f2;
  color: var(--green);
  padding: 0 12px;
  font-weight: 900;
}

.caregiver-status-card {
  display: none;
}

.caregiver-reference-actions h2 {
  display: none;
}

.caregiver-reference-actions {
  padding: 0;
  border: 0;
  background: transparent;
}

.caregiver-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.caregiver-action-grid button {
  display: grid;
  min-height: 92px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff !important;
  color: #172033;
  padding: 10px 6px;
  font-size: 0.86rem;
  box-shadow: 0 6px 18px rgba(22, 45, 73, 0.06);
}

.caregiver-action-grid button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #e8f2ff;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
}

.caregiver-action-grid button:nth-child(2) span,
.caregiver-action-grid button:nth-child(5) span {
  background: #e7f8ef;
  color: var(--green);
}

.caregiver-action-grid button:nth-child(3) span {
  background: #f2eafd;
  color: #6d43b7;
}

.caregiver-action-grid button:nth-child(6) span {
  background: #ffecef;
  color: var(--red);
}

.caregiver-message-panel:has(#sharedLinkInput) {
  display: none;
}

.activity-panel .timeline {
  max-height: 190px;
}

.timeline-item {
  grid-template-columns: 72px 1fr 14px;
  border-left: 0;
  border-bottom: 1px solid #eef2f6;
  border-radius: 0;
  background: transparent;
}

.timeline-item::after {
  content: "";
  width: 10px;
  height: 10px;
  align-self: center;
  border-radius: 50%;
  background: var(--green);
}

@media (max-width: 760px) {
  .hub-shell[data-interface="patient"] .station-frame,
  .hub-shell[data-role="patient"] .station-frame {
    border-width: 8px;
    border-radius: 24px;
  }

  .patient-reference-home {
    padding: 18px;
  }

  .patient-tablet-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .patient-brand,
  .patient-clock {
    justify-content: center;
    justify-items: center;
  }

  .patient-reference-grid {
    grid-template-columns: 1fr;
  }

  .patient-reference-grid .patient-card {
    min-height: 112px;
  }

  .caregiver-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Guided demo accessibility, profile, pairing, appearance, and monitor additions */
html,
body {
  overflow-x: hidden;
}

.hub-shell[data-role="patient"],
.hub-shell[data-interface="patient"] {
  align-content: center;
}

.hub-shell[data-interface="patient"] .interface-panel,
.hub-shell[data-role="patient"] .interface-panel {
  width: min(100%, 1480px);
}

.hub-shell[data-interface="patient"] .station-frame,
.hub-shell[data-role="patient"] .station-frame {
  max-width: min(1480px, calc(100vw - 28px));
  min-height: min(900px, calc(100vh - 28px));
}

.hub-shell[data-interface="patient"] .patient-rail,
.hub-shell[data-role="patient"] .patient-rail {
  grid-template-columns: repeat(8, minmax(90px, 1fr));
}

.hub-shell[data-interface="patient"] .rail-btn,
.hub-shell[data-role="patient"] .rail-btn {
  min-height: 84px;
  font-size: clamp(0.92rem, 1vw, 1.08rem);
}

.patient-reference-home {
  display: grid;
  align-content: start;
}

.patient-reference-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  max-width: 1180px;
  margin: 0 auto;
}

.patient-reference-grid .patient-card,
.sync-screen button,
.profile-actions button,
.settings-actions button {
  min-height: 96px;
}

.patient-reference-grid .patient-card {
  max-width: 360px;
  justify-self: stretch;
}

.patient-reference-grid .patient-card strong {
  font-size: clamp(1.25rem, 1.45vw, 1.6rem);
}

.patient-reference-grid .patient-card small {
  color: var(--muted);
  font-size: clamp(1rem, 1.05vw, 1.12rem);
}

.primary-action {
  border-color: var(--blue) !important;
}

.connect-card {
  border-color: #7dd3fc !important;
}

.dashboard-status-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e9fbf1;
  color: #0f6f4d;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
}

.permanent-help {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 520;
  display: inline-flex;
  min-width: 112px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  padding: 0 22px;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 18px 38px rgba(180, 35, 53, 0.28);
}

.screen-note {
  max-width: 820px;
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.3vw, 1.3rem);
  line-height: 1.45;
  font-weight: 800;
}

.sync-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1fr);
  gap: 20px;
  max-width: 980px;
}

.sync-code-card,
.settings-panel,
.profile-form {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: 0 12px 34px rgba(22, 45, 73, 0.08);
}

.sync-code-card span,
.sync-code-card small {
  display: block;
  color: var(--muted);
  font-weight: 900;
}

.sync-code-card strong {
  display: block;
  margin: 18px 0;
  color: var(--blue-dark);
  font-size: clamp(3.2rem, 6vw, 5.6rem);
  letter-spacing: 0.08em;
}

.sync-status {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  margin: 20px 0 0;
  border-radius: 999px;
  background: #e8f7ef;
  color: #0f6f4d;
  padding: 0 18px;
  font-size: 1.15rem;
  font-weight: 900;
}

.hub-shell.clean-pair[data-role="patient"] .hub-topbar,
.hub-shell.clean-pair[data-role="caregiver"] .hub-topbar,
.hub-shell.clean-pair[data-role="setup"] .hub-topbar {
  display: grid;
}

.hub-shell.clean-pair .prototype-note,
.hub-shell.clean-pair .pairing-panel {
  display: none;
}

.hub-shell.clean-pair .mode-switch {
  position: sticky;
  top: 8px;
  z-index: 540;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-photo {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  background: #dceafe;
  color: #064e7a;
  font-size: 1.8rem;
  font-weight: 900;
}

.profile-identity strong,
.profile-identity span {
  display: block;
}

.profile-identity strong {
  font-size: 1.65rem;
}

.profile-identity span {
  margin-top: 4px;
  color: var(--green);
  font-weight: 900;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.profile-grid label,
.appearance-options label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.profile-grid input,
.profile-grid textarea {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.profile-grid textarea {
  min-height: 98px;
}

.profile-grid input:disabled,
.profile-grid textarea:disabled {
  opacity: 1;
}

.profile-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.profile-actions button,
.settings-actions button,
.sync-screen .large-choice-row button {
  border: 0;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  padding: 0 22px;
  font-weight: 900;
}

.profile-actions button:disabled {
  background: #94a3b8;
}

.appearance-options {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 0;
  padding: 0;
}

.appearance-options legend {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.appearance-options label {
  grid-template-columns: auto 1fr;
  min-height: 72px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  padding: 0 18px;
  color: var(--ink);
  font-size: 1.18rem;
}

.appearance-options input {
  width: 26px;
  height: 26px;
}

.caregiver-patient-monitor {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}

.caregiver-patient-monitor .section-head span {
  color: var(--green);
  font-weight: 900;
}

.monitor-grid {
  display: grid;
  gap: 8px;
}

.monitor-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 8px 10px;
  align-items: center;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.monitor-card.active {
  border-color: var(--blue);
  background: #eaf4ff;
}

.monitor-card.attention {
  border-color: #f59e0b;
  background: #fff7ed;
}

.monitor-avatar {
  grid-row: span 2;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #dce5eb;
  font-weight: 900;
}

.monitor-card strong,
.monitor-card small,
.monitor-card b {
  display: block;
}

.monitor-card small {
  color: var(--muted);
  font-weight: 800;
}

.monitor-card b {
  grid-row: span 2;
  color: var(--green);
  font-size: 0.82rem;
}

:root[data-theme="dark"] .station-frame,
:root[data-theme="dark"] .patient-screen,
:root[data-theme="dark"] .patient-home-screen,
:root[data-theme="dark"] .phone-frame,
:root[data-theme="dark"] .patient-reference-grid .patient-card,
:root[data-theme="dark"] .caregiver-profile-card,
:root[data-theme="dark"] .caregiver-next-task,
:root[data-theme="dark"] .caregiver-patient-monitor,
:root[data-theme="dark"] .caregiver-plan,
:root[data-theme="dark"] .caregiver-message-panel,
:root[data-theme="dark"] .activity-panel,
:root[data-theme="dark"] .monitor-card,
:root[data-theme="dark"] .daily-tip {
  background: var(--panel);
  color: var(--ink);
}

:root[data-theme="dark"] .patient-greeting h1,
:root[data-theme="dark"] .patient-greeting .patient-summary,
:root[data-theme="dark"] .patient-clock,
:root[data-theme="dark"] .patient-card strong,
:root[data-theme="dark"] .profile-grid input,
:root[data-theme="dark"] .profile-grid textarea {
  color: var(--ink);
}

:root[data-theme="dark"] .dashboard-status-pill,
:root[data-theme="dark"] .sync-status,
:root[data-theme="dark"] .online-pill {
  background: #12332d;
  color: #a7f3d0;
}

:root[data-theme="dark"] .monitor-card.active,
:root[data-theme="dark"] .monitor-card.attention,
:root[data-theme="dark"] .appearance-options label {
  background: #102235;
}

@media (min-width: 1500px) and (orientation: landscape) {
  .patient-tablet-header {
    grid-template-columns: 240px minmax(520px, 1fr) 220px;
  }

  .patient-greeting h1 {
    font-size: clamp(3rem, 3vw, 4.2rem);
  }

  .patient-reference-grid {
    gap: 20px;
  }

  .patient-reference-grid .patient-card {
    min-height: 122px;
  }
}

@media (max-width: 1020px) {
  .hub-shell[data-interface="patient"] .patient-rail,
  .hub-shell[data-role="patient"] .patient-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .patient-reference-grid,
  .sync-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .patient-reference-grid .patient-card {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .hub-shell[data-interface="patient"] .patient-rail,
  .hub-shell[data-role="patient"] .patient-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permanent-help {
    right: 10px;
    bottom: 10px;
    min-width: 92px;
  }

  .sync-code-card strong {
    font-size: 3rem;
  }

  .profile-actions,
  .settings-actions {
    display: grid;
  }

  .monitor-card {
    grid-template-columns: 44px 1fr;
  }

  .monitor-card b {
    grid-column: 2;
  }
}

/* Modern ComCare Hub visual pattern */
body {
  background:
    radial-gradient(circle at 92% 18%, rgba(16, 185, 129, 0.16), transparent 22rem),
    linear-gradient(180deg, #ffffff 0%, #f4fbff 54%, #ffffff 100%);
}

.hub-shell {
  background: transparent;
}

.exit-demo-link {
  border-color: #bfead9;
  background: rgba(255, 255, 255, 0.94);
  color: #047857;
  box-shadow: 0 18px 44px rgba(13, 36, 69, 0.12);
}

.exit-demo-link:hover {
  background: #10b981;
}

.hub-topbar {
  max-width: 1480px;
  border: 1px solid #e0edf6;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  box-shadow: 0 18px 44px rgba(13, 36, 69, 0.08);
  backdrop-filter: blur(14px);
}

.brand-lockup strong,
.phone-header h1,
.patient-greeting h1,
.caregiver-profile-card h1,
.setup-header h1 {
  color: #071b49;
  letter-spacing: 0;
}

.brand-lockup small,
.patient-brand small {
  color: #10b981;
}

.mode-switch {
  border-color: #dbe8f2;
  border-radius: 999px;
  background: #f6fbff;
  padding: 5px;
}

.mode-btn,
.home-link {
  border-radius: 999px;
}

.mode-btn.active {
  background: linear-gradient(135deg, #2563eb, #174ff0);
}

.home-link {
  border-color: #bfead9;
  background: #ffffff;
  color: #047857;
}

.prototype-note {
  max-width: 1480px;
  border: 1px solid #bfead9;
  border-left-width: 6px;
  border-radius: 18px;
  background: #f0fdf7;
  color: #174a43;
}

.patient-home-screen,
.patient-station,
.phone-frame,
.setup-form {
  border-color: #dbe8f2;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(13, 36, 69, 0.14);
}

.patient-station {
  border-radius: 34px;
}

.patient-reference-home {
  background:
    radial-gradient(circle at 88% 12%, rgba(16, 185, 129, 0.1), transparent 14rem),
    #ffffff;
}

.patient-tablet-header {
  align-items: center;
}

.dashboard-status-pill,
.sync-status,
.status-pill,
.connection-pill {
  border-color: transparent;
  background: #dcfce7;
  color: #047857;
}

.patient-reference-grid .patient-card,
.caregiver-action-grid button,
.caregiver-profile-card,
.caregiver-next-task,
.caregiver-patient-monitor,
.caregiver-plan,
.caregiver-message-panel,
.setup-card,
.request-status,
.caregiver-card-large,
.activity-panel,
.profile-form,
.sync-card {
  border-color: #dbe8f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 16px 42px rgba(13, 36, 69, 0.08);
}

.patient-reference-grid .patient-card {
  min-height: 132px;
  border-radius: 18px;
}

.patient-reference-grid .patient-card:hover,
.caregiver-action-grid button:hover,
.setup-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(13, 36, 69, 0.12);
}

.patient-reference-grid .card-mark,
.caregiver-action-grid button span {
  border-radius: 18px;
}

.mark-plan,
.mark-edu,
.mark-msg,
.mark-progress {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.mark-med,
.mark-team {
  background: linear-gradient(135deg, #10b981, #059669);
}

.mark-relax,
.mark-equipment {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.mark-help {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.daily-tip {
  border-color: #dbe8f2;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(13, 36, 69, 0.08);
}

.phone-frame {
  border-width: 10px;
  border-color: #111827;
  background: #f8fbff;
}

.caregiver-app-header {
  background: #ffffff;
}

.caregiver-avatar {
  background: linear-gradient(135deg, #dbeafe, #dcfce7);
  color: #075985;
}

.urgent-alert-card {
  border-radius: 20px;
}

.setup-header button,
.setup-card button,
.caregiver-actions button,
.caregiver-action-grid button:nth-child(1),
.caregiver-action-grid button:nth-child(3),
.caregiver-action-grid button:nth-child(5) {
  background: linear-gradient(135deg, #2563eb, #174ff0);
  color: #ffffff;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 92% 18%, rgba(16, 185, 129, 0.1), transparent 22rem),
    linear-gradient(180deg, #101b28 0%, #0f1b28 100%);
}

:root[data-theme="dark"] .hub-topbar,
:root[data-theme="dark"] .patient-home-screen,
:root[data-theme="dark"] .patient-station,
:root[data-theme="dark"] .phone-frame,
:root[data-theme="dark"] .setup-form {
  background: rgba(23, 36, 51, 0.96);
}
