/* 유치원 학습 놀이터 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; }

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.academy-link {
  border-color: #7fb9ff;
  background: #edf7ff;
  color: #165a93;
}

.portal-login-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.portal-login-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid #ead7bf;
  font-size: inherit;
  font-family: inherit;
  width: 100px;
  background: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(64, 50, 30, 0.08);
}
.portal-login-form button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: inherit;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(64, 50, 30, 0.08);
}
.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-meta.status-approved { color: #257a35; }
.credential-meta.status-pending { color: #a15c00; }
.credential-meta.status-suspended,
.credential-meta.status-blocked { color: #b42318; }

.credential-admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.credential-admin-summary span {
  background: rgba(255, 248, 238, 0.9);
  border: 1px solid rgba(125, 92, 55, 0.12);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.credential-progress-map {
  display: grid;
  gap: 5px;
}

.credential-progress-map small {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

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

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

.credential-form.admin-account-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.credential-form .wide {
  grid-column: 1 / -1;
}

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

.credential-form input,
.credential-form select,
.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;
}

.permission-box {
  border: 2px dashed rgba(91, 75, 183, 0.18);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.permission-box legend {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 0 4px;
}

.permission-box label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.permission-box input {
  width: auto;
}

.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: 380px; }
.three-scene.classroom { height: 330px; }
.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: 330px; }
  .three-scene.classroom { height: 280px; }
  .three-scene.quiz { height: 200px; }
  .three-scene.teacher-monitor { height: clamp(180px, 45vw, 300px); }
  .student-monitor-list { grid-template-columns: 1fr; }
}

/* ── 클래스 삭제 버튼 ── */
.class-chip-wrapper {
  display: inline-flex; align-items: center; gap: 2px;
}
.class-chip-delete {
  background: #ef4444; color: #fff; border: none; border-radius: 99px;
  width: 20px; height: 20px; font-size: 10px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0.8;
}
.class-chip-delete:hover { opacity: 1; }

/* ── 학생 모니터 카드 액션 버튼 ── */
.student-monitor-actions {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.mini-action.report-action {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
}

/* ── 꿈쟁이 리틀 AI 학생 진단 리포트 ── */
.kinder-student-report {
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.kinder-student-report .report-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px;
}
.kinder-student-report .report-card {
  background: #fff; border-radius: 12px; padding: 14px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 4px;
}
.kinder-student-report .report-card span { font-size: 12px; color: #888; }
.kinder-student-report .report-card strong { font-size: 22px; font-weight: 800; color: #4f46e5; }
.kinder-student-report .report-section {
  background: #f8f5ff; border-radius: 12px; padding: 14px;
}
.kinder-student-report .report-section h3 { margin: 0 0 8px; }
.kinder-student-report .report-diagnosis-list,
.kinder-student-report .report-parent-list {
  padding-left: 18px; display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0;
}
.kinder-student-report .report-footer {
  border-top: 1px solid #e0d9ff; padding-top: 12px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.kinder-student-report .report-footer p {
  flex: 1; color: #888; font-size: 12px; margin: 0;
}

/* ── 교사 센터 탭 UI ─────────────────────────────────── */
.tc-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tc-tab-nav {
  display: flex;
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
}
.tc-tab {
  flex: 1;
  min-width: 110px;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tc-tab.active {
  background: #fff;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}
.tc-tab-panel {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tc-class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tc-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s;
}
.tc-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 학생 관리 탭 */
.tc-student-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-student-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tc-student-card.disabled {
  opacity: 0.6;
  background: #f8fafc;
}
.tc-student-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tc-student-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tc-student-identity strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.tc-badge {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.tc-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.tc-tag.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.tc-student-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tc-student-meta {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: #64748b;
  flex-wrap: wrap;
}
.tc-student-meta span {
  font-weight: 600;
}

/* 인라인 편집 폼 */
.tc-edit-form {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tc-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.tc-edit-grid label span {
  font-weight: 700;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}
.tc-edit-grid input,
.tc-edit-grid select {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  font-size: 14px;
  font-family: inherit;
}

/* 학생 등록 / 클래스 등록 폼 */
.tc-add-form,
.tc-class-add-panel {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tc-add-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tc-add-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.tc-add-grid label span {
  font-weight: 700;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}
.tc-add-grid input,
.tc-add-grid select {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  font-size: 14px;
  font-family: inherit;
}

/* 클래스 관리 탭 */
.tc-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tc-class-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tc-class-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-rename-form {
  display: flex;
  gap: 6px;
  flex: 1;
}
.tc-rename-form input {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  font-size: 14px;
  font-family: inherit;
}
.tc-class-student-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tc-class-student-list li {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.mini-action.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.mini-action.danger:hover {
  background: #b91c1c;
  color: #fff;
}

/* ── 수강관리 탭 ── */
.tc-enrollment-list { display: flex; flex-direction: column; gap: 12px; }
.tc-enrollment-card { background: #fff; border-radius: 12px; border: 1.5px solid #e2e8f0; 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: #64748b; 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: #334155; }

/* ── 수강 등록 배너 ── */
.enrollment-banner { background: linear-gradient(135deg, #fef3c7, #fde68a); border: 2px solid #f59e0b; border-radius: 16px; padding: 20px 24px; margin: 1rem 0; text-align: center; }
.enrollment-banner-msg { font-size: 15px; font-weight: 700; color: #92400e; margin-bottom: 12px; }

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

/* ── 인증 패널 개선 (2026-05-28) ── */
.auth-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-login-section,
.auth-signup-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.auth-section-label {
  width: 100%;
  font-size: 13px;
  color: #888;
  margin: 0 0 4px;
  font-weight: 700;
}

.auth-no-account-note {
  font-size: 13px;
  color: #c0392b;
  margin: 4px 0;
}

.auth-note {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

.mini-action.signup-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
}

.mini-action.signup-btn:hover { opacity: 0.88; }

.login-submit-btn {
  background: #168b8f;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
}

.login-submit-btn:hover { opacity: 0.88; }

.portal-logged-info span { font-size: 13px; font-weight: 700; }

.auth-quick-panel { flex-direction: column; align-items: stretch; }

.tc-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.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; }

/* ═══════════════════════════════════════════
   5차원 자기주도학습 슬라이드/듀얼 패널
═══════════════════════════════════════════ */

#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;
}

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

#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;
}

/* 듀얼 화면 모드 */
body.fivecore-dual-mode #app-root {
  max-width: none;
  margin-left: 0;
  margin-right: 30vw;
  transition: margin-right 0.32s cubic-bezier(0.32, 0, 0.15, 1);
}
body.fivecore-dual-mode #fivecore-panel {
  width: 30vw;
  min-width: 300px;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.10);
  border-left: 1px solid #e2e8f0;
}
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;
}

@media (max-width: 900px) {
  body.fivecore-dual-mode #app-root { margin-right: 40vw; }
  body.fivecore-dual-mode #fivecore-panel { width: 40vw; min-width: 260px; }
}
@media (max-width: 640px) {
  body.fivecore-dual-mode #app-root { margin-right: 50vw; }
  body.fivecore-dual-mode #fivecore-panel { width: 50vw; min-width: 220px; }
}
.math-site-btn:hover { background: #1d4ed8; }
