:root {
  --bg: #f7fff7;
  --bg-elevated: rgba(255, 255, 255, 0.84);
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(120, 168, 138, 0.16);
  --line-strong: rgba(120, 168, 138, 0.28);
  --text: #21312a;
  --muted: #4f6759;
  --accent: #4ea787;
  --accent-deep: #377c62;
  --accent-warm: #84b99a;
  --shadow: 0 20px 55px rgba(74, 107, 86, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(78, 167, 135, 0.12), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(132, 185, 154, 0.18), transparent 26%),
    linear-gradient(180deg, #f7fff7 0%, #f2fbf2 48%, #edf8ee 100%);
  font-family: "Avenir Next", "Segoe UI", "Microsoft JhengHei UI", "PingFang TC", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(102, 146, 117, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 146, 117, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
  opacity: 0.24;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(247, 255, 247, 0.96), rgba(247, 255, 247, 0.7));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  width: 112px;
  height: 112px;
  padding: 10px;
  border: 1px solid rgba(78, 167, 135, 0.28);
  border-radius: 24px;
  object-fit: contain;
  display: block;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 255, 249, 0.94));
  box-shadow: 0 18px 36px rgba(55, 124, 98, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.brand-copy strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  color: #172a22;
  font-weight: 850;
}

.brand-copy small {
  display: block;
  color: #426354;
  font-size: 1.02rem;
  margin-top: 6px;
  font-weight: 600;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.topnav a {
  padding: 10px 14px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
  outline: none;
}

.section {
  margin-top: 24px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 253, 248, 0.92));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 22px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 18px 4px 18px 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.45rem, 4.7vw, 4.25rem);
  max-width: 13ch;
}

h1 span { display: block; }

.lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 0.94rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.button,
.feature-card,
.type-card,
.timeline-item,
.expense-item,
.trend-item,
.pair-box,
.ghost-pill,
.workbench-switch a,
.modal-chip {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 64px;
  padding: 16px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.button:hover,
.button:focus-visible,
.feature-card:hover,
.feature-card:focus-visible,
.type-card:hover,
.type-card:focus-visible,
.timeline-item:hover,
.timeline-item:focus-visible,
.expense-item:hover,
.expense-item:focus-visible,
.trend-item:hover,
.trend-item:focus-visible,
.pair-box:hover,
.pair-box:focus-visible,
.ghost-pill:hover,
.ghost-pill:focus-visible,
.workbench-switch a:hover,
.workbench-switch a:focus-visible,
.modal-chip:hover,
.modal-chip:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #8ef1e0);
  color: #fff;
  box-shadow: 0 18px 35px rgba(78, 167, 135, 0.18);
}

.button.secondary,
.ghost-pill,
.workbench-switch a,
.modal-chip {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
}

.hero-visual {
  display: grid;
  gap: 14px;
}

.hero-image {
  width: 100%;
  display: block;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(74, 107, 86, 0.16);
  object-fit: cover;
  min-height: 520px;
  background: rgba(255, 255, 255, 0.28);
}

.glass-card,
.feature-card,
.role-card,
.contact-form,
.workbench-panel,
.gate-panel,
.type-card,
.timeline-item,
.expense-item,
.trend-item,
.pair-box,
.modal-card,
.disclaimer-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
}

.glass-card { padding: 18px; }

.card-kicker,
.feature-label,
.role-chip {
  margin: 0;
  color: var(--accent-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.glass-card h2 {
  font-size: 1.52rem;
  margin: 8px 0;
}

.hero-caption p,
.feature-card p,
.gate-note,
.section-heading p,
.timeline-item span,
.expense-item span,
.trend-meta,
.info-row span,
.pair-box span,
.modal-stack p,
.workbench-panel p {
  color: var(--muted);
}

.section-heading {
  display: grid;
  gap: 10px;
  max-width: 70ch;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  padding: 20px;
  min-height: 180px;
  text-align: left;
}

.link-card {
  display: grid;
  align-content: start;
  gap: 10px;
  cursor: pointer;
}

.feature-card h3 {
  font-size: 1.22rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.contact-cards {
  display: grid;
  gap: 12px;
}

.role-card {
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.role-card h3 {
  margin: 10px 0 8px;
}

.role-card p {
  margin: 0;
  color: var(--muted);
}

.role-card.is-selected {
  border-color: rgba(78, 167, 135, 0.38);
  box-shadow: inset 0 0 0 1px rgba(78, 167, 135, 0.18), 0 14px 34px rgba(74, 107, 86, 0.10);
}

.contact-form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 8px;
}

.contact-form span {
  color: var(--muted);
  font-weight: 700;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.spam-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.consent-check a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.form-footer {
  display: grid;
  gap: 14px;
}

.form-footer .button {
  justify-self: end;
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 4px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pwa-install-toast {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 120;
  width: min(480px, calc(100% - 28px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background: linear-gradient(135deg, #2f8d70, #65c6a9);
  color: #fff;
  box-shadow: 0 16px 38px rgba(33, 49, 42, 0.18);
  transform: translate(-50%, 22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.pwa-install-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 0.8;
  pointer-events: auto;
}

.pwa-install-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.98rem;
  font-weight: 900;
}

.pwa-install-content {
  display: grid;
  gap: 6px;
}

.pwa-install-content strong {
  font-size: 0.98rem;
}

.pwa-install-content span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
}

.pwa-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pwa-install-actions a,
.pwa-install-actions button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.84rem;
}

.pwa-install-actions a {
  background: #fff;
  color: #24755c;
}

.pwa-install-actions button {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.pwa-install-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font-size: 1.08rem;
  line-height: 1;
}

.match-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}

.match-side,
.match-list,
.match-actions {
  display: grid;
  gap: 12px;
}

/* CARE white paper */
.whitepaper-body {
  margin: 0;
  color: #20302b;
  background: #f4f7f5;
}

.whitepaper-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(49, 105, 84, 0.14);
  backdrop-filter: blur(14px);
}

.whitepaper-main {
  max-width: 1240px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 18px 70px rgba(33, 71, 57, 0.1);
}

.whitepaper-cover {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: 54px;
  padding: 78px 72px 66px;
  background: #edf5f1;
  overflow: hidden;
}

.whitepaper-edition,
.whitepaper-section-label {
  color: #367c64;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.whitepaper-cover h1 {
  max-width: 720px;
  margin: 20px 0 24px;
  color: #163f32;
  font-size: clamp(3.1rem, 6vw, 5.7rem);
  line-height: 1.08;
}

.whitepaper-lede {
  max-width: 650px;
  color: #4d655d;
  font-size: 1.18rem;
  line-height: 1.9;
}

.whitepaper-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.whitepaper-cover-visual {
  position: relative;
}

.whitepaper-cover-visual img {
  width: 100%;
  min-height: 510px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 28px 65px rgba(33, 73, 58, 0.2);
}

.whitepaper-cover-note {
  position: absolute;
  right: -20px;
  bottom: -26px;
  width: min(360px, 82%);
  padding: 22px 24px;
  color: #fff;
  background: #245f4c;
  border-left: 5px solid #e3b867;
}

.whitepaper-cover-note span,
.whitepaper-cover-note strong {
  display: block;
}

.whitepaper-cover-note span {
  margin-bottom: 7px;
  color: #cde2d9;
  font-size: 0.82rem;
}

.whitepaper-cover-note strong {
  line-height: 1.65;
}

.whitepaper-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #dfe9e4;
  border-bottom: 1px solid #dfe9e4;
}

.whitepaper-summary div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border-right: 1px solid #dfe9e4;
}

.whitepaper-summary div:last-child { border-right: 0; }
.whitepaper-summary strong { color: #c28f38; font-size: 1.4rem; }
.whitepaper-summary span { font-weight: 700; }

.whitepaper-section {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 50px;
  padding: 92px 72px;
  border-bottom: 1px solid #e3ebe7;
  scroll-margin-top: 100px;
}

.whitepaper-section-label {
  padding-top: 9px;
  writing-mode: vertical-rl;
}

.whitepaper-section-content { max-width: 880px; }
.whitepaper-section-content > h2,
.whitepaper-conclusion h2 {
  margin: 10px 0 28px;
  color: #173e32;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.24;
}

.whitepaper-intro {
  color: #4b625a;
  font-size: 1.15rem;
  line-height: 2;
}

.whitepaper-muted { background: #f6f8f7; }

.whitepaper-toc-list {
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #cfddd6;
}

.whitepaper-toc-list a {
  display: grid;
  grid-template-columns: 54px minmax(180px, 0.75fr) 1fr;
  gap: 20px;
  align-items: center;
  padding: 19px 6px;
  color: inherit;
  border-bottom: 1px solid #cfddd6;
  text-decoration: none;
}

.whitepaper-toc-list a:hover { color: #27745a; background: #f3f8f5; }
.whitepaper-toc-list span { color: #b47e29; font-weight: 800; }
.whitepaper-toc-list strong { font-size: 1.08rem; }
.whitepaper-toc-list small { color: #687b74; }

.whitepaper-stat-grid,
.whitepaper-problem-grid,
.whitepaper-role-grid,
.whitepaper-security-grid {
  display: grid;
  gap: 16px;
  margin-top: 38px;
}

.whitepaper-stat-grid,
.whitepaper-role-grid { grid-template-columns: repeat(3, 1fr); }
.whitepaper-problem-grid,
.whitepaper-security-grid { grid-template-columns: repeat(2, 1fr); }

.whitepaper-stat-grid article,
.whitepaper-problem-grid article,
.whitepaper-role-grid article,
.whitepaper-security-grid article,
.whitepaper-value-list article,
.whitepaper-roadmap article {
  padding: 25px;
  background: #fff;
  border: 1px solid #dce7e1;
  border-radius: 6px;
}

.whitepaper-stat-grid strong,
.whitepaper-role-grid h3 { color: #276d56; font-size: 1.3rem; }
.whitepaper-problem-grid span,
.whitepaper-role-grid span,
.whitepaper-security-grid span,
.whitepaper-roadmap span { color: #b37e2d; font-size: 0.78rem; font-weight: 800; }
.whitepaper-problem-grid h3 { margin: 9px 0; color: #244f40; }
.whitepaper-section article p { margin-bottom: 0; color: #5e706a; line-height: 1.75; }

.whitepaper-flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  gap: 13px;
  margin: 42px 0;
}

.whitepaper-flow div {
  min-height: 185px;
  padding: 22px 18px;
  background: #edf5f1;
  border-top: 4px solid #3c8d70;
}

.whitepaper-flow span,
.whitepaper-flow strong,
.whitepaper-flow small { display: block; }
.whitepaper-flow span { color: #af7724; font-weight: 800; }
.whitepaper-flow strong { margin: 13px 0; line-height: 1.45; }
.whitepaper-flow small { color: #61756d; line-height: 1.65; }
.whitepaper-flow b { color: #73a895; font-size: 1.4rem; }

.whitepaper-quote {
  margin: 44px 0 0;
  padding: 26px 30px;
  color: #244d3f;
  background: #fffaf0;
  border-left: 5px solid #d3a350;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.8;
}

.whitepaper-role-grid article:nth-child(2) { border-top: 4px solid #d2a04b; }
.whitepaper-role-grid article:first-child { border-top: 4px solid #39876b; }
.whitepaper-role-grid article:last-child { border-top: 4px solid #557da5; }

.whitepaper-value-list {
  display: grid;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid #dce6e1;
}

.whitepaper-value-list article {
  display: grid;
  grid-template-columns: minmax(210px, 0.5fr) 1fr;
  gap: 30px;
  border: 0;
  border-bottom: 1px solid #dce6e1;
  border-radius: 0;
}

.whitepaper-value-list strong { color: #296c56; font-size: 1.08rem; }
.whitepaper-security { color: #fff; background: #204f40; }
.whitepaper-security .eyebrow,
.whitepaper-security .whitepaper-section-label { color: #e3bd76; }
.whitepaper-security .whitepaper-section-content > h2 { color: #fff; }
.whitepaper-security-grid article { background: #2a5b4b; border-color: #477666; }
.whitepaper-security-grid article p { color: #d7e4de; }
.whitepaper-security-grid span { color: #edc77f; }

.whitepaper-roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 38px;
}

.whitepaper-roadmap strong { display: block; margin: 12px 0; color: #286a55; }
.whitepaper-pwa-note { margin-top: 26px; padding: 25px 28px; background: #edf5f1; border-left: 5px solid #3f8c70; }
.whitepaper-pwa-note strong { color: #225a47; font-size: 1.18rem; }
.whitepaper-pwa-note p { margin: 7px 0 0; color: #536b62; line-height: 1.75; }

.whitepaper-conclusion {
  padding: 110px max(72px, calc((100% - 960px) / 2));
  color: #fff;
  background: #153f32;
  text-align: center;
  scroll-margin-top: 100px;
}

.whitepaper-conclusion .whitepaper-edition { color: #e3bd76; }
.whitepaper-conclusion h2 { color: #fff; }
.whitepaper-conclusion > p:not(.whitepaper-edition) { max-width: 820px; margin: 0 auto 18px; color: #d8e5df; font-size: 1.08rem; line-height: 1.95; }
.whitepaper-conclusion .whitepaper-cover-actions { justify-content: center; }
.whitepaper-footer { max-width: 1240px; margin: 0 auto; }

@media (max-width: 900px) {
  .whitepaper-topbar { position: static; flex-direction: column; align-items: flex-start; padding: 14px 18px; }
  .whitepaper-cover { min-height: 0; grid-template-columns: 1fr; gap: 40px; padding: 56px 28px 70px; }
  .whitepaper-cover h1 { font-size: clamp(2.7rem, 12vw, 4.5rem); }
  .whitepaper-cover-visual img { min-height: 340px; }
  .whitepaper-cover-note { right: 10px; bottom: -32px; }
  .whitepaper-summary { grid-template-columns: 1fr 1fr; }
  .whitepaper-summary div:nth-child(2) { border-right: 0; }
  .whitepaper-summary div:nth-child(-n+2) { border-bottom: 1px solid #dfe9e4; }
  .whitepaper-section { grid-template-columns: 1fr; gap: 16px; padding: 68px 28px; }
  .whitepaper-section-label { writing-mode: horizontal-tb; }
  .whitepaper-stat-grid,
  .whitepaper-role-grid,
  .whitepaper-roadmap { grid-template-columns: 1fr; }
  .whitepaper-flow { grid-template-columns: 1fr; }
  .whitepaper-flow b { text-align: center; transform: rotate(90deg); }
  .whitepaper-flow div { min-height: 0; }
  .whitepaper-conclusion { padding: 82px 28px; }
}

@media (max-width: 600px) {
  .whitepaper-summary { grid-template-columns: 1fr; }
  .whitepaper-summary div { border-right: 0; border-bottom: 1px solid #dfe9e4; }
  .whitepaper-toc-list a { grid-template-columns: 42px 1fr; gap: 10px; }
  .whitepaper-toc-list small { grid-column: 2; }
  .whitepaper-problem-grid,
  .whitepaper-security-grid { grid-template-columns: 1fr; }
  .whitepaper-value-list article { grid-template-columns: 1fr; gap: 10px; padding: 22px 0; }
  .whitepaper-cover-actions { flex-direction: column; }
  .whitepaper-cover-actions .button { width: 100%; }
}

.match-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.match-card {
  width: 100%;
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.match-card strong {
  color: var(--text);
  font-size: 1.1rem;
}

.match-card span {
  color: var(--muted);
}

.clinic-directory .workbench-panel {
  display: grid;
  gap: 14px;
}

.clinic-summary-card {
  align-content: start;
  min-height: 154px;
}

.clinic-card-phone {
  margin-top: 4px;
  color: var(--accent-deep) !important;
  font-weight: 800;
}

.clinic-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.clinic-card-actions .ghost-pill {
  min-height: 42px;
  justify-content: center;
}

.caregiver-entry {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 20px;
  align-items: center;
}

.caregiver-copy {
  display: grid;
  gap: 14px;
}

.caregiver-copy h2 {
  font-size: clamp(1.95rem, 3.2vw, 3.05rem);
  max-width: 12ch;
}

.caregiver-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 6px;
}

.caregiver-points span {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.caregiver-card img {
  width: 100%;
  height: auto;
  display: block;
}

.caregiver-card {
  display: block;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(78, 167, 135, 0.18);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 22px 54px rgba(74, 107, 86, 0.14);
}

.caregiver-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.clinic-entry {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 20px;
  align-items: center;
}

.clinic-entry-media img {
  width: 100%;
  display: block;
  border-radius: 28px;
  border: 1px solid rgba(78, 167, 135, 0.18);
  box-shadow: 0 22px 54px rgba(74, 107, 86, 0.14);
  object-fit: cover;
}

.clinic-entry-copy {
  display: grid;
  gap: 14px;
}

.clinic-entry-copy h2 {
  font-size: clamp(1.95rem, 3.2vw, 3.05rem);
  max-width: 12ch;
}

.legal-main {
  display: grid;
  gap: 24px;
}

.legal-page {
  max-width: 920px;
  margin-inline: auto;
}

.legal-page h1 {
  max-width: 14ch;
  margin-bottom: 16px;
}

.legal-page h2 {
  margin-top: 28px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-hero {
  display: grid;
  grid-template-columns: 1fr 0.46fr;
  gap: 20px;
  align-items: end;
}

.about-hero-copy {
  display: grid;
  gap: 14px;
}

.about-hero-copy h1 {
  max-width: 18ch;
}

.about-hero-copy p {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.about-hero-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(78, 167, 135, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(235, 248, 243, 0.98), rgba(255, 255, 255, 0.92));
}

.about-hero-card strong {
  color: var(--accent-deep);
  font-size: 1.25rem;
}

.about-hero-card span {
  color: var(--muted);
}

.about-article {
  display: block;
}

.about-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.pwa-guide-page-hero {
  display: grid;
  grid-template-columns: 1fr 0.74fr;
  gap: 22px;
  align-items: center;
}

.pwa-guide-page-copy {
  display: grid;
  gap: 14px;
}

.pwa-guide-page-copy h1 {
  max-width: 17ch;
}

.pwa-guide-page-copy p {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.8;
}

.pwa-guide-page-media {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(78, 167, 135, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 44px rgba(74, 107, 86, 0.12);
}

.pwa-guide-text-card div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.94);
}

.pwa-guide-text-card strong {
  color: var(--accent-deep);
  font-size: 1rem;
}

.pwa-guide-text-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.pwa-instructions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pwa-step-card,
.pwa-faq-grid div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.pwa-step-card h2,
.pwa-faq h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.pwa-step-card ol {
  margin: 12px 0 0;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.78;
}

.pwa-step-card li + li {
  margin-top: 7px;
}

.pwa-important {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(78, 167, 135, 0.2);
  border-radius: var(--radius-md);
  background: rgba(235, 248, 243, 0.82);
  color: var(--accent-deep);
  font-size: 0.9rem;
  line-height: 1.7;
}

.pwa-faq {
  display: grid;
  gap: 14px;
}

.pwa-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pwa-faq h3 {
  font-size: 1.16rem;
}

.pwa-faq p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.78;
}

.report-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.report-window-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
}

.report-label {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-metric-grid div {
  display: grid;
  gap: 4px;
}

.report-metric-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.report-value {
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
}

.report-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-chart-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
}

.report-chart-card .section-heading {
  margin-bottom: 0;
}

.report-chart-card h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-legend strong {
  color: var(--accent-deep);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.chart-dot-seen { background: #2f8d70; }
.chart-dot-click { background: #c48a36; }
.chart-dot-install { background: #4ea787; }

.report-chart {
  width: 100%;
  min-height: 220px;
  display: block;
  overflow: visible;
}

.report-pie-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pie-legend-panel {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 10px 0 0;
}

.pie-legend-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.pie-legend-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.pie-legend-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.pie-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
  margin-top: 3px;
}

.pie-legend-text {
  display: grid;
  gap: 2px;
}

.pie-legend-text strong {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}

.pie-legend-text small {
  color: var(--muted);
  font-size: 0.9rem;
}

.pie-total-box {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(247, 255, 247, 0.86);
}

.pie-total-box span {
  color: var(--muted);
  font-size: 0.88rem;
}

.pie-total-box strong {
  font-size: 1.65rem;
  color: var(--accent-deep);
}

.report-pie-chart {
  min-height: 430px;
}

.report-tree-chart {
  min-height: 430px;
}

.chart-title-main {
  fill: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.chart-title-sub {
  fill: var(--muted);
  font-size: 13px;
}

.chart-title-main-tree {
  font-size: 23px;
}

.chart-title-sub-tree {
  font-size: 13px;
}

.pie-segment {
  filter: drop-shadow(0 10px 16px rgba(55, 124, 98, 0.12));
}

.pie-callout-line,
.tree-link {
  fill: none;
  stroke: rgba(167, 177, 185, 0.92);
  stroke-width: 2;
}

.pie-callout-dot {
  opacity: 0.95;
}

.pie-callout-label,
.pie-callout-value,
.tree-node-label,
.tree-node-value {
  fill: var(--text);
  font-size: 14px;
}

.pie-callout-value,
.tree-node-value {
  fill: var(--muted);
  font-size: 12px;
}

.pie-center-label {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pie-center-value {
  fill: var(--accent-deep);
  font-size: 31px;
  font-weight: 900;
}

.tree-node circle:first-of-type {
  fill: rgba(255, 255, 255, 0.98);
  stroke-width: 3;
}

.tree-node-root circle:first-of-type {
  stroke: #7ea0d9;
}

.tree-node-branch circle:first-of-type {
  stroke: #9eb9e2;
}

.tree-node-leaf circle:first-of-type {
  stroke: #b7c9e4;
}

.tree-node-leaf-muted circle:first-of-type {
  stroke: #d7dfe8;
}

.tree-node-core {
  fill: #8ab0e0;
  stroke: none;
}

.tree-node-root .tree-node-core {
  fill: #6b89cb;
}

.tree-node-branch .tree-node-core {
  fill: #9eb9e2;
}

.tree-node-leaf .tree-node-core {
  fill: #bed0ea;
}

.tree-node-leaf-muted .tree-node-core {
  fill: #d7dfe8;
}

.chart-source {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.chart-axis {
  stroke: rgba(79, 103, 89, 0.36);
  stroke-width: 1.2;
}

.chart-grid-line {
  stroke: rgba(120, 168, 138, 0.18);
  stroke-width: 1;
  stroke-dasharray: 5 8;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-seen { stroke: #2f8d70; }
.chart-line-click { stroke: #c48a36; }
.chart-line-install { stroke: #4ea787; }

.chart-area {
  fill: rgba(78, 167, 135, 0.16);
}

.chart-label,
.chart-y-label {
  fill: var(--muted);
  font-size: 13px;
}

.chart-label {
  text-anchor: middle;
}

.report-table-section {
  display: grid;
  gap: 16px;
}

.report-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.report-table th,
.report-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

.report-table th {
  color: var(--accent-deep);
  font-weight: 800;
  background: rgba(235, 248, 243, 0.86);
}

.report-table td {
  color: var(--muted);
}

.report-empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.report-login-shell {
  display: grid;
  place-items: center;
  min-height: 62vh;
}

.report-login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.report-login-card h1 {
  max-width: none;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.report-login-card p {
  margin: 0;
  color: var(--muted);
}

.report-login-form {
  display: grid;
  gap: 14px;
}

.report-login-form label {
  display: grid;
  gap: 8px;
}

.report-login-form span {
  color: var(--muted);
  font-weight: 700;
}

.report-login-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
}

.report-login-error {
  padding: 12px 14px;
  border: 1px solid rgba(210, 92, 92, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 241, 241, 0.95);
  color: #a53a3a;
}

.clinic-list {
  display: grid;
  gap: 16px;
}

.clinic-card {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.clinic-card > img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: block;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(238, 249, 241, 0.9);
}

.clinic-card-body {
  display: grid;
  gap: 14px;
}

.clinic-card-body h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
}

.clinic-card-body p {
  margin: 0;
  color: var(--muted);
}

.clinic-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.98);
}

.clinic-note strong,
.clinic-note span {
  display: block;
}

.clinic-note span {
  color: var(--muted);
  margin-top: 4px;
}

.clinic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.match-preview {
  display: grid;
  gap: 16px;
}

.match-preview img {
  width: 100%;
  display: block;
  border-radius: 24px;
  object-fit: cover;
}

.match-preview-copy {
  display: grid;
  gap: 10px;
}

.match-preview-copy h2 {
  font-size: 1.8rem;
}

.match-modal-card {
  width: min(940px, 100%);
}

.profile-sheet {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 18px;
  align-items: center;
}

.profile-photo img {
  width: 100%;
  display: block;
  border-radius: 24px;
  object-fit: cover;
  background: #eef9f1;
}

.profile-info {
  display: grid;
  gap: 12px;
}

.profile-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(78, 167, 135, 0.12);
  color: var(--accent-deep);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.profile-info h3 {
  font-size: 1.8rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-grid div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.98);
}

.profile-grid span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.profile-grid strong {
  color: var(--text);
}

.workbench-shell { display: grid; gap: 16px; }

.workbench-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
}

.workbench-switch {
  display: inline-flex;
  padding: 6px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(78, 167, 135, 0.12);
}

.workbench-switch a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--accent-deep);
  font-weight: 700;
}

.workbench-switch a.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(74, 107, 86, 0.10);
}

.workbench-panel {
  padding: 20px;
}

.workbench-panel h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.gate-layout,
.caregiver-stage,
.family-layout {
  display: grid;
  gap: 16px;
}

.gate-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gate-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.disclaimer-box {
  max-height: 340px;
  overflow: auto;
  padding: 18px;
  background: #f8fcf8;
}

.disclaimer-box p { margin: 0 0 12px; }

.gate-signature {
  display: grid;
  gap: 8px;
}

.gate-signature input,
.contact-form input,
.contact-form select,
.contact-form textarea,
.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
}

.ai-query-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-query-form .ai-question,
.ai-query-form .button,
.ai-query-form .muted,
.summary-markdown {
  grid-column: 1 / -1;
}

.summary-markdown {
  margin: 14px 0 0;
  border: 1px solid rgba(15, 143, 120, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #f8fcfa;
  color: #17352d;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-x: auto;
}

.gate-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.gate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gate-actions-single {
  grid-template-columns: minmax(0, 1fr);
}

.gate-guide {
  display: flex;
  width: min(100%, 460px);
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  padding: 0 24px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
  white-space: nowrap;
  margin-inline: auto;
}

#openDisclaimer,
#openLogin {
  width: min(100%, 240px);
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  padding: 0 18px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
}

.gate-actions .gate-guide {
  width: 100%;
}

.gate-actions-single .gate-guide {
  width: min(100%, 240px);
}

.gate-message {
  min-height: 1.45em;
  margin: -2px 0 0;
  color: #b14242;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.is-locked { opacity: 0.82; }

.button.is-disabled,
.gate-actions .is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.caregiver-stage {
  grid-template-columns: 1fr 0.82fr;
}

.family-layout {
  grid-template-columns: 1.05fr 0.95fr;
}

.caregiver-columns,
.family-main,
.family-side {
  display: grid;
  gap: 16px;
}

.clinic-layout,
.admin-grid {
  display: grid;
  gap: 16px;
}

.clinic-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinic-log-panel {
  grid-column: 1 / -1;
}

.clinic-flow {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.98);
}

.clinic-flow p {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-return-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-return-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-shell {
  display: grid;
  gap: 16px;
}

.hero-shell-header,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-shell-header h2,
.panel-head h2 {
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  margin: 4px 0 0;
}

.pill,
.ghost-pill {
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--accent-deep);
  font-weight: 700;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.type-card {
  min-height: 138px;
  padding: 16px;
  display: grid;
  place-items: center;
  gap: 10px;
  cursor: pointer;
}

.type-card.more-card {
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.98), rgba(230, 239, 255, 0.98));
}

.type-icon {
  font-size: 2.15rem;
  line-height: 1;
}

.type-label {
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.timeline,
.trend-list,
.expense-list,
.info-grid {
  display: grid;
  gap: 10px;
}

.timeline-item,
.expense-item,
.trend-item {
  width: 100%;
  text-align: left;
  padding: 18px;
  cursor: pointer;
  display: grid;
  gap: 8px;
}

.record-date {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.record-open strong,
.expense-item strong,
.info-row strong,
.pair-box strong,
.trend-item strong {
  display: block;
  color: var(--text);
}

.trend-item strong {
  font-size: 1.8rem;
  color: #ef5b00;
}

.trend-item svg {
  width: 100%;
  height: 54px;
}

.trend-item polyline {
  fill: none;
  stroke: #f15a00;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge.confirmed {
  background: rgba(16, 185, 129, 0.12);
  color: #0f8a63;
}

.badge.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #b76a00;
}

.pair-box {
  border-radius: 22px;
  padding: 20px;
  cursor: pointer;
}

.pair-box.accent {
  background: linear-gradient(180deg, rgba(235, 248, 243, 0.98), rgba(224, 245, 236, 0.98));
}

.pair-box strong {
  font-size: 3rem;
  letter-spacing: 0.18em;
  text-align: center;
}

.caregiver-toolbar {
  background: linear-gradient(180deg, rgba(44, 105, 221, 0.95), rgba(33, 86, 201, 0.92));
  color: #fff;
}

.family-toolbar {
  background: linear-gradient(180deg, rgba(17, 134, 114, 0.95), rgba(11, 111, 94, 0.92));
  color: #fff;
}

.caregiver-toolbar .section-heading h1,
.caregiver-toolbar .section-heading p,
.caregiver-toolbar .eyebrow,
.family-toolbar .section-heading h1,
.family-toolbar .section-heading p,
.family-toolbar .eyebrow {
  color: #fff;
}

.caregiver-toolbar .workbench-switch,
.family-toolbar .workbench-switch {
  background: rgba(255, 255, 255, 0.18);
}

.caregiver-toolbar .workbench-switch a,
.family-toolbar .workbench-switch a {
  color: #172b25;
}

.caregiver-toolbar .workbench-switch a.is-active {
  color: #1f4bd8;
}

.family-toolbar .workbench-switch a.is-active {
  color: #0e8a6e;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 33, 41, 0.56);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 80;
}

.modal-overlay.is-hidden { display: none; }

.is-hidden { display: none !important; }

.modal-card {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.98);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-head h2 {
  font-size: 1.6rem;
  margin: 6px 0 0;
}

.record-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(78, 167, 135, 0.12);
  cursor: pointer;
  font-size: 1.4rem;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-field {
  display: grid;
  gap: 8px;
}

.modal-field span {
  color: var(--muted);
  font-weight: 700;
}

.receipt-preview {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.98);
}

.receipt-preview.is-empty {
  display: flex;
  justify-content: center;
  color: var(--muted);
}

.receipt-preview img,
.receipt-file-icon {
  width: 88px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}

.receipt-preview strong,
.receipt-preview span {
  display: block;
}

.receipt-preview strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.receipt-preview span {
  color: var(--accent-deep);
  font-size: 0.85rem;
  margin-top: 4px;
}

.receipt-file-icon {
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  font-weight: 800;
}

.search-panel {
  display: grid;
  gap: 14px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.search-keyword {
  grid-column: 1 / -1;
}

.search-submit {
  justify-self: end;
  min-height: 52px;
  padding: 12px 22px;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 252, 248, 0.98);
}

.search-result-card img {
  width: 96px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.search-result-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
}

.search-result-card p {
  margin: 4px 0;
  color: var(--muted);
}

.modal-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.modal-chip {
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.more-card-option {
  display: grid;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: center;
}

.more-card-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.more-card-label {
  font-weight: 800;
  color: var(--text);
}

.modal-stack {
  display: grid;
  gap: 12px;
}

.modal-stack strong {
  color: var(--text);
}

.modal-record-meta {
  margin: 0 0 4px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.link-card:focus-visible,
.type-card:focus-visible,
.timeline-item:focus-visible,
.expense-item:focus-visible,
.trend-item:focus-visible,
.pair-box:focus-visible,
.ghost-pill:focus-visible,
.modal-chip:focus-visible,
.button:focus-visible,
.workbench-switch a:focus-visible {
  box-shadow: 0 0 0 4px rgba(78, 167, 135, 0.15);
}

@media (max-width: 960px) {
  .hero,
  .feature-grid,
  .caregiver-entry,
  .clinic-entry,
  .about-hero,
  .pwa-guide-page-hero,
  .report-hero,
  .report-window-grid,
  .pwa-instructions,
  .pwa-faq-grid,
  .report-chart-grid,
  .clinic-card,
  .gate-layout,
  .caregiver-stage,
  .family-layout,
  .clinic-layout,
  .admin-grid,
  .contact-layout,
  .match-layout {
    grid-template-columns: 1fr;
  }

  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .more-grid {
    grid-template-columns: 1fr;
  }

  .form-grid { grid-template-columns: 1fr; }

  .clinic-card {
    gap: 16px;
    padding: 18px;
  }

  .clinic-card > img {
    height: auto;
    min-height: 0;
    object-fit: contain;
    align-self: start;
  }

  .report-pie-layout {
    grid-template-columns: 1fr;
  }

  .pie-legend-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 100%);
    padding: 12px 0 28px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 0 18px;
  }

  .brand {
    gap: 14px;
  }

  .brand-logo {
    width: 84px;
    height: 84px;
  }

  .brand-copy strong {
    font-size: 1.2rem;
  }

  .brand-copy small {
    font-size: 0.92rem;
  }

  .topnav {
    justify-content: flex-start;
  }

  .section,
  .workbench-toolbar,
  .workbench-panel,
  .gate-panel,
  .modal-card {
    padding: 16px;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .report-chart-card {
    padding: 14px;
  }

  .pie-legend-list {
    grid-template-columns: 1fr;
  }

  .report-pie-chart,
  .report-tree-chart {
    min-height: 320px;
  }

  .chart-title-main {
    font-size: 22px;
  }

  .hero-image {
    min-height: 300px;
  }

  .hero-actions,
  .gate-actions,
  .modal-actions,
  .form-actions,
  .admin-return-panel,
  .hero-shell-header,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .form-footer .button {
    justify-self: stretch;
  }

  .pwa-install-toast {
    bottom: 12px;
    width: min(360px, calc(100% - 24px));
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .pwa-install-icon {
    display: none;
  }

  .pwa-install-actions {
    gap: 8px;
  }

  .pwa-install-actions a,
  .pwa-install-actions button {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.8rem;
  }

  .about-cta {
    flex-direction: column;
  }

  .gate-guide {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    min-width: 0;
    width: min(100%, 100%);
  }

  #openDisclaimer,
  #openLogin {
    width: 100%;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 0 18px;
  }

  .gate-actions {
    grid-template-columns: 1fr;
  }

  .type-grid,
  .modal-chip-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-grid,
  .search-result-card {
    grid-template-columns: 1fr;
  }

  .search-submit {
    justify-self: stretch;
  }

  .caregiver-points {
    grid-template-columns: 1fr;
  }

  .pair-box strong {
    font-size: 2.4rem;
  }

  .clinic-card {
    gap: 14px;
    padding: 14px;
  }

  .clinic-card > img {
    border-radius: 18px;
  }

  .clinic-card-body {
    gap: 12px;
  }

  .clinic-card-body h2 {
    font-size: 1.46rem;
    line-height: 1.2;
  }

  .clinic-card-body p,
  .clinic-note span {
    font-size: 0.94rem;
    line-height: 1.72;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-grid div {
    padding: 12px;
  }

  .profile-grid strong {
    font-size: 1rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .clinic-note {
    padding: 12px;
  }

  .clinic-actions {
    flex-direction: column;
  }

  .clinic-actions .button {
    width: 100%;
    min-height: 54px;
  }

  .ai-query-form {
    grid-template-columns: 1fr;
  }
}
