/* ===================================================================
   styles.css - MakeIt WoodCraft DIY 가구 설계 & 재료 산출 스튜디오
   =================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  
  /* Color Tokens - Deep Woodcraft Studio Theme */
  --bg-main: #0c0f14;
  --bg-surface: #141821;
  --bg-surface-elevated: #1d222e;
  --bg-surface-subtle: #252b3b;
  --border-subtle: #2e3547;
  --border-focus: #f59e0b;

  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);

  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.15);

  --accent-sky: #38bdf8;
  --accent-sky-subtle: rgba(56, 189, 248, 0.15);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(245, 158, 11, 0.25);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================= Light Mode (밝게 모드) Theme Tokens ================= */
body.light-mode {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-subtle: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #d97706;

  --accent-amber: #d97706;
  --accent-amber-hover: #b45309;
  --accent-amber-subtle: rgba(217, 119, 6, 0.12);

  --accent-emerald: #059669;
  --accent-emerald-subtle: rgba(5, 150, 105, 0.12);

  --accent-sky: #0284c7;
  --accent-sky-subtle: rgba(2, 132, 199, 0.12);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 0 24px rgba(217, 119, 6, 0.2);
}

/* Light mode specific element styling */
body.light-mode .header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

body.light-mode .brand h1 {
  color: #0f172a;
}

body.light-mode .viewport-container {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-mode .viewport-tabs-bar {
  background: #ffffff;
  border-color: #cbd5e1;
}

body.light-mode .view-tab-btn {
  color: #64748b;
  border-color: transparent;
}

body.light-mode .view-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

body.light-mode .view-tab-btn.active {
  color: #d97706;
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.4);
}

body.light-mode .category-card-btn {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-mode .category-card-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-mode .category-card-btn.active {
  background: #fffbeb;
  border-color: #d97706;
}

body.light-mode .template-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

body.light-mode .template-chip:hover {
  background: #e2e8f0;
}

body.light-mode .template-chip.active {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

body.light-mode .plywood-highlight-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

body.light-mode .sub-tab-item {
  color: #64748b;
}

body.light-mode .sub-tab-item.active {
  color: #d97706;
  border-bottom-color: #d97706;
}

body.light-mode .bom-table th {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

body.light-mode .bom-table td {
  border-color: #f1f5f9;
  color: #1e293b;
}

body.light-mode .bom-table tr:hover {
  background: #f8fafc;
}

body.light-mode .control-slider {
  background: #e2e8f0;
}

body.light-mode .value-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-mode select,
body.light-mode input[type="number"],
body.light-mode input[type="text"] {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-mode .blueprint-subnav {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.light-mode .blueprint-view-panel {
  background: #ffffff;
}

body.light-mode .cutlist-view-panel {
  background: #ffffff;
}

/* Theme Toggle Button Style */
.btn-theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-theme-toggle:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 15px;
  line-height: 1;
}

.theme-label {
  letter-spacing: -0.2px;
}

/* ================= 저장 / 불러오기 버튼 ================= */
.btn-save-design,
.btn-load-design {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-save-design {
  background: linear-gradient(135deg, #065f46, #059669);
  border: 1px solid rgba(5, 150, 105, 0.4);
  color: #ffffff;
}

.btn-save-design:hover {
  background: linear-gradient(135deg, #047857, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.btn-load-design {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-load-design:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  transform: translateY(-1px);
}

/* Light mode 버튼 조정 */
body.light-mode .btn-load-design {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-mode .btn-load-design:hover {
  border-color: #d97706;
  color: #d97706;
}

/* ================= 모달 공통 스타일 ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-box-wide {
  max-width: 680px;
}

@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.modal-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-main);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.modal-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.modal-input-hint {
  font-size: 11px;
  color: var(--text-subtle);
}

.modal-storage-info {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.modal-search-row {
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ================= 설계 목록 카드 ================= */
.design-list-container {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.design-list-container::-webkit-scrollbar {
  width: 4px;
}

.design-list-container::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.design-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.design-card:hover {
  border-color: var(--accent-amber);
  background: var(--accent-amber-subtle);
}

.design-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.design-card-info {
  flex: 1;
  min-width: 0;
}

.design-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-card-meta {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}

.design-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.design-card-load-btn,
.design-card-delete-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.design-card-load-btn {
  background: var(--accent-amber-subtle);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
}

.design-card-load-btn:hover {
  background: var(--accent-amber);
  color: #000;
}

.design-card-delete-btn {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-subtle);
}

.design-card-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.design-list-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-subtle);
}

.design-empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.design-empty-sub {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-subtle);
}

/* Toast 알림 */
.wc-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.wc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wc-toast.success { border-color: #059669; color: #059669; }
.wc-toast.error   { border-color: #ef4444; color: #ef4444; }

/* Light mode 모달 조정 */
body.light-mode .modal-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-mode .modal-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-mode .design-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-mode .design-card:hover {
  background: #fffbeb;
  border-color: #d97706;
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================= Top Navigation Bar ================= */
.header {
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand:active {
  transform: scale(0.98);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Export Dropdown Menu */
.export-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.export-main-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ext-badge-pill {
  background: var(--accent-amber);
  color: #0c0f14;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  letter-spacing: -0.2px;
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #141824;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 16px rgba(245, 158, 11, 0.2);
  min-width: 320px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  animation: fadeIn 0.18s ease-out;
}

.export-dropdown-menu .dropdown-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.export-dropdown-menu .dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.export-dropdown-menu .dropdown-item:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
}

.export-dropdown-menu .dropdown-item.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
}

.export-dropdown-menu .ext-icon {
  font-size: 20px;
  line-height: 1.2;
}

.export-dropdown-menu .ext-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-dropdown-menu .ext-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-dropdown-menu .rec-tag {
  font-size: 9px;
  font-weight: 800;
  background: var(--accent-amber);
  color: #0c0f14;
  padding: 1px 5px;
  border-radius: 3px;
}

.export-dropdown-menu .ext-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--text-subtle);
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0c0f14;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

/* ================= Main App Layout ================= */
.app-container {
  display: grid;
  grid-template-columns: 350px 1fr 400px;
  gap: 16px;
  padding: 16px;
  flex: 1;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1400px) {
  .app-container {
    grid-template-columns: 320px 1fr;
  }
  .panel-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1000px) {
  .app-container {
    display: flex;
    flex-direction: column;
  }
}

/* Common Card Panel Styles */
.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* ================= 1. Category Selector (8 Main Categories) ================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.category-card-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--text-muted);
  text-align: left;
}

.category-card-btn:hover {
  border-color: var(--accent-amber);
  color: var(--text-main);
  background: var(--bg-surface-subtle);
  transform: translateY(-1px);
}

.category-card-btn.active {
  border-color: var(--accent-amber);
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  box-shadow: inset 0 0 0 1px var(--accent-amber);
}

.category-icon,
.cat-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.category-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-name,
.cat-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-subtext,
.cat-subtext {
  font-size: 10px;
  color: var(--text-subtle);
}

.category-card-btn.active .category-subtext,
.category-card-btn.active .cat-subtext {
  color: rgba(245, 158, 11, 0.8);
}

/* ================= 2. Sub-Template Chip Group ================= */
.template-chip-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.template-chip {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.template-chip:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.template-chip.active {
  border-color: var(--accent-amber);
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent-amber);
}

.template-chip-badge,
.chip-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-subtle);
}

.template-chip.active .template-chip-badge,
.template-chip.active .chip-badge {
  color: rgba(245, 158, 11, 0.85);
}

/* ================= 2.5 Lumber Size Chips ================= */
.lumber-size-chip {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lumber-size-chip:hover {
  border-color: #3b82f6;
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.lumber-size-chip.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #2563eb;
}

body.light-mode .lumber-size-chip.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e40af;
}

/* ================= 3. Coating & Surface Finishing ================= */
.coating-control-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coating-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coating-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.toggle-switch-group {
  display: flex;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn:hover {
  color: var(--text-main);
}

.toggle-btn.active {
  background: var(--accent-amber);
  color: #0c0f14;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.coating-subpanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.coating-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
}

.coating-type-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.coating-type-btn:hover {
  color: var(--text-main);
}

.coating-type-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-amber);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

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

.color-chip-btn {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.color-chip-btn:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.color-chip-btn.active {
  border-color: var(--accent-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.color-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.color-chip-btn.active .color-circle::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.color-name-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.color-chip-btn.active .color-name-label {
  color: var(--accent-amber);
}

.coating-selected-info {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-amber);
  border-radius: 4px;
  padding: 8px 10px;
}

.coating-info-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 2px;
}

.coating-info-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Form Controls & Sliders */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.control-label-row strong {
  color: var(--text-main);
  font-weight: 600;
}

.control-val-badge {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
  background: var(--bg-surface-elevated);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* 직접 숫자 입력 필드 (Direct Parametric Dimension Input) */
.param-input-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-elevated, #161b26);
  border: 1.5px solid var(--border-subtle, #334155);
  border-radius: 6px;
  padding: 3px 10px;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.param-input-wrap:focus-within,
.param-input-wrap:hover {
  border-color: var(--accent-amber, #f59e0b);
  background: rgba(26, 32, 44, 0.95);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.param-num-input {
  font-family: "JetBrains Mono", "SF Mono", monospace, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-amber, #f59e0b);
  background: transparent;
  border: none;
  outline: none;
  width: 66px;
  text-align: right;
  padding: 0;
  margin: 0;
  -moz-appearance: textfield;
}

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

.param-input-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  margin-left: 4px;
  user-select: none;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface-subtle);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* 파라메트릭 치수 조절 드래그 슬라이더 (Dimension Range Slider & Drag Controller) */
.dim-drag-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.dim-drag-group:hover,
.dim-drag-group:focus-within {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.4);
}

.dim-label-drag-target:hover .dim-drag-icon {
  transform: scale(1.2);
  opacity: 1;
}

.dim-step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 4px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  width: 20px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.dim-step-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
}

.dim-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #1e293b, #334155);
  outline: none;
  cursor: pointer;
  margin: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dim-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  cursor: grab;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dim-range-slider::-webkit-slider-thumb:hover,
.dim-range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.9), inset 0 1px 2px #fff;
}

.dim-range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  cursor: grab;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
  border: 2px solid #ffffff;
}

body.light-mode .dim-drag-group {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-mode .dim-drag-group:hover,
body.light-mode .dim-drag-group:focus-within {
  background: #f0f9ff;
  border-color: #93c5fd;
}

body.light-mode .dim-step-btn {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-mode .dim-step-btn:hover {
  background: #2563eb;
  color: #fff;
}

body.light-mode .dim-range-slider {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* Thickness Radio Pills */
.pill-radio-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pill-radio-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pill-radio-btn:hover {
  border-color: var(--accent-amber);
  color: var(--text-main);
}

.pill-radio-btn.active {
  background: var(--accent-amber);
  color: #0c0f14;
  border-color: var(--accent-amber);
}

/* Material Selector Dropdown & Swatch */
.material-select-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.select-native {
  width: 100%;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.select-native:focus {
  border-color: var(--accent-amber);
}

.material-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wood-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
}

.material-info-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ================= Center Viewport Area ================= */
.panel-center {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viewport-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 12px;
}

.view-tabs {
  display: flex;
  gap: 6px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.view-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.view-tab-btn.active {
  color: #fff;
  background: var(--bg-surface-subtle);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.view-tab-btn.tab-cutlist.active {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.viewport-container {
  flex: 1;
  background: #14171f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  min-height: 520px;
  max-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-viewport {
  width: 100%;
  height: 100%;
  display: block;
}

/* 3D Overlays (Controls, Explode Slider, Camera Tools) */
.viewport-overlay-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  max-width: calc(100% - 24px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 3px;
}

.viewport-overlay-top::-webkit-scrollbar {
  height: 3px;
}

.viewport-overlay-top::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 3px;
}

.viewport-overlay-sub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dim-tag-badge {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-sky);
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewport-overlay-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.explode-controller-box {
  pointer-events: auto;
  background: rgba(20, 24, 33, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.explode-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.camera-tools {
  pointer-events: auto;
  display: flex;
  gap: 6px;
}

.cam-btn {
  background: rgba(20, 24, 33, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.cam-btn:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  border-color: var(--accent-amber);
}

/* 2D Blueprint & Cutlist Views Container */
.blueprint-view-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
}

#blueprint-canvas {
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.22);
  display: block;
  box-sizing: border-box;
}

body.light-mode #blueprint-canvas {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(2, 132, 199, 0.22);
}

.cutlist-view-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  box-sizing: border-box;
}

.blueprint-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.subnav-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.subnav-btn.active {
  background: var(--accent-sky-subtle);
  color: var(--accent-sky);
  border-color: rgba(56, 189, 248, 0.4);
}

/* ================= Right Panel: Plywood Calculation & BOM ================= */
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
  min-height: 0;
}

/* ★★★ 핵심: 1220x2440mm 합판 소요량 하이라이트 배너 (재단표 증가 시에도 크기 고정 및 상단 고정) ★★★ */
.plywood-highlight-banner {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(20, 24, 33, 0.98) 100%);
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-right > .card-panel {
  flex-shrink: 0;
}

.plywood-highlight-banner::after {
  content: '1220 × 2440 mm';
  position: absolute;
  right: -10px;
  bottom: -12px;
  font-size: 32px;
  font-weight: 900;
  color: rgba(16, 185, 129, 0.05);
  pointer-events: none;
  letter-spacing: -1px;
}

.banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 원판 규격 선택 및 직접 입력 컨트롤 스타일 */
.sheet-spec-control-box {
  background: rgba(12, 16, 26, 0.75);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.sheet-spec-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-size-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sheet-size-select {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.sheet-size-select:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.custom-sheet-inputs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(4, 120, 87, 0.15);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(16, 185, 129, 0.5);
}

.custom-sheet-field {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.custom-sheet-field input {
  width: 62px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
}

.custom-sheet-field input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}

.custom-sheet-x {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: bold;
}

.btn-apply-custom-sheet {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-emerald);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-apply-custom-sheet:hover {
  background: #059669;
  transform: translateY(-1px);
}

.banner-sheet-display {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.banner-sheet-display .num {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  word-break: keep-all;
}

.banner-sheet-display .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.banner-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-item .lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-item .val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.progress-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Right Panel Tabs (BOM, Hardware, Cost, Assembly) */
.sub-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.sub-tab-item {
  flex: 1;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.sub-tab-item:hover {
  color: var(--text-main);
}

.sub-tab-item.active {
  color: var(--accent-amber);
  border-bottom-color: var(--accent-amber);
  background: var(--accent-amber-subtle);
}

/* BOM Table */
.bom-table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bom-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

.bom-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.part-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.dim-code {
  font-family: monospace;
  font-weight: 600;
  color: var(--accent-sky);
}

/* Hardware & Supplies Checklist */
.supplies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supply-item-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.supply-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.supply-qty-badge {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.supply-item-tip {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  border-radius: 4px;
}

/* Cost Breakdown Card */
.cost-breakdown-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.cost-row strong {
  color: var(--text-main);
}

.cost-total-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.cost-total-row .total-price {
  font-size: 22px;
  color: var(--accent-amber);
  font-family: monospace;
}

/* Assembly Controls & Timeline */
.assembly-control-bar {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Assembly Mode Switcher (전체 / 서랍 단독 / 레일 부착) */
.assembly-mode-nav {
  display: flex;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 4px;
}

.btn-assembly-mode {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.btn-assembly-mode:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-assembly-mode.active {
  background: var(--accent-amber);
  color: #0c0f14;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  border-color: var(--accent-amber);
}

.assembly-sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.assembly-btn-group {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 6px;
}

.btn-assembly-ctrl {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-assembly-ctrl:hover {
  border-color: var(--accent-amber);
  background: var(--bg-surface-elevated);
  color: var(--accent-amber);
}

.btn-assembly-ctrl.active-play {
  background: var(--accent-amber);
  color: #0c0f14;
  border-color: var(--accent-amber);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.assembly-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 18px;
}

.assembly-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-step:hover {
  border-color: var(--accent-amber);
  background: var(--bg-surface-subtle);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.timeline-step.active-step {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
  transform: translateX(4px);
}

.step-marker {
  position: absolute;
  left: -18px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #475569;
  border: 2px solid var(--bg-surface);
  transition: var(--transition);
}

.timeline-step:hover .step-marker {
  background: var(--accent-amber);
}

.timeline-step.active-step .step-marker {
  background: #f59e0b;
  box-shadow: 0 0 12px #f59e0b;
  transform: scale(1.3);
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-step.active-step .step-title {
  color: var(--accent-amber);
}

.step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.step-action-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.timeline-step:hover .step-action-tag {
  color: var(--accent-amber);
  background: var(--accent-amber-subtle);
}

.timeline-step.active-step .step-action-tag {
  background: var(--accent-amber);
  color: #0c0f14;
  font-weight: 700;
}

#sec-assembly {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-right: 8px;
}

/* 3D Viewport Assembly HUD Banner */
.assembly-hud-banner {
  position: absolute;
  top: 56px;
  left: 14px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--accent-amber);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  pointer-events: auto;
  animation: slideDownFade 0.25s ease-out;
}

.hud-step-pill {
  background: var(--accent-amber);
  color: #0c0f14;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
}

.hud-step-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.hud-step-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
  transition: var(--transition);
}

.hud-step-close:hover {
  color: var(--text-main);
}

/* ================= Cutlist Sheet Detail View ================= */
.sheet-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  align-items: center;
}

.single-sheet-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  max-width: 760px;
  width: 100%;
}

.single-sheet-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.sheet-canvas {
  display: block;
  border-radius: 4px;
}

/* ================= Footer ================= */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-subtle);
  background: var(--bg-surface);
}

/* ================= 3D Part Hover Tooltip HUD ================= */
.part-hover-hud {
  position: absolute;
  z-index: 50;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  transition: opacity 0.15s ease;
}

.part-hover-hud .hud-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.part-hover-hud .hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.part-hover-hud .hud-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.part-hover-hud .hud-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.part-hover-hud .hud-dim {
  font-size: 15px;
  font-weight: 700;
  font-family: monospace;
  color: var(--accent-sky);
  letter-spacing: -0.3px;
}

.part-hover-hud .hud-tip {
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* BOM Table Row Active Glow on 3D Selection */
.bom-table tr.highlighted-part-row {
  background: rgba(245, 158, 11, 0.22) !important;
  outline: 1px solid var(--accent-amber);
  transition: background 0.3s ease;
}

.bom-table tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.bom-table tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   A4 Blueprint Print Preview Modal & @media print Styles
   ========================================================================== */

/* Modal Backdrop */
.print-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.print-modal-container {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  width: 100%;
  max-width: 1140px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.print-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #1e293b;
  border-bottom: 1px solid var(--border-subtle);
}

.print-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.print-modal-title .p-icon {
  font-size: 24px;
}

.print-modal-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.print-modal-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.print-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Print Modal Tabs for Independent Section Selection */
.print-modal-tabs {
  display: flex;
  gap: 6px;
  background: #151e2e;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  align-items: center;
}

.pm-tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pm-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.pm-tab-btn.active {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Assembly Steps inside Print Sheet */
.print-assembly-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

.print-assembly-step-card {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 8px 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  page-break-inside: avoid;
}

.p-step-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.p-step-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.p-step-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0284c7;
}

.p-step-desc {
  font-size: 11px;
  color: #334155;
  line-height: 1.45;
}

.p-step-tips {
  font-size: 10.5px;
  color: #059669;
  font-weight: 600;
}

.print-sheet-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #090d16;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Realistic White A4 Sheet (A4 세로 표준 규격 프리뷰: 1 : 1.414) */
.print-a4-sheet {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 780px;
  min-height: 1060px;
  padding: 24px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Pretendard", sans-serif;
  box-sizing: border-box;
}

/* Sheet Header Title Block (표제란) */
.sheet-title-block {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border: 2px solid #0f172a;
  padding: 10px 16px;
  background: #f8fafc;
  gap: 16px;
}

.sheet-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1.5px solid #cbd5e1;
  padding-right: 12px;
}

.sheet-brand .sb-icon {
  font-size: 24px;
}

.sb-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.sheet-meta-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}

.sm-item {
  display: flex;
  flex-direction: column;
  font-size: 11px;
}

.sm-lbl {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.sm-item strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 1. 가구 형상 3D & 2D 2컬럼 레이아웃 */
.sheet-visuals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

.sheet-visuals-grid.single-view {
  display: block;
}

.sheet-visuals-grid.single-view .sheet-visual-card {
  width: 100%;
}

.sheet-visuals-grid.single-view .sheet-visual-body {
  min-height: 580px;
}

.sheet-visuals-grid.single-view .print-3d-img {
  height: 600px;
  max-height: 680px;
}

.sheet-visuals-grid.single-view .print-2d-canvas,
.sheet-visuals-grid.single-view #print-sheet-canvas {
  height: 600px;
  max-height: 680px;
}

.sheet-visual-card {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.sheet-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  display: inline-block;
  width: fit-content;
}

.sheet-visual-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  min-height: 220px;
}

.print-3d-img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.print-2d-canvas {
  width: 100%;
  height: 240px;
  object-fit: contain;
  display: block;
}

/* 2D 삼각도법 3면도 (정면도, 평면도, 측면도) 멀티뷰 레이아웃 */
.print-2d-multiview-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  min-height: auto !important;
}

.print-ortho-view-card {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.print-ortho-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 6px;
}

.print-ortho-badge .pob-title {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
}

.print-ortho-badge .pob-sub {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
}

.print-ortho-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.print-2d-subcanvas {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #ffffff;
  border-radius: 2px;
}

.sheet-visuals-grid.single-view .print-ortho-front .print-2d-subcanvas {
  max-height: 380px;
}

.sheet-visuals-grid.single-view .print-ortho-top .print-2d-subcanvas,
.sheet-visuals-grid.single-view .print-ortho-side .print-2d-subcanvas {
  max-height: 300px;
}

/* 2. 원판 재단배치도 영역 */
.sheet-nesting-section {
  margin: 10px 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.print-nesting-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.print-sheet-card {
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 14px 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.print-sheet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e2e8f0;
  gap: 12px;
}

.ps-head-badge {
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.ps-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #0f172a;
}

.ps-sheet-badge {
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.ps-sheet-dims {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.ps-sheet-page-tag {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.ps-head-meta {
  font-size: 11px;
  color: #475569;
  margin-top: 3px;
}

.ps-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ps-stat-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.ps-stat-badge.efficiency {
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  border: 1px solid #a7f3d0;
}
.ps-stat-badge.count {
  background: #f0f9ff;
  color: #0369a1;
  font-weight: 600;
}
.ps-stat-badge.scrap {
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
}

.print-sheet-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  padding: 6px 0;
  width: 100%;
}

.print-nesting-canvas {
  max-height: 520px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.print-sheet-parts-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
}

.ps-parts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.ps-parts-hint {
  font-size: 9.5px;
  font-weight: 500;
  color: #64748b;
}

.ps-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 4px 8px;
}

.ps-part-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 6px;
}

.ps-chip-num {
  font-size: 9.5px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  padding: 1px 4px;
  border-radius: 3px;
  min-width: 14px;
  text-align: center;
}

.ps-chip-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.15);
  display: inline-block;
  flex-shrink: 0;
}

.ps-chip-name {
  color: #0f172a;
}

.ps-chip-size {
  margin-left: auto;
  font-family: monospace;
  font-size: 10px;
  color: #475569;
}

/* Central Canvas Area (Legacy Fallback) */
.sheet-center-canvas-wrap {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.canvas-center-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}

#print-sheet-canvas {
  width: 100%;
  max-width: 980px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* BOM Table in Print Sheet */
.sheet-bom-section {
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.sheet-bom-title {
  background: #f1f5f9;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1.5px solid #cbd5e1;
}

.sheet-bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.sheet-bom-table th {
  background: #f8fafc;
  color: #475569;
  padding: 6px 8px;
  font-weight: 700;
  border-bottom: 1px solid #cbd5e1;
}

.sheet-bom-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.sheet-bom-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.sheet-footer-notes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #64748b;
  padding-top: 4px;
}

/* ==========================================================================
   @media print Rules (A4 표준 규격 인쇄)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 8mm 8mm 8mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 화면 상의 모든 네비게이션, 사이드바, 메인화면, 헤더, 푸터, 버튼, 모달 숨김 */
  header,
  main.app-container,
  .app-container,
  aside,
  footer,
  .viewport-container,
  .viewport-tabs,
  .viewport-tabs-bar,
  .assembly-hud-banner,
  .part-hover-hud,
  .header-actions,
  .print-modal-header,
  .print-modal-tabs,
  .canvas-center-badge,
  .modal-overlay,
  .toast,
  #wc-toast {
    display: none !important;
  }

  /* 독립 인쇄: 개별 섹션이 숨겨져 있을 때 인쇄물에서도 완벽 은닉 */
  .print-a4-sheet .print-hide,
  .print-a4-sheet [style*="display: none"],
  .print-a4-sheet [style*="display:none"],
  .sheet-visuals-grid [style*="display: none"],
  .sheet-visuals-grid [style*="display:none"] {
    display: none !important;
  }

  .print-modal-backdrop {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }

  .print-modal-container {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .print-sheet-viewport {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    display: block !important;
    max-height: none !important;
  }

  .print-a4-sheet {
    box-shadow: none !important;
    border: 1.5px solid #0f172a !important;
    padding: 5mm 6mm !important;
    width: 100% !important;
    max-width: 194mm !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    display: block !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  /* 1. 표제란 컴팩트화 (A4 세로 너비 최적화) */
  .sheet-title-block {
    padding: 3px 8px !important;
    border: 1.5px solid #0f172a !important;
    background: #f8fafc !important;
    margin-bottom: 3mm !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .sheet-brand {
    padding-right: 8px !important;
    min-width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .sheet-brand .sb-icon { font-size: 18px !important; }
  .sb-name { font-size: 12.5px !important; font-weight: 800 !important; white-space: nowrap !important; }
  .sheet-meta-grid {
    gap: 2px 6px !important;
  }
  .sm-lbl { font-size: 8px !important; }
  .sm-item strong { font-size: 9.5px !important; }

  /* 2. 가구 형상 3D & 2D 2컬럼 인쇄 스타일 (전체 종합 인쇄 시) */
  .sheet-visuals-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin: 4px 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sheet-visual-card {
    border: 1px solid #cbd5e1 !important;
    padding: 4px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
  }

  .sheet-visual-body {
    min-height: 140px !important;
    background: #ffffff !important;
  }

  .print-3d-img {
    height: 160px !important;
    max-height: 160px !important;
    object-fit: contain !important;
    display: block !important;
    background: #ffffff !important;
    margin: 0 auto !important;
  }

  .print-2d-canvas, #print-sheet-canvas {
    width: auto !important;
    max-width: 100% !important;
    max-height: 160px !important;
    height: 160px !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
  }

  /* ─────────────────────────────────────────────────────────────
     ★ 3D 완성 입체 뷰 단독 인쇄 모드 (.mode-3d)
     - 표제란 + 3D 대형 렌더링 뷰를 A4 1장(275mm)에 꽉 차게 단독 출력
     ───────────────────────────────────────────────────────────── */
  .print-a4-sheet.mode-3d {
    height: 275mm !important;
    max-height: 278mm !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
    page-break-before: auto !important;
    page-break-after: auto !important;
  }

  .print-a4-sheet.mode-3d .sheet-visuals-grid,
  .print-a4-sheet.mode-3d .sheet-visuals-grid.single-view {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    margin: 2mm 0 !important;
    min-height: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-a4-sheet.mode-3d #print-card-3d {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1.5px solid #0f172a !important;
    padding: 4mm !important;
    background: #ffffff !important;
    min-height: 0 !important;
  }

  .print-a4-sheet.mode-3d #print-card-3d .sheet-badge {
    margin-bottom: 2mm !important;
    font-size: 10.5pt !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
  }

  .print-a4-sheet.mode-3d .sheet-visual-body {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  .print-a4-sheet.mode-3d .print-3d-img {
    width: 100% !important;
    height: auto !important;
    max-height: 205mm !important;
    object-fit: contain !important;
    background: #ffffff !important;
    margin: 0 auto !important;
    display: block !important;
  }

  /* ─────────────────────────────────────────────────────────────
     ★ 2D 제작 상세 도면 단독 인쇄 모드 (.mode-2d)
     - 표제란 + 정면도 + 평면도/측면도를 A4 1장(275mm)에 꽉 차게 단독 출력
     ───────────────────────────────────────────────────────────── */
  .print-a4-sheet.mode-2d {
    height: 275mm !important;
    max-height: 278mm !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  .print-a4-sheet.mode-2d .sheet-visuals-grid,
  .print-a4-sheet.mode-2d .sheet-visuals-grid.single-view {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    margin: 2mm 0 !important;
    min-height: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-a4-sheet.mode-2d #print-card-2d {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1.5px solid #0f172a !important;
    padding: 3mm !important;
    background: #ffffff !important;
    min-height: 0 !important;
  }

  .print-a4-sheet.mode-2d .print-2d-multiview-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 2mm !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  .print-a4-sheet.mode-2d .print-ortho-view-card {
    border: 1px solid #cbd5e1 !important;
    padding: 2mm !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-a4-sheet.mode-2d .print-ortho-front .print-2d-subcanvas {
    max-height: 105mm !important;
    height: auto !important;
    width: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  .print-a4-sheet.mode-2d .print-ortho-subgrid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
  }

  .print-a4-sheet.mode-2d .print-ortho-top .print-2d-subcanvas,
  .print-a4-sheet.mode-2d .print-ortho-side .print-2d-subcanvas {
    max-height: 88mm !important;
    height: auto !important;
    width: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* ─────────────────────────────────────────────────────────────
     ★ 재단배치도 단독 인쇄 모드 (.mode-cutlist / .cutlist-only-mode)
     - 원판 1장 = A4 1장 전용 인쇄 (헤더 + 캔버스 + 부재목록)
     ───────────────────────────────────────────────────────────── */
  .print-a4-sheet.cutlist-only-mode {
    border: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 194mm !important;
  }
  .print-a4-sheet.cutlist-only-mode .sheet-title-block,
  .print-a4-sheet.cutlist-only-mode > .sheet-badge,
  .print-a4-sheet.cutlist-only-mode .sheet-nesting-section > .sheet-badge {
    display: none !important;
  }
  .print-a4-sheet.cutlist-only-mode .sheet-nesting-section {
    page-break-before: auto !important;
    break-before: auto !important;
  }

  .sheet-nesting-section {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .print-nesting-container {
    display: block !important;
    width: 100% !important;
  }

  /* 원판 1장 = 정확히 A4 1장 (265mm) 꽉 차는 레이아웃 */
  .print-sheet-card {
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 265mm !important;
    max-height: 268mm !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 4px !important;
    padding: 4mm 6mm !important;
    margin: 0 !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  /* 2번째 원판부터는 무조건 새로운 A4 페이지로 분리하여 1장당 1원판 철저 보장 */
  .print-sheet-card:not(:first-child) {
    page-break-before: always !important;
    break-before: page !important;
  }

  .print-sheet-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding-bottom: 2mm !important;
    border-bottom: 1.5px solid #0f172a !important;
    margin-bottom: 1.5mm !important;
  }

  .ps-head-badge {
    font-size: 8pt !important;
    font-weight: 700 !important;
    color: #0369a1 !important;
    background: #e0f2fe !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    display: inline-block !important;
    margin-bottom: 1mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ps-head-title {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 10.5pt !important;
    color: #0f172a !important;
  }

  .ps-sheet-badge {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 1.5px 5px !important;
    border-radius: 3px !important;
    font-size: 9pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ps-sheet-dims {
    font-size: 10.5pt !important;
    font-weight: 800 !important;
    color: #0f172a !important;
  }

  .ps-head-meta {
    font-size: 8pt !important;
    color: #334155 !important;
    margin-top: 1px !important;
  }

  .ps-head-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 2px !important;
  }

  .ps-stat-badge {
    font-size: 8pt !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ps-stat-badge.efficiency {
    background: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 700 !important;
    border: 1px solid #a7f3d0 !important;
  }
  .ps-stat-badge.count {
    background: #f0f9ff !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
    border: 1px solid #bae6fd !important;
  }
  .ps-stat-badge.scrap {
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 7.5pt !important;
  }

  /* 중앙: A4 용지에 꽉 차게 들어가는 대형 캔버스 영역 */
  .print-sheet-canvas-wrapper {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: 180mm !important;
    padding: 0 !important;
    margin: 1.5mm 0 !important;
    overflow: hidden !important;
  }

  .print-nesting-canvas {
    height: auto !important;
    max-height: 175mm !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }

  /* 하단: 부재 목록 체크리스트 */
  .print-sheet-parts-summary {
    display: block !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2mm 3mm !important;
    background: #f8fafc !important;
    margin-top: 1mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ps-parts-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 8pt !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 1.5mm !important;
    padding-bottom: 1mm !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  .ps-parts-hint {
    font-size: 7pt !important;
    font-weight: 500 !important;
    color: #64748b !important;
  }

  .ps-parts-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1mm 2mm !important;
  }

  .ps-part-chip {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 7.5pt !important;
    color: #1e293b !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 3px !important;
    padding: 1mm 1.5mm !important;
  }

  .ps-chip-num {
    font-size: 7pt !important;
    font-weight: 800 !important;
    color: #0369a1 !important;
    background: #e0f2fe !important;
    padding: 0.5px 3px !important;
    border-radius: 2px !important;
    min-width: 11px !important;
    text-align: center !important;
  }

  .ps-chip-color {
    width: 7px !important;
    height: 7px !important;
    border-radius: 2px !important;
    border: 0.5px solid rgba(0,0,0,0.2) !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ps-chip-name {
    color: #0f172a !important;
    white-space: nowrap !important;
  }

  .ps-chip-size {
    margin-left: auto !important;
    font-family: monospace !important;
    font-size: 7pt !important;
    color: #475569 !important;
    white-space: nowrap !important;
  }

  /* 4. 부재 재단 치수표(BOM) 출력 보장 */
  .sheet-bom-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 4px !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 4px !important;
    overflow: visible !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .sheet-bom-title {
    background: #f1f5f9 !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #0f172a !important;
    display: block !important;
  }

  .sheet-bom-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9px !important;
  }

  .sheet-bom-table thead {
    display: table-header-group !important;
  }

  .sheet-bom-table tbody {
    display: table-row-group !important;
  }

  .sheet-bom-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sheet-bom-table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    padding: 3px 6px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid #94a3b8 !important;
    font-size: 8.5px !important;
  }

  .sheet-bom-table td {
    padding: 3px 6px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    font-size: 8.5px !important;
    line-height: 1.2 !important;
  }

  .sheet-bom-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
  }

  /* 5. 철물/부자재 & 견적서 & 조립설명서 출력 스타일 */
  .sheet-supplies-section,
  .sheet-cost-section,
  .sheet-assembly-section {
    margin-top: 6px !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 4px !important;
    overflow: visible !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .print-assembly-step-card {
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    padding: 5px 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 4px !important;
  }

  .p-step-title {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
  }

  .p-step-desc {
    font-size: 9.5px !important;
    color: #334155 !important;
  }

  /* 6. 하단 각주 */
  .sheet-footer-notes {
    padding-top: 2px !important;
    font-size: 8px !important;
    color: #64748b !important;
    display: flex !important;
    justify-content: space-between !important;
  }

  /* 7. 인쇄종이 최하단 diystudio.co.kr 표기 (우측 정렬) */
  .sheet-print-footer-brand {
    display: block !important;
    text-align: right !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    padding-top: 2px !important;
    padding-right: 6px !important;
    letter-spacing: 0.5px !important;
  }
}

/* ==========================================================================
   3D Cinematic Assembly Video Player Overlay Styles
   ========================================================================== */
.btn-cinema-action {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.45)) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  transition: all 0.25s ease;
}

.btn-cinema-action:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0f172a !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.cinematic-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 10, 15, 0.88) 0%, rgba(8, 10, 15, 0.1) 18%, rgba(8, 10, 15, 0.15) 60%, rgba(8, 10, 15, 0.95) 100%);
  animation: cinemaFadeIn 0.35s ease;
  user-select: none;
}

@keyframes cinemaFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Top Cinema Header */
.cinematic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(12, 15, 22, 0.9), transparent);
}

.cinematic-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseRec 1.2s infinite ease-in-out;
}

@keyframes pulseRec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.cinematic-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.cinematic-model-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.cinematic-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.video-speed-selector {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 4px;
}

.speed-label {
  font-size: 11px;
  color: #94a3b8;
  margin-right: 3px;
  font-weight: 600;
}

.btn-speed {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-speed.active {
  background: #f59e0b;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.4);
}

.btn-close-cinematic {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-cinematic:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Central Captions & Badges Area (모니터 화면 최하단에 고정) */
.cinematic-caption-container {
  position: fixed;
  bottom: 56px; /* 모니터 바닥 컨트롤 바 바로 위 */
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 980px;
  width: 92%;
  z-index: 9990;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  animation: cinemaSlideUp 0.3s ease;
}

@keyframes cinemaSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.video-badges-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: auto;
}

.video-tool-badge {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.badge-hardware {
  border-color: rgba(168, 85, 247, 0.5);
  color: #c084fc;
}

.video-tip-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.video-subtitle-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 8px 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
  text-align: center;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.subtitle-step-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #f59e0b;
  margin-bottom: 2px;
}

.subtitle-main-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.subtitle-description {
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
  font-weight: 400;
  word-break: keep-all;
}

/* Bottom Cinema Controls Bar: 모니터 최하단 바닥에 고정 */
.cinematic-controls-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9995;
  background: rgba(8, 10, 16, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.65);
  padding: 4px 24px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: cinemaSlideUp 0.3s ease;
}

.video-progress-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s ease;
}

.video-progress-wrap:hover {
  height: 7px;
}

.video-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 4px;
  position: relative;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.video-chapter-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chapter-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, 0.6);
}

.cinematic-btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cinematic-left-btns,
.cinematic-right-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-video-ctrl {
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-video-ctrl:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f59e0b;
  transform: scale(1.08);
}

#btn-video-play {
  background: #f59e0b;
  color: #0f172a;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 12px;
  font-weight: bold;
}

#btn-video-play:hover {
  background: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

#btn-video-play:hover {
  background: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.video-time-display {
  font-size: 12px;
  font-family: monospace;
  color: #94a3b8;
  font-weight: 600;
}

.video-chapter-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

/* ===================================================================
   방식 1번: 3D 뷰어 화면 직접 드래그 앤 드롭 (Direct 3D Drop) 스타일
   =================================================================== */
.canvas-viewport {
  position: relative;
}

.canvas-drop-guide {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 20, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 3px dashed var(--accent-amber, #f59e0b);
  border-radius: var(--radius-md, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
  z-index: 60;
}

.canvas-viewport.drag-over-3d .canvas-drop-guide {
  opacity: 1;
  border-color: #fbbf24;
  box-shadow: inset 0 0 40px rgba(245, 158, 11, 0.25), 0 0 30px rgba(245, 158, 11, 0.3);
}

.drop-guide-box {
  text-align: center;
  color: #fff;
  padding: 24px 32px;
  background: rgba(20, 24, 33, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-viewport.drag-over-3d .drop-guide-box {
  transform: scale(1);
}

.drop-icon {
  font-size: 52px;
  margin-bottom: 12px;
  display: inline-block;
  animation: pulse-drop 1.4s infinite ease-in-out;
}

@keyframes pulse-drop {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.18) translateY(-6px); }
}

.drop-title {
  font-size: 17px;
  font-weight: 800;
  color: #f59e0b;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
  letter-spacing: -0.3px;
}

.drop-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* 드래그 가능한 블록/칩 스타일 */
.custom-mode-pill-btn[draggable="true"],
.custom-palette-chip[draggable="true"] {
  cursor: grab !important;
  user-select: none;
}
.custom-mode-pill-btn[draggable="true"]:active,
.custom-palette-chip[draggable="true"]:active {
  cursor: grabbing !important;
}
.custom-mode-pill-btn.is-dragging,
.custom-palette-chip.is-dragging {
  opacity: 0.45 !important;
  transform: scale(0.95);
}

/* 3D 적용 완료 토스트 알림 */
.canvas-drop-toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 20px rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.canvas-drop-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   방식 3번: 3D 부재 직접 선택 & 마우스 드래그 위치 이동 플로팅 인스펙터
   =================================================================== */
.selected-part-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 308px;
  max-width: calc(100% - 32px);
  background: rgba(18, 22, 31, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 240, 255, 0.2);
  padding: 14px;
  color: var(--text-main, #f1f5f9);
  z-index: 65;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.selected-part-toolbar.active {
  display: block;
  animation: slideInPartToolbar 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInPartToolbar {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.spt-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spt-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber, #f59e0b);
}

.spt-close-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.spt-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.spt-guide {
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.spt-control-group {
  margin-bottom: 8px;
}

.spt-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}

.spt-label-name {
  color: var(--text-muted, #94a3b8);
}

.spt-label-val {
  font-weight: 700;
  color: var(--accent-amber, #f59e0b);
  font-family: monospace;
}

.spt-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spt-step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main, #f1f5f9);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.spt-step-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber, #f59e0b);
  color: var(--accent-amber, #f59e0b);
}

.spt-range-slider {
  flex: 1;
  accent-color: var(--accent-amber, #f59e0b);
  cursor: pointer;
}

.spt-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.spt-action-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.spt-btn-clone {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.spt-btn-clone:hover {
  background: rgba(56, 189, 248, 0.28);
}

.spt-btn-del {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.spt-btn-del:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* ── 인스펙터 Undo/Redo/Reset 히스토리 버튼 행 ── */
.spt-history-row {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  padding: 6px 0 2px;
  border-top: 1px dashed rgba(255,255,255,0.1);
}

.spt-hist-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-muted, #9ca3af);
}
.spt-hist-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.14);
  color: var(--text-main, #f1f5f9);
  transform: translateY(-1px);
}
.spt-hist-btn:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}
.spt-hist-btn span:first-child {
  font-size: 13px;
}

/* 초기화 버튼: 강조색 */
.spt-hist-reset {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
.spt-hist-reset:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.25);
  color: #f59e0b;
}

/* 라이트 모드 */
body.light-mode .spt-history-row {
  border-top-color: rgba(0,0,0,0.08);
}
body.light-mode .spt-hist-btn {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: #6b7280;
}
body.light-mode .spt-hist-btn:hover:not(:disabled) {
  background: rgba(0,0,0,0.09);
  color: #1e293b;
}
body.light-mode .spt-hist-reset {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
  color: #d97706;
}
body.light-mode .spt-hist-reset:hover:not(:disabled) {
  background: rgba(217, 119, 6, 0.2);
}

/* ── 붙이기(Snap) 버튼 그리드 ── */
.spt-snap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 5px;
}

.spt-snap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
  white-space: nowrap;
}
.spt-snap-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}
.spt-snap-btn:active {
  transform: translateY(0);
}

/* 각 축별 중앙 붙이기 (상하중앙, 좌우중앙, 앞뒤중앙) */
.spt-snap-axis-center {
  background: rgba(14, 165, 233, 0.13);
  border-color: rgba(14, 165, 233, 0.38);
  color: #7dd3fc;
}
.spt-snap-axis-center:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: rgba(14, 165, 233, 0.7);
  color: #bae6fd;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.35);
}

/* 전체 중앙 붙이기 (X·Y·Z 모두) - 3열 전체 차지 */
.spt-snap-center {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  grid-column: span 3;
  font-size: 11.5px;
  padding: 8px 6px;
}
.spt-snap-center:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.75);
  color: #a7f3d0;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

/* 라이트 모드 */
body.light-mode .spt-snap-btn {
  background: rgba(79, 70, 229, 0.07);
  border-color: rgba(79, 70, 229, 0.22);
  color: #4f46e5;
}
body.light-mode .spt-snap-btn:hover {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(79, 70, 229, 0.5);
  color: #3730a3;
}
body.light-mode .spt-snap-axis-center {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}
body.light-mode .spt-snap-axis-center:hover {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(2, 132, 199, 0.55);
  color: #0369a1;
}
body.light-mode .spt-snap-center {
  background: rgba(5, 150, 105, 0.07);
  border-color: rgba(5, 150, 105, 0.22);
  color: #059669;
}
body.light-mode .spt-snap-center:hover {
  background: rgba(5, 150, 105, 0.18);
  border-color: rgba(5, 150, 105, 0.5);
  color: #047857;
}

/* 3D 드래그 중 캔버스 스타일 */
body.is-part-dragging,
body.is-part-dragging canvas {
  cursor: grabbing !important;
  user-select: none;
}

/* 3D 크기 조절 드래그 중 캔버스 스타일 */
body.is-part-resizing,
body.is-part-resizing canvas {
  cursor: nwse-resize !important;
  user-select: none;
}

/* 모드 전환 스위치 (위치 이동 vs 크기 조절) */
.spt-mode-switch-wrap {
  margin-bottom: 8px;
}

.spt-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.spt-mode-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.spt-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.spt-mode-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
  border: 1px solid var(--accent-amber, #f59e0b);
  color: var(--accent-amber, #f59e0b);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* 세부 조정 모드별 패널 (위치 이동 패널 vs 크기 조절 패널) */
.spt-panel {
  animation: fadeInSptPanel 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInSptPanel {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spt-section-divider {
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  margin: 10px 0 8px 0;
  padding-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber, #f59e0b);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===================================================================
   밝게 모드(Light Mode)에서의 우측 상단 플로팅 세부 조정 인스펙터 스타일
   =================================================================== */
body.light-mode .selected-part-toolbar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 0 24px rgba(217, 119, 6, 0.18);
  color: var(--text-main, #0f172a);
}

body.light-mode .spt-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .spt-title {
  color: var(--accent-amber, #d97706);
}

body.light-mode .spt-close-btn {
  color: var(--text-muted, #64748b);
}

body.light-mode .spt-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

body.light-mode .spt-guide {
  color: #475569;
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
}

body.light-mode .spt-label-name {
  color: var(--text-muted, #475569);
}

body.light-mode .spt-label-val {
  color: var(--accent-amber, #d97706);
}

body.light-mode .spt-step-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
  color: #1e293b;
}

body.light-mode .spt-step-btn:hover {
  background: rgba(217, 119, 6, 0.15);
  border-color: var(--accent-amber, #d97706);
  color: var(--accent-amber, #d97706);
}

body.light-mode .spt-actions-row {
  border-top-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .spt-btn-clone {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.4);
  color: #0284c7;
}

body.light-mode .spt-btn-clone:hover {
  background: rgba(2, 132, 199, 0.22);
}

body.light-mode .spt-btn-del {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

body.light-mode .spt-btn-del:hover {
  background: rgba(239, 68, 68, 0.22);
}

body.light-mode .spt-mode-switch {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .spt-mode-btn {
  color: #64748b;
}

body.light-mode .spt-mode-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .spt-mode-btn.active {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(253, 230, 138, 0.95));
  border-color: var(--accent-amber, #d97706);
  color: #b45309;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
}

body.light-mode .spt-section-divider {
  border-top-color: rgba(0, 0, 0, 0.1);
  color: var(--accent-amber, #d97706);
}

/* ================= 객체 우측 상세옵션 플로팅 모달 (Object Detail Modal) ================= */

/* 3D 뷰어 상단 메인 상세옵션 토글 버튼 */
.btn-odm-main-toggle {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28) 0%, rgba(59, 130, 246, 0.18) 100%) !important;
  border: 1.5px solid #3b82f6 !important;
  color: #93c5fd !important;
  font-weight: 800 !important;
  padding: 6px 12px !important;
  font-size: 11.5px !important;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-odm-main-toggle:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.55) 0%, rgba(59, 130, 246, 0.4) 100%) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn-odm-main-toggle.odm-active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.6) !important;
}

/* 3D 뷰포트 내 우측 플로팅 빠른 열기 버튼 (모달이 닫혔을 때 표시) */
.btn-floating-open-odm {
  position: absolute;
  top: 60px;
  right: 14px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45), 0 0 12px rgba(59, 130, 246, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
}
.btn-floating-open-odm:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6), 0 0 16px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.btn-floating-open-odm:active {
  transform: scale(0.97);
}

.object-detail-modal {
  position: absolute;
  top: 55px;
  right: 16px;
  width: 330px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 115px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 105;
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
}

@media (max-width: 768px) {
  .object-detail-modal {
    top: 50px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100% - 16px) !important;
    max-height: calc(100% - 65px) !important;
    z-index: 120 !important;
  }
  .btn-floating-open-odm {
    top: auto;
    bottom: 20px;
    right: 12px;
    padding: 7px 12px;
    font-size: 11.5px;
  }
}

.object-detail-modal.minimized {
  max-height: 46px !important;
  overflow: hidden !important;
}

.object-detail-modal.minimized .odm-tabs,
.object-detail-modal.minimized .odm-body {
  display: none !important;
}

.odm-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.odm-header:active {
  cursor: grabbing;
}

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

.odm-icon {
  font-size: 16px;
}

.odm-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.odm-subtitle {
  font-size: 10.5px;
  color: #38bdf8;
  font-weight: 600;
  margin-top: 1px;
}

.odm-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.odm-btn-minimize,
.odm-btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  transition: all 0.15s ease;
}

.odm-btn-minimize:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.odm-btn-close:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.odm-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 8px;
  gap: 5px;
}

.odm-tab-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.odm-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.odm-tab-btn.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.odm-body {
  padding: 12px 14px;
  overflow-y: auto;
  max-height: calc(100vh - 350px);
  user-select: auto;
}

.odm-body::-webkit-scrollbar {
  width: 5px;
}

.odm-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.odm-tab-pane {
  display: none;
}

.odm-tab-pane.active {
  display: block;
}

/* Light mode for object-detail-modal */
body.light-mode .object-detail-modal {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

body.light-mode .odm-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .odm-title {
  color: #0f172a;
}

body.light-mode .odm-subtitle {
  color: #2563eb;
}

body.light-mode .odm-btn-minimize,
body.light-mode .odm-btn-close {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #64748b;
}

body.light-mode .odm-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .odm-tab-btn {
  color: #64748b;
}

body.light-mode .odm-tab-btn.active {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.95);
  border-color: #93c5fd;
}

/* ================= H책상 모델 옵션 전용 고급 버튼 및 카드 스타일 ================= */
.h-opt-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.h-opt-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}

.h-opt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.h-opt-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.h-opt-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  letter-spacing: -0.2px;
}

.h-btn-grid {
  display: grid;
  gap: 6px;
}

.h-btn-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.h-btn-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.h-btn-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.h-btn-grid.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.h-btn-grid.cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.h-btn-grid.cols-7 {
  grid-template-columns: repeat(7, 1fr);
}

.h-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  line-height: 1.25;
  width: 100%;
}

.h-opt-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f1f5f9;
  transform: translateY(-1px);
}

.h-opt-btn:active {
  transform: translateY(0);
}

.h-opt-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(30, 64, 175, 0.45));
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.h-btn-main {
  font-size: 11.5px;
  font-weight: 700;
  display: block;
}

.h-opt-btn.active .h-btn-main {
  color: #60a5fa;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.h-btn-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

.h-opt-btn.active .h-btn-sub {
  color: #bfdbfe;
}

/* Light mode support */
body.light-mode .h-opt-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .h-opt-card:hover {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .h-opt-title {
  color: #1e293b;
}

body.light-mode .h-opt-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}

body.light-mode .h-opt-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #64748b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-mode .h-opt-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

body.light-mode .h-opt-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

body.light-mode .h-opt-btn.active .h-btn-main {
  color: #1d4ed8;
}

body.light-mode .h-opt-btn.active .h-btn-sub {
  color: #2563eb;
}

/* ================= Bookshelf Door Drag & Customizer ================= */
.door-drag-source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(37, 99, 235, 0.18) 100%);
  border: 1.5px dashed #38bdf8;
  border-radius: 8px;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}
.door-drag-source:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(37, 99, 235, 0.28) 100%);
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
.door-drag-source:active {
  cursor: grabbing;
}
.door-drag-tip {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}
.bks-grid-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  user-select: none;
}
.bks-grid-matrix {
  display: grid;
  gap: 6px;
  width: 100%;
}
.bks-slot-cell {
  min-height: 48px;
  border: 1.5px dashed rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  font-size: 10.5px;
  color: #94a3b8;
  position: relative;
  overflow: hidden;
}
.bks-slot-cell:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #e2e8f0;
}
.bks-slot-cell.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transform: scale(1.03);
}
.bks-slot-cell.has-door {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.85) 0%, rgba(2, 132, 199, 0.95) 100%);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  color: #ffffff;
  font-weight: 700;
}
.bks-slot-cell .door-knob {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 12px;
  background: #f59e0b;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.6);
}
.bks-slot-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.bks-action-btn {
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.bks-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Light mode support for door customizer */
body.light-mode .door-drag-source {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(56, 189, 248, 0.12) 100%);
  border-color: #2563eb;
  color: #2563eb;
}
body.light-mode .bks-grid-wrapper {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
body.light-mode .bks-slot-cell {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #64748b;
}
body.light-mode .bks-slot-cell.has-door {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  border-color: #1d4ed8;
  color: #ffffff;
}
body.light-mode .bks-action-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}
body.light-mode .bks-action-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

/* ===================================================================
   Mobile Optimization & Responsive Styles (스마트폰 & 태블릿 최적화)
   =================================================================== */

/* PC 및 768px 초과 환경: 모바일 전용 탭바 및 터치 버튼 절대 표시 금지 */
.mobile-nav-bar,
.btn-mobile-touch-toggle {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────────
   [1] Tablet & Smartphone Breakpoint (화면 폭 960px 이하)
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {

  /* 헤더 간소화 */
  .header {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .brand {
    gap: 8px;
    flex-shrink: 0;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .brand-text h1 {
    font-size: 15px;
    gap: 4px;
  }
  .brand-badge {
    display: none;
  }
  .brand-text p {
    display: none; /* 모바일에서 공간 절약을 위해 서브타이틀 숨김 */
  }

  /* 헤더 우측 버튼 가로 스크롤 허용 */
  .header-actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    gap: 6px;
    max-width: calc(100vw - 150px);
  }
  .header-actions::-webkit-scrollbar {
    height: 3px;
  }
  .header-actions::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 3px;
  }
  .header-actions .btn {
    padding: 6px 10px;
    font-size: 11.5px;
    gap: 4px;
    flex-shrink: 0;
  }
}

/* ──────────────────────────────────────────────────────────────────
   [2] 스마트폰 전용 Breakpoint (화면 폭 768px 이하 모바일 기기)
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* 모바일 상단 3개 섹션 세그먼트 탭바 */
  .mobile-nav-bar {
    display: flex !important;
    position: sticky;
    top: 52px;
    z-index: 80;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 8px;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
  body.light-mode .mobile-nav-bar {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  body.light-mode .mobile-nav-tab {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
  }

  .mobile-nav-tab:hover {
    color: var(--text-main);
    background: rgba(51, 65, 85, 0.8);
  }
  .mobile-nav-tab.active {
    background: var(--accent-amber-subtle);
    border-color: var(--accent-amber);
    color: var(--accent-amber);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  body.light-mode .mobile-nav-tab.active {
    background: #fef3c7;
    border-color: #d97706;
    color: #b45309;
  }

  .mobile-nav-icon {
    font-size: 14px;
    line-height: 1;
  }
  .mobile-nav-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--accent-sky);
    border: 1px solid rgba(56, 189, 248, 0.3);
  }
  .mobile-nav-badge.highlight {
    background: var(--accent-amber);
    color: #0c0f14;
    border-color: transparent;
  }

  /* 모바일 화면에서만 탭 기반 패널 전환 적용 */
  .app-container {
    display: block !important;
    padding: 10px 8px 30px !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .app-container[data-mobile-active="panel-left"] .panel-left {
    display: block !important;
    width: 100% !important;
  }
  .app-container[data-mobile-active="panel-left"] .panel-center,
  .app-container[data-mobile-active="panel-left"] .panel-right {
    display: none !important;
  }

  .app-container[data-mobile-active="panel-center"] .panel-center {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  .app-container[data-mobile-active="panel-center"] .panel-left,
  .app-container[data-mobile-active="panel-center"] .panel-right {
    display: none !important;
  }

  .app-container[data-mobile-active="panel-right"] .panel-right {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  .app-container[data-mobile-active="panel-right"] .panel-left,
  .app-container[data-mobile-active="panel-right"] .panel-center {
    display: none !important;
  }
}

  /* 3D 뷰포트 크기 및 터치 영역 최적화 */
  .viewport-container {
    min-height: 440px !important;
    max-height: 720px !important;
    border-radius: var(--radius-md);
  }
  .canvas-viewport canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    touch-action: none;
  }

  /* 3D 회전 제어 vs 화면 스크롤 모드 토글 버튼 */
  .btn-mobile-touch-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    outline: none;
  }
  .btn-mobile-touch-toggle.scroll-mode {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
  }

  /* 모달 팝업 모바일 최적화 (94vw) */
  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 92vh !important;
    padding: 14px !important;
    margin: 10px auto !important;
  }
  .modal-box-wide {
    width: 95vw !important;
    max-width: 95vw !important;
  }
}

/* ──────────────────────────────────────────────────────────────────
   [2] Compact Phone Breakpoint (화면 폭 600px 이하 추가 세부 최적화)
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {

  /* 카테고리 2열 그리드 크기 최적화 */
  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .category-card-btn {
    padding: 8px 6px !important;
    min-height: 48px !important;
    gap: 6px !important;
  }
  .category-icon {
    font-size: 18px !important;
  }
  .category-name {
    font-size: 11.5px !important;
  }

  /* 템플릿 칩 버튼 */
  .template-chip-group {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .template-chip {
    padding: 7px 6px !important;
    font-size: 11.5px !important;
  }

  /* 치수 슬라이더 및 스테퍼(+/-) 버튼 터치 영역 확대 */
  .dim-drag-group {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .dim-step-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
  }
  .dim-range-slider::-webkit-slider-thumb {
    width: 22px !important;
    height: 22px !important;
  }
  .dim-range-slider::-moz-range-thumb {
    width: 22px !important;
    height: 22px !important;
  }

  /* 합판 하이라이트 배너 컴팩트 조정 */
  .plywood-highlight-banner {
    min-height: 200px !important;
    padding: 12px 14px !important;
  }
  .banner-sheet-display .num {
    font-size: 38px !important;
  }
  .banner-stat-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .banner-stat-row .lbl {
    font-size: 10px !important;
  }
  .banner-stat-row .val {
    font-size: 12px !important;
  }

  /* BOM 테이블 폰트 및 패딩 축소 */
  .bom-table th,
  .bom-table td {
    padding: 7px 5px !important;
    font-size: 11px !important;
  }
}




