@font-face {
  font-family: "InterVariable";
  src: url("./inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "InterVariable";
  src: url("./inter-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #263c39;
  --ink-soft: #354744;
  --muted: #65756f;
  --teal: #4c9a91;
  --teal-dark: #2d6f68;
  --teal-soft: #edf6f2;
  --linen: #f8f3ec;
  --cream: #fbf9f5;
  --paper: #ffffff;
  --line: #e4dac9;
  --line-strong: #c9c1b4;
  --terracotta: #d98977;
  --terracotta-soft: #fff2ed;
  --yellow: #ffcf70;
  --yellow-soft: #fff8df;
  --lavender: #cab8ff;
  --lavender-soft: #f5f1fb;
  --sage: #c7d8c6;
  --blue-soft: #eef5f8;
  --danger: #9c3f38;
  --danger-bg: #fff3f1;
  --focus: rgba(45, 111, 104, 0.24);
  --shadow: 0 18px 50px rgba(38, 60, 57, 0.08);
  --shadow-small: 0 8px 24px rgba(38, 60, 57, 0.07);
  color: var(--ink);
  background: var(--cream);
  font-family: "InterVariable", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--cream); color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--cream); color: var(--ink); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: #235b55; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; color: white; background: var(--teal-dark); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.feedback { margin: 0 0 18px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #cfe1da; border-radius: 14px; color: var(--teal-dark); background: var(--teal-soft); font-size: .88rem; font-weight: 650; }
.feedback--error { color: var(--danger); background: var(--danger-bg); border-color: #e7b8b3; }
.feedback i { margin-top: 2px; font-size: 1.1rem; }

.portal-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid rgba(228, 218, 201, .72); background: rgba(251, 249, 245, .94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.portal-header__inner { width: min(100%, 1120px); min-height: 76px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 740; letter-spacing: -.04em; }
.portal-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(45, 111, 104, .18); background: var(--paper); }
.portal-nav { display: flex; align-items: center; gap: 6px; }
.portal-nav--mobile { display: none; }
.portal-nav__item { min-height: 42px; padding: 9px 14px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; border-radius: 999px; font-size: .88rem; font-weight: 650; transition: color 150ms ease, background 150ms ease, transform 150ms ease; }
.portal-nav__item i { font-size: 1.15rem; }
.portal-nav__item:hover { color: var(--teal-dark); background: rgba(76, 154, 145, .1); }
.portal-nav__item.is-active { color: white; background: var(--teal-dark); box-shadow: 0 7px 18px rgba(45, 111, 104, .18); }

.portal-main { width: min(100%, 1120px); margin: 0 auto; padding: 44px 24px 96px; }
.portal-main--narrow { width: min(100%, 760px); }
.portal-body--auth .portal-header { position: static; border-bottom: 0; }
.portal-body--auth .portal-main { width: min(100%, 560px); padding-top: 72px; }

h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.12; }
h1 { font-size: clamp(2.25rem, 6vw, 4.35rem); font-weight: 760; letter-spacing: -.055em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 720; letter-spacing: -.035em; }
h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.018em; }
h4 { font-size: .92rem; font-weight: 720; }
p { margin: .75rem 0 0; }
.eyebrow { margin: 0 0 12px; color: var(--teal-dark); font-size: .76rem; font-weight: 760; letter-spacing: .12em; line-height: 1.3; text-transform: uppercase; }
.lede { max-width: 46rem; margin-top: 18px; color: var(--ink-soft); font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.55; }
.muted { color: var(--muted); }
.microcopy { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading--spaced { margin-top: 34px; }
.section-heading p { margin: 0; color: var(--muted); font-size: .86rem; }

section, .card, .panel { margin: 18px 0 0; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-small); }
.panel--flat { box-shadow: none; }
.panel--tint { background: var(--teal-soft); border-color: #cfe1da; }
.panel--warning { background: var(--yellow-soft); border-color: #ead5a1; }
.panel--danger { background: var(--danger-bg); border-color: #e7b8b3; }
.hero-panel { margin: 0; padding: clamp(24px, 5vw, 42px); background: var(--paper); border-top: 4px solid var(--teal); box-shadow: var(--shadow); }
.hero-panel h1 { max-width: 18ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stats-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-height: 124px; margin: 0; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: none; }
.stat-card:nth-child(1) { background: var(--teal-soft); border-color: #cfe1da; }
.stat-card:nth-child(2) { background: var(--yellow-soft); border-color: #ead5a1; }
.stat-card:nth-child(3) { background: var(--lavender-soft); border-color: #ddd2f3; }
.stat-card__icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--teal-dark); background: rgba(255,255,255,.72); font-size: 1.1rem; }
.metric { margin-top: 12px; color: var(--ink); font-size: 2rem; font-weight: 760; letter-spacing: -.045em; line-height: 1; }
.metric-label { margin-top: 6px; color: var(--muted); font-size: .78rem; font-weight: 650; }

.children-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.child-panel { margin-top: 0; padding: 0; overflow: hidden; }
.child-panel__header { padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #fcfaf6; }
.child-panel__avatar { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; color: var(--teal-dark); background: var(--teal-soft); border: 1px solid #cfe1da; border-radius: 50%; font-weight: 760; }
.child-panel__title { display: flex; align-items: center; gap: 12px; }
.activity-list, .report-list, .clean-list, .conversation-list { margin: 0; padding: 0; list-style: none; }
.activity-card { padding: 18px 22px; border-top: 1px solid var(--line); }
.activity-card:first-child { border-top: 0; }
.activity-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.activity-card__top a { color: var(--ink); font-weight: 700; text-decoration: none; }
.activity-card__top a:hover { color: var(--teal-dark); }
.activity-card__minutes { flex: 0 0 auto; padding: 4px 8px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 999px; font-size: .72rem; font-weight: 720; }
.activity-card__observation { margin-top: 7px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.empty-state { padding: 26px 22px; color: var(--muted); text-align: center; font-size: .88rem; }

.report-list li, .clean-list > li, .conversation-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.report-list li:first-child, .clean-list > li:first-child, .conversation-list li:first-child { border-top: 0; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.report-row a { color: var(--ink); font-weight: 680; text-decoration: none; }
.status-badge, .pill { width: fit-content; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; color: var(--teal-dark); background: var(--teal-soft); border: 1px solid #cfe1da; border-radius: 999px; font-size: .69rem; font-weight: 720; text-transform: capitalize; }
.status-badge--warm { color: #7b5b1e; background: var(--yellow-soft); border-color: #ead5a1; }

.portal-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; margin-top: 13px; color: var(--ink); font-size: .8rem; font-weight: 680; }
input, select, textarea { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 11px; font-size: .95rem; font-weight: 450; }
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-dark); box-shadow: 0 0 0 3px var(--focus); }
button, .button { min-height: 46px; margin: 14px 7px 0 0; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: white; background: var(--teal-dark); border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 700; text-align: center; text-decoration: none; transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
button:hover, .button:hover { color: white; background: #235b55; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(45, 111, 104, .16); }
button:disabled { cursor: wait; opacity: .62; transform: none; box-shadow: none; }
button.secondary, .button.secondary { color: var(--teal-dark); background: var(--paper); border: 1px solid var(--line-strong); }
button.secondary:hover, .button.secondary:hover { color: var(--teal-dark); background: var(--teal-soft); box-shadow: none; }
button.danger, .button.danger { color: var(--danger); background: var(--danger-bg); border: 1px solid #e7b8b3; }
button.danger:hover, .button.danger:hover { color: var(--danger); background: #ffe9e6; box-shadow: none; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.inline { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.inline button { min-height: 34px; margin: 0 0 0 6px; padding: 6px 10px; font-size: .72rem; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(140px, .7fr)) auto; align-items: end; gap: 12px; }
.filter-bar label, .filter-bar button { margin-top: 0; }
.trace { margin-top: 14px; padding: 16px; background: #f7faf8; border: 1px solid #d8e6df; border-radius: 14px; }
.trace p:first-child { margin-top: 0; }
.trace__title { margin-top: 10px; }
.trace-meta { color: var(--muted); font-size: .78rem; }
.section-subheading { margin-top: 20px; }
.checkbox-label input { width: auto; min-height: auto; }
details { margin-top: 12px; }
summary { min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--teal-dark); cursor: pointer; font-weight: 690; }

.pathway-grid { display: grid; gap: 14px; }
.pathway-card { margin: 0; padding: 0; overflow: hidden; }
.pathway-card > summary { min-height: 76px; padding: 18px 20px; justify-content: space-between; list-style: none; }
.pathway-card > summary::-webkit-details-marker { display: none; }
.pathway-card > summary::after { content: "+"; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; font-size: 1.1rem; }
.pathway-card[open] > summary::after { content: "−"; }
.pathway-card__body { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.domain-section { margin-top: 34px; }
.domain-section__header { margin-bottom: 14px; padding: 0 2px; }
.domain-section__header p { max-width: 48rem; color: var(--muted); }
.step-list { margin: 18px 0 0; padding: 0; list-style: none; }
.step-item { padding: 18px 0; border-top: 1px solid var(--line); }
.step-item:first-child { border-top: 0; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-grid--spaced { margin-top: 24px; }
.settings-grid section { margin: 0; }
.settings-grid .settings-wide { grid-column: 1 / -1; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.person-row__main { display: flex; align-items: center; gap: 11px; }
.person-dot { width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; font-weight: 740; }

.auth-card { padding: 30px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card__avatar { width: 70px; height: 70px; margin-bottom: 22px; border-radius: 50%; border: 1px solid rgba(45,111,104,.2); }
.auth-card form { margin-top: 24px; }
.auth-card button { width: 100%; }

.conversation-list strong { display: block; color: var(--ink); font-size: .82rem; }
.conversation-list p { margin-top: 5px; color: var(--muted); }
.pagination { margin-top: 18px; display: flex; justify-content: space-between; gap: 12px; }

.portal-nav-spacer { display: none; }

@media (max-width: 760px) {
  .portal-header__inner { min-height: 64px; padding: 9px 16px; }
  .portal-nav--desktop { display: none; }
  .portal-brand { font-size: 1.12rem; }
  .portal-brand img { width: 40px; height: 40px; }
  .portal-main { padding: 28px 16px 104px; }
  .portal-body--auth .portal-main { padding-top: 42px; }
  h1 { font-size: clamp(2rem, 11vw, 3.1rem); }
  .hero-panel { padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 112px; padding: 14px 12px; }
  .metric { font-size: 1.55rem; }
  .metric-label { font-size: .67rem; line-height: 1.3; }
  section, .card, .panel { padding: 18px; border-radius: 17px; }
  .children-grid, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .settings-wide { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .child-panel { padding: 0; }
  .child-panel__header, .activity-card { padding-left: 18px; padding-right: 18px; }
  .report-row, .person-row { align-items: flex-start; }
  .person-row, .report-row { flex-direction: column; }
  .person-row .inline, .report-row .inline { width: 100%; justify-content: flex-start; }
  .inline button { margin-left: 0; }
  .filter-bar { grid-template-columns: 1fr; }
  .portal-nav--mobile { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); min-height: 64px; padding: 7px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: rgba(255,255,255,.95); border: 1px solid rgba(201,193,180,.8); border-radius: 20px; box-shadow: 0 16px 42px rgba(38,60,57,.18); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .portal-nav__item { min-height: 50px; padding: 5px 4px; flex-direction: column; justify-content: center; gap: 2px; border-radius: 14px; font-size: .64rem; }
  .portal-nav__item i { font-size: 1.3rem; }
  .portal-nav__item.is-active { box-shadow: none; }
  .portal-nav-spacer { display: block; height: calc(82px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 24px 20px; }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 92px; }
  .activity-card__top { display: grid; }
  .activity-card__minutes { width: fit-content; }
  .phone-row { grid-template-columns: 1fr; }
}

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