/* Heart Fluid Check — senior-friendly */
/* Default = warm cream (inviting). Themes via data-theme on <html>/<body>. */
:root,
[data-theme="warm-cream"] {
  --navy: #1B3A5C;
  --teal: #2A6F7F;
  --bg: #FBF6EE;
  --card: #FFFCF8;
  --text: #1a1a1a;
  --muted: #4a3f36;
  --green: #1F5C3A;
  --green-bg: #E6F4EA;
  --amber: #8A5A00;
  --amber-bg: #FFF4E5;
  --red: #8B2E2E;
  --red-bg: #FDECEC;
  --border: #E8D9C8;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem; /* ~18px */
  --hero-grad: linear-gradient(145deg, #fff8f0 0%, #ffe4d4 42%, #e5f5f2 100%);
  --hero-border: #d4a090;
  --shadow: 0 2px 10px rgba(80, 50, 30, 0.07);
  --top-bar: #1B3A5C;
}

[data-theme="soft-teal"] {
  --navy: #1B3A5C;
  --teal: #2A6F7F;
  --bg: #F4F7F8;
  --card: #ffffff;
  --text: #111111;
  --muted: #3d4a54;
  --green: #1F5C3A;
  --green-bg: #E6F4EA;
  --amber: #8A5A00;
  --amber-bg: #FFF4E5;
  --red: #8B2E2E;
  --red-bg: #FDECEC;
  --border: #D5DEE3;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem;
  --hero-grad: linear-gradient(145deg, #f0fafb 0%, #e8f2f8 55%, #dff3ef 100%);
  --hero-border: #2A6F7F;
  --shadow: 0 2px 8px rgba(30, 50, 60, 0.06);
  --top-bar: #1B3A5C;
}

[data-theme="soft-sky"] {
  --navy: #1A3A5C;
  --teal: #2B6E8A;
  --bg: #EEF6FB;
  --card: #FFFFFF;
  --text: #122033;
  --muted: #3d5163;
  --green: #1F5C3A;
  --green-bg: #E6F4EA;
  --amber: #8A5A00;
  --amber-bg: #FFF4E5;
  --red: #8B2E2E;
  --red-bg: #FDECEC;
  --border: #C5D8E6;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem;
  --hero-grad: linear-gradient(145deg, #f5fbff 0%, #dcebff 48%, #e8f7f4 100%);
  --hero-border: #6a9ec4;
  --shadow: 0 2px 10px rgba(40, 70, 100, 0.07);
  --top-bar: #1A3A5C;
}

[data-theme="gentle-lavender"] {
  --navy: #3A2F5C;
  --teal: #5A6F9F;
  --bg: #F5F2FA;
  --card: #FDFCFF;
  --text: #1a1528;
  --muted: #4a4458;
  --green: #1F5C3A;
  --green-bg: #E6F4EA;
  --amber: #8A5A00;
  --amber-bg: #FFF4E5;
  --red: #8B2E2E;
  --red-bg: #FDECEC;
  --border: #D8D0E6;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem;
  --hero-grad: linear-gradient(145deg, #faf7ff 0%, #ebe4f8 45%, #e8f4f2 100%);
  --hero-border: #9a8bc4;
  --shadow: 0 2px 10px rgba(60, 40, 90, 0.07);
  --top-bar: #3A2F5C;
}

[data-theme="soft-sage"] {
  --navy: #2A4538;
  --teal: #3F6F5A;
  --bg: #F2F6F1;
  --card: #FBFCFA;
  --text: #142019;
  --muted: #3f4f44;
  --green: #1F5C3A;
  --green-bg: #E6F4EA;
  --amber: #8A5A00;
  --amber-bg: #FFF4E5;
  --red: #8B2E2E;
  --red-bg: #FDECEC;
  --border: #C9D6C8;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem;
  --hero-grad: linear-gradient(145deg, #f7faf5 0%, #e4efe3 48%, #e8f4f0 100%);
  --hero-border: #7a9e86;
  --shadow: 0 2px 10px rgba(40, 60, 45, 0.07);
  --top-bar: #2A4538;
}

[data-theme="calm-slate"] {
  --navy: #FFFFFF;
  --teal: #9FE7F0;
  --bg: #1B2430;
  --card: #2C3848;
  --text: #FFFFFF;
  --muted: #E4EDF5;
  --green: #B6E8C0;
  --green-bg: #2F4A3A;
  --amber: #FFE08A;
  --amber-bg: #4A3E28;
  --red: #FFC7C7;
  --red-bg: #4A3030;
  --border: #8AA0B5;
  --radius: 18px;
  --tap: 56px;
  --body: 1.125rem;
  --hero-grad: linear-gradient(145deg, #3a4555 0%, #455468 50%, #3d5558 100%);
  --hero-border: #7EB8C4;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  --top-bar: #1E2630;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: var(--body);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app {
  max-width: 520px; margin: 0 auto; min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
.top {
  background: var(--top-bar, var(--navy)); color: #fff;
  padding: 18px 12px 10px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  /* Fully opaque so scrolled Today copy never bleeds through */
  isolation: isolate;
}
.top-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.top h1 { margin: 0; font-size: 1.45rem; font-weight: 700; flex: 1; min-width: 0; }
.app-version {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.9;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.tagline { margin: 4px 0 12px; opacity: 0.92; font-size: 1.05rem; }

.tabs {
  display: flex; gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 0; min-width: 0; min-height: 44px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.15); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 8px 2px; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.15;
}
.tab.active { background: #fff; color: var(--navy); }
main { padding: 14px 14px 24px; }
.view { display: none; }
.view.active { display: block; }
.date-line { font-size: 1.05rem; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow, 0 2px 8px rgba(40, 50, 60, 0.06));
}
.card h2 { margin: 0 0 10px; font-size: 1.22rem; color: var(--navy); }
.card h3 { margin: 14px 0 8px; font-size: 1.08rem; color: var(--navy); }
.label {
  display: block; font-weight: 700; margin: 14px 0 8px; font-size: 1.12rem;
}
.optional { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
input, textarea {
  width: 100%; font-size: 1.2rem; padding: 14px 16px;
  border: 2px solid #b8c5cc; border-radius: 12px;
  min-height: var(--tap); background: #fff;
  -webkit-appearance: none; appearance: none;
}
input[type="file"] {
  font-size: 1rem; padding: 10px; min-height: var(--tap);
}
input[type="date"] { min-height: var(--tap); }
textarea { min-height: 100px; resize: vertical; line-height: 1.4; }
.hint { color: var(--muted); font-size: 1rem; margin: 10px 0 0; line-height: 1.4; }
.row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: 0; }
.item-q { flex: 1; font-size: 1.1rem; line-height: 1.35; font-weight: 550; }
.toggle { display: flex; gap: 8px; flex-shrink: 0; }
.toggle button {
  min-width: 72px; min-height: 52px; border-radius: 12px;
  border: 2px solid #b8c5cc; background: #fff; font-size: 1.1rem; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.toggle button.on-yes { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.toggle button.on-no { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  min-height: var(--tap); border: 0; border-radius: 14px;
  font-size: 1.2rem; font-weight: 700; padding: 16px 18px; margin: 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--teal); color: #fff; }
.btn.secondary { background: #e8eef1; color: var(--navy); }
.btn.danger { background: var(--red); color: #fff; }
.result {
  border-radius: var(--radius); padding: 16px; margin: 12px 0;
  border: 2px solid transparent; font-size: 1.1rem; line-height: 1.45;
}
.result.green { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.result.amber { background: var(--amber-bg); border-color: var(--amber); color: #5c3d00; }
.result h3 { margin: 0 0 8px; font-size: 1.25rem; }
.emergency { border-color: #f0c0c0; background: #fffafa; }
.emergency ul { margin: 0 0 10px; padding-left: 1.15rem; line-height: 1.45; font-size: 1.05rem; }
.disclaimer { font-size: 0.95rem; color: var(--muted); line-height: 1.4; margin-top: 12px; }
.hidden { display: none !important; }
.ok { color: var(--green); font-weight: 700; font-size: 1.05rem; }
.warn { color: var(--amber); font-weight: 700; }
.log-entry {
  border-bottom: 1px solid var(--border); padding: 14px 0;
}
.log-entry:last-child { border-bottom: 0; }
.log-entry strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }
.badge {
  display: inline-block; font-size: 0.85rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; margin-right: 6px;
}
.badge.take { background: var(--amber-bg); color: var(--amber); }
.badge.skip { background: var(--green-bg); color: var(--green); }
.empty { color: var(--muted); padding: 8px 0; font-size: 1.05rem; }

.echo-summary {
  background: linear-gradient(135deg, #eef5f8 0%, #fff 100%);
  border-color: #c5d8e0;
}
.echo-summary .echo-line {
  font-size: 1.08rem; font-weight: 700; color: var(--navy); margin: 0;
}
.echo-summary .echo-sub {
  font-size: 0.98rem; color: var(--muted); margin: 4px 0 0;
}

.heart-chart-glance {
  background: #1B3A5C;
  border: 2px solid #0f2438;
  color: #fff;
}
.heart-chart-glance h2,
.heart-chart-glance > .hc-fold {
  color: #fff;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.heart-chart-glance > .hc-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.heart-chart-glance > .hc-fold::-webkit-details-marker { display: none; }
.heart-chart-glance > .hc-fold::after {
  content: "›";
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.85;
  transform: rotate(90deg);
}
.heart-chart-glance[open] > .hc-fold { margin-bottom: 10px; }
.heart-chart-glance[open] > .hc-fold::after { transform: rotate(-90deg); }
.heart-chart-glance:not([open]) > .heart-chart-summary { display: none; }
.heart-chart-glance .btn.primary {
  background: #fff;
  color: var(--navy);
  margin-top: 12px;
}
.heart-chart-summary { font-size: 1.02rem; line-height: 1.45; }
.heart-chart-summary .hc-block {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.heart-chart-summary .hc-block:last-child {
  border-bottom: 0; margin-bottom: 0; padding-bottom: 0;
}
.heart-chart-summary .hc-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.9;
  margin-bottom: 2px;
  cursor: pointer;
}
.heart-chart-summary .hc-preview {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
}
.heart-chart-summary details.hc-block > .hc-value { display: none; }
.heart-chart-summary details.hc-block[open] > .hc-preview { display: none; }
.heart-chart-summary details.hc-block[open] > .hc-value { display: block; margin-top: 6px; }
.heart-chart-summary .hc-value { color: #fff; font-weight: 600; }
.heart-chart-summary .hc-empty {
  opacity: 0.7; font-weight: 400; font-style: italic;
}

.jump-bar {
  position: sticky;
  top: 112px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 12px;
  margin: 0 0 8px;
  background: var(--bg);
}
.jump-btn {
  flex: 1 1 auto;
  min-height: 48px;
  min-width: calc(33% - 8px);
  padding: 10px 12px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.jump-btn:active,
.jump-btn:focus {
  background: var(--navy);
  color: #fff;
}

.physical-assessment {
  margin: 4px 0 12px;
  padding: 12px 10px 4px;
  border-radius: var(--radius);
  background: #e8eef2;
  border: 1px solid #c5d0d8;
}
.section-banner {
  margin: 0 4px 4px;
  font-size: 1.15rem;
  color: var(--navy);
}
.section-banner-hint {
  margin: 0 4px 12px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.4;
}
.physical-assessment .card { margin-bottom: 12px; }

.install-help { border-color: #b8d0da; background: #f0f7fa; }
.install-steps {
  margin: 8px 0 0; padding-left: 1.2rem; line-height: 1.5; font-size: 1.02rem;
}
.install-steps li { margin-bottom: 8px; }

.extract-review { margin-top: 12px; color: #0f172a; }
.extract-findings-box {
  margin: 10px 0 14px;
  padding: 14px 14px 6px;
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: #f7fcfd;
  color: #0f172a;
}
.extract-findings-box .label { margin-top: 0; }
.extract-findings-box #extractObtainedDate {
  margin-bottom: 10px;
}
.snippet-list-in-box .snippet:first-child { padding-top: 4px; }
.snippet-list-in-box .snippet:last-child { border-bottom: 0; padding-bottom: 8px; }
.snippet {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.snippet:last-child { border-bottom: 0; }
.snippet input[type="checkbox"] {
  width: 28px; height: 28px; min-height: 28px; min-width: 28px;
  margin-top: 2px; flex-shrink: 0; accent-color: var(--teal);
  -webkit-appearance: checkbox; appearance: auto;
}
.snippet-body { flex: 1; min-width: 0; }
.snippet-tag {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--teal); margin-bottom: 2px;
}
.snippet-text {
  font-size: 1.02rem;
  line-height: 1.4;
  color: #0f172a;
  word-break: break-word;
}

.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-btn { display: block; text-align: center; cursor: pointer; margin: 10px 0; }
.highlight-upload { border: 2px solid var(--teal); background: #f0fafb; }
.highlight-upload h2 { color: var(--teal); }

/* Guidelines / 4 main heart medicines (GDMT) */
.sources-card {
  background: #f0f7fa;
  border-color: #b8d0da;
}
.source-list {
  margin: 6px 0 8px;
  padding-left: 1.2rem;
  line-height: 1.5;
  font-size: 1.02rem;
}
.source-list li { margin-bottom: 8px; }

.gdmt-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.gdmt-type-btn {
  min-height: 76px;
  border: 2px solid #b8c5cc;
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  font-size: 1.12rem;
  font-weight: 700;
  padding: 12px 10px;
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gdmt-type-btn .sub {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}
.gdmt-type-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.gdmt-type-btn.active .sub { color: rgba(255,255,255,0.88); }

.gdmt-list { margin-top: 6px; }
.gdmt-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 4px;
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gdmt-item:last-child { border-bottom: 0; }
.gdmt-item input[type="checkbox"] {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--teal);
  -webkit-appearance: checkbox;
  appearance: auto;
}
.gdmt-item-body { flex: 1; min-width: 0; }
.gdmt-item-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.gdmt-item-detail {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.gdmt-item.pillar .gdmt-item-title::after {
  content: " · one of the 4";
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
}

.pillar-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #eef5f8;
  border: 2px solid #c5d8e0;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--navy);
}
.pillar-summary strong { font-weight: 750; }
.pillar-summary .missing-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}
.pillar-summary .missing-list li { margin-bottom: 6px; }
.pillar-summary.all-in {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.meds-hint {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--amber-bg);
  border: 1px solid #e8c98a;
  color: #5c3d00;
  font-size: 1.02rem;
  line-height: 1.4;
}


/* Search */
.search-box-card {
  border: 2px solid var(--teal);
  background: #f0fafb;
  position: sticky;
  top: 112px;
  z-index: 7;
}
.search-box-card input[type="search"] {
  font-size: 1.25rem;
  min-height: 60px;
  padding: 16px 18px;
  border: 2px solid var(--navy);
}
.search-results { margin-top: 4px; }
.search-group {
  margin: 0 0 14px;
}
.search-group-title {
  font-size: 0.9rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  margin: 4px 4px 8px;
}
.search-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.search-row-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.search-row-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.search-empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.4;
}
/* Five primary tabs — keep readable */
.tab { font-size: 0.66rem; padding: 8px 1px; min-height: 44px; }

.med-check-list { margin: 8px 0 14px; }
.disclaimer { font-size: 0.98rem !important; color: #445; line-height: 1.4; }


.extract-echo-heading {
  font-weight: 700;
  color: var(--teal);
  font-size: 1.05rem;
  margin: 4px 0 6px;
}
.extract-other-heading {
  font-weight: 700;
  color: #555;
  font-size: 0.98rem;
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.snippet-num {
  font-weight: 800;
  color: var(--teal);
  margin-right: 2px;
}
.section-echo-box,
#section-echo {
  border: 2px solid var(--teal);
}
#section-echo .label {
  font-weight: 700;
}

/* Stent / vessel occlusion — one clinical box (matches echo extract look) */
.stent-one-box {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7fcfd;
  border: 2px solid var(--teal);
}
.stent-one-box .label {
  font-weight: 700;
}
.stent-one-summary {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e7f6f4;
  color: #0b5c55;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.35;
  min-height: 1.2em;
}
.stent-one-summary:empty {
  display: none;
}
.stent-one-box .stent-vessel-row {
  margin: 4px 0 2px;
}
.stent-one-box textarea {
  min-height: 72px;
}
@media (max-width: 520px) {
  .stent-one-box .stent-vessel-row {
    grid-template-columns: 1fr;
  }
}

.log-vitals {
  margin: 8px 0 4px;
  padding-left: 1.15rem;
  line-height: 1.45;
  font-size: 1.02rem;
}
.log-symptoms { margin-top: 6px; font-size: 0.98rem; line-height: 1.4; }
.log-sym-yes { margin: 4px 0; color: #8a5a00; }
.log-sym-no { margin: 4px 0; color: #355; }
.log-note { margin: 6px 0 0; font-size: 0.95rem; color: #444; }
.log-missing { margin: 6px 0; color: #777; font-size: 0.95rem; }

.extract-kept-banner {
  margin: 8px 0 10px;
  padding: 10px 12px;
  background: #e7f6f4;
  border-radius: 10px;
  font-weight: 600;
  color: #0b5c55;
  line-height: 1.35;
}
.extract-skipped {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.98rem;
}
.extract-skipped summary {
  cursor: pointer;
  color: #555;
  font-weight: 600;
  padding: 6px 0;
}

.log-sym-head { font-weight: 700; margin-top: 8px; font-size: 0.95rem; }
.log-reassess { margin-top: 10px; padding: 10px 12px; background: #f0f7fa; border-radius: 10px; }
.log-reassess strong { display: block; margin-bottom: 4px; color: var(--teal); }
.toggle button.on-same { background: #e8e8e8; border-color: #888; font-weight: 700; }
.reassess-overall { margin: 12px 0; }
.reassess-item { margin-bottom: 10px; }
.go-reassess { margin-top: 10px; display: block; width: 100%; }

/* Intro / welcome */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(165deg, #0f2a45 0%, #1B3A5C 42%, #1a5c5a 100%);
  color: #f4f8fb;
  padding: 28px 18px 48px;
}
.intro-inner {
  max-width: 560px;
  margin: 0 auto;
}
.intro-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 8px;
}
.intro-screen h1 {
  font-size: 1.85rem;
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 800;
  color: #fff;
}
.intro-lead {
  font-size: 1.12rem;
  line-height: 1.45;
  margin: 0 0 20px;
  opacity: 0.95;
}
.intro-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.intro-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 14px 16px;
}
.intro-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #9fe8df;
}
.intro-card ul {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.45;
  font-size: 1.02rem;
}
.intro-card li { margin-bottom: 6px; }
.intro-setup {
  background: #fff;
  color: #1a1a1a;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.intro-setup h2 { margin-top: 0; color: #1B3A5C; }
.intro-setup .hint { color: #444; }
.intro-actions {
  display: grid;
  gap: 10px;
}
.intro-screen .btn.ghost {
  background: transparent;
  color: #e8f2f8;
  border: 1px solid rgba(255,255,255,0.35);
}
.intro-disclaimer {
  margin-top: 18px;
  font-size: 0.88rem;
  opacity: 0.75;
  line-height: 1.35;
}
body.intro-open #app { visibility: hidden; }

.home-hero {
  background: var(--hero-grad, linear-gradient(145deg, #fff8f0 0%, #ffe4d4 42%, #e5f5f2 100%));
  border: 2px solid var(--hero-border, var(--teal));
  border-radius: 20px;
  box-shadow: var(--shadow, 0 4px 14px rgba(90, 60, 40, 0.08));
}
.home-kicker {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--teal);
}
.home-hero h2 {
  margin: 0 0 8px;
  font-size: 1.28rem;
  line-height: 1.25;
  color: var(--navy);
}
.home-lead {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.45;
}
.home-sub { margin-bottom: 0; }

.home-prn {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #fff8e8;
  border: 1px solid #e0c47a;
  border-radius: 10px;
  font-size: 1.02rem;
  line-height: 1.4;
  color: #3a2e10;
}
.home-prn strong { color: #6b4e00; }

.plan-choice {
  display: grid;
  gap: 10px;
  margin: 10px 0 6px;
}
.plan-choice-btn {
  text-align: left;
  border: 2px solid #b8c5cc;
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  padding: 14px 14px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.35;
}
.plan-choice-btn strong {
  display: block;
  font-size: 1.12rem;
  margin-bottom: 6px;
}
.plan-choice-desc {
  display: block;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--muted);
}
.plan-choice-btn.active {
  background: #e8f7f5;
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}
.plan-choice-btn.active strong { color: #0d5c54; }
.plan-choice-btn.active .plan-choice-desc { color: #1a3a36; }
.intro-setup .plan-choice-btn {
  background: #f7fcfd;
}
.intro-setup .plan-choice-btn.active {
  background: #e8f7f5;
}
.settings-plan-choice { margin-bottom: 14px; }
.home-prn.home-prn-daily {
  background: #eef6ff;
  border-color: #8eb4d8;
  color: #1a2e44;
}
.home-prn.home-prn-daily strong { color: #1B3A5C; }

.extract-echo-box,
.extract-lab-box,
.extract-other-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7fcfd;
  border: 2px solid var(--teal);
  color: #0f172a; /* v40: override .intro-screen nearly-white inherit */
}
.extract-lab-box {
  border-color: #6b8fad;
  background: #f4f8fb;
}
.extract-other-box {
  border-color: #9aa;
  background: #fafafa;
}
.extract-echo-box .extract-echo-heading,
.extract-lab-box .extract-other-heading,
.extract-other-box .extract-other-heading {
  margin: 0 0 10px;
}
.echo-line {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: #0f172a; /* v40: do not inherit wizard/intro nearly-white text */
}
.echo-line:last-child { border-bottom: 0; padding-bottom: 0; }
.echo-line-num {
  font-weight: 800;
  color: #0d9488; /* teal heading — high contrast on light boxes */
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.echo-line-text {
  font-size: 1.05rem;
  line-height: 1.45;
  word-break: break-word;
  color: #0f172a; /* body: dark on light extract boxes (senior-readable) */
  font-weight: 500;
}
.skipped-line .echo-line-num { color: #475569; font-weight: 600; }
.skipped-line .echo-line-text { color: #334155; }
.skipped-line { opacity: 1; }


.search-term {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.search-plain {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.search-def {
  font-size: 1.02rem;
  color: #334;
  margin-top: 8px;
  line-height: 1.45;
}
.reminder-banner {
  border: 2px solid var(--teal, #2a7f7f);
  background: #eef8f7;
}
.reminder-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.35;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 600;
  margin: 12px 0 8px;
  color: var(--navy);
}
.check-row input[type="checkbox"],
input[type="checkbox"] {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  padding: 0 !important;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid #5a7a88;
  border-radius: 6px;
  background: #fff;
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  accent-color: var(--teal);
  cursor: pointer;
}
.check-row {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  z-index: 2;
}
.check-row span { flex: 1; line-height: 1.35; }

.check-row:has(input:checked) {
  background: #e7f6f4;
  border: 2px solid #2a9d8f;
  border-radius: 12px;
  padding: 10px 12px;
  margin-left: -4px;
  margin-right: -4px;
}
.check-row:has(input:checked) span {
  color: #0b3d4a;
}



.extract-symptoms-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8f0;
  border: 2px solid #d4a574;
  color: #0f172a;
}


/* More secondary menu */
.more-menu-card { padding-top: 18px; }
.more-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.more-menu .more-link {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  min-height: 52px;
  font-size: 1.08rem;
}

/* Family SMS */
.family-contact {
  margin: 0 0 14px;
  padding: 12px 12px 10px;
  border: 1px solid #d8e2e8;
  border-radius: 12px;
  background: #fbfcfd;
}
.family-contact .btn { margin-top: 8px; }
.family-share-picker {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f3ea;
  border: 2px solid #c9a86a;
}
.family-share-picker .btn { margin-top: 8px; margin-right: 8px; }
.family-pick-row { margin: 8px 0; }

.family-sms-toast {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef8f7;
  border: 2px solid var(--teal, #2a7f7f);
}
.family-sms-toast .btn {
  margin-top: 8px;
  margin-right: 8px;
}

.call-provider {
  margin-top: 14px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 3px solid #9a3412;
  background: #fff4ee;
}
.call-provider-title {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 800;
  color: #7c2d12;
}
.call-provider-body {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #7c2d12;
}
.family-reassess-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d8e2e8;
}
#section-family-sms .btn[disabled],
#section-family-reassess .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* About the creator */
.about-slogan {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--teal, #2a7f7f);
  margin: 0 0 12px;
  line-height: 1.35;
}
#section-about h3 {
  margin-top: 16px;
  color: var(--navy);
}
.about-org {
  margin-top: 16px;
  font-weight: 600;
}


/* Setup wizard v39 */
.wizard-progress {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #9fe8df;
}
.wizard-title { margin-bottom: 10px; }
.wizard-step { margin-bottom: 8px; }
.wizard-nav {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.wizard-nav-btn {
  min-height: 52px;
  font-size: 1.15rem;
  font-weight: 800;
}
.wizard-upload-slot .highlight-upload {
  margin: 0;
  /* v40: papersUploadBlock is moved here; do not inherit intro nearly-white text */
  color: #0f172a;
  background: #f0fafb;
}
.wizard-upload-slot .highlight-upload h2,
.wizard-upload-slot .highlight-upload h3 {
  color: var(--teal);
}
.wizard-upload-slot .highlight-upload .hint,
.wizard-upload-slot .highlight-upload .label,
.wizard-upload-slot .highlight-upload #pdfStatus,
.wizard-upload-slot .highlight-upload .empty,
.wizard-upload-slot .highlight-upload .extract-kept-banner {
  color: #1a2b3c;
}
.wizard-upload-slot .highlight-upload .hint.warn { color: #9a3412; }
.wizard-upload-slot .highlight-upload .hint.ok { color: #0f5c4c; }
.wizard-upload-slot {
  margin: 12px 0;
}

/* Also when upload sits on Heart chart (not wizard) */
#papersUploadBlock,
#papersUploadBlock .extract-review,
#papersUploadBlock .echo-line-text,
#papersUploadBlock .snippet-text,
#papersUploadBlock .snippet-body {
  color: #0f172a;
}
#papersUploadBlock .echo-line-num,
#papersUploadBlock .extract-echo-heading,
#papersUploadBlock .extract-other-heading,
#papersUploadBlock .snippet-tag {
  color: #0d9488;
}
#papersUploadBlock .hint { color: #334155; }
#papersUploadBlock .hint.ok { color: #0f5c4c; }
#papersUploadBlock .hint.warn { color: #9a3412; }

@keyframes hfc-save-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.55); transform: scale(1); }
  40% { box-shadow: 0 0 0 10px rgba(13, 148, 136, 0); transform: scale(1.04); }
}
#btnSaveSnippets.save-pulse {
  animation: hfc-save-pulse 0.85s ease-in-out 3;
}
.wizard-skip-hint { opacity: 0.9; color: #e8f2f8; }
.wizard-heart-summary {
  white-space: pre-wrap;
  line-height: 1.45;
  margin-bottom: 12px;
  color: #222;
}
.wizard-done-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.5;
  font-size: 1.05rem;
}
.wizard-done-list li { margin-bottom: 8px; }

.setup-banner {
  border: 2px solid var(--teal);
  background: #f7fcfd;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.setup-banner-text {
  margin: 0;
  flex: 1 1 180px;
  font-size: 1.02rem;
  line-height: 1.35;
}
.setup-banner-btn { flex: 0 0 auto; }


.upload-success {
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 3px solid #1f7a4d;
  background: #e7f6ee;
}
.upload-success-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #145c38;
}
.upload-success-body {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #145c38;
  line-height: 1.35;
}
.papers-status {
  border: 1px solid #c5d6de;
  background: #f7fafb;
}
.papers-status-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}
button.linkish {
  background: none;
  border: none;
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  padding: 0 0 0 6px;
}
.papers-home:empty { display: none; }


/* v41: stent combined field, walkthrough, videos */
.stent-one-box #stentVesselOcclusion {
  font-size: 1.15rem;
}
.walkthrough-overlay {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.walkthrough-card {
  pointer-events: auto;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 -8px 28px rgba(0,0,0,0.18);
}
.walkthrough-kicker {
  margin: 0 0 4px;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.95rem;
}
.walkthrough-title {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.35rem;
}
.walkthrough-what {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.4;
}
.walkthrough-how-label { margin-top: 6px; }
.walkthrough-bullets {
  margin: 0 0 12px;
  padding-left: 1.2rem;
  font-size: 1.05rem;
  line-height: 1.4;
}
.walkthrough-bullets li { margin-bottom: 6px; }
.walkthrough-actions {
  display: flex;
  gap: 10px;
}
.walkthrough-actions .btn {
  flex: 1;
  min-height: 56px;
  font-size: 1.15rem;
  font-weight: 700;
}
.walkthrough-skip {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
}
/* Full-tab walkthrough highlight + zoom into focused tab (senior-friendly) */

body.walkthrough-open .setup-banner,
body.intro-open .setup-banner,
body.walkthrough-open #allowNotifBanner,
body.intro-open #allowNotifBanner {
  display: none !important;
}
body.walkthrough-open .top {
  z-index: 90;
  overflow: visible;
}
body.walkthrough-open .tabs {
  overflow: visible;
  padding: 10px 4px 12px;
}
body.walkthrough-open .tab {
  position: relative;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 350ms ease, opacity 350ms ease, filter 350ms ease;
  will-change: transform;
}
/* Dim non-focused tabs so the zoomed target stands out */
body.walkthrough-open .tab:not(.walkthrough-target) {
  opacity: 0.38;
  filter: saturate(0.55);
}
body.walkthrough-open .tab.walkthrough-target {
  z-index: 92;
  outline: 4px solid #2a9d8f; /* teal — full button outline */
  outline-offset: 3px;
  border-radius: 999px;
  /* Zoom into the focused tab (~1.25 — readable, not dizzying) */
  transform: scale(1.25);
  transform-origin: center center;
  /* spotlight hole = full button box; stronger surround dim */
  box-shadow:
    0 0 0 3px rgba(232, 184, 74, 0.9),
    0 0 22px rgba(42, 157, 143, 0.65),
    0 0 0 9999px rgba(15, 23, 42, 0.68);
  animation: walkthrough-pulse 1.5s ease-in-out infinite;
}
@keyframes walkthrough-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(232, 184, 74, 0.9),
      0 0 18px rgba(42, 157, 143, 0.55),
      0 0 0 9999px rgba(15, 23, 42, 0.68);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(232, 184, 74, 1),
      0 0 26px rgba(42, 157, 143, 0.8),
      0 0 0 9999px rgba(15, 23, 42, 0.68);
  }
}
body.walkthrough-open main {
  padding-bottom: 280px;
}

/* Settings / Guidelines outbound links */
.guideline-links a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}
.guideline-links .link-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.95rem;
}
.video-card .howto-video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  background: #0f172a;
  margin: 8px 0 6px;
}
.video-card h3 {
  margin-top: 16px;
}
.btn.danger {
  margin-top: 8px;
}
.search-video-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  color: var(--teal);
  text-decoration: underline;
  font-size: 1.02rem;
}

/* Theme swatches (Settings) */
.theme-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 72px;
  padding: 10px;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--navy);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font: inherit;
  font-weight: 700;
  font-size: 1.02rem;
}
.theme-swatch .theme-swatch-preview {
  display: block;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
}
.theme-swatch.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal);
}
.theme-swatch .theme-swatch-label {
  line-height: 1.25;
}

/* Calm slate readability tweaks */
[data-theme="calm-slate"] .tab.active {
  background: #E8EEF4;
  color: #1E2630;
}
[data-theme="calm-slate"] input,
[data-theme="calm-slate"] textarea {
  background: #2A3340;
  color: #F2F5F8;
  border-color: #6A7888;
}
[data-theme="calm-slate"] .btn.secondary {
  background: #455468;
  color: #F2F5F8;
}
[data-theme="calm-slate"] .plan-choice-btn {
  background: #2A3340;
  color: #F2F5F8;
  border-color: #6A7888;
}
[data-theme="calm-slate"] .plan-choice-btn.active {
  background: #3d5558;
  border-color: var(--teal);
}
[data-theme="calm-slate"] .home-prn {
  background: #4A3E28;
  border-color: #C9A84A;
  color: #F8F0D8;
}
[data-theme="calm-slate"] .home-prn strong { color: #F0C674; }
[data-theme="calm-slate"] .home-prn.home-prn-daily {
  background: #2F4058;
  border-color: #7EB8C4;
  color: #E8EEF4;
}
[data-theme="calm-slate"] .home-prn.home-prn-daily strong { color: #E8EEF4; }
[data-theme="calm-slate"] .hint { color: var(--muted); }
[data-theme="calm-slate"] .empty { color: var(--muted); }
[data-theme="calm-slate"] .disclaimer { color: var(--muted); }



/* References table (Settings) */
.ref-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 12px; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ref-table th, .ref-table td {
  text-align: left; vertical-align: top;
  padding: 10px 8px; border-bottom: 1px solid var(--border);
}
.ref-table th { color: var(--navy); font-weight: 700; background: rgba(0,0,0,0.03); }
.ref-table td a { color: var(--teal, #0a7ea4); font-weight: 600; }
.tab { font-size: 0.72rem; padding: 10px 2px; }


/* Post-import: compact extracted summary (not raw dump) */
.extracted-summary { border-color: #7ec8c0; background: #f3fbfa; }
.extracted-summary h2,
.extracted-summary > .extracted-fold {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}
.extracted-summary > .extracted-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.extracted-summary > .extracted-fold::-webkit-details-marker { display: none; }
.extracted-summary > .extracted-fold::after {
  content: "›";
  font-size: 1.3rem;
  line-height: 1;
  transform: rotate(90deg);
}
.extracted-summary[open] > .extracted-fold { margin-bottom: 8px; }
.extracted-summary[open] > .extracted-fold::after { transform: rotate(-90deg); }
.extracted-summary:not([open]) > :not(summary) { display: none; }
.extracted-summary-list { margin: 8px 0 14px; padding-left: 1.15rem; }
.extracted-summary-list li { margin: 6px 0; line-height: 1.35; }
.extracted-summary-list strong { color: var(--navy); }


/* six primary tabs: Today Reassess Log Heart chart Videos More */
.tabs { gap: 3px; }
.tab { font-size: 0.64rem; padding: 8px 1px; min-height: 44px; letter-spacing: -0.01em; }


.hint-list {
  margin: 8px 0 12px;
  padding-left: 1.2em;
  color: var(--muted, #4a5568);
  font-size: 0.95rem;
  line-height: 1.45;
}
.hint-list li { margin-bottom: 8px; }
.hint-list strong { color: var(--ink, #1a202c); }


.vitals-alert {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
  font-weight: 650;
  line-height: 1.4;
}
.vitals-alert.urgent {
  border-color: #991b1b;
  background: #fee2e2;
}
.vitals-alert ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
  font-weight: 550;
}
.vitals-alert li { margin-bottom: 4px; }
.vitals-alert .vitals-alert-note {
  margin: 8px 0 0;
  font-weight: 500;
  font-size: 0.9rem;
  color: #9a3412;
}
input.vital-out {
  border-color: #b91c1c !important;
  background: #fff5f5;
}


.intro-howto {
  margin-top: 10px;
  border: 1px solid var(--border, #c5d4de);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  padding: 0 12px 4px;
}
.intro-howto > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal, #0b6e6a);
  padding: 12px 4px;
  list-style: none;
}
.intro-howto > summary::-webkit-details-marker { display: none; }
.intro-howto > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
.intro-howto[open] > summary::before { content: "▾ "; }
.intro-howto-body {
  padding: 0 4px 12px;
  font-size: 0.98rem;
  line-height: 1.45;
}
.intro-howto-body h3 {
  margin: 12px 0 6px;
  font-size: 1.02rem;
  color: var(--ink, #1a202c);
}
.intro-howto-body ul {
  margin: 0 0 4px;
  padding-left: 1.2em;
}
.intro-howto-body li { margin-bottom: 5px; }

/* Intro devices + howto — high contrast (readable on setup) */
.intro-card .hint {
  color: #e8f2f8;
  opacity: 1;
}
.intro-card.intro-devices-card {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.intro-card.intro-devices-card h2 {
  color: #1B3A5C;
}
.intro-card.intro-devices-card .hint {
  color: #334155;
}
.intro-screen .intro-howto {
  border: 1px solid #c5d4de;
  background: #f4f8fb;
}
.intro-screen .intro-howto > summary {
  color: #0b5c55;
}
.intro-screen .intro-howto-body {
  color: #1a1a1a;
}
.intro-screen .intro-howto-body .hint {
  color: #444;
}
.intro-screen .intro-devices-video {
  background: #f8fafc;
  border: 1px solid #d0dbe3;
  color: #1a1a1a;
}
.intro-screen .intro-devices-video h2,
.intro-screen .intro-devices-video h3 {
  color: #1B3A5C;
}
.intro-screen .intro-devices-video .hint {
  color: #334155;
}



.settings-collapse {
  margin: 0;
}
.settings-collapse > summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 1.15rem;
  color: var(--ink, #1a202c);
  padding: 4px 0 8px;
  list-style: none;
}
.settings-collapse > summary::-webkit-details-marker { display: none; }
.settings-collapse > summary::before {
  content: "▸ ";
  color: var(--teal, #0b6e6a);
}
.settings-collapse[open] > summary::before { content: "▾ "; }
.settings-collapse-body {
  padding-top: 4px;
}

/* Current medicines (home bottles) */
.current-meds-list { margin: 8px 0 12px; }
.current-med-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.55);
}
.current-med-row .label { margin-top: 8px; }
.current-med-row textarea { min-height: 56px; }
.current-meds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.current-meds-actions .file-btn,
.current-med-photo-btn {
  margin: 0;
  display: inline-block;
}
.btn-remove-current-med { margin-top: 10px; }
.current-meds-empty { margin: 6px 0 10px; }
#bottleMedStatus.ok { color: var(--green); }
#bottleMedStatus.warn { color: var(--amber); }


.current-med-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 8px;
}
.current-med-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d8e2e8;
  background: #fff;
}
.current-med-row { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e4ebf0; }

.log-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.log-cal-title { margin: 0; font-weight: 800; text-align: center; flex: 1; }
.log-cal-week, .log-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.log-cal-week { font-size: 0.78rem; font-weight: 700; color: #5c6b76; margin-bottom: 4px; }
.log-cal-day, .log-cal-pad { min-height: 40px; }
.log-cal-day { border: 1px solid #d8e2e8; border-radius: 10px; background: #fff; font-weight: 700; }
.log-cal-day.has-entry { background: #e7f6ee; border-color: #1f7a4d; }
.log-cal-day.is-today { outline: 2px solid #2a7f7f; }
.log-cal-day.is-selected { background: #2a7f7f; color: #fff; }
.log-cal-day:disabled { opacity: 0.35; }
.past-day-form { margin-top: 12px; }

.med-pick-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.med-pick { min-height: 36px; padding: 6px 10px; font-size: 0.92rem; }

.med-hand-search { margin-top: 12px; }
.med-hand-results { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.med-hand-hit { text-align: left; justify-content: flex-start; }

.feel-protect {
  margin: 14px 0 12px;
  padding: 12px 14px;
  border: 2px solid var(--navy, #1B3A5C);
  border-radius: 12px;
  background: #f4f7fb;
}
.feel-protect-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--navy, #1B3A5C);
}
.feel-protect p { margin: 0; line-height: 1.45; }
.med-confirm {
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--navy, #1B3A5C);
  border-radius: 12px;
  background: #f7f4ee;
}
.med-confirm .btn { margin-top: 8px; }

.med-book-select, #medBookPick {
  width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
  margin: 6px 0 10px;
}

.log-cal-day.is-skipped {
  background: #f4b942;
  border: 2px solid #b86a00;
  color: #3f2500;
  font-weight: 800;
}
.log-cal-day.is-selected,
.log-cal-day.is-skipped.is-selected,
.log-cal-day.has-entry.is-selected {
  background: #1f6f6f;
  border-color: #1f6f6f;
  color: #fff;
  box-shadow: 0 0 0 2px #1f6f6f;
}

.current-med-condensed { padding: 12px 14px; }
.current-med-name { margin: 0 0 4px; font-weight: 800; font-size: 1.15rem; }
.current-med-condensed .btn { margin-top: 8px; }

.search-expect { margin-top: 6px; line-height: 1.4; }

.trend-box {
  margin: 12px 0 8px;
}
.trend-box:empty { display: none; }
.trend-head {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft, #456);
  margin: 0 0 6px;
}
.trend-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d7e6ea;
  background: #f7fcfd;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 6px;
  font: inherit;
  color: inherit;
}
.trend-row strong { font-weight: 800; }
.trend-delta { color: #0b6e6a; font-weight: 700; }
.trend-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.trend-actions .btn { flex: 1 1 140px; }

.med-dose-row { display: flex; gap: 8px; margin: 8px 0; }
.med-dose-row .btn { flex: 1; }
.btn-dose-taken.is-on { background: #1f7a4d; color: #fff; border-color: #1f7a4d; }
.btn-dose-skipped.is-on { background: #b86a00; color: #fff; border-color: #b86a00; }

.dc-compare { margin-top: 12px; }
.dc-compare-title { font-weight: 800; margin: 0 0 6px; }
.dc-compare-row { margin: 6px 0; padding: 8px 10px; border-radius: 10px; }
.dc-compare-row.is-on { background: #e7f6ee; }
.dc-compare-row.is-off { background: #fff6e8; }

.chart-fold { border: 0; }
.chart-fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}
.chart-fold-summary::-webkit-details-marker { display: none; }
.chart-fold-summary::after { content: "›"; font-size: 1.3rem; transform: rotate(90deg); }
.chart-fold[open] > .chart-fold-summary { margin-bottom: 8px; }
.chart-fold[open] > .chart-fold-summary::after { transform: rotate(-90deg); }
.chart-fold:not([open]) > .chart-fold-body { display: none; }
.papers-fold-summary { font-weight: 800; cursor: pointer; }
.papers-status-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.alarm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 28, 40, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.alarm-overlay.hidden { display: none; }
.alarm-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px 18px 18px;
  border: 3px solid #0b6e6a;
  text-align: center;
}
.alarm-kicker {
  margin: 0 0 6px;
  color: #0b6e6a;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.alarm-card h2 { margin: 0 0 8px; color: #102a43; }
.alarm-body { margin: 0 0 16px; color: #243b53; }

[data-theme="calm-slate"] .theme-swatch {
  color: #FFFFFF;
  border-color: #8AA0B5;
}
[data-theme="calm-slate"] .theme-swatch .theme-swatch-preview {
  border: 2px solid #FFFFFF;
}
[data-theme="calm-slate"] .theme-swatch.active {
  border-color: #9FE7F0;
  box-shadow: 0 0 0 3px #9FE7F0;
}
[data-theme="calm-slate"] .card,
[data-theme="calm-slate"] h2,
[data-theme="calm-slate"] h3,
[data-theme="calm-slate"] .label,
[data-theme="calm-slate"] .settings-collapse > summary {
  color: #FFFFFF;
}
[data-theme="calm-slate"] .hint,
[data-theme="calm-slate"] .link-note {
  color: #E4EDF5;
}

.alarm-help-corner {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 8px;
  left: 8px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.alarm-help-chip,
.alarm-help-player,
.alarm-help-player button {
  pointer-events: auto;
}
.alarm-help-chip {
  background: #0b6e6a;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 750;
  font-size: 0.95rem;
}
.alarm-help-player {
  width: 100%;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
  overflow: auto;
  margin-top: 8px;
  background: #fff;
  color: #102a43;
  border-radius: 16px;
  padding: 10px;
  border: 2px solid #0b6e6a;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  box-sizing: border-box;
}
.alarm-help-player.hidden { display: none; }
.alarm-help-title { margin: 0 0 8px; font-weight: 750; }
.alarm-help-player video,
.alarm-help-player .howto-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  background: #0f172a;
  border-radius: 12px;
  margin: 0 0 8px;
}

.alarm-help-steps {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  color: #102a43;
  font-size: 0.95rem;
  line-height: 1.35;
}
.alarm-help-steps li { margin: 0 0 6px; }
.alarm-help-note {
  margin: 0 0 8px;
  color: #243b53;
  font-size: 0.85rem;
}
#timerBanner input[type="time"] {
  width: 100%;
  margin: 4px 0 12px;
  font-size: 1.15rem;
}
#timerBanner .btn { margin-top: 4px; }

.btn.is-selected,
.tab.is-selected,
.plan-choice-btn.is-selected {
  outline: 3px solid #102a43;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 3px #fff;
}
.btn.primary.is-selected {
  background: #084e4b;
}
.btn.secondary.is-selected {
  background: #d5e4ea;
  color: #102a43;
}
.btn.is-selected .btn-selected-mark,
.btn.is-selected::after {
  font-weight: 800;
}

.toggle button.on-yes,
.toggle button.on-no,
.toggle button.on-same,
.toggle button.is-selected {
  outline: 3px solid #102a43;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 2px #fff;
  font-weight: 800;
}
.toggle button.on-yes { background: #f3d7a1; color: #5c3d00; }
#btnDecide.is-selected {
  outline: 3px solid #102a43;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 3px #fff;
}
.top-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facts-strip {
  background: #fff8ee;
  color: #1B3A5C;
  border-bottom: 2px solid #c5d8e0;
  padding: 10px 14px 12px;
}
.facts-strip .echo-line {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1B3A5C;
  margin: 0;
}
.facts-strip .echo-sub {
  font-size: 0.98rem;
  color: #3d4f63;
  margin: 4px 0 0;
}
.today-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.today-tools .date-line { margin: 0; flex: 1; }
#btnRefreshApp {
  width: auto;
  margin: 0;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.donate-chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #f3d7a1;
  color: #5c3d00;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 12px;
  min-height: 36px;
}
.donate-pop {
  margin-top: 8px;
  background: #fff8ee;
  color: #1B3A5C;
  border-radius: 12px;
  padding: 10px 12px;
}
.donate-pop p { margin: 0 0 6px; }
.donate-pop .btn { width: auto; }


.header-refresh {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.95rem;
}
.pin-lock,
.start-account {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(27, 58, 92, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}
.pin-lock.hidden,
.start-account.hidden {
  display: none;
}
.pin-lock-card,
.start-account-card {
  width: min(520px, 100%);
  margin-top: 24px;
}

.freq-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.freq-btn {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
}
.freq-btn.is-on {
  outline: 2px solid currentColor;
}
.med-save-status.warn {
  color: #8a3b12;
}

.med-need-list { margin: 8px 0 14px; max-height: 420px; overflow: auto; }
.med-need-group { margin: 10px 0 4px; font-weight: 800; }
.med-need-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #e4ebf0;
}
.med-need-checks { display: flex; flex-direction: column; gap: 4px; min-width: 7.2rem; }
.med-need-checks label, .med-check-close { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.med-check-close { margin-top: 12px; font-weight: 700; }
.req-star { color: #9a3412; font-weight: 800; }
.field-miss, .freq-choice.field-miss {
  outline: 2px solid #c2410c;
  background: #fff7ed;
  border-radius: 8px;
}

/* Computer: show the same column a phone uses, centered on the desk. */
@media (min-width: 640px) {
  html, body {
    background: #d7dde3;
  }
  body {
    min-height: 100vh;
  }
  #app {
    width: 390px;
    max-width: 390px;
    margin: 18px auto 28px;
    min-height: calc(100vh - 36px);
    background: var(--bg);
    border-radius: 28px;
    box-shadow: 0 0 0 10px #1b2430, 0 18px 50px rgba(16, 24, 32, 0.28);
    overflow: visible;
  }
  .top {
    border-radius: 28px 28px 0 0;
  }
  .intro-screen {
    background: #d7dde3;
  }
  .intro-inner {
    width: 390px;
    max-width: 390px;
    min-height: calc(100vh - 36px);
    margin: 18px auto;
    border-radius: 28px;
    box-shadow: 0 0 0 10px #1b2430, 0 18px 50px rgba(16, 24, 32, 0.28);
    background: linear-gradient(165deg, #0f2a45 0%, #1B3A5C 42%, #1a5c5a 100%);
    padding: 28px 18px 48px;
  }
  .walkthrough-card {
    width: 390px;
    max-width: 390px;
  }
}

.heart3d-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 40%, #2a4664 0%, #122033 72%);
}

#currentMedsList, #section-current-meds { scroll-margin-top: 88px; }
