/* =========================================================
   カリウタ — 夜の録音スタジオ（ガラスのパネル × ネオンの光）
   ========================================================= */
:root {
  --bg: #07080f;
  --bg2: rgba(8, 9, 20, 0.55);
  --panel: rgba(22, 24, 44, 0.55);
  --panel2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.16);
  --text: #f3f2fb;
  --sub: #c4c3dc;
  --muted: #8d8ca9;
  --me: #ff4f8b;
  --me2: #ff8a5c;
  --ai: #3be3d2;
  --inst: #9aa8d6;
  --violet: #8b7bff;
  --warn: #ffc857;
  --danger: #ff4d6d;
  --good: #52e39a;
  --radius: 18px;
  --grad-me: linear-gradient(135deg, var(--me), var(--me2));
  --grad-brand: linear-gradient(100deg, var(--ai), var(--violet) 50%, var(--me));
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 48px -28px rgba(0, 0, 0, 0.8);
  font-family: "Yu Gothic UI", "BIZ UDPGothic", "Hiragino Sans", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  font-feature-settings: "palt"; /* 日本語の字間を詰めて、すっきり見せる */
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }
/* 画面全体はスクロールさせず、ウィンドウの高さにぴったり収める */
body {
  background: var(--bg);
  color: var(--text);
  height: 100vh; height: 100dvh;
  overflow: hidden;
  display: flex; flex-direction: column;
  line-height: 1.6;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* オーロラのような光 */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 42% at 12% 8%, rgba(255, 79, 139, 0.20), transparent 70%),
    radial-gradient(36% 40% at 92% 14%, rgba(59, 227, 210, 0.15), transparent 70%),
    radial-gradient(45% 45% at 60% 110%, rgba(139, 123, 255, 0.18), transparent 70%);
  filter: blur(20px);
}
/* うっすらとした粒子感 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: rgba(255, 79, 139, 0.35); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.c-me { color: var(--me); }
.c-ai { color: var(--ai); }
.c-inst { color: var(--inst); }
.grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* スクロールバー（枠の中だけ流れるところ） */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 起動中 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--bg);
}
.boot-box { text-align: center; max-width: 420px; padding: 24px; }

/* ---------- 上の帯 ---------- */
.appbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 15, 0.35);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark { display: grid; width: 28px; height: 28px; flex: none; filter: drop-shadow(0 4px 12px rgba(255, 79, 139, 0.35)); }
.logo-mark svg { width: 100%; height: 100%; }
.logo {
  white-space: nowrap;
  font-weight: 800; font-size: 19px; letter-spacing: 0.12em;
  color: var(--text);
}
.logo.big {
  font-size: 40px;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); font-size: 12.5px; margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--line2); }
.pill {
  white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 4px 12px 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.03);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill.good { color: var(--good); border-color: rgba(82, 227, 154, 0.3); }
.pill.warn { color: var(--warn); border-color: rgba(255, 200, 87, 0.3); }
.pill.bad { color: var(--danger); border-color: rgba(255, 77, 109, 0.35); }

main {
  flex: 1; min-height: 0; width: 100%;
  max-width: 1440px; margin: 0 auto; padding: 16px 24px 18px;
  display: flex; flex-direction: column;
}
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: fade-in 0.35s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--line);
  cursor: pointer; font-size: 14px; white-space: nowrap; color: var(--text);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.08s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: var(--line2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .rec-btn:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
.btn-accent {
  background: var(--grad-me); border-color: transparent; color: #fff; font-weight: 700;
  box-shadow: 0 8px 24px -8px rgba(255, 79, 139, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-accent:hover:not(:disabled) {
  background: var(--grad-me); border-color: transparent; filter: brightness(1.08);
  box-shadow: 0 10px 30px -8px rgba(255, 79, 139, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; font-weight: 700; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.btn-small { padding: 6px 13px; font-size: 13px; border-radius: 10px; }
.btn-tiny { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.on { background: rgba(255, 200, 87, 0.14); border-color: rgba(255, 200, 87, 0.6); color: var(--warn); }
.btn.wide { width: 100%; }
.btn-rec-outline { border-color: rgba(255, 79, 139, 0.5); color: #ff9fbf; background: rgba(255, 79, 139, 0.08); }

/* ---------- はじめの画面 ---------- */
#screen-start { gap: 18px; }
/* 見出しと「動くミキサー」を横に並べる */
.hero {
  flex: none; padding: 4px 0 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 32px; align-items: center;
}
.hero-mixer {
  position: relative; height: clamp(176px, 27vh, 272px);
  display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, rgba(26, 28, 52, 0.75), rgba(10, 11, 24, 0.8));
  border: 1px solid var(--line2);
  box-shadow: var(--glass-shadow), 0 0 0 1px rgba(139, 123, 255, 0.08), 0 30px 80px -30px rgba(139, 123, 255, 0.55), 0 20px 60px -35px rgba(255, 79, 139, 0.6);
  backdrop-filter: blur(18px);
  transform: perspective(1400px) rotateY(-5deg) rotateX(2deg);
  transform-origin: left center;
}
.hero-mixer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 60% at 100% 0%, rgba(59, 227, 210, 0.1), transparent 60%), radial-gradient(70% 60% at 0% 100%, rgba(255, 79, 139, 0.1), transparent 60%);
}
.hm-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 12px;
}
.hm-dots { display: flex; gap: 5px; }
.hm-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.hm-dots i:first-child { background: #ff5f7a; }
.hm-dots i:nth-child(2) { background: #ffc857; }
.hm-dots i:nth-child(3) { background: #3be3a0; }
.hm-title { color: var(--muted); letter-spacing: 0.16em; font-weight: 700; }
.hm-rec {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; color: #ff9fbf; font-weight: 700; letter-spacing: 0.08em;
  background: rgba(255, 79, 139, 0.12); border: 1px solid rgba(255, 79, 139, 0.45);
}
.hm-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--me); box-shadow: 0 0 8px var(--me); animation: blink 1.2s infinite; }
.hm-time {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; min-width: 52px; text-align: right;
}
.hero-mixer canvas { position: relative; flex: 1; min-height: 0; width: 100%; display: block; padding: 0; }
.hero h1 { font-size: clamp(24px, 2.5vw, 34px); font-weight: 800; line-height: 1.3; margin: 0 0 8px; letter-spacing: 0.03em; }
.hero p { color: var(--sub); max-width: 900px; margin: 0; font-size: 14.5px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; counter-reset: s; }
.steps li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); font-size: 13px; color: var(--sub);
}
.steps li + li::before { content: ""; display: none; }
.steps span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); font-size: 11.5px; font-weight: 700; color: var(--text);
}

.cards { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line2); }
.card h2 { font-size: 17px; margin: 2px 0 0; letter-spacing: 0.03em; }
.card p { margin: 0; color: var(--sub); font-size: 13.5px; flex: 1; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 79, 139, 0.14); color: var(--me);
}
.card-icon.ai { background: rgba(59, 227, 210, 0.12); color: var(--ai); }
.card-icon.inst { background: rgba(139, 123, 255, 0.15); color: #b4a9ff; }
.card-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-primary { cursor: pointer; border-color: rgba(255, 79, 139, 0.35); }
.card-primary::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 79, 139, 0.18), transparent 60%);
}
.card-primary:hover { border-color: rgba(255, 79, 139, 0.7); box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255, 79, 139, 0.25), 0 20px 50px -20px rgba(255, 79, 139, 0.45); }
.card-tag { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; }
.card .hint { font-size: 12.5px; color: var(--warn); min-height: 1em; }
.file-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.file-row span { line-height: 1.3; }
.file-row input { font-size: 12px; color: var(--sub); }
.file-row input::file-selector-button {
  margin-right: 10px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.07); color: var(--text); font: inherit;
}

/* ウェブ版では、AIで分けるカードを控えめにして、分離済みのファイルのカードを主役にする */
body.is-web .card-primary { border-color: var(--line); opacity: 0.6; order: 3; }
body.is-web .card-primary::before { display: none; }
body.is-web .card-primary .btn-accent { background: var(--panel2); box-shadow: none; color: var(--sub); font-weight: 400; }
body.is-web .card-primary .hint { color: var(--muted); }

/* 作品が増えたら、一覧の枠の中だけが流れる */
.projects { flex: 1; min-height: 72px; display: flex; flex-direction: column; }
.projects h2 { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.12em; margin: 0 0 8px; }
.project-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start; padding-right: 4px; }
.project-list > .muted { margin: 0; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line2); font-size: 13.5px; }
.project {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.project:hover { border-color: var(--line2); background: rgba(30, 32, 58, 0.6); }
.project-name { font-weight: 700; }
.project-meta { font-size: 12px; color: var(--muted); }
.project-actions { display: flex; gap: 6px; }
.note { flex: none; margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); opacity: 0.85; }

/* ---------- スタジオ ---------- */
.studio-head { flex: none; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.proj-name {
  flex: 1; min-width: 0; max-width: 520px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  font-size: 19px; font-weight: 800; padding: 2px 8px; letter-spacing: 0.04em;
}
.proj-name:hover, .proj-name:focus { border-color: var(--line); background: var(--bg2); outline: none; }
.keys { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* 再生バーと波形を、1枚のガラスのパネルとして見せる */
.transport {
  flex: none;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 9px 14px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  cursor: pointer; font-size: 14px; display: grid; place-items: center; color: var(--text);
  transition: background 0.15s, transform 0.08s, box-shadow 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.big {
  width: 50px; height: 50px; font-size: 18px; border: none; color: #0b0c16;
  background: linear-gradient(160deg, #ffffff, #d9d8ee);
  box-shadow: 0 8px 22px -8px rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}
.rec-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  background: rgba(255, 79, 139, 0.1); border: 1px solid rgba(255, 79, 139, 0.45);
  color: #ff9fbf; font-weight: 700; cursor: pointer; letter-spacing: 0.06em;
  transition: background 0.15s, box-shadow 0.2s;
}
.rec-btn:hover { background: rgba(255, 79, 139, 0.18); box-shadow: 0 0 24px -6px rgba(255, 79, 139, 0.6); }
.rec-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--me); box-shadow: 0 0 10px var(--me); }
.rec-btn.on { background: var(--grad-me); border-color: transparent; color: #fff; box-shadow: 0 0 30px -4px rgba(255, 79, 139, 0.8); }
.rec-btn.on .dot { background: #fff; border-radius: 3px; box-shadow: none; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.time {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; min-width: 150px; letter-spacing: 0.02em;
}
.time .slash { color: var(--muted); margin: 0 6px; font-weight: 300; }
#time-total { color: var(--muted); font-weight: 400; font-size: 15px; }
.sel-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; font-size: 12.5px;
  padding: 4px 4px 4px 12px; border-radius: 12px; background: rgba(139, 123, 255, 0.1); border: 1px solid rgba(139, 123, 255, 0.3);
}
.sel-help { margin-left: auto; font-size: 12px; color: var(--muted); }

.timeline-wrap {
  flex: none;
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden; background: rgba(8, 9, 20, 0.6); margin-bottom: 14px;
  box-shadow: var(--glass-shadow);
}
#timeline { display: block; cursor: crosshair; touch-action: none; }
body.is-recording .timeline-wrap,
body.is-recording .transport { border-color: rgba(255, 79, 139, 0.55); }
body.is-recording .timeline-wrap { box-shadow: 0 0 0 1px rgba(255, 79, 139, 0.25), 0 0 40px -10px rgba(255, 79, 139, 0.5); }

/* 残りの高さを、左の歌詞と右のタブで分け合う（中身が多いときは枠の中だけが流れる） */
.studio-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  backdrop-filter: blur(18px); box-shadow: var(--glass-shadow);
}
.panel h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.08em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; color: var(--sub); font-size: 13px; letter-spacing: 0.14em; }
.panel-actions { display: flex; gap: 6px; align-items: center; }
.lyrics-panel { display: flex; flex-direction: column; min-height: 0; }
.lyrics-panel > * { flex: none; }
.side { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }

/* タブ（すりガラスの切り替えスイッチ） */
.tabs {
  flex: none; display: flex; gap: 4px; margin: 10px 12px 0; padding: 4px;
  border-radius: 13px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line);
}
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 6px; border: none; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); font-weight: 700; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px -6px rgba(0, 0, 0, 0.6); }
.tab:focus-visible { outline: 2px solid var(--ai); outline-offset: -2px; }
.tab-badge {
  min-width: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px; line-height: 17px; text-align: center;
  background: var(--grad-me); color: #fff; font-weight: 700;
}
.tab-page { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 14px; }

.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.row label { min-width: 92px; font-size: 13px; color: var(--sub); }
.row select {
  flex: 1; min-width: 0; padding: 6px 10px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
}
.row select option { background: #15162a; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; cursor: pointer; color: var(--sub); }
.check input { accent-color: var(--me); width: 15px; height: 15px; }
.sub-head { margin: 14px 0 8px; font-size: 12.5px; color: var(--muted); }

/* 歌詞 */
.karaoke {
  position: relative; overflow: hidden;
  border-radius: 14px; padding: 14px 20px; min-height: 150px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(139, 123, 255, 0.12), transparent 60%), rgba(6, 7, 16, 0.55);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 6px; text-align: center;
}
.k-line { min-height: 1.4em; }
.k-prev { color: #5f5e7d; font-size: 14px; }
.k-cur {
  font-size: 28px; font-weight: 800; line-height: 1.35; letter-spacing: 0.04em; --p: 0%;
  background: linear-gradient(90deg, var(--me) 0%, var(--me2) var(--p), #f3f2fb var(--p));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 79, 139, 0.25));
}
.k-next { color: #b9b8d3; font-size: 16px; }
.k-next2 { color: #5f5e7d; font-size: 14px; }
.karaoke.empty .k-cur { font-size: 17px; font-weight: 600; filter: none; }

.tap-bar {
  margin-top: 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(59, 227, 210, 0.07); border: 1px solid rgba(59, 227, 210, 0.35);
}
.tap-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tap-count { font-size: 12px; color: var(--ai); }
.tap-label { font-size: 12.5px; color: var(--muted); }
.tap-next { font-weight: 700; font-size: 16px; }
.tap-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.lyrics-panel > .lyrics-list { flex: 1; min-height: 0; list-style: none; margin: 10px 0 0; padding: 0 4px 0 0; overflow-y: auto; }
.lyrics-list li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 6px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--sub);
  transition: background 0.12s, color 0.12s;
}
.lyrics-list li:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.lyrics-list li.current { background: linear-gradient(90deg, rgba(255, 79, 139, 0.18), rgba(255, 79, 139, 0.02)); color: var(--text); box-shadow: inset 2px 0 0 var(--me); }
.lyric-time { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); min-width: 38px; }
.lyrics-panel > .lyrics-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lyrics-editor .row { flex: none; }
.lyrics-editor textarea {
  flex: 1; min-height: 60px;
  width: 100%; margin-top: 4px; padding: 12px 14px; resize: none;
  border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); line-height: 1.75;
}
.lyrics-editor textarea:focus { outline: none; border-color: rgba(255, 79, 139, 0.5); box-shadow: 0 0 0 3px rgba(255, 79, 139, 0.12); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5;
  display: grid; gap: 4px; padding: 8px; min-width: 210px;
  background: rgba(24, 25, 46, 0.92); border: 1px solid var(--line2); border-radius: 14px;
  backdrop-filter: blur(20px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.menu-body .btn { justify-content: flex-start; background: transparent; border-color: transparent; }
.menu-body .btn:hover { background: rgba(255, 255, 255, 0.07); }

/* つまみ（スライダー） */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer;
  --c: var(--text); --v: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, var(--c) var(--v), rgba(255, 255, 255, 0.12) var(--v));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 0 12px var(--c);
  transition: transform 0.12s;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--c); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ai); }

.fader { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; margin: 4px 0; font-size: 13px; }
.fader label { color: var(--sub); }
.fader output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.fader input { --c: #d8d7ea; }
.fader.inst input { --c: var(--inst); }
.fader.guide input { --c: var(--ai); }
.fader.voice input { --c: var(--me); }
.blend { padding: 10px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 8px; }
.blend-labels { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; }
.blend-labels output { color: var(--text); font-weight: 400; font-size: 12px; opacity: 0.8; }
#blend { margin: 8px 0; height: 20px; }
#blend::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--ai), var(--violet) 50%, var(--me)); }
#blend::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; box-shadow: 0 0 0 4px rgba(10, 10, 22, 0.9), 0 0 18px rgba(255, 255, 255, 0.5); }
#blend::-moz-range-track { height: 6px; background: linear-gradient(90deg, var(--ai), var(--violet) 50%, var(--me)); }
#blend::-moz-range-progress { background: transparent; }
.blend-quick { display: flex; justify-content: space-between; gap: 6px; }
.blend-quick .btn { background: transparent; }
.mix-panel .fader { margin: 4px 0; }
#btn-autolevel { margin-top: 4px; border-style: dashed; color: var(--sub); }
#btn-autolevel:hover:not(:disabled) { color: var(--text); border-style: solid; }
.fx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.fx-label { width: 110px; font-size: 13px; color: var(--sub); }
.fx-row .presets { margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.presets .btn { border-radius: 999px; }
.presets .btn.on { background: rgba(255, 79, 139, 0.16); border-color: rgba(255, 79, 139, 0.65); color: #ffd0e0; box-shadow: 0 0 16px -6px rgba(255, 79, 139, 0.8); }

/* テイク */
.takes-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.takes-list .empty { color: var(--muted); font-size: 13px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line2); }
.take {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--me);
}
.take.is-muted { box-shadow: inset 3px 0 0 #4b4a66; opacity: 0.65; }
.take-name { font-weight: 700; font-size: 13.5px; }
.take-range { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.take-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* 録音の設定 */
.meter { flex: 1; height: 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
#meter-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--good), #c6f36b); box-shadow: 0 0 10px rgba(82, 227, 154, 0.6); transition: width 0.05s linear; }
#meter-bar.clip { background: var(--danger); }
.latency-row input {
  width: 90px; padding: 5px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

/* ---------- 重なって出るもの ---------- */
.countdown {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 30;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 140px; font-weight: 800; color: #fff; pointer-events: none;
  text-shadow: 0 0 40px rgba(255, 79, 139, 0.7), 0 10px 50px rgba(0, 0, 0, 0.6);
}
.countdown.go { font-size: 64px; background: var(--grad-me); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(3, 3, 10, 0.6); backdrop-filter: blur(8px); animation: fade-in 0.2s ease-out; }
.modal-box {
  width: min(520px, calc(100vw - 32px)); padding: 24px; border-radius: 22px;
  background: rgba(24, 25, 46, 0.9); border: 1px solid var(--line2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 90px rgba(0, 0, 0, 0.6);
}
.modal-box h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: 0.04em; }
.modal-box p { margin: 6px 0; color: var(--sub); }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 16px 0 8px; position: relative; }
#progress-bar { height: 100%; width: 0; border-radius: 999px; background: var(--grad-brand); box-shadow: 0 0 14px rgba(139, 123, 255, 0.6); transition: width 0.3s; }
.progress.indeterminate #progress-bar { width: 35% !important; position: absolute; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; }
.toast {
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; max-width: min(640px, calc(100vw - 32px));
  background: rgba(28, 29, 54, 0.92); border: 1px solid var(--line2); backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.good { border-color: rgba(82, 227, 154, 0.45); }
.toast.warn { border-color: rgba(255, 200, 87, 0.55); }
.toast.error { border-color: rgba(255, 77, 109, 0.65); }
.toast.out { opacity: 0; transition: opacity 0.3s; }
@keyframes pop { from { transform: translateY(10px) scale(0.97); opacity: 0; } }

/* 波形を大きく見せる分、右のタブの中身はいつも詰めて並べる */
.tabs { margin: 6px 10px 0; padding: 3px; }
.tab { padding: 4px 6px; }
.tab-page .row, .tab-page .check { margin: 5px 0; }
.tab-page { padding: 6px 16px 4px; }
.blend { padding: 6px 12px; }
#blend { margin: 4px 0; }
.blend-quick .btn { padding: 2px 9px; }
.mix-panel .fader { margin: 0; }
#btn-autolevel { padding: 4px 12px; margin-top: 2px; }
.fx-row { margin: 8px 0 2px; }
.fx-row .btn { padding: 4px 10px; }

/* 高さが低い画面では、少しずつ詰める */
@media (max-height: 760px) {
  .steps { display: none; }
  .hero p { font-size: 13px; }
  #screen-start { gap: 14px; }
  .card p { font-size: 12.5px; }
  .card-icon { width: 30px; height: 30px; }
  .karaoke { min-height: 0; padding: 10px 16px; gap: 2px; }
  .k-cur { font-size: 23px; }
  .k-next2 { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn.big { width: 44px; height: 44px; }
  .rec-btn { height: 38px; }
  .studio-head { margin-bottom: 6px; }
  .timeline-wrap { margin-bottom: 10px; }
  main { padding-top: 10px; padding-bottom: 12px; }
}
@media (max-height: 700px) {
  .hero-mixer { height: 150px; }
  #screen-start { gap: 12px; }
  .card { padding: 14px 18px; gap: 6px; }
  .hero p { font-size: 12.5px; }
}
@media (max-width: 1100px) {
  .keys { display: none; }
  .fx-label { width: auto; }
  .fx-row { gap: 8px; }
  .fx-row .presets { gap: 4px; }
  .fx-row .btn { padding: 4px 8px; font-size: 12.5px; }
  .fader { grid-template-columns: 92px 1fr 44px; }
}

/* 小さすぎる画面（スマホや細いウィンドウ）だけは、ふつうに縦にスクロールさせる */
@media (max-width: 900px), (max-height: 540px) {
  body { height: auto; min-height: 100vh; overflow: visible; display: block; }
  main, .screen { display: block; }
  .screen > * + * { margin-top: 16px; }
  .cards { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .side { min-height: 420px; }
  .lyrics-panel > .lyrics-list { max-height: 320px; }
  .lyrics-editor textarea { min-height: 240px; }
  .hero h1 { font-size: 24px; }
  .hero { display: block; }
  .hero-mixer { margin-top: 16px; height: 200px; transform: none; }
}
@media (max-width: 560px) {
  .tagline { display: none; }
  .appbar { padding: 12px 16px; }
  main { padding: 16px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
