:root {
  --ink: #153342;
  --muted: #607886;
  --navy: #0d4f67;
  --navy-deep: #08394c;
  --teal: #168a8a;
  --mint: #dff3ed;
  --aqua: #e7f7f8;
  --sky: #f2f7f8;
  --paper: #ffffff;
  --line: #d8e5e8;
  --yellow: #f4b942;
  --danger: #b44444;
  --shadow: 0 22px 70px rgba(20, 62, 78, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--sky);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(117, 211, 197, 0.22), transparent 26rem),
    radial-gradient(circle at 96% 2%, rgba(244, 185, 66, 0.14), transparent 24rem),
    var(--sky);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
}

button,
input,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right))
    14px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(13, 79, 103, 0.08);
  background: rgba(242, 247, 248, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.2;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 14px 34px rgba(13, 79, 103, 0.22);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

body.modal-open {
  overflow: hidden;
}

.install-guide {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.install-guide-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 39, 51, 0.66);
  backdrop-filter: blur(5px);
}

.install-guide-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  padding: clamp(24px, 5vw, 38px);
  overflow-y: auto;
  border: 1px solid rgba(13, 79, 103, 0.14);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(8, 39, 51, 0.28);
}

.install-guide-card h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.install-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.install-guide-steps {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.install-guide-steps li {
  position: relative;
  min-height: 44px;
  padding: 10px 12px 10px 52px;
  border-radius: 14px;
  background: var(--aqua);
  counter-increment: install-step;
}

.install-guide-steps li::before {
  position: absolute;
  top: 10px;
  left: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  content: counter(install-step);
  font-size: 13px;
  font-weight: 800;
}

.install-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.status-pill {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.online {
  border-color: rgba(22, 138, 138, 0.28);
  color: var(--teal);
  background: var(--mint);
}

.status-pill.offline {
  border-color: rgba(180, 68, 68, 0.25);
  color: var(--danger);
  background: #fff1f1;
}

.app-shell,
.child-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 max(60px, env(safe-area-inset-bottom));
}

.landing {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(44px, 9vw, 110px) 0 70px;
}

.landing-hero {
  max-width: 780px;
}

.landing h1,
.auth-layout h1,
.dashboard-heading h1,
.child-hero h1,
.pair-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.auth-layout h1,
.dashboard-heading h1,
.child-hero h1,
.pair-card h1 {
  font-size: clamp(32px, 5vw, 52px);
}

.landing .lede {
  max-width: 670px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.5vw, 22px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 46px;
}

.platform-card {
  position: relative;
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(13, 79, 103, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.platform-card::after {
  position: absolute;
  width: 240px;
  height: 240px;
  right: -110px;
  bottom: -130px;
  border-radius: 50%;
  background: rgba(22, 138, 138, 0.08);
  content: "";
}

.android-card {
  border-top: 5px solid var(--navy);
}

.web-card {
  border-top: 5px solid var(--yellow);
}

.platform-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.platform-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

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

.platform-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--navy);
  font-size: 24px;
  font-weight: 850;
}

.web-card .platform-icon {
  color: var(--ink);
  background: var(--yellow);
}

.platform-card > p {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--muted);
}

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

.build-facts div {
  padding: 12px;
  border-radius: 14px;
  background: var(--aqua);
}

.build-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.build-facts dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 750;
}

.download-button {
  width: 100%;
  margin-top: auto;
}

.platform-text-link {
  position: relative;
  z-index: 1;
  align-self: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
}

.platform-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.platform-hint {
  position: relative;
  z-index: 1;
  padding-top: 14px;
  font-size: 12px;
}

.feature-card h3 {
  margin: 10px 0 0;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 10px 28px rgba(13, 79, 103, 0.2);
}

.button.primary:hover {
  background: var(--navy-deep);
}

.button.secondary {
  border-color: var(--line);
  color: var(--navy);
  background: rgba(255, 255, 255, 0.74);
}

.button.compact {
  min-height: 42px;
  padding: 8px 15px;
  border-radius: 12px;
  font-size: 14px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.text-button {
  padding: 7px;
  border: 0;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.text-button.danger {
  color: var(--danger);
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 750;
  text-underline-offset: 3px;
}

.privacy-note {
  max-width: 660px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(70px, 12vw, 150px);
}

.feature-card,
.panel,
.auth-card,
.pair-card,
.guided-card,
.focus-banner {
  border: 1px solid rgba(13, 79, 103, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.feature-card {
  padding: 28px;
}

.feature-number {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.feature-card h2,
.panel h2,
.guided-card h2,
.frame-help h2 {
  margin: 18px 0 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.feature-card p,
.panel p,
.guided-card p,
.frame-help p {
  margin: 0;
  color: var(--muted);
}

.auth-layout {
  display: grid;
  min-height: calc(100vh - 190px);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: clamp(32px, 7vw, 90px);
}

.intro-panel {
  max-width: 650px;
}

.intro-panel > p:not(.eyebrow) {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding-left: 26px;
}

.plain-list li::before {
  position: absolute;
  top: 0.7em;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.auth-card {
  padding: 22px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 15px;
  background: var(--aqua);
}

.segment {
  padding: 10px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.segment.active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 5px 16px rgba(13, 79, 103, 0.1);
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input {
  min-height: 52px;
  padding: 11px 14px;
}

select {
  min-height: 52px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 98px;
  padding: 13px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(22, 138, 138, 0.12);
}

.form-message {
  min-height: 22px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.dashboard-heading,
.panel-heading,
.child-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-heading {
  margin-bottom: 28px;
}

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

.span-two {
  grid-column: span 2;
}

.panel {
  padding: 25px;
}

.panel-heading {
  align-items: center;
}

.panel-heading h2 {
  margin: 0;
}

.inline-form,
.connector-form {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 22px 0;
}

.inline-form label {
  flex: 1;
}

.connector-form {
  display: grid;
  grid-template-columns: 1fr 1.45fr auto;
}

.connector-form .wide {
  grid-column: 1 / 3;
}

.advanced-options {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--aqua);
}

.advanced-options summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

.advanced-options p {
  margin: 12px 0;
  font-size: 13px;
}

.card-list,
.service-grid {
  display: grid;
  gap: 12px;
}

.device-card,
.connector-card,
.service-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.device-card {
  display: grid;
  gap: 12px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 18px;
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 13px;
}

.device-online {
  color: var(--teal);
  font-weight: 750;
}

.device-offline {
  color: var(--muted);
  font-weight: 750;
}

.assign-row {
  display: flex;
  gap: 10px;
}

.assign-row select {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.discovery-retry {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cfe0ea;
  border-radius: 16px;
  background: #f7fbfd;
}

.discovery-retry label {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.discovery-retry input {
  margin-top: 8px;
}

.connector-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.connector-card h3 {
  margin: 0 0 4px;
}

.connector-card p {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.connector-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.connector-delete {
  color: #a43b32;
  border-color: #e6c8c3;
  background: #fff8f7;
}

.fallback-options {
  display: grid;
  gap: 12px;
}

.fallback-section {
  display: grid;
  gap: 12px;
}

.fallback-disclosure {
  margin-top: 12px;
}

.fallback-option-card {
  align-items: flex-start;
}

.fallback-option-card > div:first-child {
  min-width: 0;
  flex: 1;
}

.fallback-option-card .connector-actions {
  max-width: 360px;
}

.discovery-alternatives {
  padding: 14px 16px;
  border: 1px solid #cfe0ea;
  border-radius: 16px;
  background: #f7fbfd;
}

.discovery-alternatives summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 750;
}

.discovery-alternatives .connector-card {
  margin-top: 12px;
}

.family-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 14px;
  margin-top: 20px;
}

.family-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

.family-create-form > p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
}

.family-create-form > button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
}

.school-results {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
}

.school-option {
  display: grid;
  width: auto;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.school-option:hover,
.school-option:focus {
  border-color: var(--teal);
  background: var(--sky);
}

.school-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.school-selected {
  grid-column: 1 / -1;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--navy);
  background: var(--aqua);
  font-size: 13px;
  font-weight: 700;
}

.school-loading,
.school-empty {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--sky);
  font-size: 13px;
}

.school-empty {
  display: grid;
  gap: 8px;
}

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

.school-tools {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.school-tools .button {
  flex: 1 1 150px;
}

.lookup-status {
  min-height: 20px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.lookup-status.error {
  color: var(--danger);
}

.year-warning {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  padding: 15px;
  border: 1px solid rgba(211, 143, 31, 0.28);
  border-radius: 14px;
  background: #fff8e8;
}

.family-overview,
.family-code-box,
.family-members {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.family-overview {
  display: grid;
  gap: 8px;
}

.family-child {
  font-size: 20px;
  font-weight: 800;
}

.family-code-box {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: var(--aqua);
}

.family-code {
  margin: 4px 0;
  color: var(--navy);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 850;
  letter-spacing: 0.12em;
}

.family-members {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.class-history {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.class-history .eyebrow {
  width: 100%;
}

.family-member {
  padding: 14px;
  border-radius: 14px;
  background: var(--sky);
}

.family-member strong,
.family-member span {
  display: block;
}

.family-member span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100% - 36px));
  padding: 13px 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--navy-deep);
  box-shadow: 0 14px 38px rgba(8, 57, 76, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.child-page {
  background:
    radial-gradient(circle at 10% 4%, rgba(100, 207, 193, 0.22), transparent 22rem),
    linear-gradient(180deg, #f5fbfa, #eef6f7 68%);
}

.child-topbar {
  background: rgba(245, 251, 250, 0.88);
}

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

.pair-card {
  max-width: 560px;
  margin: 8vh auto 0;
  padding: clamp(26px, 6vw, 46px);
}

.pair-card > p:not(.eyebrow) {
  color: var(--muted);
}

.pair-card label {
  margin: 24px 0 12px;
}

.pair-card .button {
  width: 100%;
  margin-top: 12px;
}

.pair-code-wrap {
  margin-top: 24px;
  padding: 22px;
  border-radius: 20px;
  background: var(--aqua);
  text-align: center;
}

.pair-code-wrap span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pair-code-wrap strong {
  display: block;
  margin: 8px 0;
  color: var(--navy);
  font-size: clamp(34px, 10vw, 52px);
  letter-spacing: 0.13em;
}

.pair-code-wrap p {
  margin: 0;
  color: var(--teal);
}

.child-hero {
  align-items: center;
  margin: 10px 0 26px;
}

.round-button {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
}

.focus-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-color: rgba(244, 185, 66, 0.28);
  background: #fff8e9;
  box-shadow: none;
}

.focus-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow);
  font-size: 24px;
}

.focus-banner p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.learning-section {
  margin-top: 34px;
}

.service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.service-card {
  display: grid;
  min-height: 176px;
  align-content: space-between;
  gap: 20px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 34px rgba(20, 62, 78, 0.1);
}

.service-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: var(--navy);
  background: var(--mint);
  font-size: 20px;
  font-weight: 800;
}

.service-card h3 {
  margin: 12px 0 3px;
  font-size: 20px;
}

.service-card p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.service-card-fallback {
  cursor: default;
}

.fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fallback-actions .button {
  flex: 1;
  justify-content: center;
}

.guided-card {
  margin: 32px 0;
  padding: 26px;
  box-shadow: none;
}

.step-list {
  display: grid;
  gap: 10px;
  padding-left: 24px;
  color: var(--muted);
}

.service-page {
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.service-toolbar {
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.service-toolbar strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.service-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.frame-help {
  position: absolute;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(360px, calc(100% - 32px));
  padding: 18px;
  border: 1px solid rgba(13, 79, 103, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.frame-help h2 {
  margin-top: 0;
  font-size: 18px;
}

.frame-help p {
  font-size: 13px;
}

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

@media (max-width: 900px) {
  .platform-grid,
  .landing-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  .auth-card {
    max-width: 560px;
  }

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

  .connector-form .wide {
    grid-column: auto;
  }

  .family-summary {
    grid-template-columns: 1fr;
  }

  .family-create-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 66px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .status-pill {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell,
  .child-shell,
  .landing {
    width: min(100% - 24px, 1180px);
  }

  .app-shell,
  .landing {
    padding-top: 26px;
  }

  .landing h1 {
    font-size: 43px;
  }

  .landing-grid {
    margin-top: 60px;
  }

  .platform-grid {
    margin-top: 32px;
  }

  .platform-card {
    min-height: 360px;
  }

  .build-facts,
  .platform-actions {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .panel,
  .auth-card,
  .pair-card,
  .guided-card {
    border-radius: 20px;
  }

  .dashboard-heading,
  .child-hero {
    align-items: flex-start;
  }

  .heading-actions,
  .install-guide-actions {
    width: 100%;
  }

  .heading-actions .button,
  .install-guide-actions .button {
    flex: 1;
  }

  .inline-form,
  .assign-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .connector-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .discovery-retry {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-banner {
    align-items: flex-start;
  }

  .service-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .service-toolbar .button {
    min-height: 40px;
    padding: 7px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.wechat-import-card {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #cfe0ea;
  border-radius: 16px;
  background: #f2f8fb;
}

.wechat-import-card h3 {
  margin: 0 0 10px;
  color: #17324a;
}

.wechat-import-card .heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.homework-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.homework-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.homework-card h3 {
  margin: 0;
}

.homework-image {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f8fa;
}

.homework-score {
  color: var(--teal);
  font-size: 20px;
  font-weight: 800;
}

.homework-text {
  white-space: pre-wrap;
  line-height: 1.75;
}

.homework-feedback-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.parent-note {
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  background: var(--aqua);
}

.ai-tutor-card,
.homework-card {
  padding: 22px;
  border: 1px solid rgba(13, 79, 103, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.tutor-messages {
  display: grid;
  max-height: 420px;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f6fafc;
}

.tutor-message {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.55;
}

.tutor-message p {
  margin: 0;
}

.tutor-message ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.tutor-message.assistant {
  justify-self: start;
  background: #fff;
  box-shadow: 0 5px 18px rgba(13, 79, 103, 0.08);
}

.tutor-message.user {
  justify-self: end;
  color: #fff;
  background: var(--navy);
}

.tutor-form,
.homework-form {
  display: grid;
  gap: 14px;
}

.tutor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tutor-actions .button {
  flex: 1;
}

/* Apple-inspired visual refresh: quieter surfaces, fewer labels, more whitespace. */
:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --navy: #007aff;
  --navy-deep: #0062cc;
  --teal: #007aff;
  --mint: #eaf3ff;
  --aqua: #f2f2f7;
  --sky: #f5f5f7;
  --paper: #ffffff;
  --line: #d2d2d7;
  --yellow: #ff9f0a;
  --danger: #ff3b30;
  --shadow: none;
  --radius: 20px;
}

html,
body {
  background: #f5f5f7;
}

.child-page {
  background: #f5f5f7;
}

.child-topbar {
  background: rgba(245, 245, 247, 0.82);
}

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  line-height: 1.47;
}

a,
.text-button {
  color: #007aff;
}

.topbar {
  min-height: 56px;
  padding: max(10px, env(safe-area-inset-top)) 20px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  gap: 10px;
}

.brand strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand small {
  font-size: 11px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  color: #fff;
  background: #1d1d1f;
  box-shadow: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 12px;
}

.topbar-actions {
  gap: 10px;
}

.app-shell,
.child-shell {
  width: min(980px, calc(100% - 40px));
  padding: 32px 0 max(52px, env(safe-area-inset-bottom));
}

.child-shell {
  width: min(900px, calc(100% - 40px));
}

.landing {
  width: min(980px, calc(100% - 40px));
  padding: clamp(56px, 9vw, 96px) 0 60px;
}

.landing-hero {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.landing-hero .brand-mark {
  margin: 0 auto 28px;
}

.landing h1,
.auth-layout h1,
.dashboard-heading h1,
.child-hero h1,
.pair-card h1 {
  color: var(--ink);
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.auth-layout h1,
.dashboard-heading h1,
.child-hero h1,
.pair-card h1 {
  font-size: clamp(30px, 4.5vw, 42px);
}

.dashboard-heading h1 {
  font-size: clamp(28px, 4vw, 36px);
}

.landing .lede {
  max-width: 520px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2.5vw, 21px);
  line-height: 1.5;
}

.eyebrow {
  display: none;
}

.landing-actions {
  justify-content: center;
  margin-top: 28px;
}

.platform-grid {
  gap: 16px;
  margin-top: 48px;
}

.platform-card,
.feature-card,
.panel,
.auth-card,
.pair-card,
.guided-card,
.focus-banner,
.ai-tutor-card,
.homework-card {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

.platform-card {
  min-height: 230px;
  padding: 28px;
}

.platform-card::after,
.android-card,
.web-card {
  border-top: 0;
}

.platform-card::after {
  display: none;
}

.platform-heading {
  gap: 13px;
}

.platform-heading h2 {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #007aff;
  background: #eaf3ff;
  font-size: 18px;
  font-weight: 700;
}

.web-card .platform-icon {
  color: #007aff;
  background: #eaf3ff;
}

.platform-card > p {
  margin: 20px 0 24px;
  color: var(--muted);
}

.button {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background-color 150ms ease, opacity 150ms ease;
}

.button:hover {
  transform: none;
}

.button.primary {
  color: #fff;
  background: #007aff;
  box-shadow: none;
}

.button.primary:hover {
  background: #006fe6;
}

.button.secondary {
  color: #1d1d1f;
  border-color: transparent;
  background: #e9e9ed;
}

.button.compact {
  min-height: 38px;
  padding: 8px 13px;
}

.text-button {
  padding: 6px 0;
  font-weight: 500;
}

.auth-layout {
  width: 100%;
  max-width: 620px;
  min-height: auto;
  margin: 0 auto;
  grid-template-columns: 1fr;
  gap: 26px;
  min-width: 0;
}

.intro-panel {
  max-width: none;
  text-align: center;
}

.intro-panel > p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
}

.auth-card {
  width: 100%;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
}

.segmented {
  width: 100%;
  min-width: 0;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: #e9e9ed;
}

.segment {
  min-width: 0;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 550;
}

.segment.active {
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.stack {
  min-width: 0;
  gap: 14px;
  margin-top: 20px;
}

label {
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

input,
select,
textarea {
  border-color: transparent;
  border-radius: 12px;
  color: var(--ink);
  background: #f2f2f7;
}

input,
select {
  min-height: 50px;
  padding: 11px 14px;
}

textarea {
  padding: 13px 14px;
}

input[type="file"] {
  padding: 7px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 9px 13px;
  border: 0;
  border-radius: 9px;
  color: #007aff;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #007aff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.dashboard-heading {
  align-items: center;
  margin-bottom: 20px;
}

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

.span-two {
  grid-column: span 2;
}

.panel {
  padding: 22px;
}

.panel-heading h2,
.guided-card h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.inline-form {
  align-items: end;
  margin: 18px 0;
}

.wechat-import-card,
.advanced-options,
.tutor-messages,
.homework-card,
.family-member,
.class-history {
  border-color: transparent;
  border-radius: 16px;
  background: #f5f5f7;
}

.wechat-import-card {
  margin: 14px 0;
  padding: 18px;
}

.wechat-import-card h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
}

.advanced-options {
  padding: 14px 16px;
}

.advanced-options summary,
.guided-card > summary {
  font-weight: 600;
}

.status-pill {
  padding: 5px 9px;
  border: 0;
  color: var(--muted);
  background: #e9e9ed;
  font-size: 11px;
  font-weight: 500;
}

.status-pill.online {
  color: #167a39;
  background: #e8f6ec;
}

.status-pill.offline {
  color: #b42318;
  background: #fff0ef;
}

.pair-card {
  max-width: 520px;
  margin: 40px auto 0;
  padding: 30px;
}

.pair-card > p:not(.eyebrow) {
  margin-top: 10px;
}

.pair-code-wrap {
  border-radius: 16px;
  background: #f5f5f7;
}

.pair-code-wrap strong {
  color: var(--ink);
}

.child-hero {
  margin: 4px 0 24px;
}

.round-button {
  width: 42px;
  height: 42px;
  border-color: transparent;
  color: #007aff;
  background: #e9e9ed;
  font-size: 20px;
}

.learning-section {
  margin-top: 28px;
}

.service-grid {
  gap: 14px;
  margin-top: 14px;
}

.service-card {
  min-height: 132px;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background: #fff;
}

.service-card:hover {
  transform: none;
  box-shadow: none;
}

.service-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #007aff;
  background: #eaf3ff;
  font-size: 17px;
}

.service-card h3 {
  margin-top: 9px;
  font-size: 18px;
  font-weight: 650;
}

.service-card p {
  color: var(--muted);
}

.ai-tutor-card,
.homework-card {
  padding: 22px;
}

.tutor-messages {
  max-height: 380px;
  margin: 16px 0;
  padding: 14px;
}

.tutor-message {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
}

.tutor-message.assistant {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
}

.tutor-message.user {
  background: #007aff;
}

.homework-list {
  gap: 12px;
  margin-top: 16px;
}

.homework-card {
  padding: 16px;
}

.homework-image {
  border-color: transparent;
  border-radius: 12px;
  background: #f2f2f7;
}

.homework-score {
  color: #007aff;
}

.parent-note {
  border-left-color: #007aff;
  background: #eaf3ff;
}

.guided-card {
  margin: 28px 0;
  padding: 0;
  overflow: hidden;
}

.guided-card > summary {
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.guided-card > summary::-webkit-details-marker {
  display: none;
}

.guided-card > summary::after {
  float: right;
  color: #8e8e93;
  content: "›";
  transition: transform 150ms ease;
}

.guided-card[open] > summary::after {
  transform: rotate(90deg);
}

.guided-card[open] {
  padding-bottom: 18px;
}

.guided-card > ol,
.guided-card > p {
  margin-right: 20px;
  margin-left: 20px;
}

.focus-banner {
  border-color: rgba(255, 159, 10, 0.2);
  background: #fff8eb;
}

.focus-icon {
  color: #fff;
  background: #ff9f0a;
}

.empty-state {
  border: 1px dashed #d2d2d7;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.28);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .app-shell,
  .child-shell,
  .landing {
    width: min(100% - 24px, 980px);
  }

  .app-shell,
  .landing {
    padding-top: 24px;
  }

  .landing h1 {
    font-size: 40px;
  }

  .landing-actions,
  .platform-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-actions .button,
  .platform-actions .button {
    width: 100%;
  }

  .platform-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .platform-card {
    min-height: auto;
    padding: 22px;
  }

  .dashboard-heading,
  .child-hero,
  .panel-heading {
    align-items: flex-start;
  }

  .dashboard-heading {
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

  .panel,
  .auth-card,
  .pair-card,
  .ai-tutor-card,
  .homework-card {
    padding: 18px;
    border-radius: 18px;
  }

  .pair-card {
    margin-top: 20px;
  }

  .inline-form,
  .connector-form {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

/* r79: focused secondary pages and a Doubao-style growing AI composer. */
.child-page.secondary-view-open .child-shell,
.parent-page.secondary-view-open .app-shell {
  padding-top: max(14px, env(safe-area-inset-top));
}

.child-page.secondary-view-open .child-view.compact-panel,
.parent-page.secondary-view-open .compact-panel {
  margin-top: 0;
}

.child-page.secondary-view-open .ai-query-card {
  min-height: calc(var(--visual-viewport-height, 100dvh) - 24px);
}

.child-page.secondary-view-open .ai-chat-thread {
  min-height: 220px;
  max-height: max(220px, calc(var(--visual-viewport-height, 100dvh) - 330px));
  padding-bottom: 12px;
}

.ai-query-form {
  bottom: max(10px, env(safe-area-inset-bottom));
  gap: 7px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 38px rgba(26, 57, 50, 0.12);
}

.ai-query-form textarea {
  min-height: 58px;
  max-height: 184px;
  padding: 11px 12px 4px;
  color: #24352f;
  font-size: 16px !important;
  font-weight: 500;
  line-height: 1.55;
  overflow-y: hidden;
}

.ai-query-form textarea::placeholder {
  color: #8a9490;
}

.ai-query-composer-actions {
  min-height: 42px;
  padding-top: 2px;
}

.child-page .ai-query-form textarea {
  font-size: 17px !important;
}

@media (max-width: 760px) {
  .child-page.secondary-view-open .ai-chat-thread {
    max-height: max(220px, calc(var(--visual-viewport-height, 100dvh) - 340px));
  }
}

.child-home-tool-grid {
  margin-top: 12px;
}

.learning-tool-card {
  position: relative;
}

.tool-yellow > span {
  color: #9b6300;
  background: #fff3d7;
}

.tool-green > span {
  color: #167a39;
  background: #e8f6ec;
}

.tool-pink > span {
  color: #b4235a;
  background: #ffe9f0;
}

.tool-cyan > span {
  color: #006f86;
  background: #e4f8fb;
}

.learning-tool-card > .nav-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.summary-blue {
  background: #eaf3ff;
}

.daily-message-preview {
  padding: 13px 14px;
  border-radius: 16px;
  color: #6a4b00;
  background: #fff5d9;
  font-size: 13px;
}

.ai-query-form {
  display: grid;
  gap: 11px;
}

.ai-query-preview {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 15px;
  background: #f2f2f7;
}

.ai-query-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.ai-query-answer {
  margin-top: 14px;
  padding: 15px;
  border-radius: 18px;
  background: #f2f2f7;
}

.ai-query-answer > strong {
  display: block;
  margin-bottom: 7px;
}

.ai-query-answer p {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .child-bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* r64 learning-first information architecture */
.child-home-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
}

.child-home-header .profile-copy {
  min-width: 0;
  flex: 1;
}

.child-home-header h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.child-home-header p {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.child-view {
  animation: child-view-in 160ms ease both;
}

@keyframes child-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.learning-first-card,
.home-message-preview,
.home-action-row,
.learning-tool-card,
.learning-plan-card,
.child-view.compact-panel,
.child-guided-card {
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #fff;
}

.learning-first-card {
  padding: 18px;
  border-radius: 22px;
}

.learning-first-card .section-title-row {
  align-items: center;
}

.learning-first-card h2,
.child-view-heading h2,
.learning-plan-card h2,
.homework-history-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.child-kicker {
  display: block;
  margin-bottom: 3px;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.learning-first-card .service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.learning-first-card .service-card {
  min-height: 116px;
  padding: 15px;
  border-color: transparent;
  border-radius: 18px;
  background: #f5f5f7;
}

.learning-first-card .service-card h3 {
  margin-top: 9px;
  font-size: 16px;
}

.learning-first-card .service-card p {
  margin-top: 2px;
}

.home-message-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}

.home-message-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #007aff;
  background: #eaf3ff;
  font-size: 18px;
}

.home-message-preview > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.home-message-preview small {
  color: var(--muted);
  font-size: 11px;
}

.home-message-preview strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-message-preview i,
.home-action-row i {
  color: #8e8e93;
  font-size: 22px;
  font-style: normal;
}

.home-secondary-actions {
  margin-top: 12px;
}

.home-action-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 12px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.home-action-row > span {
  grid-row: 1 / 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #a14cff;
  background: #f4ebff;
}

.home-action-row strong {
  font-size: 15px;
}

.home-action-row small {
  color: var(--muted);
  font-size: 11px;
}

.home-action-row i {
  grid-row: 1 / 3;
  grid-column: 3;
}

.child-back-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin: 0 0 12px;
  padding: 5px 0;
  border: 0;
  color: #007aff;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.child-view-heading {
  margin-bottom: 16px;
}

.child-view-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.learning-tool-card {
  display: grid;
  min-height: 156px;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.learning-tool-card > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
}

.tool-blue > span {
  color: #006edb;
  background: #e6f2ff;
}

.tool-purple > span {
  color: #8d45df;
  background: #f2e9ff;
}

.learning-tool-card strong {
  font-size: 18px;
}

.learning-tool-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.learning-plan-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
}

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

.homework-intro {
  margin: 2px 0 14px;
  font-size: 12px;
}

.homework-history-heading {
  margin-top: 18px;
}

.nav-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: #ff3b30;
  font-size: 10px;
  font-style: normal;
}

.child-bottom-nav button {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  padding: 7px 5px 5px;
  border: 0;
  border-radius: 16px;
  color: #77777c;
  background: transparent;
  cursor: pointer;
}

.child-bottom-nav button.active {
  color: #1d1d1f;
  background: #e9e9ed;
}

.child-bottom-nav button > span {
  font-size: 17px;
  line-height: 1;
}

.child-bottom-nav button > small {
  margin-top: 3px;
  font-size: 10px;
}

.child-bottom-nav .nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 7px);
}

.family-message-list {
  display: grid;
  max-height: min(55vh, 520px);
  gap: 10px;
  margin: 14px 0;
  overflow-y: auto;
}

.family-message-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 17px;
}

.family-message-bubble.from-parent {
  justify-self: start;
  background: #f2f2f7;
}

.family-message-bubble.from-child {
  justify-self: end;
  color: #fff;
  background: #007aff;
}

.family-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 10px;
  opacity: 0.72;
}

.family-message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.family-message-image {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 8px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.family-message-form,
.child-profile-form {
  display: grid;
  gap: 12px;
}

.profile-detail-list {
  display: grid;
  gap: 1px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 16px;
  background: #e9e9ed;
}

.profile-detail-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
}

.profile-detail-row dt {
  color: var(--muted);
}

.profile-detail-row dd {
  margin: 0;
  font-weight: 600;
}

.child-guided-card {
  margin: 16px 0;
  box-shadow: none;
}

.parent-message-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f5f7;
}

.parent-message-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.parent-message-card {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #f7f7f8;
}

.parent-message-card.from-child {
  border-left: 3px solid #007aff;
}

.parent-message-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.parent-message-card p {
  margin: 0;
  white-space: pre-wrap;
}

.parent-message-card img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 760px) {
  .child-shell {
    width: min(100% - 24px, 900px);
    padding-top: 16px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .child-home-header {
    margin-bottom: 12px;
  }

  .learning-first-card {
    padding: 15px;
    border-radius: 21px;
  }

  .learning-first-card .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .learning-first-card .service-card {
    min-height: 108px;
    padding: 13px;
  }

  .learning-tool-grid {
    gap: 9px;
  }

  .learning-tool-card {
    min-height: 142px;
    padding: 15px;
  }

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

  .child-page .child-view.compact-panel,
  .child-page #tutor-section,
  .child-page #homework-section {
    margin-top: 0;
  }
}

/* r72: direct message input, scroll pickers, and conversation-style AI */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.message-input-with-voice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: stretch;
}

.message-input-with-voice textarea {
  min-width: 0;
}

.message-voice-button {
  width: 74px;
  border: 1px solid rgba(0, 122, 255, 0.16);
  border-radius: 14px;
  color: #006edb;
  background: #eaf4ff;
  font: inherit;
}

.message-voice-button span {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.message-voice-button small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
}

.message-voice-button.is-recording {
  color: #fff;
  background: #ff3b30;
  animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
  50% { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0.13); }
}

.homework-picker-block {
  display: grid;
  gap: 7px;
}

.homework-picker-label {
  color: #52525a;
  font-size: 12px;
  font-weight: 680;
}

.homework-choice-wheel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 2px 7px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.homework-choice-wheel::-webkit-scrollbar {
  display: none;
}

.homework-choice-wheel button {
  min-width: 82px;
  min-height: 44px;
  flex: 0 0 auto;
  scroll-snap-align: center;
  padding: 8px 15px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 15px;
  color: #686870;
  background: #f2f2f5;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
}

.homework-choice-wheel button.active {
  color: #fff;
  border-color: #171719;
  background: #171719;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16);
}

.homework-date-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.2fr);
  gap: 9px;
}

.homework-date-row input {
  min-width: 0;
}

.homework-batch-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #ededf0;
}

.homework-batch-switch button {
  border: 0;
  border-radius: 11px;
  color: #6e6e73;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
}

.homework-batch-switch button.active {
  color: #171719;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.ai-query-card {
  min-height: min(720px, calc(100dvh - 128px));
  padding-bottom: 12px !important;
}

.ai-query-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-query-heading h2 {
  margin-bottom: 0 !important;
}

.ai-query-clear {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  color: #55555c;
  background: #f2f2f4;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.ai-chat-thread {
  display: flex;
  min-height: 330px;
  max-height: min(54dvh, 590px);
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 8px 2px 18px;
  scroll-behavior: smooth;
}

.ai-chat-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  max-width: 92%;
}

.ai-chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-chat-message > div {
  padding: 11px 14px;
  border-radius: 18px 18px 18px 5px;
  background: #f1f1f4;
}

.ai-chat-message.user > div {
  color: #fff;
  border-radius: 18px 18px 5px 18px;
  background: #171719;
}

.ai-chat-message p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
}

.ai-chat-message img {
  display: block;
  width: min(100%, 270px);
  max-height: 220px;
  margin-top: 8px;
  object-fit: cover;
  border-radius: 12px;
}

.ai-chat-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #171719;
  font-size: 10px;
  font-weight: 800;
}

.ai-chat-message.user .ai-chat-avatar {
  color: #3b3b3f;
  background: #e7e7ea;
}

.ai-chat-message.typing > div::after {
  content: "•••";
  color: #8b8b91;
  letter-spacing: 2px;
}

.ai-query-form {
  position: sticky;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 22px;
  background: rgba(250, 250, 251, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
}

.ai-query-form textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 11px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.ai-query-composer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-query-attach,
.ai-query-language,
.ai-query-mic,
.ai-query-send {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #242426;
  background: #ededf0;
  font: inherit;
  font-size: 21px;
  font-weight: 650;
}

.ai-query-attach {
  cursor: pointer;
}

.ai-query-attach input {
  display: none;
}

.ai-query-language {
  width: auto;
  min-width: 54px;
  height: 36px;
  margin-left: auto;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.ai-query-language[data-language="en"] {
  color: #fff;
  background: #171719;
}

.ai-query-language:disabled {
  opacity: 0.55;
}

.ai-query-mic {
  margin-left: 0;
}

.ai-query-mic.is-recording {
  color: #fff;
  background: #ff3b30;
  animation: voice-pulse 1s ease-in-out infinite;
}

.ai-query-send {
  color: #fff;
  background: #171719;
  font-size: 24px;
}

.ai-query-form .ai-query-preview {
  width: 74px;
  height: 74px;
  border-radius: 13px;
}

.ai-query-card #ai-query-status:empty {
  display: none;
}

@media (max-width: 390px) {
  .message-input-with-voice {
    grid-template-columns: 1fr;
  }

  .message-voice-button {
    width: 100%;
    min-height: 40px;
  }

  .message-voice-button span,
  .message-voice-button small {
    display: inline;
    margin: 0 0 0 5px;
  }

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

  .ai-chat-message {
    max-width: 97%;
  }
}

@media (max-width: 390px) {
  .learning-first-card .service-grid {
    grid-template-columns: 1fr;
  }

  .learning-first-card .service-card {
    min-height: 92px;
  }

  .learning-tool-grid {
    grid-template-columns: 1fr;
  }

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

.mic-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 18, 20, 0.58);
  backdrop-filter: blur(10px);
}

.mic-help-backdrop[hidden] {
  display: none;
}

.mic-help-card {
  position: relative;
  width: min(100%, 430px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 26px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.mic-help-close {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: #1c1c1e;
  font-size: 25px;
  line-height: 1;
}

.mic-help-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2eee1;
  color: #715c18;
  font-size: 12px;
  font-weight: 700;
}

.mic-help-card h2 {
  margin: 0 42px 12px 0;
  font-size: 24px;
  line-height: 1.2;
}

.mic-help-card p {
  margin: 0 0 14px;
  color: #53535a;
  font-size: 15px;
  line-height: 1.65;
}

.mic-help-steps {
  margin: 16px 0;
  padding: 16px 16px 16px 38px;
  border-radius: 18px;
  background: #f5f8f7;
  color: #1c1c1e;
  font-size: 16px;
  line-height: 1.65;
}

.mic-help-steps li + li {
  margin-top: 5px;
}

.mic-help-card .mic-help-note {
  padding: 13px 14px;
  border-radius: 16px;
  background: #f7f3e8;
  color: #504934;
  font-size: 14px;
}

.mic-help-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mic-help-actions .button {
  width: 100%;
  min-height: 48px;
}

/* Final compact pass: quieter hierarchy, compact profiles, desktop-safe navigation. */
.parent-page {
  background:
    radial-gradient(circle at 92% 0%, rgba(0, 122, 255, 0.055), transparent 24%),
    #f6f7f9;
}

.child-page {
  background:
    radial-gradient(circle at 7% 4%, rgba(255, 210, 82, 0.13), transparent 20%),
    radial-gradient(circle at 95% 9%, rgba(66, 190, 121, 0.1), transparent 22%),
    #f6f7f9;
}

.parent-page .app-shell {
  width: min(980px, calc(100% - 32px));
  padding-bottom: 28px;
}

.dashboard-heading {
  margin-bottom: 14px;
}

.dashboard-heading h1 {
  color: #1d1d1f;
  font-size: 23px;
  line-height: 1.18;
}

#account-summary {
  margin-top: 4px;
  color: #6e6e73;
  font-size: 12px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
}

.panel-heading h2 {
  color: #1d1d1f;
  font-size: 16px;
}

.parent-page .panel-heading h2::before {
  display: none;
}

.parent-page .panel-heading {
  margin-bottom: 10px;
}

.family-summary {
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.85fr);
  align-items: start;
  gap: 10px 12px;
  margin-top: 0;
}

.family-overview,
.family-profile,
.family-code-box,
.family-members,
.class-history {
  padding: 0;
  background: transparent;
}

.family-overview {
  grid-column: 1 / -1;
  padding-bottom: 11px;
  border-bottom: 1px solid #eceef1;
}

.family-child {
  color: #1d1d1f;
  font-size: 15px;
}

.family-member-count {
  font-size: 11px;
}

.family-profile-row {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}

.family-profile dt {
  font-size: 11px;
}

.family-profile dd {
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 560;
}

.family-code-box {
  align-self: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f6f8;
}

.family-code-box > span {
  font-size: 11px;
}

.family-code {
  font-size: 11px;
}

.family-members {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-member {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  padding: 7px 9px;
  border-color: #eceef1;
  border-radius: 10px;
  background: #f8f9fa;
}

.family-member strong {
  font-size: 12px;
}

.family-member span {
  font-size: 10px;
}

.class-history {
  grid-column: 2;
  display: block;
}

.class-history summary {
  cursor: pointer;
  color: #6e6e73;
  font-size: 11px;
}

.class-history .muted {
  display: block;
  padding-top: 5px;
  font-size: 11px;
}

.child-shell {
  padding-top: 18px;
}

.child-hero {
  min-height: 136px;
  padding: 20px;
  border-color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 91% 10%, rgba(255, 214, 92, 0.34), transparent 22%),
    radial-gradient(circle at 72% 105%, rgba(76, 190, 126, 0.16), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f2f8ff 100%);
}

.child-hero h1 {
  color: #1d1d1f;
  font-size: clamp(27px, 6.5vw, 35px);
}

.child-mascot {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: #fff5cf;
  font-size: 31px;
}

.learning-section > .panel-heading h2 {
  color: #1d1d1f;
  font-size: 18px;
}

.service-card {
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 7px 22px rgba(23, 31, 45, 0.035);
}

.service-card-tone-0 {
  background: linear-gradient(145deg, #eef6ff 0%, #ffffff 74%);
}

.service-card-tone-1 {
  background: linear-gradient(145deg, #edf9f1 0%, #ffffff 74%);
}

.service-card-tone-2 {
  background: linear-gradient(145deg, #fff7dd 0%, #ffffff 74%);
}

.service-card-tone-3 {
  background: linear-gradient(145deg, #f4efff 0%, #ffffff 74%);
}

.service-card h3 {
  color: #1d1d1f;
}

.service-card p {
  color: #7a7a80;
}

@media (min-width: 761px) {
  .app-bottom-nav {
    display: none;
  }

  .parent-page .app-shell,
  .child-shell {
    padding-bottom: 32px;
  }
}

@media (max-width: 760px) {
  .dashboard-heading h1 {
    font-size: 22px;
  }

  .panel-heading h2 {
    font-size: 16px;
  }

  .family-summary {
    grid-template-columns: 1fr;
  }

  .family-overview,
  .family-members,
  .class-history {
    grid-column: 1;
  }

  .family-code-box {
    grid-column: 1;
  }

  .child-hero {
    min-height: 132px;
    padding: 18px;
  }
}

/* Final mobile typography and navigation density. */
.intro-panel h1 {
  font-size: 27px;
}

.friendly-card h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
}

.app-bottom-nav {
  bottom: max(8px, env(safe-area-inset-bottom));
  padding: 6px;
  border-radius: 21px;
}

.app-bottom-nav a {
  padding: 7px 5px 5px;
}

.app-bottom-nav a span {
  font-size: 16px;
}

.app-bottom-nav a small {
  margin-top: 2px;
  font-size: 9.5px;
}

@media (max-width: 760px) {
  .landing h1 {
    font-size: 34px;
  }

  .intro-panel h1 {
    font-size: 25px;
  }

  .friendly-card h1 {
    font-size: 24px;
  }

  .friendly-card {
    margin-top: 22px;
    padding: 22px;
  }
}

/* 2026 unified friendly interface */
:root {
  --sc-bg: #f5f5f7;
  --sc-card: #ffffff;
  --sc-ink: #1d1d1f;
  --sc-muted: #6e6e73;
  --sc-blue: #007aff;
  --sc-green: #30c66b;
  --sc-mint: #dff8e9;
  --sc-sun: #fff1b8;
  --sc-sky: #e8f3ff;
  --sc-lilac: #f0eaff;
  --sc-radius-xl: 28px;
  --sc-radius-lg: 22px;
  --sc-radius-md: 16px;
  --sc-shadow-soft: 0 16px 42px rgba(18, 26, 43, 0.07);
}

html {
  scroll-behavior: smooth;
}

html,
body,
.landing-page,
.parent-page,
.child-page {
  background: var(--sc-bg);
}

body {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgba(245, 245, 247, 0.84);
}

.brand-mark {
  background: #111214;
}

.status-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
}

.button {
  border-radius: 14px;
}

.button.primary {
  background: var(--sc-blue);
}

.button.secondary {
  color: var(--sc-ink);
  background: #ececf0;
}

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(0, 122, 255, 0.12), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(48, 198, 107, 0.12), transparent 26%),
    var(--sc-bg);
}

.landing {
  width: min(1040px, calc(100% - 40px));
  padding: clamp(38px, 8vw, 76px) 0 70px;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: none;
  padding: clamp(34px, 6vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 36px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 214, 92, 0.45), transparent 18%),
    radial-gradient(circle at 82% 88%, rgba(48, 198, 107, 0.22), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.92));
  box-shadow: var(--sc-shadow-soft);
}

.landing-hero::after {
  position: absolute;
  z-index: -1;
  top: -110px;
  right: -90px;
  width: 290px;
  height: 290px;
  border: 44px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  content: "";
}

.landing-symbol {
  position: relative;
  width: max-content;
  margin: 0 auto 22px;
}

.landing-symbol .brand-mark {
  width: 76px;
  height: 76px;
  margin: 0;
  border-radius: 23px;
  font-size: 24px;
}

.landing-spark {
  position: absolute;
  top: -10px;
  right: -14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #5f4a00;
  background: #ffd95c;
  box-shadow: 0 5px 16px rgba(255, 193, 7, 0.24);
}

.landing-kicker,
.section-kicker,
.child-kicker {
  display: block;
  color: var(--sc-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.landing h1 {
  max-width: 720px;
  margin: 12px auto 0;
  font-size: clamp(42px, 7vw, 68px);
}

.landing h1 span {
  color: var(--sc-blue);
}

.landing .lede {
  margin-top: 16px;
}

.landing-actions {
  gap: 10px;
}

.platform-grid {
  gap: 18px;
  margin-top: 24px;
}

.platform-card {
  overflow: hidden;
  min-height: 220px;
  padding: 26px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-shadow-soft);
}

.android-card {
  background: linear-gradient(145deg, #fff, #eef5ff);
}

.web-card {
  background: linear-gradient(145deg, #fff, #effaf2);
}

.platform-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(24, 45, 70, 0.07);
  font-size: 26px;
}

.platform-heading h2 {
  font-size: 24px;
}

.platform-card > p {
  margin: 16px 0 22px;
}

.parent-page {
  background:
    radial-gradient(circle at 90% 3%, rgba(0, 122, 255, 0.09), transparent 23%),
    var(--sc-bg);
}

.parent-page .app-shell {
  width: min(1040px, calc(100% - 40px));
  padding-bottom: 126px;
}

.auth-layout {
  max-width: 760px;
  gap: 20px;
  padding-top: 16px;
}

.intro-panel {
  display: grid;
  justify-items: center;
}

.parent-orbit {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: #111214;
  box-shadow: 0 16px 34px rgba(17, 18, 20, 0.16);
  font-size: 18px;
  font-weight: 750;
}

.parent-orbit i {
  position: absolute;
  top: -9px;
  right: -10px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #635000;
  background: #ffd95c;
  font-size: 13px;
  font-style: normal;
}

.intro-panel h1 {
  margin-top: 9px;
}

.auth-card {
  padding: 26px;
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-shadow-soft);
}

.dashboard-heading {
  margin-bottom: 24px;
}

.dashboard-heading h1 {
  font-size: clamp(32px, 5vw, 46px);
}

.dashboard-grid {
  gap: 18px;
}

.panel {
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-shadow-soft);
}

.panel-heading h2::before {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-right: 9px;
  place-items: center;
  border-radius: 10px;
  background: var(--sc-sky);
  font-size: 16px;
  vertical-align: 2px;
}

#family-panel h2::before {
  content: "🎓";
}

#device-panel h2::before {
  content: "📱";
}

#homework-panel h2::before {
  content: "📝";
}

#connector-panel h2::before {
  content: "🚀";
}

.wechat-import-card,
.tutor-messages,
.homework-card,
.family-member,
.class-history {
  border-radius: var(--sc-radius-lg);
}

.app-bottom-nav {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  width: min(430px, calc(100% - 28px));
  padding: 8px;
  transform: translateX(50%);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 36px rgba(19, 28, 44, 0.13);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.app-bottom-nav a {
  display: grid;
  flex: 1;
  min-width: 0;
  padding: 8px 5px 6px;
  place-items: center;
  border-radius: 17px;
  color: #76767b;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.app-bottom-nav a:first-child {
  color: var(--sc-blue);
  background: #edf5ff;
}

.app-bottom-nav a span {
  font-size: 18px;
  line-height: 1;
}

.app-bottom-nav a small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 650;
}

.parent-bottom-nav {
  max-width: 390px;
}

.child-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 4% 8%, rgba(255, 214, 92, 0.2), transparent 20%),
    radial-gradient(circle at 96% 16%, rgba(48, 198, 107, 0.15), transparent 23%),
    var(--sc-bg);
}

.child-shell {
  width: min(780px, calc(100% - 32px));
  padding-top: 22px;
  padding-bottom: 126px;
}

.friendly-card {
  position: relative;
  overflow: hidden;
  max-width: 560px;
  margin-top: 30px;
  padding: 30px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 214, 92, 0.32), transparent 20%),
    linear-gradient(150deg, #fff, #f1f8ff);
  box-shadow: var(--sc-shadow-soft);
}

.friendly-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 9px 22px rgba(26, 39, 60, 0.08);
  font-size: 31px;
}

.friendly-card h1 {
  font-size: clamp(30px, 8vw, 42px);
}

.friendly-card .step-list {
  margin-top: 20px;
}

.pair-code-wrap {
  border-radius: var(--sc-radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.pair-code-wrap strong {
  color: #111214;
  font-size: clamp(42px, 13vw, 64px);
  letter-spacing: 0.08em;
}

.child-hero {
  position: relative;
  display: grid;
  min-height: 192px;
  margin: 0 0 24px;
  padding: 28px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) 116px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 16%, rgba(255, 211, 78, 0.48), transparent 22%),
    radial-gradient(circle at 72% 96%, rgba(48, 198, 107, 0.22), transparent 27%),
    linear-gradient(145deg, #fff, #eef7ff);
  box-shadow: var(--sc-shadow-soft);
}

.child-hero::after {
  position: absolute;
  right: -54px;
  bottom: -92px;
  width: 210px;
  height: 210px;
  border: 32px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  content: "";
}

.child-hero-copy {
  position: relative;
  z-index: 1;
}

.child-kicker {
  color: #177345;
}

.child-hero h1 {
  max-width: 410px;
  margin-top: 9px;
  font-size: clamp(32px, 8vw, 48px);
}

.child-hero p {
  margin: 10px 0 0;
  font-size: 13px;
}

.child-mascot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 32px rgba(24, 57, 82, 0.1);
  font-size: 49px;
  animation: mascot-float 3.2s ease-in-out infinite;
}

.child-hero .round-button {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.7);
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.learning-section,
#services-section,
#tutor-section,
#homework-section {
  scroll-margin-top: 76px;
}

.learning-section {
  margin-top: 18px;
}

.learning-section > .panel-heading {
  margin-bottom: 13px;
}

.learning-section > .panel-heading h2 {
  font-size: 23px;
}

.service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.service-card {
  min-height: 158px;
  align-content: space-between;
  gap: 16px;
  padding: 17px;
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(18, 31, 49, 0.055);
}

.service-card-tone-0 {
  background: linear-gradient(145deg, #eef7ff, #fff);
}

.service-card-tone-1 {
  background: linear-gradient(145deg, #eafaf0, #fff);
}

.service-card-tone-2 {
  background: linear-gradient(145deg, #fff7d9, #fff);
}

.service-card-tone-3 {
  background: linear-gradient(145deg, #f4efff, #fff);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 16px rgba(20, 40, 60, 0.06);
  font-size: 25px;
}

.service-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 4px;
  font-size: 18px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.ai-tutor-card,
.homework-card {
  padding: 22px;
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-shadow-soft);
}

.ai-tutor-card {
  background: linear-gradient(150deg, #fff, #eef7ff);
}

.homework-card {
  background: linear-gradient(150deg, #fff, #fff9e8);
}

.ai-tutor-card > .panel-heading h2::before {
  content: "🦊";
}

.homework-card > .panel-heading h2::before {
  content: "✏️";
}

.ai-tutor-card > .panel-heading h2::before,
.homework-card > .panel-heading h2::before {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-right: 9px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  vertical-align: 2px;
}

.tutor-messages {
  background: rgba(255, 255, 255, 0.7);
}

.tutor-message.assistant {
  background: #fff;
}

.guided-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.guided-card > summary {
  padding: 16px 18px;
}

.guided-card > summary::before {
  margin-right: 7px;
  content: "🛡️";
}

.child-bottom-nav {
  max-width: 420px;
}

.child-bottom-nav a:nth-child(2):hover,
.child-bottom-nav a:nth-child(3):hover,
.child-bottom-nav a:nth-child(4):hover {
  color: #177345;
  background: #eaf8ef;
}

@media (max-width: 760px) {
  .landing {
    width: min(100% - 24px, 1040px);
    padding-top: 18px;
  }

  .landing-hero {
    padding: 34px 22px 30px;
    border-radius: 30px;
  }

  .landing-symbol .brand-mark {
    width: 66px;
    height: 66px;
  }

  .landing h1 {
    font-size: clamp(38px, 12vw, 52px);
  }

  .landing-actions {
    display: grid;
  }

  .platform-card {
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
  }

  .parent-page .app-shell,
  .child-shell {
    width: min(100% - 24px, 1040px);
  }

  .auth-card,
  .panel {
    padding: 19px;
    border-radius: 24px;
  }

  .dashboard-heading {
    gap: 14px;
  }

  .dashboard-heading h1 {
    font-size: 34px;
  }

  .panel-heading {
    align-items: center;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .child-hero {
    min-height: 174px;
    padding: 24px 22px;
    grid-template-columns: minmax(0, 1fr) 82px;
    border-radius: 28px;
  }

  .child-mascot {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    font-size: 39px;
  }

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

  .service-card {
    min-height: 148px;
    padding: 15px;
    border-radius: 21px;
  }

  .service-icon {
    width: 47px;
    height: 47px;
    font-size: 22px;
  }

  .service-card h3 {
    font-size: 16px;
  }

  .ai-tutor-card,
  .homework-card {
    padding: 19px;
    border-radius: 24px;
  }
}

@media (max-width: 390px) {
  .landing h1 {
    font-size: 38px;
  }

  .child-hero {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .child-mascot {
    width: 64px;
    height: 64px;
    font-size: 33px;
  }

  .service-card {
    min-height: 142px;
    padding: 14px;
  }

  .app-bottom-nav {
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .child-mascot {
    animation: none;
  }
}

/* Refined neutral Apple-style pass */
.landing-page,
.parent-page,
.child-page {
  background: #f5f5f7;
}

.landing-hero {
  background: linear-gradient(155deg, #ffffff 0%, #f8fbff 72%, #f3f8ff 100%);
  box-shadow: 0 18px 46px rgba(23, 31, 45, 0.06);
}

.landing-hero::after {
  border-color: rgba(0, 122, 255, 0.055);
}

.landing-symbol .brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 19px;
  font-size: 20px;
}

.landing-spark {
  width: 27px;
  height: 27px;
  font-size: 11px;
}

.landing h1 {
  font-size: clamp(38px, 6vw, 52px);
  letter-spacing: -0.045em;
}

.landing .lede {
  font-size: 17px;
}

.landing-actions {
  max-width: 470px;
  margin-right: auto;
  margin-left: auto;
}

.platform-grid {
  gap: 14px;
}

.platform-card {
  min-height: 184px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(23, 31, 45, 0.05);
}

.platform-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f5f5f7;
  box-shadow: none;
  font-size: 22px;
}

.platform-heading h2 {
  font-size: 20px;
}

.parent-orbit {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
  font-size: 15px;
}

.parent-orbit i {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.intro-panel h1 {
  font-size: 32px;
}

.intro-panel > p:not(.eyebrow) {
  margin-top: 7px;
  font-size: 15px;
}

.auth-card {
  padding: 20px;
  box-shadow: 0 14px 38px rgba(23, 31, 45, 0.055);
}

.dashboard-heading {
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-heading h1 {
  font-size: 28px;
  letter-spacing: -0.035em;
}

#account-summary {
  max-width: 680px;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-heading .heading-actions {
  flex-wrap: nowrap;
}

.dashboard-heading .button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
}

.dashboard-grid {
  gap: 14px;
}

.panel {
  padding: 18px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(23, 31, 45, 0.045);
}

.panel-heading {
  margin-bottom: 12px;
}

.panel-heading h2,
.guided-card h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panel-heading h2::before {
  width: 27px;
  height: 27px;
  margin-right: 7px;
  border-radius: 8px;
  background: #f1f3f6;
  font-size: 14px;
}

.family-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 14px;
}

.family-overview,
.family-code-box,
.family-members,
.class-history,
.family-profile {
  grid-column: auto;
  padding: 13px 14px;
  border: 0;
  border-radius: 15px;
  background: #f5f5f7;
}

.family-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.family-child {
  font-size: 16px;
  font-weight: 650;
}

.family-member-count {
  color: var(--sc-muted);
  font-size: 12px;
}

.family-profile {
  margin: 0;
}

.family-profile-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
}

.family-profile-row:last-child {
  border-bottom: 0;
}

.family-profile dt {
  color: var(--sc-muted);
  font-size: 12px;
}

.family-profile dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--sc-ink);
  font-size: 13px;
  font-weight: 550;
  text-align: right;
}

.family-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.family-code-box > span {
  color: var(--sc-muted);
  font-size: 12px;
}

.family-code {
  margin: 0;
  color: #5f6368;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.family-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.family-member {
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  background: #fff;
}

.family-member strong {
  font-size: 13px;
}

.family-member span {
  font-size: 11px;
}

.class-history {
  display: grid;
  gap: 5px;
}

.class-history-title {
  color: var(--sc-muted);
  font-size: 12px;
}

.class-history .muted {
  font-size: 12px;
}

.child-page {
  background: #f5f5f7;
}

.child-hero {
  min-height: 154px;
  padding: 22px;
  grid-template-columns: minmax(0, 1fr) 82px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 214, 92, 0.22), transparent 20%),
    #fff;
  box-shadow: 0 12px 34px rgba(23, 31, 45, 0.05);
}

.child-hero::after {
  display: none;
}

.child-kicker {
  color: #248a55;
  font-size: 11px;
}

.child-hero h1 {
  margin-top: 6px;
  font-size: clamp(29px, 7vw, 38px);
  letter-spacing: -0.04em;
}

.child-hero p {
  margin-top: 7px;
  font-size: 12px;
}

.child-mascot {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: #fff7dd;
  box-shadow: none;
  font-size: 35px;
}

.learning-section {
  margin-top: 16px;
}

.learning-section > .panel-heading h2 {
  font-size: 20px;
}

.service-card {
  min-height: 138px;
  padding: 15px;
  border-color: rgba(0, 0, 0, 0.055);
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 31, 45, 0.04);
}

.service-card-tone-0 .service-icon {
  background: #e9f2ff;
}

.service-card-tone-1 .service-icon {
  background: #eaf7ef;
}

.service-card-tone-2 .service-icon {
  background: #fff4d8;
}

.service-card-tone-3 .service-icon {
  background: #f2ecff;
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f5f5f7;
  box-shadow: none;
  font-size: 22px;
}

.service-card h3 {
  font-size: 16px;
}

.ai-tutor-card,
.homework-card {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(23, 31, 45, 0.045);
}

.friendly-card {
  max-width: 500px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(23, 31, 45, 0.055);
}

.friendly-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 15px;
  border-radius: 17px;
  background: #f5f5f7;
  box-shadow: none;
  font-size: 26px;
}

.friendly-card h1 {
  font-size: 30px;
}

@media (max-width: 760px) {
  .landing-hero {
    padding: 30px 20px 26px;
  }

  .landing h1 {
    font-size: 38px;
  }

  .dashboard-heading {
    align-items: flex-start;
  }

  .dashboard-heading h1 {
    font-size: 27px;
  }

  .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .child-hero {
    min-height: 146px;
    padding: 20px;
    grid-template-columns: minmax(0, 1fr) 66px;
  }

  .child-mascot {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  .service-card {
    min-height: 132px;
    padding: 13px;
    border-radius: 18px;
  }
}

/* Final cascade: keep this block at the end so compact sizing always wins. */
.parent-page {
  background:
    radial-gradient(circle at 92% 0%, rgba(0, 122, 255, 0.055), transparent 24%),
    #f6f7f9;
}

.child-page {
  background:
    radial-gradient(circle at 7% 4%, rgba(255, 210, 82, 0.13), transparent 20%),
    radial-gradient(circle at 95% 9%, rgba(66, 190, 121, 0.1), transparent 22%),
    #f6f7f9;
}

.parent-page .app-shell {
  width: min(980px, calc(100% - 32px));
  padding-bottom: 28px;
}

.dashboard-heading {
  margin-bottom: 14px;
}

.dashboard-heading h1 {
  color: #1d1d1f;
  font-size: 23px;
  line-height: 1.18;
}

#account-summary {
  margin-top: 4px;
  color: #6e6e73;
  font-size: 12px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
}

.panel-heading h2 {
  color: #1d1d1f;
  font-size: 16px;
}

.parent-page .panel-heading h2::before {
  display: none;
}

.parent-page .panel-heading {
  margin-bottom: 10px;
}

.family-summary {
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.85fr);
  align-items: start;
  gap: 10px 12px;
  margin-top: 0;
}

.family-overview,
.family-profile,
.family-code-box,
.family-members,
.class-history {
  padding: 0;
  background: transparent;
}

.family-overview {
  grid-column: 1 / -1;
  padding-bottom: 11px;
  border-bottom: 1px solid #eceef1;
}

.family-child {
  color: #1d1d1f;
  font-size: 15px;
}

.family-member-count,
.family-code-box > span,
.family-code,
.family-member span,
.class-history summary,
.class-history .muted {
  font-size: 11px;
}

.family-profile-row {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}

.family-profile dt {
  font-size: 11px;
}

.family-profile dd {
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 560;
}

.family-code-box {
  align-self: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f6f8;
}

.family-members {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-member {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  padding: 7px 9px;
  border-color: #eceef1;
  border-radius: 10px;
  background: #f8f9fa;
}

.family-member strong {
  font-size: 12px;
}

.class-history {
  grid-column: 2;
  display: block;
}

.class-history summary {
  cursor: pointer;
  color: #6e6e73;
}

.class-history .muted {
  display: block;
  padding-top: 5px;
}

.child-shell {
  padding-top: 18px;
}

.child-hero {
  min-height: 136px;
  padding: 20px;
  border-color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 91% 10%, rgba(255, 214, 92, 0.34), transparent 22%),
    radial-gradient(circle at 72% 105%, rgba(76, 190, 126, 0.16), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f2f8ff 100%);
}

.child-hero h1 {
  color: #1d1d1f;
  font-size: clamp(27px, 6.5vw, 35px);
}

.child-mascot {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: #fff5cf;
  font-size: 31px;
}

.learning-section > .panel-heading h2 {
  color: #1d1d1f;
  font-size: 18px;
}

.service-card {
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 7px 22px rgba(23, 31, 45, 0.035);
}

.service-card-tone-0 {
  background: linear-gradient(145deg, #eef6ff 0%, #ffffff 74%);
}

.service-card-tone-1 {
  background: linear-gradient(145deg, #edf9f1 0%, #ffffff 74%);
}

.service-card-tone-2 {
  background: linear-gradient(145deg, #fff7dd 0%, #ffffff 74%);
}

.service-card-tone-3 {
  background: linear-gradient(145deg, #f4efff 0%, #ffffff 74%);
}

.service-card h3 {
  color: #1d1d1f;
}

.service-card p {
  color: #7a7a80;
}

@media (min-width: 761px) {
  .app-bottom-nav {
    display: none;
  }

  .parent-page .app-shell,
  .child-shell {
    padding-bottom: 32px;
  }
}

@media (max-width: 760px) {
  .dashboard-heading h1 {
    font-size: 22px;
  }

  .panel-heading h2 {
    font-size: 16px;
  }

  .family-summary {
    grid-template-columns: 1fr;
  }

  .family-overview,
  .family-code-box,
  .family-members,
  .class-history {
    grid-column: 1;
  }

  .child-hero {
    min-height: 132px;
    padding: 18px;
  }
}

/* Last-mile mobile density: intentionally the final declarations in this file. */
.intro-panel h1 { font-size: 27px; }
.friendly-card h1 { font-size: 25px; letter-spacing: -0.03em; }
.app-bottom-nav { bottom: max(8px, env(safe-area-inset-bottom)); padding: 6px; border-radius: 21px; }
.app-bottom-nav a { padding: 7px 5px 5px; }
.app-bottom-nav a span { font-size: 16px; }
.app-bottom-nav a small { margin-top: 2px; font-size: 9.5px; }
@media (max-width: 760px) {
  .landing h1 { font-size: 34px; }
  .intro-panel h1 { font-size: 25px; }
  .friendly-card { margin-top: 22px; padding: 22px; }
  .friendly-card h1 { font-size: 24px; }
}

/* Paired-device recovery without creating a duplicate device. */
.device-recovery {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eceef1;
}
.device-recovery > summary {
  cursor: pointer;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 650;
}
.device-recovery > p {
  margin: 9px 0;
  color: #6e6e73;
  font-size: 12px;
}
.device-recovery-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.device-recovery-form input {
  min-height: 40px;
  letter-spacing: 0.12em;
}
.device-recovery-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.device-recovery-result {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  color: #6e6e73;
  font-size: 11px;
}
.device-recovery-result strong {
  color: #1d1d1f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  letter-spacing: 0.12em;
}
.device-recovery-result small {
  font-size: 10px;
}

/* Live digital-human English classroom */
.tutor-persona-picker {
  margin: 14px 0 2px;
  padding: 12px;
  border: 1px solid rgba(89, 104, 179, 0.13);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(249, 247, 255, 0.98), rgba(239, 248, 255, 0.98));
}

.tutor-persona-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.tutor-persona-heading span {
  color: #65647a;
  font-size: 12px;
  font-weight: 700;
}

.tutor-persona-heading strong {
  color: #34364d;
  font-size: 12px;
  text-align: right;
}

.tutor-persona-list {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.tutor-persona {
  display: flex;
  flex: 0 0 154px;
  align-items: center;
  gap: 9px;
  min-height: 64px;
  padding: 6px 9px 6px 6px;
  border: 1px solid rgba(83, 100, 170, 0.14);
  border-radius: 17px;
  color: #34364d;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(69, 80, 133, 0.07);
  font: inherit;
  text-align: left;
  scroll-snap-align: start;
}

.tutor-persona[aria-pressed="true"] {
  border-color: rgba(92, 86, 220, 0.72);
  background: #fff;
  box-shadow:
    0 8px 20px rgba(76, 80, 180, 0.14),
    0 0 0 3px rgba(105, 101, 232, 0.13);
}

.tutor-persona-thumb {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.tutor-persona[data-sheet="adults"] .tutor-persona-thumb {
  background-image: url("/assets/tutor-adults-open-v2.webp");
  background-size: 300% 200%;
}

.tutor-persona[data-sheet="peers"] .tutor-persona-thumb {
  background-image: url("/assets/tutor-peers-open-v2.webp");
  background-size: 200% 200%;
}

.tutor-persona[data-sheet="adults"][data-cell="0"] .tutor-persona-thumb { background-position: 0% 0%; }
.tutor-persona[data-sheet="adults"][data-cell="1"] .tutor-persona-thumb { background-position: 50% 0%; }
.tutor-persona[data-sheet="adults"][data-cell="2"] .tutor-persona-thumb { background-position: 100% 0%; }
.tutor-persona[data-sheet="adults"][data-cell="3"] .tutor-persona-thumb { background-position: 0% 100%; }
.tutor-persona[data-sheet="adults"][data-cell="4"] .tutor-persona-thumb { background-position: 50% 100%; }
.tutor-persona[data-sheet="adults"][data-cell="5"] .tutor-persona-thumb { background-position: 100% 100%; }
.tutor-persona[data-sheet="peers"][data-cell="0"] .tutor-persona-thumb { background-position: 0% 0%; }
.tutor-persona[data-sheet="peers"][data-cell="1"] .tutor-persona-thumb { background-position: 100% 0%; }
.tutor-persona[data-sheet="peers"][data-cell="2"] .tutor-persona-thumb { background-position: 0% 100%; }
.tutor-persona[data-sheet="peers"][data-cell="3"] .tutor-persona-thumb { background-position: 100% 100%; }

.tutor-persona-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.tutor-persona-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutor-persona-copy small {
  color: #77798b;
  font-size: 9px;
  line-height: 1.25;
}

.tutor-video-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 520px;
  margin: 16px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), transparent 34%),
    linear-gradient(155deg, #f7e8ff 0%, #e8f5ff 52%, #fff4e8 100%);
  box-shadow:
    0 20px 55px rgba(88, 74, 129, 0.16),
    inset 0 0 0 1px rgba(111, 84, 161, 0.06);
}

.tutor-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #16131d;
}

#tutor-avatar {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.tutor-video-placeholder {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  text-align: center;
  color: #3f3755;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 36px rgba(39, 45, 76, 0.18);
  backdrop-filter: blur(14px);
}

.tutor-video-placeholder > span {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 20px rgba(81, 67, 116, 0.12);
  font-size: 23px;
  backdrop-filter: blur(12px);
}

.tutor-video-placeholder strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.tutor-video-placeholder p {
  max-width: 260px;
  margin: 0;
  color: #716a7e;
  font-size: 11px;
  line-height: 1.55;
}

.tutor-live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(20, 18, 27, 0.62);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.tutor-live-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d67;
  box-shadow: 0 0 0 4px rgba(255, 77, 103, 0.2);
  animation: tutor-live-pulse 1.6s ease-in-out infinite;
}

@keyframes tutor-live-pulse {
  50% { opacity: 0.45; transform: scale(0.82); }
}

.tutor-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  max-height: 34%;
  overflow-y: auto;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  color: #fff;
  background: rgba(19, 17, 25, 0.68);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(10px);
}

.tutor-caption:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.tutor-live-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tutor-live-actions .button {
  flex: 1 1 130px;
}

.tutor-live-actions .text-button {
  min-height: 42px;
  padding-inline: 12px;
}

.tutor-live-hint {
  margin: 10px 2px 4px;
  color: #77717f;
  font-size: 12px;
  line-height: 1.55;
}

.tutor-choice-panel {
  margin: 10px 0 4px;
  padding: 12px;
  border: 1px solid rgba(76, 116, 220, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(240, 247, 255, 0.96), rgba(247, 242, 255, 0.96));
}

.tutor-choice-panel p {
  margin: 0 0 9px;
  color: #4e5268;
  font-size: 12px;
  font-weight: 700;
}

.tutor-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tutor-choice {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid rgba(64, 107, 221, 0.2);
  border-radius: 999px;
  color: #244f9f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 14px rgba(66, 89, 154, 0.08);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.tutor-choice:active {
  transform: translateY(1px);
}

#tutor-section[data-live-state="connecting"] .tutor-video-shell {
  box-shadow:
    0 20px 55px rgba(88, 74, 129, 0.16),
    0 0 0 4px rgba(94, 128, 255, 0.12);
}

#tutor-section[data-live-state="connected"] .tutor-video-placeholder {
  display: none;
}

#tutor-section[data-live-state="listening"] .tutor-video-shell {
  box-shadow:
    0 20px 55px rgba(31, 121, 83, 0.2),
    0 0 0 5px rgba(48, 179, 119, 0.14);
}

#tutor-section[data-live-state="speaking"] .tutor-video-shell {
  box-shadow:
    0 20px 55px rgba(88, 74, 129, 0.2),
    0 0 0 5px rgba(103, 105, 255, 0.13);
}

#tutor-section[data-live-state="listening"] #tutor-avatar {
  animation: tutor-listening-glow 1.25s ease-in-out infinite;
}

@keyframes tutor-listening-glow {
  50% { filter: brightness(1.04) saturate(1.06); }
}

@media (min-width: 760px) {
  .tutor-video-shell {
    aspect-ratio: 16 / 10;
    max-height: 430px;
  }

  .tutor-persona-list {
    padding-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutor-live-badge span {
    animation: none;
  }

  #tutor-section[data-live-state="listening"] #tutor-avatar {
    animation: none;
  }
}

/* r53 shared StarLinkPod interface: calm dashboard, pastel learning cards, unified parent/child language. */
:root {
  --ui-ink: #111214;
  --ui-muted: #7c8087;
  --ui-soft: #f5f6f7;
  --ui-line: rgba(17, 18, 20, 0.07);
  --ui-white: #ffffff;
  --ui-yellow: #ffe9a8;
  --ui-yellow-deep: #f6c94d;
  --ui-mint: #dceee9;
  --ui-mint-deep: #a7d8cb;
  --ui-lavender: #e4ddf6;
  --ui-lavender-deep: #c9b9eb;
  --ui-pink: #f8dce9;
  --ui-pink-deep: #efb7cf;
  --ui-radius-xl: 30px;
  --ui-radius-lg: 24px;
  --ui-shadow: 0 14px 42px rgba(20, 25, 32, 0.055);
}

body.parent-page,
body.child-page,
body.landing-page {
  color: var(--ui-ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 232, 164, 0.18), transparent 27%),
    radial-gradient(circle at 92% 18%, rgba(213, 237, 230, 0.2), transparent 25%),
    #f4f5f6;
}

body.parent-page,
body.child-page {
  min-height: 100vh;
}

body.parent-page .topbar,
body.child-page .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 4px;
  border: 0;
  background: rgba(244, 245, 246, 0.9);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.topbar .brand {
  gap: 10px;
}

.topbar .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: var(--ui-ink);
  box-shadow: none;
  font-size: 13px;
}

.topbar .brand > span:last-child {
  gap: 1px;
}

.topbar .brand strong {
  color: var(--ui-ink);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.topbar .brand small {
  color: var(--ui-muted);
  font-size: 10px;
}

.topbar .status-pill {
  min-height: 34px;
  padding: 8px 13px;
  border: 0;
  color: #397a64;
  background: var(--ui-mint);
  font-size: 11px;
  font-weight: 700;
}

.topbar .status-pill:not(.online) {
  color: #7d7060;
  background: var(--ui-yellow);
}

#logout-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: #55575d;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

body.parent-page .topbar-actions {
  gap: 7px;
  min-width: 0;
}

body.parent-page .app-shell,
body.child-page .child-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 12px 16px 118px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 14px 4px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-avatar {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  color: #1b2228;
  background: linear-gradient(145deg, #f7c8c8, #f9e4bf);
  box-shadow: 0 8px 22px rgba(28, 32, 38, 0.09);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-copy h1 {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(25px, 6.4vw, 36px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.profile-copy p {
  margin: 5px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: auto;
  margin-left: auto;
}

.round-button,
.profile-actions .round-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 50%;
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(24, 29, 36, 0.06);
  font-size: 18px;
}

.dashboard-tabs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  margin: 0 0 18px;
  padding: 1px 1px 8px;
  scrollbar-width: none;
}

.dashboard-tabs::-webkit-scrollbar {
  display: none;
}

.dashboard-tabs a {
  flex: 1 0 auto;
  min-width: 78px;
  padding: 12px 18px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: #70747b;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 20px rgba(20, 24, 30, 0.035);
}

.dashboard-tabs a.active {
  color: #fff;
  background: var(--ui-ink);
}

.feature-grid,
.parent-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.summary-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 0;
  border-radius: var(--ui-radius-xl);
  color: var(--ui-ink);
  text-decoration: none;
  box-shadow: var(--ui-shadow);
}

.feature-card {
  min-height: 188px;
  padding: 20px;
}

.feature-card::before,
.summary-card::before {
  position: absolute;
  top: -34px;
  right: 20px;
  width: 118px;
  height: 48px;
  border: 10px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  content: "";
  transform: rotate(-34deg);
}

.feature-yellow {
  background: linear-gradient(145deg, #ffedb9, var(--ui-yellow));
}

.feature-mint {
  background: linear-gradient(145deg, #e7f4f0, var(--ui-mint));
}

.feature-lavender {
  background: linear-gradient(145deg, #eee8fb, var(--ui-lavender));
}

.feature-pink {
  background: linear-gradient(145deg, #fce8f1, var(--ui-pink));
}

.feature-star {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.8);
  font-size: 20px;
}

.feature-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.feature-card small {
  position: absolute;
  top: 82px;
  left: 20px;
  color: rgba(17, 18, 20, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-card h2 {
  position: absolute;
  right: 60px;
  bottom: 44px;
  left: 20px;
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(19px, 4.8vw, 25px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.feature-card p {
  position: absolute;
  right: 56px;
  bottom: 20px;
  left: 20px;
  margin: 0;
  overflow: hidden;
  color: rgba(17, 18, 20, 0.62);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-arrow {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ui-ink);
  font-size: 17px;
}

.dashboard-calendar,
.recent-learning {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--ui-radius-xl);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ui-shadow);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title-row h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.section-title-row > a {
  color: #6c7077;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.calendar-date {
  padding: 9px 13px;
  border-radius: 999px;
  color: #477b69;
  background: var(--ui-mint);
  font-size: 11px;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 19px 0 16px;
}

.week-day {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #8a8d92;
}

.week-day small {
  font-size: 9px;
  font-weight: 650;
}

.week-day strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 50%;
  color: #303237;
  font-size: 12px;
  font-weight: 650;
}

.week-day.today small {
  color: #2d7560;
}

.week-day.today strong {
  border-color: var(--ui-ink);
  color: #fff;
  background: var(--ui-ink);
}

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

.schedule-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px 10px 10px;
  border-radius: 20px;
  color: var(--ui-ink);
  background: #e5f1ee;
  text-decoration: none;
}

.schedule-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 750;
}

.schedule-item > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.schedule-item small {
  color: #668078;
  font-size: 9px;
  font-weight: 700;
}

.schedule-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-item b {
  color: #2f3735;
  font-size: 16px;
}

.recent-learning .section-title-row {
  margin-bottom: 13px;
}

.recent-learning-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 20px;
  color: var(--ui-ink);
  background: #f7f2fb;
  text-decoration: none;
}

.recent-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #4b3e68;
  background: var(--ui-lavender);
  font-size: 12px;
  font-weight: 800;
}

.recent-learning-card > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.recent-learning-card strong {
  font-size: 13px;
}

.recent-learning-card small {
  color: var(--ui-muted);
  font-size: 10px;
}

.recent-learning-card b {
  font-size: 16px;
}

.learning-section,
.panel,
.ai-tutor-card,
.homework-card,
.family-summary {
  margin-top: 18px;
  padding: 22px;
  border: 0;
  border-radius: var(--ui-radius-xl);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--ui-shadow);
}

.learning-section > .panel-heading,
.panel > .panel-heading {
  margin-bottom: 14px;
  padding: 0;
  border: 0;
}

.learning-section > .panel-heading h2,
.panel > .panel-heading h2,
.dashboard-heading h1 {
  color: var(--ui-ink);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.panel > .panel-heading h2::before,
.ai-tutor-card > .panel-heading h2::before,
.homework-card > .panel-heading h2::before,
.child-kicker::before {
  display: none;
}

.child-kicker {
  color: #6c7077;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.service-grid {
  gap: 12px;
}

.service-card {
  min-height: 116px;
  padding: 17px;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
}

.service-card-tone-0 {
  background: var(--ui-yellow);
}

.service-card-tone-1 {
  background: var(--ui-mint);
}

.service-card-tone-2 {
  background: var(--ui-lavender);
}

.service-card-tone-3 {
  background: var(--ui-pink);
}

.service-card h3 {
  color: var(--ui-ink);
  font-size: 15px;
}

.service-card p {
  color: rgba(17, 18, 20, 0.58);
  font-size: 10px;
}

.empty-state {
  min-height: 0;
  padding: 18px;
  border: 1px dashed rgba(17, 18, 20, 0.12);
  border-radius: 20px;
  color: #777b82;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.55;
}

.tutor-persona-picker {
  padding: 13px;
  border: 0;
  border-radius: 22px;
  background: #f7f7f8;
}

.tutor-persona {
  border-color: transparent;
  border-radius: 18px;
  box-shadow: 0 7px 20px rgba(20, 24, 30, 0.045);
}

.tutor-persona[aria-pressed="true"] {
  border-color: var(--ui-ink);
  box-shadow: 0 0 0 2px rgba(17, 18, 20, 0.08);
}

.tutor-persona-thumb {
  border-radius: 50%;
}

.tutor-video-shell {
  margin-top: 15px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(145deg, var(--ui-lavender), var(--ui-mint));
  box-shadow: 0 16px 38px rgba(38, 44, 52, 0.12);
}

.tutor-video-placeholder {
  display: none;
}

.tutor-live-actions .button.primary,
.button.primary {
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--ui-ink);
  box-shadow: none;
}

.button.secondary,
.text-button {
  border-color: var(--ui-line);
  border-radius: 999px;
  color: var(--ui-ink);
  background: #fff;
  box-shadow: none;
}

.tutor-messages {
  border: 0;
  border-radius: 22px;
  background: #f7f7f8;
}

.tutor-message.assistant {
  color: #34363b;
  background: var(--ui-mint);
}

.tutor-message.user {
  color: #fff;
  background: var(--ui-ink);
}

.tutor-choice-panel {
  border: 0;
  border-radius: 22px;
  background: #f5f0fb;
}

input,
select,
textarea {
  border-color: var(--ui-line);
  border-radius: 16px;
  background: #fafafa;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(17, 18, 20, 0.28);
  box-shadow: 0 0 0 4px rgba(17, 18, 20, 0.05);
}

.parent-summary-grid {
  margin-bottom: 18px;
}

.summary-card {
  display: grid;
  min-height: 150px;
  padding: 18px;
  align-content: end;
}

.summary-yellow {
  background: var(--ui-yellow);
}

.summary-mint {
  background: var(--ui-mint);
}

.summary-lavender {
  background: var(--ui-lavender);
}

.summary-pink {
  background: var(--ui-pink);
}

.summary-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  font-size: 16px;
}

.summary-card small {
  color: rgba(17, 18, 20, 0.56);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  margin: 6px 0 4px;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 19px;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card > span:last-child {
  overflow: hidden;
  color: rgba(17, 18, 20, 0.58);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-page .dashboard-grid {
  gap: 18px;
}

.parent-page .panel {
  margin-top: 0;
}

.parent-page .panel-heading {
  align-items: center;
}

.parent-page .family-summary {
  margin-top: 14px;
  padding: 16px;
  background: #f8f8f9;
  box-shadow: none;
}

.parent-page .family-member,
.parent-page .family-code-box {
  border-radius: 14px;
  background: #fff;
}

.parent-page .device-card,
.parent-page .connector-card,
.parent-page .homework-card {
  border: 0;
  border-radius: 20px;
  background: #f8f8f9;
  box-shadow: none;
}

.parent-page .wechat-import-card {
  border: 0;
  border-radius: 22px;
  background: var(--ui-mint);
}

.auth-layout {
  gap: 22px;
  align-items: stretch;
}

.intro-panel {
  border-radius: var(--ui-radius-xl);
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.75), transparent 24%),
    var(--ui-yellow);
  box-shadow: var(--ui-shadow);
}

.auth-card {
  border: 0;
  border-radius: var(--ui-radius-xl);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--ui-shadow);
}

.segmented {
  border-radius: 999px;
  background: #f0f1f2;
}

.segment.active {
  border-radius: 999px;
  color: #fff;
  background: var(--ui-ink);
}

.pair-card,
.friendly-card,
.guided-card,
.focus-banner {
  border: 0;
  border-radius: var(--ui-radius-xl);
  box-shadow: var(--ui-shadow);
}

body.landing-page {
  padding: 20px;
}

.landing {
  width: min(1050px, 100%);
}

.landing-hero {
  overflow: hidden;
  border-radius: 36px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.82), transparent 22%),
    linear-gradient(145deg, #fff2bf, #f9dfb4);
  box-shadow: var(--ui-shadow);
}

.landing-actions .button,
.platform-card .button {
  border-radius: 999px;
}

.platform-card {
  border: 0;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--ui-shadow);
}

@media (max-width: 760px) {
  body.parent-page .topbar,
  body.child-page .topbar {
    width: calc(100% - 20px);
    padding: 10px 2px;
  }

  body.parent-page .app-shell,
  body.child-page .child-shell {
    padding: 8px 12px 112px;
  }

  .profile-hero {
    padding: 10px 2px 15px;
  }

  .profile-avatar {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .profile-copy h1 {
    font-size: 26px;
  }

  .dashboard-tabs {
    margin-bottom: 14px;
  }

  .dashboard-tabs a {
    min-width: 72px;
    padding: 11px 15px;
  }

  .feature-grid,
  .parent-summary-grid {
    gap: 11px;
  }

  .feature-card {
    min-height: 174px;
    padding: 17px;
  }

  .feature-card small {
    top: 75px;
    left: 17px;
  }

  .feature-card h2 {
    right: 52px;
    bottom: 42px;
    left: 17px;
    font-size: 20px;
  }

  .feature-card p {
    right: 50px;
    bottom: 19px;
    left: 17px;
    font-size: 9px;
  }

  .feature-star {
    top: 15px;
    left: 15px;
  }

  .feature-icon {
    top: 15px;
    right: 15px;
  }

  .dashboard-calendar,
  .recent-learning,
  .learning-section,
  .panel,
  .ai-tutor-card,
  .homework-card {
    padding: 18px;
    border-radius: 27px;
  }

  .section-title-row h2 {
    font-size: 21px;
  }

  .summary-card {
    min-height: 138px;
    padding: 15px;
    border-radius: 26px;
  }

  .summary-card strong {
    font-size: 17px;
  }

  .parent-page .panel {
    margin-top: 0;
  }

  .app-bottom-nav {
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    display: flex;
    justify-content: space-around;
    width: auto;
    max-width: none;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 16px 38px rgba(20, 25, 32, 0.14);
    transform: none;
    backdrop-filter: blur(18px);
  }

  .app-bottom-nav a {
    flex: 1;
    padding: 3px 2px;
    border-radius: 18px;
    background: transparent;
  }

  .app-bottom-nav a span {
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #656970;
    background: #fff;
    font-size: 17px;
  }

  .app-bottom-nav a:first-child span {
    width: 48px;
    height: 48px;
    margin-top: -4px;
    color: #fff;
    background: var(--ui-ink);
  }

  .app-bottom-nav a small {
    margin-top: 2px;
    color: #676b72;
    font-size: 9px;
  }

  .app-bottom-nav a:first-child small {
    color: var(--ui-ink);
    font-weight: 750;
  }

  .tutor-video-shell {
    aspect-ratio: 1 / 1.12;
  }
}

@media (max-width: 390px) {
  .feature-grid,
  .parent-summary-grid {
    gap: 9px;
  }

  .feature-card {
    min-height: 166px;
  }

  .feature-card h2 {
    font-size: 18px;
  }

  .summary-card {
    min-height: 132px;
  }

  .week-day strong {
    width: 31px;
    height: 31px;
  }
}

/* Compact management sections keep long parent and child pages scannable. */
.parent-page .compact-panel,
.child-page .compact-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 24px;
}

#family-panel,
#device-panel,
#homework-panel,
#connector-panel,
#study-plan,
#services-section,
#tutor-section,
#homework-section {
  scroll-margin-top: 82px;
}

.parent-page .compact-panel > .panel-heading,
.child-page .compact-panel > .panel-heading {
  min-height: 30px;
  margin: 0 0 12px;
  padding: 0 0 11px;
  border-bottom: 1px solid var(--ui-line);
}

.parent-page .compact-panel > .panel-heading h2,
.child-page .compact-panel > .panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.parent-page .compact-panel .status-pill,
.child-page .compact-panel .status-pill {
  min-height: 26px;
  padding: 5px 9px;
  font-size: 9px;
}

.parent-page .compact-panel .muted,
.child-page .compact-panel .muted {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
}

.parent-page .compact-panel .inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.parent-page .compact-panel .inline-form label {
  min-width: 0;
  color: #676b72;
  font-size: 10px;
}

.parent-page .compact-panel .inline-form input {
  min-height: 40px;
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 13px;
}

.parent-page .compact-panel .inline-form .button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 13px;
  white-space: nowrap;
}

.parent-page .compact-panel .button,
.child-page .compact-panel .button {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 13px;
  font-size: 11px;
}

.parent-page .compact-panel .text-button,
.child-page .compact-panel .text-button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 11px;
}

.parent-page .compact-panel .empty-state,
.child-page .compact-panel .empty-state {
  min-height: 48px;
  margin-top: 9px;
  padding: 12px;
  border-radius: 14px;
  font-size: 10px;
  line-height: 1.45;
}

.parent-page .compact-panel .card-list,
.parent-page .compact-panel .homework-list,
.child-page .compact-panel .homework-list {
  gap: 8px;
  margin-top: 10px;
}

.parent-page .compact-panel .device-card,
.parent-page .compact-panel .connector-card,
.parent-page .compact-panel .homework-card,
.child-page .compact-panel .homework-card {
  padding: 12px;
  border-radius: 16px;
}

.parent-page .compact-panel .wechat-import-card {
  padding: 12px;
  border-radius: 18px;
}

.parent-page .compact-panel .wechat-import-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.parent-page .compact-panel .wechat-import-card .heading-actions {
  gap: 7px;
}

.parent-page .compact-panel .wechat-import-card .button {
  min-height: 36px;
  padding: 7px 12px;
}

.parent-page .compact-panel details {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  background: #f7f7f8;
}

.parent-page .compact-panel details > summary {
  font-size: 11px;
}

.parent-page .compact-panel .connector-form,
.parent-page .compact-panel .family-create-form {
  gap: 9px;
  margin-top: 10px;
}

.parent-page .compact-panel label {
  font-size: 11px;
}

.parent-page .compact-panel input,
.parent-page .compact-panel select,
.parent-page .compact-panel textarea,
.child-page .compact-panel input,
.child-page .compact-panel select,
.child-page .compact-panel textarea {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 13px;
  font-size: 12px;
}

.child-page .compact-panel .service-grid {
  gap: 9px;
}

.child-page .compact-panel .service-card {
  min-height: 90px;
  padding: 13px;
  border-radius: 17px;
}

.child-page .compact-panel .service-card h3 {
  font-size: 13px;
}

.child-page .compact-panel .service-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 19px;
}

.child-page .compact-panel .homework-form {
  gap: 10px;
}

@media (max-width: 760px) {
  .parent-page .compact-panel,
  .child-page .compact-panel {
    margin-top: 10px;
    padding: 14px;
    border-radius: 22px;
  }

  .parent-page .compact-panel > .panel-heading,
  .child-page .compact-panel > .panel-heading {
    margin-bottom: 10px;
    padding-bottom: 9px;
  }

  .parent-page .compact-panel > .panel-heading h2,
  .child-page .compact-panel > .panel-heading h2 {
    font-size: 17px;
  }

  .parent-page .compact-panel .inline-form {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .parent-page .compact-panel .inline-form .button {
    padding-inline: 10px;
  }
}

/* r65 hierarchical child navigation */
.child-page {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.96), transparent 34rem),
    #f3f4f5;
}

.child-shell {
  max-width: 760px;
  padding-top: 18px;
}

.child-home-header {
  margin: 2px 0 22px;
  gap: 14px;
}

.child-home-header[hidden] {
  display: none !important;
}

#child-avatar.profile-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  color: #4c342f;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(145deg, #ffd9cc, #f7b7a5);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.05em;
}

.child-home-header h1 {
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 760;
}

.child-home-header p {
  margin-top: 3px;
  color: #77777d;
  font-size: 12px;
}

.child-home-header .round-button {
  position: relative;
  width: 48px;
  height: 48px;
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.child-home-header .round-button .nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
}

.child-home-tabs {
  display: flex;
  gap: 9px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding: 1px;
  scrollbar-width: none;
}

.child-home-tabs::-webkit-scrollbar {
  display: none;
}

.child-home-tabs button {
  min-height: 48px;
  flex: 0 0 auto;
  padding: 10px 24px;
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 999px;
  color: #707077;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 680;
}

.child-home-tabs button.active {
  color: #fff;
  background: #171719;
}

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

.child-menu-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 192px;
  overflow: hidden;
  padding: 18px;
  border: 0;
  border-radius: 27px;
  color: #171719;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 150ms ease, filter 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.child-menu-card:active {
  filter: brightness(0.97);
  transform: scale(0.985);
}

.child-menu-card.menu-yellow {
  background: linear-gradient(145deg, #ffe7a7, #ffd98a);
}

.child-menu-card.menu-mint {
  background: linear-gradient(145deg, #d4ece5, #bdddd4);
}

.child-menu-card.menu-lavender {
  background: linear-gradient(145deg, #e1d2f6, #d1bce9);
}

.child-menu-card.menu-pink {
  background: linear-gradient(145deg, #fbd2e4, #f5bdd5);
}

.child-menu-card.menu-peach {
  background: linear-gradient(145deg, #ffddbe, #f8c99d);
}

.child-menu-card.menu-sky {
  background: linear-gradient(145deg, #ccecff, #b8ddf7);
}

.child-menu-card.menu-blue {
  background: linear-gradient(145deg, #d7e7ff, #bdd7fb);
}

.child-menu-card.menu-wide {
  grid-column: 1 / -1;
  min-height: 142px;
}

.menu-star {
  position: absolute;
  top: 15px;
  left: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  font-size: 19px;
  line-height: 1;
}

.menu-icon {
  position: absolute;
  top: 7px;
  right: 15px;
  color: rgba(23, 23, 25, 0.14);
  font-size: 58px;
  font-weight: 820;
  line-height: 1;
  transform: rotate(-7deg);
}

.menu-copy {
  display: grid;
  min-height: 156px;
  align-content: end;
  padding: 42px 44px 0 1px;
}

.menu-wide .menu-copy {
  min-height: 106px;
}

.menu-copy small {
  color: rgba(23, 23, 25, 0.56);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-copy strong {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.menu-copy > span {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(23, 23, 25, 0.62);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.menu-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #171719;
  font-size: 20px;
  line-height: 1;
}

.child-menu-card > .nav-badge {
  position: absolute;
  top: 15px;
  left: 58px;
}

.child-recent-section {
  display: grid;
  gap: 9px;
  margin-top: 30px;
}

.child-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px 3px;
}

.child-section-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.child-section-heading button {
  padding: 5px 0;
  border: 0;
  color: #67676d;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.child-recent-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 13px 15px;
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 22px;
  color: #171719;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
}

.recent-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: #edf1f3;
  font-size: 18px;
}

.child-recent-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.child-recent-row small {
  color: #77777d;
  font-size: 10px;
}

.child-recent-row strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-recent-row > b {
  color: #8e8e93;
  font-size: 24px;
  font-weight: 400;
}

.child-back-button {
  position: sticky;
  z-index: 15;
  top: calc(56px + env(safe-area-inset-top));
  width: fit-content;
  min-height: 40px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.child-learning-page .service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.child-learning-page .service-card {
  min-height: 148px;
  border: 0;
  border-radius: 23px;
  background: #f3f4f5;
}

.ai-query-actions .button.is-recording {
  color: #fff;
  background: #ff3b30;
  animation: ai-query-recording 1.2s ease-in-out infinite;
}

@keyframes ai-query-recording {
  0%,
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.26); }
  50% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
}

@media (max-width: 760px) {
  .child-shell {
    width: min(100% - 24px, 760px);
    padding-top: 12px;
  }

  .child-home-header {
    margin-bottom: 18px;
  }

  .child-home-tabs {
    margin-bottom: 14px;
  }

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

  .child-menu-card {
    min-height: 180px;
    padding: 16px;
    border-radius: 24px;
  }

  .child-menu-card.menu-wide {
    min-height: 132px;
  }

  .menu-copy {
    min-height: 146px;
  }

  .menu-wide .menu-copy {
    min-height: 96px;
  }

  .menu-copy strong {
    font-size: 20px;
  }

  .menu-arrow {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 360px) {
  .child-menu-grid {
    gap: 8px;
  }

  .child-menu-card {
    min-height: 170px;
    padding: 14px;
  }

  .menu-copy strong {
    font-size: 18px;
  }

  .menu-copy > span {
    font-size: 10px;
  }
}

/* r68: one-level home cards, one compact secondary page on both apps. */
.compact-action-button {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  color: #45474d;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.compact-action-button > span {
  font-size: 17px;
  line-height: 1;
}

.compact-action-label {
  font: inherit;
}

.compact-action-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.compact-action-button.is-refreshing > span {
  animation: compact-action-spin 850ms linear infinite;
}

.child-home-header .compact-action-button {
  flex: 0 0 auto;
}

.child-home-header .compact-action-button .nav-badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

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

.parent-home {
  margin-top: 20px;
}

.parent-home .parent-summary-grid {
  gap: 12px;
  margin: 0;
}

.parent-home .summary-card {
  display: block;
  min-height: 176px;
  padding: 18px;
  border: 0;
  border-radius: 27px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 150ms ease, filter 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.parent-home .summary-card:active {
  filter: brightness(0.97);
  transform: scale(0.985);
}

.parent-home .summary-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  font-weight: 760;
}

.parent-home .summary-card small,
.parent-home .summary-card strong,
.parent-home .summary-card > span:not(.summary-icon):not(.parent-card-arrow) {
  display: block;
}

.parent-home .summary-card small {
  margin-top: 76px;
  color: rgba(23, 23, 25, 0.54);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.parent-home .summary-card strong {
  margin-top: 2px;
  color: #171719;
  font-size: 21px;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.parent-home .summary-card > span:not(.summary-icon):not(.parent-card-arrow) {
  margin-top: 5px;
  padding-right: 42px;
  color: rgba(23, 23, 25, 0.6);
  font-size: 11px;
  line-height: 1.4;
}

.parent-home .parent-card-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #171719;
  font-size: 20px;
}

.parent-home .parent-summary-wide {
  grid-column: 1 / -1;
  min-height: 142px;
}

.parent-home .parent-summary-wide small {
  margin-top: 46px;
}

.parent-operations {
  display: block;
  margin-top: 0;
}

.parent-operations .compact-panel {
  width: 100%;
  margin: 0;
  padding: 22px;
  border-radius: 27px;
}

.parent-back-button {
  position: sticky;
  z-index: 15;
  top: calc(56px + env(safe-area-inset-top));
  width: fit-content;
  min-height: 40px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row,
.settings-action {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 18, 20, 0.055);
  border-radius: 19px;
  color: var(--ui-ink);
  background: #f8f8f9;
  font: inherit;
  text-align: left;
}

.settings-row > span,
.settings-action small {
  color: #73757b;
  font-size: 11px;
}

.settings-row strong {
  font-size: 13px;
  font-weight: 680;
}

.settings-action {
  cursor: pointer;
}

.settings-action > span {
  display: grid;
  gap: 2px;
}

.settings-action b {
  font-size: 14px;
  font-weight: 720;
}

.settings-action > strong {
  color: #777980;
  font-size: 22px;
  font-weight: 450;
}

.settings-action.danger b,
.settings-action.danger > strong {
  color: #c53a33;
}

.child-settings-disclosure {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}

.child-settings-disclosure > summary {
  padding: 17px 18px;
  font-size: 15px;
  font-weight: 740;
}

.child-settings-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.child-settings-body .guided-card {
  margin: 0;
}

.tutor-live-transcript {
  display: grid;
  gap: 8px;
  margin-top: 13px;
  padding: 15px 17px;
  border: 1px solid rgba(17, 18, 20, 0.055);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(20, 24, 30, 0.055);
}

.tutor-live-transcript-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #686970;
  font-size: 11px;
  font-weight: 720;
}

.tutor-live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30a46c;
  box-shadow: 0 0 0 0 rgba(48, 164, 108, 0.3);
  animation: tutor-live-pulse 1.25s ease-out infinite;
}

#tutor-section[data-live-state="speaking"] .tutor-live-pulse,
#tutor-section[data-live-state="thinking"] .tutor-live-pulse {
  background: #7b61d1;
  animation-name: tutor-live-thinking;
}

#tutor-live-transcript-text {
  min-height: 42px;
  margin: 0;
  color: #1b1c1f;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.55;
  letter-spacing: -0.015em;
}

.tutor-correction {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  color: #6f4b00;
  background: #fff4ce;
  font-size: 12px;
  line-height: 1.5;
}

.tutor-correction strong {
  display: block;
  margin-bottom: 2px;
  color: #4f3500;
}

@keyframes tutor-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 164, 108, 0.34); }
  100% { box-shadow: 0 0 0 9px rgba(48, 164, 108, 0); }
}

@keyframes tutor-live-thinking {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 760px) {
  .parent-home {
    margin-top: 16px;
  }

  .parent-home .summary-card {
    min-height: 168px;
    padding: 16px;
    border-radius: 24px;
  }

  .parent-home .summary-card small {
    margin-top: 72px;
  }

  .parent-home .summary-card strong {
    font-size: 19px;
  }

  .parent-home .parent-summary-wide {
    min-height: 132px;
  }

  .parent-home .parent-summary-wide small {
    margin-top: 40px;
  }

  .parent-operations .compact-panel {
    padding: 18px;
    border-radius: 24px;
  }
}

/* r68: keep one clear bottom navigation and add account-level child switching. */
.parent-page .app-shell {
  padding-bottom: 126px;
}

.parent-bottom-nav button {
  position: relative;
  display: grid;
  flex: 1;
  min-width: 0;
  place-items: center;
  padding: 7px 4px 5px;
  border: 0;
  border-radius: 16px;
  color: #77777c;
  background: transparent;
  cursor: pointer;
}

.parent-bottom-nav button.active {
  color: #1d1d1f;
  background: #e9e9ed;
}

.parent-bottom-nav button > span {
  font-size: 17px;
  line-height: 1;
}

.parent-bottom-nav button > small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 650;
}

.parent-child-switcher {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.child-switcher-toggle {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(24, 29, 36, 0.06);
}

.child-switcher-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #24303a;
  background: linear-gradient(145deg, #f6d8ce, #f9e7c7);
  font-size: 13px;
  font-weight: 800;
}

.child-switcher-copy {
  display: grid;
  max-width: 92px;
  text-align: left;
}

.child-switcher-copy small {
  color: var(--ui-muted);
  font-size: 9px;
  line-height: 1.2;
}

.child-switcher-copy b {
  overflow: hidden;
  margin-top: 1px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-switcher-chevron {
  color: #76777c;
  font-size: 15px;
}

.child-switcher-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid rgba(20, 25, 32, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 54px rgba(20, 25, 32, 0.18);
  backdrop-filter: blur(20px);
}

.child-switcher-list {
  display: grid;
  gap: 5px;
}

.child-switcher-option,
.add-child-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 15px;
  color: var(--ui-ink);
  background: transparent;
  text-align: left;
}

.child-switcher-option:hover,
.add-child-button:hover,
.child-switcher-option.active {
  background: #f1f2f4;
}

.child-switcher-option .child-switcher-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.child-switcher-option span:last-child,
.add-child-button span:last-child {
  display: grid;
  min-width: 0;
}

.child-switcher-option b,
.add-child-button b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-switcher-option small,
.add-child-button small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ui-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-switcher-option em {
  margin-left: auto;
  color: #2b8a57;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.add-child-button {
  margin-top: 5px;
  border-top: 1px solid var(--ui-line);
  border-radius: 0 0 15px 15px;
}

.add-child-button > span:first-child {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #1d1d1f;
  font-size: 20px;
}

.add-child-card {
  width: min(520px, calc(100% - 28px));
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

.add-child-card form {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .parent-profile-hero {
    flex-wrap: wrap;
  }

  .parent-profile-hero .profile-copy {
    flex-basis: calc(100% - 76px);
  }

  .parent-child-switcher {
    order: 4;
    width: calc(100% - 76px);
    margin-left: 66px;
  }

  .child-switcher-toggle {
    width: 100%;
  }

  .child-switcher-copy {
    max-width: none;
    flex: 1;
  }

  .child-switcher-menu {
    right: auto;
    left: 0;
    width: min(360px, calc(100vw - 54px));
  }

  .parent-profile-hero .profile-actions {
    order: 3;
  }
}

/* r69: compact account controls and a predictable six-item parent navigation. */
.parent-bottom-nav {
  max-width: 440px;
}

/* r77: one-tap handoff between the parent and child apps on the same phone. */
.same-phone-switch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(17, 18, 20, 0.06);
  border-radius: 20px;
  color: var(--ui-ink);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.9), transparent 38%),
    #dff4ee;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.same-phone-switch > span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #28695a;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.same-phone-switch > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-phone-switch > b {
  color: #28695a;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.same-phone-switch:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 420px) {
  .same-phone-switch {
    grid-template-columns: 1fr auto;
  }

  .same-phone-switch > span {
    display: none;
  }
}

.mistake-insight-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 104, 89, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.mistake-insight-summary strong {
  color: #203e38;
  font-size: 18px;
  font-weight: 780;
}

.mistake-insight-summary span {
  color: #71817c;
  font-size: 11px;
  line-height: 1.55;
}

.mistake-subject-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mistake-subject-chart {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(35, 104, 89, 0.075);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.mistake-subject-chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mistake-subject-chart-heading strong {
  color: #245f55;
  font-size: 13px;
}

.mistake-subject-chart-heading span {
  color: #77847f;
  font-size: 10px;
}

.mistake-subject-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.mistake-subject-chart-line {
  fill: none;
  stroke: #2f7d70;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.mistake-subject-chart-dot {
  fill: #fff;
  stroke: #2f7d70;
  stroke-width: 2.5;
}

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

.mistake-insight-row {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px solid rgba(35, 104, 89, 0.075);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
}

.mistake-insight-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mistake-insight-row strong {
  color: #245f55;
  font-size: 13px;
}

.mistake-insight-row span {
  color: #81908b;
  font-size: 10px;
}

.mistake-insight-row p {
  margin: 0;
  color: #41534d;
  font-size: 12px;
  line-height: 1.6;
}

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

.mistake-mastery-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(35, 104, 89, 0.075);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.mistake-mastery-card > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mistake-mastery-card strong {
  color: #245f55;
  font-size: 14px;
}

.mistake-mastery-card b {
  color: #203e38;
  font-size: 18px;
}

.mistake-mastery-card small {
  color: #788781;
  font-size: 10px;
}

@media (max-width: 680px) {
  .mistake-subject-chart-grid,
  .mistake-mastery-grid {
    grid-template-columns: 1fr;
  }
}

/* r77: automatic mistake book shared by the child and parent apps. */
.child-menu-card.menu-teal {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.92), transparent 30%),
    #d9f0e9;
}

.summary-coral {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.84), transparent 32%),
    #f6dcd2;
}

.mistake-panel {
  display: grid;
  gap: 16px;
}

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

.mistake-stat {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  gap: 5px;
  padding: 15px;
  border: 1px solid rgba(17, 18, 20, 0.055);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(20, 24, 30, 0.04);
}

.mistake-stat small {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 700;
}

.mistake-stat strong {
  color: var(--ui-ink);
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.mistake-stat span {
  color: var(--ui-muted);
  font-size: 10px;
}

.mistake-subject-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scrollbar-width: none;
}

.mistake-settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(17, 18, 20, 0.055);
  border-radius: 22px;
  background: #eef5f2;
}

.mistake-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mistake-settings-heading > div {
  display: grid;
  gap: 3px;
}

.mistake-settings-heading strong {
  color: var(--ui-ink);
  font-size: 14px;
}

.mistake-settings-heading small {
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.45;
}

.mistake-practice-settings {
  display: grid;
  gap: 8px;
}

.mistake-practice-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.mistake-practice-setting-row > span {
  display: grid;
  gap: 2px;
}

.mistake-practice-setting-row strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.mistake-practice-setting-row small {
  color: var(--ui-muted);
  font-size: 10px;
}

.mistake-practice-setting-row select {
  min-width: 84px;
  padding: 7px 30px 7px 11px;
  border: 1px solid rgba(17, 18, 20, 0.08);
  border-radius: 999px;
  color: var(--ui-ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.mistake-subject-strip::-webkit-scrollbar {
  display: none;
}

.mistake-subject-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid rgba(17, 18, 20, 0.07);
  border-radius: 999px;
  color: #5d6067;
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.mistake-subject-chip.active {
  color: #fff;
  background: #1d1e21;
}

.mistake-list {
  display: grid;
  gap: 12px;
}

.mistake-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(17, 18, 20, 0.055);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(20, 24, 30, 0.045);
}

.mistake-card-header,
.mistake-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mistake-card-header {
  justify-content: space-between;
}

.mistake-card-title {
  flex: 1 1 auto;
  min-width: 0;
}

.mistake-card-title strong {
  min-width: 0;
  color: var(--ui-ink);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.mistake-subject-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #9a453b;
  background: #fde4df;
  font-size: 11px;
  font-weight: 760;
}

.mistake-answer-pair {
  display: grid;
  gap: 8px;
}

.mistake-answer {
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mistake-answer.wrong {
  color: #7b403a;
  background: #fff0ed;
}

.mistake-answer.correct {
  color: #225f50;
  background: #e7f6f1;
}

.mistake-explanation {
  margin: 0;
  color: #666970;
  font-size: 13px;
  line-height: 1.55;
}

.mistake-practice {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 18px;
  background: #f4f5f8;
}

.mistake-practice > strong {
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 760;
}

.mistake-practice-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  color: #55585f;
  font-size: 12px;
  line-height: 1.55;
}

.mistake-practice .button {
  justify-self: start;
}

@media (min-width: 720px) {
  .mistake-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.parent-profile-hero .profile-actions {
  align-items: center;
  gap: 7px;
}

.parent-child-switcher {
  margin-left: 0;
}

.compact-child-switcher {
  min-height: 38px;
  gap: 6px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  box-shadow: none;
}

.compact-child-switcher .child-switcher-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.compact-child-switcher .child-switcher-copy small {
  display: none;
}

.compact-child-switcher .child-switcher-copy b {
  display: block;
  max-width: 74px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-child-switcher .child-switcher-chevron {
  margin-left: 1px;
  font-size: 12px;
}

.parent-summary-grid .parent-card-arrow {
  display: none;
}

.parent-account-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 16px 0 18px;
  padding: 15px;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.parent-account-summary > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.parent-account-summary small,
.parent-account-summary em {
  color: var(--ui-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.parent-account-summary strong {
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .parent-profile-hero .profile-actions {
    order: 3;
    width: auto;
    margin-left: auto;
  }

  .parent-child-switcher {
    order: initial;
    width: auto;
    margin-left: 0;
  }

  .compact-child-switcher {
    width: auto;
  }

  .child-switcher-menu {
    right: 0;
    left: auto;
    width: min(340px, calc(100vw - 32px));
  }
}

/* r77: unified controls, textbook focus, and parent activity brief. */
.child-parent-return {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(23, 23, 25, 0.1);
  border-radius: 999px;
  color: #fff;
  background: #171719;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.child-back-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.child-menu-card.menu-sand {
  background: #f2ead7;
}

.ai-query-attach svg,
.ai-query-mic svg,
.ai-query-send svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-query-attach,
.ai-query-mic,
.ai-query-send {
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.ai-query-attach:active,
.ai-query-mic:active,
.ai-query-send:active {
  transform: scale(0.94);
}

.ai-query-mic {
  color: #fff;
  background: #171719;
}

.ai-query-mic .stop-icon,
.ai-query-mic .processing-dot {
  display: none;
}

.ai-query-mic[data-state="recording"] {
  color: #171719;
  background: #fff;
  box-shadow: inset 0 0 0 2px #f25f5c;
  animation: none;
}

.ai-query-mic[data-state="recording"] .mic-icon {
  display: none;
}

.ai-query-mic[data-state="recording"] .stop-icon {
  display: block;
  color: #f25f5c;
  fill: currentColor;
  stroke: none;
}

.ai-query-mic[data-state="processing"] {
  color: #171719;
  background: #ececef;
  animation: none;
}

.ai-query-mic[data-state="processing"] .mic-icon,
.ai-query-mic[data-state="processing"] .stop-icon {
  display: none;
}

.ai-query-mic[data-state="processing"] .processing-dot {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 23, 25, 0.18);
  border-top-color: #171719;
  border-radius: 50%;
  animation: r77-spin 700ms linear infinite;
}

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

.homework-image-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(23, 23, 25, 0.1);
  border-radius: 18px;
  background: #f5f5f7;
}

.homework-image-picker > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.homework-image-picker strong {
  font-size: 13px;
}

.homework-image-picker span {
  overflow: hidden;
  color: #777a80;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.textbook-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}

.textbook-toolbar label {
  display: grid;
  min-width: 150px;
  gap: 6px;
  color: #777a80;
  font-size: 11px;
  font-weight: 700;
}

.textbook-toolbar select {
  min-height: 42px;
  padding: 0 36px 0 13px;
  border: 1px solid rgba(23, 23, 25, 0.1);
  border-radius: 13px;
  color: #171719;
  background: #fff;
  font: inherit;
  font-weight: 720;
}

.textbook-subject-tabs {
  display: flex;
  gap: 7px;
}

.textbook-subject-tabs button {
  min-width: 62px;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #666a70;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.textbook-subject-tabs button.active {
  color: #fff;
  background: #171719;
}

.textbook-focus-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 26px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.72), transparent 13rem),
    #f2ead7;
}

.textbook-focus-card h3 {
  margin: 6px 0 7px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.045em;
}

.textbook-focus-card p {
  max-width: 720px;
  margin: 0;
  color: #666158;
}

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

.textbook-key-points > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.textbook-key-points span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 50%;
  color: #fff;
  background: #171719;
  font-size: 11px;
  font-weight: 760;
}

.textbook-key-points p {
  color: #171719;
  font-size: 13px;
  font-weight: 680;
}

.parent-unlock-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 16, 18, 0.45);
  backdrop-filter: blur(12px);
}

.parent-unlock-card {
  display: grid;
  width: min(390px, 100%);
  gap: 13px;
  padding: 24px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

.parent-unlock-card h2,
.parent-unlock-card p {
  margin: 0;
}

.parent-unlock-card p {
  color: #777a80;
  font-size: 12px;
}

.parent-unlock-card input {
  margin-top: 7px;
  text-align: center;
  font-size: 23px;
  font-weight: 760;
  letter-spacing: 0.25em;
}

.parent-unlock-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 9px;
}

.summary-card.summary-sage {
  background: #dfeee7;
}

#parent-activity-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.activity-brief-summary {
  margin: 18px 0;
  padding: 18px;
  border-radius: 20px;
  background: #edf6f1;
}

.activity-brief-summary strong {
  display: block;
  margin-bottom: 7px;
}

.activity-brief-summary p {
  margin: 0;
  color: #43524b;
  line-height: 1.7;
}

.activity-brief-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.activity-brief-stats article {
  display: grid;
  gap: 4px;
  padding: 15px;
  border: 1px solid rgba(23, 23, 25, 0.08);
  border-radius: 18px;
  background: #fff;
}

.activity-brief-stats small {
  color: #7b7e84;
  font-size: 10px;
}

.activity-brief-stats strong {
  font-size: 18px;
}

.activity-date-input {
  width: auto;
  min-width: 142px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(37, 78, 67, 0.14);
  border-radius: 999px;
  color: #36594f;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.activity-view-list,
.activity-query-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.activity-view-row {
  display: grid;
  gap: 9px;
  padding: 14px 15px;
  border-radius: 16px;
  background: #f5f5f7;
}

.activity-view-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-view-copy span {
  color: #777a80;
  font-size: 11px;
}

.activity-view-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e4e7;
}

.activity-view-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #73a893;
}

.practice-feedback-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.practice-feedback-card {
  display: grid;
  gap: 11px;
  padding: 17px;
  border: 1px solid rgba(43, 91, 79, 0.08);
  border-radius: 20px;
  background: linear-gradient(145deg, #f8faf9, #eef6f2);
}

.practice-feedback-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.practice-feedback-card header div {
  display: grid;
  gap: 3px;
}

.practice-feedback-card header span,
.practice-feedback-card time {
  color: #78837f;
  font-size: 11px;
}

.practice-feedback-card h3 {
  margin: 0;
  font-size: 17px;
}

.practice-feedback-prompt,
.practice-feedback-answer {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  color: #46524d;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
  white-space: pre-wrap;
}

.practice-feedback-prompt {
  color: #67736e;
  font-size: 12px;
}

.practice-feedback-answer {
  border: 1px solid rgba(44, 110, 92, 0.08);
}

.practice-feedback-card img {
  width: 100%;
  max-height: 320px;
  border-radius: 15px;
  object-fit: contain;
  background: #fff;
}

.practice-feedback-card audio {
  width: 100%;
}

.practice-subject-strip {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scrollbar-width: none;
}

.practice-subject-strip::-webkit-scrollbar {
  display: none;
}

.practice-subject-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(23, 23, 25, 0.08);
  border-radius: 999px;
  color: #696d73;
  background: #f2f3f4;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
}

.practice-subject-chip.active {
  color: #fff;
  border-color: #315f52;
  background: #315f52;
}

.practice-grade-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.practice-grade-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: #53635d;
  background: #e5ece8;
  font-size: 11px;
  font-weight: 700;
}

.practice-grade-pill.completed {
  color: #176347;
  background: #d9eee4;
}

.practice-grade-pill.failed,
.practice-grade-pill.needs_text {
  color: #8a3d35;
  background: #f7e2df;
}

.practice-feedback-overall,
.practice-feedback-transcript {
  margin: 0;
  color: #4e5b56;
  line-height: 1.65;
  white-space: pre-wrap;
}

.practice-corrections {
  display: grid;
  gap: 9px;
}

.practice-correction {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 3px solid #d28b78;
  border-radius: 4px 14px 14px 4px;
  background: #fff8f5;
}

.practice-correction strong {
  font-size: 12px;
}

.practice-correction span,
.practice-correction p {
  margin: 0;
  color: #6a625f;
  font-size: 12px;
  line-height: 1.55;
}

.practice-suggestions {
  margin: 0;
  padding-left: 20px;
  color: #5b6661;
  font-size: 12px;
  line-height: 1.65;
}

.activity-query-card {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(23, 23, 25, 0.08);
  border-radius: 18px;
  background: #fff;
}

.activity-query-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.activity-query-heading time {
  flex: 0 0 auto;
  color: #85888e;
  font-size: 10px;
}

.activity-query-card p {
  margin: 0;
  color: #64676d;
  font-size: 12px;
  line-height: 1.6;
}

.activity-query-tag {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #477b69;
  background: #edf6f1;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .child-parent-return {
    padding: 0 10px;
  }

  .textbook-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .textbook-subject-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .textbook-key-points,
  .activity-brief-stats {
    grid-template-columns: 1fr;
  }

  .homework-image-picker {
    align-items: stretch;
    flex-direction: column;
  }
}

/* r78: soft product controls, real textbook hierarchy, and region-ready catalogs. */
.child-parent-return {
  min-height: 36px;
  padding: 0 14px;
  border-color: rgba(35, 104, 89, 0.14);
  color: #28695a;
  background: #dff4ee;
  box-shadow: 0 7px 20px rgba(35, 104, 89, 0.08);
}

.child-parent-return:active {
  background: #d1ece4;
}

/* r96-3n: keep the system phone reachable from every child view. */
.child-call-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid rgba(35, 104, 89, 0.14);
  border-radius: 999px;
  color: #fff;
  background: #2f7d70;
  box-shadow: 0 7px 20px rgba(35, 104, 89, 0.12);
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.child-call-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.child-call-button:active {
  transform: scale(0.96);
  background: #286b60;
}

/* r96-3o: iOS cannot dial an empty tel: URL, so web uses a real number pad. */
.phone-dialer-backdrop {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 16px 12px 0;
  background: rgba(15, 25, 22, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.phone-dialer-card {
  display: grid;
  width: min(430px, 100%);
  max-height: calc(100dvh - 16px);
  gap: 12px;
  overflow-y: auto;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  color: #173f37;
  background: #fff;
  box-shadow: 0 -20px 60px rgba(11, 42, 35, 0.22);
  overscroll-behavior: contain;
}

.phone-dialer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.phone-dialer-header h2,
.phone-dialer-help,
.phone-dialer-status {
  margin: 0;
}

.phone-dialer-header h2 {
  margin-top: 3px;
  font-size: 24px;
}

.phone-dialer-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #47665e;
  background: #edf5f2;
  font: inherit;
  font-size: 25px;
  line-height: 1;
}

.phone-dialer-help {
  color: #6d7b76;
  font-size: 12px;
  line-height: 1.55;
}

.phone-dialer-input {
  width: 100%;
  min-height: 62px;
  padding: 0 14px;
  border: 1px solid rgba(31, 83, 72, 0.13);
  border-radius: 18px;
  outline: 0;
  color: #173f37;
  background: #f5faf8;
  font: inherit;
  font-size: clamp(24px, 8vw, 31px);
  font-weight: 760;
  letter-spacing: 0.04em;
  text-align: center;
}

.phone-dialer-input:focus {
  border-color: rgba(35, 104, 89, 0.44);
  box-shadow: 0 0 0 3px rgba(47, 125, 112, 0.11);
}

.phone-dialer-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.phone-dialer-keypad button,
.phone-dialer-backspace {
  min-height: 52px;
  border: 1px solid rgba(31, 83, 72, 0.08);
  border-radius: 17px;
  color: #244e45;
  background: #f2f7f5;
  font: inherit;
  font-size: 21px;
  font-weight: 720;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.phone-dialer-keypad button:active,
.phone-dialer-backspace:active {
  transform: scale(0.96);
  background: #e3efeb;
}

.phone-dialer-status {
  min-height: 18px;
  color: #7a8581;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.phone-dialer-status.error {
  color: #b44e47;
}

.phone-dialer-actions {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.phone-dialer-backspace {
  display: grid;
  place-items: center;
}

.phone-dialer-call {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  color: #fff;
  background: #2f7d70;
  box-shadow: 0 10px 24px rgba(35, 104, 89, 0.18);
  font-size: 16px;
  font-weight: 760;
  text-decoration: none;
  touch-action: manipulation;
}

.phone-dialer-call:active {
  transform: scale(0.98);
  background: #286b60;
}

.phone-dialer-call.is-disabled {
  color: #86938f;
  background: #e7eeeb;
  box-shadow: none;
  pointer-events: none;
}

@media (min-width: 700px) {
  .phone-dialer-backdrop {
    align-items: center;
    padding: 22px;
  }

  .phone-dialer-card {
    border-radius: 28px;
  }
}

@media (max-width: 390px) {
  .child-call-button {
    width: 36px;
    padding: 0;
  }

  .child-call-button span {
    display: none;
  }
}

.child-menu-card .menu-arrow,
.menu-arrow {
  display: none !important;
}

.child-menu-card .menu-copy {
  padding-right: 4px;
}

.ai-chat-message.user > div {
  color: #173f37;
  background: #d9eee8;
}

.ai-chat-message.user .ai-chat-avatar {
  color: #28695a;
  background: #cbe8df;
}

.ai-query-language {
  color: #526a65;
  background: #edf5f2;
}

.ai-query-language[data-language="en"] {
  color: #28695a;
  background: #dff4ee;
  box-shadow: inset 0 0 0 1px rgba(35, 104, 89, 0.12);
}

.ai-query-mic {
  color: #205f54;
  background: #d8eee8;
}

.ai-query-send {
  color: #fff;
  background: #2f7d70;
  box-shadow: 0 8px 20px rgba(47, 125, 112, 0.18);
}

.ai-query-mic[data-state="recording"] {
  color: #b9443f;
  background: #fff3f1;
}

.ai-query-mic[data-state="processing"] {
  color: #526a65;
  background: #edf5f2;
}

.ai-query-mic[data-state="processing"] .processing-dot {
  border-color: rgba(47, 125, 112, 0.18);
  border-top-color: #2f7d70;
}

.homework-choice-wheel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 2px 0;
  scroll-snap-type: none;
}

.homework-choice-wheel button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border-color: rgba(30, 82, 73, 0.09);
  color: #5f6e6a;
  background: #f1f7f5;
}

.homework-choice-wheel button.active {
  color: #245f55;
  border-color: rgba(35, 104, 89, 0.18);
  background: #d9eee8;
  box-shadow: 0 7px 18px rgba(35, 104, 89, 0.1);
}

.textbook-toolbar {
  align-items: end;
}

.textbook-toolbar select {
  color: #203e38;
  border-color: rgba(30, 82, 73, 0.1);
  background: #f7fbfa;
}

.textbook-subject-tabs {
  padding: 4px;
  border-radius: 16px;
  background: #eef5f2;
}

.textbook-subject-tabs button {
  min-height: 40px;
  color: #687671;
  background: transparent;
}

.textbook-subject-tabs button.active {
  color: #245f55;
  background: #fff;
  box-shadow: 0 6px 16px rgba(35, 104, 89, 0.09);
}

.textbook-focus-card {
  gap: 16px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.76), transparent 13rem),
    linear-gradient(145deg, #f6efdf, #eaf3ee);
}

.textbook-focus-card > .button {
  justify-self: start;
}

.textbook-key-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.textbook-unit {
  display: grid;
  gap: 9px;
}

.textbook-unit h4 {
  margin: 2px 2px 0;
  color: #52645e;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.textbook-unit-lessons {
  display: grid;
  gap: 8px;
}

.textbook-key-points .textbook-point-row {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid rgba(35, 83, 73, 0.065);
  border-radius: 17px;
  color: #233b35;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.textbook-key-points .textbook-point-row:hover,
.textbook-key-points .textbook-point-row:focus-visible {
  border-color: rgba(35, 104, 89, 0.2);
  background: #fff;
}

.textbook-key-points .textbook-point-row:active {
  transform: scale(0.99);
}

.textbook-key-points .textbook-point-row > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  color: #28695a;
  background: #dff1ec;
  font-size: 11px;
  font-weight: 780;
}

.textbook-key-points .textbook-point-row > span:last-child {
  display: grid;
  width: auto;
  height: auto;
  min-width: 0;
  flex: none;
  gap: 2px;
  border-radius: 0;
  color: inherit;
  background: transparent;
}

.textbook-point-row strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 720;
}

.textbook-point-row small {
  color: #77847f;
  font-size: 10px;
  font-weight: 550;
}

.textbook-lesson-detail {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 26px;
  background:
    radial-gradient(circle at 94% 5%, rgba(255, 255, 255, 0.9), transparent 14rem),
    linear-gradient(145deg, #f7f0df, #edf6f2);
}

.textbook-lesson-detail > .child-back-button {
  justify-self: start;
  border-color: rgba(35, 104, 89, 0.12);
  color: #28695a;
  background: rgba(255, 255, 255, 0.72);
}

.textbook-lesson-detail h3 {
  margin: 0;
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: -0.04em;
}

.textbook-lesson-goal {
  margin: 0;
  color: #58655f;
  font-size: 14px;
  line-height: 1.7;
}

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

.textbook-lesson-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(35, 83, 73, 0.07);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.78);
}

.textbook-lesson-grid h4 {
  margin: 0;
  color: #28695a;
  font-size: 13px;
}

.textbook-lesson-grid p,
.textbook-lesson-grid ul {
  margin: 0;
  color: #596760;
  font-size: 13px;
  line-height: 1.65;
}

.textbook-lesson-grid ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.textbook-lesson-practice {
  background: #dff1ec !important;
}

.textbook-practice-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(34, 92, 79, 0.1);
}

.textbook-practice-form label {
  display: grid;
  gap: 7px;
  color: #355d53;
  font-size: 12px;
  font-weight: 700;
}

.textbook-practice-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(34, 92, 79, 0.13);
  border-radius: 15px;
  outline: none;
  color: #253d37;
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 17px;
  line-height: 1.55;
}

.textbook-practice-form textarea:focus {
  border-color: rgba(35, 120, 99, 0.55);
  box-shadow: 0 0 0 3px rgba(48, 143, 118, 0.1);
}

.textbook-practice-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.textbook-practice-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
}

.textbook-practice-preview img {
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  object-fit: cover;
}

.textbook-practice-preview audio {
  width: 100%;
}

.textbook-practice-form > .button.primary {
  width: 100%;
}

.textbook-lesson-detail > .button {
  justify-self: start;
}

@media (min-width: 620px) {
  .homework-choice-wheel {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .textbook-lesson-grid {
    grid-template-columns: 1fr;
  }

  .textbook-focus-card > .button,
  .textbook-lesson-detail > .button {
    width: 100%;
  }
}

/* r78.1: subject-aware homework controls and mistake analytics. */
.homework-alert-settings-card,
.mistake-subject-manager {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(35, 83, 73, 0.075);
  border-radius: 22px;
  background: linear-gradient(145deg, #f4f8f6, #eef6f3);
}

.collapsible-settings > summary {
  cursor: pointer;
  list-style: none;
}

.collapsible-settings > summary.homework-alert-settings-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.collapsible-settings > summary #parent-homework-alert-status {
  min-width: 0;
  white-space: nowrap;
  font-size: 10px;
}

.collapsible-settings > summary::-webkit-details-marker {
  display: none;
}

.collapsible-settings > summary::after {
  content: "展开";
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: #2f7568;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 750;
}

.collapsible-settings[open] > summary::after {
  content: "收起";
}

.homework-alert-settings-body {
  display: grid;
  gap: 12px;
}

.homework-alert-settings-help {
  margin: 0;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.55;
}

.homework-alert-settings-heading,
.mistake-analysis-heading,
.mistake-trend-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.homework-alert-settings-heading > div,
.mistake-analysis-heading > div,
.mistake-subject-manager > div:first-child {
  display: grid;
  gap: 3px;
}

.homework-alert-settings-heading strong,
.mistake-analysis-heading h3,
.mistake-subject-manager strong {
  margin: 0;
  color: var(--ui-ink);
  font-size: 15px;
}

.homework-alert-settings-heading small,
.mistake-subject-manager small {
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.45;
}

.homework-alert-settings {
  display: grid;
  gap: 8px;
}

.homework-alert-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.homework-alert-setting-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.homework-alert-setting-row strong {
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-alert-setting-row small {
  color: var(--ui-muted);
  font-size: 10px;
}

.homework-alert-setting-row select {
  min-width: 96px;
  padding: 7px 30px 7px 11px;
  border: 1px solid rgba(17, 18, 20, 0.08);
  border-radius: 999px;
  color: var(--ui-ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.subject-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.subject-add-row input {
  min-width: 0;
}

.homework-accuracy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
}

.homework-accuracy-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: #29685a;
  background: #e2f2ed;
  font-size: 11px;
  font-weight: 750;
}

.homework-accuracy-pill.alert {
  color: #9b443c;
  background: #fde8e3;
}

.homework-alert-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(178, 72, 60, 0.1);
  border-radius: 14px;
  color: #8d4038;
  background: #fff1ee;
  font-size: 12px;
  line-height: 1.55;
}

.mistake-stat-action {
  width: 100%;
  border-color: rgba(35, 104, 89, 0.1);
  color: inherit;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.9), transparent 5rem),
    #e8f4f0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.mistake-stat-action::after {
  content: "查看分析 ›";
  color: #2f7568;
  font-size: 10px;
  font-weight: 750;
}

.mistake-stat-list-action::after {
  content: none;
}

.mistake-analysis-open {
  justify-self: start;
}

.mistake-stat-action[aria-expanded="true"]::after {
  content: "已展开 ⌃";
}

.mistake-analysis {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(35, 83, 73, 0.075);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% 0, rgba(255, 255, 255, 0.9), transparent 12rem),
    linear-gradient(145deg, #f2f8f5, #eef3f8);
}

.mistake-analysis[hidden] {
  display: none;
}

.mistake-analysis-heading p {
  max-width: 620px;
  margin: 4px 0 0;
  color: #6a7772;
  font-size: 11px;
  line-height: 1.55;
}

.mistake-analysis-close {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid rgba(35, 83, 73, 0.1);
  border-radius: 999px;
  color: #35695f;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.mistake-distribution {
  display: grid;
  gap: 9px;
}

.mistake-distribution-row {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid rgba(35, 83, 73, 0.065);
  border-radius: 16px;
  color: inherit;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.mistake-distribution-row:hover,
.mistake-distribution-row:focus-visible {
  background: #fff;
}

.mistake-distribution-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mistake-distribution-meta strong {
  color: #29453f;
  font-size: 13px;
}

.mistake-distribution-meta span {
  color: #6d7a76;
  font-size: 10px;
}

.mistake-distribution-meta b {
  color: #28695a;
  font-size: 13px;
}

.mistake-distribution-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecea;
}

.mistake-distribution-track i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #8cc8b9, #2f7d70);
}

.mistake-distribution-empty,
.mistake-trend-empty {
  padding: 18px 14px;
  border-radius: 16px;
  color: #6d7a76;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.mistake-trend-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(35, 83, 73, 0.065);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.mistake-trend-heading strong {
  color: #29453f;
  font-size: 13px;
}

.mistake-trend-heading span {
  color: #6d7a76;
  font-size: 10px;
}

.mistake-trend-chart {
  min-height: 150px;
}

.mistake-trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.mistake-trend-axis {
  stroke: rgba(58, 79, 73, 0.12);
  stroke-width: 1;
}

.mistake-trend-grid {
  stroke: rgba(58, 79, 73, 0.07);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.mistake-trend-line {
  fill: none;
  stroke: #2f7d70;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.mistake-trend-area {
  fill: url("#mistakeTrendFill");
  opacity: 0.72;
}

.mistake-trend-dot {
  fill: #fff;
  stroke: #2f7d70;
  stroke-width: 2.5;
}

.mistake-trend-label {
  fill: #76827e;
  font-size: 9px;
}

.mistake-trend-value {
  fill: #28695a;
  font-size: 9px;
  font-weight: 700;
}

.mistake-subject-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mistake-managed-subject {
  padding: 6px 10px;
  border-radius: 999px;
  color: #32685e;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 700;
}

.mistake-subject-chip.active {
  color: #245f55;
  border-color: rgba(35, 104, 89, 0.18);
  background: #d9eee8;
}

.child-switcher-menu {
  width: min(286px, calc(100vw - 32px));
}

.child-switcher-option small {
  display: none;
}

@media (max-width: 760px) {
  .parent-page input,
  .parent-page select,
  .parent-page textarea,
  .child-page input,
  .child-page select,
  .child-page textarea {
    font-size: 16px !important;
  }

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

  .subject-add-row .button {
    width: 100%;
  }

  .mistake-analysis-heading {
    align-items: center;
  }

  .mistake-analysis-heading p {
    font-size: 11px;
  }
}

/* r80: consistent secondary-page navigation and compact AI controls. */
.child-back-button,
.parent-back-button {
  position: static;
  z-index: auto;
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin: 8px 0 22px;
  padding: 0 14px;
  border: 1px solid rgba(35, 104, 89, 0.12);
  border-radius: 999px;
  color: #28695a;
  background: #e2f2ed;
  box-shadow: 0 7px 20px rgba(35, 104, 89, 0.07);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  vertical-align: middle;
}

.child-back-button:active,
.parent-back-button:active {
  background: #d4ebe4;
}

.textbook-lesson-detail > .child-back-button {
  background: #e2f2ed;
}

.ai-query-attach,
.ai-query-language,
.ai-query-mic,
.ai-query-send {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.ai-query-language {
  margin-left: auto;
}

.ai-query-attach svg,
.ai-query-language svg,
.ai-query-mic svg,
.ai-query-send svg {
  display: block;
  width: 19px;
  height: 19px;
  margin: auto;
}

/* r82: near-live voice, subject-first homework, compact textbook controls. */
.child-menu-card.menu-peach .menu-copy > span,
.child-menu-card.menu-teal .menu-copy > span {
  overflow: hidden;
  font-size: 10.5px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-subject-entry {
  padding: 4px 0 10px;
}

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

.homework-subject-entry-button {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 104, 89, 0.09);
  border-radius: 19px;
  color: #24433c;
  background: linear-gradient(145deg, #f6fbf9, #edf6f2);
  box-shadow: 0 9px 22px rgba(35, 104, 89, 0.06);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.homework-subject-entry-button strong {
  font-size: 17px;
  font-weight: 780;
}

.homework-subject-entry-button span {
  color: #71817c;
  font-size: 11px;
  font-weight: 600;
}

.homework-subject-entry-button:active {
  transform: scale(0.985);
  background: #e2f2ed;
}

.homework-stage-back {
  justify-self: start;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(35, 104, 89, 0.1);
  border-radius: 999px;
  color: #28695a;
  background: #e2f2ed;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.textbook-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 12px;
}

.textbook-page-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 5vw, 34px);
  letter-spacing: -0.045em;
}

.textbook-grade-compact {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  border: 1px solid rgba(30, 82, 73, 0.1);
  border-radius: 999px;
  color: #61736d;
  background: #f5faf8;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.textbook-grade-label {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.textbook-grade-label small {
  color: #82938e;
  font-size: 8.5px;
  font-weight: 650;
}

.textbook-grade-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.textbook-grade-select-wrap::after {
  position: absolute;
  right: 9px;
  z-index: 2;
  color: #2f7568;
  content: "⌄";
  font-size: 16px;
  font-weight: 900;
  pointer-events: none;
}

.textbook-grade-compact select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 92px;
  min-height: 32px;
  padding: 0 30px 0 8px;
  border: 0;
  outline: 0;
  color: #245f55;
  background: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
}

.textbook-board > .textbook-subject-tabs {
  margin: 0 0 8px;
}

.textbook-grade-note {
  margin: 0 0 14px;
  color: #71817c;
  font-size: 10.5px;
  line-height: 1.45;
}

.ai-query-language {
  width: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  color: #526a65;
  background: #edf5f2;
  font-size: 13px !important;
  font-weight: 760;
}

.ai-query-language.active,
.ai-query-language[data-mode="translate"] {
  color: #205f54;
  background: #d5eee7;
  box-shadow: inset 0 0 0 1px rgba(35, 104, 89, 0.14);
}

@media (max-width: 420px) {
  .homework-subject-entry-list {
    grid-template-columns: 1fr;
  }

  .textbook-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .textbook-grade-compact {
    width: 100%;
    justify-content: space-between;
  }
}

/* r83: secondary pages use the full viewport; the AI composer sits at the bottom. */
.child-page.secondary-view-open .child-shell {
  min-height: var(--visual-viewport-height, 100dvh);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.child-page.secondary-view-open .ai-query-card {
  display: grid;
  min-height: calc(
    var(--visual-viewport-height, 100dvh)
    - max(14px, env(safe-area-inset-top))
    - max(8px, env(safe-area-inset-bottom))
  );
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  padding-bottom: 0 !important;
}

.child-page.secondary-view-open .ai-query-card > .child-back-button {
  margin-bottom: 12px;
}

.child-page.secondary-view-open .ai-chat-thread {
  min-height: 0;
  max-height: none;
  padding-bottom: 10px;
}

/* r96-3: shared daily homework checklist for parent and child */
.daily-task-panel {
  display: grid;
  gap: 14px;
  margin: 4px 0 20px;
  padding: 16px;
  border: 1px solid rgba(37, 92, 81, 0.11);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 4%, rgba(181, 229, 216, 0.36), transparent 31%),
    linear-gradient(145deg, #fbfdfc, #f4f8f6);
  box-shadow: 0 12px 34px rgba(31, 71, 63, 0.07);
}

.daily-upload-card {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid rgba(37, 92, 81, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 94% 8%, rgba(174, 224, 211, 0.34), transparent 34%),
    linear-gradient(145deg, #fbfdfc, #f3f8f6);
  box-shadow: 0 10px 28px rgba(31, 71, 63, 0.06);
}

.daily-upload-card h3 {
  margin: 3px 0 5px;
  color: #244f47;
  font-size: 18px;
}

.daily-upload-card p {
  margin: 0;
  color: #6d7e78;
  font-size: 11px;
  line-height: 1.65;
}

.daily-upload-card-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.daily-upload-card-controls > label:first-child {
  display: grid;
  gap: 5px;
  color: #61726d;
  font-size: 11px;
  font-weight: 720;
}

.daily-upload-card-controls input[type="date"] {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(37, 92, 81, 0.13);
  border-radius: 14px;
  color: #1f5f53;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.daily-upload-picker {
  min-height: 44px;
  cursor: pointer;
}

.daily-upload-picker:has(input:disabled) {
  cursor: wait;
  opacity: 0.62;
}

.daily-task-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-date-picker {
  display: grid;
  min-width: min(100%, 230px);
  gap: 5px;
  color: #61726d;
  font-size: 11px;
  font-weight: 720;
}

.daily-date-picker select,
.daily-date-picker input {
  min-height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid rgba(37, 92, 81, 0.13);
  border-radius: 14px;
  color: #1f5f53;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.daily-task-progress-card {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 1px rgba(37, 92, 81, 0.08);
}

.daily-task-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.daily-task-progress-copy span {
  color: #64756f;
  font-size: 11px;
  font-weight: 720;
}

.daily-task-progress-copy strong {
  color: #234f47;
  font-size: 12px;
  text-align: right;
}

.daily-task-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece9;
}

.daily-task-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6ab8a4, #287d6c);
  transition: width 260ms ease;
}

.daily-task-help {
  margin: -2px 0 0;
  color: #72817c;
  font-size: 10.5px;
  line-height: 1.55;
}

.daily-task-items {
  display: grid;
  gap: 8px;
}

.daily-task-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 92, 81, 0.09);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease;
}

.daily-task-item:active {
  transform: scale(0.992);
}

.daily-task-item > input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.daily-task-item::before {
  width: 24px;
  height: 24px;
  border: 2px solid #b8c6c1;
  border-radius: 8px;
  content: "";
  background: #fafcfb;
}

.daily-task-item.done {
  border-color: rgba(42, 125, 105, 0.15);
  background: #f2faf7;
}

.daily-task-item.done::before {
  border-color: #2a7d69;
  background: #2a7d69;
  box-shadow: inset 0 0 0 4px #f2faf7;
}

.daily-task-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-task-copy strong {
  color: #222725;
  font-size: 13px;
  line-height: 1.45;
}

.daily-task-item.done .daily-task-copy strong {
  color: #668078;
  text-decoration: line-through;
}

.daily-task-copy small {
  color: #87938f;
  font-size: 9.5px;
}

.daily-task-item.is-editable {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  cursor: default;
}

.daily-task-admin {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 2px;
  border-top: 1px solid rgba(37, 92, 81, 0.07);
}

.daily-task-drag {
  margin-right: auto;
  color: #7f908a;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
}

.daily-task-subject,
.daily-task-order,
.daily-task-edit,
.daily-task-delete {
  min-height: 31px;
  border: 1px solid rgba(37, 92, 81, 0.12);
  border-radius: 10px;
  color: #315b52;
  background: #f6faf8;
  font: inherit;
  font-size: 11px;
  font-weight: 720;
}

.daily-task-subject {
  padding: 0 7px;
}

.daily-task-order,
.daily-task-edit,
.daily-task-delete {
  width: 32px;
  padding: 0;
}

.daily-task-order:disabled {
  opacity: 0.36;
}

.daily-task-delete {
  color: #a54b47;
  background: #fff5f4;
}

.daily-task-editor {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 88px auto auto;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid rgba(37, 92, 81, 0.08);
}

.daily-task-editor[hidden] {
  display: none;
}

.daily-task-editor input,
.daily-task-editor select {
  min-width: 0;
  min-height: 39px;
  padding: 0 9px;
  border: 1px solid rgba(37, 92, 81, 0.14);
  border-radius: 11px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.daily-task-item.is-dragging {
  opacity: 0.48;
}

.daily-task-item.is-drag-over {
  border-color: #2388ff;
  box-shadow: 0 0 0 2px rgba(35, 136, 255, 0.12);
}

.daily-task-check {
  color: #2a7d69;
  font-size: 15px;
  font-weight: 900;
}

.daily-task-empty {
  padding: 18px 14px;
  border: 1px dashed rgba(37, 92, 81, 0.16);
  border-radius: 16px;
  color: #75847f;
  background: rgba(255, 255, 255, 0.62);
  font-size: 11.5px;
  line-height: 1.55;
}

.daily-custom-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding-top: 2px;
}

.daily-custom-form label {
  display: grid;
  gap: 5px;
  color: #63736e;
  font-size: 10.5px;
  font-weight: 720;
}

.daily-custom-form input {
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(37, 92, 81, 0.12);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.daily-source-details {
  overflow: hidden;
  border: 1px solid rgba(37, 92, 81, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
}

.daily-source-details summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  color: #586a64;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  list-style: none;
}

.daily-source-details summary::-webkit-details-marker {
  display: none;
}

.daily-source-details summary::before {
  content: "▸";
  color: #3e796d;
}

.daily-source-details[open] summary::before {
  content: "▾";
}

.daily-source-details summary span {
  flex: 1;
}

.daily-source-details summary small {
  color: #8a9692;
  font-size: 9.5px;
}

.daily-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 9px;
  padding: 0 10px 10px;
}

.daily-source-image {
  display: grid;
  gap: 5px;
  color: #71817c;
  text-decoration: none;
}

.daily-source-image img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef2f0;
}

.daily-source-image small {
  font-size: 9px;
}

.daily-crop-dialog {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
}

.daily-crop-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 20, 17, 0.72);
  backdrop-filter: blur(8px);
}

.daily-crop-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(760px, 100%);
  max-height: calc(100dvh - 28px);
  gap: 13px;
  overflow: auto;
  padding: 16px;
  border-radius: 24px;
  background: #fbfcfc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.daily-crop-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-crop-heading h2 {
  margin: 4px 0 5px;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.daily-crop-heading p {
  margin: 0;
  color: #6d7a76;
  font-size: 11px;
  line-height: 1.5;
}

.daily-crop-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: #4c5b56;
  background: #edf1ef;
  font-size: 24px;
}

.daily-crop-stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  border-radius: 15px;
  background: #e7ecea;
  touch-action: none;
  user-select: none;
}

.daily-crop-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 270px);
  pointer-events: none;
}

.daily-crop-drawing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

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

@media (max-width: 520px) {
  .daily-task-panel {
    padding: 13px;
    border-radius: 20px;
  }

  .daily-upload-card {
    padding: 13px;
    border-radius: 20px;
  }

  .daily-upload-card-controls {
    grid-template-columns: 1fr;
  }

  .daily-upload-picker {
    justify-content: center;
  }

  .daily-task-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-date-picker {
    width: 100%;
  }

  .daily-task-editor {
    grid-template-columns: 1fr 1fr;
  }

  .daily-task-editor input {
    grid-column: 1 / -1;
  }

  .daily-task-toolbar > .button {
    width: 100%;
  }

  .daily-custom-form {
    grid-template-columns: 1fr;
  }

  .daily-custom-form > .button {
    width: 100%;
  }

  .daily-crop-card {
    padding: 13px;
    border-radius: 20px;
  }

  .daily-crop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .daily-crop-actions [data-crop-confirm] {
    grid-column: 1 / -1;
  }
}

.child-page.secondary-view-open .ai-query-form {
  position: static;
  bottom: auto;
  gap: 6px;
  padding: 8px;
  border-radius: 21px;
  box-shadow: 0 10px 26px rgba(26, 57, 50, 0.1);
}

.child-page.secondary-view-open .ai-query-form textarea {
  min-height: 44px;
  max-height: min(160px, 26dvh);
  padding: 9px 11px 5px;
  line-height: 1.4;
}

.child-page.secondary-view-open .ai-query-composer-actions {
  min-height: 42px;
  padding-top: 0;
}

.child-page.secondary-view-open #ai-query-status:not(:empty) {
  margin-top: 7px;
}

/* r92: the WebView may resize for the keyboard; only the message thread moves. */
html.ai-query-view-open,
body.ai-query-view-open {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.ai-query-view-open {
  position: fixed;
  top: var(--visual-viewport-offset-top, 0px);
  right: 0;
  bottom: auto;
  left: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: 0;
}

body.ai-query-view-open .child-shell {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.ai-query-view-open .ai-query-card {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left)) !important;
  border: 0;
  border-radius: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  background: #f6f7f7;
  box-shadow: none;
}

body.ai-query-view-open .ai-query-card > .child-back-button {
  justify-self: start;
  margin: 0 0 6px;
}

body.ai-query-view-open .ai-query-heading {
  margin-bottom: 8px;
}

body.ai-query-view-open .ai-chat-thread {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.ai-query-view-open .ai-query-form {
  position: static;
  bottom: auto;
  align-self: end;
  scroll-margin: 0;
  flex: 0 0 auto;
}

body.ai-query-keyboard-open .ai-query-card {
  padding-bottom: 6px !important;
}

body.ai-query-view-open .ai-query-composer-actions .ai-query-mic {
  margin-left: auto;
}

/* r96-3e: Doubao-style voice composer. The message thread scrolls by itself;
   the action bar and hold-to-talk surface remain anchored to the viewport. */
body.ai-query-view-open .ai-query-form {
  position: relative;
  display: grid;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  touch-action: none;
  overscroll-behavior: none;
}

body.ai-query-view-open .ai-query-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.ai-query-quick-action {
  display: flex;
  min-width: 0;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 13px;
  color: #303532;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(20, 30, 27, 0.04);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ai-query-quick-action span {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border-radius: 7px;
  color: #15784d;
  background: #eaf7f0;
  font-size: 11px;
  line-height: 1;
}

body.ai-query-view-open .ai-query-composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(22, 32, 29, 0.09);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 9px 28px rgba(22, 32, 29, 0.1);
  touch-action: none;
  overscroll-behavior: none;
}

body.ai-query-view-open .ai-query-composer-shell textarea {
  display: none;
  width: 100%;
  min-height: 43px;
  max-height: min(150px, 24dvh);
  padding: 10px 10px 4px;
  border: 0;
  outline: 0;
  color: #202421;
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
}

body.ai-query-view-open .ai-query-voice-preview {
  display: block;
  width: 100%;
  min-height: 43px;
  max-height: min(150px, 24dvh);
  padding: 10px 10px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: #202421;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-user-select: none;
}

body.ai-query-view-open .ai-query-voice-preview[hidden] {
  display: none;
}

body.ai-query-view-open .ai-query-voice-caret {
  display: inline-block;
  width: 2px;
  height: 1.25em;
  margin: 0 1px;
  border-radius: 999px;
  vertical-align: -0.2em;
  background: #2388ff;
  animation: ai-query-caret-blink 1s steps(1, end) infinite;
}

body.ai-query-view-open .ai-query-voice-caret[hidden] {
  display: none;
}

@keyframes ai-query-caret-blink {
  0%,
  48% { opacity: 1; }
  49%,
  100% { opacity: 0; }
}

body.ai-query-view-open .ai-query-composer-shell .ai-query-preview {
  width: 68px;
  height: 68px;
  margin: 1px 3px 0;
  border-radius: 14px;
}

body.ai-query-view-open .ai-query-preview-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 1px 3px 0;
}

body.ai-query-view-open .ai-query-preview-wrap[hidden] {
  display: none;
}

body.ai-query-view-open .ai-query-preview-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #333a36;
  font: 700 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 2px 7px rgba(20, 28, 25, 0.24);
}

body.ai-query-view-open .ai-query-composer-actions {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  align-items: center;
  padding: 0;
  touch-action: none;
  overscroll-behavior: none;
}

body.ai-query-view-open .ai-query-attach,
body.ai-query-view-open .ai-query-keyboard,
body.ai-query-view-open .ai-query-send {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #222724;
  background: transparent;
  font: inherit;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body.ai-query-view-open .ai-query-attach svg,
body.ai-query-view-open .ai-query-keyboard svg,
body.ai-query-view-open .ai-query-send svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ai-query-view-open .ai-query-mic {
  display: flex;
  grid-column: 2;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 15px;
  color: #202421;
  background: #f1f3f2;
  font: inherit;
  font-size: 15px;
  font-weight: 720;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.ai-query-view-open .ai-query-mic .mic-icon,
body.ai-query-view-open .ai-query-mic .stop-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ai-query-view-open .ai-query-mic .stop-icon,
body.ai-query-view-open .ai-query-mic .processing-dot {
  display: none;
}

body.ai-query-view-open .ai-query-mic[data-state="recording"] .mic-icon,
body.ai-query-view-open .ai-query-mic[data-state="processing"] .mic-icon {
  display: none;
}

body.ai-query-view-open .ai-query-mic[data-state="recording"] .stop-icon {
  display: block;
}

body.ai-query-view-open .ai-query-mic[data-state="processing"] .processing-dot {
  display: block;
}

/* r96-3i: keep the composer comfortably above the gesture bar, matching
   Doubao's breathing room, and use the centered text as the hold control. */
body.child-page.ai-query-view-open .ai-query-card {
  padding-bottom:
    max(48px, calc(env(safe-area-inset-bottom) + 28px)) !important;
}

body.child-page.ai-query-keyboard-open .ai-query-card {
  padding-bottom:
    max(28px, calc(env(safe-area-inset-bottom) + 16px)) !important;
}

body.ai-query-view-open .ai-query-mic .mic-icon,
body.ai-query-view-open .ai-query-mic .stop-icon,
body.ai-query-view-open .ai-query-mic .processing-dot {
  display: none !important;
}

body.ai-query-view-open .ai-query-mic {
  min-height: 46px;
  font-size: 16px;
  letter-spacing: 0.01em;
}

body.ai-query-view-open .ai-query-mic.is-recording {
  color: #fff;
  background: #2388ff;
  animation: none;
  box-shadow: 0 6px 18px rgba(35, 136, 255, 0.24);
}

body.ai-query-view-open .ai-query-mic-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ai-query-view-open .ai-query-keyboard {
  grid-column: 3;
}

body.ai-query-view-open .ai-query-send {
  display: none;
  grid-column: 4;
  color: #fff;
  background: #2388ff;
}

body.ai-query-view-open .ai-query-form.ai-query-voice-mode.ai-query-has-text .ai-query-send {
  display: grid;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-voice-preview {
  display: none;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-composer-shell textarea {
  display: block;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-composer-actions {
  display: flex;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-mic {
  display: none;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-keyboard {
  margin-left: auto;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .ai-query-send {
  display: grid;
  margin-left: 2px;
}

body.ai-query-view-open .switch-to-voice-icon {
  display: none;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .switch-to-keyboard-icon {
  display: none;
}

body.ai-query-view-open .ai-query-form.ai-query-text-mode .switch-to-voice-icon {
  display: block;
}

body.ai-query-view-open .ai-query-status:not(:empty) {
  position: static;
  bottom: auto;
  justify-self: start;
  width: auto;
  max-width: 100%;
  margin: 0 2px 7px;
  padding: 8px 11px;
  border-radius: 12px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}

body.ai-query-view-open .ai-query-status.error:not(:empty) {
  color: #9a352e;
  background: #fff0ee;
}

body.ai-query-keyboard-open .ai-query-quick-actions {
  display: none;
}

body.ai-query-keyboard-open .ai-query-form {
  gap: 0;
}

body.ai-query-voice-hold .ai-query-composer-shell,
body.ai-query-voice-hold .ai-query-form {
  touch-action: none;
  overscroll-behavior: none;
}

body.ai-query-voice-hold .ai-query-card,
body.ai-query-voice-hold .ai-chat-thread {
  overflow-anchor: none;
}

body.ai-query-view-open .ai-query-mic.is-press-feedback {
  animation: ai-query-press-feedback 180ms ease-out both;
}

@keyframes ai-query-press-feedback {
  0% { transform: scale(0.94); }
  65% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@media (max-width: 390px) {
  body.ai-query-view-open .ai-query-quick-actions {
    gap: 6px;
  }

  .ai-query-quick-action {
    gap: 3px;
    padding: 0 4px;
    font-size: 11px;
  }

  .ai-query-quick-action span {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }
}

.ai-query-heading-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.ai-query-heading-main > div {
  min-width: 0;
}

.ai-query-menu,
.ai-query-sidebar-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(24, 55, 48, 0.08);
  border-radius: 13px;
  color: #263b35;
  background: rgba(255, 255, 255, 0.84);
  font: inherit;
}

.ai-query-menu svg,
.ai-query-history-search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.ai-query-sidebar-backdrop {
  position: fixed;
  z-index: 1090;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(20, 28, 26, 0.34);
  backdrop-filter: blur(2px);
}

.ai-query-sidebar {
  position: fixed;
  z-index: 1100;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(86vw, 360px);
  max-width: calc(100% - 38px);
  min-height: 0;
  padding:
    max(16px, env(safe-area-inset-top))
    14px
    max(14px, env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  border-radius: 0 24px 24px 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(205, 239, 229, 0.74), transparent 15rem),
    #f7f8f8;
  box-shadow: 22px 0 55px rgba(25, 38, 34, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-104%);
  transition:
    transform 180ms cubic-bezier(0.22, 0.8, 0.28, 1),
    opacity 160ms ease;
}

body.ai-query-sidebar-open .ai-query-sidebar {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.ai-query-sidebar-top,
.ai-query-sidebar-brand,
.ai-query-assistant-entry {
  display: flex;
  align-items: center;
}

.ai-query-sidebar-top {
  justify-content: space-between;
  gap: 12px;
}

.ai-query-sidebar-brand {
  min-width: 0;
  gap: 10px;
}

.ai-query-sidebar-brand > div {
  display: grid;
  min-width: 0;
}

.ai-query-sidebar-brand strong {
  color: #1e2926;
  font-size: 16px;
  line-height: 1.2;
}

.ai-query-sidebar-brand small {
  color: #7a8985;
  font-size: 11px;
}

.ai-query-sidebar-close {
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.ai-query-history-search {
  display: flex;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(26, 57, 50, 0.08);
  border-radius: 15px;
  color: #7b8985;
  background: rgba(255, 255, 255, 0.9);
}

.ai-query-history-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: #25332f;
  background: transparent;
  font: inherit;
  font-size: 15px;
}

.ai-query-sidebar-new {
  display: flex;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: #1d2926;
  font: inherit;
  text-align: left;
}

.ai-query-sidebar-new span {
  font-size: 21px;
  line-height: 1;
}

.ai-query-sidebar-new strong {
  font-size: 14px;
}

.ai-query-assistant-entry {
  min-height: 58px;
  padding: 8px 10px;
  gap: 10px;
  border: 1px solid rgba(32, 93, 78, 0.09);
  border-radius: 16px;
  color: #24332f;
  background: rgba(226, 243, 237, 0.78);
  font: inherit;
  text-align: left;
}

.ai-query-assistant-entry > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
}

.ai-query-assistant-entry strong {
  font-size: 14px;
}

.ai-query-assistant-entry small {
  color: #72817d;
  font-size: 11px;
}

.ai-query-assistant-entry b {
  color: #7a8884;
  font-size: 20px;
}

.ai-query-assistant-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #1d2926;
  font-size: 10px;
  font-weight: 800;
}

.ai-query-history-section {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.ai-query-history-heading {
  display: flex;
  padding: 3px 4px 8px;
  align-items: center;
  justify-content: space-between;
  color: #7d8a86;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-query-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-query-history-heading small {
  font-size: 10px;
}

.ai-query-history-clear {
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  color: #9b504b;
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}

.ai-query-history-clear:disabled {
  color: #aab3b0;
  opacity: 0.62;
}

.ai-query-history-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ai-query-history-row {
  display: grid;
  margin-bottom: 4px;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
  border-radius: 14px;
}

.ai-query-history-row.active,
.ai-query-history-row:hover {
  background: rgba(255, 255, 255, 0.9);
}

.ai-query-history-item {
  display: grid;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 9px 10px;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  color: #28332f;
  background: transparent;
  font: inherit;
  text-align: left;
}

.ai-query-history-item:hover,
.ai-query-history-item.active {
  background: transparent;
}

.ai-query-history-item > span:first-child {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: #536a64;
  background: #e9efed;
  font-size: 13px;
}

.ai-query-history-item > span:last-child {
  display: grid;
  min-width: 0;
}

.ai-query-history-item strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-query-history-item small {
  margin-top: 2px;
  color: #8a9692;
  font-size: 10px;
}

.ai-query-history-delete {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #a45b55;
  background: rgba(255, 239, 237, 0.9);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.ai-query-history-delete:hover,
.ai-query-history-delete:focus-visible {
  color: #fff;
  background: #b85a53;
}

.ai-query-history-empty {
  margin: 18px 8px;
  color: #87928f;
  font-size: 12px;
  text-align: center;
}

.parent-summary-wide > .nav-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.parent-bottom-nav button > .nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 7px);
  margin: 0;
}

/* r96: date-addressable history and press-to-talk voice input. */
.homework-history-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(31, 83, 72, 0.1);
}

.homework-history-panel[hidden],
.ai-query-voice-overlay[hidden] {
  display: none;
}

.homework-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.homework-history-header > .status-pill {
  flex: 0 0 auto;
  min-width: 54px;
  max-width: none;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.homework-history-header h3 {
  margin: 3px 0 5px;
  font-size: 20px;
}

.homework-history-header p {
  margin: 0;
  line-height: 1.5;
}

.homework-history-filter,
.family-message-date-filter label {
  display: grid;
  gap: 6px;
  color: #66766f;
  font-size: 11px;
  font-weight: 720;
}

.homework-history-filter select,
.family-message-date-filter select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 13px;
  border: 1px solid rgba(31, 83, 72, 0.11);
  border-radius: 14px;
  outline: 0;
  color: #214d44;
  background: #f6fbf9;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

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

.homework-history-list > .homework-card {
  margin: 0;
  box-shadow: none;
}

.family-message-date-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(31, 83, 72, 0.09);
  border-radius: 17px;
  background: #f5faf8;
}

.family-message-date-filter span {
  padding-bottom: 11px;
  color: #6b7a74;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.ai-query-status {
  position: sticky;
  z-index: 8;
  bottom: calc(164px + env(safe-area-inset-bottom));
  margin: 0 8px 8px;
  padding: 7px 11px;
  border-radius: 11px;
  color: #42645b;
  background: rgba(239, 248, 245, 0.96);
  box-shadow: 0 5px 16px rgba(27, 80, 69, 0.08);
  font-size: 11px;
  line-height: 1.45;
}

.ai-query-status.error {
  color: #a52c27;
  background: rgba(255, 238, 236, 0.97);
}

.ai-query-voice-overlay {
  position: fixed;
  z-index: 1500;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-height: min(34vh, 270px);
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px calc(34px + env(safe-area-inset-bottom));
  color: #fff;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(180deg, #5aaaf7 0%, #2188ef 62%, #0878df 100%);
  box-shadow: 0 -16px 45px rgba(16, 97, 183, 0.24);
  text-align: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.ai-query-voice-overlay.cancel {
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(180deg, #f47b75 0%, #df4d45 70%, #c93a33 100%);
}

.ai-query-voice-overlay strong {
  font-size: 16px;
  font-weight: 760;
}

.ai-query-voice-overlay small {
  min-height: 18px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.ai-query-voice-wave {
  display: flex;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ai-query-voice-wave i {
  width: 5px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  animation: ai-query-voice-wave 0.82s ease-in-out infinite alternate;
}

.ai-query-voice-wave i:nth-child(2n) { animation-delay: -0.18s; }
.ai-query-voice-wave i:nth-child(3n) { animation-delay: -0.34s; }
.ai-query-voice-wave i:nth-child(4n) { animation-delay: -0.52s; }

@keyframes ai-query-voice-wave {
  from { transform: scaleY(0.55); opacity: 0.55; }
  to { transform: scaleY(3.4); opacity: 1; }
}

.ai-query-mic {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.ai-query-voice-hold {
  overscroll-behavior: none;
}

body.ai-query-voice-hold .ai-query-mic {
  transform: scale(0.9);
  box-shadow: 0 0 0 7px rgba(47, 125, 112, 0.16);
}

body.ai-query-voice-hold .ai-chat-thread,
body.ai-query-voice-hold .ai-chat-message,
body.ai-query-voice-hold .ai-query-form,
body.ai-query-voice-hold .ai-query-form textarea {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 420px) {
  .homework-history-header {
    gap: 10px;
  }

  .homework-history-header > .status-pill {
    min-width: 50px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .family-message-date-filter {
    grid-template-columns: 1fr;
  }

  .family-message-date-filter span {
    padding-bottom: 0;
  }
}

/* r96-3n: full-width tablet layout and a hold-to-talk strip that uses every
   pixel between the camera and keyboard controls. */
@media (min-width: 761px) and (max-width: 1366px) {
  body.parent-page .topbar,
  body.child-page .topbar {
    width: 100%;
    padding-right: clamp(22px, 3vw, 42px);
    padding-left: clamp(22px, 3vw, 42px);
  }

  body.parent-page .app-shell,
  body.child-page .child-shell {
    width: 100%;
    max-width: none;
    padding-right: clamp(18px, 2.4vw, 34px);
    padding-left: clamp(18px, 2.4vw, 34px);
  }

  body.parent-page .auth-layout {
    min-height: calc(100vh - 104px);
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
    align-items: stretch;
    gap: clamp(18px, 2.6vw, 34px);
    padding-top: 18px;
  }

  body.parent-page .auth-layout .intro-panel {
    display: flex;
    min-height: 100%;
    max-width: none;
    flex-direction: column;
    justify-content: center;
    padding: clamp(26px, 4vw, 46px);
  }

  body.parent-page .auth-card {
    width: 100%;
    max-width: none;
    padding: clamp(22px, 3vw, 36px);
  }

  body.parent-page .auth-card .stack {
    gap: 12px;
    margin-top: 16px;
  }

  body.parent-page .parent-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.child-page .child-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.child-page .child-menu-card.menu-wide {
    grid-column: span 2;
  }
}

@media (min-width: 761px) and (max-width: 960px) {
  body.parent-page .auth-layout {
    grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  }

  body.parent-page .parent-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.ai-query-view-open .ai-query-composer-actions {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
}

body.ai-query-view-open .ai-query-mic {
  grid-column: 2;
  width: 100%;
}

body.ai-query-view-open .ai-query-keyboard,
body.ai-query-view-open .ai-query-send {
  grid-column: 3;
}

body.ai-query-view-open .ai-query-form.ai-query-voice-mode.ai-query-has-text .ai-query-composer-actions {
  grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
}

body.ai-query-view-open .ai-query-form.ai-query-voice-mode.ai-query-has-text .ai-query-send {
  grid-column: 4;
}

.daily-task-correct {
  min-width: 74px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(31, 107, 92, 0.14);
  border-radius: 11px;
  color: #17654f;
  background: #eef8f4;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.daily-task-item:not(.is-editable) {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.daily-task-correct[data-homework-status="completed"] {
  color: #fff;
  background: #23836b;
}

.daily-task-correct[data-homework-status="processing"],
.daily-task-correct[data-homework-status="queued"] {
  color: #7c6419;
  background: #fff8dc;
}

.daily-task-correct[data-homework-status="failed"] {
  color: #a33a31;
  background: #fff0ee;
}

.boot-status {
  display: grid;
  min-height: min(62vh, 520px);
  place-items: center;
  padding: 32px 20px;
  color: #60736c;
  text-align: center;
}

.boot-status strong {
  display: block;
  margin-bottom: 8px;
  color: #173b34;
  font-size: 22px;
}

@media (max-width: 760px) {
  .daily-task-correct {
    min-width: 68px;
    padding: 0 8px;
  }
}
