/* 화면 크기에 따라 기본 폰트 크기를 조절하여 반응형 UI의 기반을 마련합니다. */
html {
  font-size: 14px;
  /* Windows 브라우저 호환성을 위한 추가 설정 */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Mantine breakpoint 기반 반응형 폰트 크기 */
@media (max-width: 74em) {
  html {
    font-size: 13px;
  }
}

/* lg 이하 */
@media (max-width: 64em) {
  html {
    font-size: 12px;
  }
}

/* md 이하 */
@media (max-width: 48em) {
  html {
    font-size: 11px;
  }
}

/* sm 이하 (모바일) */

:root {
  /* ========================================
     Mantine 스타일 Breakpoint 시스템 (em 단위)
     ======================================== */
  --breakpoint-xs: 30em;
  /* 480px @ 16px base */
  --breakpoint-sm: 48em;
  /* 768px */
  --breakpoint-md: 64em;
  /* 1024px */
  --breakpoint-lg: 74em;
  /* 1184px */
  --breakpoint-xl: 90em;
  /* 1440px */

  /* 반응형 Spacing (Mantine 패턴) */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  /* Modern Colour Palette */
  --bg-light: #F8FAFC;
  /* Cool Gray for background */
  --sidebar-bg: #FFFFFF;
  --main-bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --input-bg: #F1F5F9;
  --ink: #0F172A;
  /* Slate 900 for primary text */
  --ink-muted: #64748B;
  /* Slate 500 */

  /* Accent: Vibrant Modern Blue (Inter Blue / Tailwind Blue-600) */
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  /* Darker shade for hover */
  --accent-light: #EFF6FF;
  /* Very light blue for backgrounds */
  --accent-fg: #FFFFFF;

  --line: #E2E8F0;
  /* Slate 200 */
  --focus: #2563EB;

  /* Status Colors */
  --win: #10B981;
  /* Emerald */
  --lose: #EF4444;
  /* Red */
  --draw: #F59E0B;
  /* Amber */

  /* Shadows (Soft & Diffused) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Tournament Bracket Colors (Updated transparency) */
  --completed-r0: rgba(255, 215, 0, 0.15);
  --completed-r0-border: rgba(204, 164, 0, 0.5);
  --completed-r1: rgba(192, 192, 192, 0.15);
  --completed-r1-border: rgba(153, 153, 153, 0.5);
  --completed-r2: rgba(205, 127, 50, 0.15);
  --completed-r2-border: rgba(164, 102, 40, 0.5);
  --completed-r3: rgba(37, 99, 235, 0.1);
  --completed-r3-border: rgba(37, 99, 235, 0.4);
  --completed-r4: rgba(139, 92, 246, 0.1);
  --completed-r4-border: rgba(139, 92, 246, 0.4);
}

body[data-theme="dark"] {
  --bg-light: #0F172A;
  /* Slate 900 */
  --sidebar-bg: #1E293B;
  /* Slate 800 */
  --main-bg: #0F172A;
  --card-bg: #1E293B;
  --input-bg: #334155;
  /* Slate 700 */
  --ink: #F1F5F9;
  /* Slate 100 */
  --ink-muted: #94A3B8;
  /* Slate 400 */

  --accent: #3B82F6;
  /* Blue 500 (Brighter for dark mode) */
  --accent-hover: #60A5FA;
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-fg: #FFFFFF;

  --line: #334155;
  /* Slate 700 */
  --focus: #3B82F6;

  --win: #34D399;
  --lose: #F87171;
  --draw: #FBBF24;
}

/* ========================================
   접근성 (A11y) 스타일
   ======================================== */

/* 스크린 리더 전용 텍스트 (시각적으로는 숨김, 스크린 리더에서는 읽힘) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 키보드 포커스 표시 개선 - WCAG 2.1 AA 기준 준수 */
*:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(25, 113, 194, 0.2);
}

/* 마우스로 클릭한 경우에는 포커스 링 제거 (선택적) */
*:focus:not(:focus-visible) {
  outline: none;
}

/* 색상 대비 개선 - WCAG AA 기준 (4.5:1 이상) */
/* 버튼 텍스트 대비 확인 및 개선 */


.btn.primary {
  background-color: var(--accent);
  color: var(--accent-fg);
  /* 대비: #ffffff on #1971c2 = 8.59:1 (AAA) */
}

/* 링크 색상 대비 개선 */
a {
  color: var(--accent);
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* 에러 메시지 색상 대비 개선 */
.error-message {
  color: var(--lose);
  /* 대비: #e03131 on white = 4.78:1 (AA) */
}

body[data-theme="dark"] .error-message {
  color: var(--lose);
  /* 대비: #ef5350 on #121212 = 6.41:1 (AA) */
}

/* 성공 메시지 */
.success-message {
  color: var(--win);
  /* 대비: #2f9e44 on white = 4.88:1 (AA) */
}

body[data-theme="dark"] .success-message {
  color: var(--win);
  /* 대비: #66bb6a on #121212 = 5.87:1 (AA) */
}

/* 입력 필드 포커스 대비 개선 */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(25, 113, 194, 0.2);
}

/* 스킵 링크 (접근성 향상) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* 모달 배경 스크린 리더 접근성 */


/* aria-hidden 요소는 시각적으로도 숨김 (일관성) */


/* 로딩 상태 접근성 */


/* 테이블 접근성 */


/* 버튼 그룹 접근성 */


/* 탭 인터페이스 접근성 */
[role="tablist"] [role="tab"] {
  cursor: pointer;
}





/* Skip to main content 링크 (추가 개선) */
#skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}

#skip-to-main:focus {
  top: 0;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background: var(--bg-light);
  font-size: 1rem;
  /* rem 단위로 변경 */
  transition: background-color .2s, color .2s;
  display: -webkit-box;
  /* Safari 6.1+ */
  display: -ms-flexbox;
  /* IE 10 */
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: rgba(37, 99, 235, 0.95);
  /* Modern Blue with slight transp */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 2000;
  position: sticky;
  top: 0;
  color: white;
  /* Default text color in header */
  overflow: visible;
}

body[data-theme="dark"] .top-bar {
  background-color: rgba(15, 23, 42, 0.95);
  /* Keep Slate for dark mode or match blue? Usually dark mode headers are dark. Let's keep dark slate for visual comfort */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  /* White text on Blue header */
}

/* P.ⓔ Helper 브랜드 로고 스타일 (나노바나나 컨셉) */
.brand-logo .logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: white;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand-logo .logo-e-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #FFD700;
  /* 바나나 옐로우 (프리미엄 골드) */
  color: #1971C2;
  /* 대비를 위한 메인 블루 */
  border-radius: 50%;
  font-family: 'Bagel Fat One', cursive;
  font-size: 0.8em;
  margin: 0 1px;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
  transform: translateY(-1px);
  position: relative;
  line-height: 1;
  padding-bottom: 2px;
  /* ⓔ 기호 정렬 조정 */
}

/* 로그인 화면에서의 로고 스타일 */
.auth-box .brand-logo .logo-text {
  color: var(--ink);
  font-size: 1.8rem;
  justify-content: center;
}

.auth-box .brand-logo .logo-e-circle {
  width: 30px;
  height: 30px;
  font-size: 0.85em;
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.top-bar h1 svg {
  color: white;
  /* White icon */
  width: 24px;
  height: 24px;
}

.top-bar h1 .version {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  /* Blue text */
  background-color: white;
  /* White badge */
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 4px;
}

.app-container {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* 사이드바가 접힌 상태에서 app-container 조정 */
.app-container.sidebar-collapsed {
  /* 메인 콘텐츠가 전체 너비를 차지하도록 조정 */
  flex-direction: row;
}

/* 사이드바 기본 스타일 */
.sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s ease,
    opacity 0.2s ease,
    transform 0.3s ease;
  position: relative;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Modern clean scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border-radius: 3px;
}

/* 사이드바 토글 버튼 (상단바용) */
.top-bar-toggle {
  background: rgba(255, 255, 255, 0.1) !important;
  border: none !important;
  color: white !important;
  padding: 8px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.top-bar-toggle:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px);
}

.top-bar-toggle svg {
  transition: transform 0.3s ease;
}

/* 사이드바가 닫혀있을 때 아이콘 효과 (선택 사항) */
/* .sidebar.collapsed~.main-content .top-bar-toggle svg { ... } */

/* 사이드바 접힘 상태 */
.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* 게시판 모드에서 사이드바 숨김 */
.board-mode .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.board-mode .sidebar-overlay {
  display: none !important;
}

/* 수업 진도표 모드에서 사이드바 패딩 조정 */
.progress-mode .sidebar {
  padding: 24px 24px 0 24px;
  gap: 0;
}

/* progress-mode에서도 토글 기능이 작동하도록 조정 */
.progress-mode .sidebar.collapsed {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.main-view {
  padding: 24px;
  flex-grow: 1;
}

.sidebar-header {
  font-size: 1.5rem;
  margin: 0 0 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header svg {
  color: var(--accent);
}

#sidebar-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Progress 모드가 아닐 때는 sidebar-list-container를 항상 표시 */
body:not(.progress-mode) #sidebar-list-container {
  display: flex !important;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  transition: .2s;
}

/* 아이콘 크기를 폰트 크기에 비례하도록 em 단위로 수정 */
.btn svg {
  width: 1.15em;
  height: 1.15em;
}

.btn:hover {
  border-color: var(--ink-muted);
  background: var(--input-bg);
}

.btn.primary,
.btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent)
}

.btn.primary:hover,
.btn.active:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed
}

/* 상단바 버튼 스타일 */
/* 상단바 버튼 스타일 - Modern Blue Header Adapt */
.top-bar .btn {
  background: rgba(255, 255, 255, 0.1);
  /* Slight white tint */
  color: rgba(255, 255, 255, 0.9);
  /* White text */
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

.top-bar .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  /* Stronger white on hover */
  color: white;
  transform: translateY(-1px);
}

body[data-theme="dark"] .top-bar .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.top-bar .btn.active {
  background: white;
  color: var(--accent);
  /* Blue text on white btn */
  border: 1px solid white;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body[data-theme="dark"] .top-bar .btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent);
  border-color: transparent;
}

.top-bar .btn.active:hover {
  background: white;
  color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.top-bar .btn svg {
  color: inherit;
}

.top-bar .btn.active svg {
  color: #1565c0;
}

/* 모드 전환 버튼 특별 스타일 */
.top-bar .mode-switch-btn {
  position: relative;
  overflow: hidden;
  padding: 6px 8px;
  gap: 4px;
}

#top-bar-actions.row {
  gap: 4px;
}

.top-bar .mode-switch-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
  z-index: -1;
}

.top-bar .mode-switch-btn.active {
  position: relative;
  z-index: 1;
}

/* 활성 버튼에 애니메이션 효과 */
.top-bar .btn.active {
  animation: activePulse 2s infinite ease-in-out;
}

@keyframes activePulse {

  0%,
  100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.4);
  }
}

/* 상단바 사용자 프로필 영역 */
.top-bar #user-email {
  color: white;
  font-weight: 500;
}

.top-bar #logout-btn {
  background: white;
  color: var(--accent);
  border: 1px solid white;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.top-bar #logout-btn:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

body[data-theme="dark"] .top-bar #logout-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .top-bar #logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn.danger {
  background-color: var(--lose);
  color: white;
  border-color: var(--lose);
}

.field {
  margin-bottom: 8px
}

.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 6px
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 1rem;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--focus);
  border-color: var(--focus);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.theme-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 0;
}

.theme-toggle:hover {
  background: var(--input-bg);
}

/* 상단바 테마 토글 버튼 */
.top-bar .theme-toggle {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.top-bar .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.top-bar .theme-toggle svg {
  color: white;
}

body[data-theme="dark"] .sun-icon {
  display: block;
}

body[data-theme="dark"] .moon-icon {
  display: none;
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

.placeholder-view {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-muted);
  height: 100%;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.placeholder-content svg {
  width: 4.5em;
  height: 4.5em;
}

.placeholder-content h3 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--ink);
}

.list-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color .2s, border-color .2s;
}

.list-card:hover {
  background: var(--input-bg);
}

.list-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.list-card .name {
  font-weight: 600;
}

.list-card .details {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.hidden {
  display: none !important;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #212529;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 300px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 9999;
  margin-top: 12px;
}

/* 왼쪽 정렬 (왼쪽 가장자리 버튼용) */
[data-tooltip-align="left"]::after {
  left: 0;
  transform: translateX(0);
}

/* 오른쪽 정렬 (오른쪽 가장자리 버튼용) */
[data-tooltip-align="right"]::after {
  left: auto;
  right: 0;
  transform: translateX(0);
}

/* 위쪽에 표시 (하단 가장자리 버튼용) */
[data-tooltip-position="top"]::after {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 12px;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
}

.section-box {
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Card styles */
.card {
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-light);
  border-radius: 0.5rem 0.5rem 0 0;
}

.card-body {
  padding: 1.5rem;
}

/* 리그전 수업 모드에서 평면 스타일 적용 */
.league-mode .section-box {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 2rem;
}

/* 리그전 수업 모드에서 경기 일정과 순위표 컨테이너도 평면 스타일 적용 */
.league-mode #gamesTableContainer,
.league-mode #rankingsTableContainer {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0 -24px;
}

.league-mode .paps-table-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
}

/* PAPS 수업 모드에서 평면 스타일 적용 */
.paps-mode .section-box {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 2rem;
}

.paps-mode .paps-table-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow-x: auto;
}

/* PAPS 모드에서 테이블이 화면에 맞도록 추가 조정 */
.paps-mode #paps-record-table {
  font-size: 0.8rem;
}

.paps-mode #paps-record-table th {
  font-size: 0.75rem;
  padding: 0.3rem 0.15rem;
}

.paps-mode #paps-record-table .paps-input {
  font-size: 0.9rem;
  padding: 0.1rem 0.2rem;
  max-width: 45px;
}

.paps-mode #paps-record-table .paps-input.name {
  max-width: 55px;
}

.paps-mode #paps-record-table .paps-input.number {
  max-width: 35px;
}

.paps-mode #paps-record-table .paps-input.rec,
.paps-mode #paps-record-table .paps-input.height,
.paps-mode #paps-record-table .paps-input.weight {
  max-width: 40px;
}

.styled-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

.styled-table thead {
  background-color: var(--input-bg);
}

.styled-table th,
.styled-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.styled-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.styled-table tbody tr:nth-child(even) {
  background-color: var(--input-bg);
}

.styled-table tbody tr:hover {
  background-color: color-mix(in srgb, var(--accent) 15%, transparent);
}

.styled-table tbody tr.highlighted-row {
  background-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Record Table Zebra Striping */
.record-table tbody tr:nth-child(even) {
  background-color: var(--bg-light);
}

.record-table tbody tr:hover {
  background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}

.record-table input,
.record-table select,
.record-table textarea {
  background-color: transparent !important;
}

.score {
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.score:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

/* 숫자 입력 필드의 스피너 제거 */
.score::-webkit-outer-spin-button,
.score::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.score[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.styled-table .rank-wins {
  color: var(--win);
  font-weight: 600;
}

.styled-table .rank-losses {
  color: var(--lose);
  font-weight: 600;
}

.styled-table .rank-points {
  color: var(--accent);
  font-weight: 700;
}

.action-buttons button {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ink-muted);
  border-radius: 4px;
  line-height: 0;
}

.action-buttons button:hover {
  background: var(--input-bg);
  color: var(--ink);
}

.action-buttons button.has-note {
  color: var(--draw);
}

.action-buttons button svg {
  width: 1.15em;
  height: 1.15em;
}

.student-list-grid {
  display: -ms-grid;
  /* IE fallback */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  /* IE fallback */
  -ms-grid-columns: 1fr 1fr 1fr;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: var(--input-bg);
  border-radius: 0.5rem;
}

.student-item>span {
  cursor: pointer;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.status-badge.completed {
  background-color: color-mix(in srgb, var(--win) 20%, transparent);
  color: var(--win);
}

.status-badge.pending {
  background-color: color-mix(in srgb, var(--draw) 20%, transparent);
  color: var(--draw);
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  font-weight: 700;
  font-size: 1rem;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-total {
  background-color: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.stat-completed {
  background-color: color-mix(in srgb, var(--win) 20%, transparent);
  color: var(--win);
}

.stat-pending {
  background-color: color-mix(in srgb, var(--draw) 25%, transparent);
  color: var(--draw);
}

.game-number {
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  min-width: 24px;
  text-align: center;
}

.game-number:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  transform: scale(1.05);
}

.game-number.highlighted-number {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.1);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--input-bg);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-card .value .unit {
  font-size: 1rem;
  font-weight: 500;
  margin-left: 0.25rem;
}

.sidebar-form-group {
  display: flex;
  border: 1px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.sidebar-form-group input {
  border: none !important;
  flex-grow: 1;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
}

.sidebar-form-group input:focus {
  outline: none !important;
}

.sidebar-form-group input::placeholder {
  color: var(--ink-muted);
}

.sidebar-form-group button {
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--accent);
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.sidebar-form-group button:hover {
  background: var(--accent-dark);
}

/* 메인 콘텐츠용 폼 그룹 스타일 */
.form-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.form-group input {
  border: none !important;
  flex-grow: 1;
  padding: 10px 12px;
}

.form-group input:focus {
  outline: none !important;
}

.form-group .btn {
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--line);
  padding: 10px;
}

/* settings-grid를 수정하여 버튼까지 한 줄에 표시 */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) auto auto auto;
  gap: 16px;
  align-items: end;
}

.settings-grid .field {
  margin-bottom: 0;
}

.settings-grid-full {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

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

.chip-group label {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
}

.chip-group input[type="radio"] {
  display: none;
}

.chip-group label:has(input:checked) {
  background-color: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.info-box {
  background: var(--input-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Collapsible sections for tournament */
.collapsible-section {
  max-height: 2000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.4s ease;
}

.collapsible-section.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

/* ===== 토너먼트 대진표 — 리뉴얼 디자인 ===== */

.bracket-wrap {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #0f2040 100%) !important;
  overflow: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  min-height: 500px;
  padding: 28px;
}

/* subtle dot-grid overlay */
.bracket-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.svg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.rounds {
  display: flex;
  align-items: flex-start;
  gap: 72px;
  position: relative;
  z-index: 2;
}

.round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-grow: 0;
  width: 184px;
  min-width: 184px;
  align-items: center;
}

/* 라운드 레이블: 색상 있는 pill 배지 */
.round-title {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  white-space: nowrap;
}

/* 결승은 골드 */
.round:last-child .round-title {
  background: linear-gradient(135deg, #b8860b, #ffd700);
  border-color: #ffd700;
  color: #1a1200;
  box-shadow: 0 2px 12px rgba(255,215,0,0.4);
}

/* 4강 */
.round:nth-last-child(2) .round-title {
  background: linear-gradient(135deg, #1971c2, #339af0);
  border-color: #339af0;
  color: #fff;
  box-shadow: 0 2px 10px rgba(51,154,240,0.35);
}

.match-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
  gap: 0;
}

/* ── 매치 카드 ── */
.tourney-match-card {
  width: 184px;
  height: 84px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.08) inset;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}

.tourney-match-card:not(.tourney-disabled-card):not(.tourney-bye-card):hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  transform: translateY(-1px);
}

/* 진행 중 카드: 왼쪽 파란 테두리 */
.tourney-match-card:not(.tourney-disabled-card):not(.tourney-bye-card)::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #1971c2, #339af0);
  border-radius: 12px 0 0 12px;
}

/* 완료된 카드: 왼쪽 초록 테두리 */
.tourney-match-card.completed::before {
  background: linear-gradient(180deg, #2f9e44, #51cf66);
}

.tourney-disabled-card {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}

.tourney-disabled-card::before { display: none; }

.tourney-bye-card {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
}

.tourney-bye-card::before { display: none; }

/* 팀 행 */
.tourney-team-row {
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  transition: background 0.15s;
}

.tourney-team-row.winner {
  background: linear-gradient(90deg, rgba(47,158,68,0.12) 0%, rgba(81,207,102,0.06) 100%);
}

/* 팀 이름 */
.tourney-team-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.tourney-team-name.placeholder {
  color: #94a3b8;
  font-weight: 400;
  font-style: italic;
}

.tourney-team-name.winner-text {
  color: #1a7a30;
  font-weight: 800;
}

.tourney-team-name.loser-text {
  color: #94a3b8;
  font-weight: 400;
}

/* 구분선 */
.tourney-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 0 8px;
}

/* 점수 입력/표시 */
.tourney-score-input,
.tourney-score-display {
  min-width: 28px;
  max-width: 36px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  flex-shrink: 0;
}

.tourney-score-input {
  border: none;
  background: rgba(25,113,194,0.08);
  border-radius: 6px;
  padding: 2px 4px;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: background 0.15s, box-shadow 0.15s;
}

.tourney-score-input::-webkit-outer-spin-button,
.tourney-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.tourney-score-input:focus {
  outline: none;
  background: rgba(25,113,194,0.18);
  box-shadow: 0 0 0 2px rgba(25,113,194,0.35);
}

/* 승자 행의 점수는 초록색 */
.tourney-team-row.winner .tourney-score-input,
.tourney-team-row.winner .tourney-score-display {
  color: #1a7a30;
}

/* ── 매치 컨테이너 (2행 = 팀A + 팀B) ── */
.match {
  margin: 8px 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.97);
  border: 1.5px solid rgba(255,255,255,0.15);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28), 0 1px 0 rgba(255,255,255,0.1) inset;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}

/* 진행 중 매치: 파란 왼쪽 강조선 */
.match::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #1971c2, #339af0);
  border-radius: 12px 0 0 12px;
}

/* 두 팀 모두 결과 확정된 매치: 초록 강조선 */
.match:has(.team.win)::before {
  background: linear-gradient(180deg, #2f9e44, #51cf66);
}

.match:not(:has(.team[draggable="false"])):hover {
  box-shadow: 0 6px 28px rgba(0,0,0,0.42);
  transform: translateY(-1px);
}

.match.bye-match {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}
.match.bye-match::before { display: none; }

/* 팀 행 */
.team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px 9px 14px;
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  font-weight: 600;
  color: #1e293b;
  transition: background 0.15s;
  cursor: grab;
  user-select: none;
  min-height: 40px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.team:last-child {
  border-bottom: none;
}

.team:hover:not([draggable="false"]) {
  background: rgba(25,113,194,0.05);
}

.team.win {
  background: linear-gradient(90deg, rgba(47,158,68,0.1) 0%, rgba(81,207,102,0.04) 100%);
  color: #1a7a30;
}

.team.lose {
  color: #94a3b8;
  font-weight: 400;
}

.team.dragging {
  opacity: 0.6;
  transform: scale(1.04);
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.team.drag-over {
  background: rgba(47,158,68,0.12);
}

/* 팀 이름 */
.team-name {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.team.win .team-name { font-weight: 800; }
.team.lose .team-name { font-weight: 400; }

/* 점수 입력 */
.team-score {
  width: 36px;
  text-align: center;
  padding: 3px 4px;
  border: 1px solid rgba(25,113,194,0.2);
  border-radius: 6px;
  background: rgba(25,113,194,0.07);
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin-left: 6px;
  flex-shrink: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: background 0.15s, box-shadow 0.15s;
}

.team.win .team-score {
  background: rgba(47,158,68,0.12);
  border-color: rgba(47,158,68,0.3);
  color: #1a7a30;
}

.team.lose .team-score {
  color: #94a3b8;
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
}

.team-score::-webkit-outer-spin-button,
.team-score::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.team-score:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(25,113,194,0.35);
  background: rgba(25,113,194,0.14);
}

.team-score:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.team-score:not(:disabled) {
  cursor: text;
}

.team-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}


.team.bye-team {
  color: var(--ink-muted);
  font-style: italic;
  background-color: rgba(134, 142, 150, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }

  50% {
    box-shadow: 0 0 8px 4px color-mix(in srgb, var(--accent) 20%, transparent);
  }

  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

.teams {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
}

.team.win {
  font-weight: 700;
  background: color-mix(in srgb, var(--win) 15%, transparent);
}

.team.lose {
  opacity: .6;
}

.rank-badge {
  margin-right: 8px;
}

.rank-badge svg {
  width: 1.25em;
  height: 1.25em;
  vertical-align: middle;
}

.floating-btn {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--sidebar-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.auth-box h2 {
  text-align: center;
  margin-top: 0;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.auth-tabs button {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 3px solid transparent;
}

.auth-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form .error-message {
  color: var(--lose);
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-align: center;
}

.auth-form .success-message {
  color: var(--win);
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-align: center;
}

.auth-form button {
  width: 100%;
  margin-top: 8px;
}

.auth-form .forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-top: -4px;
  margin-bottom: 12px;
}

.auth-form .forgot-password-link:hover {
  color: var(--accent);
}

.loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  color: white;
  font-size: 1.2rem;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 24px 0 16px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.divider:not(:empty)::before {
  margin-right: .5em;
}

.divider:not(:empty)::after {
  margin-left: .5em;
}

.social-buttons {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
  justify-items: center;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  padding: 0;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--ink-muted);
}

.social-btn svg {
  width: 1.5em;
  height: 1.5em;
}

/* 방문자 통계 스타일 */
.visitor-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
}

/* 경기 일정 테이블 스타일 */
.schedule-header {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 100;
  padding: 16px 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedule-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

/* 경기 일정 테이블 스타일 */
#gamesTableContent .styled-table {
  position: relative;
}

#gamesTableContent .styled-table thead th {
  background: var(--input-bg);
  white-space: nowrap;
  /* 텍스트 줄바꿈 방지 */
}

/* 경기 일정 테이블 컨테이너 */
#gamesTableContent {
  overflow: visible;
  border-radius: 12px;
}

.games-table-container {
  position: relative;
}

.intro-highlight {
  animation: highlight-pulse 2s infinite ease-in-out;
}

@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  }

  70% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent);
  }

  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

.intro-arrow {
  display: none;
  position: absolute;
  width: 40px;
  height: 40px;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  animation: blink-effect 1.2s infinite ease-in-out;
  z-index: 10;
}

.intro-container-active .intro-arrow {
  display: block;
}

.intro-arrow svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

@keyframes blink-effect {
  50% {
    opacity: 0.2;
  }
}

.help-popup-content {
  line-height: 1.6;
}

.help-popup-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.help-popup-content ul {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 1rem;
}

.help-popup-content li {
  margin-bottom: 0.5rem;
}

.help-popup-content code {
  background: var(--input-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}


/* SVG 아이콘 크기 강제 지정 */
.top-bar .brand-logo svg {
  width: 28px !important;
  height: 28px !important;
}

.top-bar-toggle svg {
  width: 24px !important;
  height: 24px !important;
}

.sidebar-header svg {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0;
}

h2 svg {
  width: 1.25em;
  height: 1.25em;
}

.auth-box>div:first-child svg {
  width: 3.2em;
  height: 3.2em;
}

.theme-toggle svg {
  width: 1.4em;
  height: 1.4em;
}

.sidebar-form-group .btn svg {
  width: 1.5em;
  height: 1.5em;
}

.floating-btn svg,
.mode-switch-btn svg {
  width: 1.5em;
  height: 1.5em;
}

.modal-box .btn svg {
  width: 1.2em;
  height: 1.2em;
}


/* 작은 화면 레이아웃 조정 (Mantine breakpoint 사용) */
@media (max-width: 48em) {
  body {
    overflow: auto;
  }

  .app-container {
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    height: auto;
  }

  .main-content {
    overflow-y: visible;
  }

  .top-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Legacy sidebar-toggle rules removed */

  .top-bar>.row {
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-end;
  }
}

/* =====================
   PAPS 전용 스타일
   ===================== */
.paps-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 12px;
  flex-wrap: wrap;
}

.paps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.paps-event-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paps-event-group select {
  width: 100%;
}

.paps-table-wrap {
  overflow: visible;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: var(--card-bg);
}

/* PAPS 설정 컨테이너 스타일 */
.paps-setup-container {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.paps-setup-container .setup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.paps-setup-container .setup-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 600;
}

.paps-setup-container .setup-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.paps-setup-container .setup-actions .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--line);
}

.paps-setup-container .setup-actions .btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.paps-setup-container .setup-actions .btn-primary:hover {
  background: var(--accent-dark);
}

.paps-setup-container .setup-actions .btn-secondary {
  background: var(--card-bg);
  color: var(--ink);
  border-color: var(--line);
}

.paps-setup-container .setup-actions .btn-secondary:hover {
  background: var(--input-bg);
  border-color: var(--accent);
}

.paps-settings-row {
  display: flex;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
}

.paps-settings-row .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.paps-settings-row .form-group label {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.paps-settings-row .form-group select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.paps-settings-row .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 113, 194, 0.2);
}

.paps-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 2px dashed var(--line);
}

/* PAPS 등급 셀 스타일 */
.grade-cell {
  font-weight: bold;
  text-align: center;
  transition: all 0.2s ease;
}

.grade-cell.grade-1 {
  background-color: #4CAF50 !important;
  color: white !important;
}

.grade-cell.grade-2 {
  background-color: #2196F3 !important;
  color: white !important;
}

.grade-cell.grade-3 {
  background-color: #FF9800 !important;
  color: white !important;
}

.grade-cell.grade-4 {
  background-color: #F44336 !important;
  color: white !important;
}

.grade-cell.grade-5 {
  background-color: #9C27B0 !important;
  color: white !important;
}

/* PAPS 테이블 개선 */
#paps-record-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

#paps-record-table th,
#paps-record-table td {
  border: 1px solid var(--line);
  padding: 8px 4px;
  text-align: center;
  vertical-align: middle;
}

#paps-record-table th {
  background: var(--input-bg);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

#paps-record-table input[type="number"],
#paps-record-table input[type="text"],
#paps-record-table select {
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px;
  text-align: center;
  font-size: 0.9rem;
}

#paps-record-table input[type="number"]:focus,
#paps-record-table input[type="text"]:focus,
#paps-record-table select:focus {
  outline: 2px solid var(--accent);
  background: var(--input-bg);
}

/* PAPS 테이블 전용 스타일 */
#paps-record-table {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  font-size: 0.9rem;
  table-layout: fixed;
}

#paps-record-table th {
  text-align: center;
  padding: 0.4rem 0.2rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

#paps-record-table td {
  text-align: center;
  padding: 0.2rem;
  vertical-align: middle;
}

#paps-record-table .paps-input {
  width: 100%;
  max-width: 50px;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-bg);
  text-align: center;
  font-size: 0.95rem;
}

#paps-record-table .paps-input.number {
  max-width: 40px;
}

#paps-record-table .paps-input.name {
  max-width: 60px;
}

#paps-record-table .paps-input.rec {
  max-width: 45px;
}

#paps-record-table .paps-input.height,
#paps-record-table .paps-input.weight {
  max-width: 45px;
}

#paps-record-table .paps-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

#paps-record-table .paps-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

#paps-record-table .paps-input[type="number"]::-webkit-outer-spin-button,
#paps-record-table .paps-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

#paps-record-table .grade-cell {
  font-weight: 600;
  font-size: 0.85rem;
  width: 25px;
  min-width: 25px;
  max-width: 25px;
  padding: 0.15rem 0.1rem;
  text-align: center;
  white-space: nowrap;
}

#paps-record-table .bmi-cell {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
  width: 25px;
  min-width: 25px;
  max-width: 25px;
  padding: 0.15rem 0.1rem;
  text-align: center;
  white-space: nowrap;
}

#paps-record-table .overall-grade-cell {
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--input-bg);
  width: 35px;
  min-width: 35px;
  max-width: 35px;
  padding: 0.15rem 0.1rem;
  text-align: center;
  white-space: nowrap;
}

.paps-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.paps-chart-grid>div {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 300px;
}

.paps-chart-grid canvas {
  max-width: 100%;
  height: auto;
}

.paps-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--input-bg);
  color: var(--ink-muted);
}

.paps-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.grade-1 {
  background-color: color-mix(in srgb, var(--win) 35%, transparent);
  color: var(--win);
}

.grade-2 {
  background-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
}

.grade-3 {
  background-color: color-mix(in srgb, var(--draw) 25%, transparent);
  color: var(--draw);
}

.grade-4 {
  background-color: color-mix(in srgb, var(--lose) 15%, transparent);
  color: var(--lose);
}

.grade-5 {
  background-color: color-mix(in srgb, var(--lose) 25%, transparent);
  color: var(--lose);
}

.grade-정상 {
  background-color: color-mix(in srgb, var(--win) 25%, transparent);
  color: var(--win);
}

.grade-과체중 {
  background-color: color-mix(in srgb, var(--draw) 25%, transparent);
  color: var(--draw);
}

.grade-마름,
.grade-경도비만,
.grade-고도비만 {
  background-color: color-mix(in srgb, var(--lose) 20%, transparent);
  color: var(--lose);
}

/* =====================
   엑셀 관리 섹션 스타일
   ===================== */
.progress-excel-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}


.progress-excel-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-excel-buttons .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 8px 12px;
  justify-content: flex-start;
}

.progress-excel-buttons .btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* =====================
   수업 진도표 전용 스타일
   ===================== */
.progress-mode {
  --week-col-w: 320px;
  --cell-pad: 8px;
}

/* 수업 진도표 모드에서 사이드바 하단 표시 */
.progress-mode .sidebar-footer {
  display: block !important;
}


/* 수업 진도표 모드에서 사이드바 리스트 컨테이너 숨기기 */
.progress-mode #sidebar-list-container {
  display: none !important;
}

/* 수업 진도표 모드에서 반 목록 스타일 */
.progress-mode .progress-class-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 0 0 0;
}

/* 수업 진도표 모드에서 사이드바 하단 여백 제거 */
.progress-mode .sidebar-actions {
  display: none !important;
}

.progress-mode .progress-class-list.expanded {
  flex: 1;
  min-height: 0;
}

.progress-mode .progress-main-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.progress-mode .progress-right {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.progress-mode .progress-right-header {
  flex-shrink: 0;
}

.progress-mode .progress-setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

.progress-mode .progress-setting-header .title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.progress-mode .progress-setting-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.progress-mode .progress-setting-toggle:hover {
  background: var(--input-bg);
  color: var(--ink);
}

.progress-mode .progress-setting-toggle.collapsed {
  transform: rotate(-90deg);
}

.progress-mode .progress-setting-controls {
  transition: all 0.3s ease;
  overflow: hidden;
}

.progress-mode .progress-setting-controls.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.progress-mode .progress-setting-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-mode .progress-selected-class {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-left: auto;
  font-weight: 600;
  background: var(--input-bg);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.class-info-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.class-info-header h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}

.class-info-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.info-label {
  color: var(--ink-muted);
  font-weight: 500;
}

.info-value {
  color: var(--ink);
  font-weight: 600;
}

.progress-mode .progress-setting-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-mode .progress-setting-bar .title {
  font-weight: 700;
  margin-right: 8px;
}

.progress-mode .progress-right-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.progress-mode .progress-sheet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.progress-mode .progress-sheet {
  overflow: auto;
  padding: 0;
  background: transparent;
}

.progress-mode .progress-sheet-weeks {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 240px;
}

.progress-mode .progress-weeks {
  display: flex;
  gap: 12px;
  min-width: calc(var(--week-col-w) + 12px);
}

.progress-mode .progress-week-col {
  width: var(--week-col-w);
  min-width: var(--week-col-w);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-mode .progress-week-col .week-head {
  padding: 10px 12px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

body[data-theme="dark"] .progress-mode .progress-week-col .week-head {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  color: #dcfce7;
}

.progress-mode .progress-week-col .week-head .buttons {
  display: flex;
  gap: 4px;
}

.progress-mode .progress-week-col .week-head .title {
  font-weight: 700;
  color: #166534;
}

body[data-theme="dark"] .progress-mode .progress-week-col .week-head .title {
  color: #dcfce7;
}

.progress-mode .progress-week-col .week-head .add-next {
  border: 1px solid #166534;
  background: transparent;
  color: #166534;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.progress-mode .progress-week-col .week-head .add-next:hover {
  background: #166534;
  border-color: #166534;
  color: #dcfce7;
}

.progress-mode .progress-week-col .week-head .remove-week {
  border: 1px solid #166534;
  background: transparent;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  color: #166534;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.progress-mode .progress-week-col .week-head .remove-week:hover {
  background: var(--lose);
  border-color: var(--lose);
  color: white;
}

body[data-theme="dark"] .progress-mode .progress-week-col .week-head .add-next {
  border-color: #dcfce7;
  color: #dcfce7;
}

body[data-theme="dark"] .progress-mode .progress-week-col .week-head .add-next:hover {
  background: #dcfce7;
  color: #166534;
}

body[data-theme="dark"] .progress-mode .progress-week-col .week-head .remove-week {
  border-color: #dcfce7;
  color: #dcfce7;
}

.progress-mode .progress-session {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  background: var(--card-bg);
}

.progress-mode .progress-session:last-child {
  border-bottom: 0;
}

.progress-mode .progress-session:nth-child(even) {
  background: var(--input-bg);
}

.progress-mode .progress-session .session-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-mode .progress-session .session-title {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.progress-mode .progress-session .session-date {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.8rem;
  width: 140px;
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--card-bg);
}

.progress-mode .progress-session .day-of-week {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 600;
  margin-left: 8px;
  min-width: 40px;
  text-align: center;
  display: inline-block;
  font-family: 'Noto Sans KR', sans-serif;
  padding: 2px 6px;
  background: var(--input-bg);
  border-radius: 3px;
}

.progress-mode .progress-session textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  font-weight: 400;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.2s ease;
}

.progress-mode .progress-session textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 113, 194, 0.1);
}

.progress-mode .progress-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-muted);
  background: var(--input-bg);
  text-align: center;
}


@media (max-width: 68.75em) {

  /* 약 lg breakpoint */
  .progress-mode .progress-session input[type="date"] {
    width: 120px;
  }
}

@media (max-width: 51.25em) {

  /* 약 sm-md 사이 */
  .progress-mode .progress-sheet-weeks {
    flex-direction: column;
  }

  .progress-mode .progress-weeks {
    flex-direction: column;
    min-width: auto;
  }

  .progress-mode .progress-week-col {
    width: 100%;
    min-width: auto;
  }
}

/* ========================================
   새로운 ProgressManager 스타일
   ======================================== */

.progress-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-light);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-class-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-class-selector label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}

.progress-class-selector select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.9rem;
  min-width: 200px;
}

.progress-class-info {
  flex: 1;
  margin-left: 24px;
}

.class-details h4 {
  margin: 0 0 8px 0;
  color: var(--ink);
  font-size: 1.1rem;
}

.class-details p {
  margin: 4px 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.progress-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.progress-sidebar {
  width: 300px;
  background: var(--card-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.progress-class-list {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.progress-class-list h3 {
  margin: 0 0 16px 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.add-class-section {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.add-class-section input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.9rem;
}

.add-class-section button {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.add-class-section button:hover {
  background: var(--accent-dark);
}

.class-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.class-item {
  padding: 16px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.class-item:hover {
  background: var(--card-bg);
  border-color: var(--accent);
}

.class-item.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent-dark);
}

.class-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.class-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.class-actions {
  display: flex;
  gap: 8px;
}

.class-actions button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.class-actions .edit-btn:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.class-actions .delete-btn:hover {
  background: var(--lose);
  color: white;
  border-color: var(--lose);
}

.progress-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.progress-sheet-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.progress-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
}

.progress-sheet-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 600;
}

.progress-actions {
  display: flex;
  gap: 12px;
}

.progress-actions button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.progress-actions #addWeekBtn {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.progress-actions #addWeekBtn:hover {
  background: var(--accent-dark);
}

.progress-actions #saveProgressBtn {
  background: var(--win);
  color: white;
  border-color: var(--win);
}

.progress-actions #saveProgressBtn:hover {
  background: #2f9e44;
}

.progress-sheet {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-light);
}

.progress-table {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-table table {
  width: 100%;
  border-collapse: collapse;
}

.progress-table th {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 16px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-table th:last-child {
  border-right: none;
}

.progress-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}

.progress-table td:last-child {
  border-right: none;
}

.week-number {
  background: var(--input-bg);
  font-weight: 600;
  text-align: center;
  min-width: 80px;
}

.session-cell {
  min-width: 200px;
}

.session-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-content textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  resize: vertical;
}

.session-content textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 113, 194, 0.1);
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}

.session-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.session-controls input[type="checkbox"] {
  margin: 0;
}

.session-controls input[type="text"] {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.no-selection {
  color: var(--ink-muted);
  font-style: italic;
}

/* 반응형 디자인 */
@media (max-width: 74em) {

  /* lg breakpoint */
  .progress-sidebar {
    width: 250px;
  }
}

@media (max-width: 48em) {

  /* sm breakpoint (모바일) */
  .progress-main {
    flex-direction: column;
  }

  .progress-sidebar {
    width: 100%;
    height: 200px;
  }

  .progress-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .progress-class-info {
    margin-left: 0;
  }
}

/* 수업 설정 컨테이너 스타일 */
.class-settings-container {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.class-settings-container h3 {
  margin: 0 0 16px 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
}

.settings-form {
  display: flex;
  flex-direction: row;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.form-group label {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 113, 194, 0.2);
}

#saveSettingsBtn {
  align-self: end;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

#saveSettingsBtn:hover {
  background: var(--accent-dark);
}

/* ProgressManager 사이드바 스타일 */
.progress-mode .sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.progress-mode .sidebar #sidebarTitle {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
}

.progress-mode .sidebar #sidebar-form-container {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.progress-mode .sidebar #sidebar-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}

.progress-mode .sidebar .add-class-section {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.progress-mode .sidebar .add-class-section input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.9rem;
}

.progress-mode .sidebar .add-class-section button {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.progress-mode .sidebar .add-class-section button:hover {
  background: var(--accent-dark);
}

.progress-mode .sidebar .class-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-mode .sidebar .class-item {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.progress-mode .sidebar .class-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(25, 113, 194, 0.1);
}

.progress-mode .sidebar .class-item.active {
  border-color: var(--accent);
  background: rgba(25, 113, 194, 0.05);
}

.progress-mode .sidebar .class-item h4 {
  margin: 0 0 4px 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.progress-mode .sidebar .class-item .class-info {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.progress-mode .sidebar .class-item .class-actions {
  display: flex;
  gap: 4px;
}

.progress-mode .sidebar .class-item .class-actions button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.progress-mode .sidebar .class-item .class-actions button:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* 진도표 테이블 스타일 */
.progress-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-table th {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-right: 1px solid var(--accent-light);
}

.progress-table th:last-child {
  border-right: none;
}

.progress-table td {
  padding: 8px;
  border: 1px solid var(--line);
  vertical-align: top;
  background: var(--bg);
}

.progress-table tr:nth-child(even) td {
  background: var(--card-bg);
}

/* 주차 컬럼 스타일 */
.progress-table .week-cell {
  background: var(--accent) !important;
  color: var(--accent-fg) !important;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  vertical-align: middle;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  border-right: 2px solid var(--accent-hover);
  padding: 8px 4px;
}

/* 세션 콘텐츠 스타일 */
.session-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--ink);
}

.date-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.day-of-week {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 30px;
  text-align: center;
}

.content-textarea {
  width: 100%;
  min-height: 60px;
  /* 기존 높이의 2배 */
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}

.content-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.content-textarea::placeholder {
  color: var(--ink-muted);
}

/* Grammarly 아이콘 숨기기 */
.content-textarea[data-gramm="true"] {
  position: relative;
}

.content-textarea[data-gramm="true"]::after {
  display: none !important;
}

/* Grammarly 관련 요소 숨기기 */
[data-gramm-editor],
[data-gramm="true"],
.grammarly-extension {
  display: none !important;
}

/* Grammarly 버튼 숨기기 */
div[data-gramm="true"]>div[style*="position: absolute"] {
  display: none !important;
}

/* Grammarly 오버레이 완전 제거 */
.grammarly-extension,
[data-gramm-editor="true"],
div[data-gramm="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Grammarly 아이콘과 버튼 숨기기 */
.content-textarea+div[style*="position: absolute"],
.content-textarea+div[style*="z-index"],
div[style*="position: absolute"][style*="z-index"] {
  display: none !important;
}

/* 빈 상태 메시지 */
.progress-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 2px dashed var(--line);
}

/* PAPS 랭킹 기능 스타일 */
.ranking-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: end;
}

.ranking-controls .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.ranking-controls .form-group label {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.ranking-controls .form-group select,
.ranking-controls .form-group input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ranking-controls .form-group select:focus,
.ranking-controls .form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 113, 194, 0.2);
}

.ranking-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.ranking-table-container {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.ranking-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-controls .btn {
  padding: 6px 12px;
  font-size: 12px;
}

#ranking-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

#ranking-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  padding: 12px 8px;
  text-align: center;
}

#ranking-table td {
  vertical-align: middle;
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
}

#ranking-table tr.table-warning {
  background-color: #fff3cd !important;
}

#ranking-table tr.table-warning td {
  border-color: #ffeaa7;
}

#ranking-table tr:hover {
  background-color: #f8f9fa;
}

#ranking-table tr.table-warning:hover {
  background-color: #fff3cd !important;
}

/* 공유 기능 스타일 */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
}

.dropdown-item:hover {
  background-color: #f8f9fa !important;
}

/* 순위표 레이아웃 스타일 */
.ranking-content-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

.ranking-table-container {
  flex: 0 0 calc(50% - 10px);
  width: calc(50% - 10px);
  max-width: calc(50% - 10px);
  min-width: calc(50% - 10px);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.ranking-chart-container {
  flex: 0 0 calc(50% - 10px);
  width: calc(50% - 10px);
  max-width: calc(50% - 10px);
  min-width: calc(50% - 10px);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  overflow: auto;
}

#ranking-distribution-chart {
  width: 800px;
  height: 600px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

/* 진도표 제어 버튼 스타일 */
.progress-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.progress-controls .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--line);
}

.progress-controls .btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.progress-controls .btn.primary:hover {
  background: var(--accent-hover);
}

.progress-controls .btn.secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
}

.progress-controls .btn.secondary:hover {
  background: var(--card-bg);
  border-color: var(--accent);
}

.progress-controls .btn.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#weekCounter {
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* 차시 번호 표시 스타일 */
.session-header {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.star-button {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.star-button:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.star-button.marked {
  color: #ffc107;
}

.star-button.marked:hover {
  color: #ffb300;
}

.session-cell.marked {
  background-color: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #ffc107;
}

.session-cell.marked .session-content {
  position: relative;
}

/* PAPS 빈 상태 스타일 */
.paps-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ========================================
   토스트 알림 스타일
   ======================================== */

.toast-container {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
}

.toast-container.toast-top-right {
  top: 20px;
  right: 20px;
  align-items: flex-end;
}

.toast-container.toast-top-left {
  top: 20px;
  left: 20px;
  align-items: flex-start;
}

.toast-container.toast-bottom-right {
  bottom: 20px;
  right: 20px;
  align-items: flex-end;
}

.toast-container.toast-bottom-left {
  bottom: 20px;
  left: 20px;
  align-items: flex-start;
}

.toast-container.toast-top-center {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.toast-container.toast-bottom-center {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-hide {
  opacity: 0;
  transform: translateY(-10px);
}

.toast-message {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink);
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--ink);
}

/* 토스트 타입별 스타일 */
.toast-success {
  border-left: 4px solid var(--win);
}

.toast-success .toast-icon {
  color: var(--win);
}

.toast-error {
  border-left: 4px solid var(--lose);
}

.toast-error .toast-icon {
  color: var(--lose);
}

.toast-warning {
  border-left: 4px solid var(--draw);
}

.toast-warning .toast-icon {
  color: var(--draw);
}

.toast-info {
  border-left: 4px solid var(--accent);
}

.toast-info .toast-icon {
  color: var(--accent);
}

/* ========================================
   Mantine 스타일 반응형 유틸리티 (hiddenFrom/visibleFrom)
   ======================================== */

/* hiddenFrom: 지정 breakpoint 이상에서 숨김 */
.hidden-from-xs {
  @media (min-width: 30em) {
    display: none !important;
  }
}

.hidden-from-sm {
  @media (min-width: 48em) {
    display: none !important;
  }
}

.hidden-from-md {
  @media (min-width: 64em) {
    display: none !important;
  }
}

.hidden-from-lg {
  @media (min-width: 74em) {
    display: none !important;
  }
}

/* visibleFrom: 지정 breakpoint 이상에서만 표시 */
.visible-from-xs {
  display: none;

  @media (min-width: 30em) {
    display: block;
  }
}

.visible-from-sm {
  display: none;

  @media (min-width: 48em) {
    display: block;
  }
}

.visible-from-md {
  display: none;

  @media (min-width: 64em) {
    display: block;
  }
}

.visible-from-lg {
  display: none;

  @media (min-width: 74em) {
    display: block;
  }
}

/* flex/inline-flex 버전 */
.visible-from-sm-flex {
  display: none;

  @media (min-width: 48em) {
    display: flex;
  }
}

.visible-from-md-flex {
  display: none;

  @media (min-width: 64em) {
    display: flex;
  }
}

/* ========================================
   AppShell 패턴 적용
   ======================================== */

.app-shell {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.app-shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
}

.app-shell-navbar {
  /* 데스크톱: 고정 너비 */
  width: 340px;
  flex-shrink: 0;
}

.app-shell-main {
  flex: 1;
  margin-top: 60px;
  /* header 높이만큼 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 모바일: AppShell 모달 방식 */
@media (max-width: 48em) {
  .app-shell {
    flex-direction: column;
  }

  .app-shell-navbar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85vw;
    max-width: 400px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  }

  .app-shell-navbar:not(.collapsed) {
    left: 0;
  }

  .app-shell-main {
    margin-top: 0;
    width: 100%;
  }
}

/* 다크 모드 지원 */
body[data-theme="dark"] .toast {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 48em) {

  /* sm breakpoint (모바일) */
  .toast-container {
    max-width: calc(100vw - 40px);
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* ========================================
   모바일 전용 완전히 새로운 디자인
   ======================================== */

@media (max-width: 48em) {
  /* sm breakpoint (모바일) */
  /* ========================================
     전체 레이아웃 재구성
     ======================================== */

  body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  #app-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--main-bg);
  }

  /* ========================================
     상단 헤더 - 모바일 최적화
     ======================================== */

  .top-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--card-bg);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .top-bar h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
  }

  .top-bar h1 svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
  }

  .top-bar .version {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--accent);
    color: var(--accent-fg);
    border-radius: 4px;
    font-weight: 600;
  }

  /* 상단 바의 모든 버튼 숨기기 (모바일에서는 하단 네비게이션 사용) */
  .top-bar nav,
  .top-bar>.row,
  .top-bar #top-bar-actions,
  .top-bar #user-profile,
  .top-bar .theme-toggle,
  .top-bar #undo-btn,
  .top-bar #redo-btn,
  .top-bar .btn:not(.mode-switch-btn):not(.top-bar-toggle):not(#settings-btn) {
    display: none !important;
  }

  /* 설정 버튼은 모바일에서도 표시 */
  .top-bar #settings-btn {
    display: flex !important;
  }

  /* 신규 토글 버튼은 모바일에서도 보여야 함 */
  .top-bar .top-bar-toggle {
    display: flex !important;
    background: transparent !important;
    color: var(--ink) !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
  }

  /* ========================================
     사이드바 - 모바일 드로어 스타일
     ======================================== */

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85vw;
    max-width: 360px;
    height: 100vh;
    z-index: 1000;
    background: var(--card-bg);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    border-right: none;
    border-bottom: none;
  }

  .sidebar:not(.collapsed) {
    left: 0;
  }

  .sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line);
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .sidebar-header svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
  }

  #sidebar-form-container {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
  }

  #sidebar-list-container {
    padding: 0 20px 20px;
  }

  .sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: var(--bg-light);
    font-size: 0.75rem;
    text-align: center;
    color: var(--ink-muted);
  }

  /* 사이드바 오버레이 */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: block;
  }

  .sidebar:not(.collapsed)~.sidebar-overlay,
  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  /* 사이드바 토글 버튼 */
  /* Legacy sidebar-toggle rules removed */

  /* ========================================
     메인 콘텐츠 - 카드 기반 레이아웃
     ======================================== */

  .main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 100px;
    /* 하단 네비게이션 공간 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-x: visible;
  }

  .main-view {
    max-width: 100%;
  }

  /* 카드 스타일 개선 */
  .card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--line);
    transition: all 0.2s ease;
  }

  .card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }

  /* ========================================
     버튼 - 모바일 최적화
     ======================================== */

  .btn {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 12px;
    touch-action: manipulation;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  .btn.primary {
    background: var(--accent);
    color: var(--accent-fg);
    box-shadow: 0 4px 12px rgba(25, 113, 194, 0.3);
  }

  .btn.primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(25, 113, 194, 0.3);
  }

  .btn svg {
    width: 20px;
    height: 20px;
  }

  .btn+.btn {
    margin-left: 12px;
  }

  .btn.small {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 15px;
  }

  /* ========================================
     입력 필드 - 모바일 최적화
     ======================================== */

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 17px !important;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--ink);
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
  }

  input:focus,
  select:focus,
  textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(25, 113, 194, 0.1);
  }

  input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
  }

  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* ========================================
     폼 요소
     ======================================== */

  .field {
    margin-bottom: 20px;
  }

  .field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
  }

  .sidebar-form-group {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    margin-bottom: 16px;
  }

  /* ========================================
     테이블 - 모바일 최적화
     ======================================== */

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
    position: relative;
  }

  table {
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
  }

  table th,
  table td {
    padding: 14px 12px;
    font-size: 15px;
  }

  table th {
    background: var(--bg-light);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  /* ========================================
     리스트 - 카드 스타일
     ======================================== */

  .list-item,
  li {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    min-height: 56px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
  }

  .list-item:active,
  li:active {
    transform: scale(0.98);
    background: var(--input-bg);
  }

  /* ========================================
     타이포그래피
     ======================================== */

  h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 12px 0;
  }

  h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
  }

  p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 12px 0;
  }

  /* ========================================
     모달 - 모바일 최적화
     ======================================== */

  .modal-box {
    width: 95vw;
    max-width: 420px;
    max-height: 85vh;
    margin: 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ========================================
     터치 영역 확대
     ======================================== */

  a,
  button,
  .clickable,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 48px;
    min-width: 48px;
  }

  /* ========================================
     iOS safe area 대응
     ======================================== */

  @supports (padding: max(0px)) {

    .top-bar,
    .mobile-bottom-nav {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }

    .mobile-bottom-nav {
      padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
  }

  /* ========================================
     애니메이션
     ======================================== */

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .card,
  .list-item {
    animation: slideIn 0.3s ease-out;
  }

  /* ========================================
     스크롤바 스타일링
     ======================================== */

  ::-webkit-scrollbar {
    width: 6px;
  }

  ::-webkit-scrollbar-track {
    background: var(--bg-light);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--ink-muted);
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--ink);
  }

}

/* 작은 모바일 화면 (320px ~ 480px) */
@media (max-width: 480px) {
  .mode-switch-btn {
    min-width: 100%;
    margin-bottom: 4px;
  }

  .top-bar>.row {
    flex-direction: column;
  }

  .sidebar {
    width: 90vw;
  }

  .modal-box {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
}

/* ========================================
   모바일 하단 네비게이션 바 - 완전히 새로운 디자인
   ======================================== */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  min-height: 68px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  border-radius: 12px;
  margin: 0 4px;
  position: relative;
}

.mobile-bottom-nav .nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
  transition: width 0.3s ease;
}

.mobile-bottom-nav .nav-item:active {
  transform: scale(0.92);
  background: var(--input-bg);
}

.mobile-bottom-nav .nav-item svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.mobile-bottom-nav .nav-item.active {
  color: var(--accent);
  font-weight: 700;
}

.mobile-bottom-nav .nav-item.active::before {
  width: 40px;
}

.mobile-bottom-nav .nav-item.active svg {
  stroke-width: 2.5;
  transform: scale(1.1);
}

.mobile-bottom-nav .nav-item span {
  letter-spacing: 0.2px;
}

/* ========================================
   모바일 홈 화면 - 프로그램 소개 (모바일 전용)
   ======================================== */

/* ========================================
   통합 랜딩 페이지 (홈 화면) 스타일
   ======================================== */

.landing-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: var(--bg-light);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  animation: fadeInLanding 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-page.hidden {
  display: none !important;
}

@keyframes fadeInLanding {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 히어로 섹션 */
.hero-section {
  text-align: center;
  max-width: 900px;
  margin-bottom: 5rem;
  padding: 0 1rem;
}

.hero-section .hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.hero-section h1 {
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 2rem;
  letter-spacing: -2px;
}

.hero-section .highlight {
  background: linear-gradient(120deg, var(--accent) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-section p {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* 기능 카드 그리드 */
/* 슬라이더 컨테이너 */
.feature-slider-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin-bottom: 4rem;
  padding: 0 1rem;
}

/* 좌우 화살표 버튼 */
.feature-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--ink-muted);
}

.feature-slider-arrow:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.feature-slider-arrow svg {
  width: 20px;
  height: 20px;
}

.feature-slider-prev {
  left: -8px;
}

.feature-slider-next {
  right: -8px;
}

/* 화살표 비활성 상태 */
.feature-slider-arrow.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.feature-grid {
  display: flex;
  gap: 1rem;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.8rem 2rem;
  margin: 0;
  /* 스크롤바 숨기기 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.feature-grid::-webkit-scrollbar {
  display: none;
}

.feature-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: visible;
  flex: 0 0 256px;
  /* 카드의 최소/최대 너비를 고정 */
  scroll-snap-align: center;
  /* 스크롤 시 카드 중앙에 스냅 */
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  border-radius: 24px;
}

.feature-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-color: var(--accent);
}

.feature-card:hover::after {
  opacity: 0.03;
}

.card-icon-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  z-index: 1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover .card-icon-wrapper img {
  transform: scale(1.1);
}

.card-content {
  z-index: 1;
}

.card-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.card-content p {
  color: var(--ink-muted);
  line-height: 1.5;
  font-size: 0.85rem;
}

.card-footer {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  margin-top: auto;
  z-index: 1;
}

.card-footer svg {
  width: 20px;
  height: 20px;
  margin-left: 8px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  stroke-width: 3px;
}

.feature-card:hover .card-footer svg {
  transform: translateX(8px);
}

/* 푸터 */
.landing-footer {
  margin-top: auto;
  padding: 4rem 1rem;
  text-align: center;
  border-top: 1px solid var(--line);
  width: 100%;
  background: white;
}

.landing-footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.landing-footer p {
  color: var(--ink-muted);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.landing-footer .copyright {
  font-weight: 600;
  color: var(--ink);
}

/* 반응형 처리 */
@media (max-width: 90em) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
  }
}

@media (max-width: 48em) {
  .landing-page {
    padding: 3rem 1.5rem;
  }

  .hero-section {
    margin-bottom: 3.5rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .feature-card {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .card-content h3 {
    font-size: 1.3rem;
  }
}

/* ========================================
   앱 프로모션 섹션 (LTS v4)
   ======================================== */

.app-promo-section {
  width: 100%;
  padding: 6rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 4rem;
}

.promo-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.promo-content {
  flex: 1;
  max-width: 600px;
}

.promo-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.promo-content h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.promo-content p {
  font-size: 1.15rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* 주요 기능 리스트 */
.promo-features {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.promo-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  min-height: auto;
}

.check-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.1);
  padding: 4px;
  border-radius: 50%;
}

.promo-features span {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
}

/* 설치 가이드 박스 */
.install-guide-box {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.install-guide-box h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--ink);
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--ink);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step p {
  font-size: 0.95rem;
  margin: 0;
  color: var(--ink-muted);
}

/* 다운로드 버튼 */
.promo-download-btn {
  width: 100%;
  max-width: 320px;
  height: 56px;
  font-size: 1.1rem;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.promo-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
}

/* 이미지 영역 */
.promo-image-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 9/18;
  border-radius: 40px;
  background: #f1f5f9;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  border: 8px solid white;
  overflow: hidden;
}

.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 반응형 스타일 */
@media (max-width: 900px) {
  .promo-container {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .promo-content {
    margin: 0 auto;
  }

  .promo-features {
    align-items: center;
    text-align: left;
  }

  .step {
    text-align: left;
  }
}

/* 이미지 선명도 개선 */
.phone-frame img {
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
  /* 강제 하드웨어 가속으로 렌더링 품질 개선 유도 */
}

/* Unsaved Changes Indicator for Save Button */
.btn.unsaved {
  background-color: var(--win) !important;
  /* Green */
  color: white !important;
  border-color: var(--win) !important;
  animation: pulse-green 2s infinite;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes pulse-green {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* 3. 스켈레톤 로딩 (Skeleton Loading) */
.skeleton {
  background: #eee;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  border-radius: 5px;
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

@keyframes shareBtnPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(25,113,194,0.4); }
  50% { box-shadow: 0 4px 24px rgba(25,113,194,0.7); }
}

/* 4. 빈 상태 (Empty State) 디자인 개선 */
.empty-state-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin: 2rem auto;
  max-width: 400px;
}

.empty-state-icon {
  width: 120px;
  height: 120px;
  background-color: var(--surface-variant);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.empty-state-icon svg {
  width: 64px;
  height: 64px;
  color: var(--ink-muted);
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 1rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  max-width: 300px;
  line-height: 1.5;
}

.empty-state-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.empty-state-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background: var(--accent-dark);
}

/* ========================================
   12. 커뮤니티 게시판 스타일
   ======================================== */
.board-layout {
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.board-tabs::-webkit-scrollbar {
  height: 4px;
}

.board-tabs::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border-radius: 4px;
}

.board-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* ========================================
   Windows 13" FHD 최적화 (125% 배율: ~1536px)
   ======================================== */
@media (max-width: 96em) {
  /* 96em = 1536px @ 16px base */

  .top-bar {
    padding: 10px 16px;
  }

  .top-bar h1 {
    font-size: 1.1rem;
    gap: 6px;
  }

  .top-bar .btn {
    padding: 5px 10px;
    font-size: 0.85rem;
    gap: 5px;
  }

  .top-bar .btn svg {
    width: 1em;
    height: 1em;
  }

  .sidebar {
    width: 270px;
    padding: 18px;
    gap: 16px;
  }

  .main-view {
    padding: 18px;
  }

  .progress-mode .sidebar {
    padding: 18px 18px 0 18px;
  }

  .top-bar #user-email {
    font-size: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-bar .logo-text {
    font-size: 1rem;
  }

  .top-bar .version {
    font-size: 0.65rem !important;
  }

  /* 상단바 우측 영역 간격 축소 */
  .top-bar nav .row {
    gap: 4px;
  }
}

/* ========================================
   Windows 13" FHD 최적화 (150% 배율: ~1280px)
   ======================================== */
@media (max-width: 80em) {
  /* 80em = 1280px @ 16px base */

  html {
    font-size: 13px;
  }

  .top-bar {
    padding: 8px 12px;
  }

  .top-bar h1 {
    font-size: 1rem;
    gap: 4px;
  }

  .top-bar h1 svg {
    width: 24px;
    height: 24px;
  }

  .top-bar .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    gap: 4px;
    border-radius: 6px;
  }

  .top-bar .btn svg {
    width: 0.9em;
    height: 0.9em;
  }

  /* 네비게이션 버튼 간격 축소 */
  #top-bar-actions {
    gap: 3px !important;
  }

  .sidebar {
    width: 240px;
    padding: 14px;
    gap: 12px;
  }

  .main-view {
    padding: 14px;
  }

  .progress-mode .sidebar {
    padding: 14px 14px 0 14px;
  }

  .top-bar #user-email {
    font-size: 0.75rem;
    max-width: 150px;
  }

  .top-bar .logo-text {
    font-size: 0.9rem;
  }

  .top-bar .version {
    font-size: 0.6rem !important;
  }

  .top-bar-toggle {
    width: 34px !important;
    height: 34px !important;
    padding: 6px !important;
  }

  /* 로고 옆 버전 날짜 레이블 축소 */
  .top-bar h1 .version {
    padding: 1px 4px;
    font-size: 0.55rem !important;
  }

  /* 우측 버튼 영역 간격 */
  .top-bar nav .row {
    gap: 3px;
  }

  .top-bar nav>.row:last-child {
    gap: 5px;
    margin-left: 8px;
    padding-left: 8px;
  }

  /* 사이드바 폼 그룹 */
  .sidebar-form-group input {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .sidebar-form-group button {
    padding: 6px 10px;
  }

  /* 사이드바 헤더 */
  .sidebar-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .sidebar-header h2 {
    font-size: 1rem;
  }

  /* 카드 패딩 축소 */
  .card {
    padding: 14px;
  }

  #logout-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .theme-toggle {
    width: 28px !important;
    height: 28px !important;
  }
}

/* ========================================
   Windows 13" FHD 극소 화면 (150% + 스케일 ~1152px)
   ======================================== */
@media (max-width: 72em) {
  /* 72em = 1152px @ 16px base */

  html {
    font-size: 12px;
  }

  .top-bar .btn {
    padding: 3px 6px;
    font-size: 0.75rem;
    gap: 3px;
  }

  .sidebar {
    width: 220px;
    padding: 12px;
    gap: 10px;
  }

  .main-view {
    padding: 12px;
  }

  .top-bar #user-email {
    font-size: 0.7rem;
    max-width: 120px;
  }

  /* 네비게이션에서 SVG 아이콘 숨기고 텍스트만 표시 */
  .top-bar .mode-switch-btn svg {
    display: none;
  }

  .top-bar h1 .version {
    display: none;
  }
}

/* ========================================
   설정 모달
   ======================================== */
#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.settings-modal-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.settings-modal-box {
  position: relative;
  margin-top: 58px;
  margin-right: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  width: 300px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: settings-slide-in 0.15s ease-out;
}

@keyframes settings-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.settings-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.settings-close-btn {
  color: var(--ink-muted) !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
}

.settings-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.settings-account-email {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}

body[data-theme="dark"] .settings-account-email {
  background: rgba(255, 255, 255, 0.07);
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}

.settings-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

body[data-theme="dark"] .settings-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.settings-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  cursor: default;
}

.settings-item-row:hover {
  background: transparent !important;
}

.settings-item-row .theme-toggle {
  background: transparent;
  border: none;
}

.settings-danger-zone {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.settings-danger-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger, #fa5252);
  margin-bottom: 4px;
  padding: 0 12px;
}

.settings-item-danger {
  color: var(--danger, #fa5252) !important;
}

.settings-item-danger:hover {
  background: rgba(250, 82, 82, 0.1) !important;
}

.settings-item-primary {
  color: white !important;
  background: var(--primary, #2563eb) !important;
  justify-content: center;
  font-weight: 600 !important;
  margin-top: 4px;
}

.settings-item-primary:hover {
  background: #1d4ed8 !important;
  opacity: 0.95;
}

.settings-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.settings-btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 12px 4px;
  padding: 10px 16px;
  background-color: #1971c2;
  color: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}

.settings-btn-download:hover {
  background-color: #1864ab;
}

body[data-theme="dark"] .settings-btn-download {
  background-color: #339af0;
  color: #1a1a2e;
}

body[data-theme="dark"] .settings-btn-download:hover {
  background-color: #74c0fc;
}

/* ============================================================
   모바일 앱 홍보 섹션
   ============================================================ */
.mobile-promo-section {
  background: linear-gradient(135deg, #0f2027 0%, #1a3a5c 50%, #0d6efd22 100%);
  border-radius: 24px;
  margin: 40px 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: calc(100% - 32px);
  max-width: 900px;
}

.mobile-promo-inner {
  padding: 52px 40px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mobile-promo-badge {
  display: inline-block;
  background: rgba(51, 154, 240, 0.18);
  border: 1px solid rgba(51, 154, 240, 0.4);
  color: #74c0fc;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.mobile-promo-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 16px;
}

.mobile-promo-highlight {
  color: #74c0fc;
}

.mobile-promo-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 0 36px;
}

.mobile-promo-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
  width: 100%;
  max-width: 680px;
}

.mobile-promo-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px 18px;
  flex: 1 1 180px;
  text-align: left;
}

.mobile-promo-feature-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.mobile-promo-feature-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-promo-feature-text strong {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}

.mobile-promo-feature-text span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

.mobile-promo-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1971c2, #339af0);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 15px 32px;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(51,154,240,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 10px;
}

.mobile-promo-download-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mobile-promo-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(51,154,240,0.55);
}

.mobile-promo-os-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin: 0 0 36px;
}

/* 설치 가이드 */
.mobile-install-guide {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 32px 36px;
  width: 100%;
  max-width: 680px;
  text-align: left;
}

.mobile-install-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #74c0fc;
  margin: 0 0 24px;
}

.mobile-install-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: #1971c2;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 50%;
  margin-top: 1px;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-content strong {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

.step-content span {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
}

.step-content em {
  font-style: normal;
  color: #ffd43b;
}

.step-content code {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82rem;
  color: #a9e34b;
  font-family: monospace;
}

.mobile-install-tip {
  background: rgba(255, 212, 59, 0.08);
  border: 1px solid rgba(255, 212, 59, 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
}

.mobile-install-tip strong {
  color: #ffd43b;
}

/* 반응형 */
@media (max-width: 600px) {
  .mobile-promo-inner {
    padding: 36px 20px 32px;
  }

  .mobile-promo-features {
    flex-direction: column;
    gap: 12px;
  }

  .mobile-promo-feature {
    flex: unset;
  }

  .mobile-install-guide {
    padding: 24px 18px;
  }

  .mobile-promo-download-btn {
    font-size: 0.95rem;
    padding: 13px 22px;
    width: 100%;
    justify-content: center;
  }
}
