:root {
  --bg: #f4f6f2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --ink: #101312;
  --muted: #737b77;
  --line: rgba(27, 34, 30, 0.08);
  --accent: #61b978;
  --accent-strong: #347044;
  --accent-soft: #e8f5ea;
  --amber: #f1a640;
  --danger: #9d3f37;
  --charcoal: #050706;
  --mono: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --shadow: 0 22px 56px rgba(27, 37, 31, 0.13);
  --screen-top-pad: 58px;
  --screen-side-pad: 20px;
  --tabbar-offset: 10px;
  --tabbar-height: 92px;
  --tabbar-clearance: calc(var(--tabbar-offset) + var(--tabbar-height) + 26px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at 86% 86%, rgba(205, 224, 207, 0.86), transparent 32%),
    linear-gradient(145deg, #eef4ee 0%, #f7f8f4 48%, #edf2ee 100%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  touch-action: manipulation;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(rgba(20, 24, 22, 0.2) 0.6px, transparent 0.6px);
  background-size: 5px 5px;
}

body.senior {
  font-size: 112%;
}

html[dir="rtl"] .app-header,
html[dir="rtl"] .section-heading,
html[dir="rtl"] .dose-item,
html[dir="rtl"] .care-card,
html[dir="rtl"] .profile-card,
html[dir="rtl"] .stock-row,
html[dir="rtl"] .setting-row,
html[dir="rtl"] .language-card,
html[dir="rtl"] .language-chip,
html[dir="rtl"] .history-row,
html[dir="rtl"] .premium-compare div,
html[dir="rtl"] .privacy-rights div,
html[dir="rtl"] .guide-actions button,
html[dir="rtl"] .routine-card {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .dose-chevron,
html[dir="rtl"] [data-lucide="chevron-right"] {
  transform: scaleX(-1);
}

body.senior .dose-item,
body.senior .sheet-options button,
body.senior .profile-card,
body.senior .care-card,
body.senior .stock-row {
  min-height: 70px;
}

button,
input,
textarea,
select,
a {
  font: inherit;
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: 16px;
  max-width: 100%;
  min-width: 0;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(52, 112, 68, 0.42);
  outline-offset: 3px;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  width: 720px;
  height: 720px;
  border-radius: 42% 58% 47% 53%;
  background: rgba(255, 255, 255, 0.42);
  filter: blur(18px);
  transform: translate(-34vw, -28vh) rotate(9deg);
  pointer-events: none;
}

.device {
  width: min(100vw, 430px);
  height: min(940px, 100dvh);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 11px solid #0b0c0c;
  border-radius: 52px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 247, 243, 0.92)),
    #f7f8f5;
  box-shadow:
    0 46px 120px rgba(21, 25, 23, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.device::before {
  content: "";
  width: 126px;
  height: 34px;
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 4;
  border-radius: 999px;
  background: #050606;
  transform: translateX(-50%);
  box-shadow: inset 34px 0 0 rgba(255, 255, 255, 0.03), inset -22px 0 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

html.native-ios body {
  width: 100vw;
  min-height: 100svh;
  display: block;
  overflow-x: hidden;
  overflow-y: visible;
  background: var(--bg);
}

html.native-ios {
  --bg: #080b0a;
  --surface: rgba(19, 26, 22, 0.92);
  --surface-solid: #111813;
  --ink: #f5f8f4;
  --muted: #a8b5ad;
  --line: rgba(232, 245, 234, 0.1);
  --accent: #86d79a;
  --accent-strong: #b8efc0;
  --accent-soft: rgba(134, 215, 154, 0.16);
  --amber: #f3bb65;
  --danger: #ff9c91;
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color-scheme: dark;
  overscroll-behavior-y: none;
}

html.native-ios .ambient,
html.native-ios .device::before {
  display: none;
}

html.native-ios .device {
  width: 100vw;
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  max-width: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(16, 23, 19, 0.96), rgba(8, 12, 10, 0.98)),
    var(--bg);
  box-shadow: none;
}

html.native-ios .screen {
  --screen-top-pad: max(44px, calc(env(safe-area-inset-top) + 18px));
  --screen-side-pad: max(16px, calc(env(safe-area-inset-left) + 16px));
  --tabbar-offset: 0px;
  --tabbar-height: calc(96px + env(safe-area-inset-bottom));
  --tabbar-clearance: calc(var(--tabbar-height) + 28px);
  min-height: 100svh;
  overflow: visible;
  padding-right: max(16px, calc(env(safe-area-inset-right) + 16px));
  background: var(--bg);
  -webkit-overflow-scrolling: auto;
}

html.native-ios .tabbar {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: var(--tabbar-height);
  padding-bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

html.native-ios .icon-button,
html.native-ios .chip,
html.native-ios .chip.active,
html.native-ios .search-panel,
html.native-ios .panel,
html.native-ios .metric-tile,
html.native-ios .med-card,
html.native-ios .day-pill,
html.native-ios .profile-card,
html.native-ios .stock-row,
html.native-ios .setting-row,
html.native-ios .refill-row,
html.native-ios .language-card,
html.native-ios .language-chip,
html.native-ios .privacy-rights div,
html.native-ios .reminder-grid div,
html.native-ios .report-controls,
html.native-ios .report-document,
html.native-ios .report-events div,
html.native-ios .guide-actions button,
html.native-ios .choice-grid label,
html.native-ios .onboarding-points span,
html.native-ios .setup-path,
html.native-ios .routine-card,
html.native-ios .sheet-options button,
html.native-ios .ghost-button {
  border-color: rgba(232, 245, 234, 0.08);
  background: rgba(18, 25, 21, 0.9);
  color: var(--ink);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.native-ios .guide-actions button {
  border-color: rgba(134, 215, 154, 0.16);
  background: linear-gradient(180deg, rgba(22, 33, 27, 0.96), rgba(13, 20, 16, 0.94));
}

html.native-ios .guide-actions small,
html.native-ios .routine-card small,
html.native-ios .stock-row small,
html.native-ios .profile-card small,
html.native-ios .care-card small,
html.native-ios .setting-row small {
  color: #a8b5ad;
}

html.native-ios .protocol-card {
  border-color: rgba(232, 245, 234, 0.08);
  background:
    radial-gradient(circle at 78% 18%, rgba(146, 207, 166, 0.16), transparent 30%),
    linear-gradient(138deg, rgba(23, 31, 27, 0.98), rgba(14, 20, 17, 0.96) 58%, rgba(18, 27, 22, 0.98));
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.28);
}

html.native-ios .guide-panel,
html.native-ios .routine-panel {
  background:
    radial-gradient(circle at 88% 10%, rgba(134, 215, 154, 0.11), transparent 30%),
    rgba(18, 25, 21, 0.9);
}

html.native-ios .tabbar {
  background: rgba(14, 20, 17, 0.92);
  backdrop-filter: blur(22px);
}

html.native-ios .tab {
  color: #8f9c94;
}

html.native-ios .tab.active,
html.native-ios .dose-main strong,
html.native-ios .med-card h3,
html.native-ios .care-card strong,
html.native-ios .profile-card strong,
html.native-ios .stock-row strong,
html.native-ios .empty-state strong {
  color: var(--ink);
}

.screen {
  width: 100%;
  max-width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--screen-top-pad) var(--screen-side-pad) var(--tabbar-clearance);
  scroll-padding-top: var(--screen-top-pad);
  scroll-padding-bottom: var(--tabbar-clearance);
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

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

.app-header,
.header-actions,
.chips,
.status-row,
.section-heading,
.text-action,
.link-action,
.primary-pill,
.completion-strip,
.tabbar,
.form-actions {
  display: flex;
  align-items: center;
}

.app-header {
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
}

.app-header > div:first-child,
.view,
.screen > section,
.panel,
.protocol-card,
.timeline-card,
.history-hero,
.compliance-card,
.premium-card,
.metric-tile,
.care-card,
.profile-card,
.stock-row,
.guide-actions button,
.routine-card,
.detail-grid div,
.setting-row {
  min-width: 0;
  max-width: 100%;
}

.date-label,
.kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  letter-spacing: 0;
}

h1,
h2,
h3,
p,
small,
strong,
span,
button,
label {
  overflow-wrap: break-word;
}

.header-actions {
  gap: 10px;
  flex-shrink: 0;
}

.icon-button {
  width: 43px;
  height: 43px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(31, 42, 35, 0.07);
  transition: transform 180ms ease, background 180ms ease;
}

.icon-button svg {
  width: 20px;
}

.badge-button span {
  position: absolute;
  right: -3px;
  top: -4px;
  padding: 3px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffbd54, #ef9631);
  color: white;
  font: 700 0.58rem var(--mono);
}

.guide-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 241, 0.9)),
    var(--surface-solid);
}

.guide-actions {
  display: grid;
  gap: 9px;
}

.guide-actions button {
  min-height: 66px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(52, 112, 68, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
}

.guide-actions svg {
  width: 22px;
  color: var(--accent-strong);
}

.guide-actions strong,
.guide-actions small {
  display: block;
}

.guide-actions small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.28;
}

.routine-panel {
  background:
    radial-gradient(circle at 88% 10%, rgba(97, 185, 120, 0.14), transparent 28%),
    rgba(255, 255, 255, 0.9);
}

.routine-list {
  display: grid;
  gap: 9px;
}

.routine-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(35, 47, 40, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.routine-card svg {
  width: 22px;
  color: var(--accent-strong);
}

.routine-card strong,
.routine-card small {
  display: block;
  min-width: 0;
}

.routine-card strong {
  font-size: 0.88rem;
}

.routine-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.28;
}

.routine-card em {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(52, 112, 68, 0.08);
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.routine-card.warning {
  border-color: rgba(241, 166, 64, 0.26);
}

.routine-card.warning svg,
.routine-card.warning em {
  color: #a46522;
}

.routine-card.locked {
  opacity: 0.88;
}

.daily-briefing-panel {
  background:
    radial-gradient(circle at 18% 8%, rgba(135, 206, 156, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 241, 0.9));
}

.daily-briefing {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.daily-score,
.daily-summary,
.daily-chip {
  border: 1px solid rgba(35, 47, 40, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.daily-score {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.daily-score span,
.daily-score small,
.daily-summary small,
.daily-chip span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.daily-score strong {
  color: var(--ink);
  font: 950 2rem/0.95 var(--display);
}

.daily-score.good {
  border-color: rgba(72, 151, 93, 0.22);
}

.daily-score.attention {
  border-color: rgba(241, 166, 64, 0.26);
}

.daily-score.warning {
  border-color: rgba(198, 88, 72, 0.28);
}

.daily-summary {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
}

.daily-summary strong,
.daily-summary span,
.daily-summary small {
  display: block;
  min-width: 0;
}

.daily-summary strong {
  font-size: 1rem;
}

.daily-summary span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 850;
}

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

.daily-chip {
  min-height: 78px;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.daily-chip svg {
  width: 18px;
  color: var(--accent-strong);
}

.daily-chip strong {
  font-size: 0.84rem;
  line-height: 1.12;
}

.daily-chip.attention svg,
.daily-chip.warning svg {
  color: #a46522;
}

.search-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  animation: rise 260ms ease both;
}

.search-panel label,
.form-grid label,
.full-label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #3e4741;
  font-size: 0.77rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(35, 47, 40, 0.14);
  border-radius: 14px;
  background: #f8faf7;
  color: var(--ink);
  outline: 0;
}

input {
  height: 44px;
  padding: 0 12px;
}

input[type="file"] {
  height: auto;
  padding: 10px;
}

textarea {
  min-height: 108px;
  resize: vertical;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: rgba(69, 125, 101, 0.55);
  box-shadow: 0 0 0 4px rgba(69, 125, 101, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.view {
  display: none;
  animation: rise 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.view.active {
  display: block;
}

.chips {
  gap: 10px;
  margin: 17px 0 16px;
  overflow-x: auto;
}

.chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.84);
  color: #4f5953;
  font-size: 0.82rem;
  font-weight: 800;
  transition: background 180ms ease, border-color 180ms ease;
}

.chip.active {
  border-color: rgba(29, 37, 32, 0.04);
  background: #ffffff;
  color: var(--ink);
}

.chip svg {
  width: 14px;
}

.protocol-card {
  min-height: 288px;
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 10px;
  overflow: hidden;
  padding: 25px 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.96), transparent 28%),
    linear-gradient(138deg, rgba(255, 255, 255, 0.98), rgba(232, 237, 239, 0.88) 52%, rgba(237, 242, 239, 0.92));
  box-shadow:
    0 22px 42px rgba(25, 32, 28, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.protocol-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 170px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(19, 24, 22, 0.16), transparent 68%);
  filter: blur(2px);
}

.protocol-copy {
  position: relative;
  z-index: 2;
}

.protocol-card h2 {
  max-width: 174px;
  font-size: 1.46rem;
  line-height: 1.04;
}

.protocol-card p:not(.kicker) {
  max-width: 180px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

.status-row {
  flex-wrap: wrap;
  gap: 8px;
  margin: 17px 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #67736c;
  font-size: 0.72rem;
  font-weight: 900;
}

.status.good {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.primary-pill {
  gap: 12px;
  min-height: 47px;
  min-width: 0;
  padding: 0 8px 0 18px;
  border-radius: 999px;
  background: var(--charcoal);
  color: white;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 13px 24px rgba(5, 7, 6, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.primary-pill svg {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  padding: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.protocol-card .primary-pill {
  font-size: 0.8rem;
}

.medicine-visual {
  z-index: 1;
  position: relative;
  min-height: 210px;
}

.glass-bottle {
  width: 74px;
  height: 146px;
  position: absolute;
  right: 64px;
  bottom: 7px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(25, 33, 30, 0.17);
  border-radius: 12px 12px 22px 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(194, 207, 207, 0.82) 20%, rgba(255, 255, 255, 0.96) 52%, rgba(194, 207, 207, 0.82) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(204, 214, 213, 0.3));
  box-shadow: 0 18px 25px rgba(19, 25, 22, 0.17), inset 8px 0 10px rgba(255, 255, 255, 0.28);
}

.glass-bottle::before {
  content: "";
  width: 46px;
  height: 27px;
  position: absolute;
  top: -20px;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(90deg, #214a64, #0c2538);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.28) inset;
}

.glass-bottle span {
  width: 64px;
  padding: 11px 3px;
  border-radius: 5px;
  background: #f8faf7;
  color: #1f2a27;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.18;
}

.glass-bottle.secondary {
  right: 4px;
  bottom: 5px;
  transform: scale(0.97);
}

.glass-bottle.secondary::before {
  background: linear-gradient(90deg, #51585d, #15191c);
}

.glass-bottle.secondary span {
  color: #303738;
}

.dose-wheel {
  width: 106px;
  position: absolute;
  right: -22px;
  bottom: 35px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  transform: rotate(-10deg);
  border-radius: 17px;
  background: linear-gradient(135deg, #dfe5e1, #ffffff);
  box-shadow: 0 18px 24px rgba(19, 25, 22, 0.12);
  animation: floaty 4.8s ease-in-out infinite;
}

.dose-wheel span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #cdd8d5 65%);
}

.panel,
.insight-grid,
.timeline-card,
.calendar-strip,
.history-hero,
.compliance-card,
.emergency-panel,
.danger-button,
.library-heading,
.reminder-panel,
.care-panel,
.hydration-panel,
.stock-panel {
  margin-top: 20px;
}

.panel {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 16px 32px rgba(36, 44, 38, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading > div,
.text-action span,
.link-action span {
  min-width: 0;
}

.section-heading h2 {
  font-size: 1.1rem;
}

.text-action,
.link-action {
  gap: 7px;
  background: transparent;
  color: #435049;
  font-size: 0.82rem;
  font-weight: 900;
}

.text-action svg {
  width: 27px;
  height: 27px;
  padding: 6px;
  border-radius: 50%;
  background: #edf2ed;
}

.link-action svg {
  width: 16px;
}

.dose-list,
.history-list,
.rule-list,
.privacy-list {
  display: grid;
  gap: 8px;
}

.dose-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.dose-main,
.history-row div,
.care-card > span:not(.care-avatar),
.profile-card span,
.stock-row span,
.setting-row span,
.refill-row span,
.plan-option > span:first-child,
.water-meter > div,
.metric-tile,
.reminder-grid div {
  min-width: 0;
}

.dose-item:last-child {
  border-bottom: 0;
}

.dose-check {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #dce4dd;
  border-radius: 50%;
  background: white;
  color: white;
}

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

.dose-main strong,
.med-card h3 {
  display: block;
  font-size: 0.92rem;
}

.dose-main strong,
.dose-main span,
.history-row strong,
.history-row span,
.care-card strong,
.care-card small,
.profile-card strong,
.profile-card small,
.stock-row strong,
.stock-row small,
.metric-tile p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dose-main strong,
.dose-main span,
.history-row strong,
.history-row span,
.care-card strong,
.care-card small,
.profile-card strong,
.profile-card small,
.stock-row strong,
.stock-row small {
  white-space: nowrap;
}

.dose-main span,
.dose-meta,
.med-card p,
.history-row span,
.metric-tile p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.dose-meta,
.metric-tile strong,
.history-hero h2,
.emergency-panel strong {
  font-family: var(--mono);
}

.dose-chevron {
  width: 16px;
  color: #98a39d;
}

.completion-strip {
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6f1e8, #eef4ef);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.completion-track {
  width: 96px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8e3da;
}

.completion-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 32px;
  color: var(--accent);
}

.empty-state strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.empty-state span {
  max-width: 260px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 10px;
}

.metric-tile {
  width: 100%;
  min-height: 112px;
  padding: 15px;
  border: 0;
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  text-align: left;
  box-shadow: 0 14px 26px rgba(36, 44, 38, 0.06);
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.metric-tile strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.75rem;
  letter-spacing: 0;
}

.metric-tile.warning {
  background: linear-gradient(180deg, #fff9ef, #fffdf8);
}

.water-meter {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.water-glass {
  width: 64px;
  height: 112px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(37, 95, 74, 0.24);
  border-radius: 16px 16px 24px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(231, 241, 237, 0.72));
}

.water-glass span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  border-radius: 18px 18px 20px 20px;
  background: linear-gradient(180deg, #89c8d5, #4f9aa7);
  transition: height 240ms ease;
}

.water-meter strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.8rem;
}

.water-meter p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.water-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  max-width: 100%;
  overflow: hidden;
}

.water-dots span {
  width: 16px;
  flex: 0 0 16px;
  height: 16px;
  border-radius: 50%;
  background: #dde8e2;
}

.water-dots span.done {
  background: #4f9aa7;
}

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

.reminder-grid div {
  min-height: 78px;
  padding: 12px;
  border-radius: 18px;
  background: #f4f7f2;
}

.reminder-grid span,
.stock-row small,
.profile-card small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.28;
}

.reminder-grid strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.timeline-card,
.history-hero,
.compliance-card {
  padding: 22px;
  border-radius: 30px;
  background: var(--charcoal);
  color: white;
  box-shadow: var(--shadow);
}

.premium-card {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding: 22px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 10%, rgba(157, 238, 172, 0.18), transparent 32%),
    radial-gradient(circle at 8% 90%, rgba(89, 188, 159, 0.12), transparent 34%),
    linear-gradient(145deg, #07110c 0%, #020403 76%);
  color: white;
  box-shadow: var(--shadow);
}

.premium-card::after {
  content: "";
  width: 170px;
  height: 170px;
  position: absolute;
  right: -72px;
  bottom: -82px;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.premium-card h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.premium-card p {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  line-height: 1.42;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.premium-card .premium-subcopy {
  margin-top: 8px;
  color: rgba(184, 239, 192, 0.9);
  font-size: 0.78rem;
  font-weight: 850;
}

.premium-plans {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.premium-value-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  position: relative;
  z-index: 1;
}

.premium-value-row span {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(184, 239, 192, 0.2);
  border-radius: 18px;
  background: rgba(184, 239, 192, 0.1);
}

.premium-value-row strong,
.premium-value-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.premium-value-row strong {
  color: #f7fff7;
  font-size: 0.86rem;
  font-weight: 950;
}

.premium-value-row small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1.25;
}

.premium-proof,
.premium-compare {
  display: grid;
  position: relative;
  z-index: 1;
  gap: 8px;
}

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

.premium-proof span,
.premium-compare div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.premium-proof span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  align-content: center;
  padding: 9px;
  border-radius: 17px;
}

.premium-proof strong,
.premium-proof small,
.premium-compare span,
.premium-compare strong {
  display: block;
  min-width: 0;
}

.premium-proof strong {
  color: #f8fff8;
  font-size: 0.74rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.premium-proof small,
.premium-compare span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.premium-compare {
  gap: 9px;
}

.premium-compare div {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border-radius: 18px;
}

.premium-compare strong {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  line-height: 1.28;
}

.plan-option {
  min-width: 0;
  max-width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.plan-option.featured {
  border-color: rgba(184, 239, 192, 0.32);
  background:
    linear-gradient(135deg, rgba(184, 239, 192, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.06);
}

.plan-check {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.58);
}

.plan-check svg {
  width: 15px;
  height: 15px;
}

.plan-option.active {
  border-color: rgba(156, 232, 167, 0.7);
  background: rgba(232, 245, 234, 0.14);
}

.plan-option.active .plan-check {
  background: #b8efc0;
  color: #07100b;
}

.plan-option strong,
.plan-option small,
.plan-price b,
.plan-price em {
  display: block;
}

.plan-option strong {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 0.95rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.plan-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(184, 239, 192, 0.22);
  border-radius: 999px;
  background: rgba(184, 239, 192, 0.13);
  color: #caffcf;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.plan-option small,
.plan-price em {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
}

.plan-price {
  grid-column: 2;
  text-align: left;
}

.plan-price b {
  font-family: var(--sans);
  font-size: 1.05rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.premium-price {
  width: max-content;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.premium-price strong,
.premium-price span {
  display: block;
}

.premium-price strong {
  font-family: var(--mono);
  font-size: 1.3rem;
}

.premium-price span,
.premium-status {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 800;
}

.premium-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.premium-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 800;
}

.premium-card li svg {
  width: 18px;
  color: #9ce8a7;
}

.premium-card .primary-pill {
  width: 100%;
  max-width: 100%;
  min-height: 54px;
  justify-content: space-between;
  background: white;
  color: var(--charcoal);
}

.premium-card .primary-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.premium-card .primary-pill svg {
  background: #edf6ed;
  color: var(--accent-strong);
}

.ghost-on-dark {
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 900;
}

.premium-message {
  display: none;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid rgba(184, 239, 192, 0.18);
  border-radius: 16px;
  background: rgba(184, 239, 192, 0.09);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.premium-message.show {
  display: block;
}

.premium-message.error {
  border-color: rgba(255, 161, 133, 0.32);
  background: rgba(255, 161, 133, 0.12);
  color: #ffd8cc;
}

.premium-message.success {
  color: #d7ffdc;
}

.premium-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.premium-trust-row span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.66rem;
  font-weight: 900;
}

.premium-trust-row svg {
  width: 14px;
  height: 14px;
  color: #9ce8a7;
}

.premium-legal {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
  padding-top: 2px;
}

.premium-legal p {
  max-width: none;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.premium-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.premium-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  font-weight: 900;
  text-decoration: none;
}

.native-status {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.35;
}

.settings-list,
.refill-settings-list {
  display: grid;
  gap: 9px;
}

.setting-row,
.refill-row {
  display: grid;
  grid-template-columns: 1fr minmax(94px, 130px);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #f4f7f2;
}

.language-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(35, 47, 40, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(232, 241, 233, 0.8)),
    #f4f7f2;
}

.language-card > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
}

.language-card strong {
  font-size: 0.86rem;
}

.language-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.language-chip {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid rgba(35, 47, 40, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.language-chip span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border-radius: 10px;
  background: rgba(52, 112, 68, 0.1);
  color: #2b5f38;
  font-size: 0.68rem;
  font-weight: 950;
}

.language-chip strong {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-chip.active {
  border-color: rgba(91, 197, 115, 0.58);
  background: linear-gradient(135deg, rgba(91, 197, 115, 0.23), rgba(255, 255, 255, 0.84));
}

.setting-row span,
.refill-row span {
  display: grid;
  gap: 2px;
}

.setting-row strong,
.refill-row strong {
  font-size: 0.86rem;
}

.setting-row small,
.refill-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.setting-row input,
.setting-row select,
.refill-row input {
  min-height: 40px;
  border: 1px solid rgba(35, 47, 40, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 800;
}

.setting-row select {
  padding: 0 10px;
}

.setting-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  justify-self: end;
  accent-color: var(--accent);
}

.timeline-card {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 12px;
  align-items: center;
}

.timeline-card p:not(.kicker),
.compliance-card p,
.history-hero span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.week-ring {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 25%, rgba(255, 255, 255, 0.14) 0);
}

.week-ring span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--charcoal);
  font: 800 1rem var(--mono);
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.day-pill {
  width: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px 0;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.day-pill strong {
  color: var(--ink);
  font-family: var(--mono);
}

.day-pill.done {
  background: var(--accent-soft);
}

.rule-list div,
.history-row,
.privacy-list label,
.privacy-list div,
.stock-row,
.profile-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: #4f5953;
  font-size: 0.8rem;
  line-height: 1.36;
}

.rule-list svg {
  width: 20px;
  color: var(--accent);
}

.privacy-list svg {
  width: 18px;
  color: var(--accent);
}

.panel-copy {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.care-dashboard {
  display: grid;
  gap: 9px;
}

.care-card {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(27, 34, 30, 0.04);
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(248, 251, 248, 0.96), rgba(239, 245, 240, 0.9));
  text-align: left;
}

.care-card.active {
  background: linear-gradient(180deg, #ebf7ed, #f8fbf7);
}

.care-card.locked,
.profile-card.locked,
.stock-row.locked {
  border: 1px dashed rgba(52, 112, 68, 0.24);
  background: rgba(255, 255, 255, 0.58);
}

.care-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--charcoal);
  color: white;
  font-weight: 900;
}

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

.care-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.care-card svg {
  width: 20px;
  color: var(--accent);
}

.care-avatar svg {
  color: white;
}

.profile-list,
.stock-list {
  display: grid;
  gap: 8px;
}

.profile-card {
  width: 100%;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #f4f7f2;
  text-align: left;
}

.profile-card.active {
  border-color: rgba(69, 125, 101, 0.28);
  background: var(--accent-soft);
}

.profile-card svg,
.stock-row svg {
  width: 20px;
  color: var(--accent);
}

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

.med-card {
  width: 100%;
  min-height: 148px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-align: left;
  box-shadow:
    0 14px 28px rgba(36, 44, 38, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.med-visual {
  width: 42px;
  height: 68px;
  position: relative;
  border: 1px solid #d7dfdd;
  border-radius: 9px 9px 13px 13px;
  background:
    linear-gradient(90deg, #f8fbfb, #cdd8d8 45%, #ffffff),
    linear-gradient(180deg, #ffffff, #dbe4e1);
  box-shadow: 0 10px 18px rgba(23, 31, 27, 0.12);
}

.med-visual::before {
  content: "";
  width: 27px;
  height: 13px;
  position: absolute;
  left: 8px;
  top: -8px;
  border-radius: 6px 6px 2px 2px;
  background: #244e66;
}

.med-visual::after {
  content: "";
  width: 36px;
  height: 22px;
  position: absolute;
  left: 3px;
  top: 30px;
  border-radius: 4px;
  background: var(--accent);
}

.stock-pill {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2ed;
  color: #5e6862;
  font-size: 0.68rem;
  font-weight: 900;
}

.stock-pill.low {
  background: #fff0df;
  color: #8a4b22;
}

.stock-row {
  width: 100%;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border-radius: 18px;
  background: #f4f7f2;
  color: inherit;
  text-align: left;
}

.stock-row.critical {
  background: #fff4e8;
  box-shadow: inset 0 0 0 1px rgba(138, 75, 34, 0.12);
}

.stock-row.calm {
  grid-template-columns: 28px 1fr;
}

.stock-row small {
  white-space: normal;
  overflow: visible;
  line-height: 1.35;
}

.stock-row button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--charcoal);
  color: white;
  font: 800 0.76rem var(--mono);
}

.history-hero h2 {
  margin-top: 8px;
  font-size: 3rem;
  line-height: 0.95;
}

.bars {
  height: 86px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 18px;
}

.bar {
  min-height: 12px;
  border-radius: 999px 999px 5px 5px;
  background: linear-gradient(180deg, #a7d7b0, #457d65);
}

.history-row {
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  min-height: 50px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.history-row svg {
  width: 16px;
}

.history-row time {
  color: var(--muted);
  font: 700 0.7rem var(--mono);
}

.history-row strong,
.history-row span {
  display: block;
}

.compliance-card svg {
  width: 32px;
  color: #a7d7b0;
}

.compliance-card h2 {
  margin: 12px 0 8px;
  font-size: 1.35rem;
}

.privacy-list label {
  grid-template-columns: 18px 1fr;
}

.privacy-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.privacy-rights {
  display: grid;
  gap: 9px;
}

.privacy-rights div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 16px;
  background: #f4f7f2;
}

.privacy-rights svg {
  width: 19px;
  color: var(--accent);
}

.privacy-rights strong,
.privacy-rights small {
  display: block;
}

.privacy-rights small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.32;
}

.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.consent-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.consent-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.vault-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.vault-actions .ghost-button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

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

.emergency-panel div {
  min-height: 104px;
  padding: 14px;
  border-radius: 22px;
  background: #fff8ef;
}

.emergency-panel span {
  display: block;
  color: #715039;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.emergency-panel strong {
  display: block;
  margin-top: 12px;
  color: #7c3b27;
  font-size: 1.42rem;
}

.danger-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 17px;
  background: #f8e8e5;
  color: var(--danger);
  font-weight: 900;
}

.danger-button svg {
  width: 19px;
}

.tabbar {
  min-height: var(--tabbar-height);
  position: absolute;
  right: 12px;
  bottom: var(--tabbar-offset);
  left: 12px;
  justify-content: space-around;
  gap: 2px;
  overflow: hidden;
  padding: 10px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px 30px 38px 38px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 18px 34px rgba(28, 36, 31, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(22px);
}

.tab {
  min-width: 0;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  gap: 4px;
  background: transparent;
  color: #7d8780;
  font-size: 0.66rem;
  font-weight: 900;
}

.tab svg {
  width: 22px;
}

.tab.active {
  color: var(--charcoal);
}

.add-tab {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  margin-top: -24px;
  border-radius: 50%;
  background: var(--charcoal);
  color: white;
  box-shadow: 0 14px 28px rgba(8, 10, 9, 0.28);
}

.sheet {
  width: min(390px, calc(100vw - 34px));
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: white;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(13, 17, 15, 0.24);
}

.report-sheet {
  width: min(960px, calc(100vw - 24px));
  max-height: min(900px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 34px;
  background:
    radial-gradient(circle at 88% 6%, rgba(97, 185, 120, 0.13), transparent 28%),
    linear-gradient(180deg, #ffffff, #f4f7f2);
  color: var(--ink);
  box-shadow: 0 34px 90px rgba(13, 17, 15, 0.28);
}

.report-sheet::backdrop {
  background: rgba(13, 17, 15, 0.46);
  backdrop-filter: blur(8px);
}

.report-frame {
  max-height: inherit;
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 18px;
}

.report-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 14px;
}

.report-top h2 {
  font-size: 1.34rem;
}

.report-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.report-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-controls select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(35, 47, 40, 0.14);
  border-radius: 14px;
  background: #f8faf7;
  color: var(--ink);
  font-weight: 800;
}

.report-document {
  margin-top: 14px;
  padding: 24px;
  overflow: auto;
  border-radius: 26px;
  background: #ffffff;
  box-shadow:
    0 18px 44px rgba(26, 35, 30, 0.1),
    inset 0 0 0 1px rgba(22, 31, 26, 0.06);
}

.report-doc-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e8e2;
}

.report-doc-header span {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-doc-header h1 {
  margin: 6px 0 8px;
  font-size: 1.75rem;
  line-height: 1.04;
}

.report-doc-header p,
.report-footer,
.report-events span,
.report-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.report-doc-header strong {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 17px;
  background: var(--charcoal);
  color: white;
  font-size: 1.25rem;
}

.report-warning {
  margin: 18px 0;
  padding: 13px 15px;
  border-radius: 17px;
  background: #fff8ef;
  color: #715039;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.42;
}

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

.report-grid div {
  min-height: 92px;
  padding: 13px;
  border-radius: 18px;
  background: #f4f7f2;
}

.report-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-grid strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 1.25rem;
}

.report-grid small {
  display: block;
  margin-top: 3px;
  font-weight: 800;
}

.report-section {
  margin-top: 22px;
}

.report-section h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.report-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
}

.report-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.report-section th,
.report-section td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5ebe5;
  text-align: left;
}

.report-section th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-events {
  display: grid;
  gap: 8px;
}

.report-events div {
  padding: 11px;
  border-radius: 15px;
  background: #f8faf7;
}

.report-events time {
  display: block;
  color: var(--muted);
  font: 800 0.68rem var(--mono);
}

.report-events strong,
.report-events span {
  display: block;
  margin-top: 3px;
}

.report-events strong {
  font-size: 0.86rem;
}

.report-footer {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid #e1e8e2;
}

.onboarding {
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100dvh - 44px);
  padding: 0;
  border: 0;
  border-radius: 34px;
  background:
    radial-gradient(circle at 82% 8%, rgba(97, 185, 120, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff, #f4f7f2);
  color: var(--ink);
  box-shadow: 0 34px 90px rgba(13, 17, 15, 0.28);
  overflow: hidden;
}

.onboarding::backdrop {
  background: rgba(15, 19, 17, 0.42);
  backdrop-filter: blur(8px);
}

.onboarding form {
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  padding: 24px 20px 20px;
  scrollbar-width: none;
}

.onboarding form::-webkit-scrollbar {
  display: none;
}

.onboarding .form-actions {
  margin-top: 14px;
  padding-top: 2px;
  background: transparent;
}

.onboarding-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--charcoal);
  color: white;
}

.onboarding-mark svg {
  width: 26px;
}

.onboarding h2 {
  max-width: 300px;
  margin-bottom: 10px;
  font-size: 1.45rem;
  line-height: 1.08;
}

.onboarding p:not(.kicker) {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.onboarding-points {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.onboarding-points span {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid rgba(24, 31, 27, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #425047;
  font-size: 0.76rem;
  font-weight: 900;
}

.onboarding-points svg {
  width: 16px;
  flex: 0 0 16px;
  color: var(--accent-strong);
}

.setup-path {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(52, 112, 68, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.setup-path > strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.setup-path > div {
  display: grid;
  gap: 8px;
}

.setup-path span {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid rgba(52, 112, 68, 0.2);
}

.setup-path b,
.setup-path small {
  display: block;
}

.setup-path b {
  font-size: 0.78rem;
}

.setup-path small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.28;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 18px 0 12px;
}

.choice-grid label {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 31, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 900;
}

.choice-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-grid label:has(input:checked) {
  border-color: rgba(52, 112, 68, 0.24);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sheet::backdrop {
  background: rgba(14, 18, 16, 0.36);
  backdrop-filter: blur(5px);
}

.sheet form {
  padding: 14px 18px 20px;
}

.sheet-handle {
  width: 48px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: #dbe1dc;
}

.sheet h2 {
  margin-bottom: 14px;
  font-size: 1.1rem;
}

.sheet-options,
.form-grid {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.sheet-options.compact {
  margin-top: 12px;
}

.medicine-detail {
  display: grid;
  gap: 12px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #f4f7f2;
}

.detail-hero .med-visual {
  transform: scale(0.82);
  transform-origin: left center;
}

.detail-hero h3,
.detail-hero span {
  display: block;
}

.detail-hero h3 {
  font-size: 1.05rem;
}

.detail-hero span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

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

.detail-grid div {
  padding: 11px;
  border-radius: 16px;
  background: rgba(244, 247, 242, 0.9);
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-grid strong {
  margin-top: 5px;
  font-size: 0.84rem;
}

.sheet-options button {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 16px;
  background: #f4f6f2;
  font-weight: 900;
  text-align: left;
}

.sheet-options svg {
  width: 22px;
  color: var(--accent);
}

.form-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.form-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.ghost-button,
.solid-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 14px;
  font-weight: 900;
}

.ghost-button {
  background: #eff2ee;
}

.solid-button {
  background: var(--charcoal);
  color: white;
}

.wide-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.wide-button svg {
  width: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-offset) + var(--tabbar-height) + max(14px, env(safe-area-inset-bottom)));
  z-index: 4;
  max-width: min(360px, calc(100vw - 30px));
  padding: 12px 15px;
  border-radius: 999px;
  background: var(--charcoal);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080b0a;
    --surface: rgba(19, 26, 22, 0.92);
    --surface-solid: #111813;
    --ink: #f5f8f4;
    --muted: #a8b5ad;
    --line: rgba(232, 245, 234, 0.1);
    --accent: #86d79a;
    --accent-strong: #b8efc0;
    --accent-soft: rgba(134, 215, 154, 0.16);
    --amber: #f3bb65;
    --danger: #ff9c91;
    --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
    color-scheme: dark;
  }

  body {
    background:
      radial-gradient(circle at 18% 8%, rgba(130, 196, 152, 0.13), transparent 30%),
      radial-gradient(circle at 86% 86%, rgba(62, 92, 72, 0.35), transparent 34%),
      linear-gradient(145deg, #070a09 0%, #101712 52%, #080c0a 100%),
      var(--bg);
    color: var(--ink);
  }

  body::after {
    opacity: 0.1;
    background-image: radial-gradient(rgba(232, 245, 234, 0.22) 0.6px, transparent 0.6px);
  }

  .ambient {
    background: rgba(118, 175, 135, 0.18);
  }

  .device {
    background:
      linear-gradient(180deg, rgba(16, 23, 19, 0.96), rgba(8, 12, 10, 0.98)),
      #0b100d;
    box-shadow:
      0 46px 120px rgba(0, 0, 0, 0.48),
      inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  html.native-ios body {
    background: var(--bg);
  }

  .icon-button,
  .chip,
  .chip.active,
  .search-panel,
  .panel,
  .metric-tile,
  .med-card,
  .day-pill,
  .profile-card,
  .stock-row,
  .setting-row,
  .refill-row,
  .language-card,
  .language-chip,
  .privacy-rights div,
  .reminder-grid div,
  .tabbar,
  .report-controls,
  .report-document,
  .report-events div,
  .guide-actions button,
  .choice-grid label,
  .onboarding-points span,
  .setup-path,
  .routine-card,
  .daily-score,
  .daily-summary,
  .daily-chip,
  .sheet-options button,
  .ghost-button {
    border-color: rgba(232, 245, 234, 0.08);
    background: rgba(18, 25, 21, 0.9);
    color: var(--ink);
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .tabbar {
    background: rgba(14, 20, 17, 0.9);
    backdrop-filter: blur(22px);
  }

  .tab {
    color: #8f9c94;
  }

  .tab.active,
  .chip.active,
  .day-pill strong,
  .empty-state strong,
  .dose-main strong,
  .med-card h3,
  .setting-row strong,
  .refill-row strong,
  .care-card strong,
  .profile-card strong,
  .stock-row strong {
    color: var(--ink);
  }

  .protocol-card {
    border-color: rgba(232, 245, 234, 0.08);
    background:
      radial-gradient(circle at 78% 18%, rgba(146, 207, 166, 0.16), transparent 30%),
      linear-gradient(138deg, rgba(23, 31, 27, 0.98), rgba(14, 20, 17, 0.96) 58%, rgba(18, 27, 22, 0.98));
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.28);
  }

  .guide-panel {
    background:
      radial-gradient(circle at 88% 10%, rgba(134, 215, 154, 0.11), transparent 30%),
      rgba(18, 25, 21, 0.9);
  }

  .daily-briefing-panel {
    background:
      radial-gradient(circle at 18% 8%, rgba(134, 215, 154, 0.12), transparent 32%),
      rgba(18, 25, 21, 0.9);
  }

  .protocol-card::after {
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.42), transparent 68%);
  }

  .care-card,
  .care-card.active {
    border-color: rgba(134, 215, 154, 0.16);
    background: linear-gradient(180deg, rgba(22, 35, 27, 0.96), rgba(16, 24, 20, 0.94));
  }

  .care-card.locked,
  .profile-card.locked,
  .stock-row.locked {
    border-color: rgba(134, 215, 154, 0.28);
    background: rgba(18, 25, 21, 0.68);
  }

  .timeline-card,
  .history-hero,
  .compliance-card,
  .premium-card {
    background:
      radial-gradient(circle at 88% 10%, rgba(157, 238, 172, 0.18), transparent 32%),
      radial-gradient(circle at 8% 90%, rgba(89, 188, 159, 0.12), transparent 34%),
      linear-gradient(145deg, #07110c 0%, #020403 76%);
  }

  .premium-card .primary-pill,
  .solid-button {
    background: #f5f8f4;
    color: #07100b;
  }

  .premium-card .primary-pill svg {
    background: rgba(52, 112, 68, 0.12);
    color: #347044;
  }

  .plan-option {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
  }

  .plan-option.active {
    border-color: rgba(134, 215, 154, 0.74);
    background: rgba(134, 215, 154, 0.13);
  }

  .search-panel label,
  .form-grid label,
  .full-label,
  .text-action,
  .link-action,
  .rule-list div,
  .history-row,
  .privacy-list label,
  .stock-row,
  .profile-card {
    color: #c8d2cc;
  }

  input,
  textarea,
  select,
  .setting-row input,
  .setting-row select,
  .refill-row input,
  .report-controls select {
    border-color: rgba(232, 245, 234, 0.12);
    background: rgba(8, 12, 10, 0.9);
    color: var(--ink);
  }

  input::placeholder,
  textarea::placeholder {
    color: #758178;
  }

  .completion-strip {
    background: linear-gradient(90deg, rgba(65, 113, 78, 0.28), rgba(30, 48, 37, 0.92));
    color: var(--accent-strong);
  }

  .completion-track,
  .water-dots span {
    background: rgba(232, 245, 234, 0.12);
  }

  .water-glass {
    border-color: rgba(134, 215, 154, 0.28);
    background: linear-gradient(180deg, rgba(18, 26, 22, 0.92), rgba(20, 34, 29, 0.72));
  }

  .metric-tile.warning,
  .emergency-panel div,
  .report-warning {
    background: linear-gradient(180deg, rgba(81, 52, 27, 0.86), rgba(40, 29, 19, 0.94));
    color: #f7d4a4;
  }

  .emergency-panel span,
  .emergency-panel strong {
    color: #ffd8a3;
  }

  .danger-button {
    background: rgba(86, 34, 31, 0.9);
    color: #ffafa6;
  }

  .sheet,
  .onboarding,
  .report-sheet {
    background:
      radial-gradient(circle at 82% 8%, rgba(134, 215, 154, 0.13), transparent 30%),
      linear-gradient(180deg, #151d18, #0d130f);
    color: var(--ink);
  }

  .routine-panel {
    background:
      radial-gradient(circle at 88% 10%, rgba(134, 215, 154, 0.12), transparent 28%),
      rgba(18, 25, 21, 0.9);
  }

  .routine-card em {
    background: rgba(134, 215, 154, 0.12);
    color: var(--accent-strong);
  }

  .setup-path span {
    border-left-color: rgba(134, 215, 154, 0.26);
  }

  .sheet-handle {
    background: rgba(232, 245, 234, 0.24);
  }

  .sheet::backdrop,
  .onboarding::backdrop,
  .report-sheet::backdrop {
    background: rgba(0, 0, 0, 0.62);
  }

  .report-section th,
  .report-section td,
  .report-doc-header,
  .report-footer,
  .history-row {
    border-color: var(--line);
  }

  .stock-row.critical {
    background: #2b2119;
    box-shadow: inset 0 0 0 1px rgba(255, 190, 123, 0.22);
  }

  .toast,
  .add-tab,
  .care-avatar,
  .stock-row button,
  .onboarding-mark,
  .report-doc-header strong {
    background: #f5f8f4;
    color: #07100b;
  }
}

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

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-10deg);
  }
  50% {
    transform: translateY(-7px) rotate(-8deg);
  }
}

@media (max-width: 600px) {
  body {
    display: block;
    overflow: hidden;
    background: var(--bg);
  }

  .ambient {
    display: none;
  }

  .device {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  html.native-ios body {
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  html.native-ios .device {
    min-height: 100svh;
    height: auto;
    overflow: visible;
  }

  html.native-ios .screen {
    min-height: 100svh;
    overflow: visible;
  }

  .device::before {
    display: none;
  }

  .screen {
    --screen-top-pad: max(42px, calc(env(safe-area-inset-top) + 18px));
    --screen-side-pad: max(16px, calc(env(safe-area-inset-left) + 16px));
    --tabbar-offset: 0px;
    --tabbar-height: calc(92px + env(safe-area-inset-bottom));
    --tabbar-clearance: calc(var(--tabbar-height) + 28px);
    padding-right: max(16px, calc(env(safe-area-inset-right) + 16px));
  }

  .tabbar {
    right: 0;
    bottom: 0;
    left: 0;
    min-height: var(--tabbar-height);
    padding-bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .report-sheet {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .onboarding {
    width: min(390px, calc(100vw - 24px));
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    margin-top: max(12px, env(safe-area-inset-top));
    margin-bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 28px;
  }

  .onboarding form {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    padding: 20px 18px max(22px, calc(env(safe-area-inset-bottom) + 14px));
  }

  .onboarding h2 {
    font-size: 1.34rem;
  }

  .onboarding .form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding .form-actions button {
    width: 100%;
    min-width: 0;
  }

  .report-frame {
    padding: 14px;
  }

  .report-controls {
    grid-template-columns: 1fr;
  }

  .report-document {
    padding: 18px;
  }

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

  .report-section {
    overflow-x: auto;
  }

  .daily-briefing {
    grid-template-columns: minmax(0, 1fr);
  }

  .daily-score {
    min-height: 88px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding: 14px;
    text-align: left;
  }

  .daily-score small {
    grid-column: 1 / -1;
  }

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

@media (max-width: 380px) {
  .screen,
  html.native-ios .screen {
    --screen-side-pad: max(14px, calc(env(safe-area-inset-left) + 14px));
    padding-right: max(14px, calc(env(safe-area-inset-right) + 14px));
  }

  h1 {
    font-size: 1.78rem;
  }

  .protocol-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding: 22px 16px;
  }

  .protocol-card h2,
  .protocol-card p:not(.kicker) {
    max-width: 100%;
  }

  .medicine-visual {
    min-height: 162px;
    margin-top: 8px;
  }

  .glass-bottle {
    right: 96px;
    bottom: 8px;
    transform: scale(0.88);
    transform-origin: bottom right;
  }

  .glass-bottle.secondary {
    right: 42px;
    transform: scale(0.84);
  }

  .dose-wheel {
    right: 10px;
    bottom: 28px;
    transform: scale(0.88) rotate(-10deg);
    transform-origin: bottom right;
  }

  .insight-grid,
  .reminder-grid,
  .emergency-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .water-meter {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 13px;
  }

  .water-meter strong {
    font-size: 1.55rem;
  }

  .setting-row,
  .refill-row,
  .language-card > span,
  .plan-option,
  .routine-card,
  .daily-grid,
  .vault-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-check {
    display: none;
  }

  .plan-price {
    text-align: left;
  }

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

  .premium-proof span {
    min-height: 54px;
    padding: 8px 7px;
  }

  .premium-proof strong {
    font-size: 0.68rem;
  }

  .premium-proof small {
    font-size: 0.56rem;
  }

  .completion-strip {
    border-radius: 18px;
    flex-wrap: wrap;
    padding: 12px 14px;
  }
}

@media (min-width: 700px) {
  html.native-ios .screen {
    width: min(100%, 860px);
    margin: 0 auto;
    --screen-top-pad: max(46px, calc(env(safe-area-inset-top) + 26px));
    --screen-side-pad: max(28px, env(safe-area-inset-left));
    --tabbar-height: 88px;
    --tabbar-clearance: 146px;
    padding-right: max(28px, env(safe-area-inset-right));
  }

  html.native-ios .tabbar {
    width: min(560px, calc(100vw - 48px));
    right: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    min-height: var(--tabbar-height);
    padding-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    transform: translateX(-50%);
  }
}
