:root {
  --paper: #f5f0e3;
  --paper-deep: #ebe2cf;
  --ink: #173a35;
  --ink-soft: #48635d;
  --moss: #416b57;
  --leaf: #78a66f;
  --mint: #cfe3c4;
  --coral: #ef765f;
  --sun: #f2bd57;
  --sky: #80b9c2;
  --lavender: #b7a5c7;
  --white: #fffdf7;
  --danger: #c84f43;
  --shadow: 0 18px 45px rgba(48, 58, 44, 0.12);
  --soft-shadow: 0 8px 22px rgba(48, 58, 44, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --display: "LXGW WenKai", "STKaiti", "KaiTi", serif;
  --body: "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 8%, rgba(242, 189, 87, 0.2), transparent 22rem),
    radial-gradient(circle at 94% 10%, rgba(128, 185, 194, 0.2), transparent 24rem),
    var(--paper);
  font-family: var(--body);
}

.app-shell[data-role="auth"] .workspace {
  min-height: 100vh;
  padding: 0;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(108deg, rgba(23, 58, 53, 0.98) 0 43%, transparent 43.1%),
    radial-gradient(circle at 82% 15%, rgba(242, 189, 87, 0.26), transparent 24rem),
    var(--paper);
}

.auth-page::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 25rem;
  height: 25rem;
  border: 1px solid rgba(23, 58, 53, 0.16);
  border-radius: 44% 56% 63% 37%;
  transform: rotate(22deg);
  pointer-events: none;
}

.auth-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 20px clamp(20px, 4vw, 64px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--white);
  text-decoration: none;
}

.auth-brand .brand-mark {
  color: var(--ink);
  background: var(--sun);
  box-shadow: 4px 4px 0 rgba(255, 253, 247, 0.8);
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font: 800 24px/1 var(--display);
  letter-spacing: 0.12em;
}

.auth-brand small {
  margin-top: 5px;
  color: rgba(255, 253, 247, 0.72);
  font-size: 12px;
}

.auth-demo-link {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(23, 58, 53, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.68);
  cursor: pointer;
}

.auth-demo-link span { margin-left: 7px; }

.auth-composition {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(310px, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 118px);
  margin: 0 auto;
  padding: 32px 0 64px;
}

.auth-story {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem clamp(1rem, 4vw, 4.5rem) 3rem 0;
  color: var(--white);
}

.auth-story-index {
  position: absolute;
  top: 1rem;
  left: 0;
  color: rgba(255, 253, 247, 0.52);
  font: 700 11px/1 var(--body);
  letter-spacing: 0.18em;
}

.auth-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 253, 247, 0.3);
  border-radius: 50%;
}

.auth-orbit::before,
.auth-orbit::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(255, 253, 247, 0.24);
  border-radius: 50%;
}

.auth-orbit::before { inset: -13px 25px; transform: rotate(32deg); }
.auth-orbit::after { inset: 25px -13px; transform: rotate(-24deg); }

.auth-orbit > span {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border: 2px solid var(--white);
  border-radius: 43% 57% 48% 52%;
  color: var(--ink);
  background: var(--mint);
  box-shadow: 8px 8px 0 var(--sun);
  font: 900 42px/1 var(--display);
  transform: rotate(-6deg);
}

.auth-orbit i,
.auth-orbit b { position: absolute; color: var(--sun); font-style: normal; }
.auth-orbit i { top: 13px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.auth-orbit b { bottom: 10px; left: 18px; font-size: 20px; }

.auth-story blockquote {
  margin: 0;
  font: 700 clamp(22px, 2.4vw, 34px)/1.48 var(--display);
  letter-spacing: 0.04em;
}

.auth-story ul {
  display: grid;
  gap: 14px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.auth-story li {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 253, 247, 0.16);
}

.auth-story li strong { color: var(--sun); font-size: 13px; }
.auth-story li small { color: rgba(255, 253, 247, 0.72); font-size: 12px; line-height: 1.6; }

.auth-card {
  width: min(570px, 100%);
  margin-left: auto;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(23, 58, 53, 0.15);
  border-radius: 42px 16px 42px 16px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 28px 80px rgba(23, 58, 53, 0.16);
  backdrop-filter: blur(18px);
}

.auth-panel-head h1 {
  margin: 12px 0 14px;
  font: 800 clamp(34px, 4.4vw, 56px)/1.04 var(--display);
  letter-spacing: 0.02em;
}

.auth-panel-head h1 em { color: var(--coral); font-style: normal; }
.auth-panel-head p { margin: 0 0 28px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }

.auth-form { display: grid; gap: 16px; }
.auth-form > label:not(.auth-consent) { display: grid; gap: 8px; }
.auth-form label > span { font-size: 13px; font-weight: 800; }
.auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(23, 58, 53, 0.2);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: rgba(245, 240, 227, 0.55);
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:focus {
  border-color: var(--leaf);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(120, 166, 111, 0.18);
}

.auth-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.auth-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--moss); }
.auth-consent span { font-weight: 500 !important; }

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 4px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--sun);
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.auth-submit:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--sun); }
.auth-submit:disabled { cursor: wait; opacity: 0.68; }
.auth-submit b { font-size: 22px; }

.auth-switch,
.auth-secondary-row {
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

.auth-switch button,
.auth-secondary-row button,
.auth-logout {
  border: 0;
  color: var(--moss);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-secondary-row { display: flex; justify-content: space-between; gap: 12px; text-align: left; }
.auth-secondary-row span { color: #7e8d87; }

.auth-notice,
.auth-error {
  margin: -10px 0 20px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.auth-notice { color: #295944; background: #e1efdc; }
.auth-error { color: #8f332c; background: #fae2dd; }

.auth-boundary {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 58, 53, 0.12);
  color: #73837d;
  font-size: 11px;
  line-height: 1.6;
}

.auth-account-card {
  margin: 0 0 24px;
  border-top: 1px solid rgba(23, 58, 53, 0.14);
}
.auth-account-card div { display: grid; grid-template-columns: 110px 1fr; padding: 15px 0; border-bottom: 1px solid rgba(23, 58, 53, 0.12); }
.auth-account-card dt { color: var(--ink-soft); font-size: 12px; }
.auth-account-card dd { margin: 0; font-weight: 800; }
.auth-logout { display: block; min-height: 44px; margin: 18px auto 0; color: var(--danger); }

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.24;
  background-image:
    radial-gradient(rgba(23, 58, 53, 0.16) 0.55px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.7) 0.5px, transparent 0.65px);
  background-position: 0 0, 7px 7px;
  background-size: 13px 13px;
  mix-blend-mode: multiply;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  min-height: 82px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(23, 58, 53, 0.12);
  background: rgba(245, 240, 227, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 48% 52% 54% 46%;
  background: var(--mint);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-3deg);
}

.brand-face {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -2px;
  transform: translateY(2px);
}

.brand-leaf {
  position: absolute;
  top: -8px;
  width: 15px;
  height: 24px;
  border: 2px solid var(--ink);
  background: var(--leaf);
}

.brand-leaf-left {
  left: 8px;
  border-radius: 90% 10% 80% 20%;
  transform: rotate(-30deg);
}

.brand-leaf-right {
  right: 8px;
  border-radius: 10% 90% 20% 80%;
  transform: rotate(30deg);
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 11px;
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(23, 58, 53, 0.13);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8);
}

.role-button,
.seg-button {
  border: 0;
  cursor: pointer;
  transition: 180ms ease;
}

.role-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.role-button:hover {
  color: var(--ink);
  background: rgba(120, 166, 111, 0.12);
}

.role-button.is-active {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 5px 12px rgba(23, 58, 53, 0.2);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.icon-button,
.avatar-button {
  border: 1px solid rgba(23, 58, 53, 0.14);
  background: rgba(255, 253, 247, 0.72);
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
}

.icon-button:hover,
.avatar-button:hover {
  border-color: rgba(23, 58, 53, 0.35);
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.button-label {
  font-size: 12px;
  font-weight: 700;
}

.avatar-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 16px;
  text-align: left;
}

.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  color: var(--white);
  background: var(--moss);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
}

.avatar-copy strong,
.avatar-copy small {
  display: block;
}

.avatar-copy strong {
  font-size: 12px;
}

.avatar-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.workspace {
  min-height: calc(100vh - 82px);
}

.view-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 82px);
}

.side-nav {
  position: sticky;
  top: 82px;
  align-self: start;
  height: calc(100vh - 82px);
  padding: 26px 18px;
  border-right: 1px solid rgba(23, 58, 53, 0.1);
  background: rgba(235, 226, 207, 0.46);
}

.space-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px dashed rgba(23, 58, 53, 0.28);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.58);
}

.space-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--sun);
  font-size: 19px;
}

.space-chip strong,
.space-chip small {
  display: block;
}

.space-chip strong {
  font-size: 13px;
}

.space-chip small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-button:hover {
  color: var(--ink);
  background: rgba(255, 253, 247, 0.56);
  transform: translateX(2px);
}

.nav-button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.nav-button span:first-child {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  font-size: 15px;
}

.nav-button strong {
  font-size: 13px;
}

.nav-note {
  position: absolute;
  right: 18px;
  bottom: 24px;
  left: 18px;
  padding: 14px;
  border: 1px solid rgba(23, 58, 53, 0.12);
  border-radius: 16px;
  background: rgba(207, 227, 196, 0.65);
}

.nav-note strong {
  display: block;
  font-family: var(--display);
  font-size: 14px;
}

.nav-note p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.content {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 34px clamp(22px, 3vw, 50px) 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-head h1,
.dialog-head h2,
.section-title h2,
.child-title h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.page-head h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.page-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.soft-button,
.care-button,
.task-action {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: 170ms ease;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
}

.primary-button {
  color: var(--white);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--sun);
}

.primary-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--sun);
}

.secondary-button {
  border: 1px solid rgba(23, 58, 53, 0.16);
  background: var(--white);
}

.secondary-button:hover,
.soft-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.stack {
  display: grid;
  gap: 20px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 58, 53, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, 0.8);
  box-shadow: var(--soft-shadow);
}

.card-pad {
  padding: 22px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  min-height: 290px;
  background:
    linear-gradient(120deg, rgba(255, 253, 247, 0.95), rgba(207, 227, 196, 0.8)),
    var(--white);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 28px;
}

.hero-copy h2 {
  max-width: 560px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 44px);
  line-height: 1.08;
}

.hero-copy p {
  max-width: 520px;
  margin: 13px 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.hero-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-pill {
  min-width: 104px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.72);
}

.metric-pill strong,
.metric-pill small {
  display: block;
}

.metric-pill strong {
  font-family: var(--display);
  font-size: 21px;
}

.metric-pill small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
}

.scribble {
  position: absolute;
  border: 2px dashed rgba(23, 58, 53, 0.2);
  border-radius: 50%;
}

.scribble-one {
  width: 220px;
  height: 180px;
  transform: rotate(-8deg);
}

.scribble-two {
  width: 180px;
  height: 220px;
  border-color: rgba(239, 118, 95, 0.28);
  transform: rotate(16deg);
}

.pet-avatar {
  --pet-color: var(--mint);
  --pet-accent: var(--leaf);
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 138px;
  border: 3px solid var(--ink);
  border-radius: 48% 52% 44% 56% / 56% 46% 54% 44%;
  background: var(--pet-color);
  box-shadow: 8px 9px 0 var(--ink);
  transform: rotate(-2deg);
  transition: 200ms ease;
}

.pet-avatar.is-small {
  width: 72px;
  height: 66px;
  border-width: 2px;
  box-shadow: 4px 4px 0 var(--ink);
}

.pet-avatar.is-tiny {
  width: 50px;
  height: 46px;
  border-width: 2px;
  box-shadow: 3px 3px 0 var(--ink);
}

.pet-avatar.is-preview {
  width: 116px;
  height: 106px;
  border-width: 2px;
  box-shadow: 5px 5px 0 var(--ink);
}

.pet-avatar.pet-art-avatar {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.pet-avatar.pet-art-avatar::before,
.pet-avatar.pet-art-avatar::after {
  display: none;
}

.pet-art-avatar img {
  display: block;
  width: 116%;
  height: 116%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 3px rgba(23, 58, 53, 0.16));
  transform: translateY(2px);
  user-select: none;
}

.pet-art-avatar.is-small img,
.pet-art-avatar.is-tiny img {
  width: 128%;
  height: 128%;
}

.pet-art-avatar.is-pixel-avatar img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 0 rgba(23, 58, 53, 0.16));
  transform: none;
}

.pet-art-avatar .pet-badge {
  z-index: 2;
}

.pet-avatar::before,
.pet-avatar::after {
  content: "";
  position: absolute;
  top: -22px;
  width: 42px;
  height: 52px;
  border: 3px solid var(--ink);
  background: var(--pet-accent);
  z-index: -1;
}

.pet-avatar::before {
  left: 13px;
  border-radius: 90% 10% 72% 28%;
  transform: rotate(-24deg);
}

.pet-avatar::after {
  right: 13px;
  border-radius: 10% 90% 28% 72%;
  transform: rotate(24deg);
}

.pet-avatar.is-small::before,
.pet-avatar.is-small::after {
  top: -12px;
  width: 22px;
  height: 28px;
  border-width: 2px;
}

.pet-avatar.is-tiny::before,
.pet-avatar.is-tiny::after {
  top: -9px;
  width: 16px;
  height: 20px;
  border-width: 2px;
}

.pet-face {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -4px;
  transform: translate(-2px, 5px);
}

.pet-avatar.is-small .pet-face {
  font-size: 18px;
}

.pet-avatar.is-tiny .pet-face {
  font-size: 14px;
}

.pet-species-mark {
  position: absolute;
  top: 13px;
  left: 17px;
  color: var(--pet-accent);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
  opacity: 0.8;
}

.pet-avatar.is-small .pet-species-mark,
.pet-avatar.is-tiny .pet-species-mark {
  top: 7px;
  left: 9px;
  font-size: 9px;
}

.pet-spark {
  position: absolute;
  top: -16px;
  right: -18px;
  display: none;
  color: var(--sun);
  font-size: 27px;
  text-shadow: 2px 2px 0 var(--ink);
}

.pet-form-1 {
  border-style: dashed;
  filter: saturate(0.72);
}

.pet-form-1::before,
.pet-form-1::after {
  transform: scale(0.62) rotate(-18deg);
}

.pet-form-1::after {
  transform: scale(0.62) rotate(18deg);
}

.pet-form-2::before,
.pet-form-2::after {
  height: 43px;
}

.pet-form-4 {
  background-image: radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.72) 0 5px, transparent 6px);
  outline: 2px dashed color-mix(in srgb, var(--pet-accent), transparent 42%);
  outline-offset: 9px;
}

.pet-form-4 .pet-spark,
.pet-form-5 .pet-spark {
  display: block;
}

.pet-form-5 {
  background-image:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.8) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 34%, rgba(255, 255, 255, 0.55) 0 3px, transparent 4px);
  box-shadow: 8px 9px 0 var(--ink), 0 0 0 11px color-mix(in srgb, var(--pet-accent), transparent 72%);
}

.pet-form-5 .pet-spark {
  animation: pet-twinkle 1.5s ease-in-out infinite alternate;
}

.pet-kind-cloud {
  border-radius: 54% 46% 56% 44% / 48% 52% 48% 52%;
}

.pet-kind-cloud::before,
.pet-kind-cloud::after {
  top: 8px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.pet-kind-cloud::before {
  left: -21px;
  transform: rotate(-8deg);
}

.pet-kind-cloud::after {
  right: -21px;
  transform: rotate(8deg);
}

.pet-kind-ember::before,
.pet-kind-ember::after {
  top: -27px;
  border-radius: 70% 15% 65% 20%;
  clip-path: polygon(50% 0, 100% 100%, 0 82%);
}

.pet-kind-star::before,
.pet-kind-star::after {
  top: -18px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.pet-kind-star::before {
  transform: rotate(-38deg);
}

.pet-kind-star::after {
  transform: rotate(38deg);
}

.pet-kind-tide::before,
.pet-kind-tide::after {
  top: 17px;
  width: 43px;
  height: 30px;
  border-radius: 80% 20% 70% 30%;
}

.pet-kind-tide::before {
  left: -29px;
  transform: rotate(-18deg);
}

.pet-kind-tide::after {
  right: -29px;
  transform: rotate(18deg) scaleX(-1);
}

.pet-kind-moon::before {
  border-radius: 100% 0 100% 0;
  transform: rotate(-13deg);
}

.pet-kind-moon::after {
  border-radius: 0 100% 0 100%;
  transform: rotate(13deg);
}

.pet-badge {
  position: absolute;
  right: -12px;
  bottom: -8px;
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 30px;
  padding: 0 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--sun);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.pet-avatar.is-small .pet-badge,
.pet-avatar.is-tiny .pet-badge {
  right: -7px;
  bottom: -5px;
  min-width: 34px;
  height: 21px;
  padding: 0 5px;
  border-width: 1.5px;
  font-size: 9px;
}

@keyframes pet-twinkle {
  from { transform: rotate(-8deg) scale(0.84); opacity: 0.72; }
  to { transform: rotate(8deg) scale(1.12); opacity: 1; }
}

.progress-wrap {
  margin-top: 18px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.progress {
  overflow: hidden;
  height: 11px;
  border: 1px solid rgba(23, 58, 53, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.7);
}

.progress > span {
  display: block;
  width: var(--progress, 52%);
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      120deg,
      var(--leaf) 0,
      var(--leaf) 10px,
      #94be82 10px,
      #94be82 18px
    );
  transition: width 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 21px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.text-button {
  border: 0;
  color: var(--moss);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-action {
  position: relative;
  min-height: 108px;
  padding: 15px;
  border: 1px solid rgba(23, 58, 53, 0.12);
  border-radius: 17px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: 170ms ease;
}

.quick-action:hover {
  z-index: 2;
  border-color: var(--ink);
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 4px 5px 0 var(--ink);
}

.quick-action span {
  display: block;
  margin-bottom: 12px;
  font-size: 25px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 12px;
}

.quick-action small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.quick-action em {
  position: absolute;
  top: 11px;
  right: 11px;
  color: var(--coral);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.student-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}

.student-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  padding: 17px 8px 13px;
  border: 1px solid rgba(23, 58, 53, 0.11);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.72);
  cursor: pointer;
  transition: 170ms ease;
}

.student-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--soft-shadow);
}

.student-card.is-selected {
  border: 2px solid var(--ink);
  background: #fff8e9;
  box-shadow: 4px 4px 0 var(--sun);
}

.student-card strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.student-card small {
  color: var(--ink-soft);
  font-size: 9px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 17px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 17px;
  background: var(--white);
}

.stat-card strong {
  display: block;
  font-family: var(--display);
  font-size: 25px;
}

.stat-card small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.task-list,
.activity-list,
.simple-list {
  display: grid;
  gap: 10px;
}

.task-item,
.activity-item,
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.68);
}

.task-icon,
.activity-icon,
.list-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--mint);
  font-size: 19px;
}

.task-copy,
.activity-copy,
.list-copy {
  min-width: 0;
  flex: 1;
}

.task-copy strong,
.task-copy small,
.activity-copy strong,
.activity-copy small,
.list-copy strong,
.list-copy small {
  display: block;
}

.task-copy strong,
.activity-copy strong,
.list-copy strong {
  font-size: 12px;
}

.task-copy small,
.activity-copy small,
.list-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-reward,
.tag {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--sun);
  font-size: 9px;
  font-weight: 900;
}

.tag.is-green {
  background: var(--mint);
}

.tag.is-coral {
  background: #f8c1b6;
}

.tag.is-sky {
  background: #c9e4e8;
}

.task-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--white);
  background: var(--moss);
  font-size: 10px;
}

.task-action:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--sun);
}

.task-action:disabled {
  color: var(--ink-soft);
  background: var(--paper-deep);
  cursor: default;
  box-shadow: none;
  transform: none;
}

.timeline-line {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 39px;
  width: 1px;
  background: rgba(23, 58, 53, 0.14);
}

.activity-item {
  position: relative;
  border: 0;
  background: transparent;
}

.activity-icon {
  position: relative;
  z-index: 1;
  border: 4px solid var(--white);
}

.split-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ledger-card {
  padding: 17px;
  border: 1px dashed rgba(23, 58, 53, 0.25);
  border-radius: 17px;
  background: rgba(255, 253, 247, 0.72);
}

.ledger-card span,
.ledger-card strong,
.ledger-card small {
  display: block;
}

.ledger-card span {
  color: var(--ink-soft);
  font-size: 9px;
}

.ledger-card strong {
  margin: 5px 0 2px;
  font-family: var(--display);
  font-size: 26px;
}

.ledger-card small {
  font-size: 9px;
}

.collection-grid,
.shop-grid,
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.shop-item,
.badge-item,
.collection-item {
  padding: 17px;
  border: 1px solid rgba(23, 58, 53, 0.11);
  border-radius: 18px;
  background: var(--white);
}

.shop-visual,
.badge-visual,
.collection-visual {
  display: grid;
  place-items: center;
  min-height: 106px;
  margin-bottom: 12px;
  border-radius: 15px;
  background: var(--paper-deep);
  font-size: 48px;
}

.shop-item strong,
.shop-item small,
.badge-item strong,
.badge-item small,
.collection-item strong,
.collection-item small {
  display: block;
}

.shop-item small,
.badge-item small,
.collection-item small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.shop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.hero-inline-link {
  margin-top: 15px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.pet-house-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 20px;
  margin-bottom: 20px;
}

.pet-evolution-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  min-height: 350px;
  background:
    radial-gradient(circle at 90% 10%, rgba(242, 189, 87, 0.22), transparent 28%),
    linear-gradient(125deg, rgba(255, 253, 247, 0.96), rgba(207, 227, 196, 0.83));
}

.pet-evolution-copy {
  position: relative;
  z-index: 1;
  padding: 30px;
}

.pet-evolution-copy h2,
.pet-preview-card h2,
.child-evolution-copy h2 {
  margin: 5px 0 10px;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
}

.pet-evolution-copy > p,
.pet-preview-card > p,
.child-evolution-copy > p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.pet-level-line {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
}

.pet-level-line > span {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 900;
}

.pet-level-line > strong {
  font-size: 10px;
}

.evolution-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.evolution-meta > span {
  padding: 12px;
  border: 1px dashed rgba(23, 58, 53, 0.2);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.62);
}

.evolution-meta small,
.evolution-meta strong {
  display: block;
}

.evolution-meta small {
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.evolution-meta strong {
  font-size: 10px;
}

.prototype-hint {
  margin: 15px 0 0;
  padding-left: 11px;
  border-left: 3px solid var(--coral);
  font-size: 9px !important;
}

.pet-evolution-visual {
  position: relative;
  display: grid;
  place-content: center;
  place-items: center;
  gap: 16px;
  overflow: hidden;
  min-height: 310px;
}

.pet-evolution-visual .pet-avatar {
  z-index: 1;
}

.pet-evolution-visual > strong {
  font-family: var(--display);
  font-size: 27px;
}

.pet-evolution-visual > small {
  color: var(--ink-soft);
  font-size: 9px;
}

.evolution-orbit {
  position: absolute;
  width: 245px;
  height: 245px;
  border: 2px dashed rgba(23, 58, 53, 0.18);
  border-radius: 44% 56% 50% 50%;
  animation: slow-orbit 20s linear infinite;
}

.evolution-orbit::before,
.evolution-orbit::after {
  content: "✦";
  position: absolute;
  color: var(--sun);
  font-size: 22px;
}

.evolution-orbit::before { top: 18px; right: 16px; }
.evolution-orbit::after { bottom: 24px; left: 12px; }

.pet-preview-card {
  padding: 25px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.88), rgba(255, 253, 247, 0.88)),
    repeating-linear-gradient(-45deg, var(--paper-deep) 0 8px, transparent 8px 16px);
}

.preview-pet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 105px;
}

.pet-preview-card h2 {
  font-size: 31px;
}

.pet-facts {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.pet-facts > div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(23, 58, 53, 0.16);
  font-size: 9px;
}

.pet-facts dt { color: var(--ink-soft); }
.pet-facts dd { margin: 0; font-weight: 800; }

.pet-preview-card .primary-button {
  width: 100%;
  margin-top: 14px;
}

.switch-note {
  display: block;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.6;
}

.production-preview {
  margin-top: 17px;
  padding: 12px;
  border: 1px solid rgba(62, 139, 120, 0.22);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(207, 227, 196, 0.48), rgba(255, 248, 233, 0.76));
}

.production-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.production-preview-head > span:first-child,
.production-preview-head strong,
.production-preview-head small {
  display: block;
}

.production-preview-head strong {
  font-family: var(--display);
  font-size: 11px;
}

.production-preview-head small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 7px;
}

.production-stamp {
  padding: 4px 6px;
  border: 1px solid var(--moss);
  border-radius: 999px;
  color: var(--moss);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(-4deg);
}

.production-stage-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.production-stage-row figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.production-stage-row img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(23, 58, 53, 0.08);
  border-radius: 9px;
  background: rgba(255, 253, 247, 0.72);
  object-fit: contain;
}

.production-stage-row figcaption {
  margin-top: 4px;
}

.production-stage-row figcaption strong,
.production-stage-row figcaption small {
  display: block;
}

.animation-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(62, 139, 120, 0.22);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.82);
}

.animation-preview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.animation-preview-row figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.animation-preview-row figure > span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(23, 58, 53, 0.09);
  border-radius: 11px;
  background:
    radial-gradient(circle at 50% 70%, rgba(207, 227, 196, 0.78), transparent 52%),
    rgba(255, 253, 247, 0.9);
}

.animation-preview-row img {
  display: block;
  width: 112%;
  height: 112%;
  object-fit: contain;
  image-rendering: pixelated;
}

.animation-preview-row figcaption {
  margin-top: 4px;
}

.animation-preview-row figcaption strong,
.animation-preview-row figcaption small {
  display: block;
}

.animation-preview-row figcaption strong {
  color: var(--moss);
  font-size: 8px;
}

.animation-preview-row figcaption small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 6px;
  white-space: nowrap;
}

.production-stage-row figcaption strong {
  color: var(--coral);
  font-size: 7px;
}

.production-stage-row figcaption small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 6px;
  white-space: nowrap;
}

.evolution-card,
.pet-catalog-section {
  margin-bottom: 20px;
}

.evolution-road {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.evolution-road::before {
  content: "";
  position: absolute;
  top: 36px;
  right: 8%;
  left: 8%;
  height: 3px;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, rgba(23, 58, 53, 0.2) 0 7px, transparent 7px 13px);
}

.evolution-stop {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px;
  text-align: center;
  opacity: 0.46;
}

.evolution-stop.is-reached { opacity: 1; }

.evolution-stop.is-current {
  border-radius: 18px;
  background: var(--mint);
  box-shadow: 4px 4px 0 var(--sun);
}

.evolution-pet {
  display: grid;
  place-items: center;
  width: 76px;
  height: 70px;
}

.evolution-stop > span {
  margin-top: 8px;
  color: var(--coral);
  font-size: 8px;
  font-weight: 900;
}

.evolution-stop > strong { font-family: var(--display); font-size: 15px; }
.evolution-stop > small { color: var(--ink-soft); font-size: 8px; }

.pet-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pet-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(23, 58, 53, 0.14);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
  cursor: pointer;
}

.pet-category-tab strong {
  font-family: var(--display);
  font-size: 13px;
}

.pet-category-tab small {
  color: var(--ink-soft);
  font-size: 8px;
}

.pet-category-tab.is-active {
  border-color: var(--ink);
  background: var(--mint);
  box-shadow: 3px 3px 0 var(--sun);
}

.pet-series-preview {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(220px, 1.15fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px dashed rgba(23, 58, 53, 0.18);
  border-radius: 18px;
  background: rgba(244, 237, 218, 0.44);
}

.pet-series-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 13px;
  object-fit: cover;
  object-position: center;
}

.pet-series-preview figcaption {
  display: grid;
  gap: 6px;
  margin: 0;
}

.pet-series-preview strong {
  font-family: var(--display);
  font-size: 23px;
}

.pet-series-preview span,
.pet-culture-note {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.65;
}

.pet-culture-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--sun);
  background: rgba(246, 226, 182, 0.28);
}

.pet-catalog-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.pet-catalog-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 205px;
  padding: 20px 10px 13px;
  border: 1px solid rgba(23, 58, 53, 0.12);
  border-radius: 19px;
  background: var(--white);
  text-align: center;
  cursor: pointer;
  transition: 180ms ease;
}

.pet-catalog-card:hover,
.pet-catalog-card.is-selected {
  transform: translateY(-3px) rotate(-0.6deg);
  border-color: var(--leaf);
  box-shadow: 5px 6px 0 rgba(120, 166, 111, 0.28);
}

.pet-catalog-card.is-active {
  background: linear-gradient(155deg, var(--white), var(--mint));
}

.pet-catalog-card.is-locked .pet-avatar:not(.pet-art-avatar) {
  opacity: 0.52;
  filter: grayscale(0.85);
}

.pet-catalog-card.is-locked .pet-art-avatar {
  opacity: 0.88;
  filter: none;
}

.pet-catalog-card .pet-art-avatar.is-small {
  width: 96px;
  height: 88px;
  margin: 7px 0 2px;
}

.pet-catalog-card > strong { font-family: var(--display); font-size: 15px; }
.pet-catalog-card > small { color: var(--ink-soft); font-size: 8px; line-height: 1.45; }

.catalog-state {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 7px;
  font-weight: 900;
}

.catalog-art-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 6px;
  border: 1px solid rgba(62, 139, 120, 0.24);
  border-radius: 999px;
  color: var(--moss);
  background: #eaf4e7;
  font-size: 7px;
  font-weight: 900;
}

.upgrade-rules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.upgrade-rules article {
  position: relative;
  min-height: 142px;
  padding: 18px;
  overflow: hidden;
  border: 1px dashed rgba(23, 58, 53, 0.2);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.68);
}

.upgrade-rules article > span {
  position: absolute;
  right: 10px;
  bottom: -16px;
  color: rgba(23, 58, 53, 0.06);
  font-family: var(--display);
  font-size: 78px;
  font-weight: 900;
}

.upgrade-rules strong,
.upgrade-rules small { position: relative; z-index: 1; display: block; }
.upgrade-rules strong { margin-bottom: 9px; font-family: var(--display); font-size: 17px; }
.upgrade-rules small { color: var(--ink-soft); font-size: 9px; line-height: 1.6; }

.child-evolution {
  padding: 28px 0 100px;
}

.child-evolution-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
  gap: 34px;
  max-width: 980px;
  margin: 0 auto 28px;
}

.child-evolution-hero > div:first-child {
  display: grid;
  justify-items: center;
  min-height: 250px;
}

.child-evolution-copy {
  padding: 25px;
  border: 1px solid rgba(23, 58, 53, 0.12);
  border-radius: 26px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--soft-shadow);
}

.child-evolution-copy > small {
  display: block;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.child-evolution-road {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 13px;
  max-width: 1080px;
  margin: 0 auto;
}

.child-form {
  display: grid;
  justify-items: center;
  min-height: 190px;
  padding: 22px 12px 15px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.78);
  text-align: center;
}

.child-form.is-locked {
  border-style: dashed;
  opacity: 0.48;
}

.child-form > div { min-height: 78px; }
.child-form > span { color: var(--coral); font-size: 12px; font-weight: 900; }
.child-form > strong { margin: 4px 0; font-family: var(--display); font-size: 16px; }
.child-form > small { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

.child-form .pet-avatar.is-small .pet-species-mark,
.child-form .pet-avatar.is-small .pet-badge {
  font-size: 12px;
}

@keyframes slow-orbit {
  to { transform: rotate(360deg); }
}

.soft-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  background: var(--mint);
  font-size: 9px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  height: 190px;
  padding-top: 25px;
}

.bar {
  position: relative;
  height: var(--height);
  min-height: 12px;
  border-radius: 10px 10px 3px 3px;
  background: var(--leaf);
}

.bar:nth-child(2n) {
  background: var(--sky);
}

.bar::after {
  content: attr(data-label);
  position: absolute;
  right: 0;
  bottom: -22px;
  left: 0;
  color: var(--ink-soft);
  font-size: 9px;
  text-align: center;
}

.family-hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(242, 189, 87, 0.4), transparent 14rem),
    linear-gradient(130deg, #fff8e9, #f7e0d8);
}

.care-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.care-button {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.84);
}

.care-button:hover {
  border-color: var(--ink);
  transform: translateY(-3px) rotate(1deg);
  box-shadow: 4px 4px 0 var(--sun);
}

.care-button span {
  margin-bottom: 7px;
  font-size: 23px;
}

.care-button small {
  font-size: 9px;
  font-weight: 800;
}

.child-view {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 24px clamp(18px, 4vw, 54px) 28px;
  background:
    radial-gradient(circle at 15% 17%, rgba(242, 189, 87, 0.46), transparent 18rem),
    radial-gradient(circle at 88% 78%, rgba(128, 185, 194, 0.4), transparent 22rem),
    #dce8d1;
}

.child-view::before {
  content: "";
  position: absolute;
  right: -5%;
  bottom: -23%;
  width: 520px;
  height: 520px;
  border: 3px dashed rgba(23, 58, 53, 0.18);
  border-radius: 50%;
}

.child-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.child-tabs {
  position: sticky;
  z-index: 8;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  width: fit-content;
  padding: 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.85);
  box-shadow: 5px 5px 0 var(--ink);
}

.child-tabs button {
  min-width: 82px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.child-tabs button > span,
.child-tabs button > strong {
  display: block;
}

.child-tabs button > span {
  margin-bottom: 2px;
  font-family: var(--display);
  font-size: 15px;
}

.child-tabs button > strong {
  font-size: 14px;
  line-height: 1.2;
}

.child-tabs button.is-active {
  color: var(--white);
  background: var(--ink);
}

.child-title h1 {
  font-size: clamp(26px, 4vw, 48px);
}

.child-title p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.child-title p strong {
  display: inline-block;
  min-width: 3.15em;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
}

.child-exit {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--white);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.child-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(300px, 0.8fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: center;
  min-height: 560px;
  padding-bottom: 34px;
}

.pet-stage {
  display: grid;
  place-items: center;
}

.pet-stage .pet-avatar {
  width: clamp(190px, 27vw, 330px);
  height: clamp(175px, 25vw, 300px);
  border-width: 5px;
  box-shadow: 14px 16px 0 var(--ink);
}

.pet-stage .pet-avatar::before,
.pet-stage .pet-avatar::after {
  top: -50px;
  width: 80px;
  height: 100px;
  border-width: 5px;
}

.pet-stage .pet-face {
  font-size: clamp(40px, 6vw, 70px);
}

.pet-stage .pet-badge {
  right: -20px;
  bottom: -12px;
  height: 46px;
  padding: 0 14px;
  border-width: 3px;
  font-size: 17px;
}

.speech-bubble {
  position: relative;
  max-width: 380px;
  margin: 0 auto 26px;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--white);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  box-shadow: 5px 5px 0 var(--sun);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--white);
  transform: translateX(-50%) rotate(45deg);
}

.child-panel {
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.87);
  box-shadow: 8px 8px 0 var(--ink);
}

.child-panel h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 24px;
}

.child-care-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.child-care-grid .care-button {
  min-height: 100px;
  border: 2px solid var(--ink);
  background: var(--white);
}

.child-care-grid .care-button span {
  font-size: 31px;
}

.child-care-grid .care-button small {
  font-size: 14px;
  line-height: 1.25;
}

.child-task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
  border: 2px dashed rgba(23, 58, 53, 0.38);
  border-radius: 15px;
  background: #fff7dd;
}

.child-task-card .task-copy {
  min-width: 0;
  flex: 1 1 10rem;
}

.child-task-card strong,
.child-task-card small {
  display: block;
}

.child-task-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.child-task-card small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.child-view .task-action {
  min-height: 44px;
  padding-inline: 14px;
  font-size: 14px;
}

.child-view .eyebrow {
  font-size: 12px;
  line-height: 1.45;
}

.child-evolution-copy > p {
  font-size: 14px;
}

.child-view .collection-item strong,
.child-view .badge-item strong {
  font-size: 15px;
  line-height: 1.4;
}

.child-view .collection-item small,
.child-view .badge-item small {
  font-size: 12px;
  line-height: 1.55;
}

.child-rest-view {
  display: grid;
  place-items: center;
  isolation: isolate;
  padding-block: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 18%, rgba(246, 226, 182, 0.6), transparent 18rem),
    radial-gradient(circle at 82% 76%, rgba(128, 185, 194, 0.34), transparent 24rem),
    #d6e2d9;
}

.child-rest-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(680px, 100%);
  padding: clamp(28px, 6vw, 58px);
  border: 3px solid var(--ink);
  border-radius: 38px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 13px 15px 0 var(--ink);
  text-align: center;
}

.child-rest-card h1 {
  margin: 8px 0 10px;
  font-family: var(--display);
  font-size: clamp(36px, 7vw, 64px);
}

.child-rest-card > p {
  max-width: 34rem;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.child-rest-card > small {
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.rest-moon {
  position: absolute;
  top: 22px;
  right: 28px;
  color: #c58a28;
  font-family: var(--display);
  font-size: 54px;
  transform: rotate(-12deg);
}

.rest-pet {
  display: grid;
  justify-items: center;
  margin-bottom: 22px;
}

.rest-pet .pet-avatar {
  transform: rotate(-4deg) scale(0.88);
  filter: saturate(0.82);
}

.rest-adult-button {
  min-height: 54px;
  padding-inline: 22px;
}

.projector-view {
  min-height: calc(100vh - 82px);
  padding: 24px 30px 38px;
  color: var(--white);
  background:
    radial-gradient(circle at 12% 20%, rgba(242, 189, 87, 0.25), transparent 26rem),
    radial-gradient(circle at 90% 80%, rgba(128, 185, 194, 0.22), transparent 30rem),
    #153c36;
}

.projector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.projector-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 54px);
}

.projector-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.projector-actions {
  display: flex;
  gap: 10px;
}

.projector-actions button {
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.class-goal {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.class-goal strong {
  font-family: var(--display);
  font-size: 18px;
}

.class-goal .progress {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.18);
}

.projector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.projector-student {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 180px;
  padding: 25px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  transition: 200ms ease;
}

.projector-student:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-3px);
}

.projector-student strong {
  margin-top: 15px;
  font-family: var(--display);
  font-size: 16px;
}

.projector-student small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
}

.projector-student .pet-avatar {
  --ink: #173a35;
  color: #173a35;
}

.privacy-on .student-name {
  filter: blur(5px);
  user-select: none;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 50px 20px;
  text-align: center;
}

.empty-state span {
  font-size: 55px;
}

.empty-state h2 {
  margin: 15px 0 6px;
  font-family: var(--display);
}

.empty-state p {
  max-width: 440px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.page-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--coral);
  color: var(--ink-soft);
  background: rgba(239, 118, 95, 0.08);
  font-size: 10px;
  line-height: 1.65;
}

.flow-dialog,
.pin-dialog {
  color: var(--ink);
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 12px 12px 0 var(--ink);
}

.flow-dialog::backdrop,
.pin-dialog::backdrop {
  background: rgba(15, 37, 34, 0.68);
  backdrop-filter: blur(5px);
}

.flow-dialog {
  width: min(1050px, calc(100% - 32px));
  padding: 28px;
  border-radius: 28px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-head h2 {
  font-size: clamp(25px, 4vw, 40px);
}

.close-dialog,
.close-pin {
  font-size: 22px;
}

.flow-track {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.flow-step {
  position: relative;
  min-height: 220px;
  padding: 23px 17px 18px;
  border: 1px solid rgba(23, 58, 53, 0.14);
  border-radius: 20px;
  background: var(--white);
}

.flow-step:nth-of-type(2) {
  background: #e6f1ef;
}

.flow-step:nth-of-type(3) {
  background: #fff0d2;
}

.flow-step:nth-of-type(4) {
  background: #f9e3dd;
}

.flow-index {
  position: absolute;
  top: 12px;
  right: 13px;
  color: rgba(23, 58, 53, 0.3);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 900;
}

.flow-icon {
  font-size: 39px;
}

.flow-step h3 {
  margin: 18px 0 8px;
  font-family: var(--display);
}

.flow-step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.flow-arrow {
  color: var(--coral);
  font-size: 25px;
  font-weight: 900;
}

.ledger-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 15px;
  border: 1px dashed rgba(23, 58, 53, 0.32);
  border-radius: 16px;
  background: rgba(207, 227, 196, 0.55);
}

.ledger-note strong {
  margin-right: auto;
  font-family: var(--display);
}

.ledger-note span {
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.7);
  font-size: 9px;
  font-weight: 800;
}

.child-entry-dialog {
  width: min(650px, calc(100% - 32px));
  max-height: min(860px, calc(100dvh - 32px));
  overflow: auto;
  padding: clamp(22px, 4vw, 36px);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 94% 8%, rgba(242, 189, 87, 0.28), transparent 13rem),
    var(--paper);
  box-shadow: 10px 12px 0 var(--ink);
}

.child-entry-dialog::backdrop {
  background: rgba(15, 37, 34, 0.7);
  backdrop-filter: blur(6px);
}

.child-entry-dialog .close-child-entry.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.child-entry-dialog > h2 {
  margin: 3px 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 42px);
}

.entry-lead {
  max-width: 33rem;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.entry-section {
  padding: 15px;
  border: 1px solid rgba(23, 58, 53, 0.15);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.74);
}

.entry-section + .entry-section {
  margin-top: 11px;
}

.entry-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.entry-section-head > strong {
  font-family: var(--display);
  font-size: 15px;
}

.entry-section-head > small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.child-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 15px;
  background: #f1f6e9;
  text-align: left;
  box-shadow: 3px 3px 0 var(--ink);
}

.child-choice-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--sun);
  font-family: var(--display);
  font-weight: 900;
}

.child-choice > span:nth-child(2) strong,
.child-choice > span:nth-child(2) small {
  display: block;
}

.child-choice > span:nth-child(2) small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.child-choice-check {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--white);
  border-radius: 50%;
  background: var(--moss);
  font-weight: 900;
}

.session-choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fff5d4;
}

.session-choice > span {
  font-size: 23px;
}

.session-choice > strong {
  font-family: var(--display);
  font-size: 18px;
}

.session-choice > small {
  justify-self: end;
  color: var(--ink-soft);
  font-size: 9px;
}

.pin-field {
  display: grid;
  gap: 6px;
}

.pin-field + .pin-field {
  margin-top: 10px;
}

.pin-field[hidden] {
  display: none;
}

.pin-field > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.pin-field input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--ink);
  border: 2px solid rgba(23, 58, 53, 0.28);
  border-radius: 12px;
  background: var(--white);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.35em;
}

.pin-field input:focus {
  border-color: var(--ink);
  outline: 3px solid rgba(242, 189, 87, 0.45);
}

.entry-error {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
}

.entry-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}

.entry-scope strong,
.entry-scope span {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 9px;
}

.entry-scope strong {
  color: var(--white);
  background: var(--ink);
}

.entry-scope span {
  background: var(--mint);
  font-weight: 800;
}

.entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 19px;
}

.pin-dialog {
  width: min(390px, calc(100% - 32px));
  padding: 28px;
  border-radius: 26px;
  text-align: center;
}

.pin-dialog .close-pin {
  position: absolute;
  top: 12px;
  right: 12px;
}

.pin-dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
}

.pin-dialog p {
  color: var(--ink-soft);
  font-size: 11px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 13px;
  margin: 22px 0;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: transparent;
}

.pin-dots span.is-filled {
  background: var(--coral);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.pin-pad button {
  min-height: 56px;
  border: 1px solid rgba(23, 58, 53, 0.16);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.pin-pad button:not(:disabled):hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--sun);
}

.pin-empty {
  visibility: hidden;
}

.pin-error {
  min-height: 18px;
  color: var(--danger) !important;
  font-weight: 800;
}

.pin-lock-note {
  padding: 12px;
  color: var(--ink) !important;
  border-radius: 13px;
  background: #fff1ce;
  line-height: 1.65;
}

.pin-pad[hidden],
.pin-dots[hidden],
.pin-lock-note[hidden] {
  display: none !important;
}

.pin-pad button:disabled:not(.pin-empty) {
  cursor: not-allowed;
  opacity: 0.45;
}

.child-session-boot .topbar,
.topbar[hidden] {
  display: none !important;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  width: min(370px, calc(100% - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
  animation: toast-in 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--mint);
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 12px;
}

.toast small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pet-hop {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  45% {
    transform: translateY(-18px) rotate(2deg);
  }
}

.pet-avatar.is-hopping {
  animation: pet-hop 620ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .brand small,
  .avatar-copy,
  .button-label {
    display: none;
  }

  .role-switcher {
    justify-self: center;
  }

  .role-button {
    padding: 9px 11px;
  }

  .student-strip,
  .projector-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pet-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .pet-series-preview {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 10px 14px;
    backdrop-filter: none;
  }

  .role-switcher {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 253, 247, 0.95);
    box-shadow: var(--shadow);
  }

  .role-button {
    justify-content: center;
    padding: 10px 6px;
    font-size: 10px;
  }

  .view-shell {
    display: block;
  }

  .side-nav {
    position: static;
    display: flex;
    width: 100%;
    height: auto;
    overflow-x: auto;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 58, 53, 0.1);
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .space-chip,
  .nav-note {
    display: none;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-button {
    width: auto;
    padding: 9px 12px;
  }

  .nav-button:hover {
    transform: none;
  }

  .content {
    padding: 24px 16px 100px;
  }

  .dashboard-grid,
  .hero-card,
  .child-stage,
  .pet-house-grid,
  .pet-evolution-hero {
    grid-template-columns: 1fr;
  }

  .pet-evolution-visual {
    min-height: 260px;
    order: -1;
  }

  .upgrade-rules {
    grid-template-columns: repeat(2, 1fr);
  }

  .child-evolution-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 220px;
  }

  .child-stage {
    padding: 30px 0 90px;
  }

  .projector-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-track {
    grid-template-columns: 1fr 1fr;
  }

  .flow-arrow {
    display: none;
  }

  .ledger-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .ledger-note strong {
    margin-right: 0;
  }
}

@media (max-width: 620px) {
  .brand strong {
    font-size: 20px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .top-actions .icon-button {
    display: none;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .head-actions button {
    flex: 1;
  }

  .student-strip,
  .collection-grid,
  .shop-grid,
  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions,
  .care-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid,
  .split-ledger {
    grid-template-columns: 1fr 1fr;
  }

  .child-view {
    padding: 20px 14px 100px;
  }

  .child-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .child-tabs::-webkit-scrollbar {
    display: none;
  }

  .child-tabs button {
    flex: 0 0 auto;
  }

  .child-top {
    align-items: flex-start;
  }

  .child-care-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projector-view {
    padding: 18px 14px 100px;
  }

  .projector-head,
  .class-goal {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .projector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pet-level-line {
    grid-template-columns: auto 1fr;
  }

  .pet-level-line > strong {
    grid-column: 1 / -1;
  }

  .evolution-meta {
    grid-template-columns: 1fr;
  }

  .evolution-road,
  .child-evolution-road {
    display: flex;
    overflow-x: auto;
    padding: 7px 3px 15px;
    scrollbar-width: none;
  }

  .evolution-road::-webkit-scrollbar,
  .child-evolution-road::-webkit-scrollbar {
    display: none;
  }

  .evolution-road::before {
    display: none;
  }

  .evolution-stop,
  .child-form {
    flex: 0 0 148px;
  }

  .pet-catalog-grid,
  .upgrade-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .child-evolution-hero {
    min-width: 0;
  }

  .child-evolution-copy {
    padding: 20px;
  }

  .flow-track {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 家长端首阶段：家庭上下文、组织绑定与首次认领 */
:root {
  --brand-canvas: #f5f0e3;
  --brand-surface: #fffdf7;
  --brand-surface-muted: #ebe2cf;
  --brand-ink: #173a35;
  --brand-ink-muted: #48635d;
  --brand-primary: #416b57;
  --brand-coral-fg: #ad3f32;
  --status-success-fg: #2f6f55;
  --status-success-bg: #eaf5ee;
  --status-info-fg: #2d6f8e;
  --status-info-bg: #eef7fb;
  --status-warning-fg: #8a5c12;
  --status-warning-bg: #fff4d6;
  --status-pending-fg: #6a5b79;
  --status-pending-bg: #f6f0fa;
  --status-danger-fg: #b6473e;
  --status-danger-bg: #fff0ed;
}

.parent-shell {
  --theme-canvas: #f5f0e3;
  --theme-surface: #eef5e9;
  --theme-primary: #416b57;
  --theme-primary-hover: #315543;
  --theme-soft: #cfe3c4;
  --theme-accent: #d99524;
  background:
    radial-gradient(circle at 82% 8%, rgba(207, 227, 196, 0.44), transparent 26rem),
    var(--theme-canvas);
}

.parent-content .eyebrow {
  color: var(--brand-coral-fg);
}

.parent-nav {
  background:
    linear-gradient(rgba(235, 226, 207, 0.52), rgba(235, 226, 207, 0.7)),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(23, 58, 53, 0.025) 18px 19px);
}

.parent-space-chip {
  position: relative;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.parent-space-chip .space-icon {
  color: var(--brand-ink);
  background: var(--theme-soft);
}

.parent-space-chip > span:nth-child(2) {
  min-width: 0;
}

.parent-space-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-chevron {
  margin-left: auto;
  font-size: 18px;
  font-weight: 900;
}

.parent-nav .nav-button.is-active {
  box-shadow: 4px 4px 0 rgba(23, 58, 53, 0.16);
}

.parent-boundary-note {
  background: linear-gradient(135deg, rgba(207, 227, 196, 0.72), rgba(255, 253, 247, 0.8));
}

.parent-context-wrap {
  position: relative;
  z-index: 8;
  margin-bottom: 26px;
}

.parent-context-bar {
  display: grid;
  grid-template-columns: minmax(150px, auto) 1px minmax(150px, auto) minmax(190px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 9px 12px;
  border: 1px solid rgba(23, 58, 53, 0.14);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 10px 30px rgba(48, 58, 44, 0.08);
  backdrop-filter: blur(14px);
}

.context-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 5px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.context-switch:hover {
  background: var(--theme-surface);
}

.context-switch > span:nth-child(2) {
  min-width: 0;
}

.context-switch small,
.context-switch strong {
  display: block;
}

.context-switch small {
  margin-bottom: 2px;
  color: var(--brand-ink-muted);
  font-size: 10px;
}

.context-switch strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(23, 58, 53, 0.16);
  border-radius: 12px;
  background: var(--theme-soft);
  font-family: var(--display);
  font-weight: 900;
}

.context-mark.is-child {
  background: var(--status-warning-bg);
}

.context-divider {
  width: 1px;
  height: 32px;
  background: rgba(23, 58, 53, 0.13);
}

.adult-context-badge {
  justify-self: end;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--status-success-fg);
  background: var(--status-success-bg);
  font-size: 11px;
  font-weight: 800;
}

.adult-context-badge span {
  margin-right: 5px;
  font-size: 7px;
}

.context-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  max-height: min(620px, calc(100dvh - 190px));
  padding: 22px;
  overflow: auto;
  border: 2px solid var(--brand-ink);
  border-radius: 24px;
  background: var(--brand-surface);
  box-shadow: 8px 9px 0 var(--brand-ink), var(--shadow);
}

.context-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.context-panel-head h2,
.family-overview-card h2,
.adult-boundary-card h2,
.journey-card h2,
.parent-form h2,
.privacy-aside h2,
.boundary-process h2,
.status-result-card h2,
.next-step-card h2,
.claim-preview h2,
.more-service-card h2,
.centered-empty h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
}

.context-panel-head p,
.family-overview-copy > p,
.adult-boundary-card p,
.journey-action p,
.form-intro p,
.privacy-aside p,
.boundary-process p,
.status-result-card p,
.next-step-card p,
.claim-preview p,
.more-service-card p,
.centered-empty p {
  color: var(--brand-ink-muted);
  line-height: 1.65;
}

.context-panel-head p {
  margin: 5px 0 0;
  font-size: 12px;
}

.family-switch-list {
  display: grid;
  gap: 12px;
}

.family-switch-card {
  padding: 10px;
  border: 1px solid rgba(23, 58, 53, 0.13);
  border-radius: 18px;
  background: rgba(245, 240, 227, 0.5);
}

.family-switch-card.is-current {
  border-color: var(--theme-primary);
  background: var(--theme-surface);
}

.family-switch-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 50px;
  padding: 6px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.family-switch-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-surface);
}

.family-switch-main strong,
.family-switch-main small {
  display: block;
}

.family-switch-main small {
  margin-top: 3px;
  color: var(--brand-ink-muted);
  font-size: 10px;
}

.child-switch-row {
  display: flex;
  gap: 8px;
  padding: 7px 6px 3px 50px;
  overflow-x: auto;
}

.child-switch-pill {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  min-width: 132px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(23, 58, 53, 0.13);
  border-radius: 14px;
  background: var(--brand-surface);
  text-align: left;
  cursor: pointer;
}

.child-switch-pill > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--status-warning-bg);
  font-family: var(--display);
  font-weight: 900;
}

.child-switch-pill strong,
.child-switch-pill small {
  white-space: nowrap;
}

.child-switch-pill small {
  color: var(--brand-ink-muted);
  font-size: 9px;
}

.child-switch-pill.is-current {
  border-color: var(--theme-primary);
  box-shadow: inset 0 0 0 1px var(--theme-primary);
}

.child-switch-pill.is-add {
  border-style: dashed;
  background: transparent;
}

.context-create-family {
  width: 100%;
  margin-top: 12px;
}

.empty-inline {
  margin: auto 0;
  color: var(--brand-ink-muted);
  font-size: 11px;
}

.family-welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.family-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(250px, 0.7fr);
  min-height: 350px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(217, 149, 36, 0.22), transparent 11rem),
    linear-gradient(135deg, var(--theme-surface), var(--brand-surface));
}

.family-overview-copy {
  z-index: 1;
  align-self: center;
  padding: clamp(24px, 4vw, 46px);
}

.family-overview-copy h2 {
  font-size: clamp(34px, 4vw, 56px);
}

.family-overview-copy > p {
  max-width: 580px;
  margin: 12px 0 22px;
  font-size: 14px;
}

.context-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.context-summary span {
  padding: 12px;
  border: 1px solid rgba(23, 58, 53, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.65);
}

.context-summary small,
.context-summary strong {
  display: block;
}

.context-summary small {
  color: var(--brand-ink-muted);
  font-size: 9px;
}

.context-summary strong {
  margin-top: 4px;
  font-size: 11px;
}

.family-overview-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.home-ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 2px dashed rgba(23, 58, 53, 0.2);
  border-radius: 50%;
  animation: spin-slow 20s linear infinite;
}

.empty-pet-seed {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  min-height: 220px;
  padding: 20px;
  text-align: center;
}

.empty-pet-seed > span {
  display: grid;
  place-items: center;
  width: 104px;
  height: 118px;
  margin-bottom: 14px;
  border: 2px solid var(--brand-ink);
  border-radius: 50% 50% 44% 44%;
  background: var(--brand-surface);
  box-shadow: 7px 8px 0 var(--theme-soft);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.empty-pet-seed strong,
.empty-pet-seed small {
  display: block;
}

.empty-pet-seed small {
  margin-top: 6px;
  color: var(--brand-ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

.adult-boundary-card {
  background: var(--brand-surface);
}

.boundary-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.boundary-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px dashed rgba(23, 58, 53, 0.15);
}

.boundary-list li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--status-success-fg);
  background: var(--status-success-bg);
  font-weight: 900;
}

.boundary-list p {
  margin: 0;
}

.boundary-list strong,
.boundary-list small {
  display: block;
}

.boundary-list small {
  margin-top: 3px;
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.5;
}

.journey-card {
  margin-top: 20px;
}

.journey-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.journey-rail::before {
  content: "";
  position: absolute;
  top: 20px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: rgba(23, 58, 53, 0.18);
}

.journey-step {
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
}

.journey-step > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(23, 58, 53, 0.18);
  border-radius: 50%;
  background: var(--brand-surface-muted);
  font-family: var(--display);
  font-weight: 900;
}

.journey-step.is-done > span {
  color: var(--brand-surface);
  background: var(--theme-primary);
}

.journey-step strong,
.journey-step small {
  display: block;
}

.journey-step small {
  margin-top: 4px;
  color: var(--brand-ink-muted);
  font-size: 9px;
  line-height: 1.45;
}

.journey-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(23, 58, 53, 0.18);
}

.journey-action p {
  margin: 0;
  font-size: 12px;
}

.flow-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(760px, 100%);
  margin: -4px 0 28px;
}

.flow-progress > span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--brand-ink-muted);
}

.flow-progress > span::before,
.flow-progress > span::after {
  content: "";
  position: absolute;
  top: 15px;
  width: 50%;
  height: 1px;
  background: rgba(23, 58, 53, 0.17);
}

.flow-progress > span::before { left: 0; }
.flow-progress > span::after { right: 0; }
.flow-progress > span:first-child::before,
.flow-progress > span:last-child::after { display: none; }

.flow-progress b {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(23, 58, 53, 0.17);
  border-radius: 50%;
  background: var(--brand-surface);
  font-family: var(--display);
}

.flow-progress small {
  font-size: 9px;
  font-weight: 800;
}

.flow-progress .is-current,
.flow-progress .is-done {
  color: var(--theme-primary);
}

.flow-progress .is-current b,
.flow-progress .is-done b {
  border-color: var(--theme-primary);
}

.flow-progress .is-done b {
  color: var(--brand-surface);
  background: var(--theme-primary);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.parent-form,
.privacy-aside,
.binding-preview-card,
.boundary-process,
.next-step-card {
  min-width: 0;
}

.parent-form {
  display: grid;
  gap: 20px;
}

.form-intro {
  display: flex;
  align-items: center;
  gap: 15px;
}

.form-intro p {
  margin: 4px 0 0;
  font-size: 12px;
}

.form-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--brand-ink);
  border-radius: 18px;
  background: var(--theme-soft);
  box-shadow: 4px 4px 0 var(--brand-ink);
  font-size: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 12px;
  font-weight: 900;
}

.field em,
.field i {
  margin-left: 4px;
  font-size: 9px;
  font-style: normal;
}

.field em { color: var(--brand-coral-fg); }
.field i { color: var(--brand-ink-muted); }

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(23, 58, 53, 0.24);
  border-radius: 14px;
  color: var(--brand-ink);
  background: var(--brand-surface);
  outline: none;
}

.field input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 4px rgba(65, 107, 87, 0.12);
}

.field > small {
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.55;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.input-with-action .soft-button {
  min-height: 50px;
  padding-inline: 14px;
  font-size: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.full-button {
  width: 100%;
}

.form-error-summary {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #e8ada6;
  border-radius: 13px;
  color: var(--status-danger-fg);
  background: var(--status-danger-bg);
  font-size: 11px;
}

.data-minimum-note,
.selected-context {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--theme-surface);
}

.data-minimum-note strong,
.selected-context span {
  font-size: 10px;
}

.data-minimum-note span,
.selected-context strong {
  font-size: 12px;
  line-height: 1.55;
}

.selected-context.two-lines {
  background: var(--status-info-bg);
}

.privacy-aside {
  position: sticky;
  top: 110px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(207, 227, 196, 0.55), transparent 8rem),
    var(--brand-surface);
}

.privacy-seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border: 2px solid var(--brand-ink);
  border-radius: 15px;
  color: var(--brand-surface);
  background: var(--theme-primary);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--theme-soft);
}

.privacy-aside > p {
  margin: 9px 0 20px;
  font-size: 12px;
}

.privacy-aside > div {
  display: grid;
  gap: 4px;
  padding: 13px 0;
  border-top: 1px dashed rgba(23, 58, 53, 0.17);
}

.privacy-aside small {
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.55;
}

.binding-preview-card {
  padding: 22px;
  border: 1px solid #aed1df;
  border-radius: var(--radius-lg);
  background: var(--status-info-bg);
}

.binding-preview-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.binding-preview-head small,
.binding-preview-head h3 {
  display: block;
  margin: 0;
}

.binding-preview-head small {
  color: var(--status-info-fg);
  font-size: 9px;
}

.binding-preview-head h3 {
  margin-top: 3px;
  font-family: var(--display);
  font-size: 20px;
}

.school-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--brand-surface);
  background: var(--status-info-fg);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 900;
}

.binding-preview-card dl,
.detail-list,
.claim-preview dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
}

.binding-preview-card dl > div,
.detail-list > div,
.claim-preview dl > div {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.72);
}

.binding-preview-card dt,
.detail-list dt,
.claim-preview dt {
  color: var(--brand-ink-muted);
  font-size: 9px;
}

.binding-preview-card dd,
.detail-list dd,
.claim-preview dd {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 800;
}

.binding-preview-card > p {
  margin: 15px 0 0;
  color: var(--status-info-fg);
  font-size: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.is-info {
  color: var(--status-info-fg);
  background: #fff;
}

.status-chip.is-pending {
  color: var(--status-pending-fg);
  background: var(--status-pending-bg);
}

.status-chip.is-success {
  color: var(--status-success-fg);
  background: var(--status-success-bg);
}

.boundary-process-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  padding: 13px 0;
  border-top: 1px dashed rgba(23, 58, 53, 0.17);
}

.boundary-process-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--brand-surface);
  background: var(--theme-primary);
  font-family: var(--display);
  font-weight: 900;
}

.boundary-process-row p {
  margin: 0;
}

.boundary-process-row strong,
.boundary-process-row small {
  display: block;
}

.boundary-process-row small {
  margin-top: 3px;
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.55;
}

.check-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
}

.check-field input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--theme-primary);
}

.check-field strong,
.check-field small {
  display: block;
}

.check-field small {
  margin-top: 4px;
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.55;
}

.compact-form {
  gap: 16px;
}

.status-result-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid #cebfdc;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 18%, rgba(183, 165, 199, 0.24), transparent 13rem),
    var(--status-pending-bg);
}

.status-result-card.is-success {
  border-color: #a9cfb7;
  background:
    radial-gradient(circle at 88% 18%, rgba(207, 227, 196, 0.48), transparent 13rem),
    var(--status-success-bg);
}

.status-result-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 2px solid var(--brand-ink);
  border-radius: 24px;
  background: var(--brand-surface);
  box-shadow: 5px 5px 0 var(--brand-ink);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 900;
}

.status-result-card h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.status-result-card p,
.next-step-card p {
  margin: 8px 0 0;
  font-size: 12px;
}

.next-step-card {
  align-self: start;
  background:
    linear-gradient(135deg, var(--theme-surface), var(--brand-surface));
}

.next-step-card p {
  margin-bottom: 18px;
}

.claim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.claim-form {
  display: grid;
  gap: 22px;
}

.pet-choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pet-choice-fieldset legend {
  margin-bottom: 14px;
}

.pet-choice-fieldset legend > strong {
  font-family: var(--display);
  font-size: 22px;
}

.claim-pet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.claim-pet-card {
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 0;
  min-height: 220px;
  padding: 18px 10px 12px;
  border: 1px solid rgba(23, 58, 53, 0.15);
  border-radius: 18px;
  background: rgba(245, 240, 227, 0.56);
  text-align: center;
  cursor: pointer;
}

.claim-pet-card:has(input:checked),
.claim-pet-card.is-selected {
  border-color: var(--theme-primary);
  background: var(--theme-surface);
  box-shadow: inset 0 0 0 1px var(--theme-primary), 4px 4px 0 var(--theme-soft);
}

.claim-pet-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.selection-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--brand-surface);
  background: var(--theme-primary);
  font-size: 11px;
  font-weight: 900;
}

.claim-pet-card:has(input:checked) .selection-dot,
.claim-pet-card.is-selected .selection-dot {
  display: grid;
}

.claim-pet-card .pet-avatar {
  margin: 8px 0 12px;
}

.claim-pet-card > strong {
  font-family: var(--display);
}

.claim-pet-card > small {
  margin-top: 5px;
  color: var(--brand-ink-muted);
  font-size: 9px;
  line-height: 1.45;
}

.agreement-field {
  padding: 15px;
  border: 1px solid #e2c676;
  border-radius: 14px;
  background: var(--status-warning-bg);
}

.claim-preview {
  position: sticky;
  top: 110px;
  overflow: hidden;
}

.claim-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  background:
    radial-gradient(circle, rgba(242, 189, 87, 0.32), transparent 45%),
    var(--theme-surface);
}

.welcome-spark {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--theme-accent);
  font-size: 28px;
  animation: sparkle 2.4s ease-in-out infinite;
}

.claim-preview-copy {
  padding: 24px;
}

.claim-preview-copy > p {
  margin: 8px 0 0;
  font-size: 12px;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.more-service-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 154px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
}

button.more-service-card:hover {
  border-color: var(--theme-primary);
  transform: translateY(-2px);
  box-shadow: 5px 6px 0 var(--theme-soft);
}

.more-service-card > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--theme-surface);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.more-service-card small {
  color: var(--brand-coral-fg);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.more-service-card h2 {
  margin-top: 3px;
  font-size: 20px;
}

.more-service-card p {
  margin: 5px 0 0;
  font-size: 10px;
}

.more-service-card > b {
  font-size: 16px;
}

.more-service-card.is-planned {
  cursor: default;
  opacity: 0.76;
}

.more-service-card.is-planned > b {
  color: var(--brand-ink-muted);
  font-size: 9px;
}

.welcome-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid #a9cfb7;
  border-radius: 16px;
  color: var(--status-success-fg);
  background: var(--status-success-bg);
}

.welcome-banner > span {
  font-size: 20px;
}

.welcome-banner strong,
.welcome-banner small {
  display: block;
}

.welcome-banner small {
  margin-top: 2px;
  font-size: 9px;
}

.welcome-banner button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.inline-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px dashed rgba(23, 58, 53, 0.2);
  border-radius: 15px;
  background: rgba(245, 240, 227, 0.45);
}

.inline-empty > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--theme-surface);
  font-weight: 900;
}

.inline-empty strong,
.inline-empty small {
  display: block;
}

.inline-empty small {
  margin-top: 3px;
  color: var(--brand-ink-muted);
  font-size: 10px;
  line-height: 1.5;
}

.centered-empty {
  display: grid;
  justify-items: center;
  min-height: 360px;
  align-content: center;
  text-align: center;
}

.centered-empty > span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  border: 2px solid var(--brand-ink);
  border-radius: 24px;
  background: var(--theme-soft);
  box-shadow: 5px 5px 0 var(--brand-ink);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 900;
}

.centered-empty p {
  max-width: 520px;
  margin: 8px 0 18px;
  font-size: 12px;
}

.centered-empty.is-compact {
  min-height: 260px;
  border: 1px dashed rgba(23, 58, 53, 0.2);
  border-radius: 18px;
}

.centered-empty.is-compact > span {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-width: 1px;
  border-radius: 17px;
  box-shadow: 3px 3px 0 var(--brand-ink);
  font-size: 19px;
}

.growth-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.growth-summary-strip > span {
  padding: 15px 17px;
  border: 1px solid rgba(23, 58, 53, 0.12);
  border-radius: 16px;
  background: var(--brand-surface);
}

.growth-summary-strip small,
.growth-summary-strip strong {
  display: block;
}

.growth-summary-strip small {
  color: var(--brand-ink-muted);
  font-size: 9px;
}

.growth-summary-strip strong {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 24px;
}

.growth-summary-strip .source-class,
.metric-pill.source-class,
.ledger-card.class-wallet {
  color: var(--status-info-fg);
  background: var(--status-info-bg);
}

.growth-summary-strip .source-family,
.metric-pill.source-family,
.ledger-card.family-wallet {
  color: var(--status-warning-fg);
  background: var(--status-warning-bg);
}

/* 教室大屏主线整合：聚合数据、默认增强隐私、远距离可读。 */
.app-shell[data-role="projector"] .topbar {
  display: none;
}

.app-shell[data-role="projector"] .workspace {
  min-height: 100vh;
  min-height: 100dvh;
}

.projector-view {
  --display-bg: #0d302c;
  --display-panel: rgba(255, 255, 255, 0.075);
  --display-line: rgba(255, 255, 255, 0.17);
  --display-muted: rgba(255, 255, 255, 0.72);
  --display-mint: #bce9bf;
  --display-sun: #ffd16a;
  --display-coral: #ff8f76;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  color: #fffdf7;
  background: var(--display-bg);
}

.display-control-page,
.display-connect-page,
.display-ended-page,
.display-mobile-fallback {
  position: relative;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 209, 106, 0.18), transparent 30rem),
    radial-gradient(circle at 86% 82%, rgba(128, 185, 194, 0.2), transparent 34rem),
    linear-gradient(145deg, #0a2927 0%, #123f38 52%, #0a302d 100%);
}

.display-control-page::before,
.display-connect-page::before,
.display-ended-page::before,
.display-mobile-fallback::before,
.display-session-page::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.display-control-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - clamp(2rem, 6vw, 7rem)));
  margin-inline: auto;
  padding-block: clamp(1.25rem, 3vh, 2.5rem);
}

.display-back,
.display-teacher-dock button {
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--display-line);
  border-radius: 999px;
  color: #fffdf7;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 800;
}

.display-back:hover,
.display-teacher-dock button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.13);
}

.display-mock-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(255, 209, 106, 0.34);
  border-radius: 999px;
  color: var(--display-sun);
  background: rgba(255, 209, 106, 0.08);
  font-size: clamp(0.72rem, 0.62vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.display-setup-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
  width: min(1400px, calc(100% - clamp(2rem, 8vw, 10rem)));
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
  margin: auto;
  padding: 2rem 0 clamp(4rem, 9vh, 7rem);
}

.display-setup-copy {
  max-width: 760px;
}

.display-kicker {
  display: inline-block;
  color: var(--display-sun);
  font-size: clamp(0.78rem, 0.65vw + 0.5rem, 1.1rem);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.display-setup-copy h1,
.display-connect-layout h1,
.display-ended-card h1,
.display-mobile-fallback h1 {
  max-width: 13ch;
  margin: 0.6rem 0 1.15rem;
  font-family: var(--display);
  font-size: clamp(3rem, 5.2vw, 6.4rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.display-setup-copy > p,
.display-connect-layout > p,
.display-ended-card > p,
.display-mobile-fallback p {
  max-width: 44rem;
  margin: 0;
  color: var(--display-muted);
  font-size: clamp(1rem, 0.75vw + 0.7rem, 1.4rem);
  line-height: 1.75;
}

.display-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.display-principles span {
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(255, 209, 106, 0.28);
  border-radius: 0.75rem;
  color: var(--display-sun);
  background: rgba(255, 209, 106, 0.07);
  font-weight: 800;
}

.display-session-card {
  padding: clamp(1.35rem, 2.5vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: clamp(1.5rem, 2.2vw, 2.4rem);
  background: rgba(245, 240, 227, 0.095);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.display-card-head,
.display-setting {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.display-card-head {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--display-line);
}

.display-card-head strong,
.display-card-head small,
.display-setting strong,
.display-setting small {
  display: block;
}

.display-card-head strong {
  font-family: var(--display);
  font-size: clamp(1.3rem, 1.5vw, 1.9rem);
}

.display-card-head small,
.display-setting small {
  margin-top: 0.2rem;
  color: var(--display-muted);
  line-height: 1.45;
}

.display-step,
.display-setting-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgba(255, 209, 106, 0.35);
  border-radius: 50%;
  color: var(--display-sun);
  background: rgba(255, 209, 106, 0.08);
  font-weight: 900;
}

.display-field {
  display: grid;
  gap: 0.55rem;
  margin-block: 1.25rem;
  font-weight: 800;
}

.display-field select {
  min-height: 52px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.9rem;
  color: #fffdf7;
  background: #173f39;
}

.display-setting {
  padding-block: 1rem;
  border-top: 1px solid var(--display-line);
}

.display-setting > div {
  flex: 1;
}

.display-lock {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: var(--display-mint);
  background: rgba(188, 233, 191, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.display-primary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  margin-top: 1.1rem;
  padding: 0.72rem 0.82rem 0.72rem 1.15rem;
  border: 1px solid #173a35;
  border-radius: 1rem;
  color: #173a35;
  background: var(--display-sun);
  box-shadow: 5px 5px 0 rgba(5, 25, 23, 0.72);
  cursor: pointer;
  font-weight: 900;
}

.display-primary-action b {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.7rem;
  color: #fffdf7;
  background: #173a35;
}

.display-form-note {
  margin: 0.9rem 0 0;
  color: var(--display-muted);
  font-size: 0.78rem;
  text-align: center;
}

.display-connect-layout {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(860px, calc(100% - 2rem));
  margin: 1vh auto 0;
  padding-bottom: 3rem;
  text-align: center;
}

.display-connect-layout h1,
.display-ended-card h1 {
  max-width: none;
  font-size: clamp(2.8rem, 4.8vw, 5.6rem);
}

.display-connect-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(6rem, 9vw, 9rem);
  height: clamp(6rem, 9vw, 9rem);
  margin-bottom: 1.2rem;
  border-radius: 42% 58% 48% 52%;
  color: #173a35;
  background: var(--display-sun);
  box-shadow: 0 0 0 0.7rem rgba(255, 209, 106, 0.08);
  transform: rotate(-3deg);
}

.display-connect-mark span {
  position: absolute;
  top: -1rem;
  width: 2.1rem;
  height: 3.4rem;
  border-radius: 80% 10% 80% 10%;
  background: var(--display-mint);
  transform: rotate(34deg);
}

.display-connect-mark b {
  font-family: var(--display);
  font-size: clamp(2rem, 3.2vw, 3.6rem);
  transform: rotate(3deg);
}

.display-token-card {
  display: grid;
  gap: 0.4rem;
  width: min(620px, 100%);
  margin-top: 1.6rem;
  padding: 1.2rem 2rem;
  border: 1px solid rgba(255, 209, 106, 0.32);
  border-radius: 1.35rem;
  background: rgba(255, 209, 106, 0.075);
}

.display-token-card small,
.display-token-card span {
  color: var(--display-muted);
}

.display-token-card strong {
  color: var(--display-sun);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  letter-spacing: 0.1em;
}

.display-connect-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: min(650px, 100%);
  margin-top: 1.2rem;
}

.display-primary-action.is-centered {
  width: min(390px, 100%);
  margin-top: 0;
}

.display-inline-error {
  margin: 0.9rem 0 0 !important;
  color: #ffd1c7 !important;
}

.display-connect-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.15rem;
  margin-top: 1.4rem;
  color: var(--display-muted);
  font-size: 0.82rem;
}

.display-connect-status span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.display-connect-status i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.display-connect-status i.is-ready {
  background: var(--display-mint);
  box-shadow: 0 0 0 0.22rem rgba(188, 233, 191, 0.1);
}

.display-session-page {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 4% 12%, rgba(255, 209, 106, 0.16), transparent 26rem),
    radial-gradient(circle at 93% 78%, rgba(128, 185, 194, 0.19), transparent 30rem),
    #0d302c;
}

.display-session-page > * {
  position: relative;
  z-index: 1;
}

.display-session-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) auto minmax(430px, 1.25fr);
  align-items: center;
  gap: clamp(0.8rem, 1.6vw, 2.2rem);
  min-height: clamp(74px, 8vh, 126px);
  padding: clamp(0.65rem, 1.4vh, 1.25rem) clamp(1.1rem, 2.4vw, 3.8rem);
  border-bottom: 1px solid var(--display-line);
  background: rgba(4, 25, 23, 0.56);
}

.display-session-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.display-session-brand > div span,
.display-session-brand > div strong {
  display: block;
}

.display-session-brand > div span {
  color: var(--display-muted);
  font-size: clamp(0.7rem, 0.62vw, 0.95rem);
  font-weight: 700;
}

.display-session-brand > div strong {
  margin-top: 0.1rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.2vw, 1.7rem);
}

.display-mini-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(2.5rem, 3.2vw, 4.2rem);
  height: clamp(2.5rem, 3.2vw, 4.2rem);
  border-radius: 42% 58% 50% 50%;
  color: #173a35;
  background: var(--display-sun);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.35vw, 1.9rem);
  font-weight: 900;
}

.display-view-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--display-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
}

.display-view-tabs button {
  min-height: 42px;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 999px;
  color: var(--display-muted);
  background: transparent;
  cursor: pointer;
  font-size: clamp(0.82rem, 0.72vw, 1.04rem);
  font-weight: 900;
}

.display-view-tabs button.is-active {
  color: #173a35;
  background: var(--display-sun);
}

.display-session-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.display-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.4rem 0.68rem;
  border: 1px solid var(--display-line);
  border-radius: 999px;
  color: var(--display-muted);
  background: rgba(0, 0, 0, 0.12);
  font-size: clamp(0.72rem, 0.62vw, 0.9rem);
  font-weight: 800;
}

.display-mode-chip.is-private {
  color: var(--display-mint);
  border-color: rgba(188, 233, 191, 0.25);
}

.display-countdown {
  min-width: 5.5ch;
  color: #fffdf7;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: clamp(1.25rem, 1.55vw, 2.05rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: right;
}

.display-banner-stack {
  min-height: 0;
}

.display-offline-banner,
.display-privacy-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: clamp(36px, 4.2vh, 54px);
  padding: 0.4rem 1rem;
  font-size: clamp(0.78rem, 0.75vw, 1.04rem);
  font-weight: 800;
}

.display-offline-banner {
  color: #173a35;
  background: var(--display-sun);
}

.display-privacy-banner {
  color: #173a35;
  background: var(--display-mint);
}

.display-privacy-banner span {
  opacity: 0.72;
}

.display-stage {
  min-height: 0;
  padding: clamp(0.7rem, 1.5vh, 1.6rem) clamp(1.15rem, 2.6vw, 4.2rem);
}

.display-lineup,
.display-goal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.65rem, 1.25vh, 1.15rem);
  height: 100%;
}

.display-goal {
  grid-template-rows: auto minmax(0, 1fr);
}

.display-stage-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.display-stage-title h1 {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.display-stage-title > p {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--display-muted);
  font-size: clamp(0.78rem, 0.75vw, 1.08rem);
  line-height: 1.35;
}

.display-stage-title > p > strong {
  color: var(--display-sun);
  font-family: var(--display);
  font-size: clamp(2.4rem, 3.4vw, 5.5rem);
  line-height: 0.8;
}

.display-lineup-grid.is-aggregate {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(0.6rem, 1vw, 1.35rem);
  min-height: 0;
}

.display-pet-slot {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) 1fr;
  align-items: center;
  gap: clamp(0.65rem, 1.1vw, 1.4rem);
  min-width: 0;
  min-height: 0;
  padding: clamp(0.65rem, 1vw, 1.2rem);
  overflow: hidden;
  border: 1px solid var(--display-line);
  border-radius: clamp(1rem, 1.4vw, 2rem);
  background: var(--display-panel);
}

.display-pet-slot:nth-child(3n + 1) {
  background: rgba(188, 233, 191, 0.085);
}

.display-pet-slot:nth-child(3n + 2) {
  background: rgba(255, 209, 106, 0.08);
}

.display-pet-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 7rem;
}

.display-pet-art img {
  width: min(100%, 12rem);
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.75rem 0.8rem rgba(0, 0, 0, 0.2));
}

.display-pet-art > span {
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  border-radius: 45%;
  color: #173a35;
  background: var(--pet-color, var(--display-mint));
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
}

.display-pet-slot > div:last-child {
  min-width: 0;
  padding-left: clamp(0.65rem, 1vw, 1.2rem);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.display-pet-slot strong,
.display-pet-slot span {
  display: block;
}

.display-pet-slot strong {
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.75vw, 2.5rem);
}

.display-pet-slot span {
  margin-top: 0.3rem;
  color: var(--display-muted);
  font-size: clamp(0.9rem, 0.82vw, 1.18rem);
}

.display-aggregate-note {
  margin: 0;
  color: var(--display-muted);
  font-size: clamp(0.75rem, 0.68vw, 0.96rem);
  text-align: center;
}

.display-no-ranking {
  display: block !important;
  padding-left: 1.1rem;
  border-left: 3px solid var(--display-sun);
  text-align: right;
}

.display-no-ranking strong {
  color: #fffdf7;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.1vw, 1.6rem);
}

.display-goal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(0.8rem, 1.3vw, 1.8rem);
  min-height: 0;
}

.display-goal-visual,
.display-goal-progress {
  min-height: 0;
  border: 1px solid var(--display-line);
  border-radius: clamp(1.25rem, 2vw, 2.6rem);
  background: var(--display-panel);
}

.display-goal-visual {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) 1fr;
  align-items: center;
  gap: clamp(1rem, 3vw, 4rem);
  padding: clamp(1rem, 2.5vw, 3.4rem);
  overflow: hidden;
}

.display-goal-visual h2 {
  margin: 0.3rem 0;
  color: var(--display-sun);
  font-family: var(--display);
  font-size: clamp(2.8rem, 4.6vw, 6.8rem);
  line-height: 1;
}

.display-goal-visual p,
.display-goal-visual > div:last-child > span {
  color: var(--display-muted);
  font-size: clamp(0.9rem, 0.85vw, 1.22rem);
}

.display-tree {
  position: relative;
  width: min(31vh, 100%);
  aspect-ratio: 1;
  justify-self: center;
}

.tree-crown {
  position: absolute;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 45% 55% 48% 52%;
  background: #76a970;
  box-shadow: inset -1rem -1rem 0 rgba(20, 72, 59, 0.18);
}

.crown-one { inset: 8% 25% 36% 8%; transform: rotate(-8deg); }
.crown-two { inset: 3% 5% 35% 42%; background: #8ebc78; transform: rotate(12deg); }
.crown-three { inset: 27% 17% 18% 19%; background: #6d9e69; }

.tree-trunk {
  position: absolute;
  z-index: 1;
  right: 44%;
  bottom: 0;
  width: 15%;
  height: 48%;
  border-radius: 1rem 1rem 0 0;
  background: #bd8156;
}

.tree-house {
  position: absolute;
  z-index: 3;
  top: 37%;
  left: 39%;
  display: grid;
  place-items: center;
  width: 31%;
  aspect-ratio: 1.2;
  border: 2px solid #173a35;
  border-radius: 0.6rem;
  color: #173a35;
  background: var(--display-sun);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.24);
  font-size: clamp(2rem, 4vw, 5rem);
  font-weight: 900;
}

.display-goal-progress {
  display: grid;
  place-items: center;
  align-content: center;
  padding: clamp(1rem, 2vw, 2.5rem);
}

.display-progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: min(29vh, 76%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--display-sun) var(--goal-progress), rgba(255, 255, 255, 0.1) 0);
}

.display-progress-ring::before {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #123c37;
  content: "";
}

.display-progress-ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: clamp(3rem, 4.8vw, 7.2rem);
  line-height: 1;
}

.display-progress-ring small { font-size: 0.35em; }

.display-goal-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.3rem;
  margin-top: 0.9rem;
}

.display-goal-numbers span {
  color: var(--display-muted);
  font-size: clamp(0.72rem, 0.7vw, 0.96rem);
  text-align: center;
}

.display-goal-numbers b {
  display: block;
  color: #fffdf7;
  font-size: clamp(1.3rem, 1.5vw, 2.1rem);
}

.display-goal-numbers i {
  width: 1px;
  height: 2.6rem;
  background: var(--display-line);
}

.display-goal-progress > p {
  margin: 0.65rem 0 0;
  color: var(--display-muted);
}

.display-safe-state {
  display: grid;
  place-items: center;
  align-content: center;
  height: 100%;
  min-height: 20rem;
  padding: 2rem;
  border: 1px dashed var(--display-line);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.display-state-icon,
.display-ended-icon,
.display-mobile-icon {
  display: grid;
  place-items: center;
  width: clamp(4.8rem, 7vw, 7.5rem);
  height: clamp(4.8rem, 7vw, 7.5rem);
  margin-bottom: 1.4rem;
  border: 2px solid rgba(188, 233, 191, 0.3);
  border-radius: 50%;
  color: #173a35;
  background: var(--display-mint);
  font-size: clamp(2rem, 3vw, 3.4rem);
  font-weight: 900;
}

.display-safe-state.is-failed .display-state-icon {
  color: #4b211c;
  border-color: rgba(255, 143, 118, 0.35);
  background: #ffd0c6;
}

.display-safe-state h1 {
  margin: 0.4rem 0 0.7rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 4vw, 5rem);
}

.display-safe-state p {
  max-width: 42rem;
  margin: 0 0 1.5rem;
  color: var(--display-muted);
  font-size: clamp(0.95rem, 0.9vw, 1.25rem);
  line-height: 1.7;
}

.display-teacher-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: clamp(58px, 6.5vh, 88px);
  padding: 0.5rem clamp(1.1rem, 2.3vw, 3.8rem);
  border-top: 1px solid var(--display-line);
  background: rgba(4, 25, 23, 0.75);
}

.display-teacher-dock > span b,
.display-teacher-dock > span small {
  display: block;
}

.display-teacher-dock > span small {
  margin-top: 0.1rem;
  color: var(--display-muted);
  font-size: 0.68rem;
}

.display-teacher-dock > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.display-teacher-dock button {
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  font-size: clamp(0.68rem, 0.58vw, 0.82rem);
}

.display-teacher-dock button.is-danger {
  border-color: rgba(255, 143, 118, 0.35);
  color: #ffd2c8;
  background: rgba(255, 143, 118, 0.09);
}

.display-session-page[data-performance="static"] {
  background: #0d302c;
}

.display-session-page[data-performance="static"]::before {
  display: none;
}

.display-session-page[data-performance="static"] *,
.display-session-page[data-performance="static"] *::before,
.display-session-page[data-performance="static"] *::after {
  animation: none !important;
  transition: none !important;
}

.display-ended-page,
.display-mobile-fallback {
  display: grid;
  place-items: center;
}

.display-ended-card,
.display-mobile-fallback > main {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(860px, calc(100% - 2rem));
  padding: clamp(2rem, 5vw, 4.5rem);
  text-align: center;
}

.display-ended-card > p,
.display-mobile-fallback p {
  max-width: 44rem;
}

.display-ended-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.display-ended-proof span {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(188, 233, 191, 0.22);
  border-radius: 999px;
  color: var(--display-mint);
  background: rgba(188, 233, 191, 0.07);
  font-size: 0.8rem;
  font-weight: 800;
}

.display-ended-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.display-ended-actions .display-primary-action,
.display-mobile-fallback .display-primary-action {
  width: auto;
  min-width: 220px;
  margin-top: 0;
}

.display-mobile-fallback .display-mock-label {
  margin-bottom: 1.5rem;
}

@media (max-width: 1180px) and (min-width: 801px) {
  .display-session-head {
    grid-template-columns: auto 1fr;
  }

  .display-view-tabs { justify-self: end; }

  .display-session-meta {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .display-session-head { padding-block: 0.55rem; }

  .display-setup-layout {
    width: min(1060px, calc(100% - 3rem));
    gap: 2.5rem;
  }

  .display-pet-slot {
    grid-template-columns: minmax(5.5rem, 0.7fr) 1fr;
  }

  .display-teacher-dock {
    align-items: flex-start;
  }

  .display-teacher-dock > span {
    flex: 0 0 12rem;
  }
}

@media (max-height: 760px) and (min-width: 801px) {
  .display-control-head { padding-block: 0.65rem; }
  .display-setup-layout { min-height: auto; padding-block: 0.5rem 1rem; }
  .display-session-card { padding: 1rem 1.2rem; }
  .display-card-head { padding-bottom: 0.65rem; }
  .display-field { margin-block: 0.65rem; }
  .display-setting { padding-block: 0.55rem; }
  .display-session-card .display-primary-action { min-height: 48px; margin-top: 0.6rem; }
  .display-form-note { margin-top: 0.4rem; }
  .display-connect-layout { margin-top: 0; padding-bottom: 0.8rem; }
  .display-connect-mark { width: 5rem; height: 5rem; margin-bottom: 0.5rem; }
  .display-connect-layout h1 { margin-block: 0.25rem 0.45rem; font-size: 3rem; }
  .display-connect-layout > p { font-size: 1rem; line-height: 1.5; }
  .display-token-card { margin-top: 0.8rem; padding-block: 0.65rem; }
  .display-connect-actions { margin-top: 0.7rem; }
  .display-connect-status { margin-top: 0.7rem; }
  .display-session-head { min-height: 68px; }
  .display-stage { padding-block: 0.55rem; }
  .display-stage-title h1 { font-size: clamp(1.85rem, 2.8vw, 3rem); }
  .display-lineup-grid.is-aggregate { gap: 0.5rem; }
  .display-pet-slot { padding: 0.5rem; }
  .display-pet-art { min-height: 5.4rem; }
  .display-pet-art img { width: min(100%, 7.5rem); }
  .display-teacher-dock { min-height: 54px; }
  .display-tree { width: min(28vh, 100%); }
  .display-progress-ring { width: min(26vh, 70%); }
}

@media (max-width: 800px) {
  .display-mobile-fallback {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .display-session-page {
    background: #0d302c;
  }

  .display-session-page::before {
    display: none;
  }
}
