/*
 * 芽伴响应式基线
 * 覆盖手机、平板、电脑与教室大屏，并为 iOS/Android 安全区域提供适配。
 */

:root {
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --content-gutter: clamp(0.875rem, 3vw, 3.125rem);
  --section-gap: clamp(1rem, 2vw, 1.5rem);
  --touch-min: 2.75rem;
  --text-caption: clamp(0.6875rem, 0.18vw + 0.65rem, 0.75rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --topbar-height: 5.125rem;
  --mobile-role-height: 4.75rem;
  --z-sticky: 30;
  --z-mobile-nav: 50;
  --z-toast: 60;
}

html {
  min-width: 0;
  overflow-x: clip;
  scroll-padding-bottom: calc(var(--mobile-role-height) + var(--safe-bottom));
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-wrap: break-word;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.app-shell,
.workspace,
.view-shell,
.child-view,
.projector-view {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  z-index: var(--z-sticky);
  padding-top: max(0.75rem, var(--safe-top));
  padding-right: max(1.75rem, var(--safe-right));
  padding-left: max(1.75rem, var(--safe-left));
}

.brand,
.role-button,
.icon-button,
.avatar-button,
.nav-button,
.text-button,
.soft-button,
.task-action,
.child-tabs button,
.child-exit,
.projector-actions button,
.pet-category-tab {
  min-height: var(--touch-min);
}

.icon-button {
  min-width: var(--touch-min);
}

.role-button {
  white-space: nowrap;
}

.text-button,
.hero-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding-inline: var(--space-xs);
  border-radius: 0.625rem;
}

.soft-button,
.task-action {
  min-width: var(--touch-min);
}

.content {
  padding-right: max(var(--content-gutter), var(--safe-right));
  padding-bottom: max(3.5rem, calc(2rem + var(--safe-bottom)));
  padding-left: max(var(--content-gutter), var(--safe-left));
}

.dashboard-grid,
.stack,
.pet-house-grid,
.upgrade-rules {
  gap: var(--section-gap);
}

.section-title {
  align-items: flex-start;
}

.section-title > :first-child {
  min-width: 0;
}

.section-title p,
.brand small,
.avatar-copy small,
.space-chip small,
.nav-note p,
.metric-pill small,
.quick-action small,
.student-card small,
.stat-card small,
.task-copy small,
.activity-copy small,
.list-copy small,
.pet-catalog-card > small,
.catalog-state,
.task-reward,
.tag,
.switch-note,
.evolution-stop > small,
.child-form > small,
.upgrade-rules small,
.pet-facts,
.pet-evolution-visual > small,
.projector-student small {
  font-size: var(--text-caption);
}

.task-copy small,
.activity-copy small,
.list-copy small {
  white-space: normal;
}

.student-card,
.pet-catalog-card,
.quick-action,
.task-item,
.activity-item,
.list-row {
  min-width: 0;
}

.pet-series-preview img {
  width: 100%;
  max-height: 19rem;
  object-fit: contain;
  background: #f8f0de;
}

.flow-dialog,
.pin-dialog {
  max-height: calc(100vh - 1.5rem - var(--safe-top) - var(--safe-bottom));
  max-height: calc(100dvh - 1.5rem - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  overscroll-behavior: contain;
}

.toast-region {
  z-index: var(--z-toast);
  right: max(1.5rem, var(--safe-right));
  bottom: max(1.5rem, var(--safe-bottom));
}

.child-view,
.projector-view {
  padding-right: max(var(--content-gutter), var(--safe-right));
  padding-left: max(var(--content-gutter), var(--safe-left));
}

.child-exit,
.projector-actions button {
  min-width: var(--touch-min);
}

@media (hover: none), (pointer: coarse) {
  .role-button:hover,
  .icon-button:hover,
  .avatar-button:hover,
  .nav-button:hover,
  .primary-button:hover,
  .secondary-button:hover,
  .soft-button:hover,
  .quick-action:hover,
  .student-card:hover,
  .task-action:hover,
  .care-button:hover,
  .pet-catalog-card:hover,
  .projector-student:hover,
  .pin-pad button:not(:disabled):hover {
    transform: none;
  }
}

@media (max-width: 1180px) {
  .topbar {
    padding-right: max(0.875rem, var(--safe-right));
    padding-left: max(0.875rem, var(--safe-left));
  }

  .role-button {
    padding-inline: 0.625rem;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 4.375rem;
  }

  .topbar {
    min-height: var(--topbar-height);
    padding-top: max(0.5rem, var(--safe-top));
    padding-right: max(0.75rem, var(--safe-right));
    padding-bottom: 0.5rem;
    padding-left: max(0.75rem, var(--safe-left));
  }

  .workspace,
  .view-shell,
  .child-view,
  .projector-view {
    min-height: calc(100vh - var(--topbar-height));
    min-height: calc(100dvh - var(--topbar-height));
  }

  .role-switcher {
    z-index: var(--z-mobile-nav);
    right: max(0.5rem, var(--safe-right));
    bottom: max(0.5rem, var(--safe-bottom));
    left: max(0.5rem, var(--safe-left));
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 1.25rem;
  }

  .role-button {
    min-width: 0;
    min-height: 3.25rem;
    padding: 0.5rem 0.25rem;
    overflow: hidden;
    font-size: 0.6875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-nav {
    padding-right: max(0.875rem, var(--safe-right));
    padding-left: max(0.875rem, var(--safe-left));
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .nav-button {
    min-height: var(--touch-min);
    scroll-snap-align: start;
  }

  .content {
    padding-top: clamp(1.25rem, 4vw, 1.75rem);
    padding-right: max(1rem, var(--safe-right));
    padding-bottom: calc(var(--mobile-role-height) + var(--safe-bottom) + 2.25rem);
    padding-left: max(1rem, var(--safe-left));
  }

  .child-view,
  .projector-view {
    padding-right: max(1rem, var(--safe-right));
    padding-bottom: calc(var(--mobile-role-height) + var(--safe-bottom) + 1.75rem);
    padding-left: max(1rem, var(--safe-left));
  }

  .toast-region {
    right: max(1rem, var(--safe-right));
    bottom: calc(var(--mobile-role-height) + var(--safe-bottom) + 0.75rem);
    left: max(1rem, var(--safe-left));
    width: auto;
  }

  .pet-evolution-visual {
    min-height: clamp(13rem, 42vw, 16rem);
  }

  .child-stage {
    min-height: 0;
    padding-block: clamp(1.5rem, 5vw, 3rem);
  }

  .projector-actions {
    flex-wrap: wrap;
  }

  .flow-dialog {
    padding: clamp(1rem, 4vw, 1.75rem);
  }

  .flow-step {
    min-height: 10rem;
  }
}

@media (max-width: 620px) {
  :root {
    --content-gutter: 0.875rem;
    --section-gap: 0.875rem;
  }

  .brand {
    min-height: var(--touch-min);
  }

  .page-head {
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  .page-head h1 {
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }

  .page-head p {
    font-size: 0.8125rem;
  }

  .card-pad,
  .pet-preview-card,
  .child-panel {
    padding: clamp(1rem, 5vw, 1.375rem);
  }

  .hero-copy,
  .pet-evolution-copy {
    padding: clamp(1.125rem, 5vw, 1.75rem);
  }

  .section-title {
    flex-wrap: wrap;
    margin-bottom: 0.875rem;
  }

  .section-title h2 {
    font-size: clamp(1.125rem, 5vw, 1.375rem);
  }

  .section-title > .tag,
  .section-title > .text-button {
    margin-left: auto;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-pill {
    min-width: 0;
  }

  .task-item,
  .activity-item,
  .list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
  }

  .task-action,
  .soft-button,
  .task-reward,
  .task-item > .tag,
  .activity-item > .tag,
  .list-row > .tag {
    grid-column: 3;
  }

  .pet-series-preview {
    gap: var(--space-sm);
  }

  .pet-series-preview img {
    max-height: none;
  }

  .pet-category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pet-category-tab {
    justify-content: center;
    min-width: 0;
    padding-inline: 0.5rem;
  }

  .pet-category-tab strong {
    font-size: 0.75rem;
  }

  .pet-category-tab small {
    display: none;
  }

  .pet-catalog-card {
    min-height: 11.5rem;
    padding: 1.25rem 0.5rem 0.75rem;
    overflow: clip;
  }

  .pet-catalog-card > strong {
    font-size: 0.875rem;
  }

  .evolution-stop,
  .child-form {
    scroll-snap-align: start;
  }

  .evolution-road,
  .child-evolution-road,
  .child-tabs {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .child-top {
    align-items: center;
  }

  .child-title p {
    font-size: 0.875rem;
  }

  .child-tabs button {
    min-height: var(--touch-min);
  }

  .child-stage {
    gap: 1.5rem;
  }

  .pet-stage .pet-avatar {
    width: clamp(10rem, 58vw, 13rem);
    height: clamp(9.25rem, 52vw, 12rem);
  }

  .projector-head {
    align-items: stretch;
  }

  .projector-actions button {
    flex: 1 1 8rem;
  }

  .flow-step {
    min-height: 0;
  }

  .dialog-head {
    align-items: flex-start;
  }

  .ledger-note span {
    width: 100%;
    border-radius: 0.75rem;
  }
}

@media (max-width: 380px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .brand strong {
    font-size: 1.125rem;
  }

  .brand-mark {
    width: 2.375rem;
    height: 2.375rem;
  }

  .avatar-button {
    padding-right: 0.3125rem;
  }

  .role-button {
    flex-direction: column;
    gap: 0.125rem;
    min-height: 3.5rem;
    font-size: 0.625rem;
  }

  .quick-actions,
  .student-strip,
  .collection-grid,
  .shop-grid,
  .badge-grid,
  .pet-catalog-grid,
  .projector-grid {
    gap: 0.5rem;
  }

  .student-card {
    overflow: clip;
  }

  .stat-grid,
  .split-ledger {
    grid-template-columns: 1fr;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .head-actions button {
    width: 100%;
  }

  .task-item,
  .activity-item,
  .list-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-action,
  .soft-button,
  .task-reward,
  .task-item > .tag,
  .activity-item > .tag,
  .list-row > .tag {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }

  .pet-category-tabs {
    grid-template-columns: 1fr;
  }

  .pet-category-tab small {
    display: inline;
  }

  .flow-dialog,
  .pin-dialog {
    width: calc(100% - 1rem);
    padding: 1rem;
    border-radius: 1.25rem;
    box-shadow: 0.375rem 0.375rem 0 var(--ink);
  }
}

/* 儿童安全模式不继承成人顶栏或移动端角色切换预留空间。 */
.app-shell[data-role="child"] .workspace,
.app-shell[data-role="child"] .child-view {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell[data-role="child"] .child-task-card small,
.app-shell[data-role="child"] .child-form > small {
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .app-shell[data-role="child"] .child-view {
    padding-bottom: calc(6rem + var(--safe-bottom));
  }

  .child-tabs {
    position: fixed;
    right: max(0.75rem, var(--safe-right));
    left: max(0.75rem, var(--safe-left));
    bottom: max(0.75rem, var(--safe-bottom));
    width: auto;
    margin: 0;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .app-shell[data-role="child"] + .toast-region {
    bottom: calc(6rem + var(--safe-bottom));
  }
}

@media (max-width: 640px) {
  .child-entry-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
    padding: 1.15rem;
    border-radius: 1.35rem;
  }

  .entry-section-head,
  .session-choice {
    align-items: flex-start;
  }

  .session-choice {
    grid-template-columns: auto 1fr;
  }

  .session-choice > small {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 0.15rem;
  }

  .entry-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .entry-actions button {
    width: 100%;
  }

  .child-tabs {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    gap: 0.125rem;
    padding: 0.25rem;
  }

  .child-tabs button {
    flex: 1 1 20%;
    min-width: 0;
    padding: 0.375rem 0.125rem;
  }

  .child-tabs button > strong {
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .child-care-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .child-rest-card {
    padding: 2rem 1.15rem;
    border-radius: 1.75rem;
    box-shadow: 8px 9px 0 var(--ink);
  }
}

@media (max-width: 480px) {
  .app-shell[data-role="child"] .child-view {
    padding-right: max(0.75rem, var(--safe-right));
    padding-left: max(0.75rem, var(--safe-left));
  }

  .child-top {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .child-exit {
    align-self: flex-end;
  }

  .child-task-card {
    flex-wrap: wrap;
  }

  .child-task-card .task-action {
    margin-left: auto;
  }

  .child-tabs {
    right: max(0.375rem, var(--safe-right));
    left: max(0.375rem, var(--safe-left));
  }
}

@media (max-width: 360px) {
  .child-tabs {
    right: max(0.25rem, var(--safe-right));
    left: max(0.25rem, var(--safe-left));
    gap: 0;
    padding: 0.125rem;
  }

  .child-tabs button {
    padding-inline: 0;
  }
}

@media (min-width: 1600px) {
  .content {
    width: min(1480px, 100%);
  }

  .projector-view {
    padding-inline: clamp(2rem, 5vw, 6rem);
  }

  .projector-grid {
    gap: clamp(0.875rem, 1.2vw, 1.5rem);
  }
}

@media (prefers-contrast: more) {
  .card,
  .task-item,
  .activity-item,
  .list-row,
  .pet-catalog-card {
    border-color: currentColor;
  }
}

/* 家长端：移动优先导航与主闭环表单 */
@media (max-width: 1180px) {
  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .family-welcome-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  }

  .family-overview-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.68fr);
  }
}

@media (max-width: 900px) {
  .app-shell[data-role="parent"] .role-switcher {
    display: none;
  }

  .app-shell[data-role="parent"] .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .parent-shell .parent-nav {
    position: fixed;
    z-index: var(--z-mobile-nav);
    top: auto;
    right: max(0.5rem, var(--safe-right));
    bottom: max(0.5rem, var(--safe-bottom));
    left: max(0.5rem, var(--safe-left));
    display: block;
    width: auto;
    height: auto;
    padding: 0.375rem;
    overflow: visible;
    border: 1px solid rgba(23, 58, 53, 0.14);
    border-radius: 1.25rem;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .parent-nav .parent-space-chip,
  .parent-nav .parent-boundary-note {
    display: none;
  }

  .parent-nav .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 0.25rem;
  }

  .parent-nav .nav-button {
    display: grid;
    justify-items: center;
    gap: 0.125rem;
    width: 100%;
    min-width: 0;
    min-height: 3.35rem;
    padding: 0.35rem 0.2rem;
    text-align: center;
  }

  .parent-nav .nav-button span:first-child {
    width: 1.5rem;
    height: 1.5rem;
  }

  .parent-nav .nav-button strong {
    overflow: hidden;
    font-size: 0.625rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .parent-nav .nav-button.is-active {
    color: var(--white);
    background: var(--ink);
    box-shadow: none;
  }

  .parent-content {
    padding-bottom: calc(5.5rem + var(--safe-bottom));
  }

  .parent-context-wrap {
    position: sticky;
    z-index: 12;
    top: calc(var(--topbar-height) + 0.5rem);
  }

  .parent-context-bar {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 0.5rem;
    min-height: 4rem;
    padding: 0.375rem 0.5rem;
  }

  .adult-context-badge {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: none;
    text-align: center;
  }

  .context-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.5rem);
    right: max(0.75rem, var(--safe-right));
    bottom: calc(5.25rem + var(--safe-bottom));
    left: max(0.75rem, var(--safe-left));
    max-height: none;
    padding: 1.125rem;
    border-radius: 1.25rem;
    box-shadow: 0.4rem 0.45rem 0 var(--brand-ink), var(--shadow);
  }

  .family-welcome-grid,
  .family-overview-card,
  .form-layout,
  .claim-layout {
    grid-template-columns: 1fr;
  }

  .family-overview-visual {
    order: -1;
    min-height: 15rem;
  }

  .family-overview-copy {
    padding-top: 0;
  }

  .privacy-aside,
  .claim-preview {
    position: static;
  }

  .privacy-aside {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
  }

  .privacy-aside .privacy-seal {
    grid-row: 1 / 3;
    margin: 0;
  }

  .privacy-aside > p,
  .privacy-aside > div {
    grid-column: 2;
  }

  .status-result-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .status-result-card > .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .claim-preview {
    display: grid;
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1fr);
  }

  .claim-preview-stage {
    min-height: 20rem;
  }
}

@media (max-width: 620px) {
  .parent-context-wrap {
    top: calc(var(--topbar-height) + 0.25rem);
    margin-bottom: 1.25rem;
  }

  .parent-context-bar {
    border-radius: 1rem;
  }

  .context-switch {
    gap: 0.35rem;
    min-height: 2.875rem;
    padding: 0.25rem;
  }

  .context-mark {
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    font-size: 0.75rem;
  }

  .context-switch small {
    font-size: 0.5625rem;
  }

  .context-switch strong {
    font-size: 0.6875rem;
  }

  .context-switch > span:last-child {
    display: none;
  }

  .context-divider {
    height: 2rem;
  }

  .context-panel-head h2 {
    font-size: 1.25rem;
  }

  .child-switch-row {
    padding-left: 0;
  }

  .family-switch-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .family-switch-main > .tag {
    grid-column: 2;
    justify-self: start;
  }

  .family-overview-card {
    min-height: 0;
  }

  .family-overview-visual {
    min-height: 13.5rem;
  }

  .family-overview-copy {
    padding: 0 1.125rem 1.375rem;
  }

  .family-overview-copy h2 {
    font-size: clamp(2rem, 12vw, 2.75rem);
  }

  .context-summary {
    grid-template-columns: 1fr;
  }

  .journey-rail {
    grid-template-columns: repeat(5, 7.5rem);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .journey-rail::before {
    display: none;
  }

  .journey-step {
    scroll-snap-align: start;
  }

  .journey-action {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-progress {
    margin-bottom: 1.25rem;
  }

  .flow-progress b {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.6875rem;
  }

  .flow-progress > span::before,
  .flow-progress > span::after {
    top: 0.875rem;
  }

  .flow-progress small {
    font-size: 0.5rem;
  }

  .form-layout {
    gap: 0.875rem;
  }

  .privacy-aside {
    display: block;
  }

  .privacy-aside .privacy-seal {
    margin-bottom: 1rem;
  }

  .privacy-aside > p,
  .privacy-aside > div {
    grid-column: auto;
  }

  .input-with-action {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions button {
    width: 100%;
  }

  .binding-preview-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .binding-preview-head .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .binding-preview-card dl,
  .detail-list,
  .claim-preview dl {
    grid-template-columns: 1fr;
  }

  .status-result-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .status-result-card > .status-chip {
    grid-column: auto;
  }

  .status-result-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.125rem;
    font-size: 1.5rem;
  }

  .claim-pet-grid {
    grid-auto-columns: minmax(10.5rem, 72%);
    grid-template-columns: none;
    grid-auto-flow: column;
    padding: 0 0.25rem 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .claim-pet-card {
    min-height: 13rem;
    scroll-snap-align: start;
  }

  .claim-preview {
    grid-template-columns: 1fr;
  }

  .claim-preview-stage {
    min-height: 16rem;
  }

  .more-grid {
    grid-template-columns: 1fr;
  }

  .more-service-card {
    min-height: 8rem;
    padding: 1rem;
  }

  .growth-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-banner {
    align-items: start;
  }
}

@media (max-width: 380px) {
  .parent-nav .nav-button strong {
    font-size: 0.5625rem;
  }

  .parent-content {
    padding-right: max(0.75rem, var(--safe-right));
    padding-left: max(0.75rem, var(--safe-left));
  }

  .parent-context-bar {
    padding-inline: 0.3rem;
  }

  .context-switch strong {
    max-width: 5.25rem;
  }

  .growth-summary-strip {
    gap: 0.5rem;
  }

  .growth-summary-strip > span {
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-ring,
  .welcome-spark {
    animation: none !important;
  }
}

/* Classroom display owns the full viewport even though this shared file loads last. */
.app-shell[data-role="projector"] .projector-view {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

@media (max-aspect-ratio: 4 / 3) and (min-width: 801px) {
  .app-shell[data-role="projector"] .display-session-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
  }

  .app-shell[data-role="projector"] .display-view-tabs {
    justify-self: end;
  }

  .app-shell[data-role="projector"] .display-session-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .app-shell[data-role="projector"] .display-stage {
    padding-inline: clamp(1rem, 3vw, 2.25rem);
  }

  .app-shell[data-role="projector"] .display-pet-lineup {
    gap: clamp(0.6rem, 1.2vw, 1rem);
  }
}

@media (max-width: 800px) {
  .app-shell[data-role="projector"] .projector-view {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }
}
@media (max-width: 860px) {
  .auth-page {
    background:
      linear-gradient(180deg, rgba(23, 58, 53, 0.98) 0 280px, transparent 280px),
      radial-gradient(circle at 85% 18%, rgba(242, 189, 87, 0.22), transparent 18rem),
      var(--paper);
  }

  .auth-top { min-height: 78px; padding: 14px 20px; }
  .auth-brand small { display: none; }
  .auth-demo-link { border-color: rgba(255, 253, 247, 0.3); color: var(--white); background: rgba(255,255,255,0.08); }
  .auth-composition {
    grid-template-columns: 1fr;
    width: min(620px, calc(100% - 32px));
    padding: 16px 0 48px;
  }
  .auth-story { min-height: 180px; padding: 16px 4px 28px; }
  .auth-story-index, .auth-story ul { display: none; }
  .auth-orbit { width: 92px; height: 92px; margin: 0 0 16px; }
  .auth-orbit > span { width: 54px; height: 54px; font-size: 28px; box-shadow: 5px 5px 0 var(--sun); }
  .auth-orbit::before, .auth-orbit::after { display: none; }
  .auth-story blockquote { font-size: 20px; }
  .auth-card { width: 100%; margin: 0; border-radius: 28px 12px 28px 12px; }
}

@media (max-width: 480px) {
  .auth-top { padding-inline: 16px; }
  .auth-brand .brand-mark { width: 42px; height: 42px; }
  .auth-demo-link { padding-inline: 12px; font-size: 12px; }
  .auth-composition { width: calc(100% - 24px); }
  .auth-story { min-height: 165px; }
  .auth-card { padding: 26px 20px; }
  .auth-panel-head h1 { font-size: 36px; }
  .auth-secondary-row { display: grid; justify-items: center; text-align: center; }
  .auth-form input:not([type="checkbox"]) { min-height: 52px; }
  .auth-submit { min-height: 54px; }
}
