/* ==========================================================
   H/MIX COMPRESSOR — 視覚で学ぶコンプレッサー
   1880 × 1700 plug-in shell. Glass-morph, brass, jade, gold.
   ========================================================== */

:root {
  /* tone */
  --bg-0:        #03060d;
  --bg-1:        #050b18;
  --bg-2:        #0a3a26;
  --bg-3:        #0a1422;
  /* core palette */
  --jade:        #40ceb4;
  --jade-soft:   #7be0c8;
  --jade-deep:   #1f8c79;
  --gold:        #d4a44c;
  --gold-bright: #f5d896;
  --gold-deep:   #8a6a2a;
  --brass:       #b48a44;
  --brass-dark:  #6d4f22;
  --patina:      #4d8068;          /* oxidised brass */
  --star:        rgba(245, 240, 230, 0.92);
  --ink:         rgba(245, 240, 230, 0.92);
  --ink-soft:    rgba(218, 232, 228, 0.62);
  --muted:       rgba(180, 220, 195, 0.55);
  --warn:        #e57364;
  --weak:        #6c8c9c;
  --line:        rgba(217, 181, 102, 0.32);
  --line-soft:   rgba(217, 181, 102, 0.16);
  --line-jade:   rgba(64, 206, 180, 0.28);
  /* shadows */
  --glow-jade:   0 0 24px rgba(64, 206, 180, 0.30);
  --glow-gold:   0 0 28px rgba(217, 181, 102, 0.25);
  --bevel-out:   inset 0 1px 0 rgba(245, 216, 150, 0.18),
                 inset 0 -1px 0 rgba(0, 0, 0, 0.55);
  --bevel-in:    inset 0 2px 4px rgba(0, 0, 0, 0.7),
                 inset 0 -1px 0 rgba(245, 216, 150, 0.10);
}

*  { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(64, 206, 180, 0.10), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(217, 181, 102, 0.06), transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  color: var(--ink);
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 8% 14%,  rgba(245,240,230,0.55), transparent 60%),
    radial-gradient(1px 1px at 22% 71%, rgba(245,240,230,0.45), transparent 60%),
    radial-gradient(1px 1px at 38% 22%, rgba(245,240,230,0.5),  transparent 60%),
    radial-gradient(1px 1px at 54% 88%, rgba(245,240,230,0.4),  transparent 60%),
    radial-gradient(1px 1px at 71% 32%, rgba(245,240,230,0.55), transparent 60%),
    radial-gradient(1px 1px at 88% 64%, rgba(245,240,230,0.45), transparent 60%),
    radial-gradient(1px 1px at 95% 18%, rgba(245,240,230,0.4),  transparent 60%);
  opacity: 0.6;
  z-index: 0;
}
/* === 出力レベル連動の外背景 === (drawWindow が --ext-glow を更新) */
:root { --ext-glow: 0; }
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 80% at 50% 50%,
      rgba(245, 216, 150, calc(var(--ext-glow) * 0.85)) 0%,
      rgba(255, 200, 130, calc(var(--ext-glow) * 0.45)) 18%,
      rgba(64, 206, 180, calc(var(--ext-glow) * 0.22)) 48%,
      rgba(40, 80, 120, calc(var(--ext-glow) * 0.10)) 75%,
      transparent 100%);
  mix-blend-mode: screen;
  transition: opacity 0.06s linear;
}
/* PC画面全体: 出力に応じて壮大に呼吸 */
html {
  background-color: rgb(
    calc(8  + var(--ext-glow, 0) * 60),
    calc(12 + var(--ext-glow, 0) * 44),
    calc(20 + var(--ext-glow, 0) * 16)
  );
  transition: background-color 0.08s linear;
}
/* 追加レイヤー: 強い出力時に外側で大胆に光輝く星雲 */
body {
  position: relative;
}
body > .ext-aurora {
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 216, 150, calc(var(--ext-glow) * 0.50)), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(64, 206, 180, calc(var(--ext-glow) * 0.40)), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(255, 200, 140, calc(var(--ext-glow) * 0.45)), transparent 35%);
  mix-blend-mode: screen;
  filter: blur(60px);
  opacity: calc(var(--ext-glow, 0));
  transition: opacity 0.08s linear;
}

/* ==========================================================
   Viewport scaling shell — design at 1880 × 1700
   ========================================================== */
.scaler {
  position: relative;
  width: 1880px; height: 1700px;
  transform-origin: top center;
  flex: 0 0 auto;
}
.viewport-host {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 0 36px;
  position: relative;
  z-index: 1;
  overflow-x: hidden;   /* scale で縮小しても layout 幅 1880 のため、横overflow を隠す */
}

/* ==========================================================
   Plug-in panel (the "ancient device")
   ========================================================== */
.panel {
  position: relative;
  width: 100%; height: 100%;
  padding: 22px;
  border-radius: 18px;
  background:
    linear-gradient(180deg,
      rgba(11, 24, 36, 0.92) 0%,
      rgba(6, 14, 22, 0.94) 50%,
      rgba(3, 8, 14, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(217, 181, 102, 0.22),
    0 0 0 2px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(180, 138, 68, 0.18),
    0 30px 90px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(245, 216, 150, 0.10),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6);
}
/* brass corner bolts */
.bolt {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f0d28a, #8a6a2a 55%, #2a1f0c 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 230, 170, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.6);
}
.bolt::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(45deg, transparent 45%, rgba(0,0,0,0.4) 49%, rgba(0,0,0,0.4) 51%, transparent 55%);
  border-radius: 50%;
}
.bolt.tl { top: 14px; left: 14px; }
.bolt.tr { top: 14px; right: 14px; }
.bolt.bl { bottom: 14px; left: 14px; }
.bolt.br { bottom: 14px; right: 14px; }

/* filigree art-nouveau corner ornaments */
.filigree {
  position: absolute;
  width: 110px; height: 110px;
  pointer-events: none;
  opacity: 0.55;
  color: var(--gold);
}
.filigree.tl { top: 8px;    left: 8px; }
.filigree.tr { top: 8px;    right: 8px; transform: scaleX(-1); }
.filigree.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.filigree.br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

/* ==========================================================
   Header bar
   ========================================================== */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  margin-bottom: 14px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(15, 28, 40, 0.82), rgba(6, 14, 22, 0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(245, 216, 150, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.5);
}
.header-left, .header-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 6px; }
.header-right { justify-content: flex-end; }
.header-center {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
}
.brand-mark {
  display: flex; align-items: center; gap: 12px;
}
.brand-mark img {
  height: 64px; width: auto;
  filter: drop-shadow(0 0 14px rgba(245, 216, 150, 0.35));
}
.brand-text {
  display: flex; flex-direction: column; align-items: center;
}
.brand-name {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(245, 216, 150, 0.35);
}
.brand-sub {
  font-family: 'Noto Serif JP', serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--muted);
  margin-top: 4px;
}

/* preset selector — 強調版 (光のパルス) */
.preset-bay {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20, 50, 60, 0.85), rgba(4, 14, 22, 0.92));
  border: 1px solid rgba(217, 181, 102, 0.55);
  box-shadow:
    inset 0 0 20px rgba(217, 181, 102, 0.10),
    0 0 24px rgba(245, 216, 150, 0.18);
  animation: preset-pulse 2.8s ease-in-out infinite;
  position: relative;
}
@keyframes preset-pulse {
  0%, 100% { box-shadow: inset 0 0 20px rgba(217, 181, 102, 0.10), 0 0 22px rgba(245, 216, 150, 0.18); border-color: rgba(217, 181, 102, 0.55); }
  50%      { box-shadow: inset 0 0 26px rgba(245, 216, 150, 0.20), 0 0 38px rgba(245, 216, 150, 0.40); border-color: rgba(245, 216, 150, 0.95); }
}
.preset-bay.is-quiet {
  animation: none;   /* ユーザーが操作したら静かに */
}
.preset-arrow {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 181, 102, 0.4);
  background: rgba(8, 18, 28, 0.7);
  color: var(--gold-bright);
  font-family: 'Cinzel', serif;
  font-size: 18px;
  cursor: pointer;
  transition: 0.15s;
}
.preset-arrow:hover {
  border-color: var(--gold-bright);
  background: rgba(217, 181, 102, 0.18);
  color: var(--gold-bright);
  transform: scale(1.06);
}
.preset-name {
  min-width: 240px;
  text-align: center;
  font-family: 'Cinzel', 'Noto Serif JP', serif;
  font-size: 18px;
  letter-spacing: 0.10em;
  color: var(--gold-bright);
  padding: 6px 14px;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 0 10px rgba(245, 216, 150, 0.5);
}
.preset-name small {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-top: 3px;
  opacity: 0.8;
}

/* preset dropdown panel */
.preset-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-height: 660px;       /* 12 プリセット用に拡張 */
  overflow: auto;
  overflow-x: visible;  /* tooltip が横にはみ出ても見えるように */
  background: linear-gradient(180deg, rgba(10, 22, 30, 0.98), rgba(4, 10, 18, 0.98));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(64, 206, 180, 0.10);
  padding: 6px;
  z-index: 60;
  display: none;
}
.preset-bay.is-open .preset-menu { display: block; }
.preset-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.14s;
  border: 1px solid transparent;
}
.preset-item:hover {
  background: rgba(64, 206, 180, 0.12);
  border-color: var(--line-jade);
}
.preset-item.is-active {
  background: linear-gradient(135deg, rgba(64, 206, 180, 0.22), rgba(217, 181, 102, 0.18));
  border-color: var(--jade);
}
.preset-item .pi-key {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  width: 32px; text-align: center;
  text-shadow: 0 0 8px rgba(245, 216, 150, 0.4);
}
.preset-item .pi-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preset-item .pi-name {
  font-family: 'Noto Serif JP', serif;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.06em;
  font-weight: 500;
}
.preset-item .pi-en {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

/* hover ツールチップ (詳細はここで読める文字サイズで表示) */
.preset-item .pi-tooltip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  min-width: 320px;
  max-width: 400px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(14, 26, 36, 0.98), rgba(6, 14, 22, 0.99));
  border: 1px solid var(--line-jade);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 22px rgba(64, 206, 180, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease-out;
  z-index: 400;
}
.preset-item:hover .pi-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.preset-item .pi-tt-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 16px;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.preset-item .pi-tt-en {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-left: 6px;
}
.preset-item .pi-tt-desc {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.preset-item .pi-tt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--jade);
}
.preset-item .pi-tt-meta strong {
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.16em;
  margin-right: 6px;
}

/* header buttons (capsule pills) */
.cap-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  font-family: 'Cinzel', 'Noto Serif JP', serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: rgba(8, 18, 28, 0.65);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: 0.16s;
  white-space: nowrap;
  box-shadow: var(--bevel-out);
}
.cap-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(217, 181, 102, 0.10);
  transform: translateY(-1px);
}
.cap-btn.is-active {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(64, 206, 180, 0.10);
  box-shadow: 0 0 18px rgba(64, 206, 180, 0.30), var(--bevel-out);
}
.cap-btn[data-tone="warn"].is-active {
  border-color: var(--warn);
  color: var(--warn);
  background: rgba(229, 115, 100, 0.10);
  box-shadow: 0 0 18px rgba(229, 115, 100, 0.30), var(--bevel-out);
}
.cap-btn .gem {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brass-dark);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.4);
}
.cap-btn.is-active .gem {
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* AB selector */
.ab-bay {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: rgba(4, 10, 18, 0.7);
}
.ab-btn {
  padding: 7px 12px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.20em;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: 0.14s;
}
.ab-btn.is-active {
  background: rgba(64, 206, 180, 0.18);
  color: var(--jade);
}
.ab-copy {
  padding: 7px 12px;
  font-family: 'Noto Serif JP', 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.10em;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line-soft);
  color: var(--gold);
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}
.ab-copy:hover { color: var(--gold-bright); background: rgba(217, 181, 102, 0.08); }
.ab-copy.is-saved {
  color: var(--jade);
  background: rgba(64, 206, 180, 0.16);
  font-size: 14px;
}

.lang-bay {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.lang-bay button {
  padding: 7px 12px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.20em;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: 0.14s;
}
.lang-bay button.is-active {
  background: rgba(64, 206, 180, 0.16);
  color: var(--jade);
}

/* ==========================================================
   Main grid: VU | center stack | VU
   ========================================================== */
.main-grid {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 18px;
  height: 1180px;   /* メイン画面拡大: 880 → 1180 */
}

/* VU columns */
.vu-col {
  display: flex; flex-direction: column;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 22, 30, 0.85), rgba(4, 10, 18, 0.92));
  border: 1px solid var(--line-soft);
  box-shadow: var(--bevel-out);
  padding: 14px 10px;
  align-items: center;
  gap: 8px;
}
.vu-col .vu-cap {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.30em;
  color: var(--gold);
}
.vu-col .vu-cap small {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 2px;
}
.vu-meter {
  position: relative;
  width: 38px;
  flex: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.95));
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--bevel-in);
}
.vu-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg,
    var(--jade) 0%,
    var(--jade-soft) 30%,
    var(--gold-bright) 75%,
    var(--warn) 95%);
  height: 0%;
  box-shadow: 0 0 12px rgba(64, 206, 180, 0.45);
  transition: height 0.05s linear;
}
.vu-peak {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
  opacity: 0.85;
}
/* 瞬間ピークの跳ねるバー: peak で即座に上がり、 0.5s 程度でゆっくり下がる
   半透明の薄いラインを上下に重ねて「光の刃」 感を出す */
.vu-peak-fast {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(0deg,
    transparent 0%,
    rgba(245, 240, 230, 0.55) 30%,
    rgba(255, 250, 230, 0.95) 50%,
    rgba(245, 240, 230, 0.55) 70%,
    transparent 100%);
  box-shadow:
    0 0 8px rgba(255, 250, 230, 0.85),
    0 0 16px rgba(245, 216, 150, 0.5);
  opacity: 0.95;
  pointer-events: none;
  transition: bottom 0.05s ease-out;
}
.vu-ticks {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(180deg,
      transparent 0%, transparent calc(10% - 1px),
      rgba(245,240,230,0.18) calc(10% - 1px), rgba(245,240,230,0.18) 10%,
      transparent 10%, transparent calc(25% - 1px),
      rgba(245,240,230,0.14) calc(25% - 1px), rgba(245,240,230,0.14) 25%,
      transparent 25%, transparent calc(50% - 1px),
      rgba(245,240,230,0.18) calc(50% - 1px), rgba(245,240,230,0.18) 50%,
      transparent 50%, transparent calc(75% - 1px),
      rgba(245,240,230,0.14) calc(75% - 1px), rgba(245,240,230,0.14) 75%);
}
.vu-scale {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  height: 100%;
  font-family: 'Cinzel', serif;
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.06em;
  width: 22px;
  text-align: right;
  align-items: stretch;
}
.vu-scale span { line-height: 1; }
.vu-row {
  display: flex; align-items: stretch; gap: 4px; flex: 1; width: 100%;
  justify-content: center;
}
.vu-num {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--jade);
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(64, 206, 180, 0.6);
}

/* ==========================================================
   Center: window canvas + middle row + bottom rows
   ========================================================== */
.center-col {
  display: flex; flex-direction: column;
  gap: 14px;
}
.window-card {
  position: relative;
  flex: 1;
  min-height: 760px;   /* メイン画面の最低高さを確保 */
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.92), rgba(2, 6, 14, 0.98));
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.7),
    inset 0 0 30px rgba(64, 206, 180, 0.05),
    0 0 60px rgba(64, 206, 180, 0.06),
    0 0 30px rgba(217, 181, 102, 0.04);
  overflow: hidden;
}
.window-card canvas {
  position: absolute;     /* normal flow から外し、親を押し広げないようにする */
  inset: 0;
  display: block;
  width: 100%; height: 100%;
}
/* glass highlight stripe across canvas top */
.window-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 30%;
  background: linear-gradient(180deg, rgba(245, 216, 150, 0.05), transparent);
  pointer-events: none;
  z-index: 2;
}
/* corner gem mounts on the window */
.window-card .gem-mount {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #87ecd5, #1f8c79 55%, #02160f 100%);
  box-shadow:
    inset 0 1px 2px rgba(180, 240, 220, 0.6),
    0 0 14px rgba(64, 206, 180, 0.5);
  z-index: 3;
  border: 2px solid rgba(180, 138, 68, 0.7);
}
.window-card .gem-mount.tl { top: 12px; left: 12px; }
.window-card .gem-mount.tr { top: 12px; right: 12px; }
.window-card .gem-mount.bl { bottom: 12px; left: 12px; }
.window-card .gem-mount.br { bottom: 12px; right: 12px; }
.window-card .gem-mount.chip { background: radial-gradient(circle at 30% 25%, #87ecd5, #1f8c79 50%, #02160f 100%); }
.window-card .gem-mount.chip::after {
  content: ''; position: absolute;
  top: 50%; right: 0; width: 7px; height: 7px;
  background: #02160f;
  border-radius: 50% 0 0 50%;
  transform: translateY(-50%);
}

.live-narration {
  position: absolute;
  left: 16px; right: auto; bottom: 16px;
  max-width: 340px;
  padding: 10px 16px 10px 20px;
  background: linear-gradient(180deg,
    rgba(8, 30, 36, 0.72) 0%,
    rgba(2, 14, 22, 0.78) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(64, 206, 180, 0.28);
  border-left: 3px solid var(--jade);
  border-radius: 8px;
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  z-index: 4;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.50),
    0 0 16px rgba(64, 206, 180, 0.12),
    inset 0 0 14px rgba(64, 206, 180, 0.04);
  animation: live-glow 4.5s ease-in-out infinite;
}
@keyframes live-glow {
  0%, 100% { box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55), 0 0 28px rgba(64, 206, 180, 0.18), inset 0 0 24px rgba(64, 206, 180, 0.05); }
  50%      { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 38px rgba(64, 206, 180, 0.32), inset 0 0 28px rgba(64, 206, 180, 0.10); }
}
.live-narration .ln-head {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--jade);
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(64, 206, 180, 0.5);
}
.live-narration .ln-body { color: var(--ink); letter-spacing: 0.02em; }
.live-narration em {
  font-style: normal;
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(217, 181, 102, 0.4);
  padding: 0 3px;
}
.live-narration em.j { color: var(--jade);  border-color: rgba(64, 206, 180, 0.5); }
.live-narration em.r { color: #ff8a78;       border-color: rgba(229, 115, 100, 0.5); }
.live-narration em.s { color: #b6cad5;       border-color: rgba(180, 200, 215, 0.4); }

/* ==========================================================
   Middle row : INPUT GAIN — GR meter — MIX
   ========================================================== */
.mid-row {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.74), rgba(4, 10, 18, 0.78));
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  box-shadow: var(--bevel-out);
}

.knob-cell {
  display: flex; align-items: center; gap: 14px;
  user-select: none;
}
.knob-cell .knob-meta {
  display: flex; flex-direction: column;
  gap: 2px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.22em;
}
.knob-cell .knob-meta .kc-label {
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(217, 181, 102, 0.4);
}
.knob-cell .knob-meta .kc-sub {
  font-family: 'Noto Serif JP', serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.knob-cell .knob-meta .kc-val {
  font-size: 16px;
  color: var(--gold-bright);
  margin-top: 4px;
}

.physical-knob {
  position: relative;
  width: 100px; height: 100px;
  cursor: ns-resize;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6));
}

/* GR meter (horizontal) */
.gr-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 0 6px;
}
.gr-meter .gr-cap {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.gr-meter .gr-cap small {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
}
.gr-bar {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  box-shadow: var(--bevel-in);
}
.gr-fill {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 0%;
  background:
    linear-gradient(90deg, rgba(64, 206, 180, 0.5), var(--gold-bright));
  box-shadow: 0 0 14px var(--gold-bright);
  transition: width 0.06s linear;
}
.gr-bar .gr-ticks {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, transparent calc(20% - 1px), rgba(245,240,230,0.12) calc(20% - 1px), rgba(245,240,230,0.12) 20%, transparent 20%),
    linear-gradient(90deg, transparent calc(40% - 1px), rgba(245,240,230,0.12) calc(40% - 1px), rgba(245,240,230,0.12) 40%, transparent 40%),
    linear-gradient(90deg, transparent calc(60% - 1px), rgba(245,240,230,0.18) calc(60% - 1px), rgba(245,240,230,0.18) 60%, transparent 60%),
    linear-gradient(90deg, transparent calc(80% - 1px), rgba(245,240,230,0.12) calc(80% - 1px), rgba(245,240,230,0.12) 80%, transparent 80%);
  pointer-events: none;
}
.gr-value {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  min-width: 80px; text-align: right;
}
.makeup-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 0 6px;
}
.makeup-row label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--jade);
}
.makeup-row label small {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 2px;
}
.makeup-row input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(64,206,180,0.4), rgba(245,216,150,0.55));
  outline: none;
}
.makeup-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 1px solid var(--gold);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(245, 216, 150, 0.6);
}
.makeup-row input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 1px solid var(--gold);
  cursor: pointer;
}
.makeup-row .mu-val {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold-bright);
  min-width: 64px; text-align: right;
}
.gr-meter-wrap {
  display: flex; flex-direction: column;
}

/* ==========================================================
   Bottom row : 4 mini displays (THRESHOLD / ATTACK / RELEASE / RATIO)
   ========================================================== */
.mini-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.mini-card {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 22, 30, 0.88), rgba(4, 10, 18, 0.94));
  border: 1px solid var(--line-soft);
  box-shadow: var(--bevel-out), inset 0 0 28px rgba(64, 206, 180, 0.04);
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 14px;
  align-items: center;
  cursor: ns-resize;
  transition: 0.18s;
}
.mini-card:hover, .mini-card.is-focused {
  border-color: var(--jade);
  box-shadow: var(--bevel-out), 0 0 24px rgba(64, 206, 180, 0.18);
}
.mini-card .mc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-card .mc-cap {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gold);
}
.mini-card .mc-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.mini-card .mc-val {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  margin-top: 4px;
  text-shadow: 0 0 14px rgba(245, 216, 150, 0.35);
  line-height: 1;
}
.mini-card .mc-unit {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.10em;
}
.mini-card .mc-status {
  font-family: 'Noto Serif JP', serif;
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--jade);
  margin-top: 4px;
}
.mini-card[data-status="weak"]   .mc-status { color: var(--weak); }
.mini-card[data-status="good"]   .mc-status { color: var(--jade); }
.mini-card[data-status="strong"] .mc-status { color: var(--gold-bright); }
.mini-card[data-status="over"]   .mc-status { color: var(--warn); }
.mini-card[data-status="weak"]   .mc-val    { color: #a0bccc; }
.mini-card[data-status="over"]   .mc-val    { color: #ff8a78; }

.mini-card .mini-knob {
  position: relative;
  width: 96px; height: 96px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.mini-card.disabled {
  opacity: 0.55;
  cursor: default;
}
.mini-card.disabled:hover {
  border-color: var(--line-soft);
  box-shadow: var(--bevel-out);
}

/* sidechain has different visual: filter shape SVG */
.mini-card.sidechain .sc-graph {
  width: 96px; height: 96px;
  position: relative;
}
.mini-card.sidechain .sc-graph svg { width: 100%; height: 100%; }

/* ==========================================================
   Bottom toggle row
   ========================================================== */
.toggle-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.74), rgba(4, 10, 18, 0.78));
  border: 1px solid var(--line-soft);
  box-shadow: var(--bevel-out);
}
.toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.6), rgba(2, 6, 14, 0.8));
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: 0.16s;
  box-shadow: var(--bevel-in);
  user-select: none;
}
.toggle:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.8), rgba(4, 10, 18, 0.9));
}
.toggle.is-active {
  border-color: var(--jade);
  background: linear-gradient(180deg, rgba(8, 32, 28, 0.85), rgba(4, 18, 14, 0.92));
  box-shadow: 0 0 18px rgba(64, 206, 180, 0.20), var(--bevel-in);
}
.toggle .t-gem {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a3a14, #1a0d04);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.6);
  flex-shrink: 0;
}
.toggle.is-active .t-gem {
  background: radial-gradient(circle at 35% 30%, #87ecd5, #1f8c79 55%, #02160f 100%);
  box-shadow: 0 0 10px rgba(64, 206, 180, 0.7), inset 0 1px 1px rgba(180, 240, 220, 0.4);
}
/* SC HPF 周波数表示 — toggle が ON の時のみ表示、 クリックで周波数を順送り */
.toggle .t-freq {
  display: none;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(245, 216, 150, 0.06);
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(245, 216, 150, 0.4);
}
.toggle.is-active .t-freq { display: inline-block; }
.toggle .t-freq:hover {
  background: rgba(245, 216, 150, 0.18);
  border-color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 216, 150, 0.7);
}
.toggle .t-label {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.toggle .t-label .t-cap {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold);
  white-space: nowrap;
}
.toggle .t-label .t-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--muted);
  white-space: nowrap;
}
.toggle .t-info {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.toggle.is-active .t-info { color: var(--jade); }
.toggle.learn {
  border-color: rgba(64, 206, 180, 0.32);
}
.toggle.learn .t-cap { color: var(--jade); }

/* ==========================================================
   Source row (audio file pickers — appended subtly)
   ========================================================== */
.source-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(8, 18, 28, 0.55);
  border: 1px solid var(--line-soft);
  flex-wrap: wrap;
  justify-content: center;
}
.source-row .src-cap {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--muted);
  font-weight: 500;
}
.file-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(8, 18, 12, 0.55);
  color: var(--ink-soft);
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  cursor: pointer;
  transition: 0.16s;
}
.file-pill:hover { border-color: var(--gold); color: var(--gold-bright); }
.file-pill input { display: none; }
.play-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(217, 181, 102, 0.12);
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: 0.16s;
}
.play-btn:hover { background: rgba(217, 181, 102, 0.22); transform: scale(1.05); }
.play-btn.is-playing {
  background: rgba(64, 206, 180, 0.18);
  border-color: var(--jade);
  color: var(--jade);
  box-shadow: 0 0 14px rgba(64, 206, 180, 0.40);
}
.export-btn {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(64, 206, 180, 0.42);
  background: linear-gradient(180deg, rgba(64, 206, 180, 0.16), rgba(17, 49, 42, 0.72));
  color: var(--jade-soft);
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  cursor: pointer;
  transition: 0.16s;
  box-shadow: inset 0 1px 0 rgba(245, 240, 230, 0.10);
}
.export-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}
.export-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.export-status {
  min-width: 90px;
  max-width: 260px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

/* ==========================================================
   Tooltip (knobs and toggles)
   ========================================================== */
.gtip {
  position: fixed;
  background: rgba(4, 12, 18, 0.97);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Noto Serif JP', serif;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.04em;
  max-width: 280px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.gtip.is-show { opacity: 1; transform: translateY(0); }
.gtip .gtip-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  margin-bottom: 6px;
}
.gtip em { font-style: normal; color: var(--jade); }

/* ==========================================================
   Learn overlay
   ========================================================== */
.learn-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: lf 0.25s ease-out;
}
@keyframes lf { from { opacity: 0; } to { opacity: 1; } }
.learn-card {
  max-width: 640px; width: 100%;
  background: linear-gradient(180deg, rgba(10, 22, 30, 0.98), rgba(4, 10, 18, 0.98));
  border: 1px solid var(--jade);
  border-radius: 14px;
  padding: 30px 36px;
  box-shadow:
    0 0 60px rgba(64, 206, 180, 0.22),
    0 0 30px rgba(217, 181, 102, 0.08);
  position: relative;
}
.learn-step {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 6px;
}
.learn-title {
  margin: 0 0 18px;
  font-family: 'Cinzel', 'Noto Serif JP', serif;
  font-size: 22px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  font-weight: 500;
}
.learn-body {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 22px;
}
.learn-body em {
  font-style: normal;
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(217, 181, 102, 0.4);
  padding: 0 3px;
}
.learn-body em.j { color: var(--jade); border-color: rgba(64, 206, 180, 0.5); }
.learn-body em.r { color: #ff8a78; border-color: rgba(229, 115, 100, 0.5); }
.learn-body em.s { color: #b6cad5; border-color: rgba(180, 200, 215, 0.4); }
.learn-body .try {
  display: block;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(64, 206, 180, 0.08);
  border-left: 2px solid var(--jade);
  border-radius: 4px;
  font-size: 13px;
  color: var(--jade);
  line-height: 1.7;
}
.learn-actions {
  display: flex; justify-content: flex-end; gap: 10px;
}
.learn-progress {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.learn-progress .lp {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(217, 181, 102, 0.18);
}
.learn-progress .lp.is-done { background: var(--jade); box-shadow: 0 0 6px var(--jade); }
.learn-progress .lp.is-active { background: var(--gold-bright); box-shadow: 0 0 8px var(--gold-bright); }

/* knob status colors (shared) */
.physical-knob[data-status="weak"]   .pk-arc-fg { stroke: var(--weak); }
.physical-knob[data-status="weak"]   .pk-pip    { fill: var(--weak); }
.physical-knob[data-status="good"]   .pk-arc-fg { stroke: var(--jade); }
.physical-knob[data-status="good"]   .pk-pip    { fill: var(--jade-soft); }
.physical-knob[data-status="strong"] .pk-arc-fg { stroke: var(--gold-bright); }
.physical-knob[data-status="strong"] .pk-pip    { fill: var(--gold-bright); }
.physical-knob[data-status="over"]   .pk-arc-fg { stroke: var(--warn); }
.physical-knob[data-status="over"]   .pk-pip    { fill: var(--warn); }
.physical-knob[data-status="idle"]   .pk-arc-fg { stroke: var(--gold); }
.physical-knob[data-status="idle"]   .pk-pip    { fill: var(--gold-bright); }

.physical-knob.is-pulse .pk-rotor {
  animation: knobpulse 0.34s ease-out;
}
@keyframes knobpulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.08); filter: drop-shadow(0 0 16px var(--gold-bright)); }
  100% { transform: scale(1); }
}

/* general */
.hidden { display: none !important; }

/* ============================================================
   z-index 修正: preset ドロップダウンが中央画面の裏に回らないように
   ============================================================ */
.header     { position: relative; z-index: 200; }
.preset-bay { position: relative; z-index: 210; }
.preset-bay.is-open { z-index: 300; }
.preset-menu { z-index: 320 !important; }

/* ============================================================
   文字サイズ拡大: 全体的に 1.3〜1.5 倍にして読みやすく
   ============================================================ */
.brand-name             { font-size: 28px !important; }
.brand-sub              { font-size: 14px !important; }
.ab-btn                 { font-size: 14px !important; padding: 6px 10px !important; min-width: 32px; }
.ab-copy                { font-size: 11px !important; padding: 6px 10px !important; }
.cap-btn .lbl           { font-size: 11px !important; letter-spacing: 0.04em; }
.lang-bay button        { font-size: 11px !important; padding: 5px 8px !important; letter-spacing: 0.10em; }
/* リセット: 他のキャプションと違って一文字級に短いのでアイコン的に縮める */
#btnReset .lbl          { letter-spacing: 0.10em; }

/* VU メーター */
.vu-col .vu-cap         { font-size: 14px !important; }
.vu-col .vu-cap small   { font-size: 11px !important; }
.vu-num                 { font-size: 14px !important; }
.vu-scale               { font-size: 11px !important; }

/* INPUT GAIN セル */
.knob-cell .kc-label    { font-size: 14px !important; }
.knob-cell .kc-sub      { font-size: 12px !important; }
.knob-cell .kc-val      { font-size: 19px !important; }

/* GR メーター */
.gr-cap                 { font-size: 14px !important; }
.gr-cap small           { font-size: 11px !important; }
.gr-value               { font-size: 32px !important; }

/* MAKE-UP スライダー */
.makeup-row label       { font-size: 14px !important; }
.makeup-row label small { font-size: 11px !important; }
.makeup-row .mu-val     { font-size: 14px !important; }

/* ミニカード */
.mini-card .mc-cap      { font-size: 17px !important; letter-spacing: 0.14em; }
.mini-card .mc-jp       { font-size: 12px !important; }
.mini-card .mc-val      { font-size: 32px !important; }
.mini-card .mc-unit     { font-size: 14px !important; }
.mini-card .mc-status   { font-size: 12px !important; }

/* トグル行 (HPF / LEARN) */
.toggle .t-cap          { font-size: 14px !important; letter-spacing: 0.18em; }
.toggle .t-jp           { font-size: 11px !important; }

/* SOURCE 行 */
.src-cap                { font-size: 15px !important; letter-spacing: 0.22em; font-weight: 500 !important; }
.file-pill              { font-size: 16px !important; padding: 11px 20px !important; }
.play-btn               { font-size: 17px !important; width: 44px !important; height: 44px !important; }
.demo-pill              { font-size: 16px !important; padding: 11px 22px !important; }
.export-btn             { font-size: 15px !important; padding: 0 22px !important; min-height: 44px !important; }
/* Player bar (desktop scaler 内) */
.player-bar__title      { font-size: 19px !important; }
.player-bar__cat        { font-size: 12px !important; padding: 5px 12px !important; }
.player-bar__time       { font-size: 18px !important; min-width: 130px !important; }

/* tooltip */
.tip                    { font-size: 13px !important; line-height: 1.6; }
.tip strong             { font-size: 14px !important; }

/* Live narration: ヘッダー (translucent jade) */
.live-narration .ln-head { font-size: 10px !important; letter-spacing: 0.28em; margin-bottom: 4px; }
.live-narration .ln-body { font-size: 13px !important; line-height: 1.55 !important; }
.live-narration { padding: 10px 16px 10px 20px !important; }

/* ============================================================
   プリセット誘導ヒント (初回のみ、操作で消える)
   ============================================================ */
.preset-hint {
  position: absolute;
  top: calc(100% + 14px);    /* preset の真下 */
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 250;
  text-align: center;
  font-family: 'Noto Serif JP', serif;
  color: var(--gold-bright);
  animation: hint-bounce 1.5s ease-in-out infinite;
}
.preset-hint-arrow {
  font-size: 28px;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(245, 216, 150, 0.8);
  margin-bottom: -2px;       /* テキストとくっつける */
  line-height: 1;
}
/* preset-bay 自体に光彩 (誘導が見えてる時のみ) */
.preset-bay:not(.is-quiet) .preset-name {
  animation: preset-glow-pulse 1.5s ease-in-out infinite;
}
@keyframes preset-glow-pulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(245, 216, 150, 0.5),
      0 0 18px rgba(245, 216, 150, 0.25);
  }
  50% {
    text-shadow:
      0 0 14px rgba(245, 216, 150, 0.95),
      0 0 30px rgba(245, 216, 150, 0.7),
      0 0 50px rgba(245, 216, 150, 0.45);
  }
}
.preset-hint-text {
  display: inline-block;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(60, 40, 10, 0.94), rgba(40, 28, 6, 0.96));
  border: 1px solid rgba(245, 216, 150, 0.7);
  border-radius: 12px;
  font-size: 17px;
  letter-spacing: 0.08em;
  font-weight: 500;
  box-shadow: 0 10px 32px rgba(0,0,0,0.7), 0 0 28px rgba(245, 216, 150, 0.35);
}
.preset-hint-text small {
  display: block;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.10em;
  margin-top: 5px;
  opacity: 0.9;
}
@keyframes hint-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -6px); }
}
.preset-bay.is-quiet .preset-hint { display: none; }

/* ============================================================
   Tutorial step hints (初心者導線: 次に触るべきノブを光らせる)
   ============================================================ */
[data-tutorial-active] {
  position: relative;
  outline: 1px solid rgba(245, 216, 150, 0.85);
  outline-offset: 2px;
  border-radius: 12px;
  animation: tutorial-pulse 1.6s ease-in-out infinite;
}
[data-tutorial-active]::after {
  content: attr(data-tutorial-text);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(80, 50, 12, 0.98), rgba(50, 30, 6, 0.99));
  border: 1px solid rgba(245, 216, 150, 0.85);
  color: var(--gold-bright);
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 18px rgba(245, 216, 150, 0.35);
  pointer-events: none;
  z-index: 260;
  animation: tutorial-bounce 1.6s ease-in-out infinite;
}
@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 216, 150, 0); }
  50%      { box-shadow: 0 0 22px rgba(245, 216, 150, 0.45); }
}
@keyframes tutorial-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

/* ============================================================
   Keyboard focus visibility (アクセシビリティ)
   ============================================================ */
.physical-knob:focus,
.physical-knob:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
  border-radius: 50%;
}
.physical-knob:focus:not(:focus-visible) { outline: none; }

/* ============================================================
   MOBILE LAYOUT (≤ 768px)
   スマホ専用縦レイアウト。 scaler を解除し、 native flow に戻す。
   1880×1700 デザイン → スマホは 100vw 縦並び。
   ============================================================ */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
  }
  .viewport-host {
    width: 100vw;
    height: auto;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .scaler {
    /* JS は scale を 1 に固定 (fit() でモバイル判定) */
    transform: none !important;
    width: 100vw !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .panel {
    width: 100vw;
    height: auto;
    padding: 8px 6px 16px;
    border-radius: 0;
    box-shadow: none;
  }
  /* デコレーションは控えめに */
  .bolt, .filigree { display: none; }

  /* ───────── ヘッダー ───────── */
  .header {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;
  }
  .header-left { justify-content: center; }
  .brand-mark { gap: 8px; }
  .brand-mark img { height: 28px; }
  .brand-name { font-size: 13px; letter-spacing: 0.18em; }
  .brand-sub { font-size: 9px; }

  .header-center { width: 100%; }
  .preset-bay { width: 100%; }
  .preset-name {
    font-size: 16px;
    padding: 10px 14px;
    min-width: 0;
    flex: 1;
  }
  .preset-name small { font-size: 10px; margin-left: 6px; }

  /* preset menu はモバイルでは preset name の真下に普通の dropdown
     (高さだけ viewport に収まるよう抑える) */
  .preset-menu {
    min-width: 0 !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 60vh !important;
    transform: translateX(-50%) !important;
    -webkit-overflow-scrolling: touch;
  }

  /* ヘッダー右: 2 段折返し (横スクロールよりも気付きやすい)
     ボタン側のサイズを縮めて 2 段で全部見えるようにする */
  .header-right {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 4px 2px;
  }
  .ab-bay { flex-shrink: 0; gap: 3px; }
  .ab-btn { padding: 6px 9px !important; font-size: 11px; min-height: 32px; min-width: 28px; }
  .ab-copy { padding: 6px 8px !important; font-size: 10px; min-height: 32px; }
  .cap-btn {
    flex-shrink: 0;
    padding: 6px 8px !important;
    font-size: 10px !important;
    letter-spacing: 0.02em !important;
    min-height: 32px;
  }
  .cap-btn .gem { width: 6px !important; height: 6px !important; }
  .lang-bay { flex-shrink: 0; gap: 2px; }
  .lang-bay button { padding: 5px 7px; font-size: 10px; min-height: 32px; min-width: 24px; }

  /* ───────── メイングリッド ───────── */
  .main-grid {
    grid-template-columns: 36px 1fr 36px;
    gap: 6px;
    height: auto;
  }
  .vu-col {
    padding: 6px 4px;
    gap: 4px;
  }
  .vu-col .vu-cap { font-size: 9px !important; letter-spacing: 0.18em; }
  .vu-col .vu-cap small { font-size: 8px !important; }
  .vu-meter { width: 26px !important; min-height: 220px; }
  .vu-scale { font-size: 8px; }
  .vu-num { font-size: 11px; }

  .center-col {
    gap: 8px;
  }
  /* canvas と narration */
  .window-card {
    border-radius: 10px;
    padding: 4px;
    min-height: 280px;
  }
  .window-card canvas {
    width: 100% !important;
    height: 280px !important;
    aspect-ratio: auto;
  }
  .live-narration {
    padding: 6px 8px;
    font-size: 11px;
  }
  .ln-head { font-size: 11px; }
  .ln-body { font-size: 11px; line-height: 1.4; }

  /* ───────── mid-row: INPUT GAIN / GR / MAKEUP ───────── */
  .mid-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  .knob-cell { gap: 10px; padding: 4px; }
  .knob-cell .knob-meta { font-size: 11px; }
  .kc-label { font-size: 11px; }
  .kc-sub { font-size: 9px; }
  .kc-val { font-size: 12px; }
  .knob-cell-empty { display: none; }
  .gr-meter-stack { gap: 8px; }
  .gr-meter { padding: 8px; }
  .gr-bar { height: 18px !important; }
  .gr-cap { font-size: 11px; }
  .gr-value { font-size: 12px; }
  .makeup-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .makeup-row label { font-size: 11px; min-width: 70px; }
  .makeup-row input[type="range"] { flex: 1; min-width: 140px; }
  .mu-val { font-size: 11px; }

  /* ───────── mini-row: 4 ノブを 2x2 に ───────── */
  .mini-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }
  .mini-card {
    padding: 8px;
    gap: 8px;
  }
  .mini-card .physical-knob {
    width: 64px !important;
    height: 64px !important;
  }
  .mc-cap { font-size: 10px; }
  .mc-jp  { font-size: 9px; }
  .mc-val { font-size: 14px; }
  .mc-unit { font-size: 9px; }
  .mc-status { font-size: 9px; }

  /* INPUT GAIN ノブも縮小 */
  .knob-cell .physical-knob {
    width: 70px !important;
    height: 70px !important;
  }

  /* ───────── toggle / source ───────── */
  .toggle-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }
  .toggle {
    flex: 1;
    min-width: 130px;
    padding: 6px 10px;
  }
  .t-cap { font-size: 11px; }
  .t-jp  { font-size: 9px; }
  .t-freq { font-size: 10px; }

  .source-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    justify-content: center;
  }
  .src-cap { font-size: 10px; }
  .file-pill {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .play-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px;
  }
  .export-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .export-status {
    width: 100%;
    max-width: none;
    text-align: center;
    font-size: 10px;
  }

  /* ───────── プリセットヒント矢印は OFF (場所が違う) ───────── */
  .preset-hint {
    display: none;
  }

  /* タップ領域確保: 36px 以上 */
  button, .toggle, .ab-btn, .cap-btn { min-height: 36px; }
}

/* さらに狭い iPhone 縦 (≤ 420px) では VU 列をさらに細く */
@media (max-width: 420px) {
  .main-grid {
    grid-template-columns: 28px 1fr 28px;
    gap: 4px;
  }
  .vu-col { padding: 4px 2px; }
  .vu-meter { width: 18px !important; min-height: 180px; }
  .vu-scale span { font-size: 7px; }
  .vu-col .vu-cap { font-size: 8px !important; letter-spacing: 0.1em; }
  .panel { padding: 6px 2px 12px; }
  .cap-btn { padding: 6px 8px !important; font-size: 10px !important; }
}

/* ==========================================================
   Player bar (曲名表示 + シーク + 再生)  2026-05-06 追加
   ========================================================== */
.player-bar {
  display: flex; align-items: center; gap: 20px;
  margin-top: 14px;
  padding: 18px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11, 24, 36, 0.82), rgba(6, 14, 22, 0.88));
  border: 1px solid var(--line-soft);
  box-shadow:
    inset 0 1px 0 rgba(245, 216, 150, 0.10),
    0 8px 22px rgba(0, 0, 0, 0.45);
  position: relative;
}
.player-bar::before {
  content: ''; position: absolute;
  top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(64,206,180,0.35), rgba(217,181,102,0.35), transparent);
}
.player-bar__play {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(217, 181, 102, 0.14);
  color: var(--gold-bright);
  font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: 0.18s;
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
  letter-spacing: 0;
}
.player-bar__play:not(:disabled):hover {
  background: rgba(217, 181, 102, 0.24);
  transform: scale(1.05);
}
.player-bar__play:disabled { opacity: 0.4; cursor: not-allowed; }
.player-bar__play.is-playing {
  background: rgba(64, 206, 180, 0.20);
  border-color: var(--jade);
  color: var(--jade);
  box-shadow: 0 0 18px rgba(64, 206, 180, 0.50);
}
.player-bar__center {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.player-bar__title-row {
  display: flex; align-items: center; gap: 12px;
}
.player-bar__cat {
  font-family: 'Cinzel', serif;
  font-size: 11px; letter-spacing: 0.32em;
  color: var(--gold);
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  flex-shrink: 0;
  background: rgba(217, 181, 102, 0.06);
}
.player-bar__cat.is-loaded {
  color: var(--jade);
  border-color: rgba(64,206,180,0.32);
  background: rgba(64,206,180,0.08);
}
.player-bar__title {
  font-family: 'Noto Serif JP', serif;
  font-size: 17px; font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.player-bar__seek {
  display: flex; align-items: center; gap: 14px;
}
.player-bar__seek-bar {
  flex: 1; height: 6px;
  background: rgba(8, 18, 28, 0.7);
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  position: relative;
  cursor: pointer;
}
.player-bar__seek-bar:hover {
  border-color: rgba(217, 181, 102, 0.5);
}
.player-bar__seek-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--jade) 0%, var(--gold-bright) 100%);
  border-radius: 999px;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(64,206,180,0.4);
}
.player-bar__seek-handle {
  position: absolute;
  top: 50%; left: 0%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(245,216,150,0.65);
  transform: translate(-50%, -50%);
  transition: left 0.08s linear;
  pointer-events: none;
  opacity: 0;
}
.player-bar__seek-bar:hover .player-bar__seek-handle,
.player-bar__seek-bar.is-active .player-bar__seek-handle { opacity: 1; }
.player-bar__time {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 16px;
  color: var(--muted);
  min-width: 110px; text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

/* DEMO チップ (n142, n74, n79) */
.demo-pill {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 18, 28, 0.55);
  color: var(--ink-soft);
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.16s;
}
.demo-pill:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(217, 181, 102, 0.10);
  transform: translateY(-1px);
}
.demo-pill.is-active {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(64, 206, 180, 0.16);
  box-shadow: 0 0 14px rgba(64, 206, 180, 0.32);
}

.source-row__sep {
  display: inline-block;
  width: 1px; height: 22px;
  background: var(--line-soft);
  margin: 0 4px;
}

/* モバイル */
@media (max-width: 720px) {
  .player-bar {
    flex-direction: column; align-items: stretch; gap: 10px;
    padding: 10px 12px;
  }
  .player-bar__play {
    align-self: center;
    width: 44px; height: 44px;
  }
  .player-bar__title { font-size: 13px; }
  .player-bar__time { font-size: 11px; min-width: 80px; }
  .demo-pill { font-size: 11px; padding: 6px 11px; }
}
