@charset "UTF-8";
/* Global styles */
/* Quicksand = theme (nav, SEO chrome, headings); Inter = body copy. */
* {
  box-sizing: border-box;
  /* 전체 프로젝트에서 텍스트 선택 방지 */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
  /* 드래그 방지 */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* 특정 요소에서는 텍스트 선택 허용 */
input,
textarea,
.selectable-text,
.user-content,
[contenteditable=true] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* 코드 블록이나 정보성 텍스트에서는 선택 허용 */
code,
pre,
.code-block,
.info-text {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

code,
pre,
.code-block {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95em;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #242a42 100%);
  color: #e4e7ec;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar 상단 줄 & 메인 top-header 동일 높이. 모바일(48px 메뉴 버튼 + 여백)을 기준으로 통일. */
:root {
  /* `.top-header` 본문 한 줄(건만) */
  --app-header-height: 58px;
  /*
   * 고정 `top-header-container` 띠 전체(= .top-header min-height + 그 아래 1px border).
   * `main.main-content`의 `padding-top`과 동일 — 뷰포트 0~이 값이 고정 내비가 차지하는 영역.
   */
  --app-header-offset: calc(var(--app-header-height) + 1px);
  /* 본문 `.content-area`의 위/아래 padding 합(기본 16+16). 768px 이하에서는 padding 5px → 합 10px */
  --app-content-pad-y-sum: 32px;
  /* 사이드바 — main / top-header `margin-left`·`left`와 동일하게 유지 */
  --sidebar-width: 244px;
  /* 접힘 시 아이콘 레일(데스크톱만) */
  --sidebar-rail: 60px;
}

/* 전역 스크롤바 스타일 - 항상 표시 */
* {
  scrollbar-width: auto; /* Firefox */
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #1a1f2e;
  border-radius: 6px;
}

*::-webkit-scrollbar-thumb {
  background: #3a3f4e;
  border-radius: 6px;
  border: 2px solid #1a1f2e;
}

*::-webkit-scrollbar-thumb:hover {
  background: #4a4f5e;
}

*::-webkit-scrollbar-corner {
  background: #1a1f2e;
}

/* SPECTRA 레이아웃 스타일 */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: #0f1419;
  overflow-x: auto;
}

/* 사이드바 스타일 */
.sidebar {
  width: var(--sidebar-width);
  background-color: #1a1f2e;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease, width 0.25s ease;
  border-right: 1px solid #2a2f3e;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: var(--app-header-height);
  padding: 0 10px 0 14px;
  border-bottom: 1px solid #2a2f3e;
  box-sizing: border-box;
}

/* 데스크톱: 사이드바 접기(아이콘만) */
@media (min-width: 1025px) {
  .app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-rail);
  }
  .app-layout.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-rail);
  }
  .app-layout.sidebar-collapsed .top-header-container {
    left: var(--sidebar-rail);
  }
  .app-layout.sidebar-collapsed .sidebar .logo-text,
  .app-layout.sidebar-collapsed .sidebar .nav-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .app-layout.sidebar-collapsed .sidebar .logo {
    justify-content: center;
    flex: 1;
    min-width: 0;
  }
  .app-layout.sidebar-collapsed .sidebar .nav-item {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
  }
  .app-layout.sidebar-collapsed .sidebar .sidebar-footer-legal {
    display: none; /* 아이콘 레일에서는 푸터 링크 생략 — 펼치면 표시 */
  }
  .app-layout.sidebar-collapsed .sidebar-edge-toggle {
    left: var(--sidebar-rail);
  }
}
/* 사이드바 오른쪽(본문 쪽) 접기: 하단·푸터·법적 링크와 같은 대역, 패널 밖(본문 영역에 걸침) */
.sidebar-edge-toggle {
  -webkit-appearance: none;
  appearance: none;
  position: fixed;
  z-index: 1001;
  left: var(--sidebar-width);
  bottom: 28px; /* .sidebar-footer-legal 하단과 비슷한 수직 */
  min-width: 40px;
  height: 40px;
  padding: 0 8px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a2f3e;
  border-left: none; /* 사이드바 직선과 이어짐 */
  border-radius: 0 8px 8px 0;
  background: #1e2433;
  color: #b3bce0;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: left 0.25s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar-edge-toggle:hover {
  background: #252a3a;
  color: #e4e7ec;
}
.sidebar-edge-toggle:focus:not(:focus-visible) {
  outline: none;
}
.sidebar-edge-toggle:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.7);
  outline-offset: 2px;
}

.sidebar-edge-toggle-glyph {
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

/* 모바일(오버레이 사이드바)에서는 이 토글 숨김 */
@media (max-width: 1024px) {
  .sidebar-edge-toggle {
    display: none;
  }
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.logo-image {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  min-width: 0;
  flex: 1 1 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px; /* 아이콘·한 줄 라벨 기준 — 줄바꿈으로 높이가 들쭉날쭉해지지 않게 */
  padding: 8px 14px;
  color: #8b92a5;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border-left: 3px solid transparent;
  margin: 2px 0;
  cursor: pointer;
  box-sizing: border-box;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-item.active {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-left-color: #667eea;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  height: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.nav-text {
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 20px 0;
  border-top: 1px solid #2a2f3e;
}

.sidebar-footer-legal {
  padding: 12px 12px 20px;
  border-top: 1px solid #2a2f3e;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 4px;
  font-size: 12px;
  line-height: 1.3;
  box-sizing: border-box;
  min-width: 0;
}

.sidebar-legal-link {
  color: #8b92a5;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 0;
  text-align: center;
}

.sidebar-legal-link:hover {
  color: #ffffff;
}

/* Long-form copy (About, Privacy, Terms, Contact) + optional blog: matches CompuTools post/about scale */
.site-legal-page .content,
article.musicalboard-prose {
  max-width: 52rem;
}

.site-legal-page .content,
article.musicalboard-prose {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #e4e7ec;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.62;
  padding-top: 4px;
}
@media (max-width: 1200px) {
  .site-legal-page .content,
  article.musicalboard-prose {
    font-size: 15px;
  }
}
@media (max-width: 768px) {
  .site-legal-page .content,
  article.musicalboard-prose {
    font-size: 14px;
  }
}
.site-legal-page .content > h2:first-of-type,
article.musicalboard-prose > h2:first-of-type {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.35);
  color: #f0f2f8;
  text-align: left;
}
@media (max-width: 1200px) {
  .site-legal-page .content > h2:first-of-type,
  article.musicalboard-prose > h2:first-of-type {
    font-size: 26px;
  }
}
@media (max-width: 768px) {
  .site-legal-page .content > h2:first-of-type,
  article.musicalboard-prose > h2:first-of-type {
    font-size: 22px;
  }
}
.site-legal-page .content h2:not(:first-of-type),
article.musicalboard-prose h2:not(:first-of-type) {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  margin: 40px 0 18px;
  padding-bottom: 5px;
  color: #f0f2f8;
  text-align: left;
}
@media (max-width: 1200px) {
  .site-legal-page .content h2:not(:first-of-type),
  article.musicalboard-prose h2:not(:first-of-type) {
    font-size: 21px;
  }
}
@media (max-width: 768px) {
  .site-legal-page .content h2:not(:first-of-type),
  article.musicalboard-prose h2:not(:first-of-type) {
    font-size: 19px;
  }
}
.site-legal-page .content h3,
article.musicalboard-prose h3 {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  margin: 30px 0 16px;
  padding-bottom: 4px;
  color: #e8ecf4;
}
@media (max-width: 1200px) {
  .site-legal-page .content h3,
  article.musicalboard-prose h3 {
    font-size: 18px;
  }
}
@media (max-width: 768px) {
  .site-legal-page .content h3,
  article.musicalboard-prose h3 {
    font-size: 17px;
  }
}
.site-legal-page .content h4,
article.musicalboard-prose h4 {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin: 25px 0 14px;
  color: #e8ecf4;
}
@media (max-width: 768px) {
  .site-legal-page .content h4,
  article.musicalboard-prose h4 {
    font-size: 16px;
  }
}
.site-legal-page .content p,
article.musicalboard-prose p {
  margin: 0 0 1rem;
}
.site-legal-page .content ul,
.site-legal-page .content ol,
article.musicalboard-prose ul,
article.musicalboard-prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}
.site-legal-page .content li,
article.musicalboard-prose li {
  margin: 0.35rem 0;
  line-height: 1.6;
}
.site-legal-page .content a,
article.musicalboard-prose a {
  color: #a8b4ff;
  font-weight: 500;
  text-decoration: none;
}
.site-legal-page .content a:hover,
article.musicalboard-prose a:hover {
  text-decoration: underline;
}
.site-legal-page .content strong,
article.musicalboard-prose strong {
  font-weight: 600;
}

.logout {
  cursor: pointer;
}

.logout:hover {
  background-color: rgba(245, 87, 108, 0.1);
  color: #f5576c;
}

/* 메인 컨텐츠 영역 */
.main-content {
  flex: 1;
  min-width: 0; /* flex 자식이 뷰포트보다 좁아질 수 있게 — 좁은 화면에서 본문이 잘리지 않도록 */
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding-top: var(--app-header-offset);
  transition: margin-left 0.25s ease;
}

/* Fullscreen API: `#app-main-content` — top-header + 본문이 함께 표시. 사이드바는 대상 밖. */
.main-content:fullscreen,
.main-content:-webkit-full-screen {
  width: 100%;
  min-height: 100%;
  height: 100%;
  margin-left: 0;
  background-color: #0f1419;
  box-sizing: border-box;
}

.main-content:fullscreen .top-header-container,
.main-content:-webkit-full-screen .top-header-container {
  left: 0;
  right: 0;
}

.main-content:fullscreen > main.content-area,
.main-content:-webkit-full-screen > main.content-area {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
}

/* 홈: app-container → 대시보드가 남는 세로 공간 사용 */
.main-content:fullscreen .content-area > .app-container,
.main-content:-webkit-full-screen .content-area > .app-container {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 상세(툴) 풀스크린: .detail-page 박스 제거 — main.content-area의 flex 자식이 .content.full-width(→ analyzer)가 됨 */
.main-content:fullscreen .content-area > .detail-page,
.main-content:-webkit-full-screen .content-area > .detail-page {
  display: contents;
}

/* 상세 풀스크린: 대시보드와 같이 본문 box에 16px 패딩 + min-width 해제 */
.main-content:fullscreen .content-area:has(> .detail-page),
.main-content:-webkit-full-screen .content-area:has(> .detail-page) {
  padding: 16px;
  min-width: 0 !important;
  overflow: hidden;
}

/* 상세 풀스크린: 1024px cap·가운데 정렬·세로 마진 제거 — 피치가 헤더 아래 가로·세로 전부 사용 */
.main-content:fullscreen .content-area:has(> .detail-page) .analyzer-container,
.main-content:-webkit-full-screen .content-area:has(> .detail-page) .analyzer-container {
  margin: 0;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: none;
  align-items: stretch;
  justify-content: flex-start;
  align-self: stretch;
}

.main-content:fullscreen .content-area:has(> .detail-page) .analyzer-container > .pitch-analyzer-direct,
.main-content:-webkit-full-screen .content-area:has(> .detail-page) .analyzer-container > .pitch-analyzer-direct {
  max-width: none;
  width: 100%;
  min-height: 0;
  flex: 1 1 0;
  align-self: stretch;
  height: auto; /* flex 자식이 부모 세로를 채움 */
  display: flex;
  flex-direction: column;
}

/* 피치 루트가 .pitch-analyzer-direct의 유일(직계) 콘텐츠 블록일 때 남는 세로를 모두 씀 */
.main-content:fullscreen .content-area:has(> .detail-page) .pitch-analyzer-direct > *,
.main-content:-webkit-full-screen .content-area:has(> .detail-page) .pitch-analyzer-direct > * {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

/* 홈 SEO/인트로는 풀스크린에서 숨김 — 피치 카드만 */
.main-content:fullscreen .seo-home-above-dashboard,
.main-content:-webkit-full-screen .seo-home-above-dashboard {
  display: none !important;
}

.main-content:fullscreen .content-area .app-container > .dashboard,
.main-content:-webkit-full-screen .content-area .app-container > .dashboard {
  flex: 1 1 0;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
}

/* 대시보드에서 피치 외 카드 숨김 */
.main-content:fullscreen .dashboard .dashboard-item:not(#pitch-plot),
.main-content:-webkit-full-screen .dashboard .dashboard-item:not(#pitch-plot),
.main-content:fullscreen div[style*="--dashboard-columns"] .dashboard-item:not(#pitch-plot),
.main-content:-webkit-full-screen div[style*="--dashboard-columns"] .dashboard-item:not(#pitch-plot) {
  display: none !important;
}

.main-content:fullscreen .content-area .dashboard #pitch-plot.dashboard-item,
.main-content:-webkit-full-screen .content-area .dashboard #pitch-plot.dashboard-item,
.main-content:fullscreen div[style*="--dashboard-columns"] #pitch-plot.dashboard-item,
.main-content:-webkit-full-screen div[style*="--dashboard-columns"] #pitch-plot.dashboard-item {
  flex: 1 1 0;
  min-height: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
}

/* 상세 페이지: SEO/설명 숨기고 분석 영역만 */
.main-content:fullscreen .detail-page .detail-seo-bundle,
.main-content:-webkit-full-screen .detail-page .detail-seo-bundle,
.main-content:fullscreen .detail-page .description,
.main-content:-webkit-full-screen .detail-page .description {
  display: none !important;
}

.main-content:fullscreen .detail-page .content.full-width,
.main-content:-webkit-full-screen .detail-page .content.full-width {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.main-content:fullscreen .detail-page .analyzer-container,
.main-content:-webkit-full-screen .detail-page .analyzer-container {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main-content:fullscreen .pitch-analyzer-direct,
.main-content:-webkit-full-screen .pitch-analyzer-direct {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.top-header-container {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  position: fixed; /* 고정 위치 */
  top: 0; /* 상단에 고정 */
  left: var(--sidebar-width); /* 사이드바 너비만큼 왼쪽 여백 */
  right: 0; /* 오른쪽 끝까지 */
  z-index: 999; /* 다른 요소들 위에 표시 */
  background-color: #1a1f2e; /* 배경색 추가 */
  border-bottom: 1px solid #2a2f3e; /* 하단 테두리 */
  box-sizing: border-box;
  min-height: var(--app-header-offset);
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  transition: left 0.25s ease;
}

/* 상단 헤더 스타일 — 한 줄: 왼쪽(제목, 좁으면 말줄임) + 오른쪽(컨트롤) */
.top-header {
  background-color: #1a1f2e;
  padding: 0 24px;
  min-height: var(--app-header-height);
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
  flex: 1 1 0%;
  /* 사이드바를 줄인 만큼 제목·경로에 더 넓은 가로 공간 */
  max-width: min(720px, 52vw);
  padding: 0;
  overflow: hidden;
}

.mobile-menu-btn {
  display: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  /* mobile-controls-btn 과 동일한 헤더 아이콘 버튼 크기 */
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 8px;
  flex-shrink: 0; /* 버튼은 축소되지 않도록 */
  /* 모바일 터치: 300ms 지연 완화, 탭 시 회색/하이라이트 제거 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  align-items: center;
  justify-content: center;
  color: #ffffff; /* MenuIcon stroke currentColor */
  /* 터치 후 남는 포커스 링 최소화(키보드는 :focus-visible 유지) */
  /* ControllerIcon 과 동일: 24 뷰박스를 28px 로 표시 (mobile-controls-btn svg 와 통일) */
}
.mobile-menu-btn:focus:not(:focus-visible) {
  outline: none;
}
.mobile-menu-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.7);
  outline-offset: 3px;
}
.mobile-menu-btn:hover {
  background: none;
  box-shadow: none;
  transform: none;
}
.mobile-menu-btn .menu-icon-svg {
  pointer-events: none;
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.mobile-menu-btn .menu-bar {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: 12px 12px;
}

.page-title {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-center {
  flex: 1;
  max-width: 400px;
  margin: 0 24px;
  min-width: 0; /* flex 아이템이 축소될 수 있도록 */
  flex-shrink: 1; /* 필요시 축소 가능 */
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%; /* 부모 컨테이너 전체 너비 사용 */
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #8b92a5;
  font-size: 16px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  background-color: #2a2f3e;
  border: 1px solid #3a3f4e;
  border-radius: 8px;
  color: #ffffff;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0; /* 입력창이 축소될 수 있도록 */
}

.search-input:focus {
  border-color: #667eea;
}

.search-input::placeholder {
  color: #8b92a5;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

.header-btn {
  background: none;
  border: none;
  color: #8b92a5;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0; /* 버튼은 축소되지 않도록 */
}

.header-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.user-profile {
  margin-left: 8px;
  flex-shrink: 0; /* 프로필은 축소되지 않도록 */
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0; /* 아바타는 축소되지 않도록 */
}

.user-avatar:hover {
  transform: scale(1.05);
}

.pitch-controls-container {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid #2a2f3e;
  white-space: nowrap; /* 피치 컨트롤이 줄바꿈되지 않도록 */
  min-width: 0; /* flex 아이템이 축소될 수 있도록 */
  flex-shrink: 0; /* 피치 컨트롤은 축소되지 않도록 */
}

/* 컨텐츠 영역 */
.content-area {
  flex: 1;
  padding: 16px;
  background-color: #0f1419;
  overflow-x: auto;
  overflow-y: auto;
  min-width: 1600px;
  /* 스크롤바 항상 표시 */
  scrollbar-width: auto;
}
.content-area::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.content-area::-webkit-scrollbar-track {
  background: #1a1f2e;
  border-radius: 6px;
}
.content-area::-webkit-scrollbar-thumb {
  background: #3a3f4e;
  border-radius: 6px;
  border: 2px solid #1a1f2e;
}
.content-area::-webkit-scrollbar-thumb:hover {
  background: #4a4f5e;
}
.content-area::-webkit-scrollbar-corner {
  background: #1a1f2e;
}

/* Detail 페이지에서 min-width 제거 */
.content-area.no-min-width {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 대시보드 스타일 업데이트 */
.dashboard {
  display: grid;
  grid-template-columns: repeat(var(--dashboard-columns, 3), 1fr);
  gap: 14px;
  align-content: start;
  /* 대시보드 최소 너비 고정 — 1024px 이하에서 미디어쿼리로 min-width 해제 */
  min-width: 1160px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* 반응형 대시보드 컬럼 오버라이드 */
@media (max-width: 1024px) {
  .content-area .dashboard,
  div[style*="--dashboard-columns"] {
    /* CSS 변수 오버라이드로 1열로 변경 */
    --dashboard-columns: 1 !important;
    grid-template-columns: 1fr !important;
    min-width: auto !important;
    gap: 16px;
  }
  /* 대시보드 아이템들도 강제로 1열 차지하도록 */
  .content-area .dashboard .dashboard-item,
  div[style*="--dashboard-columns"] .dashboard-item {
    grid-column: 1/-1 !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  /*
   * 홈 대시보드 Pitch 카드:
   * - 뷰 − 고정 top-header(= --app-header-offset) − .content-area 위·아래 padding
   * - `.pitch-plot-panel`(설정)은 카드 **안**에서 이미 자리 잡으므로 여기서 다시 빼지 않음(JS가 패널 높이 측정해 캔버스에 반영)
   * - height transition 없음: 창 리사이즈 시 캔버스가 한 번에 맞게
   */
  .content-area .dashboard #pitch-plot.dashboard-item,
  div[style*="--dashboard-columns"] #pitch-plot.dashboard-item {
    aspect-ratio: auto !important;
    height: calc(100dvh - var(--app-header-offset) - var(--app-content-pad-y-sum, 48px));
    max-height: calc(100dvh - var(--app-header-offset) - var(--app-content-pad-y-sum, 48px));
    min-height: 0;
    overflow: hidden;
    transition: none;
  }
  .content-area .dashboard #pitch-plot .dashboard-item-content,
  div[style*="--dashboard-columns"] #pitch-plot .dashboard-item-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden; /* 내부 y 스크롤 제거 — 캔버스가 남은 높이에 맞춤 */
  }
}
@media (max-width: 768px) {
  .content-area .dashboard,
  div[style*="--dashboard-columns"] {
    /* CSS 변수 오버라이드로 1열 유지 */
    --dashboard-columns: 1 !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  /* 대시보드 아이템들도 강제로 1열 차지하도록 */
  .content-area .dashboard .dashboard-item,
  div[style*="--dashboard-columns"] .dashboard-item {
    grid-column: 1/-1 !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
}
.dashboard-item {
  background-color: #0f1419;
  border-radius: 0;
  border: none;
  overflow: hidden;
  /* `all`이면 height도 보간됨 — #pitch-plot 등은 위에서 덮어씀 */
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  position: relative;
}

/* Home: hero + collapsible intro sit above the tool grid as one block (not a third “card”). */
.seo-home-above-dashboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.58;
}
@media (max-width: 768px) {
  .seo-home-above-dashboard {
    font-size: 14px;
  }
}

/* Hero: typography on canvas (#0f1419) — no second card chrome; accent ties to link color #8b9cff */
.seo-home-hero {
  margin: 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid rgba(139, 156, 255, 0.45);
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
  max-width: 52rem;
  -webkit-user-select: text;
  user-select: text;
}

.seo-home-hero-sub {
  margin: 0;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.52;
  color: #e8ecf4;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .seo-home-above-dashboard {
    gap: 10px;
    margin-bottom: 16px;
  }
  .seo-home-hero {
    padding-left: 12px;
    border-left-width: 2px;
    max-width: none;
  }
  .seo-home-hero-sub {
    font-size: 0.875rem;
    line-height: 1.55;
  }
}
/* `<details>`: full copy in DOM for crawlers; nested margin handled by `.seo-home-above-dashboard`. */
.seo-home-above-dashboard details.seo-home-intro {
  margin-bottom: 0;
}

details.seo-home-intro {
  background-color: #1a1f2e;
  border: 1px solid #2a2f3e;
  border-radius: 0;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
details.seo-home-intro summary.seo-home-intro-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #e2e6ef;
}
details.seo-home-intro summary.seo-home-intro-summary::-webkit-details-marker {
  display: none;
}
details.seo-home-intro summary.seo-home-intro-summary::marker {
  display: none;
}
details.seo-home-intro summary.seo-home-intro-summary .seo-home-summary-text {
  font-weight: 600;
  color: #ffffff;
}
details.seo-home-intro summary.seo-home-intro-summary .seo-home-summary-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #8b9cff;
  line-height: 1;
  transition: transform 0.2s ease;
}
details.seo-home-intro summary.seo-home-intro-summary:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
details.seo-home-intro[open] summary.seo-home-intro-summary {
  border-bottom: 1px solid #2a2f3e;
}
details.seo-home-intro[open] summary.seo-home-intro-summary .seo-home-summary-chevron {
  transform: rotate(180deg);
}
details.seo-home-intro .seo-home-intro-body {
  padding: 16px 20px 20px;
}
details.seo-home-intro h2 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #f0f2f8;
  margin: 0 0 12px 0;
  line-height: 1.38;
}
@media (max-width: 1024px) {
  details.seo-home-intro h2 {
    font-size: 21px;
  }
}
@media (max-width: 768px) {
  details.seo-home-intro h2 {
    font-size: 18px;
  }
}
details.seo-home-intro .seo-home-subheading {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: #e8ecf4;
  margin: 20px 0 10px 0;
}
@media (max-width: 768px) {
  details.seo-home-intro .seo-home-subheading {
    font-size: 17px;
  }
}
details.seo-home-intro .seo-home-lead {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #b8c0d4;
  line-height: 1.58;
  margin: 0 0 18px 0;
  font-size: 0.875rem;
}
details.seo-home-intro .seo-home-section-lead {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #b8c0d4;
  line-height: 1.58;
  margin: 0 0 16px 0;
  font-size: 0.875rem;
}
details.seo-home-intro h2 + .seo-home-section-lead {
  margin-top: 0;
}
details.seo-home-intro h2 + .seo-home-audience-list {
  margin-top: 0;
}
details.seo-home-intro .seo-home-audience-list {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  margin: 0 0 18px;
  padding-left: 1.25rem;
  color: #b8c0d4;
  font-size: 0.875rem;
  line-height: 1.55;
}
details.seo-home-intro .seo-home-audience-list li {
  margin: 0.4rem 0;
}
details.seo-home-intro .seo-home-faq-question {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin: 1.25rem 0 0.35rem;
  line-height: 1.45;
  color: #e8ecf4;
}
@media (max-width: 768px) {
  details.seo-home-intro .seo-home-faq-question {
    font-size: 15px;
  }
}
details.seo-home-intro .seo-home-faq-answer {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.58;
  color: #b8c0d4;
}
details.seo-home-intro .seo-home-tool-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px 20px;
}
details.seo-home-intro .seo-home-tool-links li {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #9aa3b8;
  font-size: 0.875rem;
  line-height: 1.52;
  margin: 0;
}
details.seo-home-intro .seo-home-tool-links a {
  color: #8b9cff;
  font-weight: 500;
  text-decoration: none;
}
details.seo-home-intro .seo-home-tool-links a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  details.seo-home-intro {
    margin-bottom: 16px;
  }
  details.seo-home-intro summary.seo-home-intro-summary {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  details.seo-home-intro .seo-home-intro-body {
    padding: 12px 16px 16px;
  }
  details.seo-home-intro .seo-home-tool-links {
    grid-template-columns: 1fr;
  }
}
/* 반응형 디자인 */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .app-layout.mobile-menu-open .sidebar {
    transform: translateX(0);
  }
  .app-layout {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }
  .main-content {
    margin-left: 0;
    padding-top: var(--app-header-offset);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  /* Home 포함: 본문이 뷰포트보다 넓게 강제되지 않게 (기본 1600px min-width 제거) */
  .content-area {
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .app-container {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .top-header-container {
    left: 0; /* 모바일에서는 사이드바 너비 고려하지 않음 */
    right: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .top-header {
    padding: 0 12px;
  }
  .header-left {
    gap: 12px; /* 간격 줄이기 */
  }
  /* 좁은 화면에서도 제목 표시 — 긴 제목은 ellipsis (오른쪽 컨트롤 영역 확보) */
  .page-title {
    font-size: 14px;
  }
  .header-left {
    max-width: min(720px, 100% - 200px);
  }
  .header-center {
    max-width: 300px;
    margin: 0 16px; /* 마진 줄이기 */
  }
  .header-right {
    gap: 10px; /* 간격 줄이기 */
  }
  /* 1024px 이하에서는 피치 컨트롤 유지 */
  .pitch-controls-container {
    display: flex;
    margin-left: 12px;
    padding-left: 12px;
  }
}
@media (max-width: 768px) {
  .top-header {
    padding: 0 12px;
  }
  .header-left {
    gap: 8px;
    max-width: min(720px, 100% - 140px);
  }
  .header-right {
    gap: 8px;
  }
  .content-area {
    padding: 5px;
  }
  :root {
    /* 768px 이하: `.content-area` padding 5px — #pitch-plot 높이 calc(위+아래 10px) */
    --app-content-pad-y-sum: 10px;
  }
  .dashboard-overview {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 16px;
  }
  .metrics-row {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 16px;
  }
  .bottom-row {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 16px;
  }
  /* 모바일에서 카드 패딩 조정 */
  .metric-card {
    padding: 20px;
    min-height: 180px;
  }
  .invoices-card,
  .activity-card {
    padding: 20px;
    min-height: 220px;
  }
  .page-title {
    font-size: 13px;
  }
  /* 검색창도 숨기기 */
  .header-center {
    display: none;
  }
  /* 피치 컨트롤은 계속 표시 */
  .pitch-controls-container {
    display: flex;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #2a2f3e;
  }
}
@media (max-width: 480px) {
  .top-header {
    padding: 0 12px;
  }
  .header-left {
    gap: 6px; /* 간격 최소화 */
  }
  .header-right {
    gap: 6px; /* 간격 최소화 */
  }
  .pitch-controls-container {
    margin-left: 4px;
    padding-left: 4px;
  }
  /* 헤더 버튼 크기 조정 */
  .header-btn {
    padding: 6px;
    font-size: 16px;
  }
  .user-avatar {
    width: 28px;
    height: 28px;
  }
}
@media (max-width: 360px) {
  .top-header {
    padding: 0 8px;
  }
  .header-left {
    gap: 4px;
  }
  .header-right {
    gap: 4px;
  }
  .pitch-controls-container {
    margin-left: 2px;
    padding-left: 2px;
  }
  .header-btn {
    padding: 4px;
    font-size: 14px;
  }
  .user-avatar {
    width: 24px;
    height: 24px;
  }
}
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
}

.app-layout.mobile-menu-open .sidebar {
  transform: translateX(0);
}
.app-layout.mobile-menu-open .mobile-overlay {
  display: block;
}
.app-layout.mobile-menu-open .mobile-menu-btn {
  /* 트랙 y=6 / 12 / 18 → 중앙 12 로 맞추기 위해 ±6 */
}
.app-layout.mobile-menu-open .mobile-menu-btn .menu-bar--mid {
  opacity: 0;
}
.app-layout.mobile-menu-open .mobile-menu-btn .menu-bar--top {
  transform: translateY(6px) rotate(45deg);
}
.app-layout.mobile-menu-open .mobile-menu-btn .menu-bar--bot {
  transform: translateY(-6px) rotate(-45deg);
}

/* 전역 제목·버튼: 세부 레이아웃은 각 컴포넌트에서 덮어씀 */
h1 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #ffffff;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
}

h2 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #ffffff;
  margin-top: 0;
  font-weight: 600;
  font-size: 1.2rem;
}

button {
  background-color: #667eea;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  background-color: #5a6fd8;
  transform: translateY(-1px);
}

button.active {
  background-color: #667eea;
  color: #ffffff;
}

/* 기존 컴포넌트 스타일들 유지하되 색상 조정 */
.icon-button {
  font-size: 1.5rem;
  padding: 8px 12px;
  background-color: transparent;
  color: #8b92a5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-active {
  background-color: rgba(255, 0, 0, 0.2);
  transform: translateY(-1px);
  color: #8b9aff;
}

.monitor-active {
  background-color: rgba(0, 255, 0, 0.2);
  transform: translateY(-1px);
  color: #667eea;
}

/* 대시보드 스타일 */
.dashboard {
  display: grid;
  grid-template-columns: repeat(var(--dashboard-columns, 3), 1fr);
  gap: 14px;
  align-content: start;
  min-width: 1160px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-item {
  grid-column: span var(--item-width, 1);
  grid-row: span var(--item-height, 1);
  background-color: #0f1419;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  border: none;
  /* 가로세로 비율 유지를 위한 스타일 */
  aspect-ratio: var(--item-aspect-ratio, 16/9);
  min-height: 0;
}

/* 피아노 타일은 컨트롤 패널 + 건반이 잘리지 않도록 콘텐츠 기반 높이를 사용 */
#piano-keyboard.dashboard-item {
  aspect-ratio: auto;
  height: auto;
}

/*
 * 스케일 제너레이터: 홈 대시보드에서 기본 16:9 타일 높이를 쓰면,
 * 1024px 이하 1열·모바일에서 상단(레인지/BPM/방향)이 세로로 길어져 잘림.
 * 타일·래퍼는 콘텐츠 높이에 맞춤(피아노와 동일한 패턴).
 */
#scale-generator.dashboard-item {
  aspect-ratio: auto;
  height: auto;
}

#scale-generator .dashboard-item-content {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

/* Range map: 피치 플롯 오른쪽(2열)·스케일 제너레이터 아래(2행) 타일 — 고정 16:9보다 콘텐츠 높이 우선 */
#vocal-range-gauge.dashboard-item {
  aspect-ratio: auto;
  height: auto;
  justify-content: flex-end;
}

#vocal-range-gauge .dashboard-item-content {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
  justify-content: flex-end;
}

/*
 * 홈 대시보드(≥1025px, `.dashboard-home-layout`):
 * `grid-template-rows`는 행별 `minmax(…, auto)` 최소 높이(너무 크지 않게 약 60% 스케일) + `auto`로 확장.
 * 스케일·레인지는 각 2행 span, 피치는 그 위 5행 span + `height:100%`.
 * --with-range: 행1 진폭+메트로놈 | 행2–3 스케일 | 행4–5 레인지 | 행6 피아노
 * --no-range: 행1 진폭+메트로놈 | 행2–3 스케일 | 행4 피아노
 */
@media (min-width: 1025px) {
  .content-area:has(> .app-container) {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .content-area > .app-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .content-area > .app-container > .seo-home-above-dashboard {
    flex: 0 0 auto;
  }
  .content-area .dashboard.dashboard-home-layout {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    align-content: start;
  }
  /* 행 최소 높이: 직전(2배) 대비 약 60% — 콘텐츠가 더 크면 auto로 확장 */
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range {
    grid-template-rows: minmax(206px, auto) minmax(147px, auto) minmax(147px, auto) minmax(120px, auto) minmax(120px, auto) auto;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range {
    grid-template-rows: minmax(202px, auto) minmax(158px, auto) minmax(158px, auto) auto;
  }
  /* 그리드 셀 높이를 타일 박스가 꽉 채우게 — `align-self:start`+`height:auto`만 쓰면 셀·행 정렬이 깨져 겹쳐 보일 수 있음 */
  .content-area .dashboard.dashboard-home-layout > .dashboard-item {
    align-self: stretch;
    min-height: auto;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #pitch-plot.dashboard-item {
    grid-column: 1/4;
    grid-row: 1/6;
    aspect-ratio: auto;
    height: 100%;
    max-height: none;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range #pitch-plot.dashboard-item {
    grid-column: 1/4;
    grid-row: 1/4;
    aspect-ratio: auto;
    height: 100%;
    max-height: none;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout #pitch-plot .dashboard-item-content {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
  }
  .content-area .dashboard.dashboard-home-layout #amplitude-visualizer.dashboard-item {
    grid-column: 4;
    grid-row: 1/2;
    height: 100%;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout #metronome.dashboard-item {
    grid-column: 5;
    grid-row: 1/2;
    height: 100%;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout #metronome .dashboard-item-content,
  .content-area .dashboard.dashboard-home-layout #amplitude-visualizer .dashboard-item-content {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #scale-generator.dashboard-item {
    grid-column: 4/6;
    grid-row: 2/4;
    height: 100%;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #vocal-range-gauge.dashboard-item {
    grid-column: 4/6;
    grid-row: 4/6;
    height: 100%;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #scale-generator .dashboard-item-content {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #vocal-range-gauge .dashboard-item-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
    overflow: hidden;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range #scale-generator.dashboard-item {
    grid-column: 4/6;
    grid-row: 2/4;
    height: 100%;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range #scale-generator .dashboard-item-content {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    max-height: 100%;
  }
  /* 피아노: 그리드 행 최소 높이에 맞추지 않고 건반·패널의 자연 높이만 사용 */
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #piano-keyboard.dashboard-item,
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range #piano-keyboard.dashboard-item {
    grid-column: 1/-1;
    align-self: start;
    height: auto;
    min-height: 0;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--with-range #piano-keyboard.dashboard-item {
    grid-row: 6/7;
  }
  .content-area .dashboard.dashboard-home-layout.dashboard--no-range #piano-keyboard.dashboard-item {
    grid-row: 4/5;
  }
  .content-area .dashboard.dashboard-home-layout #piano-keyboard .dashboard-item-content {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    width: 100%;
  }
}
/* 대시보드 아이템 헤더 스타일 */
.dashboard-item-header {
  background-color: #16272d;
  padding: 10px 15px;
  border-bottom: 1px solid #11282f;
  display: flex;
  justify-content: flex-end;
}

.dashboard-item-header a {
  text-decoration: none;
  color: #d5d1a7;
  font-weight: 500;
  font-size: 14px;
  background-color: rgba(213, 209, 167, 0.1);
  padding: 5px 10px;
  border-radius: 2px;
  transition: all 0.2s;
}

.dashboard-item-header a:hover {
  background-color: rgba(213, 209, 167, 0.2);
  transform: translateY(-2px);
}

.dashboard-item-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 피치 카드: 세로 스크롤 없음(레이아웃·캔버스 크기가 맞음) */
#pitch-plot .dashboard-item-content {
  overflow-x: hidden;
  overflow-y: hidden;
}

/* 창 리사이즈 시 width/height가 CSS transition에 걸리지 않도록(캔버스가 늦게 따라가는 느낌 방지) */
#pitch-plot.dashboard-item,
#pitch-plot .dashboard-item-content,
#pitch-plot .pitch-plot-fullscreen-host,
#pitch-plot .pitch-plot-root,
#pitch-plot canvas.pitch-plot-canvas {
  transition: none !important;
}

/* Pitch plot — 컨트롤 패널(대시보드/상세 공통 class) */
.pitch-plot-root {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  height: 100%;
  align-self: stretch;
  gap: 10px;
  background-color: #0f1419;
}

.pitch-plot-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  background: #121a22;
  border: 1px solid #2c3342;
  border-radius: 0;
  padding: 0;
  margin: 0 0 2px 0;
  flex: 0 0 auto;
}

/* 4블록: 셀 사이 실선 — 기본(가장 좁음) 1열4행, 601+ 2×2, 1025+ 1행4열 */
.pitch-plot-control-rows {
  --ppr-divider: 1px solid #2a3444;
  display: grid;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 13px;
  color: #a8b0c4;
  column-gap: 0;
  row-gap: 0;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "ppr-y" "ppr-flags" "ppr-sens" "ppr-fs";
}

.pitch-plot-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  box-sizing: border-box;
  justify-content: center; /* 그리드 셀 안에서 콘텐츠 가로 중앙 */
}

.ppr-y,
.pitch-plot-flags,
.pitch-plot-sens,
.pitch-plot-fs-wrap {
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 10px;
}

.ppr-y {
  grid-area: ppr-y;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  justify-content: center;
  border-bottom: var(--ppr-divider);
}

.pitch-plot-flags {
  grid-area: ppr-flags;
  border-bottom: var(--ppr-divider);
}

.pitch-plot-sens {
  grid-area: ppr-sens;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  justify-content: center;
  border-bottom: var(--ppr-divider);
}

.pitch-plot-fs-wrap {
  grid-area: ppr-fs;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.pitch-plot-sens .pitch-plot-sens-range {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  height: 7px;
  accent-color: #7b68ee;
  cursor: pointer;
}

.pitch-plot-sens .pitch-plot-sens-value {
  font-family: "JetBrains Mono", monospace;
  color: #c8d0e0;
  min-width: 3.2rem;
  flex-shrink: 0;
}

.pitch-plot-select {
  font-family: "JetBrains Mono", monospace;
  background: #0f1419;
  color: #d0d8e8;
  border: 1px solid #343b4d;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  min-width: 0;
  max-width: 100%;
}

.pitch-plot-tag {
  flex-shrink: 0;
  white-space: nowrap;
  color: #7d8699;
  font-size: 12px;
}

.pitch-plot-flags .pitch-plot-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 0;
}

/* 본문이 브라우저 풀스크린(`#app-main-content`)일 때 피치 스택이 남는 높이를 채움 */
.main-content:fullscreen .pitch-plot-fullscreen-host,
.main-content:-webkit-full-screen .pitch-plot-fullscreen-host {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.main-content:fullscreen .pitch-plot-root,
.main-content:-webkit-full-screen .pitch-plot-root {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
}

.pitch-plot-fullscreen-host {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  flex: 1;
  height: 100%;
  width: 100%;
  background-color: #0f1419;
  border: 1px solid #343b4d;
}

/* Scale Generator `.sg-seg-btn` / `.is-on` 과 동일 톤(방향 토글 활성 = 보라 그라데이션) */
.pitch-plot-fs-btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.5rem;
  flex: 1 1 auto;
  align-self: stretch;
  padding: 5px 8px;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d0d5e6;
  background: rgba(15, 20, 30, 0.65);
  border: unset;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.pitch-plot-fs-btn:hover:not(:disabled) {
  border-color: rgba(102, 126, 234, 0.45);
  color: #e4e7ec;
}
.pitch-plot-fs-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.85);
  outline-offset: 2px;
}
.pitch-plot-fs-btn.is-on {
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}
.pitch-plot-fs-btn.is-on:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.pitch-plot-canvas {
  /* CSS가 레이아웃을 주도: 부모 `.pitch-plot-root` 의 남는 공간을 flex:1로 바로 채움.
     인라인 `width/height(px)` 를 쓰던 구조에서는 Rust 측정→Yew state→DOM 반영 왕복이 있어
     창 높이 변경 시 한 프레임씩 지연/계단으로 보였다. 여기서 CSS 크기를 확정하면 창 변화와
     canvas 표시 크기가 같은 레이아웃 틱에 반영되고, JS는 bitmap 버퍼(`width`/`height` 속성)만 맞추면 된다. */
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
}

.amplitude-visualizer {
  border: 1px solid #343b4d;
  box-sizing: border-box;
}

/* 상세 페이지(.pitch-analyzer-direct) 는 scroll 기반이라 부모 높이가 열려있다 → `flex:1` 이 0 으로 resolve.
   따라서 캔버스에 뷰포트 기반의 명시적 높이를 주고, 루트의 `height:100%` 는 풀어준다. 이렇게 해도
   창 세로가 바뀌면 `vh` 계산이 CSS 차원에서 한 번에 반영되므로 지연이 생기지 않는다. */
.pitch-analyzer-direct .pitch-plot-fullscreen-host {
  width: 100%;
}

.pitch-analyzer-direct .pitch-plot-root {
  height: auto;
  min-height: 0;
}

.pitch-analyzer-direct .pitch-plot-canvas {
  flex: 0 0 auto;
  width: 100%;
  height: 85vh;
  min-height: 360px;
  max-height: 820px;
}

/* Vocal range gauge — 대시보드 타일·상세 공통: 루트 너비를 넘지 않게, bitmap 폭이 레이아웃을 밀지 않게 */
.vocal-range-gauge-root {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
  border: 1px solid #343b4d;
  /* 패널 줄바꿈은 뷰포트가 아니라 타일/카드 실제 너비 기준(대시보드 좁은 칸 대응) */
  /* `.pitch-analyzer-direct .pitch-plot-canvas` 의 85vh 등이 섞이지 않도록 명시 */
}
.vocal-range-gauge-root .vocal-range-plot-root {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
  container-type: inline-size;
  container-name: vocal-range-panel;
}
.vocal-range-gauge-root .vocal-range-canvas-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 0;
  /* 창이 좁아지면 가로에 비례해 히트맵 높이도 줄어듦 (가로 대비 세로: 100/22 → 100/19 로 약간 낮춤) */
  aspect-ratio: 100/19;
  height: auto;
  flex: 0 1 auto;
  max-height: min(30vw, 220px);
  min-height: 48px;
  display: flex;
  flex-direction: column;
}
.vocal-range-gauge-root .vocal-range-gauge-canvas.pitch-plot-canvas {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
  height: 100%;
  max-height: none;
}

/* `/vocal-range-map` 전용 컬럼 */
.vocal-range-only {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.vocal-range-only .vocal-range-gauge-root .vocal-range-canvas-wrap {
  min-height: 0;
}
.vocal-range-only .vocal-range-gauge-root .vocal-range-gauge-canvas.pitch-plot-canvas {
  flex: 1 1 auto;
  height: 100%;
  max-height: none;
}

/* Vocal range — 기본(가장 좁은 컨테이너): 1열 4행. 중간·넓음은 아래 @container */
.vocal-range-plot-root .vocal-range-panel-rows {
  grid-template-areas: "ppr-y" "ppr-flags" "ppr-sens" "pvr-stats";
}

.vocal-range-plot-root .vocal-range-panel-stats {
  grid-area: pvr-stats;
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 10px;
  /* 2×2 그리드, 각 칸은 라벨 + 값 가로 배치 */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  align-content: center;
  justify-items: stretch;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: #8b92a5;
  border-bottom: 1px solid #2a3444;
}

.vocal-range-plot-root .vrs-chip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.vocal-range-plot-root .vrs-k {
  color: #5c6578;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.vocal-range-plot-root .vrs-v {
  color: #c8d0e4;
  font-weight: 600;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* `.pitch-analyzer-direct .pitch-plot-root { height: auto }`가 아래에 있어 풀스크린 flex를 막음 — 더 구체적으로 복원 */
.main-content:fullscreen .pitch-analyzer-direct .pitch-plot-root,
.main-content:-webkit-full-screen .pitch-analyzer-direct .pitch-plot-root {
  height: 100%;
  min-height: 0;
  flex: 1 1 0;
}

/* 상세 페이지(고정 vh 캔버스) — 브라우저 풀스크린에서 flex로 남는 공간 채움 */
.main-content:fullscreen .pitch-analyzer-direct .pitch-plot-canvas,
.main-content:-webkit-full-screen .pitch-analyzer-direct .pitch-plot-canvas {
  flex: 1 1 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* 601~1024px: 2×2 + 셀 구분선(가로/세로) */
@media (min-width: 601px) and (max-width: 1024px) {
  .pitch-plot-control-rows {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "ppr-y ppr-flags" "ppr-sens ppr-fs";
    /* center면 같은 행 좌·우 셀 높이가 달라 가로 구분선이 계단처럼 보임 */
    align-items: stretch;
  }
  .ppr-y,
  .pitch-plot-flags,
  .pitch-plot-sens,
  .pitch-plot-fs-wrap {
    border: 0;
  }
  .ppr-y {
    border-right: var(--ppr-divider);
    border-bottom: var(--ppr-divider);
  }
  .pitch-plot-flags {
    border-bottom: var(--ppr-divider);
  }
  .pitch-plot-sens {
    border-right: var(--ppr-divider);
  }
  .ppr-y,
  .pitch-plot-flags,
  .pitch-plot-sens {
    min-height: 100%;
    align-content: center;
    align-items: center;
  }
  .pitch-plot-fs-wrap {
    align-self: stretch;
  }
}
/* 1025px~: 1행 4열 + 셀 사이 세로 구분선, Y/민감도/FS 열이 남는 폭 공유 */
@media (min-width: 1025px) {
  .pitch-plot-control-rows {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, auto) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "ppr-y ppr-flags ppr-sens ppr-fs";
    align-items: stretch; /* 셀 높이·세로 border 일치, 내용은 아래 flex에서 가운데 */
  }
  .pitch-plot-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ppr-y,
  .pitch-plot-flags,
  .pitch-plot-sens,
  .pitch-plot-fs-wrap {
    border: 0;
  }
  .ppr-y,
  .pitch-plot-flags,
  .pitch-plot-sens {
    border-right: var(--ppr-divider);
    min-height: 100%;
    align-content: center; /* 셀 안에서 flex 줄(들)을 세로 가운데 */
  }
  .pitch-plot-fs-wrap {
    align-self: stretch;
  }
  /* 1행: 셀마다 내부는 줄바꿈 없음 — 그리드 fr + flex `minmax(0)`·`flex: 1 1 0` 으로 폭이 서로 뺏어감(완화 불가 시 셀 가로만 넘침) */
  .ppr-y,
  .pitch-plot-sens {
    flex-wrap: nowrap;
    gap: 4px 6px;
  }
  .pitch-plot-flags {
    flex-wrap: nowrap;
    gap: 4px 8px;
  }
  .ppr-y .pitch-plot-select {
    flex: 1 1 0;
    min-width: 2.25rem;
  }
  .ppr-y .pitch-plot-tag,
  .ppr-y > span:not(.pitch-plot-tag) {
    flex-shrink: 0; /* "Low/High" 라벨, "—" 구분 */
  }
  .pitch-plot-control-rows .pitch-plot-sens .pitch-plot-sens-range {
    flex: 1 1 0;
    min-width: 1.25rem; /* 전역 `1 1 120px` 대체 — 슬라이더가 Y·콤보 쪽으로 폭 뺏음 */
  }
  .pitch-plot-flags .pitch-plot-check {
    flex: 0 1 auto; /* `flex-shrink:0` 대체(위 전역보다 뒤·동일 구체) */
    min-width: 0;
  }
  .pitch-plot-flags .pitch-plot-check > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (min-width: 601px) and (max-width: 1024px) {
  .vocal-range-plot-root .vocal-range-panel-rows {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "ppr-y ppr-flags" "ppr-sens ppr-sens" "pvr-stats pvr-stats";
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    border-bottom: 0;
    border-top: var(--ppr-divider);
  }
}
@media (min-width: 1025px) {
  /* 열 비율은 `.pitch-plot-control-rows`(피치 패널)과 동일 — 대시보드에서 세로 구분선이 같은 위치에 오도록 */
  .vocal-range-plot-root .vocal-range-panel-rows {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, auto) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "ppr-y ppr-flags ppr-sens pvr-stats";
    align-items: stretch;
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    border: 0;
    min-height: 100%;
    align-content: center;
  }
}
/*
 * Range 패널: 뷰포트 @media 만 쓰면 대시보드 타일이 좁아도 1행이 유지되다가
 * 뷰포트만 줄일 때 4행으로 점프한다. 컨테이너 너비로 1행 → 2행(2×2) → 4행 전환.
 * (--vr-panel-1row / --vr-panel-2row 는 SCSS 변수로 임계만 한곳에서 조정)
 */
/* 1행 ↔ 2행 경계: 타일이 꽤 넓어질 때까지 2×2 유지(대시보드 Range 등) */
/* 이 너비 이하: 2×2(2행), 그 아래 $vr-panel-4row-max 에서 4행 */
/* 이 너비 이상: 1행 4열 */
/* 이 너비 이하: 1열 4행(위 2행 규칙 덮어씀) */
@container vocal-range-panel (max-width: 900px) {
  .vocal-range-plot-root .vocal-range-panel-rows {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "ppr-y ppr-flags" "ppr-sens pvr-stats";
    align-items: stretch;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-flags,
  .vocal-range-plot-root .pitch-plot-sens,
  .vocal-range-plot-root .vocal-range-panel-stats {
    border: 0;
  }
  .vocal-range-plot-root .ppr-y {
    border-right: var(--ppr-divider);
    border-bottom: var(--ppr-divider);
  }
  .vocal-range-plot-root .pitch-plot-flags {
    border-bottom: var(--ppr-divider);
  }
  .vocal-range-plot-root .pitch-plot-sens {
    border-right: var(--ppr-divider);
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    border-bottom: 0;
    border-top: 0;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-flags,
  .vocal-range-plot-root .pitch-plot-sens {
    min-height: 100%;
    align-content: center;
    align-items: center;
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    min-height: 100%;
    align-content: center;
  }
}
@container vocal-range-panel (max-width: 559px) {
  .vocal-range-plot-root .vocal-range-panel-rows {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ppr-y" "ppr-flags" "ppr-sens" "pvr-stats";
    align-items: stretch;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-flags,
  .vocal-range-plot-root .pitch-plot-sens,
  .vocal-range-plot-root .vocal-range-panel-stats {
    border: 0;
  }
  .vocal-range-plot-root .ppr-y {
    border-bottom: var(--ppr-divider);
  }
  .vocal-range-plot-root .pitch-plot-flags {
    border-bottom: var(--ppr-divider);
  }
  .vocal-range-plot-root .pitch-plot-sens {
    border-bottom: var(--ppr-divider);
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    border-bottom: 1px solid #2a3444;
  }
}
@container vocal-range-panel (min-width: 901px) {
  .vocal-range-plot-root .pitch-plot-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .vocal-range-plot-root .vocal-range-panel-rows {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, auto) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "ppr-y ppr-flags ppr-sens pvr-stats";
    align-items: stretch;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-flags,
  .vocal-range-plot-root .pitch-plot-sens,
  .vocal-range-plot-root .vocal-range-panel-stats {
    border: 0;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-flags,
  .vocal-range-plot-root .pitch-plot-sens {
    border-right: var(--ppr-divider);
    min-height: 100%;
    align-content: center;
  }
  .vocal-range-plot-root .vocal-range-panel-stats {
    border: 0;
    min-height: 100%;
    align-content: center;
  }
  .vocal-range-plot-root .ppr-y,
  .vocal-range-plot-root .pitch-plot-sens {
    flex-wrap: nowrap;
    gap: 4px 6px;
  }
  .vocal-range-plot-root .pitch-plot-flags {
    flex-wrap: nowrap;
    gap: 4px 8px;
  }
  .vocal-range-plot-root .ppr-y .pitch-plot-select {
    flex: 1 1 0;
    min-width: 2.25rem;
  }
  .vocal-range-plot-root .ppr-y .pitch-plot-tag,
  .vocal-range-plot-root .ppr-y > span:not(.pitch-plot-tag) {
    flex-shrink: 0;
  }
  .vocal-range-plot-root .vocal-range-panel-rows .pitch-plot-sens .pitch-plot-sens-range {
    flex: 1 1 0;
    min-width: 1.25rem;
  }
  .vocal-range-plot-root .pitch-plot-flags .pitch-plot-check {
    flex: 0 1 auto;
    min-width: 0;
  }
  .vocal-range-plot-root .pitch-plot-flags .pitch-plot-check > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* 대시보드 아이템 링크 스타일 */
.dashboard-item-link {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.dashboard-item-link a {
  text-decoration: none;
  color: rgba(213, 209, 167, 0.9);
  font-size: 0.6rem;
  background-color: rgba(26, 46, 53, 0.8);
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.dashboard-item-link a:hover {
  color: rgb(213, 209, 167);
  background-color: rgba(26, 46, 53, 0.9);
  transform: scale(1.1);
}

/* 카드 컴포넌트 스타일 */
.dashboard-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-card-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #11282f;
  margin-bottom: 15px;
}

.dashboard-card-header h3 {
  margin: 0;
  color: #d5d1a7;
}

.dashboard-card-content {
  flex: 1;
  overflow: auto;
}

/* 피치 분석기 스타일 */
.pitch-controls {
  display: flex;
  flex-direction: column;
}

/* 아이콘 버튼 스타일 */
.icon-button {
  font-size: 1.5rem;
  padding: 5px 10px;
  background-color: transparent;
  color: #d5d1a7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s, color 0.2s;
  box-shadow: none;
}

.icon-button:hover {
  background-color: rgba(213, 209, 167, 0.1);
  transform: translateY(-2px);
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 마이크 활성화 상태 버튼 스타일 */
.mic-active {
  background-color: rgba(255, 0, 0, 0.2);
  transform: translateY(-1px);
  color: #8b9aff;
}

/* 모니터링 활성화 상태 버튼 스타일 */
.monitor-active {
  background-color: rgba(0, 255, 0, 0.2);
  transform: translateY(-1px);
  color: #667eea;
}

/* 네비게이션 컨트롤 버튼 영역 */
.navbar-controls-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 2px;
}

/* 감도 드롭다운 스타일 */
.sensitivity-dropdown {
  position: relative;
  display: inline-block;
}

.sensitivity-dropdown-content {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  background: linear-gradient(135deg, #2a2f3e 0%, #1a1f2e 100%);
  min-width: 0;
  width: max-content;
  max-width: min(320px, 85vw);
  padding: 8px 10px;
  z-index: 9999;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid #3a3f4e;
  backdrop-filter: blur(10px);
}

.sensitivity-slider {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.sensitivity-slider input[type=range] {
  flex: 1 1 120px;
  min-width: 100px;
  width: 160px;
  max-width: 220px;
  height: 6px;
  background: linear-gradient(to right, #3a3f4e 0%, #2a2f3e 100%);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  border: 1px solid #4a4f5e;
}

.sensitivity-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sensitivity-slider input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 10px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sensitivity-slider input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sensitivity-slider-value {
  flex-shrink: 0;
  color: #c8d0e8;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  min-width: 2.75rem;
  text-align: right;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(139, 146, 165, 0.12);
  border: 1px solid rgba(139, 146, 165, 0.22);
}

.sensitivity-slider:last-child {
  margin-top: 0;
  margin-bottom: 0;
}

.sensitivity-slider label {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.sensitivity-value {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 500;
}

input[type=range] {
  -webkit-appearance: none;
  height: 6px;
  background: #2c4550;
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
}

canvas {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-color: #001117;
}

/* 상세 페이지 스타일 — `.content-area` 가로를 가득 채움(사이드바 펼침/접힘 공통, 우측 빈 여백 방지) */
.detail-page {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
  background-color: #1a1f2e;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #2a2f3e;
  overflow: visible;
}

/* SEO 인트로: 헤더 H1 아래를 한 블록으로 묶어 도구 영역과 시각적으로 분리 */
.detail-seo-bundle {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.58;
  margin-top: 2px;
  margin-bottom: 28px;
  padding: 1.35rem 1.4rem 1.2rem;
  background: linear-gradient(165deg, rgba(102, 126, 234, 0.09) 0%, rgba(20, 25, 36, 0.97) 42%, #121722 100%);
  border: 1px solid rgba(102, 126, 234, 0.22);
  border-radius: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
@media (max-width: 768px) {
  .detail-seo-bundle {
    font-size: 14px;
  }
}

.detail-seo-bundle .detail-seo-lead {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  margin: 0 0 1.1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(102, 126, 234, 0.18);
  max-width: none;
  color: #dce1ec;
  line-height: 1.62;
  font-size: 0.9375rem;
  font-weight: 400;
  text-align: left;
}

.detail-seo-bundle h2 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  text-align: left;
  margin: 1.15rem 0 0.45rem;
  color: #f0f2f8;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
@media (max-width: 768px) {
  .detail-seo-bundle h2 {
    font-size: 17px;
  }
}

.detail-seo-bundle .detail-seo-lead + h2 {
  margin-top: 0;
}

.detail-seo-bundle .detail-seo-h2-follow {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  margin: 0 0 1rem;
  max-width: none;
  color: #9aa3b8;
  line-height: 1.55;
  font-size: 0.875rem;
  font-weight: 400;
  text-align: left;
}

.detail-seo-bundle .detail-seo-h2-follow:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .detail-seo-bundle {
    padding: 1.05rem 1rem;
    margin-bottom: 22px;
    border-radius: 0;
  }
  .detail-seo-bundle h2 {
    font-size: 16px;
  }
}
.detail-page h3 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #a8b4ff;
  margin-top: 20px;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
}

.detail-page .content {
  padding: unset;
  overflow: visible;
}

.detail-page .content.full-width {
  width: 100%;
}

/* 404 — minimal: short copy + home link, same detail-page shell as other pages */
.not-found-page.not-found-page {
  width: min(420px, 100%);
  max-width: 100%;
  margin-inline: auto;
  padding: clamp(16px, 4vw, 24px) clamp(12px, 4vw, 20px);
  box-sizing: border-box;
}

.not-found-inner {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #dce1ec;
  padding: 4px 0 8px;
  text-align: center;
  min-width: 0;
  max-width: 100%;
}

.not-found-badge {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #8b92a5;
  margin: 0 0 10px;
}

.not-found-page h2.not-found-title {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #f0f2f8;
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.3;
  border-bottom: none;
}

.not-found-lead {
  margin: 0 auto 20px;
  max-width: 22rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #9aa3b8;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-inline: 2px;
}

.not-found-actions {
  display: flex;
  justify-content: center;
}

a.not-found-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: filter 0.2s ease, transform 0.2s ease;
}

a.not-found-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .not-found-page.not-found-page {
    padding: 18px 14px;
  }
  a.not-found-primary {
    width: 100%;
  }
}
/* 피치 분석기 직접 렌더링 컨테이너 */
.pitch-analyzer-direct {
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #11282f;
  background-color: #001117;
}

/* 분석기 컨테이너 */
.analyzer-container {
  margin: 20px 0;
  border-radius: 0;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.analyzer-container > * {
  max-width: 1024px;
  width: 100%;
}

.analyzer-container.piano-full-width > *,
.analyzer-container.scale-generator-full-width > * {
  max-width: unset;
}

/* 설명 섹션 */
.description {
  background-color: #1a1f2e;
  padding: 20px;
  border-radius: 0;
  margin-top: 30px;
  border: 1px solid #2a2f3e;
}

.description p {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 15px;
  color: #dce1ec;
}
@media (max-width: 768px) {
  .description p {
    font-size: 14px;
  }
}

.description ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.description li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: #dce1ec;
  line-height: 1.52;
}
@media (max-width: 768px) {
  .description li {
    font-size: 14px;
  }
}

.description li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #667eea;
}

.description h4 {
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #f0f2f8;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  margin: 22px 0 10px 0;
}
@media (max-width: 768px) {
  .description h4 {
    font-size: 18px;
  }
}

.description h4:first-of-type {
  margin-top: 8px;
}

.description ul.text-bullets {
  list-style: disc;
  padding-left: 1.35rem;
  margin: 0 0 16px 0;
}

.description ul.text-bullets li {
  display: list-item;
  align-items: flex-start;
  padding: 4px 0;
  margin-bottom: 6px;
}

/* 상세 페이지: 단축키·매핑 표 (피아노 등) */
.description table.doc-key-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #dce1ec;
  line-height: 1.45;
}

.description table.doc-key-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  color: #f0f2f8;
  padding: 0 0 8px 0;
  font-size: 15px;
}

.description table.doc-key-table th,
.description table.doc-key-table td {
  border: 1px solid #343b4d;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.description table.doc-key-table thead th {
  background: rgba(49, 56, 72, 0.65);
  color: #f0f2f8;
  font-weight: 600;
}

.description table.doc-key-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.12);
}

.description table.doc-key-table kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #4a5568;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.86em;
  color: #e8ecf4;
}

/* 탭 스타일 */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #2a2f3e;
}

.tab {
  padding: 10px 20px;
  margin-right: 4px;
  background-color: #1a1f2e;
  color: #d5d1a7;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tab.active {
  background-color: #667eea;
  color: #ffffff;
}

.tab:hover:not(.active) {
  background-color: #2a2f3e;
}

/* 레이블 스타일 */
.label {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 2px;
  margin-right: 8px;
}

.label-meld {
  background-color: #9EF5CF;
  color: #001117;
}

.label-midi {
  background-color: #d5d1a7;
  color: #001117;
}

.label-audio {
  background-color: #9EF5CF;
  color: #001117;
}

.label-reverb {
  background-color: #9EF5CF;
  color: #001117;
}

.label-delay {
  background-color: #d5d1a7;
  color: #001117;
}

/* 재생 게이지 바 스타일 */
.playback-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 300px;
  margin-left: 10px;
}

.progress-bar {
  flex-grow: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #2c4550;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #8b9aff;
  border-radius: 50%;
  cursor: pointer;
  transition: width 0.2s, height 0.2s, background 0.2s;
}

.progress-bar::-webkit-slider-thumb:hover {
  width: 14px;
  height: 14px;
  background: #a5b4ff;
}

.progress-bar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.time-display {
  font-size: 12px;
  font-weight: 500;
  color: #d5d1a7;
  min-width: 45px;
  text-align: center;
}

/* 재생 버튼 활성화 스타일 */
.play-active {
  background-color: rgba(139, 154, 255, 0.2);
  transform: translateY(-1px);
  color: #8b9aff;
}

/* 모바일 기기를 위한 반응형 스타일 */
@media (max-width: 768px) {
  .playback-progress {
    /* 모바일에서도 고정 너비 유지 */
    width: 300px;
    min-width: 200px;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .time-display {
    font-size: 10px;
    min-width: 35px;
  }
}
/* 메트로놈 — 대시보드 카드 톤에 맞춤, 표시 영역 aspect-ratio 30/9 유지 */
.metronome-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  color: #e4e7ec;
  background: linear-gradient(165deg, rgba(26, 31, 46, 0.98) 0%, #151a28 55%, #121722 100%);
  border: 1px solid #2a2f3e;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.metronome-compact-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: clamp(8px, 1.1vw, 12px);
  gap: 6px;
}

.metronome-controls-top {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.metronome-container .bpm-control-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 10px);
  width: 100%;
  max-width: 100%;
}

.metronome-container .bpm-buttons {
  display: flex;
  flex-direction: row;
  gap: 3px;
  flex-shrink: 0;
}

.metronome-bpm-btn {
  box-sizing: border-box;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f0f2f8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(102, 126, 234, 0.22);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.metronome-bpm-btn:hover:not(:disabled) {
  background: rgba(102, 126, 234, 0.14);
  border-color: rgba(102, 126, 234, 0.45);
}
.metronome-bpm-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.metronome-bpm-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.75);
  outline-offset: 2px;
}

.metronome-bpm-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.metronome-container .bpm-display-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.metronome-container .bpm-tap-area {
  flex: 1;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 0 2px;
  border-radius: 10px;
  border: 1px solid rgba(102, 126, 234, 0.22);
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.1) 0%, rgba(18, 23, 34, 0.55) 100%);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.metronome-container .bpm-tap-area:hover {
  border-color: rgba(102, 126, 234, 0.45);
  box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.12);
}

.note-icon {
  font-size: 20px;
  color: #667eea;
}

.equals {
  margin: 0 5px;
}

.metronome-container .bpm-value-input {
  width: clamp(52px, 22%, 88px);
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: #f0f2f8;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.metronome-container .bpm-value-input:focus {
  outline: none;
}

.metronome-container .bpm-label {
  flex-shrink: 0;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #a8b4ff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.metronome-display-compact {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 30/9;
  border-radius: 0;
  border: 1px solid rgba(42, 47, 62, 0.9);
  background: #0b0f16;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.metronome-display-compact canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  background-color: #0f1419;
  display: block;
}

.metronome-controls-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.metronome-settings-compact {
  display: grid;
  grid-template-columns: 1fr minmax(96px, 0.85fr) 1fr;
  align-items: center;
  gap: clamp(6px, 1vw, 10px);
  width: 100%;
}

.time-signature-controls,
.note-unit-controls {
  width: 100%;
  min-width: 0;
}

.metronome-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.metronome-ctrl-btn {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.metronome-ctrl-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}
.metronome-ctrl-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.metronome-ctrl-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.85);
  outline-offset: 2px;
}
.metronome-ctrl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.metronome-ctrl-btn--play,
.metronome-ctrl-btn--sound-on,
.metronome-ctrl-btn--accent-on {
  background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.22);
}
.metronome-ctrl-btn--play:hover:not(:disabled),
.metronome-ctrl-btn--sound-on:hover:not(:disabled),
.metronome-ctrl-btn--accent-on:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.metronome-ctrl-btn--play svg {
  margin-left: 2px;
}

.metronome-ctrl-btn--stop {
  background: linear-gradient(135deg, #f5576c 0%, #e04e5f 100%);
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.22);
}
.metronome-ctrl-btn--stop:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 3px 10px rgba(245, 87, 108, 0.3);
}

.metronome-ctrl-btn--sound-off,
.metronome-ctrl-btn--accent-off {
  background: #3a3f4e;
  color: #e4e7ec;
  box-shadow: none;
}
.metronome-ctrl-btn--sound-off:hover:not(:disabled),
.metronome-ctrl-btn--accent-off:hover:not(:disabled) {
  background: #4a5060;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 홈 대시보드 1×1 메트로놈 타일: 좁은 폭에 맞춰 컨트롤만 축소 */
#metronome.dashboard-item .metronome-transport {
  gap: 3px;
}
#metronome.dashboard-item .metronome-ctrl-btn {
  width: 26px;
  height: 26px;
}
#metronome.dashboard-item .metronome-ctrl-btn svg {
  width: 12px;
  height: 12px;
}
#metronome.dashboard-item .metronome-ctrl-btn--play svg {
  margin-left: 1px;
}

.time-signature-controls select,
.note-unit-controls select {
  width: 100%;
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #e4e7ec;
  background: rgba(15, 20, 30, 0.65);
  border: 1px solid #2a2f3e;
  padding: 6px 8px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.time-signature-controls select:hover,
.note-unit-controls select:hover {
  border-color: rgba(102, 126, 234, 0.45);
}
.time-signature-controls select:focus,
.note-unit-controls select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.28);
}
.time-signature-controls select:focus-visible,
.note-unit-controls select:focus-visible {
  outline: none;
}
.time-signature-controls select option,
.note-unit-controls select option {
  background-color: #1a1f2e;
  color: #e4e7ec;
}

.tempo-indicator-compact {
  text-align: center;
  margin-top: 5px;
  font-size: 14px;
  font-style: italic;
  color: #a8b4ff;
}

@media (max-width: 768px) {
  .metronome-controls {
    flex-direction: column;
    align-items: center;
  }
  .control-group {
    width: 80%;
  }
  .metronome-display-compact {
    aspect-ratio: 30/9;
  }
  .metronome-display-compact canvas {
    width: 100%;
    height: 100%;
  }
  .metronome-compact-layout {
    padding: 8px;
    gap: 5px;
  }
  .metronome-container .bpm-value-input {
    font-size: 1.05rem;
    width: clamp(48px, 26%, 72px);
  }
  .metronome-container .bpm-label {
    font-size: 0.72rem;
  }
  .metronome-bpm-btn {
    min-width: 24px;
    height: 24px;
    font-size: 0.68rem;
    padding: 0 2px;
  }
  .metronome-ctrl-btn {
    width: 32px;
    height: 32px;
  }
  .metronome-ctrl-btn svg {
    width: 14px;
    height: 14px;
  }
  .metronome-ctrl-btn--play svg {
    margin-left: 1px;
  }
  .time-signature-controls select,
  .note-unit-controls select {
    font-size: 0.62rem;
    padding: 5px 6px;
  }
  .metronome-settings-compact {
    gap: 6px;
    grid-template-columns: 1fr minmax(88px, 0.82fr) 1fr;
  }
}
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox  */
input[type=number] {
  -moz-appearance: textfield;
}

/* 스케일 제너레이터 — 메트로놈과 동일한 보라 계열 카드 톤 */
/* 대시보드·디테일 동일 레이아웃 비율(상단 3열 그리드, 칩 auto-fit 등). 가로는 부모 100% 로 채움. */
.scale-generator {
  --sg-accent: #667eea;
  --sg-accent-soft: rgba(102, 126, 234, 0.22);
  --sg-panel-bg: rgba(10, 14, 25, 0.55);
  --sg-panel-border: rgba(42, 47, 62, 0.85);
  --sg-text: #e4e7ec;
  --sg-muted: #a8b4ff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  overflow: hidden;
  padding: clamp(8px, 1vw, 14px);
  gap: clamp(6px, 1vw, 10px);
  color: var(--sg-text);
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  background: linear-gradient(165deg, rgba(26, 31, 46, 0.98) 0%, #151a28 55%, #121722 100%);
  border: 1px solid #2a2f3e;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 대시보드 컨텍스트: 부모 타일의 aspect-ratio 를 그대로 채움 */
.dashboard-item .scale-generator {
  height: 100%;
}

/* `#scale-generator` 타일은 높이를 콘텐츠에 맞출 때 `height:100%`·1fr 그리드가 순환 참조로 납작해지지 않게 덮어씀 */
#scale-generator .scale-generator {
  height: auto;
  flex: 0 0 auto;
  /* 기본 `.scale-generator { overflow: hidden }` 은 칩이 2→3행으로 늘 때 하단을 자름 */
  overflow-x: hidden;
  overflow-y: visible;
}

#scale-generator .sg-main {
  height: auto;
  grid-template-rows: auto auto auto;
}

#scale-generator .sg-intervals {
  flex: 0 1 auto;
  min-height: min-content;
}

#scale-generator .sg-chips {
  flex: 0 1 auto;
  min-height: min-content;
  align-content: start;
}

.sg-main {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vw, 10px);
  min-height: 0;
  min-width: 0;
}

/* 대시보드에서는 세로 공간을 끝까지 채워 인터벌 패널이 빈 공간을 흡수하게 함 */
.dashboard-item .sg-main {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.sg-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(6px, 0.8vw, 10px);
  min-width: 0;
}

.sg-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  min-width: 0;
  min-height: 0;
  background: var(--sg-panel-bg);
  border: 1px solid var(--sg-panel-border);
  border-radius: 8px;
}

.sg-panel-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sg-accent);
}

.sg-range-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sg-range-arrow {
  flex-shrink: 0;
  padding: 0 2px;
  font-weight: 700;
  color: var(--sg-muted);
}

.sg-select {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sg-text);
  background: rgba(15, 20, 30, 0.65);
  border: 1px solid #2a2f3e;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.sg-select:hover {
  border-color: rgba(102, 126, 234, 0.45);
}
.sg-select:focus {
  border-color: var(--sg-accent);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.28);
}
.sg-select option {
  background-color: #1a1f2e;
  color: var(--sg-text);
}

.sg-select-note {
  flex: 1.1 1 auto;
  min-width: 44px;
}

.sg-select-octave {
  flex: 0.7 1 auto;
  min-width: 40px;
}

.sg-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.sg-seg-btn {
  box-sizing: border-box;
  padding: 5px 4px;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d0d5e6;
  background: rgba(15, 20, 30, 0.65);
  border: 1px solid #2a2f3e;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.sg-seg-btn:hover:not(:disabled) {
  border-color: rgba(102, 126, 234, 0.45);
  color: var(--sg-text);
}
.sg-seg-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.85);
  outline-offset: 2px;
}
.sg-seg-btn.is-on {
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.sg-dir-icon {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.sg-tempo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sg-bpm-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f2f8;
  text-align: center;
  background: rgba(15, 20, 30, 0.65);
  border: 1px solid #2a2f3e;
  border-radius: 6px;
  outline: none;
  -moz-appearance: textfield;
}
.sg-bpm-input::-webkit-outer-spin-button, .sg-bpm-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sg-bpm-input:hover {
  border-color: rgba(102, 126, 234, 0.45);
}
.sg-bpm-input:focus {
  border-color: var(--sg-accent);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.28);
}

.sg-bpm-label {
  flex-shrink: 0;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sg-muted);
}

.sg-intervals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

/* 대시보드에서는 인터벌 패널이 남은 세로 공간을 흡수 */
.dashboard-item .sg-intervals {
  flex: 1 1 auto;
}

.sg-intervals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.sg-intervals-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.sg-preset-select {
  flex: 0 1 auto;
  min-width: 110px;
  max-width: 170px;
}

.sg-btn-ghost {
  padding: 3px 8px;
  font-family: "Quicksand", system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ff8a95;
  background: rgba(244, 67, 54, 0.12);
  border: 1px solid rgba(244, 67, 54, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.sg-btn-ghost:hover {
  color: #ff9ba5;
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.55);
}
.sg-btn-ghost:focus-visible {
  outline: 2px solid rgba(245, 140, 150, 0.7);
  outline-offset: 2px;
}

/* 인터벌 칩 auto-fit 그리드 — 넓은 화면에서는 한 줄에 가깝게, 좁으면 여러 줄로 접힘 */
.sg-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 4px;
  min-height: 0;
  min-width: 0;
  flex: 0 0 auto;
  align-content: center;
  padding: 2px;
}

/* 대시보드: 인터벌 패널이 1fr 로 늘어날 때 칩도 사용 가능 공간 안쪽에 정렬 */
.dashboard-item .sg-chips {
  flex: 1 1 auto;
}

.sg-chip {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  padding: 4px 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c5ccdc;
  background: rgba(15, 20, 30, 0.65);
  border: 1px solid #2a2f3e;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
  /* 현재 재생중인 인터벌 — 밝은 테두리 + 글로우로 강조 */
}
.sg-chip:hover:not(:disabled) {
  color: var(--sg-text);
  border-color: rgba(102, 126, 234, 0.5);
}
.sg-chip:active:not(:disabled) {
  transform: scale(0.96);
}
.sg-chip:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.8);
  outline-offset: 2px;
}
.sg-chip.is-on {
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.22);
}
.sg-chip.is-root {
  color: #ffffff;
  background: linear-gradient(135deg, #8b9aff 0%, #667eea 100%);
  border-color: rgba(255, 255, 255, 0.14);
  cursor: default;
}
.sg-chip.is-current {
  color: #ffffff;
  background: linear-gradient(135deg, #a8b4ff 0%, #7a8bff 100%);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(168, 180, 255, 0.85), 0 0 14px rgba(168, 180, 255, 0.55);
  transform: scale(1.04);
}
.sg-chip:disabled {
  opacity: 1;
}

.sg-row-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.sg-status {
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  min-width: 0;
  overflow: hidden;
  background: var(--sg-panel-bg);
  border: 1px solid var(--sg-panel-border);
  border-radius: 8px;
}

.sg-status-item {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sg-status-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sg-muted);
}

.sg-status-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f2f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-status-value.is-waiting {
  color: #6b7283;
  font-style: italic;
  font-weight: 500;
}

.sg-play-btn {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%);
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  transition: transform 0.15s ease, filter 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sg-play-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.sg-play-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
}
.sg-play-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.sg-play-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.85);
  outline-offset: 2px;
}
.sg-play-btn.is-playing {
  background: linear-gradient(135deg, #f5576c 0%, #e04e5f 100%);
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.28);
}

@media (max-width: 768px) {
  .scale-generator {
    padding: 10px;
  }
  .sg-row-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .sg-seg-btn {
    padding: 8px 4px;
  }
  .sg-dir-icon {
    width: 20px;
    height: 20px;
  }
  .sg-chips {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 6px;
  }
  .sg-chip {
    font-size: 0.82rem;
    padding: 6px 10px;
  }
  .sg-row-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .sg-play-btn {
    width: 44px;
    height: 44px;
    justify-self: center;
  }
  .sg-play-btn svg {
    width: 18px;
    height: 18px;
  }
}
/* 피아노 키보드 스타일 */
.piano-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.piano-container {
  display: flex;
  flex-direction: column;
  background-color: #1a1f2e;
  border-radius: 0;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  min-height: 0;
  /* 컨트롤 패널(위) + 건반(아래) — 뷰포트 너비와 무관하게 동일 구조 */
  /* Chords 패널 제외: 옥타브·서스테인 + 키보드 매핑 행만 세로 타이트 */
}
.piano-container .piano-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.piano-container .piano-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.piano-container .settings-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 0;
}
.piano-container .settings-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: auto;
}
.piano-container .settings-container > .settings-row:not(.keyboard-settings):not(.chord-slots-row) {
  padding: 3px 5px;
  gap: 5px;
}
.piano-container .settings-container > .settings-row:not(.keyboard-settings):not(.chord-slots-row) .octave-control {
  gap: 5px;
}
.piano-container .settings-container > .settings-row:not(.keyboard-settings):not(.chord-slots-row) .octave-control button {
  padding: 3px 6px;
  font-size: 12px;
  min-width: 30px;
}
.piano-container .settings-container > .settings-row:not(.keyboard-settings):not(.chord-slots-row) .octave-control .octave-display {
  padding: 3px 8px;
  font-size: 11px;
}
.piano-container .settings-container > .settings-row:not(.keyboard-settings):not(.chord-slots-row) .sustain-control .sustain-button {
  padding: 3px 8px;
  font-size: 11px;
}
.piano-container .settings-row.keyboard-settings .keyboard-octave-display {
  padding: 3px 4px;
  gap: 2px;
}
.piano-container .settings-row.keyboard-settings .octave-info {
  gap: 4px;
}
.piano-container .settings-row.keyboard-settings .octave-label {
  font-size: 10px;
  gap: 0;
}
.piano-container .settings-row.keyboard-settings .octave-label .octave-range-shift {
  gap: 2px;
}
.piano-container .settings-row.keyboard-settings .octave-label .octave-value {
  font-size: 11px;
  padding: 1px 3px;
}
.piano-container .settings-row.keyboard-settings .octave-shift-btn {
  min-width: 20px;
  min-height: 20px;
  padding: 0 2px;
}
.piano-container .settings-row.keyboard-settings .octave-shift-btn svg {
  width: 9px;
  height: 9px;
}
.piano-container .settings-row.keyboard-settings .keyboard-toggle {
  min-width: 0;
}
.piano-container .settings-row.keyboard-settings .keyboard-toggle .keyboard-toggle-button {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.2;
}
.piano-container .settings-row.keyboard-settings .octave-hand-shortcuts {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-shrink: 0;
  font-size: 8px;
  line-height: 1.1;
  color: #6c7389;
  user-select: none;
}
.piano-container .settings-row.keyboard-settings .octave-hand-shortcuts.octave-hand-shortcuts--outside-left {
  margin-right: 0;
}
.piano-container .settings-row.keyboard-settings .octave-hand-shortcuts.octave-hand-shortcuts--outside-right {
  margin-left: 0;
}
.piano-container .settings-row.keyboard-settings .octave-hand-shortcuts kbd {
  display: inline-block;
  padding: 0 3px;
  min-width: 1em;
  text-align: center;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 8px;
  font-weight: 600;
  color: #9ef5cf;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid #3a4556;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.piano-container .settings-row {
  display: flex;
  gap: 7px;
  background-color: #2a2f3e;
  padding: 7px;
  border-radius: 5px;
}
.piano-container .settings-row.future-features {
  flex: 1;
  align-items: center;
  justify-content: center;
  background-color: #1a1f2e;
  border: 1px dashed #3a3f4e;
}
.piano-container .settings-row.future-features .placeholder-text {
  color: #8b92a5;
  font-style: italic;
  font-size: 12px;
}
.piano-container .settings-row.keyboard-settings {
  padding: 0;
  background-color: transparent;
}
.piano-container .settings-row.shortcuts-row {
  padding: 8px;
  margin-top: 5px;
  background-color: #2a2f3e;
}
.piano-container .settings-row.shortcuts-row .shortcuts-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}
.piano-container .settings-row.shortcuts-row .shortcuts-info .shortcut-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.piano-container .settings-row.shortcuts-row .shortcuts-info .shortcut-item .key {
  font-size: 10px;
  font-weight: 600;
  color: #9EF5CF;
}
.piano-container .settings-row.shortcuts-row .shortcuts-info .shortcut-item .action {
  font-size: 10px;
  color: #ddd;
}
.piano-container .octave-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 2;
}
.piano-container .octave-control button {
  background-color: #3a3f4e;
  color: white;
  border: 1px solid #4a4f5e;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
  font-size: 14px;
  min-width: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.piano-container .octave-control button:hover:not(:disabled) {
  background-color: #4a4f5e;
  border-color: #5a5f6e;
  transform: translateY(-1px);
}
.piano-container .octave-control button:active:not(:disabled) {
  transform: translateY(1px);
}
.piano-container .octave-control button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.piano-container .octave-control .octave-display {
  font-size: 13px;
  color: #ddd;
  text-align: center;
  background-color: #3a3f4e;
  border: 1px solid #4a4f5e;
  border-radius: 4px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-grow: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.piano-container .sustain-control {
  flex: 1;
  display: flex;
  align-items: center;
}
.piano-container .sustain-control .sustain-button {
  background-color: #3a3f4e;
  color: white;
  border: 1px solid #4a4f5e;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-size: 12px;
  border-left: 3px solid #5a5f6e;
}
.piano-container .sustain-control .sustain-button:hover {
  background-color: #4a4f5e;
  border-color: #5a5f6e;
}
.piano-container .sustain-control .sustain-button.active {
  background-color: #667eea;
  border-left: 3px solid #8b9aff;
  border-color: #8b9aff;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}
.piano-container .keyboard-container {
  flex: 0 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-radius: 0;
  padding: 5px 8px 8px;
}
.piano-container .keyboard-container::-webkit-scrollbar {
  height: 8px;
}
.piano-container .keyboard-container::-webkit-scrollbar-track {
  background: #1a1f2e;
  border-radius: 4px;
}
.piano-container .keyboard-container::-webkit-scrollbar-thumb {
  background: #3a3f4e;
  border-radius: 4px;
}
.piano-container .keyboard-container::-webkit-scrollbar-thumb:hover {
  background: #4a4f5e;
}
.piano-container .keyboard-container .piano-keyboard {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-width: 100%;
  min-height: 0;
  /* 흰 건반이 세로로 과도하게 늘어나는 것을 막고, 음률(가로:세로) 비슷한 비율로 고정 */
  height: auto;
  aspect-ratio: 8.6/1;
  /* 좁은 뷰에서도 흰 건반·검은 건반 비율이 납작해지지 않게 높이 하한(너비/8.6만 쓰면 300px 대에서 ~35px 이하로 붕괴) */
  min-height: 100px;
  max-height: 152px;
  box-sizing: border-box;
}
.piano-container .keyboard-container .piano-keyboard .piano-key {
  position: relative;
  transition: all 0.05s ease;
  cursor: pointer;
  user-select: none;
}
.piano-container .keyboard-container .piano-keyboard .piano-key .key-label {
  position: absolute;
  font-size: 10px;
  color: #555;
  pointer-events: none;
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
}
.piano-container .keyboard-container .piano-keyboard .piano-key .keyboard-key-label {
  position: absolute;
  font-size: 12px;
  color: #0078d7;
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1px 4px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  left: 50%;
  transform: translateX(-50%);
  bottom: 25px;
  pointer-events: none;
  text-transform: uppercase;
}
.piano-container .keyboard-container .piano-keyboard .piano-key .keyboard-key-label.black {
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  bottom: 25px;
}
.piano-container .keyboard-container .piano-keyboard .piano-key.left-hand-range:not(.pressed).white-key {
  background: linear-gradient(to bottom, rgba(102, 126, 234, 0.15), rgba(102, 126, 234, 0.05));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.left-hand-range:not(.pressed).black-key {
  background: linear-gradient(to bottom, rgb(0, 0, 0), rgb(50, 70, 82));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.right-hand-range:not(.pressed).white-key {
  background: linear-gradient(to bottom, rgba(255, 191, 42, 0.15), rgba(255, 191, 42, 0.05));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.right-hand-range:not(.pressed).black-key {
  background: linear-gradient(to bottom, rgb(0, 0, 0), rgb(82, 70, 50));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.left-hand-range.right-hand-range:not(.pressed).white-key {
  background: linear-gradient(to right, rgba(102, 126, 234, 0.15), rgba(153, 168, 206, 0.15), rgba(255, 191, 42, 0.15));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.left-hand-range.right-hand-range:not(.pressed).black-key {
  background: linear-gradient(to right, rgb(50, 70, 82), rgb(55, 55, 55), rgb(82, 70, 50));
}
.piano-container .keyboard-container .piano-keyboard .piano-key.white-key {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  background: linear-gradient(to right, #f5f5f5, #e0e0e0);
  border: 1px solid #999;
  border-radius: 0 0 4px 4px;
  z-index: 1;
  margin: 0 1px;
}
.piano-container .keyboard-container .piano-keyboard .piano-key.white-key .key-label {
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
}
.piano-container .keyboard-container .piano-keyboard .piano-key.white-key.pressed {
  background: linear-gradient(to right, #667eea, #8b9aff);
  border-color: #777;
  box-shadow: inset 0 0 8px rgba(102, 126, 234, 0.4);
}
.piano-container .keyboard-container .piano-keyboard .piano-key.black-key {
  height: 60%;
  width: clamp(15px, 4.2%, 30px);
  max-width: 32px;
  position: absolute;
  background: linear-gradient(to right, #333, #000);
  border: 1px solid #000;
  border-radius: 0 0 3px 3px;
  z-index: 2;
  transform: translateX(-50%);
}
.piano-container .keyboard-container .piano-keyboard .piano-key.black-key .key-label {
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
  color: #999;
}
.piano-container .keyboard-container .piano-keyboard .piano-key.black-key.pressed {
  background: linear-gradient(to right, #667eea, #8b9aff);
  border-color: #777;
  box-shadow: inset 0 0 8px rgba(102, 126, 234, 0.4);
}
.piano-container .keyboard-settings {
  flex-direction: column;
}
.piano-container .keyboard-settings .keyboard-octave-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  background-color: #2a2f3e;
  padding: 5px 6px;
  border-radius: 4px;
  box-sizing: border-box;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: 10px;
  color: #999;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-range-shift {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-shift-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1px 4px;
  min-width: 22px;
  min-height: 22px;
  box-sizing: border-box;
  background-color: #3a3f4e;
  color: #fff;
  border: 1px solid #4a5f5e;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-shift-btn svg {
  width: 10px;
  height: 10px;
  display: block;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-shift-btn:hover {
  background-color: #4a5f5e;
  border-color: #5a6f6e;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-shift-btn:active {
  transform: translateY(1px);
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-value {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 2px 5px;
  border-radius: 3px;
  background-color: rgba(100, 100, 100, 0.2);
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label .octave-value.disabled {
  color: #666;
  background-color: rgba(80, 80, 80, 0.1);
  text-decoration: line-through;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label.left .octave-value {
  border-left: 3px solid #667eea;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label.left .octave-value.disabled {
  border-left-color: #555;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label.right .octave-value {
  border-right: 3px solid #667eea;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-label.right .octave-value.disabled {
  border-right-color: #555;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .keyboard-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .keyboard-toggle .keyboard-toggle-button {
  padding: 3px 8px;
  background-color: #2a2f3e;
  color: #8b92a5;
  border: 1px solid #3a3f4e;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
  transition: all 0.2s ease;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .keyboard-toggle .keyboard-toggle-button:hover {
  background-color: #3a3f4e;
  color: #ddd;
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .keyboard-toggle .keyboard-toggle-button.active {
  background-color: rgba(102, 126, 234, 0.15);
  color: #667eea;
  border-color: rgba(102, 126, 234, 0.5);
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .keyboard-toggle .keyboard-toggle-button.active:hover {
  background-color: rgba(102, 126, 234, 0.25);
}
.piano-container .keyboard-settings .keyboard-octave-display .octave-info .octave-spacer {
  width: 20px;
}
.piano-container .keyboard-mapping-help {
  flex: 1;
  overflow-y: auto;
}
.piano-container .keyboard-mapping-help .mapping-container {
  background-color: #2a2f3e;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: 100%;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-title {
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  text-align: center;
  margin-bottom: 8px;
  border-bottom: 1px solid #3a3f4e;
  padding-bottom: 5px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands::-webkit-scrollbar {
  width: 4px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands::-webkit-scrollbar-track {
  background: #1a1f2e;
  border-radius: 4px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands::-webkit-scrollbar-thumb {
  background: #3a3f4e;
  border-radius: 4px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands::-webkit-scrollbar-thumb:hover {
  background: #4a4f5e;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand {
  background-color: #1a1f2e;
  border-radius: 4px;
  padding: 6px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .hand-title {
  font-size: 11px;
  font-weight: 600;
  color: #667eea;
  text-align: center;
  margin-bottom: 6px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .key-row, .piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .note-row, .piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .octave-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .key {
  display: inline-block;
  background-color: #3a3f4e;
  color: #ddd;
  width: 24px;
  height: 24px;
  text-align: center;
  line-height: 24px;
  border-radius: 3px;
  font-size: 10px;
  border: 1px solid #4a4f5e;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .note {
  display: inline-block;
  background-color: #2a2f3e;
  color: #667eea;
  min-width: 24px;
  padding: 0 3px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .octave-row {
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: space-around;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .octave-key {
  display: inline-block;
  background-color: #2a2f3e;
  color: #ddd;
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 9px;
  white-space: nowrap;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .note-explain {
  margin-top: 6px;
  text-align: center;
  font-size: 9px;
  color: #667eea;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .note-explain .explain {
  background-color: rgba(102, 126, 234, 0.1);
  padding: 3px 6px;
  border-radius: 3px;
  display: inline-block;
  border: 1px dashed rgba(102, 126, 234, 0.3);
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .ui-controls-row {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .ui-controls-row .ui-control-key {
  display: flex;
  align-items: center;
  gap: 5px;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .ui-controls-row .ui-control-key .ui-key {
  background-color: #3a3f4e;
  color: #ddd;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 9px;
  border: 1px solid #4a4f5e;
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .ui-controls-row .ui-control-key .ui-key.space-key {
  width: 50px;
  text-align: center;
  font-style: italic;
  color: #667eea;
  border-color: #667eea;
  background-color: rgba(102, 126, 234, 0.1);
}
.piano-container .keyboard-mapping-help .mapping-container .mapping-hands .mapping-hand .ui-controls-row .ui-control-key .ui-action {
  font-size: 9px;
  color: #667eea;
}

/* === Piano control panel — Chords 블록 안에 Play/Edit, 슬롯 1행 ================== */
.piano-container .chord-slots .mode-toggle-row {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  background-color: #151925;
  border: 1px solid #2a2f3e;
  border-radius: 6px;
  padding: 2px 3px;
  min-width: 0;
}
.piano-container .chord-slots .mode-toggle-row .mode-tab {
  flex: 0 1 auto;
  background: transparent;
  color: #8b92a5;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.piano-container .chord-slots .mode-toggle-row .mode-tab .mode-tab-icon {
  font-size: 10px;
  line-height: 1;
}
.piano-container .chord-slots .mode-toggle-row .mode-tab .mode-tab-text {
  font-size: 10px;
}
.piano-container .chord-slots .mode-toggle-row .mode-tab:hover:not(.active) {
  color: #ddd;
  background-color: rgba(255, 255, 255, 0.05);
}
.piano-container .chord-slots .mode-toggle-row .mode-tab:active:not(.active) {
  transform: translateY(1px);
}
.piano-container .chord-slots .mode-toggle-row .mode-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: default;
}

.piano-container .chord-slots-row {
  padding: 4px 6px;
  background-color: #2a2f3e;
  border-radius: 5px;
}

.piano-container .chord-slots {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.piano-container .chord-slots .chord-slots-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  /* 한 행: Chords | Play·Edit | … actions */
}
.piano-container .chord-slots .chord-slots-header .chord-slots-title {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  color: #6f768a;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.piano-container .chord-slots .chord-slots-header .chord-slots-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-left: auto;
}
.piano-container .chord-slots .btn-mini {
  background-color: #1f2433;
  color: #8b92a5;
  border: 1px solid #3a3f4e;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.piano-container .chord-slots .btn-mini:hover:not(:disabled) {
  background-color: #2e3446;
  color: #ddd;
  border-color: #4a4f5e;
}
.piano-container .chord-slots .btn-mini:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.piano-container .chord-slots .btn-mini.subtle {
  background: transparent;
  border-color: transparent;
  color: #667694;
}
.piano-container .chord-slots .btn-mini.subtle:hover:not(:disabled) {
  background-color: #1f2433;
  border-color: #3a3f4e;
  color: #ddd;
}
.piano-container .chord-slots .chord-slots-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: 28px;
  gap: 4px;
  width: 100%;
  align-items: stretch;
}
.piano-container .chord-slots .chord-slot {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 1px;
  border-radius: 4px;
  background-color: #1f2433;
  border: 1px solid #3a3f4e;
  color: #ddd;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.piano-container .chord-slots .chord-slot .chord-slot-number {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.piano-container .chord-slots .chord-slot .chord-slot-badge {
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
}
.piano-container .chord-slots .chord-slot .chord-slot-badge.count {
  color: #c9d1ff;
  background-color: rgba(102, 126, 234, 0.22);
}
.piano-container .chord-slots .chord-slot .chord-slot-badge.add {
  color: #8b9aff;
  background-color: transparent;
  font-size: 12px;
  padding: 0 4px;
}
.piano-container .chord-slots .chord-slot .chord-slot-badge.empty-dash {
  color: #4a4f5e;
  background-color: transparent;
  font-size: 10px;
  padding: 0 4px;
}
.piano-container .chord-slots .chord-slot:hover:not(.playing) {
  background-color: #2a3046;
  border-color: #4a4f5e;
  transform: translateY(-1px);
}
.piano-container .chord-slots .chord-slot:active:not(.playing) {
  transform: translateY(0);
}
.piano-container .chord-slots .chord-slot.empty {
  border-style: dashed;
  color: #6a6f7e;
}
.piano-container .chord-slots .chord-slot.empty .chord-slot-number {
  color: #767c92;
}
.piano-container .chord-slots .chord-slot.filled {
  background-color: rgba(102, 126, 234, 0.14);
  border-color: rgba(102, 126, 234, 0.5);
  border-style: solid;
  color: #fff;
}
.piano-container .chord-slots .chord-slot.filled .chord-slot-number {
  color: #fff;
}
.piano-container .chord-slots .chord-slot.edit-mode.empty {
  border-color: rgba(139, 154, 255, 0.35);
}
.piano-container .chord-slots .chord-slot.edit-mode.empty:hover {
  border-color: #8b9aff;
  background-color: rgba(102, 126, 234, 0.1);
}
.piano-container .chord-slots .chord-slot.edit-mode.empty:hover .chord-slot-badge.add {
  color: #b3bcff;
}
.piano-container .chord-slots .chord-slot.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.28) 100%);
  border-color: #8b9aff;
  border-style: solid;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(139, 154, 255, 0.35), 0 2px 10px rgba(102, 126, 234, 0.3);
}
.piano-container .chord-slots .chord-slot.selected .chord-slot-number {
  color: #fff;
}
.piano-container .chord-slots .chord-slot.selected .chord-slot-badge.count {
  background-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.piano-container .chord-slots .chord-slot.playing {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #8b9aff;
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 154, 255, 0.55);
  animation: chord-slot-pulse 0.6s ease-out;
}
.piano-container .chord-slots .chord-slot.playing .chord-slot-number {
  color: #fff;
}
.piano-container .chord-slots .chord-slot.playing .chord-slot-badge.count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

@keyframes chord-slot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 154, 255, 0.55);
  }
  100% {
    box-shadow: 0 0 18px rgba(139, 154, 255, 0.35);
  }
}
.set-marker {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: #667eea;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 2px white;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.set-marker.black {
  color: #fff;
  background-color: rgba(102, 126, 234, 0.8);
  bottom: 3px;
}

.no-decoration {
  text-decoration: none;
}

/* 다운로드 드롭다운 스타일 */
.download-dropdown {
  position: relative;
  display: inline-block;
}

.download-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: linear-gradient(135deg, #2a2f3e 0%, #1a1f2e 100%);
  min-width: 160px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  z-index: 9999;
  margin-top: 8px;
  border: 1px solid #3a3f4e;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.format-option {
  padding: 12px 16px;
  color: #8b92a5;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.format-option:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: #ffffff;
}
.format-option .format-text {
  flex: 1;
}
.format-option .format-text.selected {
  color: #667eea;
  font-weight: 600;
}
.format-option .format-text.selected::before {
  content: "✓";
  margin-right: 8px;
  color: #667eea;
  font-weight: bold;
}

.download-separator {
  height: 1px;
  background: linear-gradient(to right, transparent, #3a3f4e, transparent);
  margin: 8px 0;
}

.save-option {
  color: #ffffff;
  font-weight: 600;
  text-align: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 8px;
  border-radius: 12px;
}
.save-option:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* SPECTRA 대시보드 스타일 */
.dashboard-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 1200px; /* 최소 너비 고정 */
}

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  min-width: 1200px; /* 최소 너비 고정 */
}

.bottom-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  min-width: 1200px; /* 최소 너비 고정 */
}

.metric-card {
  background-color: #1a1f2e;
  border-radius: 0;
  border: 1px solid #2a2f3e;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: #3a3f4e;
}

.profit-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.sales-card {
  background-color: #1a1f2e;
}

.analytics-card {
  background-color: #1a1f2e;
}

.invoices-card {
  background-color: #1a1f2e;
  border-radius: 0;
  border: 1px solid #2a2f3e;
  padding: 24px;
}

.activity-card {
  background-color: #1a1f2e;
  border-radius: 0;
  border: 1px solid #2a2f3e;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon {
  font-size: 20px;
  margin-right: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
}

.card-subtitle {
  font-size: 14px;
  color: #8b92a5;
  margin-left: auto;
  margin-right: 12px;
}

.card-menu {
  background: none;
  border: none;
  color: #8b92a5;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.card-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.metric-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.profit-icon {
  font-size: 48px;
  opacity: 0.8;
}

.metric-value {
  text-align: center;
}

.change-indicator {
  font-size: 14px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.change-indicator.positive {
  color: #4ade80;
}

.amount {
  font-size: 32px;
  font-weight: 700;
  color: white;
}

.chart-container {
  flex: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #2a2f3e;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-btn:hover {
  background-color: #3a3f4e;
  transform: translateY(-1px);
}

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

.table-container {
  flex: 1;
  min-height: 300px;
}

.activity-metric {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.activity-circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #667eea 0%, #667eea 65%, #2a2f3e 65%, #2a2f3e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-progress {
  width: 80px;
  height: 80px;
  background-color: #1a1f2e;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-value {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.progress-label {
  font-size: 12px;
  color: #8b92a5;
  margin-top: 4px;
}

.activity-stats {
  flex: 1;
}

.piano-container-wrapper {
  min-height: 200px;
}

.detail-link {
  color: #8b92a5;
  text-decoration: none;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.detail-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* 반응형 대시보드(레이아웃 뷰) */
@media (max-width: 1200px) {
  .content-area {
    padding: 16px;
  }
  .dashboard-overview,
  .metrics-row,
  .bottom-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}
@media (max-width: 1024px) {
  .content-area {
    padding: 16px;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard .dashboard-item {
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard-overview {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 20px;
  }
  .metrics-row {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column; /* 세로 정렬 */
    gap: 20px;
    box-sizing: border-box;
  }
  .bottom-row {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column; /* 세로 정렬 */
    gap: 20px;
    box-sizing: border-box;
  }
  /* 카드들의 높이를 자동으로 조정 */
  .metric-card {
    min-height: 200px; /* 최소 높이 설정 */
    height: auto; /* 높이 자동 조정 */
  }
  .invoices-card,
  .activity-card {
    min-height: 250px; /* 더 큰 카드들의 최소 높이 */
    height: auto; /* 높이 자동 조정 */
  }
  /* 차트 컨테이너 높이 조정 */
  .chart-container {
    min-height: 150px; /* 차트 최소 높이 */
    height: auto;
    max-width: 100%;
  }
  /* 테이블 컨테이너 높이 조정 */
  .table-container {
    min-height: 200px; /* 테이블 최소 높이 */
    height: auto;
    max-width: 100%;
  }
  /* 피아노 컨테이너 높이 조정 */
  .piano-container-wrapper {
    min-height: 300px; /* 피아노 최소 높이 증가 */
    height: auto;
    max-width: 100%;
  }
  /* 좁은 화면: 컴팩트 코드 패널(Play/Edit + 슬롯) — 좌/우 2열 */
  .piano-container .piano-section {
    flex: 0 0 auto;
    min-height: 0;
  }
  .piano-container .settings-section {
    padding: 5px 6px 4px;
  }
  .piano-container .settings-section .chord-slots-row {
    padding: 4px 5px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots {
    gap: 4px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .chord-slots-header {
    gap: 4px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .chord-slots-grid {
    grid-template-rows: 26px;
    gap: 3px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .chord-slot {
    height: 26px;
    min-height: 26px;
    max-height: 26px;
    border-radius: 4px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .chord-slot .chord-slot-number {
    font-size: 10px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .chord-slot .chord-slot-badge {
    font-size: 7px;
    padding: 0 3px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .mode-toggle-row .mode-tab {
    padding: 2px 5px;
    font-size: 9px;
  }
  .piano-container .settings-section .chord-slots-row .chord-slots .mode-toggle-row .mode-tab .mode-tab-icon, .piano-container .settings-section .chord-slots-row .chord-slots .mode-toggle-row .mode-tab .mode-tab-text {
    font-size: 9px;
  }
}
@media (max-width: 768px) {
  .content-area {
    padding: 5px;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard {
    grid-template-columns: 1fr;
    gap: 16px;
    min-width: 0 !important;
    max-width: 100%;
  }
  .dashboard .dashboard-item {
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard-overview {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 16px;
  }
  .metrics-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 16px;
  }
  .bottom-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 16px;
  }
  /* 모바일에서 카드 패딩 조정 */
  .metric-card {
    padding: 20px;
    min-height: 180px;
  }
  .invoices-card,
  .activity-card {
    padding: 20px;
    min-height: 220px;
  }
}
@media (max-width: 540px) {
  .content-area {
    min-width: 0 !important;
    max-width: 100%;
    padding: 5px;
    box-sizing: border-box;
  }
  .dashboard-overview {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 12px;
  }
  .metrics-row {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 12px;
  }
  .bottom-row {
    min-width: auto; /* 최소 너비 제한 해제 */
    gap: 12px;
  }
  /* 작은 화면에서 카드 패딩과 높이 조정 */
  .metric-card {
    padding: 16px;
    min-height: 160px;
  }
  .invoices-card,
  .activity-card {
    padding: 16px;
    min-height: 200px;
  }
  /* 차트와 테이블 높이 조정 */
  .chart-container {
    min-height: 120px;
  }
  .table-container {
    min-height: 150px;
  }
  .piano-container-wrapper {
    min-height: 250px;
  }
}
/* 모던 버튼 스타일 - 전체적인 디자인에 어울리는 세련된 스타일 */
.modern-button {
  background: linear-gradient(135deg, #2a2f3e 0%, #1a1f2e 100%);
  border: 1px solid #3a3f4e;
  border-radius: 12px;
  color: #8b92a5;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 24px;
  min-height: 24px;
  cursor: pointer;
}

.modern-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: #4a4f5e;
}

.modern-button:hover::before {
  opacity: 1;
}

.modern-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modern-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modern-button:disabled::before {
  opacity: 0;
}

/* 활성 상태 스타일 */
.modern-button.mic-active {
  background: linear-gradient(135deg, #ff4757 0%, #c44569 100%);
  border-color: #ff6b7a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modern-button.mic-active::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 1;
}

.modern-button.monitor-active {
  background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
  border-color: #74b9ff;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(93, 173, 226, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modern-button.monitor-active::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 1;
}

.modern-button.play-active {
  background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
  border-color: #00cec9;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modern-button.play-active::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 1;
}

/* SVG 아이콘 스타일 */
.modern-button svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.modern-button:hover svg {
  transform: scale(1.1);
}

/* 모바일 컨트롤 사이드바 스타일 — 헤더 .header-right 안에서 메뉴 버튼과 같은 줄·세로 정렬 */
.mobile-controls-btn {
  display: none;
  box-sizing: border-box;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  /* 햄버거(#fff)와 동일한 대비로 보이도록 (이전 회색은 같은 px도 더 작아 보임) */
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  margin: 0;
  /* mobile-menu-btn 과 동일한 헤더 아이콘 버튼 크기 */
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  align-items: center;
  justify-content: center;
}
.mobile-controls-btn:focus:not(:focus-visible) {
  outline: none;
}
.mobile-controls-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 248, 0.7);
  outline-offset: 3px;
}
.mobile-controls-btn:hover {
  background: none;
  box-shadow: none;
  transform: none;
  color: #ffffff;
}

.mobile-controls-btn svg {
  display: block;
  /* 햄버거(18×12px 부근)와 비슷한 점유 면적으로 보이도록 메뉴보다 한 단계 키움 */
  width: 28px;
  height: 28px;
  pointer-events: none;
}

/* 모바일 컨트롤: 배경 딤 없음(투명) — 탭으로만 닫기 레이어 */
.mobile-controls-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-controls-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 헤더 아래 우측 플로팅 패널 (좁은 화면용) */
.mobile-controls-panel {
  position: fixed;
  top: var(--app-header-offset);
  right: 6px;
  left: auto;
  width: min(360px, 100vw - 12px);
  max-height: min(520px, 100vh - var(--app-header-offset) - 10px);
  z-index: 1510;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: #161b26;
  border: 1px solid #2c3342;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.mobile-controls-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 380px) {
  .mobile-controls-panel {
    right: 4px;
    width: calc(100vw - 8px);
  }
}
.close-controls-btn {
  background: none;
  border: none;
  color: #8b92a5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.close-controls-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.mobile-controls-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
}

.mobile-controls-content {
  flex: 1;
  min-height: 0;
  padding: 36px 8px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 10px 10px;
}

.mobile-controls-content .pitch-controls {
  margin: 0;
}

/* 한 줄 아이콘 + 다음 줄 게이지 */
.mobile-controls-content .navbar-controls-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 6px;
  align-items: center;
  justify-items: stretch;
}

.mobile-controls-content .navbar-controls-buttons > .playback-progress {
  grid-column: 1/-1;
  width: 100%;
  min-width: 0;
  margin: 4px 0 0;
  gap: 6px;
  flex-direction: row;
  align-items: center;
}

.mobile-controls-content .playback-progress .progress-bar {
  width: 100%;
  min-width: 0;
  margin: 0;
  flex: 1;
}

.mobile-controls-content .time-display {
  font-size: 10px;
  min-width: 0;
  flex-shrink: 0;
  padding: 0 2px;
}

/* 패널 안 아이콘·슬라이더 컴팩트 */
.mobile-controls-panel .modern-button,
.mobile-controls-panel .icon-button.modern-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 4px 2px;
  box-sizing: border-box;
}

.mobile-controls-panel .modern-button svg,
.mobile-controls-panel .icon-button.modern-button svg {
  width: 18px;
  height: 18px;
}

.mobile-controls-panel .download-dropdown,
.mobile-controls-panel .sensitivity-dropdown {
  width: 100%;
  min-width: 0;
}

.mobile-controls-panel .sensitivity-dropdown > .icon-button {
  width: 100%;
}

.mobile-controls-panel .sensitivity-dropdown-content {
  left: auto;
  right: 0;
  margin-top: 4px;
  padding: 6px 8px;
  max-width: min(280px, 100vw - 24px);
}

.mobile-controls-panel .sensitivity-slider {
  gap: 6px;
}

.mobile-controls-panel .sensitivity-slider input[type=range] {
  min-width: 0;
  width: 100%;
  max-width: none;
  flex: 1;
}

/* `/pitch-controls` 상세 본문: 데스크톱에서 Controller 스트립을 본문 가로 가운데 (`.analyzer-container > * { width:100% }` 보정) */
@media (min-width: 769px) {
  .analyzer-container > .controller-detail-pitch-controls {
    width: fit-content;
    max-width: min(1024px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
  .controller-detail-pitch-controls .navbar-controls-buttons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .controller-detail-pitch-controls .playback-progress {
    margin-left: 0;
  }
}
/* `/pitch-controls` 상세 본문: 모바일에서 헤더 슬라이드 패널(`.mobile-controls-content`)과 동일한 격자·터치 UI */
@media (max-width: 768px) {
  .controller-detail-pitch-controls {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .controller-detail-pitch-controls .pitch-controls {
    margin: 0;
  }
  .controller-detail-pitch-controls .navbar-controls-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px 6px;
    align-items: center;
    justify-items: stretch;
  }
  .controller-detail-pitch-controls .navbar-controls-buttons > .playback-progress {
    grid-column: 1/-1;
    width: 100%;
    min-width: 0;
    margin: 4px 0 0;
    gap: 6px;
    flex-direction: row;
    align-items: center;
  }
  .controller-detail-pitch-controls .playback-progress .progress-bar {
    width: 100%;
    min-width: 0;
    margin: 0;
    flex: 1;
  }
  .controller-detail-pitch-controls .time-display {
    font-size: 10px;
    min-width: 0;
    flex-shrink: 0;
    padding: 0 2px;
  }
  .controller-detail-pitch-controls .modern-button,
  .controller-detail-pitch-controls .icon-button.modern-button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 4px 2px;
    box-sizing: border-box;
  }
  .controller-detail-pitch-controls .modern-button svg,
  .controller-detail-pitch-controls .icon-button.modern-button svg {
    width: 18px;
    height: 18px;
  }
  .controller-detail-pitch-controls .download-dropdown,
  .controller-detail-pitch-controls .sensitivity-dropdown {
    width: 100%;
    min-width: 0;
  }
  .controller-detail-pitch-controls .sensitivity-dropdown > .icon-button {
    width: 100%;
  }
  .controller-detail-pitch-controls .sensitivity-dropdown-content {
    left: auto;
    right: 0;
    margin-top: 4px;
    padding: 6px 8px;
    max-width: min(280px, 100vw - 24px);
  }
  .controller-detail-pitch-controls .sensitivity-slider {
    gap: 6px;
  }
  .controller-detail-pitch-controls .sensitivity-slider input[type=range] {
    min-width: 0;
    width: 100%;
    max-width: none;
    flex: 1;
  }
}
/* 768px 이하에서 모바일 컨트롤 활성화 */
@media (max-width: 768px) {
  .mobile-controls-btn {
    display: inline-flex;
  }
  .pitch-controls-container {
    display: none;
  }
  .modern-button {
    width: 100%;
  }
  /* 피아노: 키보드 매핑/⌨ 패널은 모바일에서 숨김(터치 건반만 사용) */
  .piano-container .settings-row.keyboard-settings {
    display: none;
  }
}
