/* 音声マスタリングスタジオ — ダーク基調のスタジオ風UI */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #14181d;
  --panel: #1b2129;
  --panel2: #20262e;
  --text: #e0e6ec;
  --sub: #9aa5b1;
  --accent: #4fc3f7;
  --primary: #2e7d5b;
  --warn: #b3762a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  min-height: 100vh;
}

/* ---------- ヘッダー ---------- */
.topbar {
  background: var(--panel);
  padding: 12px 16px;
  border-bottom: 1px solid #2a323c;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin-bottom: 10px; }
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.spacer { flex: 1; }

.ctl { color: var(--sub); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
select {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid #313b46;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.btn {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid #313b46;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #2a323c; }
.btn.active { background: #55452a; border-color: #8a6a30; }
.btn-primary { background: var(--primary); border-color: #3a9d74; font-weight: bold; }
.btn-primary:hover { background: #35916a; }
.btn-ghost { background: transparent; }

/* ---------- メイン ---------- */
main { padding: 14px 16px 60px; display: flex; flex-direction: column; gap: 14px; max-width: 1200px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid #2a323c;
  border-radius: 10px;
  padding: 14px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 10px;
}

.wave {
  width: 100%;
  height: 110px;
  background: var(--panel2);
  border-radius: 8px;
  cursor: crosshair;
  display: block;
}
.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.time { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 14px; }
.fileinfo { color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.meters {
  width: 100%;
  height: 120px;
  background: #161b21;
  border-radius: 8px;
  display: block;
}
.spectrum {
  width: 100%;
  height: 150px;
  background: #161b21;
  border-radius: 8px;
  display: block;
  margin-top: 8px;
}
.ab-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }

/* ---------- かんたんモード ---------- */
.easy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.macro {
  background: var(--panel2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.macro-label { font-size: 15px; margin-bottom: 8px; }
.macro-hint { font-size: 11px; color: var(--sub); margin-top: 6px; }
.macro input[type="range"] { width: 100%; }

/* ---------- 詳細モード ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.section {
  background: var(--panel2);
  border-radius: 8px;
  padding: 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
  border-bottom: 1px solid #2a323c;
  padding-bottom: 6px;
}
.slider-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
}
.slider-row label { color: var(--sub); }
.slider-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: #313b46;
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #14181d;
}

/* ---------- 自動提案の内容 ---------- */
.suggest {
  margin-top: 10px;
  background: var(--panel2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.suggest-head { color: var(--accent); margin-bottom: 6px; }
.suggest-item { color: var(--sub); line-height: 1.7; }

/* ---------- オーバーレイ ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 16, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay-box {
  background: var(--panel);
  border: 1px solid #313b46;
  border-radius: 10px;
  padding: 24px 32px;
  min-width: 340px;
  text-align: center;
}
.overlay-track {
  margin-top: 14px;
  height: 8px;
  background: var(--panel2);
  border-radius: 4px;
  overflow: hidden;
}
.overlay-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s;
}

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: 420px;
}
.toast-item {
  background: var(--panel);
  border: 1px solid #313b46;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: all .3s;
}
.toast-item.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: #66bb6a; }
.toast-warn { border-left-color: var(--warn); }

/* ===== 使い方モーダル ===== */
.helpmodal {
  position: fixed; inset: 0; background: rgba(6,8,10,0.72);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.helpmodal[hidden] { display: none; }
.helpmodal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; width: min(900px, 94vw); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 60px rgba(0,0,0,0.6);
}
.helpmodal-box h3 { margin: 0 0 12px; color: var(--accent); }
.helpmodal-box img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.helpmodal-box a { color: var(--accent); }
.helpmodal-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
