/* ==========================================================================
   전기기능사 실기 시뮬레이터 전역 스타일 (Modern Dark Engineering Theme)
   ========================================================================== */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --accent-blue: #38bdf8;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-color: #334155;
  --border-light: #475569;
  --glow-blue: 0 0 20px rgba(56, 189, 248, 0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 상단 네비게이션 헤더 */
.app-header {
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-size: 24px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-tag {
  font-size: 11px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

/* 문제 선택 셀렉트 */
.problem-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.problem-select {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.problem-select:hover, .problem-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* 7단계 진행 상태 바 */
.pipeline-bar {
  background: #111827;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
}

.stage-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.stage-step:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
}

.stage-step.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.step-arrow {
  color: var(--border-light);
  font-size: 10px;
}

/* 메인 대시보드 레이아웃 */
.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* 좌측 사이드바: 도면 및 가이드 패널 */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 12세 눈높이 가이드 말풍선 */
.guide-box {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #e2e8f0;
}

.guide-box b {
  color: var(--accent-blue);
}

/* 원본 시험 도면 뷰어 썸네일 */
.blueprint-thumbnail-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #000;
  cursor: pointer;
}

.blueprint-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: contain;
  transition: transform 0.3s;
  background: #fff;
}

.blueprint-thumbnail:hover {
  transform: scale(1.02);
}

.blueprint-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* 부품 명세 리스트 */
.component-spec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.comp-spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.comp-spec-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-blue);
}

.comp-spec-right {
  color: var(--text-muted);
  font-size: 11px;
}

/* 우측 작업대 영역 */
.workbench-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.workbench-title-group h2 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workbench-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 상단 뷰 컨트롤 (확대/축소, 속도 등) */
.view-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 돋보기 확대/축소 툴바 */
.zoom-controls {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  gap: 3px;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #38bdf8;
}

.zoom-btn.focus-btn {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.zoom-btn.focus-btn:hover {
  background: #38bdf8;
  color: #0f172a;
}

.zoom-label {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  min-width: 36px;
  text-align: center;
  font-family: monospace;
}

.speed-btn-group {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.speed-btn.active {
  background: var(--accent-blue);
  color: #0f172a;
}

/* 인터랙션 툴바 */
.action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: #111827;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: #475569;
  border-color: #64748b;
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-danger {
  background: transparent;
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.1);
}

/* 기판 뷰 래퍼 */
.board-stage-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 580px;
  background: radial-gradient(circle at center, #1e293b 0%, #0b0f17 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  overflow: hidden;
}

/* 시험 도면 팝업 모달 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: #fff;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 2단계 주회로 상별 필터 버튼 스타일 */
.filter-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 주회로 전선 인터랙션 */
.main-circuit-wire {
  cursor: pointer;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.main-circuit-wire:hover path.wire-main-path {
  stroke-width: 3.5;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}


/* ==========================================================================
   화면 높이 맞춤 레이아웃 & 크게 보기(집중 모드)
   - 넓은 화면: 페이지 전체를 브라우저 높이에 맞추고, 작업 화면이 남은 공간을 꽉 채움
     (상단 메뉴·버튼 때문에 작업 화면 아래가 잘리던 문제 해결)
   ========================================================================== */
@media (min-width: 1101px) {
  body {
    height: 100vh;
    overflow: hidden;
  }

  .main-layout {
    min-height: 0;
    overflow: hidden;
    grid-template-rows: minmax(0, 1fr);
  }

  .sidebar-panel {
    min-height: 0;
    overflow-y: auto;
  }

  .workbench-area {
    min-height: 0;
    overflow: hidden;
  }

  .board-stage-container {
    flex: 1 1 0;
    min-height: 0 !important;
  }

  /* 1·2·4단계 기판: 남은 높이에 맞춰 통째로 보이게 (board.css보다 우선하도록 선택자 강화) */
  .board-stage-container .board-view-wrapper {
    width: 100%;
    height: 100%;
    max-width: none;
  }

  .board-stage-container #board-svg {
    width: 100%;
    height: 100%;
  }

  /* 3단계 시퀀스 도면 */
  .sequence-svg-container {
    min-height: 0 !important;
  }

  #sequence-overlay-svg {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
  }
}

/* 단계 버튼 영역 접기 */
body.toolbar-collapsed .action-toolbar {
  display: none !important;
}

.layout-btn {
  white-space: nowrap;
}

.focus-mode-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border-color: #38bdf8;
}

body.focus-mode .focus-mode-btn {
  background: linear-gradient(135deg, #b45309, #d97706);
  border-color: #fbbf24;
}

/* 크게 보기(집중 모드): 상단 헤더·단계 탭·사이드바 숨김, 작업 화면 최대화 */
body.focus-mode .app-header,
body.focus-mode .pipeline-bar,
body.focus-mode .sidebar-panel {
  display: none !important;
}

body.focus-mode .main-layout {
  grid-template-columns: 1fr;
  max-width: none;
  padding: 8px 10px;
  gap: 0;
}

body.focus-mode .workbench-area {
  padding: 10px 12px;
  gap: 8px;
  position: relative;
}

body.focus-mode .workbench-header {
  padding-bottom: 8px;
}

body.focus-mode .workbench-title-group h2 {
  font-size: 15px;
}

body.focus-mode .workbench-title-group p {
  display: none;
}

@media (max-width: 1100px) {
  body.focus-mode .board-stage-container {
    min-height: calc(100vh - 140px) !important;
  }
}

/* 크게 보기 모드 전용 꿀팁 미니 창 (작업 화면 왼쪽 아래) */
.focus-guide {
  display: none;
}

body.focus-mode .focus-guide {
  display: block;
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 420px;
  pointer-events: auto;
}

.focus-guide-toggle {
  background: #0f172a;
  color: #fde68a;
  border: 1px solid #f59e0b;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
}

.focus-guide-box {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #f59e0b;
  border-radius: 0 8px 8px 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #e2e8f0;
  max-height: 34vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.focus-guide.collapsed .focus-guide-box {
  display: none;
}

/* ==========================================================================
   7단계: 전원 투입 & 동작 테스트
   ========================================================================== */
.op-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.op-diagram {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px;
}

.op-diagram svg {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.op-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  padding: 4px 0 2px;
}

.op-legend i {
  display: inline-block;
  width: 18px;
  height: 6px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.lg-flow { background: #f97316; }
.lg-return { background: #38bdf8; }
.lg-closed { background: #16a34a; border-radius: 50% !important; width: 10px !important; height: 10px !important; }
.lg-open { background: #94a3b8; border-radius: 50% !important; width: 10px !important; height: 10px !important; }

.op-flow {
  fill: none;
  stroke: #f97316;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  stroke-dasharray: 18 10;
  animation: op-flow-move 0.8s linear infinite;
}

.op-return {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

@keyframes op-flow-move {
  to { stroke-dashoffset: -28; }
}

.op-c-closed { fill: #16a34a; stroke: #ffffff; stroke-width: 2; }
.op-c-open { fill: #94a3b8; stroke: #ffffff; stroke-width: 2; opacity: 0.85; }

.op-load-on {
  animation: op-pulse 1s ease-in-out infinite;
}

@keyframes op-pulse {
  50% { opacity: 0.45; }
}

.op-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.op-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}

.op-card h4 {
  font-size: 13px;
  font-weight: 900;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.op-card h4 small {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
  margin-left: 6px;
}

.op-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.op-row-tight {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.op-mccb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 78px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
}

.op-mccb-lever {
  width: 16px;
  height: 26px;
  border-radius: 4px;
  background: #64748b;
  transform: translateY(6px);
  transition: transform 0.15s, background 0.15s;
}

.op-mccb.on {
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.op-mccb.on .op-mccb-lever {
  background: #22c55e;
  transform: translateY(-6px);
}

.op-mccb em {
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.op-eocr { flex: 1; }

.op-eocr-state {
  font-size: 12px;
  font-weight: 900;
  color: #86efac;
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid #16a34a;
  border-radius: 6px;
  padding: 5px 8px;
}

.op-eocr-state.trip {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.2);
  border-color: #ef4444;
  animation: op-pulse 0.6s ease-in-out infinite;
}

.op-btn {
  flex: 1;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
}

.op-btn.danger {
  border-color: #f59e0b;
  color: #fde68a;
}

.op-boxes {
  justify-content: space-between;
}

.op-box {
  width: 24%;
  max-width: 110px;
  height: auto;
  user-select: none;
}

.op-clickable {
  cursor: pointer;
}

.op-split {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

.op-tank {
  width: 100%;
  max-height: 190px;
}

.op-split input[type="range"] {
  width: 100%;
}

.op-check {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 4px;
}

.op-motors {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.op-motor {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}

.op-motor svg {
  width: 54px;
  height: 54px;
}

.op-motor b {
  color: #e2e8f0;
}

.op-motor span {
  font-size: 10px;
}

.op-fan {
  transform-box: fill-box;
  transform-origin: center;
}

.op-motor.on .op-fan {
  animation: op-spin 0.6s linear infinite;
}

.op-motor.on svg circle:first-child {
  stroke: #22c55e;
}

@keyframes op-spin {
  to { transform: rotate(360deg); }
}

.op-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.op-chip {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #475569;
  color: #94a3b8;
  background: #1e293b;
}

.op-chip.on {
  color: #ffffff;
  background: #ea580c;
  border-color: #fdba74;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.op-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.op-timer input {
  width: 46px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 2px 4px;
}

.op-timer-bar {
  flex-basis: 100%;
  height: 8px;
  border-radius: 4px;
  background: #1e293b;
  overflow: hidden;
}

#op-timer-fill {
  height: 100%;
  width: 0;
  background: #f59e0b;
  transition: width 0.1s linear;
}

#op-timer-fill.done {
  background: #22c55e;
}

.op-log {
  list-style: none;
  font-size: 11.5px;
  line-height: 1.5;
  color: #94a3b8;
  max-height: 160px;
  overflow-y: auto;
}

.op-log li {
  padding: 3px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.op-log li.latest {
  color: #f8fafc;
}

@media (max-width: 1100px) {
  .op-layout {
    grid-template-columns: 1fr;
  }
}

/* 컨트롤박스 기구 동작 효과 (7단계: 버튼 누름 · 램프 점등 · 부저 울림) */
.dev-press-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: dev-press 0.6s ease-out infinite;
}

@keyframes dev-press {
  from { transform: scale(0.85); opacity: 1; }
  to { transform: scale(1.35); opacity: 0; }
}

/* 램프 점등은 깜빡임 없이 일정하게 (실제로 깜빡이는 것은 FR이 껐다 켜는 YL뿐 — 회로가 직접 표현) */
.dev-lamp-halo {
  opacity: 0.75;
}

.dev-lamp-rays {
  opacity: 0.9;
}

@keyframes dev-rays {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.dev-buzz-waves {
  animation: dev-rays 0.35s ease-in-out infinite;
}

/* 7단계: 문제지 동작 사항 체크리스트 */
.op-checklist {
  border-color: #38bdf8;
}

.op-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 34vh;   /* 테스트 중에도 아래 조작 박스(램프·부저)가 보이도록 */
  overflow-y: auto;
  padding-right: 2px;
}

.op-checklist {
  flex-shrink: 0;
}

.op-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #cbd5e1;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.op-step.running {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #fef3c7;
}

.op-step.pass {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.1);
}

.op-step.fail {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.15);
  border-color: #ef4444;
}

.op-step-state {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.op-step-title {
  flex: 1;
}

.op-step-run {
  flex-shrink: 0;
  width: 28px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #22c55e;
  background: #14532d;
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
}

.op-step-run:hover {
  background: #16a34a;
}

.op-step-summary {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
}

.op-step-summary.success {
  color: #ffffff;
  background: linear-gradient(135deg, #15803d, #16a34a);
  font-size: 13px;
}

.op-step-summary.failed {
  color: #fecaca;
}

/* ==========================================================================
   화면 구성 개편: 과제 선택 왼쪽 위 · 공식 도면 ↔ 작업 화면 크기 조절 · 하단 사용 부품 띠
   ========================================================================== */
.app-header {
  justify-content: flex-start;
}

.brand-section {
  gap: 14px;
  flex-wrap: wrap;
}

.brand-section .problem-selector-wrapper {
  margin-left: 10px;
}

.main-layout {
  grid-template-columns: var(--side-w, 400px) 14px minmax(0, 1fr);
  column-gap: 0;
  row-gap: 12px;
  max-width: 1900px;
}

/* 분할선: 좌우로 끌어 공식 도면/작업 화면 폭 조절 */
.layout-splitter {
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.layout-splitter span {
  width: 4px;
  height: 64px;
  border-radius: 3px;
  background: var(--border-light, #334155);
  transition: background 0.15s, height 0.15s;
}

.layout-splitter:hover span,
body.resizing .layout-splitter span {
  background: var(--accent-blue, #38bdf8);
  height: 120px;
}

body.resizing {
  cursor: col-resize;
  user-select: none;
}

/* 공식 도면: 왼쪽 영역 남은 높이를 꽉 채움 */
.sidebar-panel {
  min-width: 0;
}

.blueprint-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.blueprint-card .blueprint-thumbnail-wrapper {
  flex: 1;
  min-height: 160px;
}

.blueprint-card .blueprint-thumbnail {
  height: 100%;
}

.blueprint-card .blueprint-thumbnail:hover {
  transform: none;
}

.sidebar-panel .guide-box {
  max-height: 28vh;
  overflow-y: auto;
}

/* 하단 사용 부품 띠 (가로로 길게) */
.parts-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.parts-strip .card-title {
  margin: 0;
  white-space: nowrap;
}

.parts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.parts-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
}

.parts-chip b {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

@media (min-width: 1101px) {
  .main-layout {
    grid-template-rows: minmax(0, 1fr) auto;
  }
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .layout-splitter {
    display: none;
  }
}

body.focus-mode .layout-splitter,
body.focus-mode .parts-strip {
  display: none !important;
}

/* 메인 작업 화면 세로 공간 최대 확보 (상단 메뉴 압축) */
.app-header {
  height: 50px;
}

.brand-logo {
  font-size: 20px;
}

.pipeline-bar {
  padding: 5px 24px;
}

.stage-step {
  padding: 4px 12px;
}

.main-layout {
  padding: 10px 18px;
}

.workbench-area {
  padding: 10px 14px;
  gap: 8px;
}

.workbench-header {
  padding-bottom: 6px;
}

.workbench-title-group h2 {
  font-size: 15px;
}

/* 작업대 설명 줄은 숨기고 제목에 마우스를 올리면 보이게 (app.js가 title로 복사) */
.workbench-title-group p {
  display: none;
}

.action-toolbar {
  padding: 6px 10px;
  gap: 6px;
}

.action-toolbar .btn {
  padding: 5px 11px;
  font-size: 12px;
}

.parts-strip {
  padding: 4px 12px;
}

.parts-strip .card-title {
  font-size: 12px;
}

.parts-chip {
  padding: 3px 8px;
  font-size: 11.5px;
}

/* 4단계 왼쪽: 3단계 핀번호·그루핑 미니 도면 */
.seq-mini {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: block;
  overflow: hidden;   /* 잘라낸 보조회로 영역만 표시 */
}

.blueprint-card .card-title small {
  font-size: 11px;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}

/* 0단계 · 공개문제 문제지 보기 */
.stage-step-doc {
  border-color: rgba(250, 204, 21, 0.4);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title-row .card-title {
  margin-bottom: 0;
}

.doc-toggle,
.doc-nav button {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #facc15;
  background: #422006;
  color: #fef08a;
  cursor: pointer;
  white-space: nowrap;
}

.doc-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
}

.blueprint-card.doc-mode .doc-nav,
.doc-nav-main {
  display: flex;
}

.doc-hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.doc-page-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: #0b1120;
  border-radius: 8px;
}

.doc-page-wrap img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #ffffff;
}

.reset-all-btn {
  border-color: #f87171 !important;
  color: #fecaca !important;
}

/* 7단계: 타이머 설정시간 도달 순간 퍼지는 빛 고리 */
.op-timer-burst {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 6;
  transform-box: fill-box;
  transform-origin: center;
  animation: op-timer-burst 1.2s ease-out forwards;
}
.op-timer-burst.late { animation-delay: 0.25s; opacity: 0; }
.op-timer-done-text {
  font-size: 20px;
  font-weight: 900;
  fill: #b45309;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  animation: op-timer-text 1.5s ease-out forwards;
}
@keyframes op-timer-burst {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3.2); opacity: 0; }
}
@keyframes op-timer-text {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* 7단계 회로도 확대 도구 (휠 확대 · 드래그 이동 · 더블클릭 맞춤) */
.op-diagram {
  position: relative;
}

.op-diagram svg {
  cursor: grab;
  touch-action: none;
}

.op-diagram svg.dragging {
  cursor: grabbing;
}

.op-zoom-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.op-zoom-tools button {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.op-zoom-tools button:hover {
  background: #334155;
}

.op-zoom-tools span {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color: #fde68a;
}

/* 7단계: 버튼 누름·셀렉터 전환 때 조작 박스 번쩍임 */
.op-box.op-box-flash {
  animation: op-box-flash 0.7s ease-out;
}
@keyframes op-box-flash {
  0% { filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0)); transform: scale(1); }
  25% { filter: drop-shadow(0 0 14px rgba(250, 204, 21, 1)); transform: scale(1.06); }
  100% { filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0)); transform: scale(1); }
}

/* 7단계: 수위 알림 — 만수(E1) 파랑 빛 / 저수위(E2) 주황 빛 */
.op-tank.op-tank-full {
  animation: op-tank-full 0.8s ease-in-out 3;
}
.op-tank.op-tank-low {
  animation: op-tank-low 0.8s ease-in-out 2;
}
@keyframes op-tank-full {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0)); }
  50% { filter: drop-shadow(0 0 16px rgba(56, 189, 248, 1)); }
}
@keyframes op-tank-low {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(251, 146, 60, 0)); }
  50% { filter: drop-shadow(0 0 14px rgba(251, 146, 60, 1)); }
}
.op-tank-banner {
  animation: op-banner-pop 0.35s ease-out;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes op-banner-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   7단계 화면 배치 (사용자 요청 재구성)
   왼쪽 = 회로도(위) + 조작 박스·전원·수조(아래 가로 배열) / 오른쪽 = 동작 사항 + 동작 기록
   ========================================================================== */
.op-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.op-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;      /* 조작 줄이 두 줄로 내려가도 회로도 높이는 지키고 이 칸만 스크롤 */
  overflow-x: hidden;
}

.op-main .op-diagram {
  flex: 1 1 auto;
  min-height: 340px;   /* 아래 조작 줄이 회로도를 밀어 올리지 않게 */
}

.op-controls {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;       /* 공간이 모자라면 카드가 다음 줄로 */
  gap: 10px;
  align-items: stretch;
}

.op-controls > .op-card:nth-child(1) { flex: 0 0 auto; }
.op-controls > .op-card:nth-child(2) { flex: 1 1 250px; max-width: 340px; }
.op-controls > .op-card:nth-child(3) { flex: 1 1 380px; }

.op-controls .op-card {
  padding: 8px 10px;
}

.op-controls .op-card h4 {
  margin-bottom: 6px;
}

.op-controls .op-card h4 small {
  display: block;
  margin: 2px 0 0;
}

.op-controls .op-boxes {
  gap: 8px;
  justify-content: flex-start;
}

.op-controls .op-box {
  width: clamp(58px, 4.8vw, 90px);   /* 화면 폭에 맞춰 줄어듦 */
  max-width: none;
}

/* 수조·전동기·릴레이 칸: 좁아져도 글자가 세로로 쪼개지지 않게 */
.op-controls .op-split > div {
  min-width: 0;
}

.op-controls .op-split h4 {
  white-space: nowrap;
}

.op-controls .op-motors {
  gap: 8px;
  margin-bottom: 6px;
}

.op-controls .op-motor svg {
  width: 46px;
  height: 46px;
}

.op-controls .op-chips {
  flex-wrap: wrap;
}

.op-controls .op-timer {
  flex-wrap: wrap;
}

/* 전원·보호: MCCB 옆에 EOCR 상태·버튼 (납작하게) */
.op-controls .op-card:nth-child(2) .op-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.op-controls .op-card:nth-child(2) .op-eocr {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.op-controls .op-split {
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
}

.op-controls .op-tank {
  max-height: 128px;
}

/* 수조 오른쪽: 전동기 | 릴레이·타이머 를 가로 두 칸으로 (높이 줄이기) */
.op-controls .op-split > div:last-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-content: start;
}

.op-controls .op-split > div:last-child > h4:nth-of-type(1) { grid-column: 1; grid-row: 1; }
.op-controls .op-split > div:last-child > .op-motors { grid-column: 1; grid-row: 2 / span 2; }
.op-controls .op-split > div:last-child > h4:nth-of-type(2) { grid-column: 2; grid-row: 1; }
.op-controls .op-split > div:last-child > .op-chips { grid-column: 2; grid-row: 2; }
.op-controls .op-split > div:last-child > .op-timer { grid-column: 2; grid-row: 3; margin-top: 6px; }

.op-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.op-side .op-checklist {
  flex: 1 1 58%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.op-side .op-steps {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.op-side .op-log-card {
  flex: 1 1 42%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.op-side .op-log {
  flex: 1;
  max-height: none;
  min-height: 0;
}

/* 조금 좁은 화면: 오른쪽(동작 사항·기록) 칸을 줄임 */
@media (max-width: 1400px) {
  .op-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* 아주 좁은 화면: 한 줄씩 아래로 (전체 스크롤) */
@media (max-width: 1000px) {
  .op-layout {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    height: auto;
    overflow-y: auto;
  }
  .op-main {
    overflow: visible;
  }
  .op-side .op-checklist,
  .op-side .op-log-card {
    flex: none;
    max-height: 420px;
  }
}

/* 7단계: EOCR 리셋 효과 (초록) */
.op-eocr-state.reset-ok {
  color: #ffffff;
  background: #16a34a;
  border-color: #86efac;
  animation: op-reset-flash 0.55s ease-out 3;
}
@keyframes op-reset-flash {
  0% { box-shadow: 0 0 0 0 rgba(134, 239, 172, 0.9); }
  100% { box-shadow: 0 0 0 12px rgba(134, 239, 172, 0); }
}
.op-btn.op-btn-press {
  animation: op-btn-press 0.35s ease-out;
}
@keyframes op-btn-press {
  0% { transform: scale(1); }
  35% { transform: scale(0.9); background: #16a34a; color: #fff; }
  100% { transform: scale(1); }
}
#op-fx-layer .reset .op-timer-burst {
  stroke: #22c55e;
}
#op-fx-layer .reset .op-timer-done-text {
  fill: #15803d;
}

/* 7단계: 시퀀스 도면 ⇄ 벽면(6단계 완성) 보기 전환 */
.op-view-tabs {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.op-view-tabs button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.op-view-tabs button.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

#op-wall-svg {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #7c5a32;
  border-radius: 6px;
}

.op-wall-motor.on .op-fan {
  animation: op-spin 0.6s linear infinite;
}

.op-wall-motor.on > g > circle:first-child {
  stroke: #4ade80;
  stroke-width: 3;
}

/* 전원·보호 버튼 글자 줄바꿈 방지 */
.op-controls .op-btn {
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 6px;
}

/* 7단계 벽면: 소켓에 꽂은 테스트용 기구 — 접점이 바뀌는 순간 '딸깍' 눌림 */
.op-test-device.dev-click {
  animation: op-dev-click 0.28s ease-out;
}
@keyframes op-dev-click {
  0% { transform: scale(1); }
  40% { transform: scale(0.93); }
  100% { transform: scale(1); }
}

/* 7단계: 리밋스위치 입력 (FLS가 없는 10~18번 과제) */
.op-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.op-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: 1.5px solid #475569;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 11px;
}
.op-switch b { font-size: 13px; color: #f8fafc; }
.op-switch.on { border-color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.op-switch.on span { color: #4ade80; font-weight: 900; }

/* 램프 점등 효과 강화 (7단계 등): 램프 둘레 큰 색 빛 + 퍼져 나가는 고리 */
.dev-lamp-aura {
  animation: dev-lamp-aura 1.4s ease-in-out infinite;
}
.dev-lamp-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: dev-lamp-ring 1.4s ease-out infinite;
}
@keyframes dev-lamp-aura {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@keyframes dev-lamp-ring {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* 7단계: 시퀀스 도면의 리밋스위치 접점 · 벽면 리밋스위치를 직접 눌러 조작 */
.op-seq-switch-hit {
  fill: rgba(56, 189, 248, 0.08);
  stroke: #0ea5e9;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  animation: op-seq-switch-pulse 1.6s ease-in-out infinite;
}
.op-seq-switch.on .op-seq-switch-hit {
  fill: rgba(34, 197, 94, 0.16);
  stroke: #16a34a;
  stroke-dasharray: none;
  animation: none;
}
.op-seq-switch-tip { fill: #0284c7; paint-order: stroke; stroke: #ffffff; stroke-width: 3px; }
.op-seq-switch.on .op-seq-switch-tip { fill: #15803d; }
.op-seq-switch:hover .op-seq-switch-hit { fill: rgba(56, 189, 248, 0.2); }
@keyframes op-seq-switch-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.3; }
}
.op-wall-ls:hover > rect:first-child { fill: rgba(56, 189, 248, 0.15); }

/* 수업용 진행 조절 막대 (5·6단계 벽면 시연: 한 단계씩 멈춤 · 장면 번호로 이동) */
.presenter-bar {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  color: #e2e8f0;
}
.presenter-bar button,
.presenter-bar select {
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.presenter-bar select { max-width: 240px; border-radius: 8px; }
.presenter-bar button:disabled { opacity: 0.4; cursor: default; }
.presenter-bar .pr-mode.on { background: #ca8a04; border-color: #facc15; color: #111827; }
.presenter-bar .pr-label { min-width: 92px; text-align: center; font-weight: 800; }
.presenter-bar .pr-label b { color: #fde68a; font-size: 15px; }
.presenter-bar .pr-label em { color: #4ade80; font-style: normal; }
.presenter-bar .pr-next.waiting {
  background: #16a34a;
  border-color: #4ade80;
  animation: pr-next-pulse 1.1s ease-in-out infinite;
}
@keyframes pr-next-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}
.presenter-bar .pr-grip { cursor: grab; padding: 0 4px; font-size: 16px; color: #94a3b8; user-select: none; touch-action: none; }
.presenter-bar .pr-grip:active { cursor: grabbing; }

/* 7단계: 4·7번 초기 운전 조건(T < FR) 확인 표시 */
.op-timer-warn {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.5);
}
.op-timer-warn.bad {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  animation: pulse-border 1.5s ease-in-out 2;
}

/* 상단 '프로그램 소개' 버튼 — 눈에 잘 띄게 (주황 그라데이션 + 은은한 반짝임) */
.intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 900;
  color: #1c1917;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  border: 2px solid #fef08a;
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6), 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: introGlow 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.intro-btn:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.08);
  animation-play-state: paused;
}
@keyframes introGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(251, 191, 36, 0), 0 2px 8px rgba(0, 0, 0, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .intro-btn { animation: none; }
}

/* 좁은 화면: 헤더가 두 줄로 넘어가지 않게 (작은 태그 숨기고 과제 선택 칸을 줄임) */
@media (max-width: 1500px) {
  .brand-section { flex-wrap: nowrap; min-width: 0; }
  .brand-section .brand-tag { display: none; }
  .brand-section .problem-selector-wrapper { min-width: 0; flex-shrink: 1; }
  .brand-section .problem-select { max-width: 460px; min-width: 0; text-overflow: ellipsis; }
}
@media (max-width: 1100px) {
  .brand-logo { font-size: 16px; white-space: nowrap; }
  .intro-btn { padding: 6px 12px; font-size: 0.85rem; }
  .brand-section .select-label { display: none; }
}
