:root {
  --accent: #6366f1;
  --accent-rgb: 99, 102, 241;
  --soft: #c7d2fe;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface-strong: #ffffff;
  --success: #059669;
  --danger: #dc2626;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fffaf0;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.78), rgba(255, 255, 255, 0.72) 34%, rgba(236, 254, 255, 0.78) 72%, rgba(245, 243, 255, 0.82));
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

button {
  color: inherit;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
}

.app-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 24px 132px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 14px 4px 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark,
.dock-class-mark,
.lock-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #0f172a));
  box-shadow: 0 12px 26px rgba(var(--accent-rgb), 0.28);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: 900;
}

.brand-block h1 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.header-stats div {
  min-width: 82px;
  padding: 7px 12px;
  border-radius: 14px;
}

.header-stats div + div {
  border-left: 1px solid rgba(226, 232, 240, 0.9);
}

.header-stats strong,
.header-stats span {
  display: block;
  text-align: center;
}

.header-stats strong {
  font-size: 19px;
  line-height: 1.1;
}

.header-stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-search,
.dock-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}

.global-search {
  width: 238px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.global-search input,
.dock-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.global-search input {
  height: 44px;
  font-size: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

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

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}

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

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 999px;
  color: #047857;
  background: rgba(236, 253, 245, 0.83);
  font-size: 12px;
  font-weight: 850;
}

.live-pill i,
.dock-class small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
}

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

.student-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 330px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.student-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: 0 18px 44px rgba(var(--accent-rgb), 0.17);
}

.student-card:focus-visible {
  outline: 4px solid rgba(var(--accent-rgb), 0.24);
  outline-offset: 3px;
}

.pet-stage {
  position: relative;
  display: grid;
  min-height: 176px;
  place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--soft) 86%, white), rgba(255, 255, 255, 0.78));
}

.pet-emoji {
  position: relative;
  z-index: 1;
  font-size: 76px;
  line-height: 1;
  filter: drop-shadow(0 12px 16px rgba(15, 23, 42, 0.12));
  animation: float 4.8s ease-in-out infinite;
}

.level-pill,
.badge-pill,
.group-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-weight: 850;
  white-space: nowrap;
}

.level-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #475569;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
  font-size: 11px;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 16px 16px;
}

.student-title-row,
.pet-row,
.progress-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.student-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-pill {
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: #f8fafc;
  font-size: 10px;
}

.badge-pill {
  color: #475569;
  font-size: 12px;
}

.badge-pill::before {
  color: #f59e0b;
  content: "●";
  font-size: 9px;
}

.pet-row {
  margin-top: 10px;
}

.pet-name {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-note {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.progress-wrap {
  margin-top: 13px;
}

.progress-meta {
  align-items: flex-end;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 56%, #22c55e));
  transition: width 280ms ease;
}

.card-footer {
  min-height: 30px;
  margin-top: 12px;
}

.energy-value {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 950;
}

.energy-value span {
  color: #f97316;
}

.hatch-button,
.mini-button,
.ghost-button,
.primary-button,
.danger-button {
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.hatch-button {
  padding: 7px 11px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(var(--accent-rgb), 0.2);
  font-size: 11px;
}

.hatch-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.compact .student-card {
  min-height: 245px;
}

.compact .pet-stage {
  min-height: 118px;
}

.compact .pet-emoji {
  font-size: 54px;
}

.compact .card-body {
  padding: 12px;
}

.compact .progress-wrap {
  margin-top: 9px;
}

.compact .level-note {
  display: none;
}

.unified-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.dock-scroll {
  display: flex;
  max-width: min(1180px, calc(100vw - 36px));
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.17);
  backdrop-filter: blur(24px);
  scrollbar-width: none;
  pointer-events: auto;
}

.dock-scroll::-webkit-scrollbar {
  display: none;
}

.dock-class {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}

.dock-class:hover {
  background: #f8fafc;
}

.dock-class-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 950;
}

.dock-class strong,
.dock-class small {
  display: flex;
  align-items: center;
}

.dock-class strong {
  max-width: 110px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-class small {
  gap: 6px;
  margin-top: 1px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.dock-divider {
  width: 1px;
  height: 34px;
  flex: 0 0 auto;
  margin: 0 3px;
  background: #e2e8f0;
}

.dock-button {
  display: grid;
  min-width: 54px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  gap: 1px;
  padding: 5px 7px;
  border: 0;
  border-radius: 16px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
}

.dock-button .icon {
  width: 19px;
  height: 19px;
}

.dock-button span {
  font-size: 10px;
  font-weight: 850;
}

.dock-button:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.dock-search {
  width: 134px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
}

.dock-search input {
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.modal-panel {
  display: flex;
  width: min(920px, 94vw);
  max-height: min(820px, 90vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.modal-panel.compact-modal {
  width: min(720px, 94vw);
}

.modal-panel.wide-modal {
  width: min(1120px, 96vw);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #eef2f7;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-title-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  font-size: 19px;
}

.modal-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
}

.modal-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #94a3b8;
  background: #f1f5f9;
  cursor: pointer;
}

.modal-close:hover {
  color: #475569;
  background: #e2e8f0;
  transform: rotate(90deg);
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

.primary-button,
.ghost-button,
.danger-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.2);
}

.ghost-button,
.mini-button {
  border: 1px solid #dbe3ee;
  color: #475569;
  background: #fff;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.mini-button {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.segmented,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.segmented button,
.category-tabs button {
  padding: 7px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  color: #64748b;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.segmented button.active,
.category-tabs button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.student-profile-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 540px;
}

.student-side {
  padding: 20px;
  border-right: 1px solid #eef2f7;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), #f8fafc);
}

.student-pet-orbit {
  display: grid;
  width: 134px;
  height: 134px;
  margin: 0 auto 14px;
  place-items: center;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--soft);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.student-pet-orbit span {
  font-size: 66px;
  line-height: 1;
}

.student-side h3 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 950;
}

.student-side .pet-name {
  display: block;
  margin: 4px 0 18px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

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

.stat-tile,
.summary-tile {
  border: 1px solid #e8edf4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
}

.stat-tile-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
}

.stat-tile span,
.stat-tile strong {
  display: block;
}

.stat-tile span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-tile strong {
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.1;
}

.profile-main {
  min-width: 0;
  overflow: hidden;
}

.tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px 0;
  border-bottom: 1px solid #eef2f7;
  background: #fbfcfe;
}

.tab-button {
  position: relative;
  min-width: max-content;
  padding: 12px 15px 13px;
  border: 0;
  color: #94a3b8;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tab-button.active {
  color: var(--accent);
}

.tab-button.active::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  content: "";
}

.tab-content {
  max-height: 560px;
  overflow-y: auto;
  padding: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  color: #94a3b8;
  background: #f8fafc;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

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

.behavior-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.behavior-section h4::before {
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: var(--section-color, #10b981);
  content: "";
}

.behavior-grid,
.shop-grid,
.pet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.behavior-card,
.shop-card,
.pet-card {
  border: 1px solid #e8edf4;
  border-radius: 16px;
  background: #fff;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.behavior-card,
.shop-card {
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
}

.behavior-card:hover,
.shop-card:hover,
.pet-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.1);
}

.behavior-card .behavior-icon,
.shop-card .shop-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  font-size: 24px;
}

.behavior-card strong,
.shop-card strong,
.pet-card strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-card span,
.shop-card span {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 11px;
  font-weight: 950;
}

.behavior-card.negative span {
  color: #b91c1c;
  background: #fef2f2;
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
  font-weight: 780;
}

.log-list,
.rank-list,
.summary-list {
  display: grid;
  gap: 8px;
}

.log-row,
.rank-row,
.summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #e8edf4;
  border-radius: 14px;
  background: #fff;
}

.log-row.undone {
  opacity: 0.52;
}

.log-main,
.rank-main {
  min-width: 0;
  flex: 1;
}

.log-main strong,
.rank-main strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-main span,
.rank-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.delta-positive {
  color: #047857;
}

.delta-negative {
  color: #b91c1c;
}

.rank-number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 950;
}

.rank-row.top1 .rank-number {
  color: #92400e;
  background: #fef3c7;
}

.rank-row.top2 .rank-number {
  color: #475569;
  background: #e2e8f0;
}

.rank-row.top3 .rank-number {
  color: #9a3412;
  background: #ffedd5;
}

.rank-value {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 950;
}

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

.summary-tile {
  padding: 14px;
}

.summary-tile span,
.summary-tile strong,
.summary-tile small {
  display: block;
}

.summary-tile span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.summary-tile strong {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.1;
}

.summary-tile small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.chart-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr 60px;
  align-items: center;
  gap: 12px;
}

.chart-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
}

.chart-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

.chart-row span {
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fff;
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 170px;
  padding: 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.09);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.theme-choice {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e8edf4;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.theme-choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.theme-swatch {
  width: 48px;
  height: 48px;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.theme-choice span {
  font-size: 11px;
  font-weight: 900;
}

.batch-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.selection-panel {
  padding: 14px;
  border: 1px solid #e8edf4;
  border-radius: 18px;
  background: #f8fafc;
}

.selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.student-check-grid {
  display: grid;
  max-height: 430px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  overflow-y: auto;
}

.student-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.student-check input {
  accent-color: var(--accent);
}

.student-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card {
  text-align: left;
}

.shop-card .shop-icon {
  margin: 0 0 10px;
}

.shop-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.shop-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.shop-action {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.shop-action select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #fff;
}

.remote-box {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 20px;
}

.remote-qr {
  display: grid;
  width: 200px;
  height: 200px;
  place-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), #fff);
  color: var(--accent);
  font-size: 24px;
  font-weight: 950;
}

.remote-box code {
  display: block;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
}

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

.classroom-tool {
  min-height: 180px;
  padding: 18px;
  border: 1px solid #e8edf4;
  border-radius: 20px;
  background: linear-gradient(150deg, #fff, #f8fafc);
  text-align: center;
}

.classroom-tool .tool-emoji {
  font-size: 42px;
}

.classroom-tool h3 {
  margin: 8px 0 4px;
  font-size: 16px;
  font-weight: 950;
}

.classroom-tool p {
  min-height: 42px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timer-value {
  margin: 10px 0;
  font-size: 36px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: 98px;
  z-index: 200;
  max-width: min(520px, calc(100vw - 40px));
  padding: 11px 16px;
  border-radius: 13px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(var(--accent-rgb), 0.88));
  text-align: center;
}

.lock-screen[hidden] {
  display: none;
}

.lock-mark {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border-radius: 24px;
  font-size: 32px;
  font-weight: 950;
}

.lock-screen h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 950;
}

.lock-screen p {
  margin: 8px 0 22px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1380px) {
  .student-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .header-stats {
    display: none;
  }

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

@media (max-width: 860px) {
  .app-shell {
    padding: 16px 14px 122px;
  }

  .app-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .header-actions {
    width: 100%;
  }

  .global-search {
    width: auto;
    flex: 1;
  }

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

  .live-pill {
    display: none;
  }

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

  .student-card {
    min-height: 286px;
    border-radius: 19px;
  }

  .pet-stage {
    min-height: 146px;
  }

  .pet-emoji {
    font-size: 62px;
  }

  .student-profile-layout {
    grid-template-columns: 1fr;
  }

  .student-side {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #eef2f7;
  }

  .student-pet-orbit {
    width: 90px;
    height: 90px;
    margin: 0 14px 0 0;
    grid-row: span 3;
  }

  .student-pet-orbit span {
    font-size: 45px;
  }

  .student-side h3,
  .student-side .pet-name {
    text-align: left;
  }

  .student-side .pet-name {
    margin-bottom: 10px;
  }

  .stat-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .behavior-grid,
  .shop-grid,
  .pet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .batch-layout {
    grid-template-columns: 1fr;
  }

  .student-check-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 250px;
  }

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

  .remote-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand-block h1 {
    font-size: 20px;
  }

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

  .student-card {
    min-height: 260px;
  }

  .pet-stage {
    min-height: 126px;
  }

  .pet-emoji {
    font-size: 54px;
  }

  .student-title {
    font-size: 13px;
  }

  .group-pill {
    display: none;
  }

  .card-body {
    padding: 10px;
  }

  .hatch-button {
    padding: 6px 8px;
    font-size: 10px;
  }

  .dock-scroll {
    justify-content: flex-start;
    border-radius: 20px;
  }

  .dock-class,
  .dock-divider:first-of-type {
    display: none;
  }

  .dock-search {
    width: 116px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel,
  .modal-panel.compact-modal,
  .modal-panel.wide-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
  }

  .modal-header,
  .modal-body {
    padding-right: 16px;
    padding-left: 16px;
  }

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

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

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

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

  .chart-row {
    grid-template-columns: 86px 1fr 44px;
    gap: 8px;
  }
}
