/**
 * P% 공통 스타일 - 다크모드
 * 프로젝트 사이드바, 관리 표(읽기 전용) 등
 */

/* 다크모드 색상 변수 */
:root {
  --flyne-bg: #0c0e12;
  --flyne-surface: #111318;
  --flyne-surface-alt: #161a22;
  --flyne-surface-elevated: #1a1f28;
  --flyne-border: #272d38;
  --flyne-border-subtle: #1e242e;
  --flyne-text: #e4e6eb;
  --flyne-text-muted: #8b92a0;
  --flyne-accent: #58b4e8;
  --flyne-accent-hover: #7ac8f4;
  --flyne-accent-bg: #1a2d42;
  --flyne-danger: #e85d5d;
  --flyne-danger-hover: #ef7777;
  --flyne-overlay: rgba(0, 0, 0, 0.75);
  --flyne-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 프로젝트 목록 사이드바 (화면 좌측 전체 높이) */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  min-width: 220px;
  background: var(--flyne-surface);
  border-right: 1px solid var(--flyne-border);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
/* 상단: 햄버거 메뉴 + 브랜드 (추후 랜딩·계정 등 연결) */
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 8px 10px 10px;
  border-bottom: 1px solid var(--flyne-border);
  flex-shrink: 0;
  min-height: 52px;
  box-sizing: border-box;
}
.sidebar-menu-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--flyne-text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
}
.sidebar-menu-btn:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-accent);
}
.sidebar-menu-btn:focus-visible {
  outline: 2px solid var(--flyne-accent);
  outline-offset: 2px;
}
.sidebar-menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  flex-shrink: 0;
}
.sidebar-brand {
  flex: 1;
  min-width: 0;
  padding: 0 4px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--flyne-accent);
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-brand-logo {
  display: block;
  max-width: 100%;
  max-height: 24px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  flex-shrink: 0;
  gap: 8px;
}
.sidebar-title {
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--flyne-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-add-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--flyne-border);
  border-radius: 6px;
  background: transparent;
  color: var(--flyne-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-add-btn:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-accent);
  border-color: var(--flyne-accent);
}
.sidebar-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  scrollbar-color: var(--flyne-border) var(--flyne-surface-alt);
  scrollbar-width: thin;
}
.sidebar-list::-webkit-scrollbar {
  width: 8px;
}
.sidebar-list::-webkit-scrollbar-track {
  background: var(--flyne-surface-alt);
  border-radius: 4px;
}
.sidebar-list::-webkit-scrollbar-thumb {
  background: var(--flyne-border);
  border-radius: 4px;
  border: 2px solid var(--flyne-surface-alt);
}
.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: var(--flyne-text-muted);
}
.sidebar-list li {
  margin: 0;
  display: flex;
  align-items: stretch;
}
.sidebar-list .sidebar-project-btn {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  color: var(--flyne-text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.sidebar-list .sidebar-delete-btn {
  flex-shrink: 0;
  width: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--flyne-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-list .sidebar-delete-btn:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-danger);
}
.sidebar-list a,
.sidebar-list button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  color: var(--flyne-text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.sidebar-list .sidebar-project-btn:hover,
.sidebar-list a:hover,
.sidebar-list button:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
.sidebar-list li.current .sidebar-project-btn,
.sidebar-list a.current,
.sidebar-list li.current button.sidebar-project-btn {
  background: var(--flyne-accent-bg);
  color: var(--flyne-accent);
  border-left: 3px solid var(--flyne-accent);
  padding-left: 13px;
}
.sidebar-list li.current .sidebar-delete-btn:hover {
  background: var(--flyne-accent-bg);
  color: var(--flyne-danger);
}
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  padding: 0 24px 56px 24px;
  --flyne-sticky-header-height: 90px;
}

.shared-table.table-wrap {
  display: inline-block;
  padding: 1px;
  background: var(--flyne-border);
  box-shadow: var(--flyne-shadow);
}
.shared-table table {
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--flyne-surface);
  border: none;
  table-layout: fixed;
  min-width: 600px;
}
.shared-table td {
  width: 72px;
  min-width: 72px;
  height: 72px;
  border: 1px solid var(--flyne-border);
  padding: 0;
  text-align: center;
  vertical-align: middle;
  font-size: 0.85rem;
  color: var(--flyne-text-muted);
  box-sizing: border-box;
}
.shared-table td:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
.shared-table tr.row-header td,
.shared-table tr.row-header th,
.table-wrap tr.row-header td,
.table-wrap tr.row-header th {
  height: auto;
  min-height: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--flyne-text-muted);
  border: none;
  position: sticky;
  top: var(--flyne-sticky-header-height, 90px);
  z-index: 5;
  background: var(--flyne-surface);
  box-shadow: 0 2px 0 var(--flyne-surface), 0 1px 0 var(--flyne-border),
    inset 0 1px 0 var(--flyne-border), inset 0 -1px 0 var(--flyne-border),
    inset 1px 0 0 var(--flyne-border), inset -1px 0 0 var(--flyne-border);
  transform: translateZ(0);
  backface-visibility: hidden;
  isolation: isolate;
}
.shared-table td.cell-thumbnail {
  width: calc(72px * var(--thumb-ratio, 1.778));
  min-width: calc(72px * var(--thumb-ratio, 1.778));
  max-width: calc(72px * var(--thumb-ratio, 1.778));
  height: 72px;
  padding: 2px;
  font-size: 0;
  line-height: 0;
  user-select: none;
  border-width: 1px;
  box-sizing: border-box;
}
.shared-table.read-only td.cell-thumbnail {
  cursor: default;
}
.shared-table tr.row-header th.cell-thumbnail-header {
  width: calc(72px * var(--thumb-ratio, 1.778));
  min-width: calc(72px * var(--thumb-ratio, 1.778));
  max-width: calc(72px * var(--thumb-ratio, 1.778));
  box-sizing: border-box;
}
.shared-table td.cell-worker-assign {
  cursor: pointer;
  color: var(--flyne-text-muted);
}
.shared-table td.cell-worker-assign:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
.shared-table td.cell-worker-assign.worker-cell-selected {
  background: rgba(96, 165, 250, 0.35);
  color: var(--flyne-text);
  outline: 2px solid var(--flyne-accent, #4f46e5);
  outline-offset: -2px;
}
.shared-table td.cell-status-assign {
  cursor: pointer;
  color: var(--flyne-text-muted);
}
.shared-table td.cell-status-assign:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
/* ANI 상태 셀 배경: ing 노란, conf 분홍, OK 연두 */
.shared-table td.cell-status-assign.status-ing {
  background: rgba(253, 224, 71, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-ing:hover {
  background: rgba(253, 224, 71, 0.6);
}
.shared-table td.cell-status-assign.status-conf {
  background: rgba(251, 113, 133, 0.4);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-conf:hover {
  background: rgba(251, 113, 133, 0.55);
}
.shared-table td.cell-status-assign.status-ok {
  background: rgba(134, 239, 172, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-ok:hover {
  background: rgba(134, 239, 172, 0.6);
}
.shared-table td.cell-status-assign.status-re {
  background: rgba(239, 68, 68, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-re:hover {
  background: rgba(239, 68, 68, 0.6);
}
.shared-table td.cell-status-assign.status-ready {
  background: rgba(96, 165, 250, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-ready:hover {
  background: rgba(96, 165, 250, 0.6);
}
.shared-table td.cell-status-assign.status-onhold {
  background: rgba(251, 146, 60, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-onhold:hover {
  background: rgba(251, 146, 60, 0.6);
}
.shared-table td.cell-status-assign.status-skip {
  background: rgba(156, 163, 175, 0.45);
  color: var(--flyne-text);
}
.shared-table td.cell-status-assign.status-skip:hover {
  background: rgba(156, 163, 175, 0.6);
}
.worker-picker-dropdown .worker-picker-item:hover {
  background: var(--flyne-surface-alt);
}
.worker-picker-clear-wrap {
  border-bottom: 1px solid var(--flyne-border);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.worker-picker-dropdown .worker-picker-clear:hover {
  background: var(--flyne-surface-alt);
}
.worker-picker-dropdown {
  scrollbar-color: var(--flyne-border) var(--flyne-surface);
  scrollbar-width: thin;
}
.worker-picker-dropdown::-webkit-scrollbar {
  width: 8px;
}
.worker-picker-dropdown::-webkit-scrollbar-track {
  background: var(--flyne-surface);
  border-radius: 4px;
}
.worker-picker-dropdown::-webkit-scrollbar-thumb {
  background: var(--flyne-border);
  border-radius: 4px;
}
.worker-picker-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--flyne-text-muted);
}
.shared-table td.cell-thumbnail:hover {
  background: var(--flyne-surface-alt);
}
.shared-table td.cell-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  outline: none;
}

/* 표 영역 */
.table-area {
  margin-bottom: 28px;
}
.shared-table td.cell-page-only {
  border-left: 1px solid var(--flyne-border);
  min-width: 72px;
  width: 72px;
  max-width: 72px;
  min-height: 72px;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}
.shared-table tr.row-header td.cell-page-only,
.shared-table tr.row-header th.cell-page-only {
  border-left: none;
}
.shared-table tr.row-header th.cell-page-only {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

/* 공정 모듈별 헤더 배경색 구분 (불투명 배경으로 스크롤 시 본문 표와 겹침 방지) */
.shared-table tr.row-header td.cell-mod-1,
.shared-table tr.row-header th.cell-mod-1 {
  background: #1a2740;
  color: var(--flyne-text);
}
.shared-table tr.row-header td.cell-mod-2,
.shared-table tr.row-header th.cell-mod-2 {
  background: #1a2e24;
  color: var(--flyne-text);
}
.shared-table tr.row-header td.cell-mod-3,
.shared-table tr.row-header th.cell-mod-3 {
  background: #2e251a;
  color: var(--flyne-text);
}
.shared-table tr.row-header td.cell-mod-4,
.shared-table tr.row-header th.cell-mod-4 {
  background: #231a2e;
  color: var(--flyne-text);
}
.shared-table tr.row-header td.cell-mod-5,
.shared-table tr.row-header th.cell-mod-5 {
  background: #2e1a28;
  color: var(--flyne-text);
}
.shared-table tr.row-header td.cell-mod-6,
.shared-table tr.row-header th.cell-mod-6 {
  background: #1a282e;
  color: var(--flyne-text);
}

/* 공유 열: 배경·불투명도 구분 */
.shared-table th[data-shared-column="true"] {
  opacity: 0.35;
  background: #3d4452 !important;
}
.shared-table td.cell-shared-status {
  opacity: 0.35;
}

/* 씬 사이 간격 행 */
tr.scene-spacer td.scene-spacer-cell {
  height: 14px;
  padding: 0;
  margin: 0;
  border: none;
  border-top: 2px solid var(--flyne-border);
  background: var(--flyne-bg);
  vertical-align: middle;
  line-height: 0;
}
tr.scene-spacer {
  background: var(--flyne-bg);
}

/* 씬 열 */
.shared-table td.cell-scene {
  width: 88px;
  min-width: 88px;
  background: var(--flyne-accent-bg);
  color: var(--flyne-accent);
  font-weight: 600;
  padding: 8px 10px;
  vertical-align: middle;
  text-align: center;
  border-right: 2px solid var(--flyne-border);
}

.nav-spacer {
  flex: 1;
  min-width: 12px;
}
.nav .btn-project-settings {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid var(--flyne-border);
  background: var(--flyne-surface-elevated);
  color: var(--flyne-text-muted);
  cursor: pointer;
  font-family: inherit;
}
.nav .btn-project-settings:hover {
  background: var(--flyne-border);
  color: var(--flyne-text);
  border-color: var(--flyne-text-muted);
}

/* 프로젝트 설정 모달 */
.project-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--flyne-overlay);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.project-settings-overlay.is-open {
  display: flex;
}
.project-settings-modal {
  background: var(--flyne-surface-elevated);
  border: 1px solid var(--flyne-border);
  border-radius: 12px;
  padding: 32px;
  min-width: 378px;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  box-shadow: var(--flyne-shadow);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.project-settings-modal h3 {
  margin: 0 0 24px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--flyne-text);
  letter-spacing: -0.01em;
}
.project-settings-modal .form-row {
  margin-bottom: 20px;
}
.project-settings-modal .form-row:last-of-type {
  margin-bottom: 0;
}
.project-settings-modal .form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--flyne-text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.project-settings-modal .form-row input,
.project-settings-modal .form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--flyne-border);
  border-radius: 8px;
  background: var(--flyne-surface);
  color: var(--flyne-text);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
  resize: vertical;
}
.project-settings-modal .form-row input:focus,
.project-settings-modal .form-row textarea:focus {
  outline: none;
  border-color: var(--flyne-accent);
  background: var(--flyne-surface-alt);
}
.project-settings-modal .form-row input::placeholder,
.project-settings-modal .form-row textarea::placeholder {
  color: var(--flyne-text-muted);
}
.project-settings-modal .form-row textarea {
  min-height: 140px;
  max-height: 140px;
  line-height: 1.6;
  resize: none;
  overflow: hidden;
}
.project-settings-modal .modal-buttons {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--flyne-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.project-settings-modal .modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  min-width: 80px;
}
.project-settings-modal .modal-buttons button.cancel {
  background: transparent;
  color: var(--flyne-text-muted);
  border: 1px solid var(--flyne-border);
}
.project-settings-modal .modal-buttons button.cancel:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
  border-color: var(--flyne-border);
}
.project-settings-modal .modal-buttons button.ok {
  background: var(--flyne-accent);
  color: var(--flyne-bg);
  border: 1px solid var(--flyne-accent);
}
.project-settings-modal .modal-buttons button.ok:hover {
  background: var(--flyne-accent-hover);
  border-color: var(--flyne-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 180, 232, 0.3);
}
.project-settings-modal .modal-buttons button.ok:active {
  transform: translateY(0);
}

/* ART/ANI/3D/COMP 페이지 설정 모달 (작업자 이름) */
.page-settings-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--flyne-overlay);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.page-settings-overlay.is-open {
  display: flex;
}
.page-settings-modal {
  background: var(--flyne-surface-elevated);
  border: 1px solid var(--flyne-border);
  border-radius: 8px;
  padding: 24px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: var(--flyne-shadow);
}
.page-settings-modal h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  color: var(--flyne-text);
}
.page-settings-modal .worker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.page-settings-modal .worker-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--flyne-border);
  border-radius: 6px;
  background: var(--flyne-surface);
  color: var(--flyne-text);
  font-size: 0.95rem;
  box-sizing: border-box;
}
.page-settings-modal .worker-row input::placeholder {
  color: var(--flyne-text-muted);
}
.page-settings-modal .worker-row .worker-remove-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--flyne-border);
  color: var(--flyne-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.page-settings-modal .worker-row .worker-remove-btn:hover:not(:disabled) {
  background: var(--flyne-danger, #b91c1c);
  color: #fff;
}
.page-settings-modal .worker-row .worker-remove-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-settings-modal .worker-add-btn {
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid var(--flyne-border);
  border-radius: 6px;
  background: var(--flyne-surface-alt);
  color: var(--flyne-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.page-settings-modal .worker-add-btn:hover {
  background: var(--flyne-border);
  color: var(--flyne-text);
}
.page-settings-modal .modal-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.page-settings-modal .modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}
.page-settings-modal .modal-buttons button.cancel {
  background: var(--flyne-border);
  color: var(--flyne-text);
}
.page-settings-modal .modal-buttons button.ok {
  background: var(--flyne-accent);
  color: var(--flyne-bg);
}

/* 페이지 공통 다크모드 (body, nav, header) */
html {
  scrollbar-gutter: stable;
}
body {
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
  margin: 0;
  background: var(--flyne-bg);
  color: var(--flyne-text);
  min-height: 100vh;
}
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--flyne-bg);
  padding: 0 24px;
  margin-bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--flyne-sticky-header-height, 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 1px 0 var(--flyne-bg);
}
.nav {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--flyne-surface-elevated);
  border-top: 1px solid var(--flyne-border);
  z-index: 100;
}
.nav a {
  color: var(--flyne-text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.nav a:hover {
  color: var(--flyne-text);
  background: var(--flyne-surface);
}
.nav a.current {
  color: var(--flyne-accent);
  font-weight: 500;
}
.nav a.schedule-label-default:not(.current) {
  color: #363b45;
}
.header {
  text-align: center;
  margin-bottom: 0;
}
.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--flyne-accent);
  margin: 0;
}
.header .page-name,
.header .page-desc,
.header p {
  font-size: 1rem;
  color: var(--flyne-text-muted);
  margin: 0;
}
.header .page-desc,
.header p {
  font-size: 0.9rem;
}
.header#page-settings-trigger,
.header#page-settings-trigger .page-name,
.header#page-settings-trigger .page-desc {
  cursor: pointer;
}

/* —— 햄버거 앱 메뉴 패널 (projects.js에서 생성) —— */
body.flyne-app-menu-open {
  overflow: hidden;
}
.flyne-app-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--flyne-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.flyne-app-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.flyne-app-menu-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(300px, 92vw);
  max-width: 100%;
  background: var(--flyne-surface-elevated);
  border-right: 1px solid var(--flyne-border);
  box-shadow: var(--flyne-shadow);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.flyne-app-menu-overlay.is-open .flyne-app-menu-panel {
  transform: translateX(0);
}
.flyne-app-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--flyne-border);
  flex-shrink: 0;
}
.flyne-app-menu-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--flyne-text);
  letter-spacing: 0.02em;
}
.flyne-app-menu-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--flyne-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flyne-app-menu-close:hover {
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
.flyne-app-menu-nav {
  padding: 10px 0;
  flex: 1;
  overflow-y: auto;
}
.flyne-app-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--flyne-text);
  cursor: pointer;
  gap: 10px;
  box-sizing: border-box;
}
.flyne-app-menu-item:hover {
  background: var(--flyne-surface-alt);
}
.flyne-app-menu-item:focus-visible {
  outline: 2px solid var(--flyne-accent);
  outline-offset: -2px;
}
.flyne-app-menu-item-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.85;
  color: var(--flyne-text-muted);
}
.flyne-app-menu-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--flyne-border);
  font-size: 0.75rem;
  color: var(--flyne-text-muted);
  line-height: 1.45;
  flex-shrink: 0;
}

/* Firebase 계정 UI (auth-ui.js) */
main.main-content > .header,
main.main-content > .schedule-header-sticky > .header {
  position: relative;
  padding-right: 118px;
}
.flyne-header-auth {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  max-width: min(220px, 42vw);
}
.flyne-auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.flyne-auth-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--flyne-border);
  object-fit: cover;
  flex-shrink: 0;
}
.flyne-auth-avatar-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--flyne-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}
.flyne-auth-bar-name {
  font-size: 0.82rem;
  color: var(--flyne-text-muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flyne-auth-bar-login,
.flyne-auth-bar-logout {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--flyne-border);
  background: var(--flyne-surface-alt);
  color: var(--flyne-text);
}
.flyne-auth-bar-login:hover,
.flyne-auth-bar-logout:hover {
  border-color: var(--flyne-accent);
  color: var(--flyne-accent);
}
.flyne-auth-bar-nosetup {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px dashed var(--flyne-border);
  background: transparent;
  color: var(--flyne-text-muted);
}
.flyne-auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--flyne-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.flyne-auth-modal-overlay.flyne-auth-modal-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.flyne-auth-modal-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--flyne-surface-elevated);
  border: 1px solid var(--flyne-border);
  border-radius: 16px;
  padding: 40px 28px 28px;
  box-shadow: var(--flyne-shadow);
}
.flyne-auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--flyne-surface-alt);
  color: var(--flyne-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.flyne-auth-modal-close:hover {
  color: var(--flyne-text);
}
.flyne-auth-modal-title {
  margin: 0 0 20px 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--flyne-accent);
}
.flyne-auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--flyne-border);
  background: var(--flyne-surface);
  color: var(--flyne-text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.flyne-auth-google-btn:hover {
  border-color: var(--flyne-text-muted);
}
.flyne-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--flyne-text-muted);
  font-size: 0.8rem;
}
.flyne-auth-divider::before,
.flyne-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--flyne-border);
}
.flyne-auth-field {
  margin-bottom: 12px;
}
.flyne-auth-field label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--flyne-text-muted);
}
.flyne-auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--flyne-border);
  background: var(--flyne-bg);
  color: var(--flyne-text);
  font-size: 0.9rem;
  font-family: inherit;
}
.flyne-auth-field input:focus {
  outline: none;
  border-color: var(--flyne-accent);
}
.flyne-auth-forgot-wrap {
  text-align: right;
  margin-bottom: 12px;
}
.flyne-auth-forgot {
  font-size: 0.78rem;
  color: var(--flyne-accent);
  text-decoration: none;
}
.flyne-auth-submit {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--flyne-accent);
  color: var(--flyne-bg);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.flyne-auth-submit:hover {
  background: var(--flyne-accent-hover);
}
.flyne-auth-switch {
  margin: 16px 0 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--flyne-text-muted);
}
.flyne-auth-switch a {
  color: var(--flyne-accent);
  text-decoration: none;
}
.flyne-auth-landing-hint {
  margin: 14px 0 0 0;
  text-align: center;
  font-size: 0.75rem;
}
.flyne-auth-landing-hint a {
  color: var(--flyne-text-muted);
}

/* —— 모바일(좁은 화면): 사이드바 드로어 + 전체 너비 메인/하단 네비 —— */
.flyne-sidebar-backdrop {
  display: none;
}
.flyne-mobile-app-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .flyne-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2540;
    background: var(--flyne-overlay);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  body.flyne-sidebar-open .flyne-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .app-layout .sidebar {
    width: min(280px, 86vw);
    min-width: 0;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2560;
    box-shadow: none;
  }
  body.flyne-sidebar-open .app-layout .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }

  .main-content {
    margin-left: 0 !important;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    min-width: 0;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .nav {
    left: 0 !important;
    right: 0 !important;
    padding: 8px max(6px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 4px;
  }
  .nav a {
    font-size: 0.7rem;
    padding: 8px 6px;
    flex: 0 1 auto;
    text-align: center;
  }

  /* 상단 헤더: 계정 UI가 제목과 겹치지 않게 */
  main.main-content > .header,
  main.main-content > .schedule-header-sticky > .header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    text-align: center;
  }
  main.main-content > .header .page-desc,
  main.main-content > .header p {
    flex: 1 1 100%;
    order: 0;
  }
  .flyne-header-auth {
    position: static !important;
    transform: none !important;
    order: 1;
    max-width: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
  }
  .flyne-auth-bar {
    justify-content: center;
  }

  .schedule-header-sticky {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .production-subnav,
  .team-subnav {
    flex-wrap: wrap;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
  .schedule-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding-bottom: 4px;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .schedule-subnav button,
  .schedule-subnav a {
    flex-shrink: 0;
  }

  .content {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }

  .main-content .table-wrap,
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .flyne-mobile-app-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--flyne-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
  }
  .flyne-mobile-app-menu-btn:hover,
  .flyne-mobile-app-menu-btn:focus-visible {
    background: var(--flyne-surface-alt);
    color: var(--flyne-accent);
    outline: none;
  }

  .flyne-app-menu-overlay {
    z-index: 2580;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
}
