/* Library extensions: filters, views, detail, projects */
.nav-links {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.nav-link {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #b7c0cf;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: #ffd166;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
}
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-row-main {
  width: 100%;
}
.filter-clear-btn {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(233, 69, 96, 0.35);
  background: rgba(233, 69, 96, 0.1);
  color: #fda4af;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.filter-clear-btn:hover {
  border-color: #e94560;
  background: rgba(233, 69, 96, 0.2);
  color: #fff;
}
.filter-row-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.filter-region-chip.active {
  border-color: #60a5fa;
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.15);
}
.filter-search {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #eee;
  font-size: 0.8rem;
}
.filter-chip {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #b7c0cf;
}
.filter-chip.active {
  border-color: #ffd166;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.15);
}
#filterFavBtn.active {
  color: #ffd166;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.2);
}
.filter-select {
  padding: 4px 24px 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.28);
  background-color: #1a2744;
  color: #f1f5f9;
  font-size: 0.74rem;
  color-scheme: dark;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.filter-select:focus {
  outline: none;
  border-color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.22);
}
.filter-select option {
  background-color: #1a2744;
  color: #f1f5f9;
}
.edit-section .filter-select {
  background-color: #0f172a;
  border-color: rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  font-weight: 600;
}
.edit-section .filter-select option {
  background-color: #0f172a;
  color: #f8fafc;
}
.view-panel { display: none; }
.view-panel.active { display: block; }
.file-wave-wrap {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.file-wave-wrap .file-waveform {
  width: 100% !important;
  display: block;
}
.file-duration-badge {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.file-hover-card .project-tags,
.file-hover-card .region-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.file-hover-card .project-tags .tag-chip,
.file-hover-card .region-tags .region-chip {
  font-size: 0.68rem;
  padding: 1px 6px;
}
.wave-ruler {
  width: 100%;
  height: 14px;
  display: block;
  margin-top: 2px;
}
    .detail-page, .project-page, .projects-list-page, .settings-page {
  max-width: 1000px;
  margin: 0 auto;
}
.detail-header, .project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.detail-header h2, .project-header h2 {
  color: #e94560;
  font-size: 1rem;
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #b7c0cf;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}
.detail-wave {
  width: 100%;
  height: 80px;
  display: block;
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  touch-action: none;
}
.detail-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.detail-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.detail-panel {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px;
}
.detail-panel h3 {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.region-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
}
.region-item.active {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
}
.region-item-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.region-item-name {
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.region-item-range {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 2px;
}
.region-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.region-action-btn {
  width: 26px;
  height: 24px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #b7c0cf;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
}
.region-action-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.region-delete-btn:hover {
  border-color: rgba(233, 69, 96, 0.5);
  color: #fda4af;
}
.regions-list {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.regions-empty {
  color: #666;
  font-size: 0.8rem;
  margin-top: 8px;
}
.region-draft {
  padding: 8px;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
}
.region-draft-summary {
  font-size: 0.78rem;
  color: #93c5fd;
  margin-bottom: 8px;
}
.region-draft-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.region-label-input {
  flex: 1 1 100px;
  min-width: 90px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #eee;
  font-size: 0.78rem;
}
.detail-panel-regions .btn-primary,
.detail-panel-regions .btn-secondary {
  font-size: 0.74rem;
  padding: 5px 10px;
}
.detail-panel-markers .region-draft-row {
  margin-top: 6px;
}
.detail-panel-markers .marker-item.active {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.1);
}
.detail-panel-markers .marker-item .region-item-range {
  color: #fcd34d;
}
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}
.region-chip {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
  cursor: pointer;
}
.region-chip:hover {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
}
.region-chip-more {
  cursor: default;
  opacity: 0.85;
}
.region-chip-more:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}
.project-card {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}
.project-card:hover {
  border-color: #e94560;
}
.project-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.project-tab {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #b7c0cf;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}
.project-tab.active {
  border-color: #e94560;
  color: #fda4af;
  background: rgba(233, 69, 96, 0.12);
}
.plan-editor-wrap {
  min-height: 320px;
  border-radius: 8px;
  overflow: hidden;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.asset-thumb {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.asset-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.whiteboard-wrap {
  position: relative;
  min-height: 400px;
  height: 560px;
  max-height: 70vh;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: #1e1e2e;
  overflow: hidden;
}
.whiteboard-app {
  width: 100%;
  height: 100%;
}
.whiteboard-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}
.edit-section {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
}
.edit-section h3 {
  font-size: 0.85rem;
  color: #e94560;
  margin-bottom: 10px;
}
.edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-box {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 20px;
  max-width: 400px;
  width: 90%;
}
.modal-box h3 { margin-bottom: 12px; color: #eee; }
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
.btn-primary {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #eee;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.file-item .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 0;
}
.file-item .region-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 0;
}
.detail-playing-other {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(46, 204, 113, 0.35);
  background: rgba(20, 70, 40, 0.22);
  font-size: 0.8rem;
  color: #a7f3d0;
}
.detail-playing-other a {
  color: #86efac;
  font-weight: 600;
}
.job-status {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .filter-search,
  .region-label-input,
  .filter-select {
    font-size: 16px;
  }
  .nav-link {
    padding: 10px 14px;
    font-size: 0.85rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .filter-btn,
  .filter-chip,
  .filter-clear-btn {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .region-action-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  .back-btn {
    min-height: 44px;
    padding: 10px 14px;
  }
  .project-tab {
    min-height: 44px;
    padding: 10px 16px;
  }
  .whiteboard-wrap {
    height: calc(100dvh - 12rem);
    min-height: 280px;
    max-height: none;
  }
  .plan-editor-wrap {
    min-height: 240px;
  }
  .detail-panels {
    grid-template-columns: 1fr;
  }
}
