/* 유치원 학습 놀이터 6세·7세 터치 친화 스타일 */

:root {
  --bg: #fff8ee;
  --bg-soft: #fff2dc;
  --ink: #2b2a4d;
  --ink-soft: #5a587a;
  --primary: #ff8a3d;
  --primary-soft: #ffe1c8;
  --accent: #ff8a3d;
  --card-bg: #ffffff;
  --shadow: 0 6px 18px rgba(64, 50, 30, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app-root {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 헤더 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  margin-bottom: 16px;
}

.header-main {
  display: grid;
  gap: 6px;
}

.app-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.app-brand strong {
  font-size: 22px;
  font-weight: 900;
}

.app-brand span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 16px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
}

.home-crumb {
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.sticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.sticker-badge.pop {
  animation: pop 0.5s ease;
}

.mini-action {
  background: #fff;
  border: 2px solid #ead7bf;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(64, 50, 30, 0.08);
}

.mini-action.portal-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

.mini-action.little-link {
  border-color: #70d69c;
  background: #ecfff3;
  color: #176a3c;
}

.mini-action.reading-essay-link {
  border-color: #a3d9b8;
  background: #e6f7ef;
  color: #0f8b5a;
}

.mini-action.fivecore-menu-btn {
  border-color: #818cf8;
  background: #eef2ff;
  color: #3730a3;
}
.mini-action.fivecore-menu-btn:hover {
  background: #e0e7ff;
  border-color: #6366f1;
}

.portal-login-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.portal-login-form input {
  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  font-size: inherit;
  font-family: inherit;
  width: 100px;
  background: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(64, 50, 30, 0.08);
}
.portal-login-form button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(64, 50, 30, 0.08);
}
.portal-login-form button:disabled,
.portal-login-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.portal-logged-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.portal-logout-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  color: #64748b;
}
.portal-logout-btn:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

.mini-action.active {
  background: var(--accent, var(--primary));
  border-color: var(--accent, var(--primary));
  color: #fff;
}

.mini-action.danger {
  border-color: #e6a4a4;
  color: #a14040;
}

.mini-action.root-action {
  border-color: #b9b0e8;
}

.mini-action.root-action.active {
  background: #5b4bb7;
  border-color: #5b4bb7;
  color: #fff;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* 공통 화면 */
.screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 8px 4px 32px;
}

.screen-title {
  font-size: 28px;
  margin: 0;
  text-align: center;
}

.screen-sub {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
}

/* 홈 - 연령 선택 */
.age-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.age-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
  min-height: 180px;
}

.age-card:hover { transform: translateY(-3px); }

.age-emoji { font-size: 64px; line-height: 1; }
.age-label { font-size: 24px; font-weight: 700; }
.age-sub { font-size: 15px; color: var(--ink-soft); text-align: center; }

/* 교실 목록 */
.subject-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.subject-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border-left: 8px solid var(--accent);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.15s ease;
}

.subject-card:hover { transform: translateY(-2px); }

.subject-emoji { font-size: 44px; line-height: 1; }
.subject-label { font-size: 22px; font-weight: 700; }
.subject-week { font-size: 15px; color: var(--ink-soft); }

/* 회원가입과 역할 전환 */
.auth-quick-panel,
.profile-switch-panel,
.signup-card,
.teacher-control-panel,
.class-monitor-panel-3d {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-quick-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 8px solid var(--accent, var(--primary));
}

.auth-quick-panel strong {
  display: block;
  font-size: 20px;
}

.auth-quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-select {
  border: 2px solid #ead7bf;
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.auth-message {
  width: 100%;
  margin: 4px 0 0;
  color: #7b4d10;
  font-size: 14px;
  font-weight: 800;
}

.auth-message.center { text-align: center; }

.role-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.home-return-btn {
  align-self: center;
  background: #fff;
  border: 3px solid var(--primary);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.role-tab {
  background: #fff;
  border: 2px solid #ead7bf;
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.role-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.signup-card {
  border-top: 8px solid var(--accent, var(--primary));
}

.signup-card.muted {
  opacity: 0.76;
}

.signup-card h2,
.profile-switch-panel h2,
.profile-switch-panel h3 {
  margin: 0 0 10px;
}

.signup-form {
  display: grid;
  gap: 12px;
}

.signup-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.signup-form input,
.signup-form select,
.teacher-mini-form input,
.teacher-mini-form select {
  width: 100%;
  border: 2px solid #ead7bf;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.profile-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip,
.class-chip {
  background: var(--bg-soft);
  border: 2px solid #ead7bf;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 800;
}

.class-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.empty-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 교실 — 활동 카드 3종 */
.activity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.activity-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  border: 3px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.activity-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.activity-emoji { font-size: 36px; }
.activity-kind { font-size: 18px; font-weight: 700; }
.activity-title { font-size: 15px; color: var(--ink-soft); grid-column: 2; }

.done-badge {
  background: #ffe6c2;
  color: #a45a14;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  grid-row: span 2;
}

/* 활동 공통 버튼 */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.big-btn {
  background: #fff;
  border: 3px solid var(--accent);
  color: var(--ink);
  padding: 16px 22px;
  border-radius: var(--radius);
  font-size: 19px;
  font-weight: 700;
  min-width: 140px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}

.big-btn:hover { transform: translateY(-2px); }

.big-btn.primary {
  background: var(--accent);
  color: #fff;
}

.big-btn.option {
  flex: 1 1 30%;
  min-width: 120px;
}

.big-btn.option.wrong {
  background: #ffd5d5;
  border-color: #ff7373;
  color: #8a1f1f;
}

.nav-btn {
  background: #fff;
  border: 2px solid var(--ink-soft);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
}

.ghost-btn {
  background: transparent;
  border: 2px dashed var(--ink-soft);
  color: var(--ink-soft);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  align-self: center;
  margin-top: 8px;
}

.ghost-btn.danger {
  border-color: #d97878;
  color: #a14040;
}

.hidden { display: none !important; }

/* 카드북 */
.card-slot {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-top: 8px solid var(--accent);
}

.card-emoji {
  font-size: 96px;
  line-height: 1.1;
  text-align: center;
}

.card-word {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
}

.card-progress {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
}

/* 동화 */
.story-stage {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-top: 8px solid var(--accent);
  min-height: 240px;
}

.story-emoji { font-size: 84px; line-height: 1.1; }
.story-text { font-size: 20px; text-align: center; line-height: 1.5; }
.story-progress { color: var(--ink-soft); font-size: 14px; }

.celebrate { font-size: 96px; }
.celebrate.big { font-size: 110px; text-align: center; margin-top: 12px; }
.celebrate-text { font-size: 22px; font-weight: 700; text-align: center; }

/* 메모리 게임 */
.memory-status {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-soft);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: var(--card-bg);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 8px solid var(--accent);
}

.memory-board[data-size="6"] { grid-template-columns: repeat(3, 1fr); }
.memory-board[data-size="8"] { grid-template-columns: repeat(4, 1fr); }
.memory-board[data-size="10"] { grid-template-columns: repeat(5, 1fr); }
.memory-board[data-size="12"] { grid-template-columns: repeat(4, 1fr); }

.memory-tile {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 32px;
  font-weight: 800;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

.memory-tile.face-up {
  background: #fff;
  color: var(--ink);
  border-color: var(--accent);
}

.memory-tile.matched {
  background: #cdf2c4;
  color: #2b5a1c;
  border-color: #7fc26d;
  cursor: default;
}

/* 보상 정원 */
.sticker-field {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  font-size: 24px;
  line-height: 1.6;
  word-break: break-all;
  text-align: center;
  min-height: 80px;
}

.garden-sub {
  margin: 6px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.completed-list {
  margin: 0;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* 365일 학습지도와 진행 모니터링 */
.day-navigator {
  display: grid;
  grid-template-columns: 1fr auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.day-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 128px;
}
.day-label strong {
  font-size: 20px;
  line-height: 1.2;
}
.day-label span {
  color: var(--ink-soft);
  font-size: 14px;
}
.day-range {
  width: 100%;
  accent-color: var(--accent, var(--primary));
}
.day-navigator .week-select {
  grid-column: 1 / -1;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title {
  margin: 0;
  font-size: 20px;
}
.panel-sub {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.monitor-panel,
.learning-map-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-top: 8px solid var(--accent, var(--primary));
}
.monitor-grid,
.garden-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.garden-progress {
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
}
.monitor-card {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 118px;
}
.monitor-card strong {
  display: block;
  font-size: 24px;
  margin: 4px 0;
}
.monitor-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}
.monitor-label {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.progress-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--accent, var(--primary)) var(--progress), #f2eadc 0);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
}
.progress-ring::before {
  content: '';
  position: absolute;
  inset: 9px;
  background: #fff;
  border-radius: 50%;
}
.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
  line-height: 1.1;
}
.progress-ring strong { font-size: 18px; }
.progress-ring span { font-size: 11px; color: var(--ink-soft); }
.today-plan {
  margin-top: 14px;
  background: #fff9ed;
  border: 2px solid #ffe1b5;
  border-radius: var(--radius-sm);
  padding: 14px;
}
.today-plan h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.today-plan p {
  margin: 0 0 10px;
  color: var(--ink);
}
.today-plan dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  font-size: 14px;
}
.today-plan dt {
  color: var(--ink-soft);
  font-weight: 700;
}
.today-plan dd { margin: 0; }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.legend-item {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f4eadb;
  color: var(--ink-soft);
  font-weight: 700;
}
.legend-item.done { background: #d8f4c8; color: #2f6a20; }
.legend-item.started { background: #fff1bd; color: #795700; }
.legend-item.current { background: var(--primary-soft); color: var(--ink); }
.learning-map-grid {
  display: grid;
  grid-template-columns: repeat(21, minmax(18px, 1fr));
  gap: 5px;
  margin-top: 14px;
  max-height: 230px;
  overflow: auto;
  padding: 2px;
}
.day-dot {
  width: 100%;
  aspect-ratio: 1;
  min-width: 18px;
  border-radius: 7px;
  background: #f3eadb;
  border: 2px solid transparent;
  color: #806d54;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.day-dot.started { background: #fff1bd; border-color: #e5b440; }
.day-dot.done { background: #cdf2c4; border-color: #7fc26d; color: #2b5a1c; }
.day-dot.current {
  outline: 3px solid var(--accent, var(--primary));
  outline-offset: 1px;
  transform: scale(1.06);
}
.activity-card.today-activity {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff 0%, #fff8eb 100%);
}
.activity-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  grid-row: span 2;
}
.today-badge {
  background: var(--primary-soft);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

/* 교사용 3D 모니터링 */
.teacher-dashboard {
  gap: 18px;
}

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

.teacher-summary-card {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 229, 0.92)),
    radial-gradient(circle at 90% 0%, rgba(76, 181, 255, 0.16), transparent 44%);
  border: 2px solid rgba(125, 92, 55, 0.18);
  box-shadow: var(--shadow);
}

.teacher-summary-card span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.teacher-summary-card strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
}

.three-scene.teacher-monitor {
  height: clamp(200px, 38vw, 420px);
  background:
    linear-gradient(180deg, #eef8ff 0%, #fff4dc 100%),
    radial-gradient(circle at 50% 18%, rgba(123, 211, 137, 0.2), transparent 38%);
}

.teacher-control-panel {
  display: grid;
  gap: 14px;
  border-top: 8px solid #5b4bb7;
}

.class-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-form-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.teacher-mini-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.teacher-mini-form:nth-child(2) {
  grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) auto auto;
}

.class-monitor-panel-3d {
  border-top: 8px solid #5b4bb7;
}

.student-monitor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.student-monitor-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(125, 92, 55, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 250, 246, 0.9)),
    radial-gradient(circle at 94% 6%, rgba(255, 138, 61, 0.16), transparent 44%);
}

.student-monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.student-monitor-head strong {
  display: block;
  font-size: clamp(14px, 2.5vw, 21px);
}

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

.student-monitor-stats div {
  background: rgba(255, 248, 238, 0.78);
  border-radius: 10px;
  padding: clamp(6px, 1.5vw, 9px);
}

.student-monitor-stats span {
  display: block;
  color: var(--ink-soft);
  font-size: clamp(10px, 1.5vw, 12px);
  font-weight: 900;
}

.student-monitor-stats strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(12px, 2vw, 15px);
}

.monitor-progress-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2eadc;
  border: 2px solid #ead7bf;
}

.monitor-progress-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a3d, #4cb5ff, #7bd389);
}

/* ROOT 관리자 */
.root-admin-dashboard {
  gap: 18px;
}

.root-monitor {
  border-top-color: #5b4bb7;
  background:
    linear-gradient(180deg, #f3f0ff 0%, #eef8ff 55%, #fff4dc 100%),
    radial-gradient(circle at 14% 16%, rgba(91, 75, 183, 0.18), transparent 34%);
}

.root-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-top: 8px solid #5b4bb7;
}

.admin-login-screen {
  max-width: 1120px;
  margin: 0 auto;
}

.admin-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin: 24px 0;
}

.admin-login-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(28, 79, 116, .14);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.admin-login-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.admin-login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.admin-google-config-form {
  display: grid;
  gap: 12px;
}

.admin-google-config-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.admin-google-config-form input {
  width: 100%;
  border: 1px solid rgba(28, 79, 116, .18);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #f8fcff;
}

.google-signin-card {
  min-height: 320px;
}

.google-login-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.admin-profile-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(19, 163, 136, .1);
}

.admin-profile-strip img,
.admin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.admin-avatar {
  display: inline-grid;
  place-items: center;
  background: var(--accent-blue);
  color: #fff;
  font-weight: 900;
}

.auth-message.error {
  color: #9b1c1c;
  background: rgba(255, 233, 233, .9);
  border-color: rgba(155, 28, 28, .18);
}

.root-summary-grid .teacher-summary-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(242, 246, 255, 0.94)),
    radial-gradient(circle at 90% 0%, rgba(91, 75, 183, 0.14), transparent 44%);
}

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

.root-management-grid h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.credential-list {
  display: grid;
  gap: 10px;
}

.credential-card,
.content-admin-card,
.root-class-row {
  border: 2px solid rgba(91, 75, 183, 0.14);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.94));
}

.credential-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

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

.credential-head strong {
  display: block;
  font-size: 18px;
}

.credential-meta {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.credential-form,
.content-admin-form {
  display: grid;
  gap: 8px;
}

.credential-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.credential-form label {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.credential-form input,
.content-admin-form input,
.content-admin-form select {
  width: 100%;
  border: 2px solid #ead7bf;
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.root-class-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.root-class-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.root-class-row span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.content-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.content-admin-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 6px solid var(--accent);
}

.content-admin-card strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.3;
}

.content-admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.content-admin-metrics span {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 7px 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

/* 주차 선택기 */
.week-selector {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
}
.week-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 17px;
  padding: 0 6px;
}
.week-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent, var(--primary));
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
.week-nav {
  background: #fff;
  border: 2px solid var(--ink-soft);
  color: var(--ink);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}
.week-nav:disabled { opacity: 0.4; }

/* 5활동 그리드 */
.activity-grid.five {
  grid-template-columns: 1fr 1fr;
}
.activity-grid.five .activity-card:last-child {
  grid-column: 1 / -1;
}

/* 듣고 고르기 */
.listen-stage {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-top: 8px solid var(--accent);
}
.listen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.listen-tile {
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 110px;
  transition: transform 0.12s ease;
}
.listen-tile:hover { transform: translateY(-2px); }
.listen-tile.right { background: #cdf2c4; border-color: #7fc26d; }
.listen-tile.wrong { background: #ffd5d5; border-color: #ff7373; opacity: 0.6; }
.listen-emoji { font-size: 48px; line-height: 1; }
.listen-word { font-size: 15px; color: var(--ink); font-weight: 600; text-align: center; }

/* 따라 말하기 */
.speak-stage {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-top: 8px solid var(--accent);
  min-height: 220px;
}
.speak-emoji { font-size: 84px; line-height: 1; }
.speak-prompt { font-size: 32px; font-weight: 700; text-align: center; }

/* 3D 장면 컨테이너 */
.three-scene {
  background: linear-gradient(180deg, #fff7e8 0%, #ffefd0 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 8px solid var(--accent, var(--primary));
  width: 100%;
  overflow: hidden;
  touch-action: none;
}
.three-scene.welcome { height: 420px; }
.three-scene.classroom { height: 260px; }
.three-scene.quiz { height: 240px; margin-top: 6px; }
.three-scene canvas { display: block; width: 100% !important; height: 100% !important; }

.three-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}

.three-reward-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: rgba(255, 248, 238, 0.25);
}
.three-reward-overlay canvas { display: block; width: 100% !important; height: 100% !important; }

/* 작은 화면 */
@media (max-width: 480px) {
  body { font-size: 17px; }
  #app-root { padding: 12px; }
  .app-header { align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .screen-title { font-size: 24px; }
  .age-grid { grid-template-columns: 1fr; }
  .age-card { min-height: 140px; }
  .auth-quick-panel { align-items: flex-start; flex-direction: column; }
  .signup-layout,
  .admin-login-grid,
  .profile-switch-grid,
  .teacher-form-grid,
  .root-management-grid,
  .content-admin-grid,
  .root-class-row,
  .student-monitor-list { grid-template-columns: 1fr; }
  .teacher-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-mini-form,
  .teacher-mini-form:nth-child(2) { grid-template-columns: 1fr; }
  .credential-form { grid-template-columns: 1fr; }
  .student-monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-emoji { font-size: 78px; }
  .card-word { font-size: 26px; }
  .story-emoji { font-size: 68px; }
  .story-text { font-size: 18px; }
  .big-btn { min-width: 100px; padding: 14px 16px; font-size: 17px; }
  .memory-board { grid-template-columns: repeat(3, 1fr) !important; }
  .day-navigator { grid-template-columns: auto 1fr auto; }
  .day-label { grid-column: 1 / -1; }
  .monitor-grid,
  .garden-progress { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; }
  .learning-map-grid { grid-template-columns: repeat(14, minmax(18px, 1fr)); max-height: 260px; }
  .activity-badges { align-items: flex-start; grid-column: 2 / -1; grid-row: auto; flex-direction: row; }
  .three-scene.welcome { height: 320px; }
  .three-scene.classroom { height: 210px; }
  .three-scene.quiz { height: 200px; }
  .three-scene.teacher-monitor { height: clamp(180px, 45vw, 300px); }
  .student-monitor-list { grid-template-columns: 1fr; }
  .student-monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ───────────────── 꿈쟁이 AI 아카데미 통합 학습 전용 레이아웃 ───────────────── */

.role-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.role-btn {
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid var(--primary-soft);
  background: #fff;
  color: var(--ink);
}
.role-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.grow-badge { background: #edf8ff; color: #17627d; }

.welcome-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.welcome-card h2 { margin: 0 0 10px; font-size: 44px; line-height: 1.12; }
.welcome-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 22px; line-height: 1.45; }

.three-stage {
  width: 100%;
  max-width: 100%;
  height: 420px;
  background: #fff8ee;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--primary-soft);
  margin: 12px 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.three-stage canvas { max-width: 100% !important; display: block; }
.three-stage.three-quiz { height: 220px; }

@media (max-width: 480px) {
  .welcome-card h2 { font-size: 32px; }
  .welcome-card p { font-size: 18px; }
  .three-stage { height: 320px; }
}

.module-detail, .welcome-card, .course-list, .role-panel, .cardbook, .quiz-area, .course-card { min-width: 0; max-width: 100%; box-sizing: border-box; }
.module-detail > * { min-width: 0; }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.school-menu-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.school-tab {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid #d9e4f2;
  border-radius: 12px;
  background: #f8fbff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(30, 55, 90, 0.08);
}
.school-tab strong {
  font-size: 18px;
  line-height: 1.2;
}
.school-tab small {
  color: var(--ink-soft);
  line-height: 1.35;
}
.school-tab.is-active {
  border-color: #2f6df6;
  background: #2f6df6;
  color: #fff;
}
.school-tab.is-active small { color: rgba(255, 255, 255, 0.86); }
.school-menu-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #f7f9ff;
  border: 1px solid #dce4ff;
}
.school-menu-panel header {
  display: grid;
  gap: 3px;
}
.school-menu-panel h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.school-menu-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.subject-card {
  --accent: #ff8a3d;
  background: #fff;
  border-radius: var(--radius);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 4px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.subject-card.is-active { background: var(--accent); color: #fff; }
.subject-emoji { font-size: 32px; }
.subject-card strong { font-size: 18px; }
.subject-card small { color: var(--ink-soft); }
.subject-card.is-active small { color: rgba(255,255,255,0.85); }

@media (max-width: 720px) {
  .school-menu-tabs { grid-template-columns: 1fr; }
  .school-tab { padding: 12px; }
  .school-menu-panel { padding: 12px; }
}

.course-list { display: grid; gap: 14px; }
.subject-switch { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pill {
  --accent: #ff8a3d;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.pill.is-active { background: var(--accent); color: #fff; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.course-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.course-card header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.course-card h3 { margin: 0; }
.module-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.module-link {
  --accent: #ff8a3d;
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--bg-soft);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 600;
}
.module-link:hover { border-color: var(--accent); background: #fff; }
.module-link em { font-style: normal; color: var(--accent); font-weight: 800; }

.module-detail { display: grid; gap: 14px; }
.btn { font-weight: 700; border-radius: var(--radius-sm); padding: 10px 14px; border: 2px solid var(--primary-soft); background: #fff; color: var(--ink); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.back { width: max-content; }

.cardbook {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.cardbook h3 { margin: 0 0 4px; }
.cardbook p { margin: 0 0 8px; color: var(--ink-soft); }
.progress-bar { background: var(--primary-soft); height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-bar span { display: block; height: 100%; background: var(--primary); transition: width 0.3s ease; }

.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.topic {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  border: 2px solid transparent;
}
.topic.is-active { border-color: var(--primary); background: #fff; }
.topic.is-done { background: #f1ffe8; }
.topic strong { color: var(--ink); }
.topic span { color: var(--ink-soft); font-size: 15px; }
.topic em { font-style: normal; color: #4cb5ff; font-weight: 700; }

.quiz-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.quiz-prompt { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.quiz-expression { color: var(--ink-soft); font-family: 'Menlo','Consolas',monospace; margin: 0 0 8px; }
.quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.quiz-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.quiz-solution { margin-top: 12px; color: var(--ink-soft); }

.role-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.role-panel h2 { margin-top: 0; }
.signup-form { display: grid; gap: 10px; max-width: 420px; }
.signup-form label { display: grid; gap: 4px; font-weight: 600; }
.signup-form input, .signup-form select {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 2px solid var(--primary-soft); font-size: 16px;
}
.teacher-student-list { padding-left: 18px; }
.inventory { padding-left: 18px; }

/* ══════════════════════════════════════
   교사용 관리 센터 (TC = Teacher Center)
══════════════════════════════════════ */
.tc-panel { padding: 20px; }
.tc-header { margin-bottom: 14px; }
.tc-header h2 { margin: 0 0 4px; }
.tc-header p { color: var(--ink-soft); margin: 0; font-size: 14px; }
.tc-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.math-site-btn { background: #1e40af; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.math-site-btn:hover { background: #1d4ed8; }

/* 탭 네비 */
.tc-tab-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid var(--primary-soft);
  margin: 16px 0 0; padding-bottom: 0;
}
.tc-tab {
  padding: 8px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 2px solid transparent; border-bottom: none;
  background: var(--surface2); color: var(--ink-soft);
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.tc-tab:hover { background: var(--primary-soft); color: var(--primary); }
.tc-tab.active {
  background: var(--card-bg); border-color: var(--primary-soft);
  color: var(--primary); position: relative; top: 2px;
}
.tc-tab-panel {
  background: var(--card-bg); border: 2px solid var(--primary-soft);
  border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 18px; min-height: 200px;
}
.tc-sub-title {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin: 0 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--primary-soft);
}
.tc-hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 12px; }

/* 클래스 칩 필터 */
.tc-class-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.tc-chip {
  padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  border: 2px solid var(--primary-soft); background: var(--surface2);
  color: var(--ink-soft); cursor: pointer;
}
.tc-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tc-chip:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* 모니터링 카드 */
.tc-monitor-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.tc-monitor-card {
  background: var(--surface2); border-radius: var(--radius-sm); padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.tc-mc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tc-mc-head strong { font-size: 14px; }
.tc-mc-head span { font-size: 11px; color: var(--ink-soft); }
.tc-mc-stats { display: flex; gap: 8px; font-size: 12px; color: var(--ink-soft); }

/* 학생 관리 목록 */
.tc-student-list { display: flex; flex-direction: column; gap: 10px; }
.tc-student-card {
  background: var(--surface2); border-radius: var(--radius-sm);
  border: 1px solid var(--primary-soft); overflow: hidden;
}
.tc-student-card.blocked { opacity: 0.6; border-color: #ef4444; }
.tc-student-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px 6px; gap: 10px;
}
.tc-student-identity { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tc-student-identity strong { font-size: 15px; }
.tc-student-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.tc-student-stats {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font-size: 12px; font-weight: 700; color: var(--primary);
}
.tc-tag {
  font-size: 11px; background: var(--primary-soft); color: var(--primary);
  padding: 2px 7px; border-radius: 99px; font-weight: 600;
}
.tc-tag.class { background: #dbeafe; color: #1d4ed8; }
.tc-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 99px; font-weight: 700;
}
.tc-badge.approved { background: #d1fae5; color: #065f46; }
.tc-badge.pending { background: #fef3c7; color: #92400e; }
.tc-badge.suspended { background: #ffedd5; color: #9a3412; }
.tc-badge.blocked { background: #fee2e2; color: #991b1b; }
.tc-student-actions {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px;
}

/* 인라인 편집 폼 */
.tc-edit-form { padding: 12px 14px 14px; border-top: 1px solid var(--primary-soft); }
.tc-edit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px;
  margin-bottom: 10px;
}
.tc-edit-grid label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; }
.tc-edit-grid input, .tc-edit-grid select {
  padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-soft); font-size: 13px;
}

/* 학생 등록 폼 */
.tc-add-form { display: flex; flex-direction: column; gap: 12px; }
.tc-add-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px;
}
.tc-add-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.tc-add-grid input, .tc-add-grid select {
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 2px solid var(--primary-soft); font-size: 14px;
}
.tc-add-hint { background: #f0fdf4; border-radius: var(--radius-sm); padding: 8px 12px; }
.tc-add-hint small { color: #166534; }
.btn.large { padding: 12px 28px; font-size: 16px; }

/* 클래스 관리 */
.tc-class-add-panel {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 18px;
}
.tc-class-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.tc-class-card {
  background: var(--card-bg); border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-soft); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.tc-cc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tc-cc-head strong { font-size: 15px; }
.tc-cc-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--ink-soft); }
.tc-cc-note { color: var(--ink-soft); font-size: 12px; margin: 0; }
.tc-cc-students { display: flex; flex-wrap: wrap; gap: 4px; }
.tc-student-chip {
  font-size: 11px; background: var(--surface2); border-radius: 99px;
  padding: 2px 8px; color: var(--ink-soft);
}
.tc-cc-footer { display: flex; justify-content: flex-end; }

/* ── 수강관리 탭 ── */
.tc-enrollment-list { display: flex; flex-direction: column; gap: 12px; }
.tc-enrollment-card { background: var(--card-bg); border-radius: var(--radius-sm); border: 1.5px solid var(--primary-soft); overflow: hidden; }
.tc-ec-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.tc-ec-head strong { flex: 1; font-size: 14px; }
.tc-ec-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.tc-ec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-ec-row label { font-size: 12px; color: var(--ink-soft); font-weight: 700; min-width: 72px; }
.tc-ec-row input[type="number"] { width: 64px; padding: 5px 8px; border-radius: 6px; border: 1.5px solid #cbd5e1; font-family: inherit; }
.tc-ec-row input[type="text"], .tc-ec-row input:not([type]) { flex: 1; min-width: 160px; padding: 5px 8px; border-radius: 6px; border: 1.5px solid #cbd5e1; font-family: inherit; }
.tc-ec-row .info { font-size: 13px; color: var(--ink); }
.tc-ec-subject-section { border-top: 1px solid #e2e8f0; padding-top: 8px; margin-top: 4px; }
.tc-ec-subject-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; gap: 8px; }
.tc-ec-subject-row span { flex: 1; }

/* ── 수강 등록 패널 ── */
.enrollment-panel { max-width: 700px; margin: 2rem auto; padding: 2rem; background: var(--card-bg); border-radius: var(--radius); border: 2px solid var(--primary-soft); }
.enrollment-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.enrollment-desc { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 1.5rem; }
.enrollment-subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.enrollment-subject-btn { padding: 14px 10px; border-radius: 12px; border: 2.5px solid var(--primary-soft); background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .2s, background .2s; font-family: inherit; }
.enrollment-subject-btn:hover { border-color: var(--accent, var(--primary)); background: #f0f9ff; }
.enrollment-subject-btn.selected { border-color: var(--accent, var(--primary)); background: color-mix(in srgb, var(--accent, var(--primary)) 12%, white); }
.enrollment-subject-btn .subject-emoji { font-size: 1.8rem; }
.enrollment-subject-btn strong { font-size: 12px; text-align: center; word-break: keep-all; }
.enrollment-confirm { width: 100%; padding: 14px; font-size: 1rem; margin-top: 0.5rem; }
.enrollment-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 600px) {
  .tc-tab { padding: 6px 10px; font-size: 12px; }
  .tc-add-grid { grid-template-columns: 1fr; }
  .tc-edit-grid { grid-template-columns: 1fr; }
  .tc-monitor-list { grid-template-columns: 1fr 1fr; }
}

/* ── 회원가입 쿠폰 배너 ── */
.signup-coupon-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b; border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 12px;
}
.coupon-badge {
  background: #f59e0b; color: #fff; font-weight: 800;
  font-size: 12px; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}
.signup-coupon-banner strong { color: #92400e; font-size: 15px; }
.signup-coupon-banner small { color: #78350f; font-size: 12px; }

/* ── 회원가입 등록 클래스 박스 ── */
.signup-class-box {
  border: 2px solid var(--primary-soft); border-radius: var(--radius-sm);
  padding: 12px; display: grid; gap: 10px;
}
.signup-class-box legend {
  font-weight: 700; font-size: 14px; padding: 0 6px; color: var(--primary);
}

/* ── 교사용 섹션 타이틀 ── */
.teacher-section-title {
  margin: 20px 0 10px; font-size: 16px; font-weight: 700;
  color: var(--primary); border-bottom: 2px solid var(--primary-soft);
  padding-bottom: 4px;
}

/* ── 교사용 학생 등록 폼 ── */
.teacher-add-student-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; background: var(--surface2); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
}
.teacher-add-student-form label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.teacher-add-student-form input, .teacher-add-student-form select {
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--primary-soft); font-size: 14px;
}
.teacher-add-student-form button { align-self: end; }

/* ── 교사용 학생 카드 ── */
.teacher-student-mgmt {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.teacher-student-card {
  background: var(--card-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--primary-soft); padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.teacher-student-card header { display: flex; flex-direction: column; gap: 2px; }
.teacher-student-card header strong { font-size: 15px; }
.teacher-student-card header small { color: var(--ink-soft); font-size: 12px; }
.teacher-student-card footer { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.coupon-tag {
  font-size: 11px; background: #fef3c7; color: #92400e;
  border-radius: 99px; padding: 2px 8px; font-weight: 700;
}

/* ── 교사용 클래스 관리 폼 ── */
.teacher-class-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; background: var(--surface2); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
}
.teacher-class-form label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.teacher-class-form input, .teacher-class-form select {
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--primary-soft); font-size: 14px;
}
.teacher-class-form button { align-self: end; }
.teacher-class-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.teacher-class-card {
  background: var(--card-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--primary-soft); padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.teacher-class-card header { display: flex; flex-direction: column; gap: 2px; }
.teacher-class-card header strong { font-size: 15px; }
.teacher-class-card header small { color: var(--ink-soft); font-size: 12px; }
.teacher-class-card footer { display: flex; gap: 6px; margin-top: 4px; }
.class-note { color: var(--ink-soft); font-size: 12px; margin: 0; }
.btn.danger { background: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* ── 진단 리포트 ── */
.diagnostic-report {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.report-header { border-bottom: 2px solid var(--primary-soft); padding-bottom: 12px; }
.report-header h2 { margin: 0 0 4px; }
.report-date { color: var(--ink-soft); font-size: 13px; margin: 0; }
.report-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px;
}
.report-card {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.report-card span { font-size: 12px; color: var(--ink-soft); }
.report-card strong { font-size: 22px; font-weight: 800; color: var(--primary); }
.report-section { background: var(--surface2); border-radius: var(--radius-sm); padding: 14px; }
.report-section h3 { margin: 0 0 8px; font-size: 15px; }
.report-diagnosis-list, .report-parent-list {
  padding-left: 18px; display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0;
}
.report-footer { border-top: 1px solid var(--primary-soft); padding-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-footer p { flex: 1; color: var(--ink-soft); font-size: 12px; margin: 0; }

/* ── 리포트 버튼 단축바 ── */
.report-shortcut-bar {
  margin-top: 14px; display: flex; justify-content: flex-end;
}
.btn.report-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font-weight: 700; padding: 10px 18px; border-radius: var(--radius-sm);
}
.btn.report-btn:hover { opacity: 0.9; }
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.admin-summary-grid article {
  background: #fff8eb;
  border: 1px solid rgba(125, 92, 55, .14);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.admin-summary-grid span { color: var(--ink-soft); font-size: 13px; }
.admin-summary-grid strong { font-size: 24px; color: var(--primary); }
.admin-section { margin-top: 18px; display: grid; gap: 12px; }
.admin-section header h3 { margin: 0 0 4px; }
.admin-section header p { margin: 0; color: var(--ink-soft); }
.admin-managed-grid,
.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-managed-card,
.admin-content-card {
  background: #fff;
  border: 1px solid rgba(125, 92, 55, .14);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.admin-managed-card > header,
.admin-content-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.admin-managed-card strong,
.admin-content-card strong { display: block; font-size: 17px; }
.admin-managed-card small,
.admin-content-card span { color: var(--ink-soft); font-size: 12px; }
.admin-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f5f7;
  color: #56616a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.admin-status.approved { background: #e0f6dc; color: #27631f; }
.admin-status.pending { background: #fff0c8; color: #805800; }
.admin-status.suspended,
.admin-status.blocked { background: #ffe0dd; color: #8b271f; }
.admin-progress-map { display: grid; gap: 5px; }
.admin-permission-line { margin: 0; color: var(--ink-soft); font-size: 13px; }
.admin-account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-account-form label,
.content-admin-form label {
  display: grid;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
}
.admin-account-form input,
.admin-account-form select,
.content-admin-form input,
.content-admin-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #e4d6bf;
  border-radius: 8px;
  font: inherit;
}
.admin-account-form .wide { grid-column: 1 / -1; }
.permission-box {
  border: 1px dashed rgba(125, 92, 55, .28);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.permission-box legend { font-weight: 800; color: var(--ink); }
.permission-box label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.permission-box input { width: auto; }
.admin-content-card { border-top: 5px solid var(--accent); }
.admin-content-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.content-admin-form {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) 1fr auto;
  gap: 8px;
  align-items: end;
}
@media (max-width: 680px) {
  .admin-summary-grid,
  .admin-managed-grid,
  .admin-content-grid,
  .admin-account-form,
  .content-admin-form { grid-template-columns: 1fr; }
}

.middle-english-analyzer {
  display: grid;
  gap: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.middle-math-lab {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0) 42%),
    #ffffff;
}

.middle-math-lab .middle-analyzer-meta {
  background: #eff6ff;
  color: #1d4ed8;
}

.middle-core-lab {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(255, 255, 255, 0) 44%),
    #ffffff;
}

.middle-core-lab .middle-analyzer-meta {
  background: #fff7ed;
  color: var(--accent);
}

.elementary-core-lab {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent), rgba(255, 255, 255, 0) 44%),
    #ffffff;
}

.elementary-core-lab .middle-analyzer-meta {
  background: #f8fafc;
  color: var(--accent);
}

.high-core-lab {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), rgba(255, 255, 255, 0) 44%),
    #ffffff;
}

.high-core-lab .middle-analyzer-meta {
  background: #f1f5f9;
  color: var(--accent);
}

.middle-analyzer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.middle-analyzer-head h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  line-height: 1.25;
}

.middle-analyzer-head p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.middle-analyzer-meta {
  display: grid;
  gap: 4px;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4fbf8;
  color: #164b3a;
  text-align: right;
}

.middle-analyzer-meta strong { font-size: 20px; }
.middle-analyzer-meta span { font-weight: 800; }
.middle-analyzer-meta small { color: #527267; }

.middle-text-form {
  display: grid;
  gap: 10px;
}

.middle-text-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.middle-text-form textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #cfded8;
  border-radius: 10px;
  padding: 12px;
  font: 15px/1.55 "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: #fbfffd;
  box-sizing: border-box;
}

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

.source-policy {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8df;
  color: #725700;
  line-height: 1.45;
  font-size: 13px;
}

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

.middle-analysis-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9ff;
  border: 1px solid #dce4ff;
}

.middle-analysis-grid span,
.middle-analysis-grid small {
  color: var(--ink-soft);
  font-size: 12px;
}

.middle-analysis-grid strong {
  color: var(--accent);
  font-size: 24px;
  line-height: 1.1;
}

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

.middle-resource-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.middle-resource-card h3 {
  margin: 0;
  font-size: 17px;
  color: #1f3d36;
}

.middle-resource-card p,
.middle-resource-card li,
.middle-resource-card small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.middle-resource-card ul,
.middle-resource-card ol {
  margin: 0;
  padding-left: 18px;
}

.middle-word-cloud,
.middle-grammar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.middle-word-cloud span,
.middle-grammar-list span {
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 9px;
  background: #e8f7f1;
  color: #14523f;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.middle-memory-list {
  display: grid;
  gap: 8px;
}

.middle-memory-list li {
  display: grid;
  gap: 3px;
}

.middle-memory-list strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.english-core-lab {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.elementary-english-lab {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.core-lab-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.core-lab-head h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  line-height: 1.25;
}

.core-lab-head p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.core-lab-meta {
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f7ff;
  color: #29235c;
  text-align: right;
}

.core-lab-meta strong {
  color: var(--accent);
  font-size: 24px;
}

.core-lab-body {
  display: grid;
  gap: 12px;
}

.core-import-form {
  display: grid;
  gap: 10px;
}

.core-import-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.core-import-form textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid #d5d8eb;
  border-radius: 10px;
  padding: 12px;
  font: 15px/1.55 "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: #fbfcff;
  box-sizing: border-box;
}

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

.core-stats-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9ff;
  border: 1px solid #dfe5ff;
}

.core-stats-grid span,
.core-stats-grid small {
  color: var(--ink-soft);
  font-size: 12px;
}

.core-stats-grid strong {
  color: var(--accent);
  font-size: 23px;
  line-height: 1.12;
}

.core-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.core-word-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.core-word-grid strong {
  color: var(--accent);
  font-size: 18px;
}

.core-word-grid span {
  font-weight: 800;
}

.core-word-grid small {
  color: var(--ink-soft);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ev-fullscreen-wrap { position: fixed; inset: 0; z-index: 200; background: #F0F2FF; }
.ev-fullscreen-frame { width: 100%; height: 100%; border: none; display: block; }

.elem-learn-deck {
  padding: 4px 0 8px;
}

.elem-deck-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 12px 0;
}

.elem-word-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.elem-word-card {
  background: #fff;
  border: 1px solid #e2eaf2;
  border-radius: 12px;
  padding: 14px 12px 10px;
  display: grid;
  gap: 5px;
  text-align: center;
}

.elem-word-en {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  word-break: break-word;
}

.elem-word-ko {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.elem-word-ex {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
}

.elem-listen-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  align-self: center;
  justify-self: center;
}

.elem-listen-btn:hover {
  opacity: 0.82;
}

.elem-grammar-card {
  background: #fff;
  border: 1px solid #e2eaf2;
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.elem-grammar-pattern {
  font-size: 19px;
  font-weight: 900;
  color: var(--accent);
}

.elem-grammar-stage,
.grammar-stage-chip {
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #e2e8f0);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.elem-grammar-chant,
.grammar-chant-line {
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, #cbd5e1);
  color: #0f172a;
  padding: 10px 12px;
  font-weight: 900;
}

.elem-grammar-core {
  color: var(--ink);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.elem-grammar-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.elem-example-pill {
  background: #f0f6ff;
  border: 1px solid var(--accent);
  color: var(--ink);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.elem-example-pill:hover {
  background: var(--accent);
  color: #fff;
}

.elem-grammar-fix {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 10px 14px;
  background: #fff8f8;
  border-radius: 8px;
  border: 1px solid #ffd0d0;
}

.elem-grammar-process {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.elem-grammar-process span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.elem-grammar-output {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: #eefbf6;
  border: 1px solid #b7ead6;
  border-radius: 12px;
  padding: 10px 12px;
  color: #065f46;
}

.elem-grammar-output strong {
  color: #047857;
}

.elem-fix-wrong {
  color: #c00;
  text-decoration: line-through;
}

.elem-fix-arrow {
  color: var(--ink-soft);
}

.elem-fix-right {
  color: #0a7a0a;
  font-weight: 700;
}

.grammar-focus-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  background: #fff8f4;
  border: 1px solid #f1d5c8;
}

.grammar-focus-card h3 {
  margin: 0;
  font-size: 20px;
}

.grammar-focus-card strong {
  color: var(--accent);
  font-size: 18px;
}

.grammar-focus-card p {
  margin: 0;
  color: var(--ink-soft);
}

.grammar-example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.grammar-routine-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.grammar-routine-grid p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

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

.elementary-set-grid article {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d9eceb;
}

.elementary-set-grid h3 {
  margin: 0;
  color: #125458;
  font-size: 17px;
}

.elementary-set-grid p,
.elementary-set-grid small {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .middle-analyzer-head,
  .middle-resource-grid,
  .core-lab-head,
  .grammar-routine-grid,
  .elementary-set-grid {
    grid-template-columns: 1fr;
  }

  .middle-analyzer-meta,
  .core-lab-meta {
    text-align: left;
    min-width: 0;
  }

  .middle-analysis-grid,
  .core-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .middle-form-actions .btn {
    flex: 1 1 150px;
  }
}

@media (max-width: 430px) {
  .middle-analysis-grid,
  .core-stats-grid {
    grid-template-columns: 1fr;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #2b2a4d;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 999;
}

.three-reward-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 99;
}

/* ───────────────── 워크시트(문제지·답안지) — 스크린 ───────────────── */

.worksheet-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
.worksheet-controls { display: grid; gap: 12px; margin-bottom: 12px; }
.worksheet-controls h3 { margin: 0; }
.count-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.worksheet-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.worksheet-host { display: grid; gap: 16px; }

.worksheet { display: grid; gap: 16px; }
.ws-page {
  background: #fff;
  border: 1px solid #e3dccb;
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  color: #1a1d29;
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
.ws-header h2 { margin: 0 0 4px; font-size: 22px; }
.ws-header p { margin: 0 0 10px; color: #555a6b; }

.ws-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  border-top: 1px dashed #c0b89f;
  border-bottom: 1px dashed #c0b89f;
  padding: 8px 0;
  margin: 10px 0 18px;
}
.ws-info > div { display: grid; gap: 2px; }
.ws-info label { font-size: 13px; color: #555a6b; font-weight: 700; }
.ws-info input {
  border: none;
  border-bottom: 1.5px solid #888;
  padding: 4px 2px;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
}
.ws-info input:focus { outline: none; border-bottom-color: var(--primary); }

.ws-problem-list, .ws-answer-list { list-style: none; padding: 0; margin: 0; counter-reset: none; display: grid; gap: 14px; }
.ws-problem {
  break-inside: avoid;
  padding: 6px 0;
  border-bottom: 1px dotted #d6cfb8;
}
.ws-problem:last-child { border-bottom: none; }
.ws-problem-head { display: flex; gap: 6px; align-items: baseline; }
.ws-problem-head strong { font-size: 17px; min-width: 28px; }
.ws-expression {
  margin: 4px 0 4px 32px;
  font-family: 'Noto Sans KR', 'Pretendard', 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', serif;
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-line;
}
.ws-expression.is-check {
  font-size: 14px;
  font-weight: 700;
  background: #fff9e8;
  border-radius: 6px;
  padding: 6px 8px;
}
.ws-choices {
  margin: 4px 0 4px 32px;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px 16px;
  font-size: 15px;
}
.ws-answer-blank {
  margin: 6px 0 0 32px;
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: #555;
}
.ws-blank { letter-spacing: 2px; color: #999; }
.ws-hint { margin: 4px 0 0 32px; font-size: 13px; color: #888; }

.ws-answer-item { display: grid; gap: 2px; padding: 4px 0; break-inside: avoid; }
.ws-answer-value { font-weight: 700; color: var(--primary); }
.ws-solution { font-size: 14px; color: #555a6b; padding-left: 24px; }

/* ───────────────── @media print — 워크시트만 출력 ───────────────── */

@media print {
  @page { size: A4 portrait; margin: 14mm 14mm; }
  html, body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  body * { visibility: hidden !important; }
  [data-print="worksheet"], [data-print="worksheet"] * { visibility: visible !important; }
  [data-print="worksheet"] {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .ws-page {
    border: none;
    padding: 0 0 24px;
    page-break-after: always;
  }
  .ws-page:last-child { page-break-after: auto; }
  .ws-problem { border-bottom: 1px dotted #888; }
  .ws-info input { border-bottom: 1.5px solid #000; }
  .worksheet-controls, .worksheet-buttons, .three-stage, .app-header { display: none !important; }
}


/* ───────────────── 수학 시각 자료 (app/src/index.css 에서 가져옴, 도형·그래프·도표·입체) ───────────────── */

.math-visual {
  width: min(100%, 360px);
  margin: 0 auto 10px;
  padding: 8px 10px 6px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, rgba(125, 92, 55, 0.2));
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 226, 0.82)),
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%);
}

.math-visual svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 230px;
}

.visual-shape,
.cuboid-front {
  fill: color-mix(in srgb, var(--accent) 32%, #fff7d8);
  stroke: color-mix(in srgb, var(--accent) 78%, #5a4635);
  stroke-width: 4;
  stroke-linejoin: round;
}

.visual-shape.twin {
  fill: color-mix(in srgb, var(--accent) 20%, #e3f3ff);
}

.visual-cut {
  fill: rgba(255, 255, 255, 0.82);
  stroke: rgba(125, 92, 55, 0.42);
  stroke-width: 3;
  stroke-dasharray: 6 5;
}

.visual-guide {
  stroke: #6f6256;
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.visual-label {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 253, 243, 0.9);
  stroke-width: 5px;
}

.ten-frame-cell {
  fill: rgba(255, 253, 243, 0.9);
  stroke: rgba(80, 58, 38, 0.34);
  stroke-width: 2.2;
}

.ten-frame-counter {
  fill: color-mix(in srgb, var(--accent) 72%, #f5c55c);
  stroke: rgba(68, 49, 38, 0.32);
  stroke-width: 2;
}

.ten-frame-counter.second {
  fill: #66b7c9;
}

.number-bond-line,
.number-line-axis,
.number-line-tick {
  stroke: rgba(68, 49, 38, 0.64);
  stroke-width: 4;
  stroke-linecap: round;
}

.number-bond-total,
.number-bond-part {
  fill: color-mix(in srgb, var(--accent) 18%, #fffdf3);
  stroke: color-mix(in srgb, var(--accent) 68%, #6b513a);
  stroke-width: 4;
}

.number-bond-part.second {
  fill: color-mix(in srgb, #66b7c9 22%, #fffdf3);
}

.number-bond-text,
.number-line-label {
  fill: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.place-value-rod {
  fill: color-mix(in srgb, var(--accent) 58%, #f5c55c);
  stroke: rgba(68, 49, 38, 0.42);
  stroke-width: 2;
}

.place-value-rod-tick {
  stroke: rgba(255, 253, 243, 0.58);
  stroke-width: 1.5;
}

.place-value-one {
  fill: #66b7c9;
  stroke: rgba(68, 49, 38, 0.32);
  stroke-width: 2;
}

.base-ten-flat {
  fill: color-mix(in srgb, var(--accent) 42%, #bde8ff);
  stroke: rgba(68, 49, 38, 0.34);
  stroke-width: 2;
}

.base-ten-flat-line,
.base-ten-rod-line {
  stroke: rgba(68, 49, 38, 0.22);
  stroke-width: 1.2;
}

.base-ten-rod {
  fill: color-mix(in srgb, var(--accent) 50%, #f5c55c);
  stroke: rgba(68, 49, 38, 0.34);
  stroke-width: 1.6;
}

.base-ten-one {
  fill: #66b7c9;
  stroke: rgba(68, 49, 38, 0.32);
  stroke-width: 1.6;
}

.number-line-missing {
  fill: rgba(255, 253, 243, 0.92);
  stroke: color-mix(in srgb, var(--accent) 72%, #6b513a);
  stroke-width: 3;
  stroke-dasharray: 6 4;
}

.cuboid-top {
  fill: color-mix(in srgb, var(--accent) 24%, #fff7d8);
  stroke: color-mix(in srgb, var(--accent) 74%, #5a4635);
  stroke-width: 4;
  stroke-linejoin: round;
}

.cuboid-side {
  fill: color-mix(in srgb, var(--accent) 38%, #f3d896);
  stroke: color-mix(in srgb, var(--accent) 74%, #5a4635);
  stroke-width: 4;
  stroke-linejoin: round;
}

.cube-top,
.cube-left,
.cube-right {
  stroke: rgba(70, 51, 36, 0.62);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.cube-top {
  fill: color-mix(in srgb, var(--accent) 18%, #fff6c8);
}

.cube-left {
  fill: color-mix(in srgb, var(--accent) 28%, #f1c56e);
}

.cube-right {
  fill: color-mix(in srgb, var(--accent) 42%, #d79d55);
}

.cube-stack-visual figcaption {
  margin-top: -4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.table-visual {
  overflow-x: auto;
}

.table-visual table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.table-visual th,
.table-visual td {
  min-width: 44px;
  padding: 8px 7px;
  border-right: 2px solid rgba(125, 92, 55, 0.18);
  border-bottom: 2px solid rgba(125, 92, 55, 0.18);
  text-align: center;
}

.table-visual th {
  background: color-mix(in srgb, var(--accent) 16%, #fffdf3);
}

.table-visual th:first-child,
.table-visual td:first-child {
  border-left: 2px solid rgba(125, 92, 55, 0.18);
}

.table-visual thead th {
  border-top: 2px solid rgba(125, 92, 55, 0.18);
}

.table-visual figcaption,
.chart-visual figcaption {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.pictograph-panel {
  display: grid;
  gap: 10px;
  min-width: 250px;
  padding: 4px 2px 2px;
}

.pictograph-key,
.pictograph-row {
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.pictograph-rows {
  display: grid;
  gap: 8px;
}

.pictograph-row {
  grid-template-columns: minmax(52px, 72px) 1fr;
  justify-content: stretch;
  padding: 8px 10px;
  border: 2px solid rgba(125, 92, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 243, 0.68);
}

.pictograph-label {
  text-align: center;
}

.pictograph-symbols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}

.pictograph-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.pictograph-icon.big {
  width: 22px;
  height: 22px;
  background: color-mix(in srgb, var(--accent) 68%, #f2b66d);
  clip-path: polygon(50% 0%, 62% 34%, 98% 34%, 69% 55%, 80% 92%, 50% 70%, 20% 92%, 31% 55%, 2% 34%, 38% 34%);
}

.pictograph-icon.small {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #69b8c8;
  box-shadow: inset 0 0 0 2px rgba(70, 51, 36, 0.18);
}

.chart-axis {
  stroke: rgba(68, 49, 38, 0.72);
  stroke-width: 3;
  stroke-linecap: round;
}

.chart-grid-line {
  stroke: rgba(125, 92, 55, 0.16);
  stroke-width: 2;
}

.chart-bar {
  fill: color-mix(in srgb, var(--accent) 62%, #79c7d3);
  stroke: color-mix(in srgb, var(--accent) 78%, #4f3b2e);
  stroke-width: 2;
}

.ratio-strip-left {
  fill: #69b8c8;
  stroke: rgba(70, 51, 36, 0.48);
  stroke-width: 2;
}

.ratio-strip-right {
  fill: #f2b66d;
  stroke: rgba(70, 51, 36, 0.48);
  stroke-width: 2;
}

.ratio-dot {
  stroke: rgba(70, 51, 36, 0.34);
  stroke-width: 1.5;
}

.ratio-dot.left {
  fill: #69b8c8;
}

.ratio-dot.right {
  fill: #f2b66d;
}

.circle-chart-ring,
.circle-diagram-base {
  fill: rgba(255, 253, 243, 0.9);
  stroke: color-mix(in srgb, var(--accent) 72%, #5a4635);
  stroke-width: 4;
}

.circle-chart-wedge {
  stroke: rgba(70, 51, 36, 0.54);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.circle-chart-hole {
  fill: rgba(255, 253, 243, 0.94);
  stroke: rgba(70, 51, 36, 0.24);
  stroke-width: 2;
}

.circle-chart-legend-chip {
  stroke: rgba(70, 51, 36, 0.42);
  stroke-width: 1.5;
}

.circle-chart-percent {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 253, 243, 0.94);
  stroke-width: 4px;
}

.circle-measure-line {
  stroke: #d96b5b;
  stroke-width: 4;
  stroke-linecap: round;
}

.circle-circumference {
  fill: none;
  stroke: #d96b5b;
  stroke-width: 4;
  stroke-dasharray: 8 6;
}

.circle-pattern-center {
  fill: color-mix(in srgb, var(--accent) 32%, #fff6c8);
  stroke: rgba(70, 51, 36, 0.48);
  stroke-width: 3;
}

.circle-pattern-petal {
  fill: color-mix(in srgb, var(--accent) 24%, #79c7d3);
  stroke: rgba(70, 51, 36, 0.36);
  stroke-width: 2.5;
}

.angle-ray {
  stroke: color-mix(in srgb, var(--accent) 75%, #4f3b2e);
  stroke-width: 5;
  stroke-linecap: round;
}

.angle-arc {
  fill: none;
  stroke: #d96b5b;
  stroke-width: 4;
  stroke-linecap: round;
}

.clock-face,
.ruler-body {
  fill: rgba(255, 253, 243, 0.92);
  stroke: color-mix(in srgb, var(--accent) 72%, #5a4635);
  stroke-width: 4;
}

.clock-tick {
  stroke: rgba(70, 51, 36, 0.52);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.clock-tick.major {
  stroke: rgba(70, 51, 36, 0.82);
  stroke-width: 3;
}

.clock-number,
.ruler-number {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.clock-hand {
  stroke-linecap: round;
}

.clock-hand.hour {
  stroke: color-mix(in srgb, var(--accent) 82%, #4f3b2e);
  stroke-width: 7;
}

.clock-hand.minute {
  stroke: #d96b5b;
  stroke-width: 4;
}

.clock-center,
.ruler-end-dot {
  fill: #d96b5b;
  stroke: rgba(70, 51, 36, 0.38);
  stroke-width: 2;
}

.ruler-tick {
  stroke: rgba(70, 51, 36, 0.62);
  stroke-linecap: round;
}

.ruler-tick.major {
  stroke-width: 3;
}

.ruler-tick.minor {
  stroke-width: 1.6;
}

.ruler-highlight {
  stroke: #d96b5b;
  stroke-width: 6;
  stroke-linecap: round;
}

.line-type-main {
  stroke: color-mix(in srgb, var(--accent) 78%, #4f3b2e);
  stroke-width: 7;
  stroke-linecap: round;
}

.line-arrow {
  fill: color-mix(in srgb, var(--accent) 78%, #4f3b2e);
}

.line-endpoint,
.array-dot {
  fill: color-mix(in srgb, var(--accent) 46%, #79c7d3);
  stroke: rgba(70, 51, 36, 0.45);
  stroke-width: 2;
}

.right-angle-marker {
  fill: none;
  stroke: #d96b5b;
  stroke-width: 4;
  stroke-linejoin: round;
}

.pattern-triangle,
.pattern-circle,
.pattern-square,
.pattern-color {
  stroke: rgba(70, 51, 36, 0.48);
  stroke-width: 3;
}

.pattern-triangle {
  fill: #f2b66d;
}

.pattern-circle {
  fill: #69b8c8;
}

.pattern-square {
  fill: #91c788;
}

.pattern-color.red {
  fill: #f08f74;
}

.pattern-color.blue {
  fill: #69b8c8;
}

.pattern-color.yellow {
  fill: #f2d36b;
}

.pattern-placeholder {
  fill: rgba(255, 253, 243, 0.9);
  stroke: #d96b5b;
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.pattern-question,
.pattern-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 253, 243, 0.9);
  stroke-width: 4px;
}

.pattern-question {
  font-size: 23px;
}

.circle-area-fill {
  fill: color-mix(in srgb, var(--accent) 28%, #a9d9c6);
  stroke: color-mix(in srgb, var(--accent) 78%, #5a4635);
  stroke-width: 4;
}

.circle-square {
  fill: rgba(255, 246, 211, 0.86);
  stroke: color-mix(in srgb, var(--accent) 72%, #5a4635);
  stroke-width: 4;
}

.fraction-cell {
  fill: rgba(255, 253, 243, 0.92);
  stroke: rgba(70, 51, 36, 0.42);
  stroke-width: 1.8;
}

.fraction-cell.shaded {
  fill: color-mix(in srgb, var(--accent) 36%, #8bcfd1);
}

.fraction-cut-line {
  stroke: #d96b5b;
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.chart-line {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 76%, #315f89);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #fffdf3;
  stroke: color-mix(in srgb, var(--accent) 82%, #315f89);
  stroke-width: 4;
}

.chart-reference {
  stroke: #d96b5b;
  stroke-width: 3;
  stroke-dasharray: 7 5;
}

.chart-reference-label,
.chart-value,
.chart-label,
.chart-unit,
.coord-label,
.coin-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 253, 243, 0.9);
  stroke-width: 4px;
}

.chart-value {
  font-size: 13px;
}

.chart-label,
.chart-unit {
  font-size: 12px;
}

.coord-grid {
  stroke: rgba(125, 92, 55, 0.13);
  stroke-width: 1;
}

.coord-axis {
  stroke: rgba(68, 49, 38, 0.72);
  stroke-width: 3;
}

.coord-symmetry {
  stroke: #d96b5b;
  stroke-width: 4;
  stroke-dasharray: 8 6;
}

.coord-point {
  fill: color-mix(in srgb, var(--accent) 72%, #5aaec7);
  stroke: #fffdf3;
  stroke-width: 3;
}

.coord-reflected {
  fill: #e97953;
  stroke: #fffdf3;
  stroke-width: 3;
}

.bag-shape {
  fill: color-mix(in srgb, var(--accent) 16%, #fffdf3);
  stroke: color-mix(in srgb, var(--accent) 72%, #6b503b);
  stroke-width: 4;
}

.bag-neck {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 72%, #6b503b);
  stroke-width: 5;
  stroke-linecap: round;
}

.prob-ball {
  stroke: rgba(255, 253, 243, 0.92);
  stroke-width: 2;
}

.prob-ball.red {
  fill: #e86756;
}

.prob-ball.blue {
  fill: #4e9ed6;
}

.coin-face {
  stroke: #8a693d;
  stroke-width: 4;
}

.coin-face.front {
  fill: #f7d56b;
}

.coin-face.back {
  fill: #f0bc50;
}

.congruent-arrow,
.rotation-path {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 76%, #315f89);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rotation-tip {
  fill: color-mix(in srgb, var(--accent) 76%, #315f89);
  stroke: none;
}

/* 워크시트 시각 슬롯 - 마운트 전 빈 박스가 자리 차지하지 않도록 */
.ws-visual { margin: 8px 0 8px 32px; max-width: 100%; }
.ws-visual:empty { display: none; }
.ws-visual .math-visual { margin-left: 0; margin-right: 0; }
@media print {
  .ws-visual { break-inside: avoid; page-break-inside: avoid; }
  .ws-visual .math-visual { border: 1px solid #888; }
}

/* ───────────────── 학습 레이아웃 — 왼쪽 제어패널 + 오른쪽 단일 문제 풀이 ───────────────── */

.learning-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
}
.learning-control-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.learning-control-panel::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
.learning-control-panel::-webkit-scrollbar-track,
.learning-control-panel::-webkit-scrollbar-thumb {
  background: transparent;
}
.learning-main { min-width: 0; }

.btn.back-mini {
  background: #fff;
  border: 2px solid var(--primary-soft);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 14px;
  width: max-content;
}

.control-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.control-card .eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.control-card strong { font-size: 16px; }
.control-card small { color: var(--ink-soft); font-size: 13px; }

.sidebar-topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.sidebar-topic {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 14px;
}
.sidebar-topic.is-active { border-color: var(--primary); background: #fff; }
.sidebar-topic.is-done { background: #f1ffe8; }
.sidebar-topic strong { font-weight: 700; font-size: 14px; grid-column: 1; }
.sidebar-topic span { grid-column: 1; color: var(--ink-soft); font-size: 12px; }
.sidebar-topic em { font-style: normal; color: #4cb5ff; font-weight: 800; grid-column: 2; grid-row: 1; }

.sidebar-actions { display: grid; gap: 6px; }
.sidebar-actions .btn { width: 100%; text-align: left; padding: 9px 12px; font-size: 14px; }
.output-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.output-actions .btn { width: 100%; padding: 9px 10px; font-size: 13px; }

/* 단일 문제 풀이 카드 */
.problem-view {
  --accent: #ff8a3d;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--accent);
  padding: 18px 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.problem-view.empty { color: var(--ink-soft); text-align: center; padding: 60px 20px; }
.problem-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  border-bottom: 1px dashed #e6dcc4;
  padding-bottom: 8px;
}
.problem-no { font-size: 18px; font-weight: 900; color: var(--accent); }
.problem-topic { color: var(--ink-soft); font-size: 14px; }
.problem-pager { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.problem-pager .btn { padding: 6px 12px; font-size: 14px; }
.problem-pager .tts-btn {
  border-color: #82c9a3;
  background: #edfff4;
  color: #176a3c;
}

.problem-prompt {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}
.problem-expression {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Noto Sans KR', 'Pretendard', 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', serif;
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
}
.problem-expression.is-check {
  font-size: 17px;
  font-weight: 700;
  background: #fff9e8;
}
.problem-visual { margin: 4px auto; max-width: 100%; min-height: 100px; }
.problem-visual .math-visual { margin: 0 auto; }

.concept-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-width: 100%;
}

.concept-card {
  min-width: 0;
  border: 1px solid #e3d4b0;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  background: #fffef9;
  padding: 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px 8px;
  align-items: start;
  box-shadow: 0 8px 18px rgba(70, 54, 25, 0.07);
}

.concept-card-no {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #2b2a4d;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
}

.concept-card strong {
  font-size: 16px;
  line-height: 1.25;
  color: var(--ink);
  align-self: center;
}

.concept-card p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.concept-card-grid.is-compact {
  margin: 6px 0 6px 32px;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 6px;
}

.concept-card-grid.is-compact .concept-card {
  padding: 7px;
  box-shadow: none;
}

.concept-card-grid.is-compact .concept-card-no {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.concept-card-grid.is-compact .concept-card strong {
  font-size: 13px;
}

.concept-card-grid.is-compact .concept-card p {
  font-size: 12px;
  line-height: 1.35;
}

.learning-aid {
  --aid: var(--accent);
  --aid-soft: color-mix(in srgb, var(--aid) 14%, #fffdf4);
  border: 2px solid color-mix(in srgb, var(--aid) 34%, #d9c9a8);
  border-radius: 8px;
  background: linear-gradient(135deg, #fffdf7 0%, var(--aid-soft) 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.learning-aid.stage-concept { --aid: #5b6cff; }
.learning-aid.stage-basic { --aid: #ff8a3d; }
.learning-aid.stage-type { --aid: #2fa36f; }
.learning-aid.stage-challenge { --aid: #c0488a; }
.learning-aid-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.learning-aid-kicker {
  display: block;
  color: color-mix(in srgb, var(--aid) 82%, #332719);
  font-size: 12px;
  font-weight: 900;
}
.learning-aid-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}
.learning-aid-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  min-width: 180px;
}
.learning-aid-chips span {
  border: 1px solid color-mix(in srgb, var(--aid) 28%, #e6dcc4);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.learning-aid-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(220px, 1.25fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.aid-visual-card {
  min-height: 150px;
  border: 1px solid color-mix(in srgb, var(--aid) 24%, #e6dcc4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.aid-visual-card figcaption {
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.learning-aid-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.learning-aid-steps li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  align-items: start;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(125, 92, 55, 0.16);
  border-radius: 8px;
  padding: 8px 9px;
}
.learning-aid-steps b {
  color: color-mix(in srgb, var(--aid) 82%, #4b3826);
  font-size: 13px;
}
.learning-aid-steps span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.learning-aid-game {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  border-left: 4px solid var(--aid);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 9px 10px;
}
.learning-aid-game b { color: color-mix(in srgb, var(--aid) 82%, #4b3826); }
.learning-aid-game span,
.learning-aid-game em {
  font-size: 13px;
  line-height: 1.45;
}
.learning-aid-game em {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-style: normal;
}
.aid-token-tray,
.aid-array,
.aid-chart {
  display: grid;
  gap: 6px;
  justify-content: center;
  align-content: center;
}
.aid-token-tray {
  grid-template-columns: repeat(5, 32px);
}
.aid-token {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--aid) 80%, #ffe58a);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  animation: aidPop 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.07s);
}
.aid-numberline {
  position: relative;
  height: 82px;
  margin: 6px 6px 0;
}
.aid-line {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 38px;
  height: 4px;
  background: color-mix(in srgb, var(--aid) 52%, #d0c2aa);
  border-radius: 999px;
}
.aid-tick {
  position: absolute;
  left: var(--pos);
  top: -8px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
}
.aid-tick i {
  width: 3px;
  height: 20px;
  background: #725c43;
  border-radius: 999px;
}
.aid-tick b {
  font-size: 12px;
  color: var(--ink);
}
.aid-runner {
  position: absolute;
  left: var(--pos);
  top: 30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--aid);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--aid) 20%, transparent);
  transform: translateX(-50%);
  animation: aidPulse 1.4s ease-in-out infinite;
  z-index: 2;
}
.aid-array {
  grid-template-columns: repeat(var(--cols), 22px);
}
.aid-array span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--aid) 72%, #fff1a6);
  animation: aidPop 1.7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.035s);
}
.aid-fraction-bar {
  display: grid;
  grid-template-columns: repeat(var(--parts), 1fr);
  height: 42px;
  border: 2px solid color-mix(in srgb, var(--aid) 70%, #4b3826);
  border-radius: 8px;
  overflow: hidden;
}
.aid-fraction-bar span {
  background: #fff;
  border-right: 1px solid rgba(86, 65, 42, 0.35);
}
.aid-fraction-bar span.is-filled {
  background: color-mix(in srgb, var(--aid) 70%, #fff0a8);
  animation: aidGlow 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
.aid-fraction-visual small {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 800;
}
.aid-geometry-visual svg {
  width: 100%;
  height: auto;
  max-height: 110px;
}
.aid-svg-shape {
  fill: color-mix(in srgb, var(--aid) 28%, #fff6c5);
  stroke: color-mix(in srgb, var(--aid) 72%, #574128);
  stroke-width: 4;
}
.aid-svg-shape.twin { fill: color-mix(in srgb, #39a8d8 28%, #fff6c5); }
.aid-svg-guide {
  stroke: #7c6a56;
  stroke-width: 3;
  stroke-dasharray: 7 6;
  animation: aidDash 1.8s linear infinite;
}
.aid-ruler {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  height: 62px;
  border-bottom: 4px solid #6e5740;
}
.aid-ruler span {
  display: grid;
  justify-items: center;
  align-content: end;
  height: 56px;
  border-left: 3px solid color-mix(in srgb, var(--aid) 70%, #6e5740);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.aid-ruler span.short { height: 42px; }
.aid-chart {
  grid-template-columns: repeat(4, 30px);
  height: 92px;
  align-items: end;
}
.aid-chart span {
  height: var(--h);
  min-height: 18px;
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--aid) 70%, #ffd76c);
  color: #fff;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: 900;
  animation: aidGrow 1.1s ease-out both;
  animation-delay: calc(var(--i) * 0.08s);
}
.aid-balance {
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 74px;
}
.aid-balance .beam {
  height: 6px;
  background: #725c43;
  border-radius: 999px;
  position: relative;
}
.aid-balance .beam::after {
  content: '';
  position: absolute;
  left: 40px;
  top: 6px;
  width: 8px;
  height: 38px;
  background: #725c43;
}
.aid-balance .pan {
  min-height: 44px;
  border: 2px solid color-mix(in srgb, var(--aid) 58%, #725c43);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.78);
}
.aid-balance .left { animation: aidTiltLeft 1.8s ease-in-out infinite; }
.aid-balance .right { animation: aidTiltRight 1.8s ease-in-out infinite; }
.learning-aid.is-compact {
  padding: 9px;
  margin: 8px 0;
}
.learning-aid.is-compact .learning-aid-grid {
  grid-template-columns: 1fr;
}
.learning-aid.is-compact .aid-visual-card {
  min-height: 112px;
}
@keyframes aidPop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}
@keyframes aidPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.12); }
}
@keyframes aidGlow {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.35) brightness(1.05); }
}
@keyframes aidDash {
  to { stroke-dashoffset: -26; }
}
@keyframes aidGrow {
  from { transform: scaleY(0.2); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}
@keyframes aidTiltLeft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
@keyframes aidTiltRight {
  0%, 100% { transform: translateY(4px); }
  50% { transform: translateY(0); }
}
@media (max-width: 680px) {
  .learning-aid-head,
  .learning-aid-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
  .learning-aid-chips {
    justify-content: flex-start;
    min-width: 0;
  }
  .learning-aid-steps li {
    grid-template-columns: 68px 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .learning-aid *,
  .learning-aid *::before,
  .learning-aid *::after {
    animation: none !important;
  }
}

.problem-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.choice-btn {
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.choice-btn:hover { border-color: var(--accent); background: #fff8ee; }

.problem-answer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.problem-answer-row label { font-weight: 700; }
.problem-answer-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-family: inherit;
}
.problem-answer-input:focus { outline: none; border-color: var(--accent); }
.problem-hint { color: var(--ink-soft); font-size: 13px; }

.problem-answer-reveal {
  background: #f6fff0;
  border: 2px solid #b6e0a0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.problem-answer-reveal .answer-value { font-size: 18px; font-weight: 900; color: #2c6e22; margin-left: 6px; }
.problem-answer-reveal .solution { margin: 0; color: var(--ink-soft); font-size: 14px; }

.problem-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #e6dcc4;
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.problem-progress-mini { color: var(--ink-soft); font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 화면에서는 인쇄용 워크시트 숨김(인쇄/PDF 때만 보임) */
.worksheet-print-only { display: none; }
@media print {
  .learning-layout { display: block !important; }
  .learning-control-panel, .learning-main { display: none !important; }
  .worksheet-print-only { display: block !important; }
}

/* 모바일: 사이드바를 위쪽으로 스택 */
@media (max-width: 768px) {
  .learning-layout {
    grid-template-columns: 1fr;
  }
  .learning-control-panel {
    position: static;
    max-height: none;
  }
}

/* ───────────────── 학년 메뉴 / 캘린더 / 레벨 테스트 ───────────────── */

.math-study-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.study-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.study-card header h2 { margin: 0 0 4px; font-size: 18px; }
.study-card header p { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.grade-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.grade-grid .btn { padding: 10px 6px; text-align: center; font-weight: 800; }

/* 4단계 필터 컬러 */
.area-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.area-pill { font-weight: 800; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eee; color: #333; margin-right: 4px; }
.tag.stage-concept { background: #e6e9ff; color: #2a3aa8; }
.tag.stage-basic { background: #fff0dc; color: #a8590f; }
.tag.stage-type { background: #e1f5ec; color: #1f6b4a; }
.tag.stage-challenge { background: #fbe1ec; color: #8a275a; }

/* 캘린더 화면 */
.calendar-view { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.calendar-header h2 { margin: 8px 0 4px; }
.calendar-header p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; }
.stage-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cal-mode-toggle { display: flex; gap: 6px; margin-bottom: 12px; }

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.week-card {
  text-align: left;
  background: #fff;
  border: 2px solid var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  color: var(--ink);
}
.week-card:hover { border-color: var(--primary); background: #fff8ee; }
.week-no { font-size: 18px; font-weight: 900; color: var(--primary); }
.week-range { color: var(--ink-soft); font-size: 12px; }
.week-topic { font-weight: 700; font-size: 14px; }
.week-module { color: var(--ink-soft); font-size: 12px; }
.week-card.stage-concept { border-color: #5b6cff; }
.week-card.stage-basic { border-color: #ff8a3d; }
.week-card.stage-type { border-color: #3aaf85; }
.week-card.stage-challenge { border-color: #c0488a; }
.week-card.stage-concept .week-no { color: #5b6cff; }
.week-card.stage-type .week-no { color: #3aaf85; }
.week-card.stage-challenge .week-no { color: #c0488a; }

.daily-table-wrap { overflow-x: auto; }
.daily-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.daily-table th, .daily-table td { padding: 6px 8px; border-bottom: 1px solid #eee; text-align: left; }
.daily-table th { background: var(--bg-soft); font-weight: 800; position: sticky; top: 0; z-index: 1; }
.daily-table tr.stage-concept { background: #f6f8ff; }
.daily-table tr.stage-basic { background: #fffaf0; }
.daily-table tr.stage-type { background: #f4fbf7; }
.daily-table tr.stage-challenge { background: #fdf1f6; }
.btn.tiny { padding: 4px 10px; font-size: 12px; }

/* 레벨 테스트 */
.leveltest-view { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.leveltest-head h2 { margin: 6px 0 8px; }
.leveltest-progress { margin: 8px 0; display: grid; gap: 4px; }
.score-bar { background: var(--primary-soft); height: 8px; border-radius: 4px; overflow: hidden; }
.score-bar span { display: block; height: 100%; background: var(--primary); transition: width 0.3s ease; }
.leveltest-result .score-big { font-size: 28px; font-weight: 900; color: var(--primary); text-align: center; margin: 12px 0; }
.leveltest-recommend { text-align: center; margin: 14px 0 18px; display: grid; gap: 8px; }
.leveltest-recommend strong { font-size: 22px; color: var(--ink); }
.leveltest-summary { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.leveltest-summary th, .leveltest-summary td { padding: 6px 8px; border-bottom: 1px solid #eee; text-align: left; }
.leveltest-summary th { background: var(--bg-soft); font-weight: 800; }

@media (max-width: 768px) {
  .grade-grid { grid-template-columns: repeat(3, 1fr); }
  .weekly-grid { grid-template-columns: repeat(2, 1fr); }
  .area-picker { grid-template-columns: 1fr; }
  .output-actions { grid-template-columns: 1fr; }
}

/* ───────────────── 개념 미디어(애니메이션 + 미니 게임) ───────────────── */

.concept-media {
  display: grid;
  gap: 12px;
  background: linear-gradient(135deg, #fffdf5 0%, #f0f4ff 100%);
  border: 2px solid #c8d2ff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.concept-media > header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.concept-media > header strong { font-size: 15px; }
.concept-media > header span { color: var(--ink-soft); font-size: 12px; }

/* 벡터 애니메이션 공통 */
.concept-anim { margin: 0; display: grid; gap: 6px; background: #fff; border-radius: 10px; padding: 10px; border: 1px solid #e4ddc7; }
.concept-anim figcaption { display: grid; gap: 2px; }
.concept-anim figcaption strong { font-size: 14px; color: var(--ink); }
.concept-anim svg { width: 100%; height: auto; max-height: 130px; }

/* 수 세기 dot */
.anim-counting .anim-dot { opacity: 0; transform: scale(0.5); transform-origin: center; animation: anim-pop 0.4s ease forwards; animation-delay: calc(var(--i) * 0.35s); fill: #ffd2a8; }
.anim-counting .anim-dot circle { fill: #ffb56e; stroke: #b56026; stroke-width: 2; }
.anim-counting .anim-dot text { fill: #4a2a10; }
@keyframes anim-pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }

/* 덧셈 */
.anim-addition .add-dot { opacity: 0; animation: anim-fade-in 0.4s ease forwards; }
.anim-addition .add-dot.left { animation-delay: calc(var(--i) * 0.25s); }
.anim-addition .add-dot.right { animation-delay: calc(0.6s + var(--i) * 0.25s); }
.anim-addition .add-dot.left circle { fill: #ffc58a; stroke: #b86b2a; stroke-width: 2; }
.anim-addition .add-dot.right circle { fill: #b6dff0; stroke: #2a78b8; stroke-width: 2; }
.anim-addition .anim-sign { fill: #2b2a4d; opacity: 0; animation: anim-fade-in 0.4s ease forwards 1.2s; }
.anim-addition .anim-total { fill: #c0488a; opacity: 0; transform: scale(0.6); transform-origin: 280px 65px; animation: anim-pop 0.5s ease forwards 1.6s; font-size: 30px; }
@keyframes anim-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 뺄셈 */
.anim-subtraction .sub-dot circle { fill: #b6dff0; stroke: #2a78b8; stroke-width: 2; }
.anim-subtraction .sub-dot.leave { animation: anim-leave 0.6s ease forwards; animation-delay: calc(1s + var(--i) * 0.25s); }
.anim-subtraction .anim-sign { fill: #c0488a; opacity: 0; animation: anim-fade-in 0.4s ease forwards 2.5s; }
@keyframes anim-leave { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }

/* 곱셈 배열 */
.anim-multiplication .mul-cell rect { fill: #c8e6c9; stroke: #2e7d32; stroke-width: 2; opacity: 0; animation: anim-fade-in 0.25s ease forwards; animation-delay: calc(var(--i) * 0.06s); }

/* 분수 */
.anim-fraction .frac-cell rect { stroke: #555; stroke-width: 1.5; fill: #fff; }
.anim-fraction .frac-cell.fill rect { fill: #ff8a3d; animation: anim-fill 0.5s ease forwards; animation-delay: calc(var(--i) * 0.25s); }
@keyframes anim-fill { from { opacity: 0.2; } to { opacity: 1; } }

/* 도형 변환 */
.anim-geometry .geom-shape rect { fill: #d8c7ff; stroke: #5b4bb7; stroke-width: 2; opacity: 0; animation: anim-fade-in 0.4s ease forwards; animation-delay: calc(var(--i) * 0.4s); transform-origin: center; }
.anim-geometry .geom-shape.g-translate rect { animation: anim-fade-in 0.4s ease forwards 0.4s, anim-translate 1.5s ease-in-out infinite alternate 0.8s; }
.anim-geometry .geom-shape.g-rotate rect { animation: anim-fade-in 0.4s ease forwards 0.8s, anim-rotate 2s linear infinite 1.2s; transform-box: fill-box; }
@keyframes anim-translate { from { transform: translateX(-8px); } to { transform: translateX(8px); } }
@keyframes anim-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 측정 자 */
.anim-measurement .meas-baseline { stroke: #888; stroke-width: 2; }
.anim-measurement .meas-tick line { stroke: #444; stroke-width: 2; opacity: 0; animation: anim-fade-in 0.25s ease forwards; animation-delay: calc(var(--i) * 0.15s); }
.anim-measurement .meas-tick text { fill: #333; opacity: 0; animation: anim-fade-in 0.25s ease forwards; animation-delay: calc(var(--i) * 0.15s); }

/* 미니 게임 공통 */
.concept-game {
  background: #fffbf0;
  border: 2px solid #ffd2a8;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.concept-game > header { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.concept-game > header strong { font-size: 15px; }
.cg-status { font-size: 13px; color: var(--ink-soft); }

/* 10칸틀 */
.cg-tenframe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cg-cell {
  aspect-ratio: 1 / 1;
  border: 2px solid #b58e5e; border-radius: 6px;
  background: #fff8e8; cursor: pointer;
}
.cg-cell.on { background: #ff8a3d; border-color: #b8541a; }

/* 도형 분류 */
.cg-shape-board { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.cg-shape-tray, .cg-shape-slots { display: grid; gap: 6px; }
.cg-shape-chip { padding: 14px; font-size: 28px; border-radius: 8px; border: 2px solid #888; background: #fff; cursor: pointer; }
.cg-shape-chip.is-active { background: #5b6cff; color: #fff; border-color: #5b6cff; }
.cg-shape-chip.used { opacity: 0.3; cursor: not-allowed; }
.cg-shape-slot { padding: 10px; border-radius: 8px; border: 2px dashed #888; background: #fff; cursor: pointer; font-weight: 700; }
.cg-shape-slot.is-matched { background: #d4f5d4; border-color: #2e7d32; border-style: solid; }

/* 등분 게임 */
.cg-equal-bar {
  position: relative; height: 60px;
  background: linear-gradient(90deg, #ffb56e, #c0488a); border-radius: 8px;
}
.cg-cut {
  position: absolute; top: -6px; bottom: -6px; width: 18px;
  background: transparent; border: none; cursor: pointer;
  border-left: 3px dashed transparent;
}
.cg-cut.on { border-left-color: #2b2a4d; border-left-style: solid; }

/* 수 순서 */
.cg-seq-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-seq-card {
  width: 56px; height: 56px; border-radius: 8px;
  border: 2px solid #5b6cff; background: #fff;
  font-size: 22px; font-weight: 900; color: #5b6cff; cursor: pointer;
}
.cg-seq-card.done { background: #5b6cff; color: #fff; }

/* 균형 */
.cg-balance { display: grid; gap: 8px; }
.cg-balance-eq { font-size: 22px; font-weight: 900; text-align: center; padding: 10px; background: #fff; border-radius: 8px; border: 2px solid #c0488a; }
.cg-balance-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.cg-balance-key { padding: 10px; background: #fff; border: 2px solid #888; border-radius: 6px; font-weight: 800; cursor: pointer; }
.cg-balance-key:hover { background: #f4f4f4; }

@media (max-width: 768px) {
  .cg-shape-board { grid-template-columns: 1fr; }
  .cg-balance-pad { grid-template-columns: repeat(4, 1fr); }
}

/* ───────────────── 추가 애니메이션 (약분/통분/입체/좌표/비례/원넓이) ───────────────── */
.anim-fraction-reduce .frac-cell-r rect { stroke: #555; stroke-width: 1.5; fill: #fff; }
.anim-fraction-reduce .frac-cell-r.fill rect { fill: #c0488a; opacity: 0; animation: anim-fade-in 0.35s ease forwards; animation-delay: calc(var(--i) * 0.15s); }
.anim-fraction-reduce .frac-cell-r.g-0 rect { stroke: #5b6cff; stroke-width: 2.5; }
.anim-fraction-reduce .reduce-arrow { opacity: 0; animation: anim-fade-in 0.5s ease forwards 2s; }

.anim-frac-common .fc-cell rect { stroke-width: 1.5; }
.anim-frac-common .fc-cell.first rect { animation: anim-fade-in 0.3s ease forwards; animation-delay: calc(var(--i) * 0.1s); }
.anim-frac-common .fc-cell.second rect { animation: anim-fade-in 0.3s ease forwards; animation-delay: calc(0.6s + var(--i) * 0.1s); }
.anim-frac-common .fc-cell.merged1 rect, .anim-frac-common .fc-cell.merged2 rect { opacity: 0; animation: anim-fade-in 0.3s ease forwards; animation-delay: calc(1.4s + var(--i) * 0.06s); }

.anim-solid-3d .s3d-top { fill: #b3d3ff; stroke: #2a5da4; stroke-width: 2; }
.anim-solid-3d .s3d-front { fill: #c8e6c9; stroke: #2e7d32; stroke-width: 2; }
.anim-solid-3d .s3d-side, .anim-solid-3d .s3d-side-r { fill: #ffd8a8; stroke: #b86b2a; stroke-width: 2; opacity: 0.85; }
.anim-solid-3d .s3d-bottom { fill: #d8c7ff; stroke: #5b4bb7; stroke-width: 2; }
.anim-solid-3d .s3d-equator { fill: none; stroke: #2a5da4; stroke-width: 1.5; stroke-dasharray: 4 3; }
.anim-solid-3d .s3d-meridian { fill: none; stroke: #2a5da4; stroke-width: 1.5; stroke-dasharray: 4 3; }
.anim-solid-3d { animation: rotate-3d 8s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes rotate-3d { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

.anim-coord .coord-grid { stroke: #ddd; stroke-width: 1; }
.anim-coord .coord-axis { stroke: #2b2a4d; stroke-width: 2; }
.anim-coord .coord-trace { fill: none; stroke: #ff8a3d; stroke-width: 2.5; stroke-dasharray: 6 4; stroke-dashoffset: 100; animation: anim-dash 1.4s ease forwards 0.4s; }
.anim-coord .coord-point { fill: #c0488a; stroke: #fff; stroke-width: 2; opacity: 0; animation: anim-pop 0.5s ease forwards 1.6s; transform-origin: center; transform-box: fill-box; }
.anim-coord .coord-label { fill: #c0488a; opacity: 0; animation: anim-fade-in 0.4s ease forwards 1.8s; }
@keyframes anim-dash { to { stroke-dashoffset: 0; } }

.anim-ratio rect.ratio-left { opacity: 0; animation: anim-fade-in 0.3s ease forwards; }
.anim-ratio rect.ratio-right { opacity: 0; animation: anim-fade-in 0.3s ease forwards; }
.anim-ratio rect.ratio-left { animation-delay: calc(var(--i, 0) * 0.18s); }
.anim-ratio rect.ratio-right { animation-delay: calc(0.6s + var(--i, 0) * 0.18s); }

.anim-circle-area .ca-outline { fill: none; stroke: #2b2a4d; stroke-width: 2.5; }
.anim-circle-area .ca-cell { fill: #ffd2a8; stroke: #b8541a; stroke-width: 0.8; opacity: 0; animation: anim-fade-in 0.2s ease forwards; animation-delay: calc(var(--i) * 0.04s); }
.anim-circle-area .ca-radius { stroke: #c0488a; stroke-width: 2.5; }

/* ───────────────── 추가 게임 (분수 비교/덧셈, 좌표, 비례, 합동) ───────────────── */
.cg-fc-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-fc-card { display: grid; gap: 6px; text-align: center; padding: 8px; border-radius: 8px; border: 2px solid #ddd; background: #fff; }
.cg-fc-bar { display: flex; gap: 2px; }
.cg-fc-cell { flex: 1; aspect-ratio: 1 / 2; background: #fff; border: 1.5px solid #888; }
.cg-fc-cell.fill { background: #ff8a3d; border-color: #b8541a; }
.cg-fc-label { font-weight: 900; font-size: 18px; color: #2b2a4d; }
.cg-fc-pick { padding: 8px; background: #5b6cff; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 800; }

.cg-fa { display: grid; gap: 6px; }
.cg-fa p { margin: 2px 0; font-size: 13px; color: #555; }
.cg-fa-row { display: flex; gap: 2px; flex-wrap: wrap; }
.cg-fa-cell { width: 36px; height: 36px; border: 2px solid #888; border-radius: 6px; background: #fff; cursor: pointer; font-weight: 700; }
.cg-fa-cell.is-active { background: #ff8a3d; color: #fff; border-color: #b8541a; }
.cg-fa-display { padding: 10px; background: #fff8e8; border-radius: 6px; font-weight: 900; font-size: 18px; text-align: center; }

.cg-coord-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #ccc; padding: 1px; border-radius: 6px; max-width: 350px; }
.cg-coord-cell { aspect-ratio: 1 / 1; background: #fff; border: none; cursor: pointer; font-size: 11px; color: #888; }
.cg-coord-cell.axis { background: #fff8e8; }
.cg-coord-cell.hit { background: #2e7d32; color: #fff; font-weight: 900; }
.cg-coord-cell.miss { background: #fdd; }

.cg-prop-pad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cg-prop-key { padding: 8px; background: #fff; border: 2px solid #ff8a3d; border-radius: 6px; cursor: pointer; font-weight: 800; }
.cg-prop-key:hover { background: #fff8e8; }

.cg-cong-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cg-cong-shape { padding: 12px; background: #fff; border: 2px solid #888; border-radius: 8px; cursor: pointer; font-weight: 900; line-height: 1; color: #5b4bb7; }
.cg-cong-shape.selected { border-color: #5b6cff; background: #eef0ff; }
.cg-cong-shape.done { border-color: #2e7d32; background: #d4f5d4; cursor: default; }

@media (max-width: 768px) {
  .cg-fc-board { grid-template-columns: 1fr; }
  .cg-coord-grid { grid-template-columns: repeat(7, 1fr); max-width: 280px; }
  .cg-prop-pad { grid-template-columns: repeat(5, 1fr); }
}

/* ───────────────── 입체 도형 전개도(solidNet) 펼침 애니메이션 ───────────────── */
.anim-solid-net .net-face rect,
.anim-solid-net .net-face polygon,
.anim-solid-net .net-face circle,
.anim-solid-net .net-face path {
  fill: #ffd2a8;
  stroke: #b8541a;
  stroke-width: 1.8;
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
  animation: net-fold 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
.anim-solid-net .kind-cylinder .cyl-side rect { fill: #c8e6c9; stroke: #2e7d32; }
.anim-solid-net .kind-cone .cone-sector path { fill: #b3d3ff; stroke: #2a5da4; }
.anim-solid-net .kind-pyramid .pyr-base rect { fill: #d8c7ff; stroke: #5b4bb7; }
.anim-solid-net .kind-cube .face.top rect { fill: #b3d3ff; stroke: #2a5da4; }
.anim-solid-net .kind-cube .face.bottom rect { fill: #d8c7ff; stroke: #5b4bb7; }
@keyframes net-fold {
  0% { opacity: 0; transform: scale(0.4); }
  40% { opacity: 1; transform: scale(1); }
  60% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(0.6) translateY(-20px); }
  100% { opacity: 0; transform: scale(0.4); }
}
.anim-solid-net .net-face text {
  opacity: 0;
  animation: anim-fade-in 0.4s ease forwards;
  animation-delay: calc(0.5s + var(--i) * 0.18s);
}

/* ───────────────── 사분면 좌표 게임 ───────────────── */
.cg-coord-board { display: grid; gap: 6px; }
.cg-coord-corner { background: #fff8e8; }
.cg-coord-axis-label { display: flex; align-items: center; justify-content: center; background: #fff8e8; color: #b8541a; font-weight: 800; font-size: 11px; }
.cg-coord-hint { color: var(--ink-soft); font-size: 12px; }

/* ───────────────── 연산 학습 현황 탭 ───────────────── */
.ml-tab-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.ml-student-list { display: flex; flex-direction: column; gap: 16px; }
.ml-student-card { background: var(--card-bg); border: 1.5px solid #e8e0d4; border-radius: 14px; padding: 16px; }
.ml-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ml-student-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-student-info strong { font-size: 16px; }
.ml-summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-chip { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #f0ece6; color: #555; }
.ml-chip.acc { background: #e8f4fd; color: #1a6ea8; }
.ml-chip.date { background: #f5f0ff; color: #6b21a8; }
.ml-chip.level.ml-advanced { background: #dcfce7; color: #166534; }
.ml-chip.level.ml-stable { background: #fef9c3; color: #854d0e; }
.ml-chip.level.ml-basic { background: #ffedd5; color: #9a3412; }
.ml-chip.level.ml-weak { background: #fee2e2; color: #991b1b; }
.ml-no-data { font-size: 13px; color: var(--ink-soft); padding: 8px 0; }
.ml-unit-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.ml-unit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ml-unit-table th { background: #f8f5f0; padding: 6px 10px; text-align: left; font-size: 12px; color: var(--ink-soft); border-bottom: 1px solid #e8e0d4; }
.ml-unit-table td { padding: 6px 10px; border-bottom: 1px solid #f0ece6; vertical-align: middle; }
.ml-bar-wrap { display: inline-block; width: 60px; height: 6px; background: #e8e0d4; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.ml-bar { height: 6px; border-radius: 3px; }
.ml-bar.ml-advanced { background: #22c55e; }
.ml-bar.ml-stable   { background: #eab308; }
.ml-bar.ml-basic    { background: #f97316; }
.ml-bar.ml-weak     { background: #ef4444; }
.ml-level-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.ml-level-badge.ml-advanced { background: #dcfce7; color: #166534; }
.ml-level-badge.ml-stable   { background: #fef9c3; color: #854d0e; }
.ml-level-badge.ml-basic    { background: #ffedd5; color: #9a3412; }
.ml-level-badge.ml-weak     { background: #fee2e2; color: #991b1b; }
.ml-memo-form { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; background: #fafaf8; border-radius: 10px; padding: 10px 12px; }
.ml-memo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-memo-row label { font-size: 12px; color: var(--ink-soft); width: 64px; flex-shrink: 0; }
.ml-memo-row input, .ml-memo-row textarea { flex: 1; border: 1px solid #ddd; border-radius: 6px; padding: 4px 8px; font-size: 13px; font-family: inherit; }
.ml-memo-row textarea { min-height: 48px; resize: vertical; }
.ml-report-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ───────────────── 학습 진단서/상담서 출력 뷰 ───────────────── */
.math-report-overlay { min-height: 100vh; background: #f5f3ef; padding: 20px; }
.rpt-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.rpt-paper { background: #fff; max-width: 720px; margin: 0 auto; padding: 40px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.10); }
.rpt-header { text-align: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid #168b8f; }
.rpt-header-logo { font-size: 13px; font-weight: 800; color: #168b8f; letter-spacing: 0.05em; margin-bottom: 6px; }
.rpt-header h2 { font-size: 24px; margin: 4px 0; }
.rpt-header-meta { display: flex; justify-content: center; gap: 20px; font-size: 13px; color: #555; margin-top: 8px; flex-wrap: wrap; }
.rpt-section { margin-bottom: 24px; }
.rpt-section h3 { font-size: 15px; color: #168b8f; border-left: 4px solid #168b8f; padding-left: 10px; margin-bottom: 12px; }
.rpt-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rpt-stat { background: #f8fcfc; border: 1px solid #b2dfdf; border-radius: 8px; padding: 12px; text-align: center; }
.rpt-stat span { display: block; font-size: 11px; color: #555; margin-bottom: 4px; }
.rpt-stat strong { font-size: 20px; color: #168b8f; }
.rpt-stat.level.ml-advanced strong { color: #166534; }
.rpt-stat.level.ml-stable strong   { color: #854d0e; }
.rpt-stat.level.ml-basic strong    { color: #9a3412; }
.rpt-stat.level.ml-weak strong     { color: #991b1b; }
.rpt-unit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-unit-table th { background: #f0fafb; padding: 7px 10px; border: 1px solid #c8e6e8; font-size: 12px; }
.rpt-unit-table td { padding: 6px 10px; border: 1px solid #e8f0f0; }
.rpt-diagnosis-list, .rpt-parent-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rpt-diagnosis-list li, .rpt-parent-list li { padding: 8px 12px; background: #f8fcfc; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.rpt-memo-text { padding: 10px 14px; background: #fffbf0; border-left: 3px solid #f59e0b; border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.6; }
.rpt-footer { margin-top: 28px; padding-top: 12px; border-top: 1px solid #e0e0e0; text-align: center; font-size: 11px; color: #aaa; }

@media print {
  .no-print { display: none !important; }
  .math-report-overlay { background: #fff; padding: 0; }
  .rpt-paper { box-shadow: none; border-radius: 0; max-width: 100%; padding: 20px; }
  @page { margin: 15mm; }
}

@media (max-width: 600px) {
  .rpt-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .ml-card-head { flex-direction: column; }
}


/* ── 아카데미 학습현황 탭 ── */
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ap-card { background: var(--card-bg); border: 1.5px solid #e0e8f0; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ap-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ap-card-head strong { font-size: 15px; }
.ap-bar-wrap { height: 8px; background: #e8eff4; border-radius: 4px; overflow: hidden; }
.ap-bar-fill { height: 100%; background: linear-gradient(90deg,#4caf86,#3b82f6); border-radius: 4px; transition: width .3s; min-width: 2px; }
.ap-card-stats { display: flex; gap: 10px; font-size: 12px; color: #6b7280; }
.ap-subjects { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-subject-chip { font-size: 11px; padding: 2px 8px; background: #f0f4ff; color: #3b5bdb; border-radius: 10px; }
.ap-no-sub { font-size: 12px; color: #aaa; margin: 0; }

/* ── 출석관리 탭 ── */
.att-table-wrap { overflow-x: auto; }
.att-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.att-table th { padding: 8px 10px; background: #f0f4f8; border: 1px solid #dde4ec; text-align: center; font-size: 12px; font-weight: 700; }
.att-table td { padding: 6px 8px; border: 1px solid #eef1f5; text-align: center; vertical-align: middle; }
.att-table .att-today { background: #e8f4fd; color: #1a6ea8; }
.att-name { text-align: left !important; min-width: 90px; }
.att-name strong { display: block; }
.att-name small { color: #888; font-size: 11px; }
.att-cell { min-width: 78px; }
.att-btn-group { display: flex; gap: 3px; justify-content: center; }
.att-btn { padding: 3px 7px; border: 1.5px solid #ccc; border-radius: 5px; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: .12s; }
.att-btn.att-o.active { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.att-btn.att-t.active { background: #fef9c3; border-color: #ca8a04; color: #92400e; }
.att-btn.att-x.active { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }
.att-btn:hover { opacity: .8; }

/* ── 학습 스케줄 탭 ── */
.sch-table-wrap { overflow-x: auto; }
.sch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sch-table th { padding: 8px 10px; background: #f5f0ff; border: 1px solid #e0d9f5; text-align: center; font-size: 12px; font-weight: 700; }
.sch-table td { padding: 7px 10px; border: 1px solid #ede9f8; text-align: center; vertical-align: middle; }
.sch-day-cell { min-width: 34px; color: #d1d5db; }
.sch-day-on { color: #6d28d9; font-weight: 900; font-size: 15px; background: #ede9fe; }
.sch-memo { text-align: left !important; font-size: 12px; color: #6b7280; max-width: 200px; }


/* ── 연산 학습현황 카드형 확장 스타일 ── */
.ml-ap-card { cursor: default; }
.ml-ap-expanded { border-color: #7c3aed; box-shadow: 0 0 0 2px #ede9fe; }
.ap-bar-fill.ml-bar-color-ml-advanced { background: linear-gradient(90deg,#16a34a,#4ade80); }
.ap-bar-fill.ml-bar-color-ml-stable   { background: linear-gradient(90deg,#ca8a04,#fbbf24); }
.ap-bar-fill.ml-bar-color-ml-basic    { background: linear-gradient(90deg,#ea580c,#fb923c); }
.ap-bar-fill.ml-bar-color-ml-weak     { background: linear-gradient(90deg,#dc2626,#f87171); }
.ap-bar-fill.ml-bar-color-none        { background: #d1d5db; }
.ml-unit-chip { font-size: 11px !important; }
.ml-unit-chip.ml-advanced { background: #dcfce7 !important; color: #166534 !important; }
.ml-unit-chip.ml-stable   { background: #fef9c3 !important; color: #854d0e !important; }
.ml-unit-chip.ml-basic    { background: #ffedd5 !important; color: #9a3412 !important; }
.ml-unit-chip.ml-weak     { background: #fee2e2 !important; color: #991b1b !important; }
.ml-expand-btn { width: 100%; margin-top: 8px; padding: 5px; border: 1.5px dashed #c4b5fd; border-radius: 7px; background: transparent; color: #7c3aed; font-size: 12px; font-weight: 700; cursor: pointer; transition: .12s; }
.ml-expand-btn:hover { background: #f5f3ff; }
.ml-expand-body { margin-top: 12px; border-top: 1.5px solid #ede9fe; padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }

/* ── 아카데미 학습현황 확장 스탯 ── */
.ap-expand-stats { display: flex; gap: 16px; padding: 10px 0 0; flex-wrap: wrap; }
.ap-stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 60px; }
.ap-stat-item span { font-size: 11px; color: #6b7280; }
.ap-stat-item strong { font-size: 16px; font-weight: 900; color: #1e293b; }
.ap-presence { padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.ap-presence.is-online { background: #dcfce7; color: #15803d; }
.ap-presence.is-offline { background: #f1f5f9; color: #64748b; }
.ap-activity-list { padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.ap-activity-list > strong { color: #1e293b; font-size: 13px; }
.ap-activity-list ol { display: grid; gap: 6px; margin: 9px 0 0; padding-left: 20px; }
.ap-activity-list li { color: #475569; font-size: 12px; }
.ap-activity-list li span { display: block; color: #1e293b; font-weight: 700; }
.ap-activity-list time { color: #64748b; font-size: 11px; }
.ap-card-stats { flex-wrap: wrap; }


/* ── 출석관리 달력 ── */
.att-cal-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.att-cal-title { font-size: 17px; font-weight: 900; min-width: 90px; text-align: center; }
.att-nav-btn { padding: 4px 12px; border: 1.5px solid #d1d5db; border-radius: 7px; background: #fff; font-size: 14px; cursor: pointer; transition: .12s; }
.att-nav-btn:hover { background: #f3f4f6; }
.att-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; margin-left: auto; }
.att-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.att-dot-auto { background: #16a34a; }
.att-dot-manual { background: #3b82f6; }
.att-cal-table { min-width: max-content; }
.att-name-th { min-width: 90px; }
.att-cal-table th { min-width: 28px; padding: 5px 3px; font-size: 11px; }
.att-cal-table td { padding: 3px 2px; }
.att-sun { color: #dc2626; background: #fff5f5; }
.att-sat { color: #2563eb; background: #eff6ff; }
.att-auto-cell { background: #f0fdf4; }
.att-auto-mark { display: block; color: #16a34a; font-size: 15px; font-weight: 900; text-align: center; line-height: 24px; }
.att-mark-btn { width: 24px; height: 24px; border: none; border-radius: 5px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; transition: .1s; display: block; margin: 0 auto; }
.att-mark-btn:hover { background: #f3f4f6; }
.att-mark-empty { color: #d1d5db; }
.att-mark-o { background: #dcfce7 !important; color: #15803d; }
.att-mark-t { background: #fef9c3 !important; color: #92400e; }
.att-mark-x { background: #fee2e2 !important; color: #b91c1c; }


/* ── 과목·단원별 게이지 바 ── */
.gb-list { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 4px; }
.gb-row { display: grid; grid-template-columns: minmax(80px, 130px) 1fr auto; align-items: center; gap: 8px; }
.gb-label { font-size: 12px; font-weight: 700; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-bar-wrap { position: relative; height: 14px; background: #e9ecef; border-radius: 8px; overflow: hidden; }
.gb-bar-fill { height: 100%; border-radius: 8px; transition: width .4s ease; min-width: 2px; }
.gb-pct { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 900; color: #fff; mix-blend-mode: multiply; filter: invert(1); pointer-events: none; }
.gb-extra { font-size: 11px; color: #6b7280; white-space: nowrap; }
/* 게이지 색상 */
.gb-fill-ml-advanced { background: linear-gradient(90deg,#16a34a,#4ade80); }
.gb-fill-ml-stable   { background: linear-gradient(90deg,#ca8a04,#fbbf24); }
.gb-fill-ml-basic    { background: linear-gradient(90deg,#ea580c,#fb923c); }
.gb-fill-ml-weak     { background: linear-gradient(90deg,#dc2626,#f87171); }
.gb-fill-none        { background: #d1d5db; }

/* ── 카카오 기존 계정 연결 ── */
.kakao-link-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: #9ca3af;
  font-size: 0.82rem;
}
.kakao-link-divider::before,
.kakao-link-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #e5e7eb;
}
.kakao-link-desc { font-size: 0.83rem; color: #6b7280; margin: 4px 0 10px; line-height: 1.5; }
.kakao-link-form { margin-top: 4px; }
.kakao-link-form label { display: flex; flex-direction: column; gap: 3px; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.kakao-link-form input { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; }

/* ── 카카오 로그인 ── */
.kakao-login-btn {
  background: #FEE500;
  color: #3A1D1D;
  border-color: #e6cf00;
  font-weight: 700;
}
.kakao-login-btn:hover {
  background: #e6cf00;
  border-color: #ccb700;
}
.kakao-signup-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFDE7;
  border: 1px solid #FEE500;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: #3A1D1D;
}
.kakao-profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
/* ── 내 정보 수정 버튼 ── */
.portal-edit-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  margin-right: 4px;
}
.portal-edit-btn:hover { background: #e5e7eb; }
/* ── 내 정보 수정 오버레이 ── */
.profile-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.profile-edit-panel {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px 20px;
  width: min(480px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.profile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.profile-edit-header h3 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.profile-edit-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #6b7280;
  padding: 2px 6px;
}
.profile-edit-close:hover { color: #111; }
/* ── 카카오 회원관리 버튼 ── */
.kakao-mgmt-btn { background: #fffde7; color: #92400e; border-color: #fbbf24; }
.kakao-mgmt-btn:hover, .kakao-mgmt-btn.is-active { background: #fef3c7; border-color: #f59e0b; }
/* ── 카카오 회원관리 패널 ── */
.kakao-mgmt-panel { width: min(640px, 96vw); }
.kakao-mgmt-summary { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kakao-mgmt-summary span { background: #f3f4f6; border-radius: 20px; padding: 4px 12px; font-size: 0.82rem; color: #374151; }
.kakao-section-title { font-size: 0.95rem; font-weight: 700; margin: 16px 0 8px; color: #1e1b4b; border-left: 3px solid #FEE500; padding-left: 8px; }
.kakao-member-list { display: flex; flex-direction: column; gap: 6px; }
.kakao-member-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fafafa; border: 1px solid #e5e7eb; border-radius: 8px; }
.kakao-member-row.editing { flex-direction: column; align-items: stretch; background: #fffde7; border-color: #fde68a; }
.kakao-profile-placeholder { width: 36px; height: 36px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.kakao-member-info { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kakao-member-info strong { font-size: 0.92rem; }
.kakao-member-badge { background: #dbeafe; color: #1d4ed8; border-radius: 10px; padding: 1px 7px; font-size: 0.75rem; font-weight: 600; }
.kakao-member-meta { color: #6b7280; font-size: 0.8rem; }
.kakao-member-kakao { color: #9ca3af; font-size: 0.75rem; white-space: nowrap; }
.kakao-member-edit-form { width: 100%; }
.kakao-member-edit-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.kakao-member-edit-row label { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; font-weight: 600; flex: 1; min-width: 120px; }
.kakao-member-edit-row input, .kakao-member-edit-row select { padding: 4px 7px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════
   꿈쟁이 자기주도학습 슬라이드 패널
   ═══════════════════════════════════════════════════════ */

/* 오버레이 (패널 외부 클릭 영역) */
#fivecore-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 8998;
  backdrop-filter: blur(1px);
}
#fivecore-panel-overlay.fivecore-panel-overlay--open {
  display: block;
}

/* 토글 버튼 — 화면 오른쪽, 가로 줄바꿈 텍스트, 클릭 시 듀얼모드 */
#fivecore-panel-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8999;
  background: linear-gradient(160deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 12px 0 0 12px;
  padding: 14px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
  letter-spacing: -0.2px;
  box-shadow: -3px 0 12px rgba(37, 99, 235, 0.35);
  transition: padding-right 0.2s, box-shadow 0.2s;
  writing-mode: horizontal-tb;
  max-width: 52px;
}
#fivecore-panel-toggle:hover {
  padding-right: 16px;
  box-shadow: -5px 0 18px rgba(37, 99, 235, 0.5);
}

/* 패널 본체 */
#fivecore-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  background: #ffffff;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0, 0.15, 1);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#fivecore-panel.fivecore-panel--open {
  transform: translateX(0);
}

/* 헤더 */
#fivecore-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
  color: #ffffff;
}
#fivecore-panel-header h2 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
#fivecore-panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
#fivecore-panel-close:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* 탭 바 */
#fivecore-panel-tabs {
  flex-shrink: 0;
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.fivecore-panel-tab {
  flex: 1;
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  color: #64748b;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.fivecore-panel-tab:hover {
  background: #f1f5f9;
  color: #334155;
}
.fivecore-panel-tab.fivecore-panel-tab--active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #ffffff;
}

/* iframe */
#fivecore-panel-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: #f8fafc;
}

/* 꿈쟁이 홈 바로가기 버튼 바 */
.fivecore-shortcut-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
  border-top: 1px solid #f1f5f9;
  margin-top: 8px;
}
.fivecore-shortcut-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
}
.fivecore-shortcut-btn:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
  transform: translateY(-1px);
}
.fivecore-shortcut-btn:active {
  transform: scale(0.97);
}

/* ═══════════════════════════════════════════════
   듀얼 화면 모드 — 꿈쟁이 자기주도학습 모바일 최적화
   body.fivecore-dual-mode 클래스로 활성화
═══════════════════════════════════════════════ */

/* 메인 콘텐츠 영역 — 오른쪽 패널 너비만큼 여백 확보 */
body.fivecore-dual-mode #app-root {
  margin-right: 400px;
  transition: margin-right 0.32s cubic-bezier(0.32, 0, 0.15, 1);
}

/* 듀얼 모드 패널 — 모바일 화면 너비로 고정 (iPhone 크기 기준) */
body.fivecore-dual-mode #fivecore-panel {
  width: 400px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
  border-left: 2px solid #c7d2fe;
  background: #eef2ff;
}

/* 듀얼 모드에서 iframe — 모바일 뷰포트처럼 전체 너비 사용 */
body.fivecore-dual-mode #fivecore-panel-iframe {
  width: 100%;
  min-width: 0;
  background: #ffffff;
}

/* 듀얼 모드에서 헤더 타이틀 크기 조정 */
body.fivecore-dual-mode #fivecore-panel-header h2 {
  font-size: 13px;
}

/* 듀얼 모드에서 탭 버튼 크기 최적화 */
body.fivecore-dual-mode .fivecore-panel-tab {
  font-size: 11px;
  padding: 8px 2px;
}

/* 듀얼 모드에서 오버레이·토글버튼 숨기기 */
body.fivecore-dual-mode #fivecore-panel-overlay,
body.fivecore-dual-mode #fivecore-panel-toggle {
  display: none !important;
}

/* 듀얼 모드에서 닫기 버튼 비활성화 표시 */
body.fivecore-dual-mode #fivecore-panel-close {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* 듀얼 모드 토글 버튼 (헤더 내) */
#fivecore-dual-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  margin-left: auto;
  white-space: nowrap;
}
#fivecore-dual-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}
#fivecore-dual-btn.fivecore-dual-btn--active {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* 현재 학습 컨텍스트 배너 (패널 헤더 아래) */
#fivecore-context-bar {
  flex-shrink: 0;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  font-size: 11px;
  color: #92400e;
  font-weight: 600;
}
#fivecore-context-bar.fivecore-context-bar--visible {
  display: flex;
}
#fivecore-context-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 반응형: 화면이 좁을 때 듀얼 모드 비율 조정 */
@media (max-width: 1100px) {
  body.fivecore-dual-mode #app-root {
    margin-right: 360px;
  }
  body.fivecore-dual-mode #fivecore-panel {
    width: 360px;
    min-width: 300px;
    max-width: 360px;
  }
}
@media (max-width: 900px) {
  body.fivecore-dual-mode #app-root {
    margin-right: 44vw;
  }
  body.fivecore-dual-mode #fivecore-panel {
    width: 44vw;
    min-width: 260px;
    max-width: none;
  }
}
@media (max-width: 640px) {
  body.fivecore-dual-mode #app-root {
    margin-right: 0;
  }
  body.fivecore-dual-mode #fivecore-panel {
    width: 100vw;
    min-width: 0;
    max-width: none;
  }
}
