/* © 2026 김용현 */
.field {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font-family: inherit;
  font-size: var(--text-body);
  color: var(--foreground);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field:focus { outline: none; border-color: var(--accent); }

.btn {
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn[disabled] { color: #b0b8c4; background: #f4f5f7; border-color: var(--border); cursor: not-allowed; }

.btn-outline { color: var(--accent); background: #fff; }
.btn-outline:hover { background: #f0f2f8; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.legend-item:hover { background: #eef0f4; }
.legend-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.legend-item.inactive { opacity: 0.35; }
.legend-swatch { width: 16px; height: 12px; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 2px; flex-shrink: 0; }

.panel-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.panel-sub { font-size: var(--text-caption); color: var(--muted); }

.stat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-table th, .stat-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.stat-table th { width: 45%; font-weight: 500; color: var(--muted); }
.stat-table td { text-align: right; font-variant-numeric: tabular-nums; }

.empty-note { color: var(--muted); font-size: 12px; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b8c4; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.legend-level + .legend-level { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.legend-level-title { font-size: var(--text-caption); font-weight: 600; color: var(--muted); margin: 0 0 4px 6px; }

.mode-chips { display: flex; gap: 4px; align-items: center; }
.mode-chip {
  font: inherit;
  font-size: var(--text-caption);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
}
.mode-chip:hover { background: var(--surface); }
.mode-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 순위표처럼 사이드바에 상시 떠 있는 목록 */
.rank-table { width: 100%; border-collapse: collapse; font-size: var(--text-caption); }
.rank-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.rank-table td { padding: 4px 6px; border-top: 1px solid var(--border); }
.rank-row { cursor: pointer; }
.rank-row:hover { background: var(--surface); }
.rank-row.selected { background: var(--accent); color: #fff; }
.rank-row.selected .rank-dot { outline: 2px solid #fff; }
.rank-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.rank-scroll { max-height: 34vh; overflow-y: auto; }

/* 모달 — 출처·개발로그 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1200;
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  background: var(--background);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(720px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close { color: var(--muted); border-color: var(--border); }
.modal-close:hover { background: var(--surface); color: var(--foreground); }
.modal-body { padding: 16px 18px; overflow-y: auto; font-size: var(--text-body); }

.meta-table { width: 100%; border-collapse: collapse; font-size: var(--text-caption); }
.meta-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.meta-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.meta-table a { color: var(--accent); word-break: break-all; }

.log-entry { padding: 12px 0; border-bottom: 1px solid var(--border); }
.log-entry:last-child { border-bottom: none; }
.log-date { font-size: var(--text-caption); color: var(--muted); }
.log-title { font-size: var(--text-body); font-weight: 600; margin: 2px 0 6px; }
.log-content { font-size: var(--text-caption); line-height: 1.7; }

/* 왜곡 모듈 */
.pick-list { list-style: none; margin: 0 0 10px; padding: 0; max-height: 30vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.pick-option { display: block; width: 100%; text-align: left; font: inherit; font-size: var(--text-caption); padding: 6px 10px; background: none; border: none; cursor: pointer; color: var(--foreground); }
.pick-option:hover { background: var(--surface); }
.pick-option.active { background: var(--accent); color: #fff; }

.pick-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pick-tag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-left-width: 3px; border-radius: 999px; padding: 2px 6px 2px 8px; font-size: var(--text-caption); }
.pick-name { font: inherit; background: none; border: none; cursor: pointer; color: var(--foreground); padding: 0; }
.pick-remove { font: inherit; background: none; border: none; cursor: pointer; color: var(--muted); padding: 0 2px; }
.pick-remove:hover { color: var(--foreground); }
.pick-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.pick-rotate { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--text-caption); }
.pick-rotate input[type="range"] { flex: 1; }
.pick-color { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-caption); }
.pick-color input[type="color"] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer; }

.scale-value { font-weight: 600; }
.tone-strong { color: #e53935; }
.tone-warn { color: #ef6c00; }
.tone-small { color: #2e7d32; }
.tone-normal { color: var(--accent); }
