:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --ink: #24352f;
  --muted: #6b7b76;
  --line: rgba(83, 103, 94, 0.14);
  --card-line: rgba(255, 169, 37, 0.2);
  --panel: #ffffff;
  --green: #176b68;
  --green-2: #0f5b55;
  --gold: #f5b642;
  --orange: #ff8a00;
  --orange-2: #ffad28;
  --red: #b94b4b;
  --blue: #3478f6;
  --soft-shadow: 0 12px 30px rgba(57, 70, 86, 0.1);
  --soft-shadow-hover: 0 18px 38px rgba(57, 70, 86, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 177, 61, 0.13), transparent 28%),
    linear-gradient(135deg, #fff8ec 0%, #f7fbff 48%, #fbf7ef 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

[hidden] {
  display: none !important;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.classroom-frame {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px 18px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(120, 150, 190, 0.09) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(247, 251, 255, 0.96));
}

.classroom-frame::before,
.classroom-frame::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(2px);
}

.classroom-frame::before {
  width: 260px;
  height: 260px;
  right: -90px;
  top: 72px;
  background: radial-gradient(circle, rgba(255, 173, 40, 0.14), transparent 70%);
}

.classroom-frame::after {
  width: 300px;
  height: 300px;
  left: -110px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(105, 136, 255, 0.1), transparent 72%);
}

.classroom-frame.shop-manager-on::before,
.classroom-frame.shop-manager-on::after {
  opacity: 0;
}

.classroom-header,
.operation-strip,
.app-shell,
#studentDrawerHost,
#settingsHost,
#classManagerHost,
#quickModeHost,
#batchDockHost,
#outfitModeHost,
#petArchiveHost,
#shopManagerHost,
#teacherLoginHost {
  position: relative;
  z-index: 1;
}

.classroom-header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.class-switcher {
  min-width: 118px;
  min-height: 62px;
  padding: 9px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.class-switcher span {
  color: var(--muted);
  font-size: 12px;
}

.class-switcher strong {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.1;
  color: var(--ink);
}

.action-ribbon {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.action-ribbon {
  grid-column: auto;
}

.action-ribbon::-webkit-scrollbar {
  display: none;
}

.action-chip,
.search-box {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid transparent;
  flex: 0 0 auto;
  line-height: 1;
}

.action-chip,
.search-box {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(80, 100, 90, 0.12);
  color: #3b534f;
  text-decoration: none;
  box-shadow: none;
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-chip:hover,
.view-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.view-toggle-button:hover {
  box-shadow: none;
}

.action-chip.active {
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  border-color: rgba(255, 138, 0, 0.35);
  color: #fff;
  box-shadow: none;
}

.action-chip.highlight {
  background: linear-gradient(135deg, #fff7de, #fff1c5);
  border-color: rgba(245, 182, 66, 0.32);
  color: #8a5700;
}

.action-chip.dashed {
  border-style: dashed;
  color: #315f8d;
}

.view-toggle {
  min-height: 42px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(80, 100, 90, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: none;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.view-toggle-button {
  min-width: 64px;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: #49615c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}

.view-toggle-button.active {
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #fff;
  box-shadow: none;
}

.search-box {
  min-width: 170px;
  justify-content: flex-start;
  color: #7f918d;
  font-weight: 600;
}

.app-shell {
  min-height: 0;
}

.operation-strip,
.board-section,
.score-section,
.rank-section,
.shop-section,
.record-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(31, 48, 45, 0.05);
}

.operation-strip {
  min-height: 92px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(310px, 1fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.brand {
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
  font-size: 34px;
  flex: 0 0 auto;
}

.eyebrow,
.section-kicker {
  color: #9fcfc4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(20px, 1.6vw, 28px);
  line-height: 1.1;
}

h2 {
  margin-top: 4px;
  font-size: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-card {
  min-height: 72px;
  padding: 10px;
  border-radius: 8px;
  background: #f6faf8;
  border: 1px solid var(--line);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--green-2);
}

.stat-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.selected-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.selected-summary {
  min-height: 24px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.button-row,
.quick-actions,
.filter-line,
.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row {
  margin-top: 8px;
}

.plain-button,
.quick-button,
.mode-pill,
.mode-hint,
.rule-count,
.segment-button {
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-hint {
  background: #fff8e6;
  color: #95630b;
  border: 1px solid #efd793;
  font-size: 13px;
  font-weight: 900;
}

.plain-button {
  background: #edf4f1;
  color: #34504b;
}

.plain-button.danger {
  background: #fff0ee;
  color: #b94b4b;
}

.quick-button {
  flex: 1 1 calc(50% - 8px);
  min-height: 36px;
  color: #fff;
  font-weight: 900;
}

.quick-button.positive {
  background: #16815f;
}

.quick-button.negative {
  background: var(--red);
}

.quick-button.badge {
  background: #835d16;
}

.quick-button.effort {
  background: var(--blue);
}

.main-grid {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(650px, 1.7fr) minmax(320px, 0.78fr);
  gap: 12px;
}

.score-section.score-source {
  display: none !important;
}

.board-section,
.score-section,
.rank-section,
.shop-section,
.record-section {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.right-stack {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.right-stack .rank-section {
  flex: 0 0 33%;
}

.right-stack .shop-section {
  flex: 0 0 32%;
}

.right-stack .record-section {
  flex: 1 1 0;
}

.rank-section,
.shop-section,
.record-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.section-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.panel-close {
  display: none;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #edf4f1;
  color: #34504b;
  font-size: 13px;
  font-weight: 800;
}

.section-head.compact {
  min-height: 44px;
}

.mode-pill,
.rule-count {
  background: #fff4d8;
  color: #7a5914;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.student-grid {
  height: calc(100% - 58px);
  margin-top: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 260px));
  align-content: start;
  justify-content: center;
  gap: 22px;
  padding: 18px 24px 24px;
}

.student-card {
  min-height: 252px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--card-line);
  text-align: left;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 180px 252px;
}

.student-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 151, 24, 0.36);
  box-shadow: var(--soft-shadow-hover);
}

.student-card.is-selected {
  border-color: rgba(255, 138, 0, 0.58);
  background: rgba(255, 251, 241, 0.98);
  box-shadow: 0 14px 32px rgba(255, 150, 32, 0.15), inset 0 0 0 2px rgba(255, 168, 35, 0.16);
}

.student-top,
.student-bottom,
.rank-row,
.record-row,
.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-badges {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.badge-chip,
.change-chip,
.outfit-pill,
.pet-name-pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}

.badge-chip {
  min-width: 52px;
  background: linear-gradient(135deg, #fff6d7, #ffe9a3);
  color: #9a5e00;
  box-shadow: 0 6px 14px rgba(245, 182, 66, 0.16);
}

.pet-stage {
  position: relative;
  height: 184px;
  padding-top: 20px;
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pet-stage::before,
.pet-stage::after {
  display: none;
}

.pet-stage::before {
  width: 74px;
  height: 18px;
  left: 18px;
  bottom: 22px;
  box-shadow: 26px 7px 0 rgba(255, 255, 255, 0.32);
}

.pet-stage::after {
  width: 44px;
  height: 11px;
  right: 24px;
  top: 38px;
  box-shadow: -34px 20px 0 rgba(255, 255, 255, 0.24);
}

.cloud {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.cloud-one {
  width: 46px;
  height: 14px;
  left: 34px;
  top: 54px;
  box-shadow: 16px -8px 0 rgba(255, 255, 255, 0.34);
}

.cloud-two {
  width: 38px;
  height: 12px;
  right: 38px;
  bottom: 50px;
}

.grass-base {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 18px;
  width: 132px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(141, 193, 89, 0.3), rgba(141, 193, 89, 0.05) 70%, transparent 72%);
}

@keyframes studentPetImageBreathe {
  0%,
  100% {
    transform: translateY(0) scale(1.006);
  }
  50% {
    transform: translateY(-4px) scale(1.012);
  }
}

.pet-stage.has-pet-image {
  padding: 0;
  background: rgba(255, 255, 255, 0.94) !important;
  isolation: isolate;
}

.pet-stage.has-pet-image::before {
  display: none;
}

.pet-stage.has-pet-image::after {
  display: none;
}

.pet-stage.has-pet-image .cloud,
.pet-stage.has-pet-image .grass-base {
  display: none;
}

.change-chip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.86);
  color: #52635f;
}

.pet-name-pill {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  transform: translateX(-50%);
  max-width: 78%;
  background: rgba(255, 255, 255, 0.82);
  color: #34504b;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-name-pill span {
  color: #5570b8;
}

.student-info {
  flex: 1 1 auto;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 253, 247, 0.98));
  border-top: 1px solid rgba(235, 224, 203, 0.65);
}

.student-top {
  justify-content: space-between;
}

.pet-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8fbff, #e7f0ff);
  display: grid;
  place-items: center;
  font-size: 32px;
  flex: 0 0 auto;
}

.student-card .pet-avatar {
  width: 124px;
  height: 124px;
  font-size: 70px;
  z-index: 2;
  box-shadow: inset 0 4px 12px rgba(255, 255, 255, 0.68), 0 16px 28px rgba(57, 70, 86, 0.12);
}

.pet-avatar-image {
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.student-card .pet-avatar-image {
  width: 176px;
  height: 176px;
  border-radius: 24px;
  filter: drop-shadow(0 16px 24px rgba(57, 70, 86, 0.14));
}

.student-card .pet-stage.has-pet-image .pet-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(57, 70, 86, 0.14));
  transform-origin: center center;
  will-change: transform;
  animation: studentPetImageBreathe 5s ease-in-out infinite;
}

.student-grid.is-scrolling .pet-stage.has-pet-image .pet-avatar-image,
.drawer-body.is-scrolling .pet-avatar-image,
.pet-choice-grid.is-scrolling .pet-avatar-image,
.archive-pet-grid.is-scrolling img,
.group-member-grid.is-scrolling img {
  animation-play-state: paused;
  transition: none;
  filter: none;
}

.student-main {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.16;
}

.student-meta,
.record-meta,
.product-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.level-badge {
  min-width: 52px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dce9ff, #bcd3ff);
  color: #1e63d6;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(63, 111, 220, 0.13);
}

.student-card .level-badge {
  min-width: 52px;
  height: 30px;
  font-size: 13px;
}

.student-grid.is-group-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: center;
}

.group-card {
  width: 100%;
  min-height: 286px;
  padding: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 197, 91, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 169, 37, 0.24);
  box-shadow: 0 14px 34px rgba(57, 70, 86, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: grid;
  grid-template-columns: minmax(188px, 40%) minmax(0, 1fr);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.group-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 151, 24, 0.38);
  box-shadow: 0 20px 44px rgba(57, 70, 86, 0.15);
}

.group-rank {
  position: absolute;
  z-index: 3;
  left: 22px;
  top: 0;
  width: 54px;
  height: 72px;
  padding-top: 20px;
  color: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(180deg, #62b66d, #3f965a);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  box-shadow: 0 10px 20px rgba(63, 150, 90, 0.2);
}

.group-card:nth-child(2n) .group-rank {
  background: linear-gradient(180deg, #ffc64e, #ff9b15);
  box-shadow: 0 10px 20px rgba(255, 155, 21, 0.2);
}

.group-visual {
  min-height: 286px;
  padding: 42px 18px 22px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.7) 0 9%, transparent 10%),
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.62) 0 8%, transparent 9%),
    linear-gradient(135deg, #eefcf6 0%, #fff8e8 100%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.group-card:nth-child(2n) .group-visual {
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.7) 0 9%, transparent 10%),
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.62) 0 8%, transparent 9%),
    linear-gradient(135deg, #f0f6ff 0%, #fff5e7 100%);
}

.group-visual-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  pointer-events: none;
}

.group-visual-cloud.cloud-a {
  width: 64px;
  height: 18px;
  left: 54px;
  top: 88px;
  box-shadow: 22px -9px 0 rgba(255, 255, 255, 0.34);
}

.group-visual-cloud.cloud-b {
  width: 54px;
  height: 15px;
  right: 34px;
  top: 58px;
  box-shadow: -22px 18px 0 rgba(255, 255, 255, 0.25);
}

.group-illustration {
  z-index: 2;
  width: min(178px, 82%);
  min-height: 148px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.92) 0 36%, transparent 37%),
    radial-gradient(ellipse at 50% 88%, rgba(118, 179, 91, 0.36), rgba(118, 179, 91, 0.08) 64%, transparent 68%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  filter: drop-shadow(0 18px 22px rgba(61, 91, 84, 0.12));
}

.group-illustration span {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-left: -10px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 247, 255, 0.84));
  font-size: 38px;
  box-shadow: inset 0 4px 12px rgba(255, 255, 255, 0.74), 0 12px 20px rgba(57, 70, 86, 0.12);
  overflow: hidden;
}

.group-illustration span:first-child {
  margin-left: 0;
  transform: translateY(-4px);
}

.group-illustration span:nth-child(2) {
  transform: translateY(16px) scale(1.08);
  z-index: 2;
}

.group-illustration span:nth-child(3) {
  transform: translateY(2px);
}

.group-pet-avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  background: transparent;
  box-shadow: none;
}

.group-pet-avatar.pet-avatar-emoji {
  display: grid;
  place-items: center;
  font-size: 34px;
  line-height: 1;
}

.group-grass {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 34px;
  width: 174px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(119, 184, 82, 0.36), rgba(119, 184, 82, 0.08) 68%, transparent 72%);
}

.group-main {
  min-width: 0;
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.group-title {
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.16;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-title em {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff3dc;
  color: #c56a00;
  border: 1px solid rgba(255, 169, 37, 0.24);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  font-style: normal;
  font-weight: 950;
}

.member-pills {
  max-width: 100%;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-pills > span {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #435a55;
  border: 1px solid rgba(83, 103, 94, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(57, 70, 86, 0.06);
}

.member-pet-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 3px 8px rgba(57, 70, 86, 0.08);
}

.member-pet-avatar.pet-avatar-emoji {
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.member-pills b {
  font: inherit;
  min-width: 0;
}

.member-pills > span.member-empty {
  color: #8c9a96;
  background: rgba(248, 250, 252, 0.86);
}

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

.group-stats div {
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(246, 255, 247, 0.96), rgba(255, 250, 238, 0.94));
  border: 1px solid rgba(255, 169, 37, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.group-stats strong {
  margin-top: 4px;
  color: #ff8a00;
  font-size: 21px;
  line-height: 1;
}

.group-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.group-footer {
  margin-top: 2px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.group-entry-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffad28, #ff8500);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(255, 132, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.group-members-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff8e8;
  color: #9a6200;
  border: 1px solid rgba(255, 169, 37, 0.26);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(255, 169, 37, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.group-members-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 138, 0, 0.42);
  box-shadow: 0 12px 24px rgba(255, 169, 37, 0.18);
}

.group-entry-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 132, 0, 0.28);
}

.progress-line {
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: #e9efec;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f7cff, #8b6cff);
  box-shadow: 0 0 10px rgba(95, 124, 255, 0.25);
}

.student-bottom {
  justify-content: space-between;
  color: #576a64;
  font-size: 13px;
  font-weight: 800;
}

.card-actions {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(233, 239, 236, 0.9);
  grid-template-columns: 1fr;
  gap: 8px;
}

.card-actions button {
  min-width: 0;
  min-height: 34px;
  padding: 0 5px;
  border-radius: 12px;
  background: #f5f8f4;
  color: #314844;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(76, 101, 92, 0.06);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.card-actions button:first-child {
  background: #eef5ff;
  color: #245ec9;
}

.card-actions button:hover {
  transform: translateY(-1px);
  background: #fff7e8;
  color: #ad6100;
}

.outfit-pill {
  min-width: 74px;
  min-height: 28px;
  background: linear-gradient(135deg, #f1edff, #eef5ff);
  color: #6253cf;
  border: 0;
  white-space: nowrap;
  line-height: 1;
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(98, 83, 207, 0.1), 0 6px 14px rgba(98, 83, 207, 0.08);
  transition: transform 0.16s ease, background 0.16s ease;
}

.outfit-pill::before {
  content: "✦";
  font-size: 12px;
  line-height: 1;
}

.outfit-pill:hover {
  transform: translateY(-1px);
  background: #ece8ff;
}

.student-card:nth-child(4n + 1) .pet-stage {
  background: rgba(255, 255, 255, 0.94);
}

.student-card:nth-child(4n + 2) .pet-stage {
  background: rgba(255, 255, 255, 0.94);
}

.student-card:nth-child(4n + 3) .pet-stage {
  background: rgba(255, 255, 255, 0.94);
}

.student-card:nth-child(4n + 4) .pet-stage {
  background: rgba(255, 255, 255, 0.94);
}

.filter-line {
  margin: 10px 0 12px;
  justify-content: space-between;
}

.segment-button {
  background: #edf4f1;
  color: #49615c;
  font-size: 13px;
}

.mini-segment {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.mini-segment .segment-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.segment-button.is-active {
  background: var(--ink);
  color: #fff;
}

.rule-grid {
  height: calc(100% - 118px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

.rule-card {
  min-height: 78px;
  padding: 12px;
  border-radius: 8px;
  background: #fbfdfc;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.rule-title,
.product-title,
.record-title {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.rule-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rule-points {
  min-width: 44px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}

.rule-points.positive {
  background: #16815f;
}

.rule-points.negative {
  background: var(--red);
}

.rank-list,
.record-list,
.product-list {
  margin-top: 10px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.rank-list,
.record-list {
  flex: 1;
}

.rank-row,
.record-row,
.product-row {
  min-height: 68px;
  padding: 10px;
  border-radius: 8px;
  background: #fbfdfc;
  border: 1px solid var(--line);
}

.record-month-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.record-month-tabs button {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid #e5edf2;
  background: #fff;
  color: #4c5f6d;
  font-weight: 900;
}

.record-month-tabs button.is-active {
  background: #fff8df;
  border-color: #f5d36d;
  color: #8a5c00;
}

.rank-row {
  gap: 8px;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.product-row .product-main {
  grid-row: 1 / span 2;
}

.product-row .product-price,
.product-row .redeem-button {
  justify-self: end;
}

.rank-row .pet-avatar {
  width: 46px;
  height: 46px;
  font-size: 26px;
}

.rank-group-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: visible;
}

.rank-group-pet-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-left: -8px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 10px rgba(57, 70, 86, 0.1);
}

.rank-group-pet-avatar:first-child {
  margin-left: 0;
}

.rank-group-pet-avatar.pet-avatar-emoji {
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.rank-no {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
  position: relative;
}

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

.rank-score,
.record-points,
.product-price {
  font-weight: 900;
  color: var(--green-2);
  white-space: nowrap;
}

.rank-score {
  font-size: 15px;
}

.select-line {
  min-height: 44px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.select-line span {
  white-space: nowrap;
}

select {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(23, 37, 35, 0.28);
  display: flex;
  justify-content: flex-end;
}

.student-drawer,
.settings-drawer {
  width: min(560px, 92vw);
  height: 100%;
  padding: 18px;
  background: #f7fbf9;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(20, 45, 41, 0.16);
  overflow: auto;
}

.settings-drawer {
  width: min(520px, 92vw);
}

.drawer-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.close-button,
.primary-small,
.danger-small {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.close-button {
  background: #edf4f1;
  color: #34504b;
}

.primary-small {
  background: var(--green);
  color: #fff;
}

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

.drawer-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.drawer-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: #eaf2ef;
  color: #49615c;
  font-weight: 800;
}

.drawer-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.drawer-body {
  display: grid;
  gap: 14px;
}

.student-score-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.score-quick-button {
  min-height: 78px;
  padding: 10px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
}

.score-quick-button strong {
  font-size: 22px;
  line-height: 1;
}

.score-quick-button span {
  font-size: 13px;
  font-weight: 900;
}

.score-quick-button.positive {
  background: #eaf8ee;
  color: #16815f;
  border-color: #cbeed8;
}

.score-quick-button.negative {
  background: #fff0ec;
  color: #b94b4b;
  border-color: #ffd2c9;
}

.score-quick-button.badge {
  background: #fff5df;
  color: #9a650c;
  border-color: #f2d89a;
}

.score-quick-button.effort {
  background: #eef3ff;
  color: #3478f6;
  border-color: #cfdcff;
}

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

.drawer-subtitle {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drawer-rule {
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.feedback-panel {
  min-height: 360px;
  padding: 8px 4px 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(232, 251, 249, 0.6), rgba(255, 244, 255, 0.52) 0 56px, #fff 56px);
}

.feedback-toolbar {
  min-height: 56px;
  padding: 0 8px 10px;
  display: grid;
  grid-template-columns: 122px minmax(210px, 1fr) 122px;
  align-items: center;
  gap: 14px;
}

.feedback-toolbar::after {
  content: "";
  width: 122px;
  height: 1px;
}

#detailScoreCategorySelect {
  grid-column: 1;
  width: 122px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #e1e9ef;
  padding: 0 28px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.92);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 10 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5 5 5.5 9 1.5' fill='none' stroke='%23546660' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
  color: #273a36;
  font-weight: 800;
}

.feedback-switch {
  grid-column: 2;
  justify-self: center;
  min-width: 210px;
  height: 42px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2edf4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(85, 133, 168, 0.04);
}

.feedback-switch button {
  border-radius: 999px;
  color: #657371;
  background: transparent;
  font-size: 14px;
  font-weight: 900;
}

.feedback-switch button.is-active {
  background: linear-gradient(135deg, #53c7ff, #219df2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(33, 157, 242, 0.24);
}

.feedback-rule-grid {
  padding: 22px 22px 10px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 20px;
}

.feedback-rule-tile {
  min-width: 0;
  min-height: 132px;
  background: transparent;
  color: #273a36;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: center;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.feedback-rule-tile:hover {
  transform: translateY(-3px);
  filter: brightness(1.03);
}

.feedback-rule-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  box-shadow: inset 0 -8px 14px rgba(255, 255, 255, 0.24), 0 12px 24px rgba(42, 65, 82, 0.12);
}

.feedback-rule-icon.tone-0 {
  background: linear-gradient(135deg, #ff9b7c, #ff6969);
}

.feedback-rule-icon.tone-1 {
  background: linear-gradient(135deg, #94dcff, #65bdfb);
}

.feedback-rule-icon.tone-2 {
  background: linear-gradient(135deg, #ffcf71, #ff8f70);
}

.feedback-rule-icon.tone-3 {
  background: linear-gradient(135deg, #ffe28b, #ffbd62);
}

.feedback-rule-icon.tone-4 {
  background: linear-gradient(135deg, #a9e6ff, #79cfff);
}

.feedback-rule-icon.tone-5 {
  background: linear-gradient(135deg, #ffd67b, #ff8d70);
}

.feedback-rule-icon.tone-negative {
  background: linear-gradient(135deg, #ff9b91, #ff6f6f);
}

.feedback-rule-points {
  min-height: 24px;
  margin-top: -18px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff3cf;
  color: #77530c;
  border: 1px solid rgba(255, 212, 111, 0.8);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(245, 182, 66, 0.12);
}

.feedback-rule-tile.negative .feedback-rule-points {
  background: #fff0ee;
  color: #b94b4b;
  border-color: #ffd1cc;
}

.feedback-rule-tile strong {
  max-width: 100%;
  color: #314844;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.feedback-rule-tile.quick strong {
  color: #1f6155;
}

@media (max-width: 940px) {
  .feedback-rule-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .feedback-toolbar {
    grid-template-columns: 1fr;
  }

  .feedback-toolbar::after {
    display: none;
  }

  .feedback-switch {
    grid-column: auto;
    justify-self: stretch;
  }

  .feedback-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
    padding: 18px 10px 10px;
  }
}

.positive-text {
  color: #11835f;
}

.negative-text {
  color: var(--red);
}

.badge-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.badge-wall div,
.level-config-grid div {
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-wall strong {
  font-size: 28px;
  color: var(--green-2);
}

.badge-wall span,
.level-config-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.pet-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pet-choice {
  min-height: 286px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 216, 199, 0.86);
  box-shadow: 0 14px 30px rgba(69, 76, 89, 0.08);
  display: grid;
  align-content: start;
  gap: 12px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 210px 286px;
}

.pet-choice:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 122, 56, 0.46);
  box-shadow: 0 20px 42px rgba(69, 76, 89, 0.13);
}

.pet-choice-art {
  position: relative;
  aspect-ratio: 1.08;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
}

.pet-choice-art::before {
  content: "";
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -12px 22px rgba(232, 122, 56, 0.08), 0 16px 30px rgba(46, 62, 78, 0.1);
}

.pet-choice-art:has(.pet-choice-card-pet.pet-avatar-image)::before {
  display: none;
}

.pet-choice-card-pet {
  position: relative;
  z-index: 1;
  width: min(150px, 82%);
  height: min(150px, 82%);
  object-fit: contain;
  transform: scale(var(--growth-scale));
}

.pet-choice-card-pet:not(.pet-avatar-image) {
  display: grid;
  place-items: center;
  font-size: 64px;
  line-height: 1;
}

.pet-choice-card-pet.pet-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  filter: none;
}

.pet-choice-card-meta {
  display: grid;
  gap: 4px;
  padding: 0 4px;
}

.pet-choice-card-meta span {
  color: #9a7652;
  font-size: 12px;
  font-weight: 950;
}

.pet-choice-card-meta strong {
  color: #172a24;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 950;
}

.pet-choice-card-meta small {
  color: #71817b;
  font-size: 12px;
  font-weight: 850;
}

.pet-choice em {
  justify-self: start;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb347, #ff870f);
  color: #fff;
  display: inline-flex;
  align-items: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(255, 132, 0, 0.2);
}

.pet-choice.is-active {
  border-color: rgba(232, 122, 56, 0.56);
  background: #fff7ed;
  box-shadow: 0 20px 42px rgba(232, 122, 56, 0.16);
}

.pet-choice.is-active em {
  background: #1b8a72;
  box-shadow: 0 10px 20px rgba(27, 138, 114, 0.16);
}

.outfit-mode-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  padding: 18px;
  background: rgba(22, 30, 28, 0.28);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
}

.outfit-mode {
  width: min(1220px, calc(100vw - 36px));
  height: min(720px, calc(100vh - 36px));
  min-height: 560px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 239, 214, 0.9), transparent 36%),
    linear-gradient(135deg, #fffaf1, #f7fbf8);
  border: 1px solid rgba(255, 180, 74, 0.24);
  box-shadow: 0 28px 80px rgba(38, 55, 50, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 292px;
}

.outfit-student-panel,
.outfit-shop-panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(233, 218, 195, 0.7);
}

.outfit-student-panel {
  border-right: 1px solid rgba(233, 218, 195, 0.7);
}

.outfit-shop-panel {
  border-left: 1px solid rgba(233, 218, 195, 0.7);
  overflow: auto;
}

.outfit-student-name {
  font-size: 25px;
  font-weight: 900;
  color: var(--ink);
}

.outfit-medal-pill {
  margin-top: 18px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5d2, #ffe8a5);
  color: #9a5e00;
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(245, 182, 66, 0.16);
}

.outfit-status-line {
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff0e6;
  color: #e07820;
  font-size: 13px;
  font-weight: 900;
}

.outfit-mini-pet {
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid rgba(255, 140, 46, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
}

.outfit-mini-pet .pet-avatar {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.outfit-mini-pet .pet-avatar-image {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(57, 70, 86, 0.12));
}

.outfit-mini-pet strong,
.outfit-mini-pet span {
  display: block;
}

.outfit-mini-pet strong {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.outfit-mini-pet span {
  margin-top: 3px;
  color: #ff8a00;
  font-size: 12px;
  font-weight: 900;
}

.outfit-stage-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.72), transparent 26%),
    radial-gradient(circle at 20% 12%, rgba(255, 183, 88, 0.18), transparent 22%),
    linear-gradient(180deg, #f9f3e8, #fffdf8 78%);
}

.outfit-stage-head {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.outfit-exit-button,
.outfit-shop-tabs button,
.outfit-item-card button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.outfit-exit-button {
  background: rgba(255, 255, 255, 0.92);
  color: #36504b;
  border: 1px solid rgba(83, 103, 94, 0.12);
  box-shadow: 0 8px 18px rgba(57, 70, 86, 0.09);
}

.outfit-student-summary {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #50645f;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}

.outfit-floating-card {
  position: absolute;
  z-index: 2;
  min-width: 130px;
  min-height: 72px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 180, 74, 0.18);
  box-shadow: 0 14px 30px rgba(57, 70, 86, 0.08);
}

.pet-name-card {
  top: 84px;
  left: 32px;
  background: linear-gradient(135deg, #efb05a, #c88642);
  color: #fff;
}

.intimacy-card {
  top: 84px;
  right: 220px;
  text-align: center;
  color: #dc6d6b;
}

.outfit-floating-card span,
.outfit-floating-card strong {
  display: block;
}

.outfit-floating-card span {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.82;
}

.outfit-floating-card strong {
  margin-top: 4px;
  font-size: 22px;
}

.outfit-gift-note {
  position: absolute;
  z-index: 2;
  top: 86px;
  right: 34px;
  max-width: 230px;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: #d96a72;
  font-size: 13px;
  font-weight: 900;
}

.outfit-pet-showcase {
  position: absolute;
  inset: 118px 92px 88px;
  display: grid;
  place-items: center;
}

.outfit-pet-aura {
  position: absolute;
  width: min(390px, 60%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(255, 242, 220, 0.48) 52%, transparent 72%);
  filter: drop-shadow(0 22px 38px rgba(255, 164, 70, 0.18));
}

.outfit-pet-avatar {
  position: relative;
  z-index: 2;
  font-size: clamp(118px, 19vw, 220px);
  line-height: 1;
  filter: drop-shadow(0 28px 30px rgba(59, 55, 48, 0.18));
}

.outfit-pet-avatar.pet-avatar-image {
  width: min(430px, 54vw);
  height: min(430px, 54vw);
  object-fit: contain;
  border-radius: 34px;
  filter: drop-shadow(0 24px 34px rgba(57, 70, 86, 0.16));
}

.outfit-armor-piece {
  position: absolute;
  z-index: 3;
  top: 24%;
  left: 50%;
  width: 76px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(135deg, #dae8f4, #8aa0b4);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(70, 88, 110, 0.2);
}

.outfit-cape-piece {
  position: absolute;
  z-index: 1;
  width: 168px;
  height: 112px;
  right: 27%;
  bottom: 29%;
  border-radius: 80% 20% 70% 30%;
  background: linear-gradient(135deg, rgba(198, 221, 241, 0.6), rgba(154, 181, 210, 0.22));
  transform: rotate(-18deg);
}

.outfit-tool-rail {
  position: absolute;
  z-index: 4;
  top: 158px;
  right: 26px;
  display: grid;
  gap: 9px;
}

.outfit-tool-rail button {
  width: 58px;
  min-height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: #6a5d4e;
  border: 1px solid rgba(220, 201, 176, 0.58);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(57, 70, 86, 0.08);
}

.outfit-tool-rail button span {
  display: block;
  font-size: 19px;
}

.outfit-tool-rail button.is-active {
  background: linear-gradient(135deg, #ffe4b9, #ffad62);
  color: #7a3e00;
  border-color: rgba(255, 138, 0, 0.28);
}

.outfit-level-rail {
  position: absolute;
  z-index: 3;
  left: 32px;
  right: 32px;
  bottom: 24px;
  min-height: 56px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(233, 218, 195, 0.7);
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.outfit-level-rail button {
  min-width: 0;
  border-radius: 999px;
  background: #f4eee5;
  color: #9d8c7c;
  font-size: 12px;
  font-weight: 900;
}

.outfit-level-rail button.is-current {
  background: linear-gradient(135deg, #ffb45a, #ff7d18);
  color: #fff;
}

.outfit-level-rail button:disabled {
  opacity: 0.58;
  cursor: default;
}

.outfit-shop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.outfit-shop-head h2 {
  margin: 3px 0 0;
  font-size: 26px;
}

.outfit-shop-tabs {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.outfit-shop-tabs button {
  background: linear-gradient(135deg, #fff, #fff7eb);
  color: #34504b;
  border: 1px solid rgba(255, 151, 24, 0.18);
  box-shadow: 0 8px 18px rgba(57, 70, 86, 0.06);
}

.outfit-shop-tabs button.is-active {
  background: linear-gradient(135deg, #ffad28, #ff8500);
  color: #fff;
  border-color: rgba(255, 138, 0, 0.42);
  box-shadow: 0 10px 22px rgba(255, 132, 0, 0.22);
}

.outfit-card-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.outfit-item-card {
  min-height: 118px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(83, 103, 94, 0.1);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  position: relative;
  box-shadow: 0 10px 24px rgba(57, 70, 86, 0.07);
}

.outfit-item-card.is-active {
  border-color: rgba(255, 138, 0, 0.46);
  box-shadow: 0 12px 26px rgba(255, 132, 0, 0.13);
}

.outfit-item-card.tone-mint {
  background: linear-gradient(135deg, #ffffff, #f1fbf4);
}

.outfit-item-card.tone-orange {
  background: linear-gradient(135deg, #ffffff, #fff3dd);
}

.outfit-item-card.tone-violet {
  background: linear-gradient(135deg, #ffffff, #f2efff);
}

.outfit-item-preview {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(83, 103, 94, 0.08);
}

.outfit-item-main {
  min-width: 0;
}

.outfit-item-main strong,
.outfit-item-main span,
.outfit-item-main small {
  display: block;
}

.outfit-item-main strong {
  color: var(--ink);
  font-size: 16px;
}

.outfit-item-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.outfit-item-main small {
  margin-top: 6px;
  color: #d27700;
  font-size: 12px;
  font-weight: 900;
}

.outfit-item-card button {
  grid-column: 1 / -1;
  background: #fff4e5;
  color: #c06a00;
}

.outfit-item-card button.is-wearing {
  background: linear-gradient(135deg, #ffad28, #ff8500);
  color: #fff;
}

@media (max-width: 1100px) {
  .outfit-mode {
    grid-template-columns: 200px minmax(0, 1fr) 292px;
  }

  .outfit-stage-head {
    top: 16px;
    left: 20px;
    right: 20px;
  }

  .outfit-floating-card {
    min-width: 112px;
    min-height: 64px;
    padding: 10px 14px;
  }

  .pet-name-card {
    left: 32px;
    width: 128px;
  }

  .intimacy-card {
    left: 176px;
    right: auto;
    width: 116px;
  }

  .outfit-floating-card strong {
    font-size: 20px;
  }

  .outfit-gift-note {
    display: none;
  }

  .outfit-pet-showcase {
    inset: 142px 86px 86px;
  }

  .outfit-level-rail {
    left: 28px;
    right: 28px;
    gap: 4px;
  }

  .outfit-level-rail button {
    font-size: 11px;
  }
}

.category-summary,
.settings-list,
.settings-form,
.settings-rule-list {
  display: grid;
  gap: 10px;
}

.settings-form {
  grid-template-columns: minmax(0, 1fr) 118px 92px auto;
  align-items: center;
}

.settings-form.rule-form {
  grid-template-columns: minmax(0, 1fr) 92px auto;
}

.settings-form input,
.settings-form select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

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

.category-summary span {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  color: #38524d;
  font-weight: 800;
}

.level-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.setting-toggle {
  min-height: 56px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #38524d;
}

.setting-toggle strong {
  min-width: 42px;
  height: 28px;
  border-radius: 999px;
  background: #dfe8e4;
  color: #657773;
  display: grid;
  place-items: center;
}

.setting-toggle.is-on strong {
  background: var(--green);
  color: #fff;
}

.settings-rule-list {
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.settings-rule-row {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.redeem-button,
.undo-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

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

.redeem-button:disabled {
  background: #dfe8e4;
  color: #73837f;
  cursor: default;
}

.undo-button {
  background: #fff1df;
  color: #8a501e;
}

.record-row.is-muted {
  opacity: 0.55;
}

.empty {
  padding: 30px 12px;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 760px) and (orientation: landscape) {
  .classroom-frame {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    padding: 14px 18px 18px;
    background:
      radial-gradient(circle at 1px 1px, rgba(120, 150, 190, 0.08) 1px, transparent 1px) 0 88px / 24px 24px,
      linear-gradient(135deg, #fff8ec 0%, #f7fbff 52%, #fbf7ef 100%);
  }

  .classroom-frame.has-panel::after {
    content: "";
    display: none;
  }

  .classroom-header {
    align-items: stretch;
    gap: 12px 14px;
  }

  .class-switcher {
    min-width: 118px;
    min-height: 62px;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(80, 100, 90, 0.12);
    box-shadow: none;
  }

  .action-ribbon {
    align-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    row-gap: 0;
  }

  .action-chip,
  .search-box {
    min-height: 38px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(80, 100, 90, 0.12);
    color: #314844;
    box-shadow: none;
    font-size: 12.5px;
  }

  .action-chip.active {
    background: linear-gradient(135deg, var(--orange-2), var(--orange));
    border-color: rgba(255, 138, 0, 0.35);
    color: #fff;
  }

  .view-toggle {
    min-height: 38px;
    padding: 3px;
    border-color: rgba(80, 100, 90, 0.12);
    box-shadow: none;
    flex: 0 0 auto;
  }

  .view-toggle-button {
    min-width: 54px;
    min-height: 30px;
    padding: 0 12px;
  }

  .view-toggle-button.active {
    background: linear-gradient(135deg, var(--orange-2), var(--orange));
    color: #fff;
    box-shadow: none;
  }

  #quickOperationButton,
  #batchOperationButton {
    background: linear-gradient(135deg, var(--orange-2), var(--orange));
    border-color: rgba(255, 138, 0, 0.35);
    color: #fff;
    box-shadow: none;
  }

  .classroom-frame.batch-mode-on #batchOperationButton {
    background: linear-gradient(135deg, #9b6cff, #7a4ee8);
    border-color: rgba(122, 78, 232, 0.35);
    color: #fff;
  }

  .search-box {
    min-width: 190px;
    background: #fbfdff;
  }

  .operation-strip {
    display: none;
  }

  .app-shell,
  .main-grid,
  .board-section {
    min-height: 0;
    height: 100%;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .board-section {
    padding: 8px 4px 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .board-section > .section-head {
    display: none;
  }

  .student-grid {
    height: 100%;
    margin-top: 0;
    padding: clamp(10px, 1vw, 16px) clamp(12px, 1.2vw, 22px) clamp(14px, 1.4vw, 24px);
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    align-content: start;
    align-items: stretch;
    justify-content: center;
    gap: clamp(8px, 0.75vw, 14px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .student-grid.is-group-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: start;
    align-items: stretch;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    gap: clamp(10px, 0.8vw, 14px);
    padding: 18px 22px 30px;
  }

  .student-card {
    width: 100%;
    min-width: 0;
    height: 12.6vw;
    aspect-ratio: 7 / 10;
    min-height: 110px;
    container-type: inline-size;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 169, 37, 0.22);
    box-shadow: var(--soft-shadow);
  }

  .student-card.is-selected {
    border-color: rgba(255, 138, 0, 0.58);
    background: rgba(255, 251, 241, 0.98);
  }

  .pet-stage {
    flex: 0 0 auto;
    width: 100%;
    height: 8.75vw;
    min-height: 76px;
    aspect-ratio: 1 / 1;
    padding-top: 0;
  }

  .student-card .pet-avatar {
    width: 58%;
    height: auto;
    aspect-ratio: 1;
    font-size: clamp(34px, 4.2vw, 72px);
    font-size: clamp(34px, 45cqw, 72px);
  }

  .student-card .pet-avatar-image {
    width: 82%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 24px;
  }

  .student-card .pet-stage.has-pet-image .pet-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .group-card {
    width: 100%;
    min-width: 0;
    min-height: 300px;
    grid-template-columns: 1fr;
    grid-template-rows: 116px minmax(0, 1fr);
    border-radius: 16px;
  }

  .group-rank {
    left: 14px;
    width: 42px;
    height: 56px;
    padding-top: 14px;
    font-size: 17px;
  }

  .group-visual {
    min-height: 116px;
    padding: 28px 12px 12px;
  }

  .group-visual-cloud.cloud-a {
    left: 42px;
    top: 58px;
  }

  .group-visual-cloud.cloud-b {
    right: 24px;
    top: 34px;
  }

  .group-illustration {
    width: min(138px, 82%);
    min-height: 86px;
  }

  .group-illustration span {
    width: 44px;
    height: 44px;
    font-size: 26px;
    margin-left: -8px;
  }

  .group-pet-avatar.pet-avatar-emoji {
    font-size: 24px;
  }

  .group-grass {
    bottom: 12px;
    width: 128px;
    height: 24px;
  }

  .group-main {
    min-height: 0;
    padding: 12px 12px 14px;
    justify-content: flex-start;
    gap: 8px;
  }

  .group-head {
    gap: 8px;
  }

  .group-title {
    min-width: 0;
    gap: 6px;
    font-size: clamp(16px, 1.25vw, 19px);
  }

  .group-title span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-title em {
    min-height: 22px;
    padding: 0 8px;
    font-size: 12px;
  }

  .member-pills {
    max-height: 66px;
    margin-top: 8px;
    gap: 5px;
    overflow: hidden;
  }

  .member-pills > span {
    min-height: 24px;
    max-width: 100%;
    padding: 0 7px;
    gap: 4px;
    font-size: 11px;
  }

  .member-pet-avatar {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .member-pills b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-stats {
    gap: 6px;
  }

  .group-stats div {
    min-height: 48px;
    padding: 7px 8px;
    border-radius: 12px;
  }

  .group-stats strong {
    font-size: 16px;
  }

  .group-stats span {
    font-size: 11px;
  }

  .group-footer {
    gap: 6px;
  }

  .group-entry-button,
  .group-members-button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 12px;
  }

  .student-info {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(3px, 0.35vw, 7px) clamp(4px, 0.55vw, 10px) clamp(4px, 0.5vw, 8px);
    padding: clamp(3px, 3cqw, 7px) clamp(4px, 4cqw, 10px) clamp(4px, 4cqw, 8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(2px, 0.18vw, 4px);
    gap: clamp(2px, 1.8cqw, 4px);
    overflow: hidden;
  }

  .student-top,
  .student-bottom {
    min-width: 0;
    gap: clamp(3px, 0.35vw, 8px);
    gap: clamp(3px, 3cqw, 8px);
  }

  .student-name {
    font-size: clamp(10px, 0.82vw, 15px);
    font-size: clamp(10px, 9.4cqw, 15px);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-bottom {
    font-size: clamp(8.5px, 0.66vw, 12px);
    font-size: clamp(8.5px, 7cqw, 12px);
    line-height: 1.1;
  }

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

  .progress-line {
    height: clamp(3px, 0.25vw, 5px);
    height: clamp(3px, 2.6cqw, 5px);
    margin: 0;
  }

  .student-badges {
    top: clamp(5px, 0.48vw, 8px);
    top: clamp(5px, 4cqw, 8px);
    right: clamp(5px, 0.48vw, 8px);
    right: clamp(5px, 4cqw, 8px);
    gap: clamp(3px, 0.28vw, 5px);
    gap: clamp(3px, 2.8cqw, 5px);
  }

  .badge-chip,
  .change-chip,
  .pet-name-pill {
    min-height: clamp(16px, 1.3vw, 24px);
    min-height: clamp(16px, 12cqw, 24px);
    padding: 0 clamp(4px, 0.38vw, 7px);
    padding: 0 clamp(4px, 3.5cqw, 7px);
    font-size: clamp(8px, 0.66vw, 11.5px);
    font-size: clamp(8px, 7cqw, 11.5px);
  }

  .badge-chip {
    min-width: clamp(30px, 2.4vw, 42px);
    min-width: clamp(30px, 26cqw, 42px);
  }

  .student-card .level-badge {
    min-width: clamp(28px, 2.4vw, 42px);
    min-width: clamp(28px, 25cqw, 42px);
    height: clamp(16px, 1.3vw, 24px);
    height: clamp(16px, 12cqw, 24px);
    font-size: clamp(8px, 0.66vw, 11.5px);
    font-size: clamp(8px, 7cqw, 11.5px);
  }

  .pet-name-pill {
    bottom: clamp(5px, 0.45vw, 8px);
    bottom: clamp(5px, 4cqw, 8px);
    max-width: 86%;
  }

  .outfit-pill {
    min-width: 0;
    min-height: clamp(16px, 1.25vw, 24px);
    min-height: clamp(16px, 13cqw, 24px);
    padding: 0 clamp(4px, 0.42vw, 8px);
    padding: 0 clamp(4px, 4cqw, 8px);
    font-size: clamp(8.5px, 0.68vw, 12px);
    font-size: clamp(8.5px, 7.4cqw, 12px);
    gap: clamp(2px, 0.2vw, 4px);
    gap: clamp(2px, 2cqw, 4px);
  }

  .outfit-pill::before {
    font-size: clamp(8px, 0.6vw, 11px);
    font-size: clamp(8px, 6.5cqw, 11px);
  }

  .progress-fill {
    background: linear-gradient(90deg, #5f7cff, #8b6cff);
  }

  .score-section,
  .right-stack {
    display: none;
  }

  .classroom-frame.panel-score .score-section,
  .classroom-frame.panel-rank .right-stack,
  .classroom-frame.panel-shop .right-stack,
  .classroom-frame.panel-records .right-stack {
    position: fixed;
    z-index: 30;
    top: 84px;
    right: 18px;
    bottom: 18px;
    display: flex;
    background:
      radial-gradient(circle at 14% 0%, rgba(255, 244, 214, 0.92), transparent 34%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(252, 255, 250, 0.96));
    border: 1px solid rgba(255, 185, 79, 0.28);
    border-radius: 26px;
    box-shadow: 0 24px 62px rgba(20, 45, 41, 0.16), 0 4px 16px rgba(255, 150, 32, 0.08);
    overflow: hidden;
  }

  .classroom-frame.panel-score .score-section {
    width: min(520px, 42vw);
    flex-direction: column;
  }

  .classroom-frame.panel-records .right-stack {
    width: min(560px, calc(100vw - 72px));
    height: auto;
    padding: 0;
    gap: 0;
  }

  .classroom-frame.panel-rank .right-stack {
    left: 50%;
    right: auto;
    width: min(590px, calc(100vw - 72px));
    height: auto;
    padding: 0;
    gap: 0;
    transform: translateX(-50%);
  }

  .classroom-frame.panel-rank .rank-section {
    padding: 18px 20px 20px;
    overflow-x: hidden;
  }

  .classroom-frame.panel-rank .board-section {
    opacity: 0;
    pointer-events: none;
  }

  .classroom-frame.panel-shop .right-stack {
    left: 18px;
    width: auto;
    height: auto;
    padding: 0;
    gap: 0;
  }

  .classroom-frame.panel-records .board-section {
    opacity: 0;
    pointer-events: none;
  }

  .classroom-frame.panel-rank .right-stack > section,
  .classroom-frame.panel-shop .right-stack > section,
  .classroom-frame.panel-records .right-stack > section {
    display: none;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    border: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
  }

  .classroom-frame.panel-rank .right-stack .rank-section,
  .classroom-frame.panel-shop .right-stack .shop-section,
  .classroom-frame.panel-records .right-stack .record-section {
    display: flex;
  }

  .panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .classroom-frame.panel-score .rule-grid {
    flex: 1;
    height: auto;
  }
}

@media (max-width: 759px), (orientation: portrait) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .classroom-frame {
    height: auto;
    min-height: 100vh;
  }

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

  .action-ribbon {
    grid-column: auto;
  }

  .app-shell {
    height: auto;
    min-height: 0;
  }

  .operation-strip {
    grid-template-columns: 1fr;
  }

  .main-grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .right-stack {
    height: auto;
  }

  .right-stack .rank-section,
  .right-stack .shop-section,
  .right-stack .record-section {
    flex: none;
  }

  .student-grid,
  .rule-grid {
    height: auto;
    max-height: 72vh;
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 16px;
  }

  .student-card {
    border-radius: 20px;
  }

  .student-grid.is-group-grid {
    grid-template-columns: 1fr;
  }

  .group-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .group-visual {
    min-height: 198px;
    padding: 42px 18px 20px;
  }

  .group-main {
    padding: 22px 20px 20px;
  }

  .group-title {
    font-size: 25px;
  }

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

  .group-stats div {
    min-height: 66px;
    padding: 10px;
  }

  .group-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .group-entry-button,
  .group-members-button {
    width: 100%;
  }

  .drawer-rule-columns,
  .badge-wall,
  .pet-choice-grid,
  .level-config-grid,
  .settings-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .student-grid:not(.is-group-grid) {
    height: 100%;
    max-height: none;
    margin-top: 0;
    padding: clamp(10px, 1vw, 16px) clamp(12px, 1.2vw, 22px) clamp(14px, 1.4vw, 24px);
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    align-content: start;
    align-items: stretch;
    justify-content: center;
    gap: clamp(8px, 0.75vw, 14px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .student-grid:not(.is-group-grid) .student-card {
    width: 100%;
    min-width: 0;
    height: 12.6vw;
    aspect-ratio: 7 / 10;
    min-height: 110px;
    container-type: inline-size;
    border-radius: 12px;
  }

  .student-grid:not(.is-group-grid) .pet-stage {
    width: 100%;
    flex: 0 0 auto;
    height: 8.75vw;
    min-height: 76px;
    aspect-ratio: 1 / 1;
    padding-top: 0;
  }

  .student-grid:not(.is-group-grid) .student-card .pet-avatar {
    width: 58%;
    height: auto;
    aspect-ratio: 1;
    font-size: clamp(34px, 4.2vw, 72px);
    font-size: clamp(34px, 45cqw, 72px);
  }

  .student-grid:not(.is-group-grid) .student-card .pet-avatar-image {
    width: 82%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 24px;
  }

  .student-grid:not(.is-group-grid) .student-card .pet-stage.has-pet-image .pet-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .student-grid:not(.is-group-grid) .student-info {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(3px, 0.35vw, 7px) clamp(4px, 0.55vw, 10px) clamp(4px, 0.5vw, 8px);
    padding: clamp(3px, 3cqw, 7px) clamp(4px, 4cqw, 10px) clamp(4px, 4cqw, 8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(2px, 0.18vw, 4px);
    gap: clamp(2px, 1.8cqw, 4px);
    overflow: hidden;
  }

  .student-grid:not(.is-group-grid) .student-top,
  .student-grid:not(.is-group-grid) .student-bottom {
    min-width: 0;
    gap: clamp(3px, 0.35vw, 8px);
    gap: clamp(3px, 3cqw, 8px);
  }

  .student-grid:not(.is-group-grid) .student-name {
    font-size: clamp(10px, 0.82vw, 15px);
    font-size: clamp(10px, 9.4cqw, 15px);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .student-grid:not(.is-group-grid) .student-bottom {
    font-size: clamp(8.5px, 0.66vw, 12px);
    font-size: clamp(8.5px, 7cqw, 12px);
    line-height: 1.1;
  }

  .student-grid:not(.is-group-grid) .student-bottom span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-grid:not(.is-group-grid) .progress-line {
    height: clamp(3px, 0.25vw, 5px);
    height: clamp(3px, 2.6cqw, 5px);
    margin: 0;
  }

  .student-grid:not(.is-group-grid) .student-badges {
    top: clamp(5px, 0.48vw, 8px);
    top: clamp(5px, 4cqw, 8px);
    right: clamp(5px, 0.48vw, 8px);
    right: clamp(5px, 4cqw, 8px);
    gap: clamp(3px, 0.28vw, 5px);
    gap: clamp(3px, 2.8cqw, 5px);
  }

  .student-grid:not(.is-group-grid) .badge-chip,
  .student-grid:not(.is-group-grid) .change-chip,
  .student-grid:not(.is-group-grid) .pet-name-pill {
    min-height: clamp(16px, 1.3vw, 24px);
    min-height: clamp(16px, 12cqw, 24px);
    padding: 0 clamp(4px, 0.38vw, 7px);
    padding: 0 clamp(4px, 3.5cqw, 7px);
    font-size: clamp(8px, 0.66vw, 11.5px);
    font-size: clamp(8px, 7cqw, 11.5px);
  }

  .student-grid:not(.is-group-grid) .badge-chip {
    min-width: clamp(30px, 2.4vw, 42px);
    min-width: clamp(30px, 26cqw, 42px);
  }

  .student-grid:not(.is-group-grid) .level-badge {
    min-width: clamp(28px, 2.4vw, 42px);
    min-width: clamp(28px, 25cqw, 42px);
    height: clamp(16px, 1.3vw, 24px);
    height: clamp(16px, 12cqw, 24px);
    font-size: clamp(8px, 0.66vw, 11.5px);
    font-size: clamp(8px, 7cqw, 11.5px);
  }

  .student-grid:not(.is-group-grid) .pet-name-pill {
    bottom: clamp(5px, 0.45vw, 8px);
    bottom: clamp(5px, 4cqw, 8px);
    max-width: 86%;
  }

  .student-grid:not(.is-group-grid) .outfit-pill {
    min-width: 0;
    min-height: clamp(16px, 1.25vw, 24px);
    min-height: clamp(16px, 13cqw, 24px);
    padding: 0 clamp(4px, 0.42vw, 8px);
    padding: 0 clamp(4px, 4cqw, 8px);
    font-size: clamp(8.5px, 0.68vw, 12px);
    font-size: clamp(8.5px, 7.4cqw, 12px);
    gap: clamp(2px, 0.2vw, 4px);
    gap: clamp(2px, 2cqw, 4px);
  }

  .student-grid:not(.is-group-grid) .outfit-pill::before {
    font-size: clamp(8px, 0.6vw, 11px);
    font-size: clamp(8px, 6.5cqw, 11px);
  }
}

.action-chip[data-icon]::before {
  content: "";
  width: 15px;
  height: 15px;
  margin-right: 6px;
  background: currentColor;
  flex: 0 0 auto;
  -webkit-mask: var(--chip-icon) center / contain no-repeat;
  mask: var(--chip-icon) center / contain no-repeat;
}

.action-chip[data-icon="student"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M20 21a8 8 0 0 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8'/%3E%3C/svg%3E");
}

.action-chip[data-icon="group"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="sort"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5h10M11 12h7M11 19h4M4 4v16M2 18l2 2 2-2'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="rank"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v4a5 5 0 0 1-10 0V4ZM5 6H3a4 4 0 0 0 4 4M19 6h2a4 4 0 0 1-4 4'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="shop"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h16l-1 10H5L4 10ZM8 10V7a4 4 0 0 1 8 0v3M3 10l2-5h14l2 5'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="pet-archive"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h10a4 4 0 0 1 4 4v12H7a4 4 0 0 1-4-4V6a2 2 0 0 1 2-2Z'/%3E%3Cpath d='M7 4v16M14 9.5c0 .8-.7 1.5-1.5 1.5S11 10.3 11 9.5 11.7 8 12.5 8 14 8.7 14 9.5ZM10.2 14c.8-1.2 3.8-1.2 4.6 0 .5.8-.1 1.8-1 1.8h-2.6c-.9 0-1.5-1-.95-1.8ZM10 11.2h.01M15 11.2h.01'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="history"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7M3 4v6h6M12 7v6l4 2'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="undo"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-1'/%3E%3C/svg%3E");
}

.action-chip[data-icon="quick"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-12M5 8h4M15 16h4M4 14l2 2 4-5M14 8l2 2 4-5'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="batch"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11 11 13 15 8M4 5h2M4 12h2M4 19h2M10 5h10M10 12h10M10 19h10'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="settings"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6V22a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.6-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9l-.1-.1A2 2 0 1 1 7.1 3l.1.1a1.7 1.7 0 0 0 1.9.3 1.7 1.7 0 0 0 1-1.6V2a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.6 1Z'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="remote-classroom"] {
  --chip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v10H4zM8 19h8M12 15v4'/%3E%3Cpath d='m9 9 3 2 3-2M16 6l2 2M18 6l-2 2'/%3E%3C/g%3E%3C/svg%3E");
}

.action-chip[data-icon="batch"]::before,
.action-chip[data-icon="history"]::before,
.action-chip[data-icon="rank"]::before,
.action-chip[data-icon="shop"]::before,
.action-chip[data-icon="pet-archive"]::before,
.action-chip[data-icon="settings"]::before,
.action-chip[data-icon="remote-classroom"]::before {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 5px;
  background-color: transparent;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  -webkit-mask: none;
  mask: none;
}

.action-chip[data-icon="batch"]::before {
  background-image: url("../assets/ui/action-icons/batch.png?v=20260605-4");
}

.action-chip[data-icon="history"]::before {
  background-image: url("../assets/ui/action-icons/records.png?v=20260605-4");
}

.action-chip[data-icon="rank"]::before {
  background-image: url("../assets/ui/action-icons/rank.png?v=20260605-4");
}

.action-chip[data-icon="shop"]::before {
  background-image: url("../assets/ui/action-icons/shop.png?v=20260605-4");
}

.action-chip[data-icon="pet-archive"]::before {
  background-image: url("../assets/ui/action-icons/archive.png?v=20260605-4");
}

.action-chip[data-icon="settings"]::before {
  background-image: url("../assets/ui/action-icons/settings.png?v=20260605-4");
}

.action-chip[data-icon="remote-classroom"]::before {
  background-image: url("../assets/ui/action-icons/remote-classroom.png?v=20260615-1");
}

.rule-icon-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
}

.rule-icon-bubble.positive {
  background: #dcfce8;
  color: #11a36a;
}

.rule-icon-bubble.negative {
  background: #fff0f3;
  color: #ef5d78;
}

.quick-mode-panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #fff;
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr);
}

.quick-mode-head {
  padding: 16px 22px;
  background: linear-gradient(90deg, #4f46e5, #8b35e8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-mode-head div div {
  font-size: 12px;
  opacity: 0.82;
  font-weight: 800;
}

.quick-mode-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.quick-exit {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.quick-mode-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr 0.95fr;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.quick-students-pane,
.quick-rules-pane {
  min-width: 0;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.quick-students-pane {
  border-right: 1px solid #e5ebf4;
}

.quick-sort-row,
.quick-selection-row,
.letter-row,
.quick-tab-row,
.rank-mode-tabs,
.rank-period-tabs,
.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quick-sort-row button,
.quick-selection-row button,
.letter-row button,
.quick-tab-row button,
.rank-mode-tabs button,
.rank-period-tabs button,
.month-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f3f6fb;
  color: #526274;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.quick-sort-row button.is-active,
.letter-row button.is-active,
.quick-tab-row button.is-active,
.rank-mode-tabs button.is-active,
.rank-period-tabs button.is-active,
.month-tabs button.is-active {
  background: #eef2ff;
  color: #5b55d9;
}

.quick-search {
  width: 100%;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  padding: 0 12px;
  background: #f8fafc;
  color: #2a3a46;
}

.quick-selection-row {
  margin-top: 12px;
  justify-content: flex-end;
}

.quick-selection-row span {
  margin-right: auto;
  color: #627083;
  font-size: 13px;
}

.quick-selection-row strong {
  color: #5b55d9;
}

.letter-row {
  margin: 18px 0 12px;
}

.quick-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

.quick-student-card {
  min-height: 72px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6ecf4;
  padding: 12px;
  text-align: left;
  position: relative;
}

.quick-student-card::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
}

.quick-student-card.is-selected::after {
  border-color: #635bff;
  background: radial-gradient(circle at center, #635bff 0 45%, #fff 47% 100%);
}

.quick-student-card span {
  display: block;
  color: #1f2d3d;
  font-size: 16px;
  font-weight: 900;
}

.quick-student-card em {
  display: inline-flex;
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #5b55d9;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.quick-rules-pane {
  background: linear-gradient(180deg, #f8faff, #ffffff);
}

.quick-tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #e5ebf4;
}

.quick-tab-row button {
  min-height: 48px;
  border-radius: 0;
  background: transparent;
}

.quick-tab-row button.is-active {
  color: #fb8c00;
  background: transparent;
  border-bottom: 2px solid #ff9f0a;
}

.quick-rule-head {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
}

.quick-rule-head .quick-search {
  margin-top: 0;
}

.quick-filter-line {
  justify-content: flex-start;
}

.quick-rule-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 12px;
}

.quick-rule-card {
  min-height: 78px;
  border-radius: 12px;
  background: #f7fffb;
  border: 1px solid #d9f5e8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.quick-rule-card.negative {
  background: #fff8fa;
  border-color: #ffe1e8;
}

.quick-rule-points {
  justify-self: end;
  min-width: 32px;
  min-height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff2d9;
  color: #e08b14;
  font-weight: 900;
}

.quick-rule-card.negative .quick-rule-points {
  background: #edf2f7;
  color: #65758a;
}

.quick-rule-card strong {
  grid-column: 1 / -1;
  color: #17252f;
  font-size: 14px;
}

.quick-badge-card {
  margin-top: 26px;
  min-height: 220px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5ebf4;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.quick-badge-card p {
  margin: 0;
  color: #637285;
}

.quick-tip {
  margin-top: 12px;
  text-align: center;
  color: #d18a12;
  font-size: 13px;
  font-weight: 800;
}

.batch-check {
  display: none;
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d6e0ea;
  background: #fff;
}

.classroom-frame.batch-mode-on .batch-check {
  display: block;
}

.classroom-frame.batch-mode-on .change-chip {
  visibility: hidden;
}

.batch-check.is-checked {
  border-color: #625bff;
  background:
    linear-gradient(45deg, transparent 45%, #fff 45% 55%, transparent 55%) 5px 9px / 10px 6px no-repeat,
    #625bff;
}

.batch-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 28;
  min-height: 58px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e6edf5;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -10px 30px rgba(23, 37, 35, 0.08);
}

.batch-dock div {
  margin-right: auto;
  color: #526274;
  font-size: 13px;
}

.batch-dock strong {
  color: #5d60ff;
}

.batch-dock button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #526274;
  font-weight: 900;
}

.batch-dock .batch-feed {
  min-width: 120px;
  background: #ebeef4;
  color: #8c98a7;
}

.batch-dock .batch-feed:not(:disabled) {
  background: #f0f5ff;
  color: #4d5bd4;
}

.export-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fffaf0;
  border: 1px solid #ffd990;
  color: #d47a00;
  font-size: 13px;
  font-weight: 900;
}

.rank-mode-tabs,
.rank-period-tabs,
.month-tabs {
  margin-bottom: 10px;
}

.rank-sort-note {
  margin: 4px 0 10px;
  color: #65758a;
  font-size: 13px;
  font-weight: 800;
}

.rank-sort-row {
  min-height: 50px;
  margin: 10px 0 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 251, 241, 0.96), rgba(246, 252, 249, 0.96));
  border: 1px solid rgba(255, 185, 79, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #667974;
  font-size: 13px;
  font-weight: 900;
}

.rank-sort-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 8px;
}

.rank-sort-pills button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #58706a;
  border: 1px solid rgba(93, 116, 110, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(57, 70, 86, 0.05);
}

.rank-sort-pills button.is-active {
  background: linear-gradient(135deg, #fff6dc, #fff0c7);
  border-color: rgba(245, 181, 66, 0.42);
  color: #a46000;
  box-shadow: 0 8px 18px rgba(245, 181, 66, 0.16);
}

.rank-blue-tabs {
  margin: 0 -14px 2px;
  padding: 0 26px 16px;
  background: linear-gradient(90deg, #5c4ff0, #5b86f7);
}

.rank-section .rank-mode-tabs {
  width: min(260px, 100%);
  margin: 0 auto 12px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(40, 50, 150, 0.18);
  flex-wrap: nowrap;
  justify-content: center;
}

.rank-section .rank-mode-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
}

.rank-section .rank-mode-tabs button.is-active {
  background: #fff;
  color: #5b55d9;
}

.rank-section .rank-period-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 auto;
  width: min(100%, 500px);
}

.rank-section .rank-period-tabs button {
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.rank-section .rank-period-tabs button.is-active {
  background: #fff;
  color: #5b55d9;
  box-shadow: 0 8px 18px rgba(41, 55, 180, 0.18);
}

.rank-card-row {
  min-height: 86px;
  background: #fff;
  border-color: #eef2f6;
  box-shadow: 0 2px 10px rgba(31, 48, 45, 0.04);
}

.rank-card-row .rank-no {
  background: #fff7dd;
  color: #c77900;
}

.rank-card-row .rank-main {
  flex: 0 1 clamp(150px, 42%, 260px);
}

.rank-card-row .student-name,
.rank-card-row .student-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-card-row .rank-score {
  margin-left: clamp(4px, 1.6vw, 18px);
}

.rank-card-row .rank-no.rank-medal {
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: #fff;
  isolation: isolate;
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.36), 0 8px 16px rgba(57, 70, 86, 0.12);
}

.rank-card-row .rank-no.rank-medal span {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.rank-card-row .rank-no.rank-medal::before,
.rank-card-row .rank-no.rank-medal::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -7px;
  width: 12px;
  height: 17px;
  border-radius: 2px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  filter: brightness(0.95);
}

.rank-card-row .rank-no.rank-medal::before {
  left: 8px;
  transform: rotate(10deg);
}

.rank-card-row .rank-no.rank-medal::after {
  right: 8px;
  transform: rotate(-10deg);
}

.rank-card-row .rank-no.rank-1 {
  background: linear-gradient(145deg, #ffe17a 0%, #ffb22d 52%, #ff8a00 100%);
  color: #7a3d00;
}

.rank-card-row .rank-no.rank-1::before,
.rank-card-row .rank-no.rank-1::after {
  background: linear-gradient(180deg, #ffb22d, #ff7b00);
}

.rank-card-row .rank-no.rank-2 {
  background: linear-gradient(145deg, #f6fbff 0%, #cfd9e8 50%, #9daabf 100%);
  color: #435064;
}

.rank-card-row .rank-no.rank-2::before,
.rank-card-row .rank-no.rank-2::after {
  background: linear-gradient(180deg, #cfd9e8, #9daabf);
}

.rank-card-row .rank-no.rank-3 {
  background: linear-gradient(145deg, #ffd5a0 0%, #d58a49 52%, #a75b29 100%);
  color: #fff7ed;
}

.rank-card-row .rank-no.rank-3::before,
.rank-card-row .rank-no.rank-3::after {
  background: linear-gradient(180deg, #d58a49, #a75b29);
}

.rank-score {
  min-width: 98px;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.rank-score strong {
  min-width: 78px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7de, #ffe8b7);
  color: #d87500;
  border: 1px solid rgba(245, 181, 66, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 16px rgba(245, 181, 66, 0.13);
}

.rank-score.badge strong {
  background: linear-gradient(135deg, #fff9df, #ffeaa5);
  color: #9b6500;
}

.rank-score strong span {
  font-size: 15px;
  line-height: 1;
}

.rank-score em {
  color: #81908d;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.rank-slogan {
  padding: 18px 8px 6px;
  text-align: center;
  color: #d38a12;
  font-weight: 900;
}

.record-row {
  background: #fff;
  border-color: #eef2f6;
  box-shadow: 0 2px 8px rgba(31, 48, 45, 0.035);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.record-title strong {
  color: #1f302d;
  font-size: 15px;
  font-weight: 900;
}

.record-title span {
  color: #9aa5ad;
  font-size: 12px;
  font-weight: 800;
}

.record-status {
  min-height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: #f1f4f6;
  color: #8b969c;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
}

.record-teacher {
  margin-top: 3px;
  color: #98a4ad;
  font-size: 12px;
  font-weight: 700;
}

.record-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.record-points {
  min-width: 48px;
  min-height: 28px;
  border-radius: 999px;
  background: #dcfce8;
  color: #0e9d61;
  display: grid;
  place-items: center;
}

.record-points.negative {
  background: #fff1f0;
  color: #e4483c;
}

.record-points.badge {
  background: #fff7d8;
  color: #c98400;
}

.record-points.neutral {
  background: #f1f4f6;
  color: #7b8790;
}

.record-undo-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff1f0;
  color: #db4b3f;
  font-size: 12px;
  font-weight: 900;
}

.shop-section .section-head h2::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  vertical-align: -7px;
  background: url("../assets/ui/action-icons/shop.png") center / contain no-repeat;
}

.shop-tabs {
  margin: 10px 0 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shop-tabs button {
  min-height: 38px;
  border-radius: 8px;
  background: #f4f7fb;
  color: #56687a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.shop-tabs button.is-active {
  background: #fff8e6;
  border: 1px solid #ffd98a;
  color: #d47a00;
}

.shop-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.shop-tools h3 {
  margin: 0;
  font-size: 18px;
}

.shop-tools input {
  min-height: 38px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  padding: 0 12px;
  background: #f8fafc;
}

.shop-tool-buttons {
  display: flex;
  gap: 8px;
}

.shop-tool-buttons.is-hidden {
  display: none;
}

.shop-tool-buttons button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #e4eadf;
  background: #f8fbf4;
  color: #30453f;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.shop-tool-buttons button:last-child {
  background: #fff8e6;
  border-color: #ffd98a;
  color: #d47a00;
}

#manageShopPriceButton {
  background: #ecf7ff;
  border-color: #cfe6ff;
  color: #2764b4;
}

.shop-section .product-list {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.shop-section .product-row {
  min-height: 272px;
  padding: 16px;
  background: #fff;
  border-color: #edf2f7;
  box-shadow: 0 2px 10px rgba(31, 48, 45, 0.04);
  grid-template-columns: 1fr;
  justify-items: stretch;
  gap: 8px;
}

.shop-section .product-title {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 17px;
  line-height: 1.25;
  word-break: keep-all;
}

.shop-section .product-desc {
  min-height: 40px;
  color: #526274;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.stock-badge {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f5fbf2;
  border: 1px solid #d8edcf;
  color: #407b30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.shop-section .product-price {
  color: #ff6500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 15px;
}

.shop-section .product-price span {
  font-size: 13px;
}

.product-icon {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  justify-self: center;
}

.product-icon::before {
  content: "";
  width: 36px;
  height: 36px;
  background: #dd7700;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7ZM12 7h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7ZM12 7h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.shop-section .redeem-button {
  width: 100%;
  min-height: 36px;
  margin-top: auto;
  background: #fff8ef;
  border: 1px solid #ffe1b8;
  color: #ff6500;
}

.shop-section .redeem-button:disabled {
  background: #f4f7fb;
  border-color: #edf2f7;
  color: #95a2b3;
}

.shop-section .product-list > .empty {
  grid-column: 1 / -1;
}

.shop-record-card {
  min-height: 106px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf2f7;
  display: grid;
  gap: 8px;
}

.shop-record-card strong {
  color: #17252f;
}

.shop-record-card span {
  color: #ff6500;
  font-weight: 900;
}

.shop-record-card em {
  color: #64748b;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

#settingsHost .drawer-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#studentDrawerHost .drawer-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#classManagerHost .drawer-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 44;
}

#shopManagerHost .drawer-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 45;
}

#teacherLoginHost {
  z-index: 90;
}

#adminVerifyHost {
  z-index: 96;
}

.admin-number-backdrop {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 239, 226, 0.72);
  backdrop-filter: blur(10px);
}

.admin-number-dialog {
  width: min(660px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(83, 103, 94, 0.14);
  box-shadow: 0 24px 70px rgba(57, 70, 86, 0.22);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(244px, 300px);
  gap: 16px;
}

.admin-number-copy {
  min-width: 0;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: #f8fbf8;
  border: 1px solid rgba(83, 103, 94, 0.1);
  display: grid;
  align-content: center;
  gap: 10px;
}

.admin-number-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #176b68;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 12px 22px rgba(23, 107, 104, 0.18);
}

.admin-number-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.admin-number-copy p {
  margin: 0;
  color: #52635f;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 850;
}

.admin-number-status {
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef7f2;
  color: #176b68;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
}

.admin-number-status.is-error {
  background: #fff1ec;
  color: #ad3d1f;
}

.admin-number-card {
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid rgba(255, 169, 37, 0.18);
  display: grid;
  gap: 12px;
}

.admin-number-screen {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(83, 103, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-number-placeholder {
  color: #8a9691;
  font-size: 13px;
  font-weight: 850;
}

.admin-number-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #176b68;
  box-shadow: 0 0 0 3px rgba(23, 107, 104, 0.1);
}

.admin-number-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-number-keypad button {
  min-width: 0;
  min-height: 52px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid rgba(83, 103, 94, 0.12);
  box-shadow: none;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
}

.admin-number-keypad button:active {
  transform: translateY(1px);
  background: #eef7f2;
}

.admin-number-keypad button[data-admin-number-clear],
.admin-number-keypad button.is-confirm {
  font-size: 16px;
}

.admin-number-keypad button.is-confirm {
  background: #176b68;
  color: #ffffff;
  border-color: #176b68;
  box-shadow: 0 10px 18px rgba(23, 107, 104, 0.16);
}

.admin-number-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.admin-number-actions .plain-button {
  min-height: 36px;
  border-color: rgba(83, 103, 94, 0.12);
  background: #ffffff;
  color: #52635f;
}

.teacher-login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 26% 18%, rgba(39, 174, 96, 0.16), transparent 28%),
    rgba(20, 35, 32, 0.58);
  backdrop-filter: blur(12px);
}

.teacher-login-dialog {
  width: min(820px, calc(100vw - 32px));
  min-height: 420px;
  padding: 26px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 173, 40, 0.16), transparent 30%),
    linear-gradient(135deg, #ffffff, #f7fffb);
  border: 1px solid rgba(255, 169, 37, 0.24);
  box-shadow: 0 30px 82px rgba(10, 28, 25, 0.36);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 22px;
}

.teacher-login-copy {
  min-width: 0;
  align-self: center;
}

.teacher-login-copy h2 {
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1.16;
  color: var(--ink);
  letter-spacing: 0;
}

.teacher-login-copy p {
  margin: 0;
  max-width: 420px;
  color: #52635f;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 800;
}

.teacher-login-badges {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-login-badges span {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf7f1;
  color: #176b68;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}

.teacher-qr-card {
  align-self: center;
  min-width: 0;
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(83, 103, 94, 0.14);
  box-shadow: 0 16px 38px rgba(40, 60, 80, 0.12);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.teacher-qr-image-wrap {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(83, 103, 94, 0.12);
  display: grid;
  place-items: center;
}

.teacher-qr-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.teacher-qr-image-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.teacher-qr-image-wrap code {
  color: #102c27;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.teacher-login-link {
  color: #176b68;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
}

.teacher-login-status {
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  margin-top: 16px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef7f2;
  color: #176b68;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}

.teacher-login-status.is-denied,
.teacher-login-status.is-expired,
.teacher-login-status.is-error {
  background: #fff1ec;
  color: #ad3d1f;
}

.teacher-login-tip {
  margin-top: 12px !important;
  max-width: 480px !important;
  color: #8b6a20 !important;
  font-size: 12px !important;
  line-height: 1.65 !important;
}

.teacher-login-tip code {
  padding: 2px 4px;
  border-radius: 5px;
  background: #fff7db;
  color: #795000;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.teacher-qr-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.teacher-qr-card > span {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff6df;
  color: #9a6200;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
}

.teacher-phone-card {
  align-self: center;
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(83, 103, 94, 0.14);
  box-shadow: 0 16px 38px rgba(40, 60, 80, 0.12);
  display: grid;
  gap: 14px;
}

.teacher-login-mode-tabs {
  min-width: 0;
  padding: 4px;
  border-radius: 12px;
  background: #f1f7f4;
  border: 1px solid rgba(83, 103, 94, 0.12);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.teacher-login-mode-tabs button {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: #52635f;
  font-size: 12px;
  font-weight: 900;
}

.teacher-login-mode-tabs button.is-active {
  background: #fff;
  color: #176b68;
  border: 1px solid rgba(53, 168, 110, 0.18);
}

.teacher-phone-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: #52635f;
  font-size: 13px;
  font-weight: 900;
}

.teacher-phone-field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(83, 103, 94, 0.18);
  background: #f8fcfa;
  color: #102c27;
  font-size: 16px;
  font-weight: 850;
  outline: none;
}

.teacher-phone-field input:focus {
  border-color: #35a86e;
  box-shadow: 0 0 0 3px rgba(53, 168, 110, 0.14);
  background: #fff;
}

.teacher-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
  align-items: center;
}

.teacher-code-row button {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
}

.teacher-phone-submit {
  width: 100%;
  min-height: 48px;
}

.teacher-login-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-login-actions button {
  min-width: 148px;
}

@media (max-width: 720px) {
  .admin-number-dialog {
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 16px;
    grid-template-columns: 1fr;
  }

  .admin-number-keypad {
    gap: 8px;
  }

  .admin-number-keypad button {
    min-height: 50px;
    border-radius: 10px;
    font-size: 22px;
  }

  .admin-number-copy h2 {
    font-size: 24px;
  }

  .teacher-login-dialog {
    max-height: calc(100vh - 32px);
    overflow: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .teacher-login-copy h2 {
    font-size: 25px;
  }

  .teacher-phone-card {
    align-self: stretch;
  }
}

@media (max-width: 420px) {
  .admin-number-backdrop {
    padding: 12px;
  }

  .admin-number-dialog {
    width: 100%;
  }

  .admin-number-keypad button {
    min-height: 46px;
  }

  .admin-number-actions .plain-button {
    width: 100%;
  }

  .teacher-login-backdrop {
    padding: 14px;
  }

  .teacher-login-dialog {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
  }

  .teacher-code-row {
    grid-template-columns: 1fr;
  }

  .teacher-login-actions button {
    width: 100%;
  }
}

.shop-manager-dialog {
  width: min(980px, 94vw);
  max-height: min(720px, 88vh);
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 173, 40, 0.13), transparent 30%),
    linear-gradient(135deg, #ffffff, #fbfff9);
  border: 1px solid rgba(255, 169, 37, 0.24);
  box-shadow: 0 28px 72px rgba(23, 37, 35, 0.24);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.shop-manager-dialog.price-dialog {
  width: min(860px, 94vw);
}

.shop-manager-head,
.shop-manager-toolbar,
.shop-manager-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.shop-manager-head h2 {
  margin: 2px 0 6px;
  color: #17252f;
  font-size: 26px;
}

.shop-manager-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.shop-manager-toolbar {
  justify-content: flex-start;
  padding: 10px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid #edf2f7;
}

.shop-product-edit-list {
  min-height: 180px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.shop-product-edit-row {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e8edf4;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(31, 48, 45, 0.06);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 92px;
  gap: 10px;
  align-items: end;
}

.shop-product-main-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(120px, 0.9fr) 96px 96px;
  gap: 10px;
}

.shop-product-edit-row label {
  min-width: 0;
  color: #526274;
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
}

.shop-product-edit-row input,
.shop-product-edit-row textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #dce8e3;
  border-radius: 10px;
  background: #fbfdff;
  color: #17252f;
  font-size: 13px;
  font-weight: 800;
}

.shop-product-edit-row input {
  min-height: 38px;
  padding: 0 10px;
}

.shop-product-edit-row textarea {
  min-height: 58px;
  padding: 10px;
  resize: vertical;
}

.shop-product-description {
  grid-column: 1 / 2;
}

.shop-product-unlimited {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #e4eadf;
  background: #f8fbf4;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  color: #30453f !important;
  white-space: nowrap;
}

.shop-product-unlimited input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.shop-manager-footer {
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.shop-price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shop-price-summary div {
  min-height: 70px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fbf4;
  border: 1px solid #e4eadf;
  display: grid;
  align-content: center;
  gap: 4px;
}

.shop-price-summary strong {
  color: #176b68;
  font-size: 24px;
  line-height: 1;
}

.shop-price-summary span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.shop-price-edit-list {
  min-height: 220px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.shop-price-edit-row {
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e8edf4;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(31, 48, 45, 0.05);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 110px 120px;
  gap: 10px;
  align-items: center;
}

.shop-price-product {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.shop-price-product strong {
  color: #17252f;
  font-size: 15px;
  font-weight: 950;
}

.shop-price-product span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-price-edit-row label {
  min-width: 0;
  color: #526274;
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
}

.shop-price-edit-row input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #dce8e3;
  border-radius: 10px;
  padding: 0 10px;
  background: #fbfdff;
  color: #17252f;
  font-size: 13px;
  font-weight: 850;
}

.shop-price-edit-row .shop-product-unlimited input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}

.class-manager-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-height: min(820px, calc(100vh - 48px));
  padding: 20px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 173, 40, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff, #fbfff9);
  border: 1px solid rgba(255, 169, 37, 0.22);
  box-shadow: 0 28px 72px rgba(23, 37, 35, 0.24);
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(180px, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.class-switch-dialog {
  width: min(900px, calc(100vw - 36px));
  max-height: min(860px, calc(100vh - 28px));
  min-height: min(700px, calc(100vh - 28px));
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 173, 40, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff, #fbfff9);
  border: 1px solid rgba(255, 169, 37, 0.22);
  box-shadow: 0 28px 72px rgba(23, 37, 35, 0.24);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.class-manager-head,
.class-manager-footer,
.class-manager-classline,
.class-manager-toolbar,
.photo-import-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.class-manager-head,
.class-manager-footer {
  justify-content: space-between;
}

.class-manager-head h2 {
  margin: 3px 0 0;
  font-size: 23px;
}

.class-manager-classline {
  align-items: flex-end;
  flex-wrap: nowrap;
}

.class-manager-classline label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #52635f;
  font-size: 13px;
  font-weight: 900;
}

.class-manager-classline label:first-child {
  flex: 1 1 auto;
}

.class-manager-classline input:not([type="checkbox"]),
.photo-import-box textarea,
.class-manager-table input {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(83, 103, 94, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.class-manager-classline input:focus,
.photo-import-box textarea:focus,
.class-manager-table input:focus {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.1);
}

.class-manager-classline .import-check {
  min-width: auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff8e8;
  border: 1px solid rgba(255, 169, 37, 0.22);
  color: #8b5a00;
}

.class-manager-toolbar {
  flex-wrap: wrap;
}

.class-account-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(235, 248, 244, 0.92), rgba(255, 250, 235, 0.9));
  border: 1px solid rgba(51, 128, 115, 0.14);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.class-account-panel.is-logged-in {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.94), rgba(236, 253, 245, 0.88));
  border-color: rgba(34, 197, 94, 0.2);
}

.class-account-panel div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.class-account-panel span {
  color: #0f766e;
  font-size: 11px;
  font-weight: 950;
}

.class-account-panel strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.class-account-panel em {
  color: #64748b;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 800;
}

.class-account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.class-account-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.class-switch-create {
  position: relative;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(83, 103, 94, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.class-switch-create label {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #52635f;
  font-size: 12px;
  font-weight: 900;
}

.class-switch-create input {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(83, 103, 94, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  font-weight: 800;
}

.class-switch-create input:focus {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.1);
}

.class-switch-list {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.class-switch-card {
  min-height: 76px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(83, 103, 94, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(57, 70, 86, 0.06);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.class-switch-card.is-active {
  border-color: rgba(255, 138, 0, 0.38);
  background: #fff8e8;
  box-shadow: 0 14px 28px rgba(255, 169, 37, 0.14);
}

.class-switch-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.class-switch-main span {
  color: #ff8a00;
  font-size: 11px;
  font-weight: 950;
}

.class-switch-main strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.14;
  font-weight: 950;
}

.class-switch-main em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.class-switch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.class-switch-actions button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.class-switch-actions b {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(98, 182, 109, 0.12);
  color: #3f965a;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 950;
}

.photo-import-box {
  align-items: stretch;
}

.qwen-import-box {
  padding: 10px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(83, 103, 94, 0.1);
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.qwen-import-box label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #52635f;
  font-size: 13px;
  font-weight: 900;
}

.qwen-import-box input {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(83, 103, 94, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  font-weight: 800;
}

.qwen-import-box input:focus {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.1);
}

.photo-import-box textarea {
  min-height: 74px;
  padding: 12px;
  resize: vertical;
}

.photo-import-box button {
  flex: 0 0 auto;
}

.class-import-status {
  min-height: 22px;
  color: #ff7a00;
  font-size: 13px;
  font-weight: 900;
}

.class-roster-grid-wrap,
.class-manager-table-wrap {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-radius: 18px;
  border: 1px solid rgba(83, 103, 94, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.class-roster-grid {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.class-roster-card {
  position: relative;
  min-width: 0;
  min-height: 82px;
  padding: 8px 7px 7px;
  border-radius: 12px;
  border: 1px solid rgba(83, 103, 94, 0.1);
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  gap: 5px;
  contain: layout paint style;
}

.class-roster-card label {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #64748b;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
}

.class-roster-card input {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(83, 103, 94, 0.14);
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 12px;
  font-weight: 850;
}

.class-roster-card [data-roster-no] {
  max-width: 100%;
  font-size: 11px;
}

.class-roster-card [data-roster-name] {
  font-size: 13px;
  font-weight: 900;
}

.class-roster-card input:focus {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 138, 0, 0.09);
}

.roster-delete-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff0f3;
  color: #d44864;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.class-manager-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.class-manager-table th,
.class-manager-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(83, 103, 94, 0.09);
  text-align: left;
}

.class-manager-table th:first-child,
.class-manager-table td:first-child {
  width: 180px;
}

.class-manager-table th:nth-child(2),
.class-manager-table td:nth-child(2) {
  width: auto;
}

.class-manager-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff9ed;
  color: #4d625c;
  font-size: 13px;
  font-weight: 900;
}

.class-manager-table th:last-child,
.class-manager-table td:last-child {
  width: 118px;
  text-align: right;
}

.class-manager-table input {
  min-height: 42px;
  font-size: 15px;
}

.class-manager-table [data-roster-name] {
  font-size: 16px;
  font-weight: 800;
}

.class-manager-groups {
  min-height: 148px;
  max-height: 220px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(83, 103, 94, 0.12);
  background: rgba(248, 250, 252, 0.78);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.group-manager-dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: min(820px, calc(100vh - 36px));
  min-height: min(640px, calc(100vh - 36px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.group-manager-dialog .class-manager-groups {
  min-height: 0;
  max-height: none;
  height: 100%;
}

.group-manager-dialog .class-group-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-content: start;
}

.class-manager-section-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.class-manager-section-head div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.class-manager-section-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.class-manager-section-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.class-group-list {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.class-group-row {
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(83, 103, 94, 0.1);
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.class-group-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.class-group-main strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 950;
}

.class-group-main span,
.class-group-main em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.class-group-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.class-group-empty {
  min-height: 72px;
  border: 1px dashed rgba(83, 103, 94, 0.18);
  border-radius: 14px;
  color: #7b8c87;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

.group-member-dialog {
  width: min(920px, calc(100vw - 48px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.group-member-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.group-member-summary label {
  display: grid;
  gap: 6px;
  color: #52635f;
  font-size: 13px;
  font-weight: 900;
}

.group-member-summary input {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(83, 103, 94, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  font-size: 15px;
  font-weight: 800;
}

.group-member-summary input:focus {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.1);
}

.group-member-count-box {
  min-width: 116px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fff8e8;
  border: 1px solid rgba(255, 169, 37, 0.24);
  color: #8b5a00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 900;
}

.group-member-count-box strong {
  color: #ff7a00;
  font-size: 22px;
  line-height: 1;
}

.group-member-count-box span,
.group-member-count-box em {
  font-size: 13px;
  font-style: normal;
}

.group-member-grid {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 4px;
}

.group-member-card {
  min-height: 78px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(83, 103, 94, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(57, 70, 86, 0.06);
  display: grid;
  grid-template-columns: 20px 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.group-member-card:hover,
.group-member-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(255, 138, 0, 0.42);
  background: #fff8e8;
  box-shadow: 0 14px 28px rgba(255, 169, 37, 0.14);
}

.group-member-card input {
  width: 18px;
  height: 18px;
  accent-color: #ff8a00;
}

.group-member-pet-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 16px rgba(57, 70, 86, 0.1);
}

.group-member-pet-avatar.pet-avatar-emoji {
  display: grid;
  place-items: center;
  font-size: 27px;
  line-height: 1;
}

.group-member-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.group-member-info strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-member-info em {
  color: #7a8b87;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

#studentDrawerHost .student-drawer {
  width: min(720px, 92vw);
  height: min(600px, 82vh);
  border-left: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(23, 37, 35, 0.22);
}

#studentDrawerHost .student-drawer.score-drawer {
  width: min(960px, 92vw);
  height: min(660px, calc(100vh - 72px));
  max-height: none;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#studentDrawerHost .student-drawer.pet-drawer {
  width: min(1120px, 94vw);
  height: min(720px, calc(100vh - 56px));
  max-height: none;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 190, 103, 0.2), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(94, 191, 168, 0.15), transparent 28%),
    linear-gradient(180deg, #fff8ef 0%, #f8fbf8 56%, #f3f7fb 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#studentDrawerHost .student-drawer.score-drawer .drawer-head,
#studentDrawerHost .student-drawer.score-drawer .drawer-tabs,
#studentDrawerHost .student-drawer.pet-drawer .drawer-head,
#studentDrawerHost .student-drawer.pet-drawer .drawer-tabs {
  flex: 0 0 auto;
}

#studentDrawerHost .student-drawer.score-drawer .drawer-body {
  min-height: 0;
  overflow: auto;
}

#studentDrawerHost .student-drawer.pet-drawer .drawer-body {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 4px 2px 22px;
}

.pet-choice-page {
  display: grid;
  gap: 18px;
}

.pet-choice-hero {
  min-height: 188px;
  padding: 20px 24px;
  border-radius: 26px;
  border: 1px solid rgba(226, 216, 199, 0.86);
  background:
    radial-gradient(circle at 22% 50%, color-mix(in srgb, var(--pet-color) 18%, transparent), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 251, 241, 0.9));
  box-shadow: 0 16px 38px rgba(69, 76, 89, 0.09);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  overflow: hidden;
}

.pet-choice-current-art {
  position: relative;
  width: 158px;
  height: 158px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 -14px 24px rgba(232, 122, 56, 0.06), 0 18px 28px rgba(46, 62, 78, 0.1);
}

.pet-choice-current-pet {
  width: 138px;
  height: 138px;
  object-fit: contain;
  font-size: 86px;
  line-height: 1;
  border-radius: 22px;
  filter: drop-shadow(0 14px 18px rgba(39, 55, 70, 0.12));
}

.pet-choice-copy span {
  color: #e87a38;
  font-size: 13px;
  font-weight: 950;
}

.pet-choice-copy h3 {
  margin: 8px 0 10px;
  color: #172a24;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.04;
  font-weight: 950;
}

.pet-choice-copy p {
  margin: 0;
  color: #65746e;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 800;
}

.pet-choice-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.pet-choice-section-head strong {
  display: block;
  margin-top: 2px;
  color: #172a24;
  font-size: 22px;
  font-weight: 950;
}

.pet-choice-section-head span {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff2e4;
  color: #d56c24;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 950;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-panel {
  min-height: 0;
  padding-bottom: 20px;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-rule-grid {
  padding: 18px 20px 18px;
  gap: 22px 16px;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-rule-tile {
  min-height: 112px;
  gap: 6px;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-rule-icon {
  width: 68px;
  height: 68px;
  font-size: 32px;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-rule-points {
  min-height: 22px;
  margin-top: -16px;
}

#studentDrawerHost .student-drawer.score-drawer .feedback-rule-tile strong {
  font-size: 14px;
  line-height: 1.24;
}

#studentDrawerHost .drawer-head {
  min-height: 72px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

#studentDrawerHost .drawer-tabs {
  margin: 12px 0 14px;
}

#studentDrawerHost .drawer-tab.is-active {
  background: #fff8e6;
  color: #d47a00;
  box-shadow: inset 0 0 0 1px #ffd98a;
}

#settingsHost .settings-drawer {
  position: relative;
  width: min(1000px, 94vw);
  height: min(620px, 82vh);
  padding: 0;
  border-left: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(23, 37, 35, 0.22);
  overflow: hidden;
}

#settingsHost .drawer-head {
  min-height: 64px;
  padding: 14px 22px;
  border-bottom: 1px solid #edf2f7;
}

#settingsHost .drawer-tabs {
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #edf2f7;
}

#settingsHost .drawer-tab {
  min-height: 54px;
  border-radius: 0;
  background: transparent;
  color: #5d6c7f;
  gap: 6px;
  font-size: 14px;
}

#settingsHost .drawer-tab.is-active {
  background: transparent;
  color: #ff8a00;
  box-shadow: inset 0 -3px 0 #ff9f0a;
}

#settingsHost .drawer-tab::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--settings-tab-icon) center / contain no-repeat;
  mask: var(--settings-tab-icon) center / contain no-repeat;
}

#settingsHost .drawer-tab:nth-child(1) {
  --settings-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.5 19c-2.8 0-5.5-1.4-5.5-3.6 0-1.6 1.2-2.8 2.6-2.8.9 0 1.5.4 2 .9.5-.5 1.2-.9 2.1-.9 1.4 0 2.6 1.2 2.6 2.8 0 2.2-2.7 3.6-5.8 3.6Z'/%3E%3Cpath d='M5.5 10.5c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.8 1 1.8 2.1-.8 2.1-1.8 2.1ZM10 8.5c-1 0-1.8-1.1-1.8-2.4S9 3.7 10 3.7s1.8 1.1 1.8 2.4S11 8.5 10 8.5ZM15 8.5c-1 0-1.8-1.1-1.8-2.4S14 3.7 15 3.7s1.8 1.1 1.8 2.4S16 8.5 15 8.5ZM19.5 10.5c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.8 1 1.8 2.1-.8 2.1-1.8 2.1Z'/%3E%3C/g%3E%3C/svg%3E");
}

#settingsHost .drawer-tab:nth-child(2) {
  --settings-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5h6M9 12h6M9 19h6M5 7h.01M5 14h.01M5 21h.01M19 3v18'/%3E%3C/g%3E%3C/svg%3E");
}

#settingsHost .drawer-tab:nth-child(3) {
  --settings-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8M14 7h7v7'/%3E%3C/g%3E%3C/svg%3E");
}

#settingsHost .drawer-tab:nth-child(4) {
  --settings-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='13' r='7'/%3E%3Cpath d='M8 8 6 4M16 8l2-4M9 13h.01M15 13h.01M10 17h4'/%3E%3C/g%3E%3C/svg%3E");
}

#settingsHost .drawer-tab:nth-child(5) {
  --settings-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M7 7v13h10V7M9 7V4h6v3M10 11v6M14 11v6'/%3E%3C/g%3E%3C/svg%3E");
}

#settingsHost .drawer-body {
  height: calc(100% - 120px);
  max-height: none;
  padding: 0;
  overflow: hidden;
}

.settings-archive-panel {
  height: 100%;
  padding: 18px;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 188, 95, 0.18), transparent 34%),
    radial-gradient(circle at 90% 2%, rgba(94, 191, 168, 0.14), transparent 30%),
    linear-gradient(180deg, #fffaf1 0%, #f8fbf8 100%);
}

.settings-archive-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(226, 216, 199, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(69, 76, 89, 0.08);
}

.settings-archive-head strong {
  display: block;
  margin: 2px 0 4px;
  color: #172a24;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 950;
}

.settings-archive-head span {
  color: #65746e;
  font-size: 13px;
  font-weight: 800;
}

.settings-archive-panel .pet-archive-tabs {
  width: 100%;
  margin-top: 14px;
}

.settings-archive-grid {
  width: 100%;
  margin: 16px 0 20px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.settings-archive-panel .archive-pet-card {
  padding: 10px;
  border-radius: 16px;
}

.settings-archive-panel .archive-pet-art {
  border-radius: 14px;
}

.settings-archive-panel .archive-card-pet:not(.archive-pet-emoji) {
  border-radius: 12px;
}

.settings-archive-panel .archive-pet-meta strong {
  font-size: 16px;
}

.settings-rule-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-rule-summary span {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f3f6fb;
  color: #5d6c7f;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
}

.settings-rule-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.settings-rules-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 0;
}

.settings-rule-side {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid #edf2f7;
  overflow: auto;
}

.settings-side-primary,
.settings-side-secondary {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  font-weight: 900;
}

.settings-side-primary {
  background: #3278ff;
  color: #fff;
}

.settings-side-secondary {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #e5ebf4;
  color: #526274;
}

.settings-side-title {
  margin: 16px 0 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.settings-side-cats {
  display: grid;
  gap: 8px;
}

.settings-side-cats button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: #526274;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}

.settings-side-cats button.is-active {
  background: #edf5ff;
  color: #3278ff;
}

.settings-side-cats .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3278ff;
}

.settings-side-cats .dot.behavior {
  background: #8b5cf6;
}

.settings-side-cats .dot.health {
  background: #22c55e;
}

.settings-side-cats .dot.other {
  background: #f59e0b;
}

.settings-side-total {
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.settings-side-total strong {
  color: #17252f;
  font-size: 15px;
}

.settings-side-total em {
  color: #12a56c;
  font-style: normal;
}

.settings-side-total em.danger {
  color: #ef4444;
}

.settings-rule-main {
  min-width: 0;
  padding: 14px;
  overflow: auto;
}

.settings-rule-main-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17252f;
}

.settings-rule-main-head::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #3278ff;
}

.settings-rule-main-head span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.settings-category-picks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-category-picks button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #f3f6fb;
  color: #5d6c7f;
  font-weight: 900;
}

.settings-category-picks button.is-active {
  background: #eef2ff;
  color: #5b55d9;
}

.settings-rule-card {
  min-height: 128px;
  padding: 14px 12px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e3e9f2;
  display: grid;
  align-content: start;
  gap: 8px;
  position: relative;
}

.settings-rule-card .rule-icon-bubble {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 15px;
}

.settings-rule-card .rule-title {
  min-height: 34px;
  font-size: 13px;
  line-height: 1.35;
  word-break: keep-all;
}

.settings-rule-card strong {
  font-size: 18px;
}

.settings-rule-card span:last-child {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9fbf0;
  color: #16a15f;
  font-size: 12px;
  font-weight: 900;
}

.settings-rule-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.settings-rule-tools button {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-weight: 900;
}

.settings-panel-grid {
  height: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
}

.settings-info-card {
  min-height: 120px;
  padding: 16px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
  align-content: center;
}

.settings-info-card strong {
  color: #17252f;
  font-size: 18px;
}

.settings-info-card span {
  color: #64748b;
  font-size: 13px;
}

.settings-info-card.danger {
  background: #fff8f8;
  border-color: #ffd9d9;
}

.settings-popover {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(15, 23, 42, 0.18);
  display: grid;
  place-items: center;
  padding: 20px;
}

.settings-popover-card {
  width: min(360px, 92vw);
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e3e9f2;
  box-shadow: 0 18px 42px rgba(23, 37, 35, 0.2);
  display: grid;
  gap: 12px;
}

.settings-popover-card.wide {
  width: min(520px, 92vw);
}

.settings-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-popover-head button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #edf4f1;
  color: #34504b;
  font-weight: 900;
}

.settings-popover-card input,
.settings-popover-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #dce8e3;
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfdff;
  color: #17252f;
}

.settings-popover-card textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

#petArchiveHost {
  z-index: 48;
}

.pet-archive-page {
  position: fixed;
  inset: 0;
  z-index: 48;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 190, 103, 0.2), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(94, 191, 168, 0.16), transparent 28%),
    radial-gradient(circle at 70% 86%, rgba(118, 139, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #fff8ef 0%, #f8fbf8 56%, #f3f7fb 100%);
  color: #132620;
}

.pet-archive-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(98, 112, 125, 0.1) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.45;
}

.pet-archive-header,
.pet-archive-tabs,
.pet-archive-layout {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.pet-archive-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(226, 216, 199, 0.82);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 42px rgba(69, 76, 89, 0.1);
  backdrop-filter: blur(18px);
}

.pet-archive-header h1 {
  margin: 2px 0 6px;
  color: #172a24;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  font-weight: 950;
}

.pet-archive-header p {
  margin: 0;
  color: #65746e;
  font-size: 14px;
  font-weight: 700;
}

.pet-archive-back {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb347, #ff870f);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(255, 132, 0, 0.22);
}

.pet-archive-count {
  min-width: 90px;
  min-height: 72px;
  border-radius: 22px;
  background: #fff7df;
  border: 1px solid #ffe2a8;
  display: grid;
  place-items: center;
  align-content: center;
  color: #b46300;
}

.pet-archive-count strong {
  font-size: 26px;
  line-height: 1;
}

.pet-archive-count span {
  margin-top: 4px;
  color: #8c6a3b;
  font-size: 13px;
  font-weight: 800;
}

.pet-archive-tabs {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pet-archive-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 216, 199, 0.9);
  color: #52635d;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(69, 76, 89, 0.06);
}

.pet-archive-tabs button.is-active {
  background: #e87a38;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(232, 122, 56, 0.24);
}

.pet-archive-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.pet-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.archive-pet-card {
  min-width: 0;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 216, 199, 0.82);
  box-shadow: 0 12px 30px rgba(69, 76, 89, 0.08);
  display: grid;
  gap: 12px;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.archive-pet-card:hover,
.archive-pet-card.is-active {
  transform: translateY(-3px);
  border-color: rgba(232, 122, 56, 0.45);
  box-shadow: 0 18px 38px rgba(69, 76, 89, 0.13);
}

.archive-pet-art {
  position: relative;
  aspect-ratio: 1.08;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: transparent;
}

.archive-pet-art::before {
  content: none;
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -12px 22px rgba(232, 122, 56, 0.08), 0 16px 30px rgba(46, 62, 78, 0.1);
}

.archive-card-pet {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  object-fit: contain;
  transform: scale(var(--growth-scale));
}

.archive-card-pet:not(.archive-pet-emoji) {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  filter: drop-shadow(0 14px 18px rgba(39, 55, 70, 0.12));
}

.archive-card-pet.archive-pet-emoji {
  display: grid;
  place-items: center;
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 12px 16px rgba(39, 55, 70, 0.12));
}

.archive-pet-meta {
  display: grid;
  gap: 4px;
  padding: 0 4px 4px;
}

.archive-pet-meta span {
  color: #8d7661;
  font-size: 12px;
  font-weight: 900;
}

.archive-pet-meta strong {
  color: #172a24;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
}

.archive-pet-meta small {
  color: #71817b;
  font-size: 12px;
  font-weight: 800;
}

.pet-archive-detail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
}

.archive-detail-card,
.archive-stage-panel {
  border-radius: 28px;
  border: 1px solid rgba(226, 216, 199, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 38px rgba(69, 76, 89, 0.1);
}

.archive-detail-card {
  min-height: 300px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(220px, 1fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 42%, color-mix(in srgb, var(--pet-color) 20%, transparent), transparent 34%),
    linear-gradient(135deg, rgba(255, 250, 237, 0.94), rgba(255, 255, 255, 0.94));
}

.archive-detail-copy span {
  color: #e87a38;
  font-size: 13px;
  font-weight: 950;
}

.archive-detail-copy h2 {
  margin: 8px 0 12px;
  color: #172a24;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
  font-weight: 950;
}

.archive-detail-copy p {
  margin: 0;
  color: #5d6e68;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 750;
}

.archive-stage-display {
  min-height: 230px;
  position: relative;
  display: grid;
  place-items: center;
}

.archive-stage-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.88), color-mix(in srgb, var(--pet-color) 22%, transparent) 54%, transparent 72%);
  box-shadow: inset 0 -18px 30px rgba(255, 255, 255, 0.35);
}

.archive-main-pet {
  position: relative;
  z-index: 1;
  width: min(260px, 22vw);
  height: min(260px, 22vw);
  object-fit: contain;
  transform: scale(var(--growth-scale));
  filter: drop-shadow(0 24px 28px rgba(31, 47, 63, 0.18));
}

.archive-main-pet:not(.archive-pet-emoji) {
  width: min(330px, 28vw);
  height: min(330px, 28vw);
  border-radius: 26px;
}

.archive-main-pet.archive-pet-emoji {
  display: grid;
  place-items: center;
  font-size: clamp(110px, 13vw, 190px);
  line-height: 1;
}

.archive-stage-badge {
  position: absolute;
  right: 16px;
  bottom: 14px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff7df;
  border: 1px solid #ffe2a8;
  color: #b46300;
  display: grid;
  place-items: center;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(199, 128, 28, 0.12);
}

.archive-stage-panel {
  padding: 18px;
}

.archive-stage-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.archive-stage-title strong {
  color: #172a24;
  font-size: 18px;
  font-weight: 950;
}

.archive-stage-title span {
  color: #70817b;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

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

.archive-stage-grid button {
  min-width: 0;
  min-height: 114px;
  padding: 9px 7px;
  border-radius: 18px;
  border: 1px solid rgba(226, 216, 199, 0.82);
  background: #fffdfa;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #52635d;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.archive-stage-grid button:hover,
.archive-stage-grid button.is-active {
  transform: translateY(-2px);
  border-color: rgba(232, 122, 56, 0.55);
  background: #fff5e9;
}

.archive-stage-pet {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transform: scale(var(--growth-scale));
}

.archive-stage-pet:not(.archive-pet-emoji) {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.archive-stage-pet.archive-pet-emoji {
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
}

.archive-stage-grid strong {
  color: #263a34;
  font-size: 13px;
  font-weight: 950;
}

.archive-stage-grid span {
  max-width: 100%;
  color: #7d8a86;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes archiveModalPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes petArchiveFloat {
  0%,
  100% {
    transform: translateY(0) scale(var(--growth-scale));
  }
  50% {
    transform: translateY(-14px) scale(var(--growth-scale));
  }
}

@keyframes petArchivePulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.96;
    transform: scale(1.06);
  }
}

@keyframes petArchiveShine {
  0% {
    transform: translateX(-140%) rotate(18deg);
    opacity: 0;
  }
  34% {
    opacity: 0.55;
  }
  68%,
  100% {
    transform: translateX(140%) rotate(18deg);
    opacity: 0;
  }
}

.pet-archive-modal {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(22, 26, 31, 0.46);
  backdrop-filter: blur(10px);
  animation: modalFadeIn 0.18s ease both;
}

.pet-archive-modal-content {
  position: relative;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(310px, 0.88fr) minmax(0, 1.25fr);
  border-radius: 32px;
  border: 1px solid rgba(226, 216, 199, 0.92);
  background: #fcf8ef;
  box-shadow: 0 34px 90px rgba(17, 24, 39, 0.28);
  animation: archiveModalPop 0.22s ease both;
}

.pet-archive-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e87a38;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
  box-shadow: 0 12px 24px rgba(232, 122, 56, 0.26);
}

.pet-archive-modal-info {
  min-height: 0;
  overflow-y: auto;
  padding: 34px 30px 30px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 6px 0 24px rgba(39, 55, 70, 0.035);
}

.pet-archive-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pet-archive-modal-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff2e4;
  color: #d56c24;
  font-size: 12px;
  font-weight: 950;
}

.pet-archive-modal-info h2 {
  margin: 0 0 14px;
  color: #172a24;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.96;
  font-style: italic;
  font-weight: 950;
}

.pet-archive-modal-info p {
  margin: 0 0 22px;
  color: #65746e;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 750;
}

.pet-archive-modal-subtitle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: #172a24;
}

.pet-archive-modal-subtitle i,
.archive-modal-current i {
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: #e87a38;
}

.pet-archive-modal-subtitle strong {
  font-size: 14px;
  font-weight: 950;
}

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

.pet-archive-modal-stage-grid button {
  min-width: 0;
  min-height: 92px;
  padding: 8px 6px;
  border-radius: 18px;
  border: 1px solid rgba(226, 216, 199, 0.9);
  background: #fffdfa;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #687872;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.pet-archive-modal-stage-grid button:hover,
.pet-archive-modal-stage-grid button.is-active {
  transform: translateY(-2px);
  border-color: rgba(232, 122, 56, 0.5);
  background: #e87a38;
  color: #fff;
  box-shadow: 0 12px 24px rgba(232, 122, 56, 0.18);
}

.archive-modal-stage-pet {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.archive-modal-stage-pet:not(.archive-pet-emoji) {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}

.archive-modal-stage-pet.archive-pet-emoji {
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
}

.pet-archive-modal-stage-grid span {
  font-size: 11px;
  font-weight: 900;
}

.pet-archive-modal-display {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 46px 42px 86px;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 239, 214, 0.96), transparent 58%),
    linear-gradient(135deg, #fff9ed, #f9fbf6);
}

.archive-modal-aura {
  position: absolute;
  width: min(420px, 58vw);
  height: min(420px, 58vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, color-mix(in srgb, var(--pet-color) 18%, transparent) 52%, transparent 72%);
  box-shadow: inset 0 -20px 42px rgba(255, 255, 255, 0.38), 0 18px 48px color-mix(in srgb, var(--pet-color) 18%, transparent);
  animation: petArchivePulse 3.2s ease-in-out infinite;
}

.archive-modal-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  width: 42%;
  left: 29%;
  animation: petArchiveShine 3.8s ease-in-out infinite;
}

.archive-modal-main-pet {
  position: relative;
  z-index: 2;
  width: min(430px, 42vw);
  height: min(430px, 42vw);
  object-fit: contain;
  transform: scale(var(--growth-scale));
  animation: petArchiveFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 30px 34px rgba(31, 47, 63, 0.18));
}

.archive-modal-main-pet:not(.archive-pet-emoji) {
  border-radius: 28px;
}

.archive-modal-main-pet.archive-pet-emoji {
  display: grid;
  place-items: center;
  font-size: clamp(128px, 19vw, 230px);
  line-height: 1;
}

.archive-modal-current {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 3;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 54px);
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 216, 199, 0.82);
  box-shadow: 0 12px 26px rgba(69, 76, 89, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #62736d;
  font-size: 13px;
  font-weight: 850;
}

.archive-modal-current strong {
  color: #e87a38;
}

.pet-archive-empty {
  min-height: 180px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px dashed #e3d6c2;
  color: #71817b;
  display: grid;
  place-items: center;
  font-weight: 900;
}

@media (max-width: 980px) {
  .pet-archive-page {
    padding: 16px;
  }

  .pet-archive-header {
    grid-template-columns: 1fr auto;
  }

  .pet-archive-header > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .pet-archive-detail {
    position: static;
  }

  .archive-detail-card {
    grid-template-columns: 1fr;
  }

  .archive-main-pet {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 620px) {
  .pet-archive-header {
    grid-template-columns: 1fr;
  }

  .pet-archive-count {
    display: none;
  }

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

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

@media (max-width: 920px) {
  .class-manager-dialog,
  .class-switch-dialog,
  .group-manager-dialog {
    width: min(96vw, 1120px);
    padding: 18px;
  }

  .group-member-dialog {
    width: min(96vw, 920px);
  }

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

  .class-manager-classline,
  .class-switch-create,
  .qwen-import-box,
  .photo-import-box,
  .class-manager-section-head,
  .class-manager-footer {
    flex-wrap: wrap;
  }

  .class-switch-create,
  .class-switch-card,
  .class-group-row,
  .qwen-import-box {
    grid-template-columns: 1fr;
  }

  .group-manager-dialog .class-group-list {
    grid-template-columns: 1fr;
  }

  .class-roster-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .class-switch-actions,
  .class-group-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .class-manager-classline label:first-child,
  .photo-import-box textarea {
    flex: 1 1 100%;
  }

  .class-manager-table {
    min-width: 680px;
  }

  .class-manager-table th:first-child,
  .class-manager-table td:first-child {
    width: 150px;
  }

  .shop-tools {
    grid-template-columns: 1fr;
  }

  .shop-tool-buttons {
    width: 100%;
  }

  .shop-tool-buttons button {
    flex: 1;
  }

  .shop-product-edit-row {
    grid-template-columns: 1fr;
  }

  .shop-price-edit-row {
    grid-template-columns: 1fr 1fr;
  }

  .shop-price-product {
    grid-column: 1 / -1;
  }

  .shop-product-main-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-product-description {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .class-switch-dialog {
    width: min(96vw, 860px);
    max-height: min(86vh, 760px);
    padding: 14px;
    border-radius: 18px;
  }

  .class-switch-main strong {
    font-size: 19px;
  }

  .class-switch-create button,
  .class-switch-actions button,
  .class-manager-footer .button-row,
  .class-manager-footer .button-row button {
    width: 100%;
  }

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

  .shop-product-main-fields {
    grid-template-columns: 1fr;
  }

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

  .shop-price-edit-row {
    grid-template-columns: 1fr;
  }
}
