:root {
  color-scheme: light;
  --white: #ffffff;
  --recessed: #f1efe8;
  --text: #2c2c2a;
  --muted: #5f5e5a;
  --placeholder: #888780;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.2);
  --amber-soft: #faeeda;
  --amber: #ef9f27;
  --amber-dark: #854f0b;
  --green-soft: #eaf3de;
  --green: #639922;
  --green-dark: #3b6d11;
  --pink-soft: #fbeaf0;
  --pink: #d4537e;
  --pink-dark: #993556;
  --blue-soft: #e6f1fb;
  --blue: #378add;
  --blue-dark: #185fa5;
  --coral-soft: #faece7;
  --coral: #d85a30;
  --coral-dark: #993c1d;
  --purple-soft: #eeedfe;
  --purple: #7f77dd;
  --purple-dark: #534ab7;
  --teal-soft: #e1f5ee;
  --teal: #1d9e75;
  --teal-dark: #0f6e56;
  --red-soft: #fcebeb;
  --red: #e24b4a;
  --red-dark: #a32d2d;
  --gray-soft: #f1efe8;
  --gray: #888780;
  --gray-dark: #444441;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

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

h1 {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}

h2 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

h3 {
  font-size: 14px;
  font-weight: 500;
}

i {
  font-size: 16px;
  line-height: 1;
}

.entry-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.entry-card {
  display: grid;
  width: min(390px, 100%);
  gap: 14px;
  padding: 22px;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  background: var(--white);
}

.auth-card {
  align-self: start;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--recessed);
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.segmented-control button.active {
  background: var(--white);
  color: var(--text);
}

.lead {
  color: var(--muted);
  font-size: 13px;
}

.entry-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.brand-mark.small {
  width: 28px;
  height: 28px;
}

.app-shell,
.child-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.app-header,
.child-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 0.5px solid var(--border);
  border-radius: 50px;
  background: var(--white);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 50px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  background: var(--recessed);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.main-column,
.side-column {
  display: grid;
  gap: 12px;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
}

.meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.panel {
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.access-panel {
  border-color: rgba(29, 158, 117, 0.32);
  background: linear-gradient(180deg, var(--teal-soft), var(--white));
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.button,
.icon-button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.button {
  padding: 0 12px;
  border: 0.5px solid var(--border);
}

.button.compact {
  min-height: 32px;
}

.button.dark {
  border-color: var(--text);
  background: var(--text);
  color: var(--white);
}

.button.light,
.icon-button,
.upload-button {
  background: var(--white);
  color: var(--text);
}

.button.light,
.icon-button {
  border: 0.5px solid var(--border);
}

.icon-button {
  width: 34px;
  padding: 0;
}

.password-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 6px;
}

.field-icon-button {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
}

.field-icon-button:hover,
.field-icon-button:focus {
  color: var(--text);
  border-color: var(--border-strong);
  outline: none;
}

.profile-menu {
  position: relative;
}

.profile-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 3px 8px 3px 3px;
  border: 0.5px solid var(--border);
  border-radius: 50px;
  background: var(--white);
  color: var(--text);
}

.profile-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: grid;
  width: 170px;
  gap: 3px;
  padding: 6px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
}

.profile-menu-popover a,
.profile-menu-popover button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.profile-menu-summary {
  display: grid;
  gap: 3px;
  padding: 6px 8px 8px;
  border-bottom: 0.5px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.profile-menu-summary b {
  color: var(--text);
  font-weight: 400;
}

.profile-menu-popover a:hover,
.profile-menu-popover button:hover {
  background: var(--recessed);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.pill.amber,
.metric.amber,
.credential-box.amber {
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.pill.green,
.metric.green {
  background: var(--green-soft);
  color: var(--green-dark);
}

.pill.blue,
.metric.blue,
.avatar.blue {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.pill.teal,
.avatar.teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.pill.gray,
.credential-box.gray {
  background: var(--gray-soft);
  color: var(--gray-dark);
}

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

.metric {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border-radius: 12px;
}

.metric span,
.credential-box span,
.credential-box small {
  font-size: 11px;
  font-weight: 400;
}

.metric strong,
.credential-box strong {
  font-size: 16px;
  font-weight: 500;
}

.report-body,
.profile-list {
  display: grid;
  gap: 9px;
}

.report-body p,
.profile-list p {
  display: grid;
  gap: 2px;
  color: var(--text);
}

.report-body span,
.profile-list span {
  color: var(--muted);
  font-size: 11px;
}

.profile-list b {
  font-weight: 400;
}

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

.topic-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) minmax(54px, auto);
  align-items: center;
  gap: 10px;
}

.topic-row strong {
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 50px;
  background: var(--recessed);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.form-stack {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border: 1.5px solid var(--border-strong);
}

input,
select {
  min-height: 34px;
  padding: 0 10px;
}

textarea {
  resize: none;
  padding: 9px 10px;
  line-height: 1.55;
}

::placeholder {
  color: var(--placeholder);
}

.credential-box {
  display: grid;
  gap: 3px;
  padding: 11px;
  border-radius: 12px;
}

.access-card {
  display: grid;
  gap: 9px;
}

.access-row,
.access-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 3px;
  padding: 10px;
  border: 0.5px solid rgba(29, 158, 117, 0.22);
  border-radius: 8px;
  background: var(--white);
}

.access-row span,
.access-link span,
.access-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.access-row strong,
.access-link a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.access-link a {
  color: var(--teal-dark);
}

.child-login-shell {
  min-height: calc(100vh - 92px);
  padding: 24px 0;
}

.child-login-card {
  border-color: rgba(29, 158, 117, 0.26);
  background: var(--teal-soft);
}

.child-shell {
  max-width: 980px;
}

.site-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 34px;
}

.landing-column {
  display: grid;
  gap: 30px;
  padding-bottom: 52px;
}

.landing-intro,
.text-section,
.landing-final {
  display: grid;
  gap: 11px;
}

.landing-intro {
  padding-top: 22px;
}

.landing-intro h1 {
  max-width: 620px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 3px;
}

.text-section {
  padding-top: 22px;
  border-top: 0.5px solid var(--border);
}

.text-section p {
  color: var(--muted);
}

.landing-final {
  padding: 18px;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  background: var(--recessed);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: start;
}

.child-main {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

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

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

.calendar-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -2px 0 12px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.calendar-cell,
.calendar-entry {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

.calendar-cell {
  min-height: 96px;
  align-content: start;
}

.calendar-cell.muted {
  min-height: 0;
  border-color: transparent;
  background: transparent;
}

.calendar-cell.today {
  border-color: rgba(29, 158, 117, 0.5);
}

.calendar-cell.has-items {
  background: var(--teal-soft);
}

.calendar-cell span,
.calendar-cell small,
.calendar-entry span {
  color: var(--muted);
  font-size: 11px;
}

.calendar-cell strong {
  color: var(--teal-dark);
  min-height: 20px;
  font-size: 18px;
  font-weight: 500;
}

.calendar-cell div {
  display: grid;
  gap: 3px;
}

.calendar-entry strong {
  font-size: 14px;
  font-weight: 500;
}

.calendar-entry p {
  color: var(--muted);
}

.chat-panel {
  display: grid;
  min-height: calc(100vh - 92px);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  overflow: hidden;
}

.chat-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 0.5px solid var(--border);
}

.chat-profile > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.child-start {
  display: grid;
  gap: 14px;
  min-height: min(520px, calc(100vh - 190px));
  align-content: center;
  justify-items: start;
  padding: 22px;
  background: var(--white);
}

.child-start h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.child-start p:not(.meta) {
  max-width: 520px;
  color: var(--muted);
}

.child-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--recessed);
}

.guide-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 56px;
  padding: 9px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

.guide-step span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
}

.guide-step p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 500;
}

.avatar.small {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.chat-feed {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 360px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 14px;
  background: var(--white);
}

.message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  max-width: min(520px, 92%);
  padding: 10px;
  border-radius: 12px;
  font-size: 13px;
}

.message.system {
  justify-self: start;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.message.child {
  justify-self: end;
  background: var(--gray-soft);
  color: var(--text);
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 0.5px solid var(--border);
  background: var(--recessed);
}

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

.submission-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
}

.submission-card h2 {
  font-size: 14px;
}

.upload-row {
  display: flex;
  gap: 8px;
}

.upload-button {
  position: relative;
  flex: 1;
  border: 0.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.history-list {
  display: grid;
  gap: 8px;
}

.history-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 0.5px solid var(--border);
  background: var(--recessed);
}

.history-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.history-item:hover,
.history-item:focus {
  border-color: var(--border-strong);
  outline: none;
}

.history-item span {
  color: var(--muted);
  font-size: 11px;
}

.history-item strong {
  font-size: 13px;
  font-weight: 500;
}

.history-item small {
  color: var(--muted);
  font-size: 11px;
}

.help-list p {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: var(--muted);
}

.help-list i {
  color: var(--blue-dark);
}

.body-text {
  color: var(--muted);
}

.form-note {
  color: var(--muted);
  font-size: 11px;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 80;
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px 14px;
  border: 0.5px solid rgba(29, 158, 117, 0.36);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

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

@media (max-width: 860px) {
  .app-header,
  .child-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
  }

  .site-header,
  .page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header .brand-link,
  .child-header .brand-link {
    min-width: 0;
  }

  .app-header .top-nav,
  .child-header .top-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .top-nav {
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 12px;
  }

  .profile-menu {
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .profile-menu-popover {
    right: 0;
    left: auto;
    width: min(190px, calc(100vw - 20px));
    z-index: 30;
  }

  .layout,
  .chat-layout,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .landing-intro {
    padding-top: 8px;
  }

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

  .chat-panel {
    min-height: calc(100vh - 220px);
  }

  .child-guide {
    grid-template-columns: 1fr;
  }

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

  .guide-step {
    min-height: auto;
  }

  .chat-feed {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .app-shell,
  .child-shell {
    padding: 10px;
  }

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

  .topic-row strong {
    text-align: left;
  }

  .upload-row {
    flex-direction: column;
  }

  .calendar-grid {
    gap: 5px;
  }

  .calendar-cell {
    min-height: 74px;
    padding: 7px;
  }

  .calendar-cell strong {
    font-size: 15px;
  }

  .calendar-cell small {
    font-size: 9px;
  }
}
