:root {
  color-scheme: light;
  --ink: #193247;
  --navy: #123d49;
  --blue: #0d6873;
  --blue-dark: #0a5360;
  --aqua: #3eb49f;
  --mint: #e1f7ef;
  --yellow: #f6c84c;
  --yellow-soft: #fff7d1;
  --coral: #ef7867;
  --coral-soft: #fff0ed;
  --paper: #f4fafc;
  --white: #ffffff;
  --line: #d5e4ea;
  --line-strong: #a9bdc7;
  --muted: #61798a;
  --success: #218869;
  --shadow: 0 20px 48px rgba(25, 50, 71, .14);
  --soft-shadow: 0 7px 20px rgba(25, 50, 71, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(18, 111, 145, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 111, 145, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 56px 56px;
}

button, input, select, textarea {
  font: inherit;
  letter-spacing: 0;
}

button, .file-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 780;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file-button:focus-within {
  outline: 3px solid rgba(18, 111, 145, .28);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

.mascot {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center bottom;
}

.mascot-topbar {
  width: 54px;
  height: 58px;
}

.mascot-notice {
  width: 66px;
  height: 72px;
}

.topbar {
  min-height: 82px;
  padding: 11px clamp(18px, 4vw, 50px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(213, 228, 234, .95);
  box-shadow: 0 7px 20px rgba(25, 50, 71, .06);
  backdrop-filter: blur(14px);
}

.topbar-brand,
.topbar-actions,
.connection {
  display: flex;
  align-items: center;
}

.topbar-brand { min-width: 0; gap: 10px; }
.topbar-actions { gap: 12px; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.brand {
  display: flex;
  align-items: baseline;
  font-size: 36px;
  font-weight: 920;
  line-height: 1;
}

.brand strong { color: #e7a900; }
.brand span { color: #159ab8; }
.brand.compact { font-size: 28px; }

.role-chip {
  padding: 7px 10px;
  color: var(--blue-dark);
  background: #e6f4f8;
  border: 1px solid #bcdde7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.user-menu-wrap { position: relative; }

.user-avatar-button {
  width: 50px;
  height: 50px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #cbb24f, var(--soft-shadow);
  font-size: 16px;
  font-weight: 920;
}

.user-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 10px);
  right: 0;
  width: min(330px, calc(100vw - 28px));
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.user-menu > div:nth-child(2) { min-width: 0; }
.user-menu strong, .user-menu span { display: block; overflow-wrap: anywhere; }
.user-menu > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.user-menu .role-chip { justify-self: start; grid-column: 1 / -1; }
.user-menu a {
  grid-column: 1 / -1;
  color: var(--blue);
  font-size: 13px;
  font-weight: 820;
}
.user-menu button { grid-column: 1 / -1; width: 100%; }

.connection {
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.connection span:first-child {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
}

.connection.online span:first-child { background: #43c797; }

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 12px clamp(14px, 3vw, 36px);
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  backdrop-filter: blur(10px);
}

.tab {
  min-height: 42px;
  padding: 9px 15px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
}

.tab:hover { color: var(--ink); background: #edf6f8; }

.tab.active {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: inset 0 -3px 0 rgba(25, 50, 71, .16);
}

.tab-badge {
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  border-radius: 999px;
  font-size: 11px;
}

.child-context {
  min-height: 74px;
  padding: 11px clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(180px, auto) auto;
  gap: 13px;
  align-items: center;
  background: var(--yellow-soft);
  border-bottom: 1px solid #ead98b;
}

.child-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(25, 50, 71, .14);
  font-size: 19px;
  font-weight: 900;
}

.child-context-copy span,
.child-context-account {
  color: var(--muted);
  font-size: 13px;
}

.child-context-copy strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
}

.child-context-account {
  text-align: right;
  overflow-wrap: anywhere;
}

main { padding: clamp(24px, 4vw, 48px); }
.view { display: none; }
.view.active { display: block; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 39px);
  line-height: 1.12;
}

.section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0;
}

.section-note {
  max-width: 860px;
  margin: -9px 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.primary, .secondary, .danger, .google-button {
  min-height: 46px;
  padding: 10px 17px;
}

.primary {
  color: var(--white);
  background: var(--blue);
  box-shadow: var(--soft-shadow);
}

.primary:hover { background: var(--blue-dark); }

.secondary {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.secondary:hover { background: #edf6f8; }

.danger {
  color: #a43f32;
  background: var(--coral-soft);
  border: 1px solid #f1bdb6;
}

.full { width: 100%; }

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 22px;
}

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

.metric {
  min-height: 116px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--aqua);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.metric:nth-child(3n + 2) { border-top-color: var(--yellow); }
.metric:nth-child(3n) { border-top-color: var(--coral); }
.metric span { color: var(--muted); font-size: 13px; font-weight: 740; }
.metric strong { display: block; margin-top: 8px; font-size: 25px; overflow-wrap: anywhere; }

.home-heading {
  margin-bottom: 18px;
}

.home-heading h2 span {
  color: var(--blue);
}

.home-children {
  margin-bottom: 10px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.home-children-heading,
.home-insights-heading,
.home-pulse-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-children-heading {
  margin-bottom: 12px;
}

.home-children-heading h3,
.home-insights-heading h3,
.home-quick-actions h3 {
  margin: 0;
}

.home-children-heading h3 {
  font-size: 18px;
}

.home-children-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.home-count {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}

.home-child-switcher {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.home-child-switcher .empty {
  width: 100%;
}

.home-child-switcher .chat-contact {
  min-width: min(290px, 78vw);
  min-height: 72px;
  flex: 0 0 270px;
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-snap-align: start;
}

.home-child-switcher .chat-contact:last-child {
  border: 1px solid var(--line);
}

.home-child-switcher .chat-contact.active {
  border-color: var(--aqua);
  box-shadow: inset 5px 0 var(--aqua), 0 0 0 2px rgba(62, 180, 159, .14);
}

.home-child-switcher .chat-contact.chat-restricted {
  background: #f8fafb;
}

.chat-contact-meta i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.home-notification-status {
  margin: 0 2px 14px;
  color: var(--muted);
  font-size: 12px;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: start;
}

.home-chat {
  min-width: 0;
}

.home-chat .chat-layout {
  min-height: 620px;
}

.home-chat .chat-messages {
  max-height: 62vh;
}

.home-insights {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.home-insights-heading {
  min-height: 54px;
  padding: 2px 2px 0;
}

.home-insights-heading .eyebrow {
  margin-bottom: 3px;
}

.home-insights-heading h3 {
  font-size: 24px;
}

.home-insights-heading .profile-avatar {
  color: var(--ink);
  background: var(--yellow);
}

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

.home-stat-grid > .empty {
  grid-column: 1 / -1;
}

.home-stat {
  min-height: 154px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.home-stat:nth-child(2) .home-stat-icon { color: #a87300; background: var(--yellow-soft); }
.home-stat:nth-child(3) .home-stat-icon { color: #bd5345; background: var(--coral-soft); }
.home-stat:nth-child(4) .home-stat-icon { color: var(--blue); background: #e5f5f8; }

.home-stat-icon {
  width: 35px;
  height: 35px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: var(--mint);
  border-radius: 8px;
}

.home-stat-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-stat > span:not(.home-stat-icon) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-stat strong {
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.home-stat small {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.home-challenge-pulse {
  padding: 16px;
  background: var(--yellow-soft);
  border: 1px solid #ead98b;
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
}

.home-challenge-pulse:empty {
  display: none;
}

.home-pulse-heading span,
.home-pulse-heading strong {
  display: block;
}

.home-pulse-heading span {
  color: #766825;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-pulse-heading strong {
  margin-top: 3px;
  font-size: 16px;
}

.home-pulse-heading > b {
  color: var(--blue);
  font-size: 13px;
}

.home-week {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.home-week-day {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.home-week-day b {
  color: #74692f;
  font-size: 10px;
  text-transform: uppercase;
}

.home-week-day i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(255, 255, 255, .8);
  border: 1px solid #dfcf78;
  border-radius: 50%;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.home-week-day.complete i {
  background: var(--success);
  border-color: var(--success);
}

.home-quick-actions {
  padding-top: 2px;
}

.home-quick-actions h3 {
  margin-bottom: 9px;
  font-size: 15px;
}

.home-quick-actions > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.home-quick-actions button {
  width: 100%;
  min-height: 42px;
  text-align: left;
}

.notice {
  margin-top: 20px;
  padding: 14px 19px 14px 12px;
  display: flex;
  gap: 15px;
  align-items: center;
  background: var(--yellow-soft);
  border: 1px solid #ead98b;
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
}

.notice p { margin: 5px 0 0; color: #675e37; line-height: 1.48; }

.master-switch, .check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 720;
}

.master-switch {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--mint);
  border: 1px solid #b5ddd4;
  border-radius: 8px;
}

input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.item-list { display: grid; gap: 11px; }

.item-row {
  padding: 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.item-row.selected-row {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 111, 145, .12), var(--soft-shadow);
}

.time-badge {
  min-width: 84px;
  padding: 12px 10px;
  color: var(--yellow);
  background: var(--navy);
  border-radius: 8px;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--aqua);
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(13, 104, 115, .18);
  font-size: 22px;
  font-weight: 920;
  line-height: 1;
  letter-spacing: 0;
}

.profile-avatar img,
.child-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.item-copy h3 { margin: 0 0 5px; font-size: 18px; }
.item-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.badge {
  padding: 3px 8px;
  color: #536977;
  background: #f9fcfd;
  border: 1px solid #b9c8d0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.badge.normal { color: #765e00; background: #fff7cf; border-color: #e2ca68; }
.badge.holiday { color: #12694d; background: #e1f7ed; border-color: #84cdb3; }
.badge.selected { color: #0d5874; background: #e2f4f9; border-color: #98ccd9; }
.badge.active { color: #12694d; background: #e1f7ed; border-color: #84cdb3; }
.badge.inactive { color: #934337; background: #fff0ed; border-color: #e9aaa1; }
.row-actions { display: flex; gap: 7px; align-items: center; }
.row-actions button { min-height: 40px; padding: 8px 12px; }
.text-editor { width: 100%; min-height: 80px; resize: vertical; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.widget-hub {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.widget-hub-card {
  position: relative;
  min-height: 128px;
  padding: 18px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.widget-hub-card.featured {
  grid-column: 1 / -1;
  min-height: 146px;
  background: #e9f8f4;
  border-color: #8bcdbd;
}

.widget-hub-card:hover { border-color: var(--aqua); transform: translateY(-1px); }

.widget-hub-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--yellow-soft);
  border-radius: 8px;
}

.widget-hub-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.widget-hub-copy strong,
.widget-hub-copy small { display: block; }
.widget-hub-copy strong { font-size: 20px; }
.widget-hub-copy small { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.4; }

.widget-hub-state {
  padding: 6px 9px;
  color: #7d4a42;
  background: var(--coral-soft);
  border: 1px solid #efbeb6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.widget-hub-state.enabled {
  color: #12694d;
  background: var(--mint);
  border-color: #8bcdbd;
}

.widget-notification {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  border: 2px solid var(--white);
  border-radius: 50%;
  font-size: 12px;
}

.suggested-phrases {
  margin-bottom: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #edf8f6;
  border: 1px solid #b8ddd4;
  border-radius: 8px;
}

.suggested-phrases strong,
.suggested-phrases span { display: block; }
.suggested-phrases span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.suggestion-chip {
  max-width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--blue-dark);
  background: var(--white);
  border: 1px solid #a8d4c9;
  text-align: left;
  line-height: 1.35;
}

.image-drop-zone {
  min-height: 168px;
  margin-bottom: 10px;
  padding: 22px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  background: #edf8f6;
  border: 2px dashed #7cc7b5;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.image-drop-zone.is-dragging {
  background: var(--yellow-soft);
  border-color: #d5aa25;
}

.image-drop-zone.is-busy { cursor: wait; opacity: .7; }
.image-drop-zone strong, .image-drop-zone span { display: block; }
.image-drop-zone strong { font-size: 19px; }
.image-drop-zone span { max-width: 680px; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.drop-zone-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--aqua);
  border-radius: 50%;
  font-size: 37px;
  font-weight: 400;
}

.upload-status { margin: 0 0 19px; color: var(--muted); font-size: 13px; }
.upload-status.error { color: #a43f32; font-weight: 760; }

.image-item {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.image-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  display: block;
  background: #e7eef1;
}

.image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #edf4f6;
  text-align: center;
  font-weight: 800;
}

.image-controls { display: grid; gap: 10px; padding: 14px; }
.image-controls input[type="text"] { width: 100%; }
.file-button { display: inline-flex; align-items: center; justify-content: center; }
.file-button input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }

.sticky-actions {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  pointer-events: none;
}

.sticky-actions button { pointer-events: auto; box-shadow: var(--shadow); }

.settings-band {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.settings-band h3 { margin: 0 0 5px; font-size: 21px; }
.settings-band > p { margin: 0 0 17px; color: var(--muted); }

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.option {
  min-height: 78px;
  padding: 13px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.screen-designer {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 16px;
  align-items: stretch;
}

.nara-preview-shell,
.layout-presets {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.nara-screen-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 12px;
  display: grid;
  grid-template-columns: .82fr 2.18fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--white);
  background: #0d6873;
  border-radius: 6px;
  overflow: hidden;
}

.nara-screen-preview.layout-clock_focus { grid-template-columns: .64fr 2.36fr; }
.nara-screen-preview.layout-photo_focus { grid-template-columns: 1.18fr 1.82fr; }
.nara-screen-preview.without-photo { grid-template-columns: 1fr; }

.preview-photo {
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  color: #56737d;
  background: linear-gradient(145deg, #e7f5f1 0 48%, #f6c84c 48% 52%, #cee9e2 52%);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 5px;
  font-weight: 850;
}

.preview-clock-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview-nara-bar {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.preview-nara-bar img { width: 42px; height: 45px; object-fit: contain; }
.preview-nara-bar span {
  min-width: 0;
  flex: 1;
  padding: 7px 9px;
  overflow: hidden;
  color: var(--ink);
  background: var(--yellow-soft);
  border-radius: 5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 850;
}
.preview-nara-bar b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--white);
  border-radius: 50%;
  font-size: 10px;
}
.preview-time { font-size: clamp(38px, 6vw, 78px); line-height: .95; }
.preview-date { margin-top: 4px; font-size: clamp(10px, 1.6vw, 20px); font-weight: 800; }
.preview-clock-column p {
  max-width: 90%;
  margin: 5px 0 0;
  overflow: hidden;
  color: #ffeb3b;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(9px, 1.3vw, 16px);
  font-weight: 850;
}
.preview-widgets {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.preview-widgets span {
  min-height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
}
.layout-presets h3 { margin: 0 0 5px; }
.layout-presets > p { margin: 0 0 15px; color: var(--muted); line-height: 1.45; }
.layout-presets .option-grid { grid-template-columns: 1fr; }

.maintenance-band { margin-top: 28px; border-left: 5px solid var(--coral); }

.option:has(input:checked) { background: #eff9f7; border-color: #8bcfc3; }
.option strong { display: block; }
.option small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.35; }

.activity-bank { display: grid; gap: 12px; }

.activity-item {
  min-height: 132px;
  padding: 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.activity-symbol {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 6px solid #dff5f0;
  border-radius: 50%;
  font-size: 31px;
  font-weight: 900;
}

.activity-copy span {
  color: var(--aqua);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}
.activity-copy h3 { margin: 4px 0 5px; font-size: 20px; }
.activity-copy p { margin: 0; color: var(--muted); line-height: 1.45; }
.activity-routines { display: grid; gap: 8px; }
.activity-routines label {
  min-height: 44px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5faf9;
  border: 1px solid #cfe2df;
  border-radius: 8px;
}

.child-professionals {
  max-width: 520px;
  margin-top: 10px;
}
.child-professionals select { min-height: 72px; }
.optional-label { color: var(--muted); font-size: 12px; font-weight: 650; }

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
input[type="number"],
select,
textarea,
label > input:not([type]) {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

input:hover, select:hover, textarea:hover { border-color: #7697a7; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { line-height: 1.45; }

dialog:not([open]) { display: none; }

dialog {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  background: var(--white);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

dialog::backdrop { background: rgba(10, 28, 41, .7); backdrop-filter: blur(3px); }
dialog form { max-height: calc(100vh - 28px); padding: 24px; display: grid; gap: 16px; overflow-y: auto; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }

.form-guidance {
  margin: -3px 0 0;
  padding: 11px 13px;
  color: var(--muted);
  background: #eef8fa;
  border-left: 4px solid var(--aqua);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.form-guidance code { color: var(--ink); font-weight: 800; }

.edit-child-identity {
  min-height: 72px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f2f8f6;
  border: 1px solid #c9ddd7;
  border-radius: 8px;
}

.edit-child-identity strong,
.edit-child-identity span {
  display: block;
}

.account-dialog { width: min(720px, calc(100% - 28px)); }
.account-identity {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #edf8f6;
  border: 1px solid #b8ddd4;
  border-radius: 8px;
}
.account-identity strong,
.account-identity span,
.account-identity small { display: block; }
.account-identity strong { font-size: 20px; }
.account-identity span { margin-top: 2px; color: var(--muted); }
.account-identity small { margin-top: 5px; color: var(--blue); font-weight: 850; }

.account-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.account-facts > div {
  padding: 14px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.account-facts span,
.account-facts strong { display: block; }
.account-facts span, .field-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.account-facts strong { margin-top: 4px; font-size: 17px; }
.field-label { display: block; margin-bottom: 8px; text-transform: uppercase; }
.account-children { display: grid; gap: 8px; }
.account-children button {
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  text-align: left;
}
.account-children button:hover { background: #f1f8fa; }
.mini-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--aqua);
  border-radius: 50%;
  font-size: 17px;
  font-weight: 920;
  line-height: 1;
}
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-children strong,
.account-children small { display: block; }
.account-children small { margin-top: 3px; color: var(--muted); }
.account-security {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--yellow-soft);
  border: 1px solid #ead98b;
  border-radius: 8px;
}
.account-security p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.edit-child-identity span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.access-toggle {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 11px;
  background: var(--yellow-soft);
  border: 1px solid #ead98b;
  border-radius: 8px;
}

.access-toggle input { flex: 0 0 auto; margin-top: 2px; }
.access-toggle span { display: block; }
.access-toggle strong,
.access-toggle small { display: block; }
.access-toggle small { margin-top: 4px; color: var(--muted); line-height: 1.4; }

fieldset { padding: 13px; border: 1px solid var(--line); border-radius: 6px; }
legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-choice { padding: 8px 3px; display: grid; justify-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 5px; }
.field-error { min-height: 18px; margin: 0; color: #a43f32; font-size: 13px; font-weight: 720; }

.login-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 22px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(13, 104, 115, .97), rgba(62, 180, 159, .9) 58%, rgba(246, 200, 76, .86)),
    var(--blue);
}

.login-layer.hidden { display: none; }

.login-panel {
  width: min(860px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(380px, 1.1fr);
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 8px;
  box-shadow: 0 28px 72px rgba(12, 40, 55, .28);
}

.login-illustration {
  min-height: 560px;
  padding: 28px 24px 25px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px),
    #ffd85a;
  background-size: 34px 34px;
}

.mascot-login {
  width: min(280px, 100%);
  height: 365px;
  margin-top: -7px;
}

.mascot-message {
  width: 100%;
  padding: 13px 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .86);
  border-left: 4px solid var(--coral);
  border-radius: 8px;
}

.mascot-message strong,
.mascot-message span { display: block; }
.mascot-message strong { font-size: 17px; }
.mascot-message span { margin-top: 3px; color: #536472; font-size: 13px; line-height: 1.4; }

.login-form-content {
  padding: 38px 42px 34px;
  display: flex;
  flex-direction: column;
}

.login-home-link {
  width: fit-content;
  min-height: 38px;
  margin: -8px 0 18px;
  padding: 7px 10px 7px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  background: #edf7fa;
  border: 1px solid #c8e2e9;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 820;
}

.login-home-link:hover { color: var(--ink); background: var(--yellow-soft); border-color: #e4ce6c; }
.login-home-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.login-form-content .brand { margin-bottom: 22px; }
.login-form-content .eyebrow { margin-bottom: 5px; }
.login-form-content h1 { margin: 0; font-size: 34px; line-height: 1.08; }
.login-intro { margin: 9px 0 25px; color: var(--muted); line-height: 1.5; }
.login-form-content > label { margin: 0 0 6px; }
.login-form-content > label:not(:first-of-type) { margin-top: 14px; }

.auth-field {
  position: relative;
  width: 100%;
  height: 54px;
}

.auth-field input {
  width: 100%;
  height: 54px;
  min-height: 54px;
  display: block;
}

.auth-field.has-action input { padding-right: 58px; }

.password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #edf7fa;
  border: 1px solid #c1dce5;
}

.password-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-slash { opacity: 1; }
.password-toggle.is-visible { color: var(--ink); background: var(--yellow); border-color: #d8b938; }
.password-toggle.is-visible .eye-slash { opacity: 0; }
.login-form-content .field-error { margin-top: 7px; }
.auth-submit { margin-top: 3px; }

.login-divider {
  height: 35px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #26394b;
  background: var(--white);
  border: 1px solid #c5d3da;
  box-shadow: 0 3px 10px rgba(25, 50, 71, .06);
}

.google-button:hover { background: #f8fbfc; border-color: #91aab6; }
.google-button svg { width: 23px; height: 23px; flex: 0 0 auto; }

.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 9px;
  vertical-align: -3px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: 430px;
  padding: 13px 17px;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  transition: transform .2s ease;
}

.toast.visible { transform: translateY(0); }
.toast.error { background: #963b30; }

.empty {
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border: 1px dashed #a8bbc5;
  border-radius: 8px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-workspace {
  display: grid;
  gap: 12px;
}

.chat-contacts {
  overflow: hidden;
  background: var(--white);
  border: 1px solid #bfd5ce;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.chat-contacts-heading {
  min-height: 62px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  background: var(--navy);
}

.chat-contacts-heading strong,
.chat-contacts-heading span {
  display: block;
}

.chat-contacts-heading span {
  margin-top: 2px;
  color: #c7dce5;
  font-size: 12px;
}

.chat-contact-list {
  max-height: 248px;
  overflow-y: auto;
}

.chat-contact {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-align: left;
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.chat-contact:last-child { border-bottom: 0; }
.chat-contact:hover { background: #f1f8f5; }
.chat-contact.active {
  background: var(--mint);
  box-shadow: inset 4px 0 var(--aqua);
}

.chat-contact .profile-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.chat-contact-copy {
  min-width: 0;
}

.chat-contact-copy strong,
.chat-contact-copy span {
  display: block;
}

.chat-contact-copy strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact-meta {
  min-width: 38px;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
}

.chat-contact-meta time {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.chat-contact-meta b {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 11px;
  background: var(--coral);
  border-radius: 999px;
}

.chat-layout {
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(340px, 1fr) auto;
  overflow: hidden;
  background: #eef6f2;
  border: 1px solid #bfd5ce;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.chat-header {
  min-height: 70px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  background: var(--navy);
}

.chat-header .profile-avatar {
  width: 46px;
  height: 46px;
  margin-top: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  font-size: 19px;
}

.chat-header strong,
.chat-header span {
  display: block;
}

.chat-header span {
  margin-top: 3px;
  color: #c7dce5;
  font-size: 12px;
}

.chat-messages {
  min-height: 360px;
  max-height: 60vh;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(21, 53, 74, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 53, 74, .025) 1px, transparent 1px),
    #f4f8f5;
  background-size: 32px 32px;
}

.chat-bubble {
  max-width: min(86%, 620px);
  padding: 10px 12px 7px;
  align-self: flex-start;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #d4e1dd;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(25, 50, 71, .08);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: var(--mint);
  border-color: #a8d8c9;
}

.chat-bubble.alert {
  background: var(--coral-soft);
  border-color: #eca89f;
  border-left: 5px solid var(--coral);
}

.chat-bubble p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-bubble footer {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.message-type {
  display: block;
  margin-bottom: 4px;
  color: #9d3e32;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
}

.message-ticks {
  color: #738a97;
  font-size: 13px;
  font-weight: 900;
}

.message-ticks.read { color: #1488b0; }

.chat-composer {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
}

.chat-send {
  min-width: 92px;
  height: 50px;
}

.chat-empty {
  margin: auto;
  max-width: 330px;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.chat-empty img {
  width: 110px;
  height: 120px;
  object-fit: contain;
}

.chat-empty strong { color: var(--ink); font-size: 18px; }

.challenge-summary {
  margin-bottom: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--yellow-soft);
  border: 1px solid #ead98b;
  border-radius: 8px;
}

.challenge-streak {
  min-height: 72px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
  border-left: 5px solid var(--coral);
  border-radius: 8px;
}

.challenge-streak span { color: var(--muted); font-size: 12px; font-weight: 760; }
.challenge-streak strong { margin-top: 3px; font-size: 23px; }

.calendar-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-toolbar h3 {
  margin: 0;
  text-transform: capitalize;
  text-align: center;
  font-size: 21px;
}

.calendar-weekdays,
.challenge-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 850;
}

.challenge-calendar {
  padding: 7px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.calendar-day {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 2px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.calendar-day:hover:not(:disabled) { background: #edf8f5; border-color: var(--aqua); }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--blue); }
.calendar-day.completed { color: var(--white); background: var(--success); border-color: var(--success); }
.calendar-day:disabled { cursor: default; opacity: .45; }
.calendar-day.spacer { border-color: transparent; background: transparent; }

.calendar-day strong {
  position: absolute;
  right: 3px;
  top: 1px;
  font-size: 10px;
}

.danger-callout {
  padding: 13px 15px;
  color: #7d3027;
  background: var(--coral-soft);
  border-left: 5px solid var(--coral);
  border-radius: 8px;
}

.danger-callout p { margin: 5px 0 0; line-height: 1.45; }

.onboarding-dialog { width: min(760px, calc(100% - 20px)); }
.onboarding-dialog form { padding: 0; gap: 0; }

.onboarding-header {
  min-height: 150px;
  padding: 18px 20px 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--yellow-soft);
  border-bottom: 1px solid #ead98b;
}

.onboarding-header img {
  width: 105px;
  height: 115px;
  flex: 0 0 auto;
  object-fit: contain;
}

.onboarding-header h2 { margin: 0; font-size: 25px; }
.onboarding-header p:last-child { margin: 5px 0 0; color: var(--muted); line-height: 1.4; }

.onboarding-progress {
  height: 7px;
  background: #e2edf0;
}

.onboarding-progress span {
  width: 20%;
  height: 100%;
  display: block;
  background: var(--aqua);
  transition: width .2s ease;
}

#onboardingSteps { padding: 24px 20px 12px; }
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.onboarding-step h3 { margin: 7px 0; font-size: 22px; line-height: 1.25; }
.onboarding-step p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.onboarding-step textarea { min-height: 150px; resize: vertical; }

.reflection-word {
  color: var(--success);
  font-size: 14px;
  font-weight: 900;
}

.onboarding-dialog .field-error { margin: 0 20px; }
.onboarding-actions { padding: 13px 20px 20px; }

.hidden { display: none !important; }

@media (min-width: 760px) {
  .chat-workspace {
    grid-template-columns: minmax(245px, 310px) minmax(0, 1fr);
    align-items: stretch;
  }
  .chat-contacts { min-height: 560px; }
  .chat-contact-list { max-height: 560px; }
  .chat-messages { padding: 22px 7%; }
  .chat-bubble { max-width: min(72%, 620px); }
  .challenge-summary {
    grid-template-columns: minmax(260px, 1fr) 190px auto;
    align-items: end;
  }
  .calendar-weekdays,
  .challenge-calendar { gap: 7px; }
  .calendar-day { font-size: 16px; }
  .calendar-day strong { right: 6px; top: 4px; font-size: 13px; }
}

@media (max-width: 920px) {
  .metric-grid, .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-dashboard { grid-template-columns: 1fr; }
  .home-insights {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
    align-items: start;
  }
  .home-insights-heading { grid-column: 1 / -1; }
  .home-quick-actions { grid-column: 1 / -1; }
  .home-quick-actions > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-item { grid-template-columns: auto minmax(0, 1fr); }
  .activity-routines { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .item-row { grid-template-columns: auto minmax(0, 1fr); }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .child-context { grid-template-columns: auto 1fr auto; }
  .child-context-account { display: none; }
  .screen-designer { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .login-layer { padding: 13px; overflow-y: auto; place-items: start center; }
  .login-panel { min-height: auto; grid-template-columns: 1fr; }
  .login-illustration { min-height: 178px; padding: 12px 20px 15px; flex-direction: row; justify-content: center; gap: 12px; }
  .mascot-login { width: 126px; height: 156px; margin: 0; }
  .mascot-message { max-width: 220px; }
  .login-form-content { padding: 27px 24px 25px; }
  .login-form-content .brand { margin-bottom: 20px; }
}

@media (max-width: 620px) {
  .topbar { min-height: 72px; padding: 9px 15px; }
  .mascot-topbar { width: 45px; height: 49px; }
  .brand.compact { font-size: 24px; }
  .topbar p, .role-chip, .connection span:last-child { display: none; }
  .user-menu .role-chip { display: block; }
  .topbar-actions { gap: 8px; }
  main { padding: 22px 14px 80px; }
  .section-heading { align-items: flex-end; }
  .section-heading h2 { font-size: 27px; }
  .home-heading { align-items: flex-start; }
  .home-heading .section-heading-actions { width: 100%; }
  .home-heading .section-heading-actions button { flex: 1; }
  .home-children { padding: 13px; }
  .home-children-heading p { max-width: 240px; }
  .home-insights { grid-template-columns: 1fr; }
  .home-insights-heading,
  .home-quick-actions { grid-column: auto; }
  .home-quick-actions > div { grid-template-columns: 1fr; }
  .home-chat .chat-layout { min-height: 500px; }
  .home-chat .chat-messages { max-height: 50vh; }
  .metric-grid, .image-grid, .option-grid, .form-grid.two { grid-template-columns: 1fr; }
  .widget-hub { grid-template-columns: 1fr; }
  .widget-hub-card.featured { grid-column: auto; }
  .widget-hub-card { grid-template-columns: 52px minmax(0, 1fr); }
  .widget-hub-state { grid-column: 2; justify-self: start; }
  .image-drop-zone { grid-template-columns: 54px minmax(0, 1fr); padding: 16px; }
  .image-drop-zone .file-button { grid-column: 1 / -1; width: 100%; }
  .drop-zone-icon { width: 54px; height: 54px; }
  .account-facts { grid-template-columns: 1fr; }
  .account-security { grid-template-columns: 1fr; }
  .section-heading-actions { width: 100%; justify-content: stretch; }
  .section-heading-actions button { flex: 1; }
  .nara-preview-shell { padding: 8px; }
  .activity-item { grid-template-columns: 1fr; }
  .activity-symbol { width: 58px; height: 58px; }
  .activity-routines { grid-column: auto; grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr; }
  .time-badge, .profile-avatar { justify-self: start; }
  .row-actions { grid-column: auto; justify-content: stretch; flex-wrap: wrap; }
  .row-actions button { flex: 1; }
  .day-grid { grid-template-columns: repeat(4, 1fr); }
  .child-context { grid-template-columns: auto 1fr; }
  .child-context .secondary { grid-column: 1 / -1; }
  .login-illustration { min-height: 132px; }
  .mascot-login { width: 100px; height: 126px; }
  .mascot-message span { display: none; }
  .chat-contacts-heading {
    min-height: 54px;
    padding: 8px 13px;
  }
  .chat-contact-list {
    max-height: none;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .chat-contact {
    min-width: 228px;
    min-height: 74px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    scroll-snap-align: start;
  }
  .chat-contact.active { box-shadow: inset 0 -4px var(--aqua); }
  .chat-layout {
    min-height: 490px;
    grid-template-rows: auto minmax(270px, 1fr) auto;
  }
  .chat-messages {
    min-height: 270px;
    max-height: 48vh;
  }
  .chat-composer { grid-template-columns: minmax(0, 1fr) auto; }
  .chat-send { width: auto; min-width: 78px; }
  .onboarding-header { align-items: flex-start; }
  .onboarding-header img { width: 82px; height: 95px; }
  .onboarding-header h2 { font-size: 22px; }
  .onboarding-actions { flex-wrap: wrap; }
  .onboarding-actions button { flex: 1; }
}

@media (max-width: 430px) {
  .home-stat-grid { grid-template-columns: 1fr; }
  .home-stat { min-height: 128px; }
}

/* Portal 2026: conversación primero, administración contextual. */
.header-icon-button { position: relative; width: 50px; height: 50px; padding: 0; display: grid; place-items: center; color: var(--blue-dark); background: #e8f5f5; border: 1px solid #b9d9dc; border-radius: 50%; box-shadow: var(--soft-shadow); }
.header-icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.header-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; color: #fff; background: var(--coral); border: 2px solid #fff; border-radius: 999px; font-size: 10px; }
.workspace-navigation { position: sticky; top: 0; min-height: calc(100vh - 82px); padding: 22px 14px; background: #fff; border-right: 1px solid var(--line); }
.workspace-navigation-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 24px; }
.workspace-navigation-heading span, .workspace-navigation-heading strong { display: block; }
.workspace-navigation-heading span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.workspace-navigation-heading strong { margin-top: 3px; font-size: 17px; }
.workspace-links { display: grid; gap: 6px; }
.workspace-links button { min-height: 48px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: transparent; text-align: left; }
.workspace-links button:hover { color: var(--ink); background: #edf7f6; }
.workspace-links button.active { color: var(--ink); background: var(--mint); box-shadow: inset 4px 0 var(--aqua); }
.nav-count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; color: #fff; background: var(--coral); border-radius: 999px; font-size: 11px; }
body.workspace-open .app-shell { max-width: 1600px; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
body.workspace-open main { min-width: 0; }
.messenger-shell { height: calc(100vh - 82px); min-height: 620px; display: grid; grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
#summary { margin: calc(-1 * clamp(24px, 4vw, 48px)); }
.conversation-sidebar { min-width: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.conversation-sidebar-heading { min-height: 90px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.conversation-sidebar-heading h2 { margin: 0; font-size: 24px; }
.conversation-tools { padding: 12px 14px 4px; display: flex; gap: 8px; }
.conversation-tools #enableNotifications { min-width: 0; flex: 1; }
.conversation-tools .icon-button { flex: 0 0 44px; }
.conversation-sidebar .home-notification-status { margin: 7px 15px 11px; line-height: 1.35; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-list .chat-contact { min-height: 82px; }
.conversation-list .chat-contact.active { background: #e9f7f2; box-shadow: inset 5px 0 var(--aqua); }
.home-chat .chat-layout { min-height: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.home-chat .chat-messages { max-height: none; }
.chat-back { display: none; color: #fff; border-color: rgba(255,255,255,.25); }
.chat-profile-button { width: 48px; height: 48px; padding: 0; flex: 0 0 auto; background: transparent; border-radius: 50%; }
.chat-profile-button .profile-avatar { width: 48px; height: 48px; }
.chat-heading-copy { min-width: 0; flex: 1; }
.chat-heading-copy strong, .chat-heading-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-actions-wrap { position: relative; margin-left: auto; }
.chat-menu-button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: #fff; background: transparent; border-radius: 50%; font-size: 29px; line-height: 1; }
.chat-menu-button:hover { background: rgba(255,255,255,.1); }
.child-actions-menu { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.child-actions-menu button { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: transparent; text-align: left; }
.child-actions-menu button:hover { background: #eef7f6; }
.chat-date-separator { align-self: center; margin: 8px 0; padding: 5px 11px; color: #526b75; background: #e5efec; border: 1px solid #d0dfda; border-radius: 999px; box-shadow: 0 1px 3px rgba(25,50,71,.08); font-size: 11px; font-weight: 800; }
.child-profile-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow-y: auto; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.profile-dialog-shell { padding: clamp(18px, 4vw, 30px); }
.profile-dialog-header { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 24px; }
.profile-dialog-header > .icon-button { align-self: start; }
.profile-dialog-header h2 { margin: 0; font-size: 30px; }
.profile-dialog-header span { color: var(--muted); font-size: 13px; }
.profile-avatar-large { width: 78px; height: 78px; padding: 0; color: var(--ink); background: var(--yellow); border: 4px solid #fff; box-shadow: 0 0 0 1px #dcc35c, var(--soft-shadow); font-size: 28px; }
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.child-profile-dialog .home-stat { min-height: 132px; }
.request-panel { margin-bottom: 20px; padding: 16px; background: var(--yellow-soft); border: 1px solid #ead98b; border-radius: 8px; }
.request-panel > div:first-child strong, .request-panel > div:first-child span { display: block; }
.request-panel > div:first-child span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.request-list { display: grid; gap: 8px; margin-top: 13px; }
.request-row { padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; border: 1px solid #ebdfa8; border-radius: 8px; }
.request-row strong, .request-row span { display: block; }
.request-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.request-row-actions { display: flex; gap: 7px; }
.request-intro { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; background: var(--mint); border-radius: 8px; }
.request-intro img { width: 72px; height: 78px; object-fit: contain; }
.request-intro p { margin: 0; color: var(--muted); line-height: 1.5; }
.embedded-management { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.compact-heading h2 { font-size: 28px; }
.family-calendar-shell { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--soft-shadow); }
.family-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.family-calendar-day { min-height: 105px; padding: 8px; overflow: hidden; background: #fbfdfd; border: 1px solid var(--line); border-radius: 6px; }
.family-calendar-day.today { border: 2px solid var(--aqua); background: #eefaf6; }
.family-calendar-day.spacer { background: transparent; border-style: dashed; opacity: .45; }
.family-calendar-day > b { display: block; margin-bottom: 6px; font-size: 13px; }
.calendar-event { margin-top: 4px; padding: 4px 5px; overflow: hidden; color: #174853; background: #dff3ed; border-radius: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 780; }
.calendar-event.holiday { color: #7a5600; background: var(--yellow-soft); }
.calendar-lists { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.calendar-lists > section { min-width: 0; }
.subsection-heading { margin-bottom: 10px; }
.subsection-heading h3 { margin: 0; }
.subsection-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.compact-list .item-row { grid-template-columns: auto minmax(0, 1fr); }
.compact-list .row-actions { grid-column: 1 / -1; justify-content: flex-end; }

@media (min-width: 901px) {
  body {
    min-height: 100vh;
    overflow-y: auto;
  }

  .topbar {
    position: sticky;
    z-index: 18;
    top: 0;
  }

  .app-shell {
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .app-shell > main {
    min-height: 0;
    overflow: visible;
  }

  body.workspace-open .workspace-navigation {
    position: sticky;
    top: 82px;
    height: calc(100vh - 82px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .messenger-shell {
    height: calc(100dvh - 82px);
    min-height: 0;
  }

  .home-chat {
    min-height: 0;
    overflow: hidden;
  }

  .home-chat .chat-layout {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .home-chat .chat-messages {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .home-chat .chat-composer {
    position: relative;
    z-index: 2;
  }
}

.conversation-list,
.chat-messages,
.workspace-navigation {
  scrollbar-color: #8db9b1 transparent;
  scrollbar-width: thin;
}

.conversation-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.workspace-navigation::-webkit-scrollbar {
  width: 9px;
}

.conversation-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.workspace-navigation::-webkit-scrollbar-thumb {
  background: #8db9b1;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

@media (max-width: 900px) {
  body.workspace-open .app-shell { display: block; }
  .workspace-navigation { position: static; min-height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-navigation-heading { margin-bottom: 8px; }
  .workspace-links { display: flex; gap: 6px; overflow-x: auto; }
  .workspace-links button { min-width: max-content; }
  .workspace-links button.active { box-shadow: inset 0 -4px var(--aqua); }
  .calendar-lists { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { min-height: 70px; padding: 8px 12px; }
  .mascot-topbar { width: 43px; height: 48px; }
  .brand.compact { font-size: 23px; }
  .header-icon-button, .user-avatar-button { width: 44px; height: 44px; }
  main { padding: 0; }
  #summary { margin: 0; }
  .messenger-shell { height: calc(100dvh - 70px); min-height: 520px; display: block; border: 0; }
  .conversation-sidebar { height: 100%; border-right: 0; }
  .home-chat { display: none; height: 100%; }
  body.mobile-chat-open .conversation-sidebar { display: none; }
  body.mobile-chat-open .home-chat { display: block; }
  .chat-back { display: grid; }
  .chat-header { min-height: 66px; padding: 8px; }
  .chat-header .profile-avatar { width: 43px; height: 43px; }
  .chat-heading-copy span { max-width: 44vw; }
  .chat-messages { min-height: 0; padding: 14px 9px; }
  .conversation-sidebar-heading { min-height: 80px; }
  body.workspace-open main { padding: 20px 14px 36px; }
  .family-calendar { gap: 3px; }
  .family-calendar-day { min-height: 76px; padding: 5px; }
  .calendar-event { font-size: 8px; }
  .profile-dialog-header { grid-template-columns: auto 1fr; }
  .profile-dialog-header > .icon-button { grid-column: 1 / -1; }
  .profile-avatar-large { width: 64px; height: 64px; }
  .home-stat-grid { grid-template-columns: 1fr 1fr; }
  .request-row { grid-template-columns: 1fr; }
}
