:root {
  --green-900: #0f3b2e;
  --green-700: #167a53;
  --green-600: #1f9363;
  --green-100: #e8f6ef;
  --green-50: #f4fbf7;
  --ink: #1c2b25;
  --muted: #66736e;
  --line: #dce7e1;
  --surface: #ffffff;
  --surface-alt: #f7faf8;
  --warning: #b86b18;
  --warning-bg: #fff5e8;
  --shadow: 0 22px 70px rgba(24, 70, 50, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.login-section,
.elder-app-section,
.dashboard-section {
  display: none;
}

body.login-page .hero,
body.login-page #features,
body.login-page #workflow,
body.login-page #pricing,
body.login-page .footer,
body.elder-page .hero,
body.elder-page #features,
body.elder-page #workflow,
body.elder-page #pricing,
body.elder-page .login-section,
body.elder-page .dashboard-section,
body.elder-page .footer,
body.dashboard-page .hero,
body.dashboard-page #features,
body.dashboard-page #workflow,
body.dashboard-page #pricing,
body.dashboard-page .footer {
  display: none;
}

body.login-page .login-section {
  display: block;
}

body.elder-page .elder-app-section {
  display: block;
}

body.dashboard-page .dashboard-section {
  display: block;
}

body.login-page .login-section {
  min-height: calc(100vh - 68px);
  padding: 68px 24px;
  background: var(--surface-alt);
}

body.elder-page .elder-app-section {
  min-height: calc(100vh - 68px);
  padding: 34px 18px;
  background:
    linear-gradient(180deg, var(--green-50), #ffffff 48%),
    var(--surface-alt);
}

body.dashboard-page .dashboard-section {
  min-height: calc(100vh - 68px);
  padding: 34px 24px 56px;
  background: var(--surface-alt);
}

body.dashboard-page .dashboard-section .section-heading {
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

.login-shell {
  display: grid;
  width: min(980px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: center;
  margin: 0 auto;
}

.login-copy h2 {
  max-width: 520px;
}

.login-copy p {
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.login-card input:focus {
  border-color: var(--green-700);
  outline: 3px solid rgba(31, 147, 99, 0.14);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.elder-app-shell {
  display: grid;
  min-height: calc(100vh - 136px);
  place-items: center;
}

.elder-device {
  width: min(430px, 100%);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.elder-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: var(--green-900);
  font-weight: 900;
}

.elder-screen {
  padding: 28px 22px 30px;
}

.elder-kicker {
  margin-bottom: 8px;
  color: var(--green-700);
  font-size: 15px;
  font-weight: 900;
}

.elder-screen h2 {
  margin-bottom: 18px;
  font-size: 30px;
}

.elder-copy {
  color: var(--muted);
  font-size: 18px;
}

.elder-field {
  display: grid;
  gap: 8px;
  margin: 26px 0 18px;
  color: var(--muted);
  font-weight: 900;
}

.elder-field input {
  width: 100%;
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--green-900);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.elder-field input:focus {
  border-color: var(--green-700);
  outline: 4px solid rgba(31, 147, 99, 0.16);
}

.elder-primary-button,
.elder-secondary-button,
.elder-muted-button,
.elder-link-button {
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.elder-primary-button {
  border: 1px solid var(--green-700);
  background: var(--green-700);
  color: white;
}

.elder-secondary-button {
  border: 1px solid var(--line);
  background: var(--green-50);
  color: var(--green-900);
}

.elder-muted-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
}

.elder-snooze-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 900;
}

.elder-snooze-field select {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--green-900);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
}

.elder-link-button {
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--green-700);
  font-size: 17px;
}

.elder-large-button {
  margin-top: 12px;
  min-height: 66px;
}

.elder-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.elder-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 13px;
  font-weight: 900;
}

.elder-next-card,
.elder-dose-card,
.elder-result {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-50);
}

.elder-next-card {
  padding: 22px;
}

.elder-next-card span,
.elder-result span {
  color: var(--green-700);
  font-size: 13px;
  font-weight: 900;
}

.elder-next-card strong {
  color: var(--green-900);
  font-size: 34px;
  line-height: 1.1;
}

.elder-next-card p {
  color: var(--muted);
  font-size: 18px;
}

.elder-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.elder-list {
  display: grid;
  gap: 10px;
}

.elder-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
}

.elder-list-item span {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.elder-list-item strong {
  color: var(--green-700);
}

.elder-dose-card {
  padding: 26px;
  text-align: center;
}

.elder-dose-card strong {
  color: var(--green-900);
  font-size: 54px;
  line-height: 1;
}

.elder-dose-card span {
  color: var(--muted);
  font-size: 18px;
}

.elder-camera-frame {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 2px dashed var(--green-700);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 122, 83, 0.08), rgba(255, 255, 255, 0.84)),
    var(--green-50);
  color: var(--green-900);
  font-size: 28px;
  font-weight: 900;
}

.elder-camera-frame.captured {
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(22, 122, 83, 0.18), rgba(232, 246, 239, 0.94)),
    white;
}

.bp-frame {
  min-height: 220px;
}

.elder-result {
  padding: 18px;
}

.elder-result strong {
  color: var(--green-900);
  font-size: 38px;
  line-height: 1;
}

.elder-result p {
  margin-bottom: 0;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(220, 231, 225, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--green-900);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-700);
  color: white;
}

.brand-mark svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 15px;
}

.nav a:hover {
  color: var(--green-700);
}

.nav-cta {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-700);
}

.hero {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 36%, rgba(255, 255, 255, 0.34) 68%, rgba(255, 255, 255, 0.16) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.88));
}

.hero-content {
  position: relative;
  width: min(620px, 88vw);
  margin-left: 6vw;
  padding: 72px 0 110px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-700);
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  color: var(--green-900);
  font-size: 58px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  color: var(--green-900);
  font-size: 34px;
  line-height: 1.22;
}

h3 {
  margin-bottom: 10px;
  font-size: 24px;
}

h4 {
  margin-bottom: 0;
  font-size: 18px;
}

.hero-copy {
  max-width: 560px;
  color: #40534b;
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  background: var(--green-700);
  color: white;
  box-shadow: 0 12px 24px rgba(22, 122, 83, 0.22);
}

.button.primary:hover {
  background: var(--green-600);
}

.button.secondary {
  background: white;
  border-color: var(--line);
  color: var(--green-900);
}

.button.small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.section {
  padding: 84px 6vw;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.feature-card,
.price-card,
.panel,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.feature-card {
  padding: 24px;
}

.feature-card p,
.step p,
.price-card li,
.dialog-copy,
.muted {
  color: var(--muted);
}

.icon-pill {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 900;
}

.split-band {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  background: var(--surface-alt);
}

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

.step {
  padding: 22px;
  border-left: 4px solid var(--green-700);
  background: white;
}

.step span {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
  color: var(--green-900);
}

.dashboard-section {
  background: white;
}

.dashboard {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 24px 18px;
  background: var(--green-900);
  color: white;
}

.sidebar-title {
  margin-bottom: 28px;
  font-weight: 900;
}

.sidebar-item {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
}

.sidebar-item.active,
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.dashboard-main {
  padding: 28px;
  background: #fbfdfc;
}

.dashboard-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active,
.tab-button:hover {
  border-color: var(--green-700);
  background: var(--green-50);
  color: var(--green-700);
}

.toolbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar h3 {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  display: block;
  color: var(--green-900);
  font-size: 32px;
  line-height: 1.1;
}

.stat.warning {
  background: var(--warning-bg);
  border-color: #f3d6ae;
}

.stat.warning strong {
  color: var(--warning);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 1.22fr);
  align-items: start;
  gap: 18px;
}

.panel {
  min-height: 250px;
  padding: 20px;
}

.setup-panel {
  background: linear-gradient(180deg, #ffffff 0%, var(--green-50) 100%);
}

.list-panel {
  background: white;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--line);
}

.view-heading h4 {
  margin: 0;
  color: var(--green-900);
  font-size: 22px;
}

.view-heading p:last-child {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 13px;
  font-weight: 800;
}

.ghost-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--green-700);
  cursor: pointer;
  font-weight: 900;
}

.timeline,
.medicine-list,
.bp-list,
.membership-panel,
.notification-list,
.record-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item,
.medicine-item,
.bp-item,
.member-item,
.record-item {
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-alt);
}

.record-item:hover {
  border-color: var(--line);
  background: white;
}

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

.status {
  font-weight: 900;
}

.status.taken {
  color: var(--green-700);
}

.status.pending {
  color: var(--warning);
}

.status.snoozed {
  color: #2374ab;
}

.status.unconfirmed {
  color: #9d2e1f;
}

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

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

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

.form-grid label,
.form-grid .form-field,
.edit-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.edit-grid input,
.edit-grid select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.form-grid input:focus,
.form-grid select:focus,
.edit-grid input:focus,
.edit-grid select:focus {
  border-color: var(--green-700);
  outline: 3px solid rgba(31, 147, 99, 0.14);
}

.split-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.time-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.time-chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--green-900);
  cursor: pointer;
  font-weight: 900;
}

.time-chip:hover {
  border-color: rgba(31, 147, 99, 0.42);
  background: var(--green-50);
}

.time-chip.active {
  border-color: var(--green-700);
  background: var(--green-700);
  color: white;
}

.custom-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.custom-time-row .ghost-button {
  min-height: 42px;
  white-space: nowrap;
}

.repeat-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-50);
}

.repeat-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: white;
  color: var(--green-900);
  font-size: 14px;
  font-weight: 900;
}

.repeat-custom-panel {
  display: grid;
  gap: 12px;
}

.repeat-custom-panel[hidden] {
  display: none;
}

.repeat-frequency-row {
  display: grid;
  grid-template-columns: auto minmax(82px, 0.42fr) minmax(96px, 0.58fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 900;
}

.repeat-frequency-row[hidden],
.repeat-mode-tabs[hidden],
.repeat-mode-button[hidden],
.repeat-section-title[hidden],
.repeat-option-grid[hidden] {
  display: none;
}

.repeat-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 10px;
  background: white;
}

.repeat-mode-button,
.repeat-option-chip {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.repeat-mode-button.active,
.repeat-option-chip.active {
  background: var(--green-700);
  color: white;
}

.repeat-option-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.repeat-option-grid.month-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.repeat-option-chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.repeat-option-chip.last-day {
  grid-column: span 2;
}

.repeat-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.repeat-help {
  margin: 0;
  font-size: 13px;
}

.medicine-photo-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.medicine-photo-preview {
  display: grid;
  min-height: 68px;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--green-700);
  border-radius: 8px;
  background: var(--green-50);
  color: var(--green-900);
  font-weight: 900;
  text-align: center;
  overflow: hidden;
  padding: 8px;
}

.medicine-photo-preview.has-photo {
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(22, 122, 83, 0.14), rgba(255, 255, 255, 0.84)),
    var(--green-50);
}

.medicine-photo-preview img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 6px;
}

.medicine-photo-preview span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-upload-button {
  align-self: stretch;
  min-width: 112px;
}

.photo-upload-button input {
  display: none;
}

.combo-fields {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--green-50);
}

.combo-fields[hidden] {
  display: none;
}

.combo-editor {
  display: grid;
  gap: 10px;
}

.combo-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-900);
  font-weight: 900;
}

.combo-item-list {
  display: grid;
  gap: 10px;
}

.combo-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(74px, 0.55fr) minmax(88px, 0.65fr) auto;
  gap: 8px;
  align-items: center;
}

.combo-remove-button {
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.span-2 {
  grid-column: span 2;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.record-meta {
  color: var(--muted);
  font-size: 14px;
}

.record-photo-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.record-photo-card img,
.record-photo-placeholder {
  width: 96px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--green-50);
}

.record-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-photo-card strong,
.record-photo-card span {
  display: block;
  min-width: 0;
}

.record-photo-card strong {
  color: var(--green-900);
  font-size: 14px;
}

.record-photo-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-kicker {
  color: var(--green-700);
  font-size: 12px;
  font-weight: 900;
}

.record-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 900;
}

.patient-card .item-row {
  justify-content: flex-start;
}

.patient-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.patient-profile-panel {
  align-content: start;
}

.patient-detail-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.large-avatar {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

.patient-detail-head h4 {
  margin: 0 0 4px;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.detail-stat-grid .stat {
  min-height: 92px;
  padding: 14px;
}

.danger-button {
  border-color: #f1c8c0;
  color: #9d2e1f;
}

.notification-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notification-settings-form label,
.notification-channel-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.notification-settings-form select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

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

.notification-record-panel {
  grid-column: 1 / -1;
}

.notification-simulator {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.notification-simulator label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.notification-simulator select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.notification-simulator .record-meta {
  align-self: center;
}

.notification-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.notification-item p {
  margin: 0;
  color: var(--ink);
}

.notification-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-meta-grid span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.simulator-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(420px, 1.12fr);
  gap: 18px;
}

.simulator-control-panel,
.simulator-state-panel,
.simulator-scheduler-panel,
.simulator-action-panel,
.simulator-results-panel {
  min-height: auto;
}

.simulator-control-grid,
.simulator-log-picker {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.simulator-control-grid label,
.simulator-log-picker label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.simulator-control-grid select,
.simulator-log-picker select {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.simulator-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.simulator-stat-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.simulator-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.simulator-stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--green-900);
  font-size: 30px;
  line-height: 1;
}

.simulator-stat-card.warning {
  border-color: #f3d6ae;
  background: var(--warning-bg);
}

.simulator-stat-card.warning strong {
  color: var(--warning);
}

.simulator-scheduler-panel {
  grid-column: 1 / -1;
}

.scheduler-result {
  margin-top: 14px;
}

.scheduler-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.scheduler-summary div {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.scheduler-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scheduler-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--green-900);
  font-size: 28px;
  line-height: 1;
}

.simulator-action-panel,
.simulator-results-panel {
  grid-column: 1 / -1;
}

.simulator-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.simulator-action-grid .button {
  min-width: 118px;
}

.testing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.testing-summary-card {
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.testing-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.testing-summary-card strong {
  display: block;
  margin-top: 10px;
  color: var(--green-900);
  font-size: 32px;
  line-height: 1;
}

.testing-summary-card.success strong {
  color: var(--green-700);
}

.testing-summary-card.warning {
  border-color: #f3d6ae;
  background: var(--warning-bg);
}

.testing-summary-card.warning strong {
  color: var(--warning);
}

.testing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.testing-toolbar strong,
.testing-toolbar span {
  display: block;
}

.testing-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.testing-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.testing-checklist {
  display: grid;
  gap: 16px;
}

.testing-group-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.testing-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.testing-item-main {
  min-width: 0;
}

.testing-group {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 12px;
  font-weight: 900;
}

.testing-item h5 {
  margin: 8px 0 4px;
  color: var(--green-900);
  font-size: 17px;
}

.testing-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.testing-item-controls {
  display: grid;
  gap: 8px;
}

.testing-status {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.testing-status.success {
  background: var(--green-100);
  color: var(--green-700);
}

.testing-status.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.testing-status.muted {
  background: #eef1ef;
  color: var(--muted);
}

.testing-item select,
.testing-item textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.testing-item select {
  min-height: 42px;
  font-weight: 800;
}

.testing-item textarea {
  resize: vertical;
}

.button:disabled,
.ghost-button:disabled,
.sidebar-item:disabled,
.tab-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.medicine-editor-card {
  background: white;
  border-color: var(--line);
}

.medicine-table-head,
.medicine-row summary {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) minmax(70px, 0.7fr) minmax(120px, 1fr) minmax(72px, 0.7fr) minmax(120px, 1fr) 64px;
  align-items: center;
  gap: 12px;
}

.medicine-table-head {
  margin-bottom: 8px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.medicine-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.medicine-row + .medicine-row {
  margin-top: 10px;
}

.medicine-row summary {
  min-height: 72px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.medicine-row summary::-webkit-details-marker {
  display: none;
}

.medicine-row summary:hover {
  background: var(--green-50);
}

.medicine-row[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--green-50);
}

.medicine-cell {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
}

.medicine-name-cell {
  display: grid;
  gap: 2px;
}

.medicine-name-cell strong {
  color: var(--green-900);
  font-size: 16px;
}

.medicine-name-cell small {
  color: var(--muted);
  font-size: 13px;
}

.medicine-action {
  justify-self: end;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--green-700);
  font-weight: 900;
}

.medicine-row[open] .medicine-action {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
}

.stock-low {
  color: var(--warning);
  font-weight: 900;
}

.medicine-edit-body {
  padding: 0 14px 14px;
}

.medicine-editor-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.medicine-editor-summary strong {
  display: block;
  color: var(--green-900);
  font-size: 18px;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.warning-badge {
  background: var(--warning-bg);
  color: var(--warning);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: white;
  color: var(--green-900);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.error {
  border-color: #f1c8c0;
  color: #9d2e1f;
}

.subpage-body {
  background: var(--surface-alt);
}

.subpage-shell {
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 56px 0 78px;
}

.subpage-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.subpage-hero h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: 42px;
}

.subpage-hero p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.medicine-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.record-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.record-detail-panel {
  display: grid;
  gap: 18px;
}

.record-filter-header {
  align-items: end;
}

.record-filter-bar {
  display: grid;
  min-width: min(420px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.record-filter-bar.single-filter {
  min-width: min(220px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.record-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-filter-bar select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.medication-record-list {
  display: grid;
  gap: 12px;
}

.medication-record-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-alt);
}

.medication-record-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.medication-record-main strong {
  display: block;
  margin-top: 4px;
  color: var(--green-900);
  font-size: 20px;
  line-height: 1.25;
}

.medication-record-main p {
  margin: 6px 0 0;
  color: var(--muted);
}

.blood-pressure-record-item .record-photo-card {
  max-width: 520px;
}

.medicine-table-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.medicine-page-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.medicine-page-head,
.medicine-page-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.25fr)
    minmax(80px, 0.6fr)
    minmax(130px, 1fr)
    minmax(120px, 0.9fr)
    minmax(100px, 0.8fr)
    minmax(130px, 0.9fr)
    140px;
  align-items: center;
  gap: 12px;
}

.medicine-page-head {
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.medicine-page-row {
  min-width: 0;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.medicine-page-row:hover {
  background: white;
}

.medicine-page-cell {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
}

.medicine-primary {
  display: grid;
  gap: 2px;
}

.medicine-primary strong {
  color: var(--green-900);
  font-size: 17px;
}

.medicine-primary small {
  color: var(--muted);
  font-size: 13px;
}

.medicine-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
  justify-content: flex-end;
}

.medicine-dialog {
  width: min(720px, calc(100vw - 36px));
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--green-50);
  color: var(--muted);
  text-align: center;
}

.pricing-section {
  background: var(--surface-alt);
}

.price-card {
  padding: 24px;
}

.price {
  margin: 12px 0 16px;
  color: var(--green-900);
  font-size: 28px;
  font-weight: 900;
}

.price-card ul {
  margin: 0;
  padding-left: 20px;
}

.dialog {
  width: min(430px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(15, 59, 46, 0.32);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 22px;
}

.invite-code {
  margin: 18px 0;
  padding: 22px;
  border: 1px dashed var(--green-700);
  border-radius: 8px;
  background: var(--green-50);
  color: var(--green-900);
  font-size: 42px;
  font-weight: 900;
  text-align: center;
}

.footer {
  padding: 30px 6vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--green-700);
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .steps,
  .pricing-grid,
  .stat-grid,
  .record-summary-grid,
  .medicine-summary-grid,
  .testing-summary-grid,
  .simulator-grid,
  .panel-grid,
  .workbench-grid,
  .patient-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-band,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .dashboard-tabs {
    display: flex;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .view-heading p:last-child {
    max-width: none;
  }

  .medicine-page-head {
    display: none;
  }

  .medicine-page-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .medicine-page-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .medicine-page-cell::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .medicine-primary {
    display: grid;
  }

  .medicine-primary::before {
    content: "药品";
  }

  .medicine-page-row .medicine-page-cell:nth-child(2)::before {
    content: "老人";
  }

  .medicine-page-row .medicine-page-cell:nth-child(3)::before {
    content: "时间";
  }

  .medicine-page-row .medicine-page-cell:nth-child(4)::before {
    content: "重复";
  }

  .medicine-page-row .medicine-page-cell:nth-child(5)::before {
    content: "确认";
  }

  .medicine-page-row .medicine-page-cell:nth-child(6)::before {
    content: "库存";
  }

  .medicine-page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
  }

  .medicine-page-actions .ghost-button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 20px;
  }

  .nav {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: 620px;
    align-items: flex-end;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.94) 48%, white 100%),
      linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.52));
  }

  .hero-content {
    width: auto;
    margin: 0;
    padding: 280px 22px 42px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 27px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .section {
    padding: 58px 22px;
  }

  body.login-page .login-section {
    padding: 36px 18px;
  }

  .login-card {
    padding: 20px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .medicine-photo-picker,
  .combo-item-row {
    grid-template-columns: 1fr;
  }

  .photo-upload-button,
  .combo-remove-button,
  .simulator-action-grid .button {
    width: 100%;
  }

  .feature-grid,
  .steps,
  .pricing-grid,
  .stat-grid,
  .record-summary-grid,
  .testing-summary-grid,
  .simulator-grid,
  .panel-grid,
  .workbench-grid,
  .patient-detail-grid,
  .form-grid,
  .edit-grid {
    grid-template-columns: 1fr;
  }

  .patient-detail-head,
  .detail-stat-grid,
  .simulator-stat-grid,
  .scheduler-summary,
  .record-filter-bar,
  .medication-record-main,
  .notification-settings-form,
  .notification-channel-grid,
  .notification-simulator {
    grid-template-columns: 1fr;
  }

  .time-chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: auto;
  }

  .dashboard-main {
    padding: 16px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .testing-toolbar,
  .testing-item {
    grid-template-columns: 1fr;
  }

  .testing-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .testing-toolbar-actions,
  .testing-toolbar-actions .button {
    width: 100%;
  }

  .medicine-editor-summary,
  .item-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-photo-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .record-photo-card img,
  .record-photo-placeholder {
    width: 82px;
    height: 64px;
  }

  .medicine-table-head {
    display: none;
  }

  .medicine-row summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .medicine-cell::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .medicine-name-cell {
    display: grid;
  }

  .medicine-name-cell::before {
    content: "药品";
  }

  .medicine-row summary .medicine-cell:nth-child(2)::before {
    content: "老人";
  }

  .medicine-row summary .medicine-cell:nth-child(3)::before {
    content: "时间";
  }

  .medicine-row summary .medicine-cell:nth-child(4)::before {
    content: "确认";
  }

  .medicine-row summary .medicine-cell:nth-child(5)::before {
    content: "库存";
  }

  .medicine-action {
    justify-self: stretch;
  }

  .status-pills {
    justify-content: flex-start;
  }

  .button {
    width: 100%;
  }

  .subpage-shell {
    width: calc(100vw - 32px);
    padding: 34px 0 54px;
  }

  .subpage-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .subpage-hero h1 {
    font-size: 30px;
  }

  .medicine-summary-grid {
    grid-template-columns: 1fr;
  }

  .medicine-table-panel {
    padding: 16px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }
}

/* Brand and dashboard refresh */
:root {
  --green-900: #12382f;
  --green-700: #1e7a55;
  --green-600: #239765;
  --green-100: #e6f3ed;
  --green-50: #f4faf7;
  --ink: #17231f;
  --muted: #65716d;
  --line: #dde5e1;
  --surface: #ffffff;
  --surface-alt: #f4f7f6;
  --blue: #2266b8;
  --blue-bg: #eaf2ff;
  --warning: #a96515;
  --warning-bg: #fff3df;
  --danger: #ad3024;
  --shadow: 0 18px 48px rgba(17, 36, 30, 0.1);
}

body {
  background: #ffffff;
  color: var(--ink);
}

.site-header {
  min-height: 64px;
  padding: 0 clamp(22px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(221, 229, 225, 0.88);
}

.brand {
  gap: 11px;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
}

.brand-mark {
  background: var(--green-700);
  box-shadow: 0 8px 18px rgba(30, 122, 85, 0.22);
}

.nav {
  gap: 22px;
  color: #596662;
}

.nav a {
  white-space: nowrap;
}

.nav-cta {
  border-color: #cfdad5;
  background: #ffffff;
  color: var(--green-700);
}

.hero {
  min-height: min(620px, calc(100svh - 92px));
  align-items: center;
  background: #f7f5ef;
}

.hero-image {
  object-position: 68% center;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 38%, rgba(255, 255, 255, 0.5) 66%, rgba(255, 255, 255, 0.14) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(245, 248, 246, 0.82));
}

.hero-content {
  width: min(660px, 88vw);
  margin-left: clamp(24px, 6vw, 88px);
  padding: 62px 0 86px;
}

.eyebrow {
  color: var(--green-700);
  letter-spacing: 0;
}

.hero h1 {
  margin-bottom: 18px;
  font-size: clamp(56px, 8vw, 92px);
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  color: #35453f;
  font-size: 21px;
  line-height: 1.78;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  border-radius: 8px;
  font-weight: 850;
}

.button.primary {
  background: var(--green-700);
  box-shadow: 0 12px 24px rgba(30, 122, 85, 0.18);
}

.button.secondary {
  border-color: #cfdad5;
  color: #20332d;
}

.hero-proof {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.hero-proof-item {
  min-height: 76px;
  border: 1px solid rgba(207, 218, 213, 0.9);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.76);
}

.hero-proof-item strong,
.hero-proof-item span {
  display: block;
}

.hero-proof-item strong {
  color: var(--ink);
  font-size: 16px;
}

.hero-proof-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 76px clamp(24px, 6vw, 86px);
}

.section-heading {
  max-width: 760px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 36px;
  line-height: 1.26;
}

.feature-grid {
  gap: 14px;
}

.feature-card {
  min-height: 210px;
  padding: 24px;
  border-color: #dce6e1;
  box-shadow: none;
}

.feature-card h3 {
  color: var(--ink);
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-pill {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--green-100);
  color: var(--green-700);
}

.feature-card:nth-child(2) .icon-pill,
.feature-card:nth-child(2) .badge {
  background: var(--blue-bg);
  color: var(--blue);
}

.feature-card:nth-child(4) .icon-pill {
  background: var(--warning-bg);
  color: var(--warning);
}

.split-band {
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  background: #f7f8f6;
}

.steps {
  gap: 12px;
}

.step {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-700);
  border-radius: 8px;
  padding: 22px;
}

.step:nth-child(2) {
  border-left-color: var(--blue);
}

.step:nth-child(3) {
  border-left-color: var(--warning);
}

.pricing-section {
  background: #ffffff;
}

body.dashboard-page .site-header {
  min-height: 58px;
}

body.dashboard-page .nav a:not(.nav-cta) {
  display: none;
}

body.dashboard-page .dashboard-section {
  min-height: calc(100vh - 58px);
  padding: 18px;
  background: #eef3f1;
}

.dashboard-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.dashboard {
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 94px);
  border-color: #d4dfda;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(21, 40, 33, 0.08);
}

.sidebar {
  padding: 18px 14px;
  border-right: 1px solid #dce6e1;
  background: #f8fbfa;
  color: var(--ink);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--ink);
}

.sidebar-title strong,
.sidebar-title small {
  display: block;
}

.sidebar-title small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-700);
  color: #ffffff;
  font-weight: 900;
}

.sidebar-item {
  min-height: 40px;
  margin-bottom: 5px;
  border-radius: 8px;
  color: #566661;
  font-weight: 800;
}

.sidebar-item.active,
.sidebar-item:hover {
  background: var(--green-900);
  color: #ffffff;
}

.dashboard-main {
  padding: 22px 28px 30px;
  background: #ffffff;
}

.toolbar {
  min-height: 74px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom-color: #dce6e1;
}

.toolbar h3 {
  color: var(--ink);
  font-size: 25px;
  letter-spacing: 0;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dashboard-mode-badge {
  background: var(--blue-bg);
  color: var(--blue);
}

.stat-grid,
.record-summary-grid,
.testing-summary-grid {
  gap: 12px;
}

.stat {
  min-height: 96px;
  padding: 16px 18px;
  border-color: #dce6e1;
  box-shadow: none;
}

.stat span {
  color: #68766f;
  font-size: 13px;
  font-weight: 800;
}

.stat strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 31px;
}

.stat-grid .stat:nth-child(2) strong,
.record-summary-grid .stat:nth-child(2) strong {
  color: var(--green-700);
}

.stat-grid .stat:nth-child(3) strong,
.record-summary-grid .stat:nth-child(3) strong {
  color: var(--blue);
}

.panel-grid,
.workbench-grid,
.patient-detail-grid {
  gap: 14px;
}

.panel {
  min-height: 0;
  padding: 18px;
  border-color: #dce6e1;
  box-shadow: none;
}

.panel-header h4,
.view-heading h4 {
  color: var(--ink);
}

.timeline,
.medicine-list,
.bp-list,
.membership-panel,
.notification-list,
.record-list {
  gap: 9px;
  margin-top: 14px;
}

.timeline-item,
.medicine-item,
.bp-item,
.member-item,
.record-item {
  padding: 13px 14px;
  border-color: transparent;
  background: #f7faf8;
}

.timeline-item:hover,
.medicine-item:hover,
.bp-item:hover,
.record-item:hover {
  border-color: #cfdad5;
  background: #ffffff;
}

.badge {
  min-height: 26px;
  border-radius: 999px;
  background: var(--green-100);
}

.ghost-button {
  border-color: #d3ded9;
  background: #ffffff;
  color: var(--green-700);
}

.view-heading {
  align-items: flex-start;
  padding-bottom: 14px;
}

.form-grid input,
.form-grid select,
.edit-grid input,
.edit-grid select {
  border-color: #d3ded9;
}

@media (max-width: 1040px) {
  body.dashboard-page .dashboard-section {
    padding: 12px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid #dce6e1;
  }

  .sidebar-title {
    margin-bottom: 0;
  }

  .sidebar-item {
    display: inline-flex;
    width: auto;
    align-items: center;
    margin: 0 4px 4px 0;
    white-space: nowrap;
  }

  .sidebar {
    overflow-x: auto;
  }
}

@media (max-width: 700px) {
  .site-header {
    gap: 10px;
    padding: 12px 18px;
  }

  .nav {
    flex-wrap: nowrap;
    gap: 10px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    font-size: 14px;
  }

  .nav-cta {
    padding-right: 10px;
    padding-left: 10px;
  }

  .hero {
    min-height: 650px;
    align-items: flex-end;
  }

  .hero-image {
    height: 52%;
    object-position: center top;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.88) 38%, #ffffff 64%),
      linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  }

  .hero-content {
    width: 100%;
    margin: 0;
    padding: 300px 22px 36px;
  }

  .hero h1 {
    font-size: 54px;
  }

  .hero-copy {
    font-size: 17px;
    line-height: 1.72;
  }

  .hero-proof {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-proof-item {
    min-height: 58px;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .feature-card {
    min-height: 0;
  }

  body.dashboard-page .site-header {
    display: none;
  }

  body.dashboard-page .dashboard-section {
    min-height: 100vh;
    padding: 0;
  }

  .dashboard-shell,
  .dashboard {
    width: 100%;
    max-width: 100vw;
  }

  .dashboard {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .sidebar {
    display: flex;
    min-height: 68px;
    align-items: center;
    padding: 12px 14px;
    overflow: hidden;
  }

  .sidebar-title {
    margin: 0;
  }

  .sidebar-item {
    display: none;
  }

  .dashboard-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .dashboard-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .dashboard-main {
    width: 100vw;
    max-width: 100vw;
    padding: 16px;
    overflow: hidden;
  }

  .toolbar-actions,
  .toolbar-actions .button {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-mode-badge {
    display: none;
  }

  .stat {
    min-height: 84px;
  }
}

/* Homepage direction inspired by the soft blue therapy reference */
body:not(.login-page):not(.elder-page):not(.dashboard-page) {
  background:
    url("/assets/distorted-grid.svg"),
    #f8fcfd;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover, auto;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
  position: relative;
  top: auto;
  z-index: 30;
  width: min(1620px, calc(100vw - 128px));
  min-height: 76px;
  margin: clamp(24px, 3vw, 36px) auto clamp(78px, 8vw, 126px);
  padding: 0 24px;
  border: 1px solid rgba(226, 237, 243, 0.9);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .brand {
  font-size: 20px;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #18c6a3;
  box-shadow: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav {
  flex: 1 1 auto;
  justify-content: space-between;
  gap: clamp(14px, 2vw, 34px);
  margin-left: clamp(28px, 5vw, 86px);
  color: #253440;
  font-size: 16px;
  font-weight: 800;
}

.nav-links,
.nav-actions {
  display: inline-flex;
  align-items: center;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links {
  position: relative;
  gap: clamp(22px, 3vw, 52px);
  margin: 0 auto;
  padding: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #172434;
  text-shadow: none;
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a::before,
body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a::after {
  content: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a:hover,
body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a:focus-visible {
  color: #0a8b70;
  outline: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-actions {
  gap: 12px;
}

.language-toggle,
.login-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
}

.language-toggle {
  gap: 8px;
  border: 1px solid rgba(218, 226, 232, 0.95);
  padding: 0 17px;
  background: #ffffff;
  color: #0d2f43;
  box-shadow: none;
  cursor: pointer;
}

.language-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.95;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-toggle span {
  display: none;
}

.language-toggle strong {
  color: #0d2f43;
}

.login-link {
  min-width: 108px;
  gap: 10px;
  padding: 0 5px 0 20px;
  background: #0d2f43;
  color: #ffffff;
  box-shadow: none;
}

.login-link::after {
  content: "→";
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #18c6a3;
  color: white;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero {
  position: relative;
  display: grid;
  width: min(1620px, calc(100vw - 128px));
  min-height: clamp(640px, calc(100svh - 250px), 820px);
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.85fr);
  gap: clamp(22px, 4vw, 72px);
  align-items: center;
  margin: 0 auto 58px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero::after {
  content: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-content,
body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-visual {
  position: relative;
  z-index: 1;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-content {
  width: auto;
  max-width: 820px;
  margin: 0;
  padding: 0;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-chips span {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid rgba(208, 225, 231, 0.84);
  border-radius: 999px;
  padding: 0 20px;
  background: #ffffff;
  color: #142c41;
  font-weight: 850;
  box-shadow: none;
}

.hero-chips span:first-child {
  border-color: transparent;
  background: #dff7f1;
  color: #08745f;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero .eyebrow {
  margin-bottom: 12px;
  color: #0a8b70;
  font-size: 15px;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero h1 {
  max-width: 760px;
  margin-bottom: 20px;
  color: #080923;
  font-size: clamp(52px, 5.4vw, 82px);
  line-height: 1.08;
  letter-spacing: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero h1 span {
  color: #16c7a4;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-copy {
  max-width: 760px;
  color: #6e7882;
  font-size: 22px;
  line-height: 1.78;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-actions {
  margin-top: 28px;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .button.primary {
  min-height: 56px;
  border-radius: 999px;
  padding: 0 26px;
  background: #256ee9;
  color: #ffffff;
  box-shadow: none;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .button.secondary {
  min-height: 56px;
  border-color: rgba(210, 224, 230, 0.9);
  border-radius: 999px;
  padding: 0 24px;
  background: #ffffff;
}

.hero-command {
  display: grid;
  width: min(620px, 100%);
  min-height: 72px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  border-radius: 999px;
  padding: 8px 10px 8px 24px;
  background: #ffffff;
  box-shadow: none;
}

.hero-command-icon {
  color: #0b1c31;
  font-size: 26px;
}

.hero-command span:not(.hero-command-icon) {
  min-width: 0;
  overflow: hidden;
  color: #77818a;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-command strong {
  display: inline-grid;
  min-height: 54px;
  min-width: 118px;
  place-items: center;
  border-radius: 999px;
  background: #0d2f43;
  color: #ffffff;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-proof {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 640px;
  margin-top: 58px;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-proof-item {
  min-height: 86px;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none;
}

.hero-visual {
  min-height: 500px;
}

.care-session-card {
  position: absolute;
  top: 76px;
  right: 54px;
  width: min(330px, 82%);
  border-radius: 24px;
  padding: 16px;
  background: #ffffff;
  box-shadow: none;
}

.care-session-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
}

.care-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: #dff7f1;
  color: #08745f;
  font-weight: 900;
}

.care-session-head strong,
.care-session-head span {
  display: block;
}

.care-session-head strong {
  color: #111827;
}

.care-session-head span {
  color: #8a949d;
  font-size: 13px;
}

.care-menu {
  color: #0d2f43;
  font-weight: 900;
}

.care-session-card img {
  display: block;
  width: 100%;
  height: 250px;
  border-radius: 18px;
  object-fit: cover;
  object-position: 63% center;
}

.care-call-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.care-call-actions span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: #f5fbfd;
  color: #0d2f43;
  font-weight: 900;
  box-shadow: none;
}

.care-call-actions span:last-child {
  background: #18c6a3;
  color: #ffffff;
}

.floating-card,
.family-pill {
  position: absolute;
  border: 1px solid rgba(224, 234, 238, 0.8);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: none;
}

.floating-card span,
.floating-card small {
  color: #7a858e;
}

.floating-card strong {
  display: block;
  color: #080923;
}

.adherence-card {
  top: 278px;
  left: 10px;
  width: 244px;
  padding: 20px;
}

.adherence-card strong {
  margin: 4px 0 14px;
  font-size: 40px;
  line-height: 1;
}

.mini-bars {
  display: grid;
  height: 66px;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
}

.mini-bars i {
  display: block;
  border-radius: 999px 999px 6px 6px;
  background: #3b82f6;
}

.mini-bars i:nth-child(1) {
  height: 42%;
  background: #c9d4dd;
}

.mini-bars i:nth-child(2) {
  height: 74%;
}

.mini-bars i:nth-child(3) {
  height: 58%;
}

.mini-bars i:nth-child(4) {
  height: 92%;
  background: #18c6a3;
}

.mini-bars i:nth-child(5) {
  height: 68%;
}

.mini-bars i:nth-child(6) {
  height: 84%;
}

.reminder-card {
  top: 132px;
  left: 12px;
  width: 238px;
  padding: 16px 18px;
}

.reminder-card strong {
  margin-top: 5px;
  font-size: 21px;
}

.family-pill {
  right: 22px;
  bottom: 20px;
  display: grid;
  min-width: 292px;
  min-height: 66px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 16px 10px 22px;
}

.family-pill span {
  color: #8a949d;
}

.family-pill strong {
  display: inline-grid;
  min-height: 46px;
  place-items: center;
  border-radius: 999px;
  padding: 0 18px;
  background: #0d2f43;
  color: #ffffff;
}

@media (max-width: 1100px) {
  body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
    width: min(100% - 24px, 960px);
    margin-top: 18px;
    margin-bottom: 12px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero {
    width: min(100% - 24px, 960px);
    grid-template-columns: 1fr;
    padding-top: 42px;
  }

  .hero-visual {
    min-height: 460px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-proof {
    margin-top: 32px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav {
    margin-left: 22px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links {
    gap: 16px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a,
  .language-toggle,
  .login-link {
    font-size: 14px;
  }

  .language-toggle {
    padding: 0 14px;
  }

  .login-link {
    min-width: 82px;
    padding: 0 18px;
  }
}

@media (max-width: 700px) {
  body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
    width: calc(100% - 22px);
    min-height: 72px;
    margin: 10px auto 8px;
    border-radius: 24px;
    padding: 10px 12px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .brand {
    font-size: 18px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .brand-mark {
    width: 38px;
    height: 38px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav {
    width: 100%;
    gap: 4px;
    margin-left: 0;
    padding-bottom: 0;
    overflow-x: auto;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links {
    gap: 0;
    margin: 0;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-links a {
    font-size: 11px;
    min-height: 32px;
    padding: 0 4px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .nav-actions {
    gap: 6px;
  }

  .language-toggle,
  .login-link {
    min-height: 36px;
    font-size: 11px;
  }

  .language-toggle {
    padding: 0 6px;
  }

  .language-toggle span {
    display: none;
  }

  .language-toggle strong {
    font-size: 0;
  }

  .language-toggle strong::after {
    content: "中/EN";
    font-size: 11px;
  }

  .login-link {
    min-width: 44px;
    padding: 0 8px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero {
    width: calc(100% - 18px);
    min-height: auto;
    margin-top: 0;
    margin-bottom: 34px;
    border-radius: 24px;
    padding: 26px 16px 24px;
  }

  .hero-chips {
    gap: 8px;
    margin-bottom: 20px;
  }

  .hero-chips span {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero h1 {
    font-size: 42px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-copy {
    font-size: 16px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-command {
    min-height: 62px;
    padding-left: 16px;
  }

  .hero-command strong {
    min-width: 84px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-proof {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .hero-visual {
    min-height: 600px;
  }

  .care-session-card {
    top: 20px;
    right: 0;
    left: 0;
    width: 100%;
  }

  .care-session-card img {
    height: 270px;
  }

  .adherence-card {
    top: 390px;
    left: 0;
    width: 58%;
    padding: 18px;
  }

  .adherence-card strong {
    font-size: 34px;
  }

  .reminder-card {
    top: 392px;
    right: 0;
    left: auto;
    width: 39%;
    padding: 14px;
  }

  .reminder-card strong {
    font-size: 16px;
  }

  .family-pill {
    right: 0;
    bottom: 0;
    left: 0;
    min-width: 0;
  }
}

/* Keep the public homepage to exactly one viewport, including footer. */
body:not(.login-page):not(.elder-page):not(.dashboard-page) {
  display: flex;
  height: 100svh;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(18px, 2.8vw, 36px) clamp(28px, 4.4vw, 64px) clamp(10px, 1.4vw, 18px);
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
  width: 100%;
  flex: 0 0 auto;
  margin: 0 auto clamp(22px, 7svh, 86px);
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) #top {
  flex: 1 1 auto;
  min-height: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 0;
  padding: clamp(8px, 1.2svh, 14px) 0 0;
  background: transparent;
  color: #6e7f88;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer-copyright,
body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer-links {
  margin: 0;
}

body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer-links {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}

@media (max-height: 760px) {
  body:not(.login-page):not(.elder-page):not(.dashboard-page) {
    padding-top: 16px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
    min-height: 68px;
    margin-bottom: 22px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero h1 {
    font-size: clamp(44px, 5vw, 68px);
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-copy {
    font-size: 18px;
  }

  .hero-chips {
    margin-bottom: 18px;
  }

  .hero-command,
  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-proof {
    display: none;
  }
}

@media (max-width: 700px) {
  body:not(.login-page):not(.elder-page):not(.dashboard-page) {
    padding: 10px 10px 12px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .site-header {
    margin-bottom: 20px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero {
    align-content: start;
    overflow: hidden;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-visual {
    display: none;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero h1 {
    font-size: clamp(38px, 11vw, 46px);
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .hero-copy {
    font-size: 15px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer {
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
  }

  body:not(.login-page):not(.elder-page):not(.dashboard-page) .footer-links {
    gap: 14px;
  }
}
