/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Modern Skin (2026-11-10)
   洗練されたモダンな外観への上書きレイヤー。styles.css の後で読み込む。
   方針:
   - パネルは「線」ではなく「面」で見せる (ソリッドなサーフェス階層)
   - 色は使わない。白・グレー階調 + 選択状態の白反転のみ
   - フォントはシステムサンセリフに統一し、数値とログだけ等幅
   - グラデーション文字・発光・ノイズ・虹色バッジなどの装飾を排除
   旧デザインへは DESIGN: CLASSIC トグル (link の disabled) で戻れる。
   ════════════════════════════════════════════════════════════════ */

:root {
  --m-bg: #0a0a0c;
  --m-panel: #131316;
  --m-raised: #1a1a1f;
  --m-inset: #0e0e11;
  --m-line: #222228;
  --m-line2: #2e2e36;
  --m-text: #f4f4f5;
  --m-sub: #a3a3ab;
  --m-dim: #63636c;
  --m-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --m-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Hiragino Kaku Gothic ProN", monospace;
}

/* ── 地とタイポグラフィ ── */
body { background: var(--m-bg) !important; }
body::before, body::after { display: none !important; }
body, body * { font-family: var(--m-font) !important; }
.pval, .log, .chord-box, .chord-status, .ui-macro-val, .sv,
[class*="readout"], [class*="lcd"] { font-family: var(--m-mono) !important; }
::selection { background: #f4f4f5; color: #101013; }

/* ── ヘッダー: 静かなマストヘッド ── */
header { text-align: left !important; padding: 30px 0 26px !important; }
.sys-tag { font-size: 10px !important; letter-spacing: .28em !important; color: var(--m-dim) !important; opacity: 1 !important; margin-bottom: 10px !important; }
h1 {
  font-size: clamp(30px, 4.2vw, 44px) !important; font-weight: 750 !important;
  letter-spacing: .01em !important; line-height: 1.05 !important;
  background: none !important; -webkit-text-fill-color: var(--m-text) !important; color: var(--m-text) !important;
}
.sub { font-size: 11px !important; letter-spacing: .24em !important; color: var(--m-dim) !important; margin-top: 10px !important; }
#osc { opacity: .5 !important; height: 56px !important; }

/* ── パネル: ソリッドな面 ── */
.panel {
  background: var(--m-panel) !important;
  border: 1px solid var(--m-line) !important;
  border-radius: 8px !important;
  padding: 24px !important;
}
.panel-top { display: none !important; }
.g2, .g3 { gap: 18px !important; margin-bottom: 18px !important; }
.full, .mb16 { margin-bottom: 18px !important; }

.sec-label {
  font-size: 11px !important; font-weight: 650 !important;
  letter-spacing: .16em !important; color: var(--m-sub) !important;
  text-transform: uppercase; margin-bottom: 18px !important;
}
.sec-label::before { content: none !important; display: none !important; }

/* ── コード入力 ── */
.chord-box {
  background: var(--m-inset) !important; border: 1px solid var(--m-line2) !important;
  border-radius: 8px !important; font-size: 25px !important; letter-spacing: 1px !important;
  color: var(--m-text) !important; caret-color: var(--m-text) !important; padding: 16px 20px !important;
}
.chord-box:focus { border-color: #4a4a55 !important; box-shadow: 0 0 0 3px rgba(244,244,245,.08) !important; }
.chord-status { font-size: 11px !important; letter-spacing: .04em !important; color: var(--m-dim) !important; }

/* ── ラベルと値 ── */
.param-label { font-size: 11px !important; letter-spacing: .05em !important; color: var(--m-sub) !important; text-transform: none !important; }
.pval { font-size: 12px !important; color: var(--m-text) !important; }

/* ── スライダー: 太いトラックとソリッドなツマミ ── */
.slider, input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px !important; border-radius: 2px !important; background: #26262d !important;
}
.slider::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #f4f4f5; border: 1px solid #000;
  box-shadow: 0 1px 3px rgba(0,0,0,.55) !important; cursor: pointer;
}
.slider::-moz-range-thumb, input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: #f4f4f5; border: 1px solid #000;
  box-shadow: 0 1px 3px rgba(0,0,0,.55) !important; cursor: pointer;
}

/* ── トグルスイッチ: ソリッド ── */
.tog {
  width: 40px !important; height: 22px !important; border-radius: 11px !important;
  background: #2b2b33 !important; transition: background .18s !important;
}
.tog::after { width: 16px !important; height: 16px !important; top: 3px !important; left: 3px !important; background: #8f8f98 !important; box-shadow: none !important; }
.tog.on { background: #f4f4f5 !important; }
.tog.on::after { background: #131316 !important; transform: translateX(18px); }
.tog-name { font-size: 12px !important; letter-spacing: .02em !important; color: var(--m-text) !important; }
.tog-desc { font-size: 10.5px !important; color: var(--m-dim) !important; letter-spacing: .01em !important; }

/* ── ボタン総則: 面で押し、選択は白反転 ── */
.g-btn, .s-btn, .t-tab, .ab-btn, .c-btn, .ep-btn, .oct-pill,
[class*="-btn"] {
  box-shadow: none !important; text-shadow: none !important;
}
button, .g-btn {
  background: var(--m-raised) !important; border: 1px solid var(--m-line2) !important;
  border-radius: 6px !important; color: var(--m-sub) !important;
  font-size: 11.5px !important; letter-spacing: .05em !important;
}
button:hover, .g-btn:hover { background: #222229 !important; color: var(--m-text) !important; }
.g-btn { padding: 13px 10px !important; }
.g-btn.on { background: #f4f4f5 !important; color: #121215 !important; border-color: #f4f4f5 !important; font-weight: 650; }

/* セクション内の選択式ボタン群 (各エンジンのモード/プリセット類) */
[class*="-btn"].on, [class*="-pill"].on, [class*="-tog"].on, .t-tab.on {
  background: #f4f4f5 !important; color: #121215 !important;
  border-color: #f4f4f5 !important; box-shadow: none !important;
}
[class*="-btn"], [class*="-pill"] { border-radius: 6px; }

/* タブ */
.t-tab { background: transparent !important; border-bottom: 2px solid transparent !important; font-size: 11px !important; letter-spacing: .08em !important; color: var(--m-dim) !important; border-radius: 0 !important; }
.t-tab.on { background: var(--m-raised) !important; color: var(--m-text) !important; border-bottom: 2px solid #f4f4f5 !important; }

/* ── バッジとチップ: 無地のタグに統一 (虹色を消す) ── */
.badge {
  background: var(--m-raised) !important; border: 1px solid transparent !important;
  border-radius: 4px !important; color: var(--m-sub) !important;
  font-size: 9.5px !important; letter-spacing: .06em !important; padding: 2px 7px !important;
}
[style*="border-color:#"], [style*="border-color: #"],
[style*="border:1px solid #"], [style*="border: 1px solid #"] {
  border-color: var(--m-line2) !important;
}
[style*="color:#"], [style*="color: #"] { color: var(--m-sub) !important; }
[style*="background:rgba("], [style*="background: rgba("] { background-color: var(--m-raised) !important; }

/* セクション固有のアクセント色 (クラス経由) も階調へ寄せる */
[class*="-badge"], .cca-lane-label, .nr-path-result, .pcs-hover-detail {
  color: var(--m-sub) !important; border-color: var(--m-line2) !important;
  background: var(--m-raised) !important; box-shadow: none !important;
}
.nr-cur-chord, .sp-score-value { color: var(--m-text) !important; }

/* ── 入力・セレクト ── */
input[type="text"], input[type="number"], select, textarea {
  background: var(--m-inset) !important; border: 1px solid var(--m-line2) !important;
  border-radius: 6px !important; color: var(--m-text) !important;
  font-size: 12px !important; letter-spacing: .02em !important;
}
select option { background: #17171b; color: var(--m-text); }

/* ── ログ ── */
.log {
  background: var(--m-inset) !important; border: 1px solid var(--m-line) !important;
  border-radius: 8px !important; font-size: 11px !important; line-height: 1.9 !important;
  color: #8e8e97 !important; letter-spacing: .01em !important;
}

/* ── キャンバスの受け面 ── */
canvas { border-radius: 6px; }

/* ── スクロールバー ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b2b32; border-radius: 5px; border: 2px solid var(--m-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ── UI 改善レイヤー (69) と生成バーも同じ面で ── */
#uiControlBar, #genBar, #uiMacroPanel {
  background: rgba(17,17,20,.94) !important; border-color: var(--m-line) !important;
}
.ui-view-btn { background: var(--m-raised) !important; border-color: var(--m-line2) !important; color: var(--m-sub) !important; border-radius: 6px !important; }
.ui-view-btn.on { background: #f4f4f5 !important; color: #121215 !important; border-color: #f4f4f5 !important; }
#genBar button.primary { background: #f4f4f5 !important; color: #121215 !important; border-color: #f4f4f5 !important; font-weight: 650; }
.status-chip { background: var(--m-raised) !important; border-color: transparent !important; color: var(--m-sub) !important; border-radius: 4px !important; }

/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Noise-standard refine (2026-11-13)
   出荷済み Noise (Lien系) の作法へ寄せる上書きレイヤー:
   - 56px の静かなセンターヘッダー (細字タイトル + 細いオシロ帯)
   - フレームレス: 罫線を消し、面・角丸12px・影だけで見せる
   - ボタンはテキスト型 (塗りだけ)、選択中だけ白反転
   - 入力は Noise のコントロール面 #171717、フォーカスで #262626
   - 下部生成バーは Noise ツールバー (blur + 影、1行固定)
   - セクションは見出しクリックで折りたたみ (84-noise-ui.js)
   生成・保存・配線には一切触れない。DESIGN: CLASSIC で従来へ戻る。
   ════════════════════════════════════════════════════════════════ */

/* ── 地と余白: Noise の panel gap 20 / padding 24 ── */
body { padding-bottom: 76px !important; }
.wrap { max-width: 1280px !important; padding: 0 24px 32px !important; }
@media (max-width: 768px) { .wrap { padding: 0 16px 32px !important; } }

/* ── ヘッダー: 56px センタータイトル + 細いオシロ帯 ── */
header { position: relative; text-align: center !important; padding: 0 0 12px !important; }
.sys-tag { display: none !important; }
.sub { display: none !important; }
h1 {
  font-size: 15px !important; font-weight: 300 !important;
  letter-spacing: .2em !important; line-height: 56px !important;
  color: rgba(255,255,255,.78) !important; -webkit-text-fill-color: rgba(255,255,255,.78) !important;
  background: none !important; margin: 0 !important; white-space: nowrap;
}
#osc { height: 36px !important; margin: 2px 0 0 !important; opacity: .38 !important; border-radius: 0 !important; }
header .ecb-preset-btn {
  float: none !important; position: absolute; top: 12px;
  margin: 0 !important; z-index: 2;
}
#readableToggle { right: 0; }
#designToggle { right: 118px; }
@media (max-width: 760px) {
  h1 { line-height: 1.25 !important; padding-top: 46px; font-size: 14px !important; }
  #designToggle { right: auto; left: 0; }
  #osc { height: 28px !important; }
}

/* ── フレームレスな面: パネル / ECB / 注入バー ── */
.panel, .ecb {
  border: 0 !important; border-radius: 12px !important;
  background: #131316 !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.45) !important;
  padding: 24px !important;
}
.ecb::before { display: none !important; }
.g2, .g3 { gap: 20px !important; margin-bottom: 20px !important; }
.full, .mb16 { margin-bottom: 20px !important; }
.panel button, .panel input, .panel select, .panel textarea,
.ecb button, .ecb input, .ecb select,
header button, #uiControlBar button, #uiControlBar input {
  border: 0 !important;
}
/* ECB 内部の小グループも面で受ける */
.ecb-group { border: 0 !important; border-radius: 8px !important; background: rgba(255,255,255,.03) !important; }
.ecb-status { border-top: 0 !important; }
.ecb-badge { border: 0 !important; border-radius: 6px !important; background: #1a1a1f !important; }
.tog-row { border-bottom: 0 !important; }
.midi-in-box { border-top: 0 !important; }
.theory-tabs { border: 0 !important; border-radius: 8px !important; background: #171717 !important; }
.t-tab { border: 0 !important; }

/* ── セクション見出し: Noise の head (12px / 600 / .12em) + 折りたたみ ── */
.sec-label {
  font-size: 12px !important; font-weight: 600 !important;
  letter-spacing: .12em !important; color: rgba(255,255,255,.72) !important;
  margin-bottom: 16px !important; cursor: pointer; user-select: none;
}
.sec-label::after {
  content: "▾"; margin-left: auto; font-size: 11px;
  color: rgba(255,255,255,.45); transition: transform .2s ease;
}
.panel.collapsed .sec-label { margin-bottom: 0 !important; }
.panel.collapsed .sec-label::after { transform: rotate(-90deg); }
.panel.collapsed > *:not(.sec-label) { display: none !important; }
.ecb-title {
  font-size: 12px !important; font-weight: 600 !important;
  letter-spacing: .12em !important; color: rgba(255,255,255,.72) !important;
}
.ecb-group-label { font-size: 10px !important; letter-spacing: .14em !important; }
.ecb-label { font-size: 11px !important; }
.meikyo-panel-tools { display: flex; gap: 4px; justify-content: flex-end; margin: 0 0 10px; }
.meikyo-panel-tools button {
  border: 0; background: transparent; color: rgba(255,255,255,.45);
  font-size: 10px; letter-spacing: .12em; padding: 6px 10px; border-radius: 6px;
  cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
.meikyo-panel-tools button:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── ボタン: Noise テキスト型。塗りだけ、選択中は白反転 ── */
button, .g-btn, .chip, .s-btn, .c-btn, .ep-btn, .oct-pill,
.ecb-preset-btn, .seed-btn, .midi-in-btn, .btn-gen-ab, .ab-btn {
  border-radius: 8px !important; box-shadow: none !important; text-shadow: none !important;
}
.chip, .s-btn, .c-btn, .ep-btn, .oct-pill, .ecb-preset-btn,
.seed-btn, .midi-in-btn, .btn-gen-ab, .ab-btn, .ls-pre-btn, .ls-grow-btn,
.hum-mode-btn, .mkv-bias-btn, .mkv-scale-btn {
  background: #1a1a1f !important; color: #a3a3ab !important;
  font-size: 11px !important; letter-spacing: .04em !important;
  padding: 7px 11px !important;
}
.chip:hover, .s-btn:hover, .c-btn:hover, .ep-btn:hover, .oct-pill:hover,
.ecb-preset-btn:hover, .seed-btn:hover, .midi-in-btn:hover,
.btn-gen-ab:hover, .ab-btn:hover { background: #26262d !important; color: #fff !important; }
.g-btn { background: #1a1a1f !important; }
.g-btn:hover { background: #26262d !important; }
.chip.on, .s-btn.on, .c-btn.on, .ep-btn.on, .oct-pill.on, .ab-btn.on,
.g-btn.on, .ls-pre-btn.on, .ls-grow-btn.on, .hum-mode-btn.on,
.mkv-bias-btn.on, .mkv-scale-btn.on, .at-type-btn.on {
  background: #f5f5f5 !important; color: #000 !important; font-weight: 600;
}
.badge { border: 0 !important; border-radius: 6px !important; background: #1a1a1f !important; }

/* ── 生成ボタン: Noise のプライマリ (白塗り) ── */
.btn-gen {
  background: #f5f5f5 !important; color: #000 !important; border: 0 !important;
  border-radius: 8px !important; font-size: 13px !important; font-weight: 600;
  letter-spacing: .1em !important; padding: 15px 18px !important;
}
.btn-gen::before { display: none !important; }
.btn-gen:hover { opacity: .88; box-shadow: none !important; }
.btn-dl {
  background: #1a1a1f !important; color: #f4f4f5 !important; border: 0 !important;
  border-radius: 8px !important; font-size: 12px !important; letter-spacing: .08em !important;
}
.btn-dl:hover { background: #26262d !important; box-shadow: none !important; }

/* ── 入力: Noise コントロール面 ── */
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  border: 0 !important; background: #171717 !important; border-radius: 8px !important;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="search"]:focus,
select:focus, textarea:focus { background: #262626 !important; outline: none !important; }
.chord-box {
  background: #171717 !important; font-size: 22px !important;
  letter-spacing: .04em !important; padding: 14px 16px !important; border-radius: 8px !important;
}
.chord-box:focus { background: #262626 !important; box-shadow: none !important; }

/* ── スライダー / トグル: Noise の寸法へ ── */
.slider, input[type="range"] { height: 4px !important; border-radius: 9999px !important; background: #26262d !important; }
.slider::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb { width: 14px !important; height: 14px !important; box-shadow: none !important; }
.slider::-moz-range-thumb, input[type="range"]::-moz-range-thumb { width: 14px !important; height: 14px !important; box-shadow: none !important; }
.param-label { font-size: 12px !important; color: #a3a3ab !important; letter-spacing: .04em !important; }
.pval { font-size: 12px !important; font-variant-numeric: tabular-nums; }
.tog-desc { font-size: 11px !important; line-height: 1.55 !important; }
.param-desc { font-size: 11px !important; line-height: 1.6 !important; }

/* ── 読み出し面 ── */
.log { border: 0 !important; border-radius: 8px !important; background: #0e0e11 !important; }
canvas { border-radius: 8px !important; }

/* ── 階層ビュー バー (69 が注入): 浮いたカードに ── */
#uiControlBar {
  border: 0 !important; border-radius: 12px !important;
  background: rgba(10,10,12,.88) !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 28px rgba(0,0,0,.45) !important;
  padding: 12px 14px !important; top: 12px !important;
}
.ui-view-btn {
  border: 0 !important; border-radius: 8px !important; background: transparent !important;
  color: #a3a3ab !important; font-size: 12px !important; padding: 7px 12px !important; min-height: 36px;
}
.ui-view-btn:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }
.ui-view-btn.on { background: #f5f5f5 !important; color: #000 !important; font-weight: 600; }
#uiSearch { border: 0 !important; border-radius: 8px !important; background: #171717 !important; min-height: 36px; padding: 8px 10px !important; }
.status-chip { border: 0 !important; border-radius: 6px !important; background: #1a1a1f !important; padding: 4px 8px !important; }

/* ── 生成バー: Noise ツールバー (下部固定・1行・blur + 影) ── */
#genBar {
  background: rgba(0,0,0,.90) !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 0 !important; box-shadow: 0 -18px 36px rgba(0,0,0,.55) !important;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom)) !important;
  flex-wrap: nowrap !important; overflow-x: auto; justify-content: center;
  scrollbar-width: none;
}
#genBar::-webkit-scrollbar { display: none; }
#genBar button {
  border: 0 !important; border-radius: 8px !important; background: transparent !important;
  color: rgba(255,255,255,.78) !important; font-size: 12px !important;
  padding: 8px 12px !important; min-height: 36px; white-space: nowrap; flex: 0 0 auto;
}
#genBar button:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }
#genBar button.primary { background: #f5f5f5 !important; color: #000 !important; font-weight: 600; }
#genBar button.primary:hover { background: #f5f5f5 !important; color: #000 !important; opacity: .88; }
#genBarStatus { font-size: 10px !important; letter-spacing: .08em !important; white-space: nowrap; }
@media (max-width: 768px) { #genBar { justify-content: flex-start; padding-left: 16px !important; padding-right: 16px !important; } }

/* ── フッター / スクロールバー / フォーカス: Noise 寸法 ── */
footer { border-top: 0 !important; letter-spacing: .16em !important; font-size: 10px !important; opacity: .55 !important; }
::-webkit-scrollbar { width: 4px !important; height: 4px !important; }
::-webkit-scrollbar-thumb { background: #333 !important; border: 0 !important; border-radius: 2px !important; }
::-webkit-scrollbar-thumb:hover { background: #555 !important; }
button:focus-visible, input:focus-visible, select:focus-visible, .sec-label:focus-visible {
  outline: 2px solid rgba(255,255,255,.85) !important; outline-offset: 2px;
}

/* ── 2026-11-13: 全幅マルチカラムレイアウト (縦の短縮) ─────────────────
   .wrap を画面幅いっぱいに広げ、広い画面ではパネルを段組みにして
   縦スクロールを短くする。.full パネルは全幅に通す。単独カラムは
   従来どおり。CLASSIC 表示ではこのブロックごと無効になる。 */
.wrap{max-width:none !important;padding-left:28px !important;padding-right:28px !important;}
@media (min-width:1280px){
  .wrap{column-count:2;column-gap:20px;}
  .wrap>.panel{break-inside:avoid;margin-bottom:20px;}
  .wrap>div{break-inside:avoid;}
  .wrap>.panel[data-section="cc-automation"],.wrap>.panel[data-section="lorenz"],.wrap>.panel[data-section="rubato"],.wrap>.panel[data-section="spectral"],.wrap>.panel[data-section="rhythmic-canons"]{column-span:all;}
}
@media (min-width:1800px){
  .wrap{column-count:3;}
}
/* ── Theory Packs II-VI (2026-11-13): the packs live in the Rhythmic
   Canons panel, which now spans all layout columns; inside the packs,
   the toggle rows flow into 3–4 columns so an opened pack is wide and
   short instead of one tall single column. ── */
#theoryPackSec,#theoryPack3Sec,#theoryPack4Sec,#theoryPack5Sec,#theoryPack6Sec{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(430px,100%),1fr));column-gap:28px;align-items:start;}
#theoryPackSec>.tp-head,#theoryPack3Sec>.tp-head,#theoryPack4Sec>.tp-head,#theoryPack5Sec>.tp-head,#theoryPack6Sec>.tp-head,#theoryPackSec>.tog-desc,#theoryPack3Sec>.tog-desc,#theoryPack4Sec>.tog-desc,#theoryPack5Sec>.tog-desc,#theoryPack6Sec>.tog-desc{grid-column:1/-1;}
/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Lien-standard refine (2026-11-15)
   出荷済み Lien (2026-11-15 最終形) + Noise v2-lien-refine の作法へ:
   - ヘッダーは Lien の 64px ブランドバー (左 VARELSER ワードマーク /
     中央タイトル / 右 家紋エンブレム、両端はトップへのリンク)
   - 地は純黒 #000。パネルは #0a0a0a の面 (Lien の panel-header
     rgba(10,10,10,.5) の実色 / Noise の --s1 と同値) で受ける
   - READABLE / DESIGN トグルはヘッダーから ECB 内のユーティリティ行へ
   - レイアウトはマルチカラムを廃し Noise 型 CSS grid へ
     (1列 <1280px / 2列 >=1280px / 3列 >=1800px、広いパネルは全幅)
   - MODERN では装飾色を全て白・グレー階調へ (CLASSIC は不変)
   生成・保存・配線には一切触れない。DESIGN: CLASSIC で従来へ戻る。
   ════════════════════════════════════════════════════════════════ */

/* ── 地: 純黒 (Lien --bg #000000) ── */
body { background: #000 !important; }

/* ── ヘッダー: Lien 64px ブランドバー ── */
header { padding: 0 0 12px !important; text-align: left !important; }
.app-header {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 8px; position: relative; background: #000; user-select: none;
}
.app-title {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 1rem !important; line-height: 1 !important; letter-spacing: .2em !important;
  font-weight: 300 !important; color: rgba(255,255,255,.78) !important;
  -webkit-text-fill-color: rgba(255,255,255,.78) !important;
  background: none !important; margin: 0 !important; padding: 0 !important;
}
.app-brand { display: inline-flex; align-items: center; color: #fff; text-decoration: none; transition: opacity .2s ease; -webkit-tap-highlight-color: transparent; }
.app-brand:hover { opacity: .75; }
.app-brand:focus-visible { outline: 2px solid rgba(255,255,255,.4) !important; outline-offset: 3px; }
.app-brand img { height: 24px; width: auto; display: block; }
.app-brand .app-emblem { width: 28px; height: 28px; object-fit: contain; display: block; flex: none; }
@media (max-width: 640px) {
  .app-header { padding: 0 10px; }
  .app-brand img { height: 20px; }
  .app-brand .app-emblem { width: 24px; height: 24px; }
  .app-title { font-size: .8rem !important; }
}
/* 旧ブロックのトグル絶対配置 (header 内前提) を無効化 — トグルは ECB 内へ移動済み */
header .ecb-preset-btn { position: static !important; float: none !important; }
#osc { margin-top: 2px !important; }

/* ── ユーティリティ行: READABLE / DESIGN (ECB 内・右寄せ・Lien テキストボタン) ── */
.lien-util { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin: 0 0 12px; }
.lien-util .ecb-preset-btn {
  float: none !important; position: static !important; margin: 0 !important;
  background: transparent !important; color: #a3a3a3 !important;
  font-size: 11px !important; letter-spacing: .08em !important;
  padding: 8px 12px !important; min-height: 36px; border-radius: 8px !important;
}
.lien-util .ecb-preset-btn:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }

/* ── パネル面: 純黒地に #0a0a0a (フレームレス・角丸12・影は既存ブロック) ── */
.panel, .ecb { background: #0a0a0a !important; }
.sp-panel {
  border: 0 !important; border-radius: 12px !important; background: #0a0a0a !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.45) !important; padding: 18px 20px !important;
}
.sp-badge { background: #1a1a1f !important; border: 0 !important; color: #a3a3a3 !important; }
.log { background: #0a0a0a !important; }
#uiControlBar { background: rgba(0,0,0,.90) !important; }

/* ── レイアウト: マルチカラム廃止 → Noise 型 grid ── */
.wrap {
  display: grid !important; grid-template-columns: minmax(0,1fr);
  gap: 20px; align-items: start; column-count: auto !important; column-gap: normal !important;
}
@media (min-width: 1280px) { .wrap { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1800px) { .wrap { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.wrap > header, .wrap > .ecb, .wrap > .meikyo-panel-tools, .wrap > footer,
.wrap > div:has(> .gen-row),
.wrap > .panel[data-section="cc-automation"], .wrap > .panel[data-section="lorenz"],
.wrap > .panel[data-section="rubato"], .wrap > .panel[data-section="spectral"],
.wrap > .panel[data-section="rhythmic-canons"] { grid-column: 1 / -1; }
.wrap > .panel { column-span: none !important; }
.g2, .g3 { display: contents !important; }
#uiControlBar { grid-column: 1 / -1; position: relative !important; top: auto !important; }
.wrap > .panel, .wrap > .ecb, .wrap > .sp-panel,
.g2 > .panel, .g3 > .panel { margin-bottom: 0 !important; }
.meikyo-panel-tools { margin: 0 !important; }

/* ── セクション見出し / パネルツール: Lien 寸法へ統一 ── */
.sec-label { display: flex !important; align-items: center; gap: 8px; }
.meikyo-panel-tools button {
  padding: 8px 12px !important; font-size: 12px !important; line-height: 1rem !important;
  min-height: 36px; border-radius: 8px !important; letter-spacing: .04em !important;
  color: rgba(255,255,255,.78) !important; background: transparent !important;
}
.meikyo-panel-tools button:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }

/* ── 色の中和: ECB プリセット (ID 特異度で readable の [style*=] 規定にも勝つ) ── */
#engineControlBar .ecb-preset-btn { color: #a3a3a3 !important; border-color: transparent !important; }
#engineControlBar .ecb-preset-btn:hover { color: #fff !important; }

/* ── 色の中和: インライン style の飽和色 (文字・罫) ── */
  [style*="#00e5ff"],
  [style*="#00e676"],
  [style*="#8c3fff"],
  [style*="#a855f7"],
  [style*="#c084fc"],
  [style*="#9b6fff"],
  [style*="#ff9100"],
  [style*="#ff6d00"],
  [style*="#ffcc00"],
  [style*="#ffe082"],
  [style*="#d7b25a"],
  [style*="#1de9b6"],
  [style*="#00bcd4"],
  [style*="#7dd3fc"],
  [style*="#f44336"],
  [style*="#ff4081"],
  [style*="#ff5252"],
  [style*="#ff6b35"],
  [style*="#b2ebf2"],
  [style*="#9ad7e1"],
  [style*="#ffab91"],
  [style*="#ffcc80"],
  [style*="#aaffaa"],
  [style*="#0288d1"],
  [style*="#00ffff"],
  [style*="#7fff00"],
  [style*="#ff9500"],
  [style*="#ffc107"],
  [style*="#f87171"],
  [style*="#713f12"],
  [style*="#7f1d1d"],
  [style*="#b7f7d1"],
  [style*="#5b8"],
  [style*="0,229,255"],
  [style*="0,230,118"],
  [style*="140,63,255"],
  [style*="168,85,247"],
  [style*="192,132,252"],
  [style*="255,145,0"],
  [style*="255,149,0"],
  [style*="255,109,0"],
  [style*="255,204,0"],
  [style*="255,193,7"],
  [style*="29,233,182"],
  [style*="0,188,212"],
  [style*="255,64,129"],
  [style*="255,82,82"],
  [style*="127,255,0"],
  [style*="255,140,0"],
  [style*="255,183,77"],
  [style*="255,138,128"],
  [style*="0,180,100"],
  body.readable-ui [style*="#00e5ff"],
  body.readable-ui [style*="#00e676"],
  body.readable-ui [style*="#8c3fff"],
  body.readable-ui [style*="#a855f7"],
  body.readable-ui [style*="#c084fc"],
  body.readable-ui [style*="#9b6fff"],
  body.readable-ui [style*="#ff9100"],
  body.readable-ui [style*="#ff6d00"],
  body.readable-ui [style*="#ffcc00"],
  body.readable-ui [style*="#ffe082"],
  body.readable-ui [style*="#d7b25a"],
  body.readable-ui [style*="#1de9b6"],
  body.readable-ui [style*="#00bcd4"],
  body.readable-ui [style*="#7dd3fc"],
  body.readable-ui [style*="#f44336"],
  body.readable-ui [style*="#ff4081"],
  body.readable-ui [style*="#ff5252"],
  body.readable-ui [style*="#ff6b35"],
  body.readable-ui [style*="#b2ebf2"],
  body.readable-ui [style*="#9ad7e1"],
  body.readable-ui [style*="#ffab91"],
  body.readable-ui [style*="#ffcc80"],
  body.readable-ui [style*="#aaffaa"],
  body.readable-ui [style*="#0288d1"],
  body.readable-ui [style*="#00ffff"],
  body.readable-ui [style*="#7fff00"],
  body.readable-ui [style*="#ff9500"],
  body.readable-ui [style*="#ffc107"],
  body.readable-ui [style*="#f87171"],
  body.readable-ui [style*="#713f12"],
  body.readable-ui [style*="#7f1d1d"],
  body.readable-ui [style*="#b7f7d1"],
  body.readable-ui [style*="#5b8"],
  body.readable-ui [style*="0,229,255"],
  body.readable-ui [style*="0,230,118"],
  body.readable-ui [style*="140,63,255"],
  body.readable-ui [style*="168,85,247"],
  body.readable-ui [style*="192,132,252"],
  body.readable-ui [style*="255,145,0"],
  body.readable-ui [style*="255,149,0"],
  body.readable-ui [style*="255,109,0"],
  body.readable-ui [style*="255,204,0"],
  body.readable-ui [style*="255,193,7"],
  body.readable-ui [style*="29,233,182"],
  body.readable-ui [style*="0,188,212"],
  body.readable-ui [style*="255,64,129"],
  body.readable-ui [style*="255,82,82"],
  body.readable-ui [style*="127,255,0"],
  body.readable-ui [style*="255,140,0"],
  body.readable-ui [style*="255,183,77"],
  body.readable-ui [style*="255,138,128"],
  body.readable-ui [style*="0,180,100"]
  { color: #a3a3a3 !important; border-color: #262626 !important; }
/* ── 色の中和: インライン style の飽和色 (背景) ── */
  [style*="background"][style*="#00e5ff"],
  [style*="background"][style*="#00e676"],
  [style*="background"][style*="#8c3fff"],
  [style*="background"][style*="#a855f7"],
  [style*="background"][style*="#c084fc"],
  [style*="background"][style*="#9b6fff"],
  [style*="background"][style*="#ff9100"],
  [style*="background"][style*="#ff6d00"],
  [style*="background"][style*="#ffcc00"],
  [style*="background"][style*="#ffe082"],
  [style*="background"][style*="#d7b25a"],
  [style*="background"][style*="#1de9b6"],
  [style*="background"][style*="#00bcd4"],
  [style*="background"][style*="#7dd3fc"],
  [style*="background"][style*="#f44336"],
  [style*="background"][style*="#ff4081"],
  [style*="background"][style*="#ff5252"],
  [style*="background"][style*="#ff6b35"],
  [style*="background"][style*="#b2ebf2"],
  [style*="background"][style*="#9ad7e1"],
  [style*="background"][style*="#ffab91"],
  [style*="background"][style*="#ffcc80"],
  [style*="background"][style*="#aaffaa"],
  [style*="background"][style*="#0288d1"],
  [style*="background"][style*="#00ffff"],
  [style*="background"][style*="#7fff00"],
  [style*="background"][style*="#ff9500"],
  [style*="background"][style*="#ffc107"],
  [style*="background"][style*="#f87171"],
  [style*="background"][style*="#713f12"],
  [style*="background"][style*="#7f1d1d"],
  [style*="background"][style*="#b7f7d1"],
  [style*="background"][style*="#5b8"],
  [style*="background"][style*="0,229,255"],
  [style*="background"][style*="0,230,118"],
  [style*="background"][style*="140,63,255"],
  [style*="background"][style*="168,85,247"],
  [style*="background"][style*="192,132,252"],
  [style*="background"][style*="255,145,0"],
  [style*="background"][style*="255,149,0"],
  [style*="background"][style*="255,109,0"],
  [style*="background"][style*="255,204,0"],
  [style*="background"][style*="255,193,7"],
  [style*="background"][style*="29,233,182"],
  [style*="background"][style*="0,188,212"],
  [style*="background"][style*="255,64,129"],
  [style*="background"][style*="255,82,82"],
  [style*="background"][style*="127,255,0"],
  [style*="background"][style*="255,140,0"],
  [style*="background"][style*="255,183,77"],
  [style*="background"][style*="255,138,128"],
  [style*="background"][style*="0,180,100"],
  body.readable-ui [style*="background"][style*="#00e5ff"],
  body.readable-ui [style*="background"][style*="#00e676"],
  body.readable-ui [style*="background"][style*="#8c3fff"],
  body.readable-ui [style*="background"][style*="#a855f7"],
  body.readable-ui [style*="background"][style*="#c084fc"],
  body.readable-ui [style*="background"][style*="#9b6fff"],
  body.readable-ui [style*="background"][style*="#ff9100"],
  body.readable-ui [style*="background"][style*="#ff6d00"],
  body.readable-ui [style*="background"][style*="#ffcc00"],
  body.readable-ui [style*="background"][style*="#ffe082"],
  body.readable-ui [style*="background"][style*="#d7b25a"],
  body.readable-ui [style*="background"][style*="#1de9b6"],
  body.readable-ui [style*="background"][style*="#00bcd4"],
  body.readable-ui [style*="background"][style*="#7dd3fc"],
  body.readable-ui [style*="background"][style*="#f44336"],
  body.readable-ui [style*="background"][style*="#ff4081"],
  body.readable-ui [style*="background"][style*="#ff5252"],
  body.readable-ui [style*="background"][style*="#ff6b35"],
  body.readable-ui [style*="background"][style*="#b2ebf2"],
  body.readable-ui [style*="background"][style*="#9ad7e1"],
  body.readable-ui [style*="background"][style*="#ffab91"],
  body.readable-ui [style*="background"][style*="#ffcc80"],
  body.readable-ui [style*="background"][style*="#aaffaa"],
  body.readable-ui [style*="background"][style*="#0288d1"],
  body.readable-ui [style*="background"][style*="#00ffff"],
  body.readable-ui [style*="background"][style*="#7fff00"],
  body.readable-ui [style*="background"][style*="#ff9500"],
  body.readable-ui [style*="background"][style*="#ffc107"],
  body.readable-ui [style*="background"][style*="#f87171"],
  body.readable-ui [style*="background"][style*="#713f12"],
  body.readable-ui [style*="background"][style*="#7f1d1d"],
  body.readable-ui [style*="background"][style*="#b7f7d1"],
  body.readable-ui [style*="background"][style*="#5b8"],
  body.readable-ui [style*="background"][style*="0,229,255"],
  body.readable-ui [style*="background"][style*="0,230,118"],
  body.readable-ui [style*="background"][style*="140,63,255"],
  body.readable-ui [style*="background"][style*="168,85,247"],
  body.readable-ui [style*="background"][style*="192,132,252"],
  body.readable-ui [style*="background"][style*="255,145,0"],
  body.readable-ui [style*="background"][style*="255,149,0"],
  body.readable-ui [style*="background"][style*="255,109,0"],
  body.readable-ui [style*="background"][style*="255,204,0"],
  body.readable-ui [style*="background"][style*="255,193,7"],
  body.readable-ui [style*="background"][style*="29,233,182"],
  body.readable-ui [style*="background"][style*="0,188,212"],
  body.readable-ui [style*="background"][style*="255,64,129"],
  body.readable-ui [style*="background"][style*="255,82,82"],
  body.readable-ui [style*="background"][style*="127,255,0"],
  body.readable-ui [style*="background"][style*="255,140,0"],
  body.readable-ui [style*="background"][style*="255,183,77"],
  body.readable-ui [style*="background"][style*="255,138,128"],
  body.readable-ui [style*="background"][style*="0,180,100"]
  { background-color: #171717 !important; background-image: none !important; }
/* ── 色の中和 (補足): JS が style に書いた色は CSSOM が空白入り rgba/rgb で
     直列化し、16進色も rgb() へ変換するため、空白入り表記でも受ける ── */
  [style*="0, 229, 255"],
  [style*="0, 230, 118"],
  [style*="140, 63, 255"],
  [style*="168, 85, 247"],
  [style*="192, 132, 252"],
  [style*="255, 145, 0"],
  [style*="255, 149, 0"],
  [style*="255, 109, 0"],
  [style*="255, 204, 0"],
  [style*="255, 193, 7"],
  [style*="29, 233, 182"],
  [style*="0, 188, 212"],
  [style*="255, 64, 129"],
  [style*="255, 82, 82"],
  [style*="127, 255, 0"],
  [style*="255, 140, 0"],
  [style*="255, 183, 77"],
  [style*="255, 138, 128"],
  [style*="0, 180, 100"],
  body.readable-ui [style*="0, 229, 255"],
  body.readable-ui [style*="0, 230, 118"],
  body.readable-ui [style*="140, 63, 255"],
  body.readable-ui [style*="168, 85, 247"],
  body.readable-ui [style*="192, 132, 252"],
  body.readable-ui [style*="255, 145, 0"],
  body.readable-ui [style*="255, 149, 0"],
  body.readable-ui [style*="255, 109, 0"],
  body.readable-ui [style*="255, 204, 0"],
  body.readable-ui [style*="255, 193, 7"],
  body.readable-ui [style*="29, 233, 182"],
  body.readable-ui [style*="0, 188, 212"],
  body.readable-ui [style*="255, 64, 129"],
  body.readable-ui [style*="255, 82, 82"],
  body.readable-ui [style*="127, 255, 0"],
  body.readable-ui [style*="255, 140, 0"],
  body.readable-ui [style*="255, 183, 77"],
  body.readable-ui [style*="255, 138, 128"],
  body.readable-ui [style*="0, 180, 100"]
  { color: #a3a3a3 !important; border-color: #262626 !important; }
  [style*="background"][style*="0, 229, 255"],
  [style*="background"][style*="0, 230, 118"],
  [style*="background"][style*="140, 63, 255"],
  [style*="background"][style*="168, 85, 247"],
  [style*="background"][style*="192, 132, 252"],
  [style*="background"][style*="255, 145, 0"],
  [style*="background"][style*="255, 149, 0"],
  [style*="background"][style*="255, 109, 0"],
  [style*="background"][style*="255, 204, 0"],
  [style*="background"][style*="255, 193, 7"],
  [style*="background"][style*="29, 233, 182"],
  [style*="background"][style*="0, 188, 212"],
  [style*="background"][style*="255, 64, 129"],
  [style*="background"][style*="255, 82, 82"],
  [style*="background"][style*="127, 255, 0"],
  [style*="background"][style*="255, 140, 0"],
  [style*="background"][style*="255, 183, 77"],
  [style*="background"][style*="255, 138, 128"],
  [style*="background"][style*="0, 180, 100"],
  body.readable-ui [style*="background"][style*="0, 229, 255"],
  body.readable-ui [style*="background"][style*="0, 230, 118"],
  body.readable-ui [style*="background"][style*="140, 63, 255"],
  body.readable-ui [style*="background"][style*="168, 85, 247"],
  body.readable-ui [style*="background"][style*="192, 132, 252"],
  body.readable-ui [style*="background"][style*="255, 145, 0"],
  body.readable-ui [style*="background"][style*="255, 149, 0"],
  body.readable-ui [style*="background"][style*="255, 109, 0"],
  body.readable-ui [style*="background"][style*="255, 204, 0"],
  body.readable-ui [style*="background"][style*="255, 193, 7"],
  body.readable-ui [style*="background"][style*="29, 233, 182"],
  body.readable-ui [style*="background"][style*="0, 188, 212"],
  body.readable-ui [style*="background"][style*="255, 64, 129"],
  body.readable-ui [style*="background"][style*="255, 82, 82"],
  body.readable-ui [style*="background"][style*="127, 255, 0"],
  body.readable-ui [style*="background"][style*="255, 140, 0"],
  body.readable-ui [style*="background"][style*="255, 183, 77"],
  body.readable-ui [style*="background"][style*="255, 138, 128"],
  body.readable-ui [style*="background"][style*="0, 180, 100"]
  { background-color: #171717 !important; background-image: none !important; }
/* ── Markov 遷移行列: 確率ヒートマップは色相を捨て輝度だけを残す ── */
.mkv-cell { filter: grayscale(1) !important; }

/* ── 色の中和: styles.css クラス経由のアクセント (hover) ── */
  .scale-track-warn-chip:hover { border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .scale-track-warn-chip.suggest:hover { border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .scale-track-warn-chip.action:hover { border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .btn-gen.warn:hover { box-shadow:none !important; }
  .ab-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .seed-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .midi-in-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .lz-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .ca-rule-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .ca-seed-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .rb-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .rb-dir-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .sp-timbre-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .cp-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .cp-slot-del:hover { color:#fff !important; border-color:#525252 !important; }
  .cp-borrowed-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .cp-add-btn:hover { background-color:rgba(255,255,255,.08) !important; }
  .cp-mode-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .sm-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .sm-slot-del:hover { color:#fff !important; background-color:rgba(255,255,255,.08) !important; }
  .sm-add-btn:hover { background-color:rgba(255,255,255,.08) !important; }
  .sm-mode-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .nr-preset-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .nr-op-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .nr-op-btn--combo:hover { color:#fff !important; }
  .nr-op-btn--reset:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .nr-path-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .nr-add-prog-btn:hover { border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .nr-add-chord-btn:hover { border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .cv-edit-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .cv-reset-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .rc-mode-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .rc-preset-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .ji-mode-btn:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .at-type-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .at-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .cca-preset-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .pcs-mode-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .prev-btn:hover:not(:disabled) { color:#fff !important; border-color:#525252 !important; }
  .prev-mixer-toggle:hover { color:#fff !important; border-color:#525252 !important; }
  .sp-btn:hover { color:#fff !important; border-color:#525252 !important; }
  .sp-btn-save:hover { color:#fff !important; border-color:#525252 !important; background-color:rgba(255,255,255,.08) !important; }
  .sp-slot:hover { border-color:#525252 !important; }
  .sp-slot-name:hover { color:#fff !important; }
  .sp-slot-del:hover { color:#fff !important; }
/* ── 色の中和: styles.css クラス経由のアクセント (選択状態) ── */
  .scale-sync-status.on { border-color:#f5f5f5 !important; }
  .scale-sync-status.on .scale-sync-badge { border-color:#f5f5f5 !important; }
  .s-btn.linked.on { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .ab-btn.on { border-color:#f5f5f5 !important; }
  .boids-agent.active { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .boids-mode-btn.on { border-color:#f5f5f5 !important; }
  .ct-sync-btn.on { border-color:#f5f5f5 !important; }
  .lz-preset-btn.on { border-color:#f5f5f5 !important; }
  .ca-rule-btn.on { border-color:#f5f5f5 !important; }
  .ca-seed-btn.on { border-color:#f5f5f5 !important; }
  .rb-preset-btn.on { border-color:#f5f5f5 !important; }
  .rb-dir-btn.on { border-color:#f5f5f5 !important; }
  .sp-timbre-btn.on { border-color:#f5f5f5 !important; }
  .cp-preset-btn.on { border-color:#f5f5f5 !important; }
  .cp-slot.active { border-color:#f5f5f5 !important; }
  .cp-mode-btn.on { border-color:#f5f5f5 !important; }
  .sm-preset-btn.on { border-color:#f5f5f5 !important; }
  .sm-mode-btn.on { border-color:#f5f5f5 !important; }
  .nr-preset-btn.on { border-color:#f5f5f5 !important; }
  .nr-op-btn.active { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .cv-edit-btn.on { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .rc-mode-btn.on { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .rc-preset-btn.on { border-color:#f5f5f5 !important; }
  .ji-mode-btn.on { border-color:#f5f5f5 !important; box-shadow:none !important; }
  .at-type-btn.on { border-color:#f5f5f5 !important; }
  .at-preset-btn.on { border-color:#f5f5f5 !important; }
  .at-preset-btn[data-atype="lorenz"].on { border-color:#f5f5f5 !important; }
  .at-preset-btn[data-atype="rossler"].on { border-color:#f5f5f5 !important; }
  .at-preset-btn[data-atype="thomas"].on { border-color:#f5f5f5 !important; }
  .cca-preset-btn.on { border-color:#f5f5f5 !important; }
  .cca-lane.active { border-color:#f5f5f5 !important; }
  .cca-lane-tog.on { border-color:#f5f5f5 !important; }
  .cca-lane-tog.on::after { background-color:#000 !important; }
  .me-layer-btn.on { border-color:#f5f5f5 !important; }
  .pcs-mode-btn.on { border-color:#f5f5f5 !important; }
/* ── 色の中和: styles.css クラス経由のアクセント (常時) ── */
  .scale-sync-status.warn { border-color:#262626 !important; background-color:#171717 !important; }
  .scale-output-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .scale-output-badge.warn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .scale-track-warn { color:#a3a3a3 !important; }
  .scale-track-warn-chip { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .scale-track-warn-chip.suggest { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .scale-track-warn-chip.action { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .me-layer-btn.warn-focus { color:#a3a3a3 !important; border-color:#262626 !important; box-shadow:none !important; }
  .s-btn.linked { border-color:#262626 !important; box-shadow:none !important; }
  .s-btn .scale-link-dot { background-color:rgba(255,255,255,.45) !important; box-shadow:none !important; }
  .tog-row.warn-focus { border-color:#262626 !important; background-color:#171717 !important; box-shadow:none !important; }
  .seed-val { color:#a3a3a3 !important; }
  .seed-btn.locked { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .badge.pink { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .ls-arrow { color:#a3a3a3 !important; }
  .ls-add-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nh-chord-card.shad { border-color:#262626 !important; background-color:#171717 !important; }
  .ecb-label { color:#a3a3a3 !important; }
  .sv-row label { color:#a3a3a3 !important; }
  .sv-input { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sv-add-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sv-result-bar { color:#a3a3a3 !important; }
  .sv-viz-label { color:#a3a3a3 !important; }
  canvas.sv-cv { border-color:#262626 !important; background-color:#000 !important; }
  .sv-preset-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sv-info-box { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .boids-agent .ag-vel { color:#a3a3a3 !important; }
  .boids-agent .ag-bar { background-color:rgba(255,255,255,.15) !important; }
  .boids-rule-card { border-color:#262626 !important; background-color:#171717 !important; }
  canvas#boidsViz { border-color:#262626 !important; background-color:#000 !important; }
  .boids-preset-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .boids-out-card { border-color:#262626 !important; background-color:#171717 !important; }
  .boids-out-card .oc-label { color:#a3a3a3 !important; }
  .boids-info-box { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .lz-badge { color:#a3a3a3 !important; border-color:#262626 !important; }
  .lz-state { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .lz-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .ca-badge { color:#a3a3a3 !important; border-color:#262626 !important; }
  .ca-rule-name { color:#a3a3a3 !important; }
  .ca-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .rb-badge { color:#a3a3a3 !important; border-color:#262626 !important; }
  .rb-ratio { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .rb-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sp-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sp-score-value { color:#a3a3a3 !important; }
  .sp-resonant { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sp-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cp-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cp-slot-del { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cp-borrowed-src-label { color:#a3a3a3 !important; }
  .cp-add-input:focus { border-color:#525252 !important; }
  .cp-add-input.ok { border-color:#262626 !important; }
  .cp-add-input.err { border-color:#262626 !important; }
  .cp-add-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cp-info-line { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cp-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sm-badge { color:#a3a3a3 !important; border-color:#262626 !important; }
  .sm-slot-del { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sm-add-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sm-info-line { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sm-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-preset-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-op-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-op-btn--combo { color:#a3a3a3 !important; }
  .nr-op-btn--reset { color:#a3a3a3 !important; border-color:#262626 !important; }
  .nr-cur-chord { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-canvas { border-color:#262626 !important; background-color:#000 !important; }
  .nr-path-input { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-path-input:focus { border-color:#525252 !important; }
  .nr-path-arrow { color:#a3a3a3 !important; }
  .nr-path-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-path-result { color:#a3a3a3 !important; }
  .nr-add-prog-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-add-bars { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .nr-add-chord-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cv-canvas { border-color:#262626 !important; background-color:#000 !important; }
  .cv-edit-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cv-reset-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .rc-mode-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .rc-preset-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .rc-pattern-canvas { border-color:#262626 !important; background-color:#000 !important; }
  .ji-mode-btn { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .ji-deviation-canvas { border-color:#262626 !important; background-color:#000 !important; }
  .sm-diff-canvas { border-color:#262626 !important; background-color:#000 !important; }
  .at-badge { color:#a3a3a3 !important; border-color:#262626 !important; }
  .at-map-label { color:#a3a3a3 !important; }
  #atCanvas { border-color:#262626 !important; background-color:#000 !important; }
  .at-lorenz-color { color:#a3a3a3 !important; }
  .at-rossler-color { color:#a3a3a3 !important; }
  .at-thomas-color { color:#a3a3a3 !important; }
  .at-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cca-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .cca-lane-label { color:#a3a3a3 !important; }
  .cca-select:focus { border-color:#525252 !important; }
  .cca-num:focus { border-color:#525252 !important; }
  .cca-step-cell input[type=range]::-webkit-slider-thumb { background-color:#f5f5f5 !important; }
  .cca-step-cell input[type=range]::-webkit-slider-runnable-track { background-color:#171717 !important; }
  .cca-step-bar { background-color:rgba(255,255,255,.45) !important; }
  #ccaCanvas { border-color:#262626 !important; background-color:#000 !important; }
  .cca-info { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .pcs-hover-detail { color:#a3a3a3 !important; }
  .prev-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .prev-seek::-webkit-slider-thumb { border-color:#262626 !important; background-color:#f5f5f5 !important; }
  .prev-seek::-moz-range-thumb { border-color:#262626 !important; background-color:#f5f5f5 !important; }
  .prev-ch-vol::-webkit-slider-thumb { border-color:#262626 !important; background-color:#f5f5f5 !important; }
  .prev-ch-vol::-moz-range-thumb { border-color:#262626 !important; background-color:#f5f5f5 !important; }
  .sp-badge { color:#a3a3a3 !important; border-color:#262626 !important; background-color:#171717 !important; }
  .sp-input:focus { border-color:#525252 !important; }
  .sp-btn-save { color:#a3a3a3 !important; border-color:#262626 !important; }

/* ── フォーカス: リンクも Lien の :focus-visible へ ── */
a:focus-visible { outline: 2px solid rgba(255,255,255,.85) !important; outline-offset: 2px; }
/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Lien-standard refine v2 (2026-11-15)
   v1 の課題だった「また縦長」を解消し、動線を簡易化する上書き:
   - レイアウトは 95-lien-layout.js が列セグメント (LPT 詰め込み) を
     組む。ここではその受け側 (.lien-cols / .lien-col) と、JS が無い
     場合に v1 grid へ戻る前提の最小限の指定だけを持つ
   - 余白の圧縮: パネル padding 24→20 (Lien panel-body 寸法)、
     セクション見出しの下 16→12、行間・列間は 16 (Noise grid gap)
   - 理論パックは minmax 430→300px で列数を増やし縦を詰める
   - 列内では Synthesis / Macros / Just Intonation の中身を 2カラム化
   - 動線帯 (.lien-nav)、tier 説明、生成後チップ、ジャンプ先の強調
   生成・保存・配線には一切触れない。DESIGN: CLASSIC で従来へ戻る。
   ════════════════════════════════════════════════════════════════ */

/* ── 余白の圧縮 (Lien / Noise 寸法) ── */
.panel, .ecb { padding: 20px !important; }
.sec-label { margin-bottom: 12px !important; }
.ecb-group { gap: 2px !important; padding: 6px 8px !important; }
.lien-util { margin-bottom: 8px !important; }
#uiControlBar { padding: 8px 12px !important; }
.sp-panel { padding: 14px 20px !important; }

/* ── 列セグメント (95 が組む) の受け側 ── */
.wrap.lien-on { display: block !important; }
.wrap.lien-on > * { margin-bottom: 16px !important; }
.wrap.lien-on > footer { margin-bottom: 0 !important; }
.lien-cols { display: flex; gap: 16px; align-items: flex-start; }
.lien-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.lien-col > *, .lien-col > .full { margin-bottom: 0 !important; }

/* ── 理論パック: 列数を増やして縦を詰める ── */
#theoryPackSec, #theoryPack3Sec, #theoryPack4Sec, #theoryPack5Sec, #theoryPack6Sec {
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}
/* 1920px 級では行間をさらに詰める */
@media (min-width: 1800px) {
  .wrap.lien-on > * { margin-bottom: 6px !important; }
  .lien-cols { gap: 8px; }
  .lien-col { gap: 8px; }
}
header { padding-bottom: 8px !important; }
/* 生成クラスターのインライン margin-top を行間に揃える */
.wrap.lien-on > div:has(> .gen-row) { margin-top: 0 !important; }

/* ── 列内パネルの内部 2カラム (行・ブロック単位で割る) ── */
.lien-col .panel[data-section="synthesis"],
.lien-col .panel[data-section="macros"],
.lien-col .panel[data-section="just-intonation"] { column-count: 2; column-gap: 20px; }
.lien-col .panel[data-section="synthesis"] > .sec-label,
.lien-col .panel[data-section="macros"] > .sec-label,
.lien-col .panel[data-section="just-intonation"] > .sec-label { column-span: all; }
.lien-col .panel[data-section="synthesis"] > *,
.lien-col .panel[data-section="macros"] > *,
.lien-col .panel[data-section="just-intonation"] > * { break-inside: avoid; }
.lien-col .panel[data-section="just-intonation"] canvas { max-width: 100%; }
.lien-pair { break-inside: avoid; }

/* ── 動線帯: クイックスタート + 目的別ジャンプ ── */
.lien-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 10px; border-radius: 12px; background: #0a0a0a;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.lien-nav-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.lien-nav-label {
  font-size: 10px !important; letter-spacing: .14em !important; color: #737373 !important;
  text-transform: uppercase; margin-right: 2px; white-space: nowrap;
}
.lien-nav button {
  background: transparent !important; border: 0 !important; border-radius: 8px !important;
  color: rgba(255,255,255,.78) !important; font-size: 12px !important; letter-spacing: .02em !important;
  padding: 6px 10px !important; min-height: 32px; cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.lien-nav button:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }
.lien-nav .lien-adv { margin-left: auto; color: #a3a3a3 !important; }
.lien-arrow { color: #525252; font-size: 11px; }
.lien-jumps button { font-size: 11px !important; color: #a3a3a3 !important; min-height: 30px; padding: 5px 9px !important; }
.lien-jumps button:hover { color: #fff !important; }
.lien-nav-tools { margin-left: auto; display: flex; align-items: center; }
.lien-nav-tools .meikyo-panel-tools { margin: 0 !important; }
@media (max-width: 640px) {
  .lien-nav .lien-adv { margin-left: 0; }
  .lien-nav-tools { margin-left: 0; }
  .lien-nav button { padding: 6px 8px !important; }
}

/* ── tier の 1行説明 / 生成後の案内チップ / ジャンプ先の強調 ── */
#lienTierDesc { font-size: 11px; color: #a3a3a3; letter-spacing: .04em; margin-left: 8px; }
#lienGenHint {
  background: rgba(255,255,255,.14) !important; color: #fff !important;
  border-radius: 8px !important; font-weight: 600;
}
.panel, #uiControlBar, #engineControlBar, #midiPreviewPanel { scroll-margin-top: 10px; }
.lien-flash { animation: lienFlash 1.25s ease-out; }
@keyframes lienFlash {
  0% { box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 8px 28px rgba(0,0,0,.45); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 8px 28px rgba(0,0,0,.45); }
}
/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Lien typography (2026-11-15 v3)
   「フォントから Lien の真似」: v1/v2 は色と面を寄せたが、文字の
   寸法が旧態 (7–9px + 字間 2–3px のマイクロラベルが数百件) のまま
   残り、テクノ風の古さが消えなかった。ここでは MODERN の全文字を
   Lien の寸法系へ移す:
   - 書体は system-ui スタックのみ。等幅は Lien の mono スタック
     (ui-monospace, SFMono-Regular, Menlo, Consolas) のみ。
     Orbitron / Rajdhani / Share Tech Mono は使わない。
   - 最小サイズは 10px (Lien の下限)。短い英字ラベルは group-title
     寸法 (10px / 500 / .16em)、ボタン類は mini-btn 寸法 (.12em)。
   - 数値の読み出しは 12px mono + tabular-nums。
   - 日本語の説明文は字間 normal・11px・行間 1.7 (Lien help 寸法)。
   - 広い字間 + 大文字は短い英字ラベルだけに限る。
   インライン style の寸法は属性セレクタで、styles.css のクラス
   寸法は生成ルール (build.py が styles.css から機械生成) で倒す。
   生成・保存・配線には触れない。CLASSIC ではこのブロックごと無効。
   ════════════════════════════════════════════════════════════════ */
:root {
  --lien-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --lien-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── 書体の全面リセット (Lien スタックへ) ── */
body, body * { font-family: var(--lien-font) !important; }
.pval, .log, .chord-box, .chord-status, .ui-macro-val, .sv,
[class*="readout"], [class*="lcd"], .seed-input, #eucPatternDisplay {
  font-family: var(--lien-mono) !important;
}

/* ── インラインの広すぎる字間 (2–4px) を Lien 寸法へ ──
   styles-readable.css が body.readable-ui + 属性セレクタ (詳細度
   0,2,1) で寸法を上書きするため、同じ詳細度のセレクタで対抗する
   (modern は後読みなので同詳細度ならこちらが勝つ)。 */
[style*="letter-spacing:2px"], [style*="letter-spacing: 2px"],
[style*="letter-spacing:3px"], [style*="letter-spacing: 3px"],
[style*="letter-spacing:4px"], [style*="letter-spacing: 4px"],
body.readable-ui [style*="letter-spacing:2px"], body.readable-ui [style*="letter-spacing: 2px"],
body.readable-ui [style*="letter-spacing:3px"], body.readable-ui [style*="letter-spacing: 3px"],
body.readable-ui [style*="letter-spacing:4px"], body.readable-ui [style*="letter-spacing: 4px"] {
  letter-spacing: .12em !important;
}

/* ── インラインのマイクロラベル (5–9.5px) を group-title 寸法へ ── */
[style*="font-size:5px"], [style*="font-size: 5px"],
[style*="font-size:6px"], [style*="font-size: 6px"],
[style*="font-size:7px"], [style*="font-size: 7px"],
[style*="font-size:8px"], [style*="font-size: 8px"],
[style*="font-size:9px"], [style*="font-size: 9px"],
[style*="font-size:9.5px"], [style*="font-size: 9.5px"],
body.readable-ui [style*="font-size:5px"], body.readable-ui [style*="font-size: 5px"],
body.readable-ui [style*="font-size:6px"], body.readable-ui [style*="font-size: 6px"],
body.readable-ui [style*="font-size:7px"], body.readable-ui [style*="font-size: 7px"],
body.readable-ui [style*="font-size:8px"], body.readable-ui [style*="font-size: 8px"],
body.readable-ui [style*="font-size:9px"], body.readable-ui [style*="font-size: 9px"],
body.readable-ui [style*="font-size:9.5px"], body.readable-ui [style*="font-size: 9.5px"] {
  font-family: var(--lien-font) !important;
  font-size: 10px !important;
  letter-spacing: .16em !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

/* ── 数値の読み出し (id 末尾 V の慣習 + 個別指定) は 12px mono ── */
[id$="V"]:not(input), #eucPatternDisplay, #rcNV, #rcVoicesV, #jiBlendV, #jiHarmonicLimitV {
  font-family: var(--lien-mono) !important;
  font-size: 12px !important;
  letter-spacing: .02em !important;
  font-weight: 400 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.4 !important;
}

/* ── コード入力: 静かな mono 16px (Lien の seed 入力と同じ扱い。
   入力要素向け総則 (0,1,1) に勝つため #chordInput を併記) ── */
#chordInput, input.chord-box {
  font-family: var(--lien-mono) !important;
  font-size: 16px !important; font-weight: 500 !important;
  letter-spacing: .04em !important; line-height: 1.4 !important;
}
.chord-status { font-size: 11px !important; letter-spacing: .04em !important; }

/* ── 日本語の説明文: 字間 normal・行間 1.7 ── */
.tog-desc, .param-desc, [class*="-desc"], [class*="-info"] {
  letter-spacing: normal !important; line-height: 1.6 !important;
}

/* ── ビジュアライザー (index 内蔵 style の寸法を Lien へ) ── */
#vizPanel .viz-title { letter-spacing: .16em !important; }
#vizPanel .viz-badge { font-size: 10px !important; letter-spacing: .12em !important; }
#vizPanel .viz-sec { font-size: 10px !important; letter-spacing: .16em !important; font-weight: 500; }
#vizPanel .viz-sec .now { font-family: var(--lien-mono) !important; font-size: 11px !important; letter-spacing: .04em !important; }
#vizPanel .viz-legend { font-size: 11px !important; letter-spacing: normal !important; line-height: 1.7 !important; }

/* ── 残りの既知の寸法漏れ ── */
.badge { font-size: 10px !important; letter-spacing: .12em !important; }
.seed-label { font-size: 10px !important; letter-spacing: .12em !important; }
#genBarStatus { letter-spacing: .04em !important; }
/* 69 が注入するステータスチップ (styles.css に無いため生成対象外) */
.status-chip { font-size: 10px !important; letter-spacing: .08em !important; }
/* JS 注入パネルの見出し群 (11px / 字間3px) をセクションヘッド寸法へ */
.tp-head, .ab-head, .daw-head, .vl-head, .crt-head, .rnd-head {
  font-size: 12px !important; letter-spacing: .12em !important; font-weight: 600 !important;
}

/* ── 理論系の開閉 (Theory Pack + GATE TIME ブロック) ──
   .tp-head クリックでパック単位に畳む。状態は 95 が
   localStorage 'meikyoshisui_ui_packs_v1' に保存する (既定は開)。
   パネル側の折りたたみ (84) とは独立だが、全て開く/閉じるには連動。 */
.tp-head { cursor: pointer; user-select: none; display: flex; align-items: center; }
.tp-head::after, .lien-subhead::after {
  content: "▾"; margin-left: auto; padding-left: 10px;
  font-size: 11px; color: rgba(255,255,255,.45);
  transition: transform .2s ease;
}
.pack-collapsed > .tp-head::after, .pack-collapsed > .lien-subhead::after { transform: rotate(-90deg); }
.pack-collapsed > *:not(.tp-head):not(.lien-subhead) { display: none !important; }
.lien-subhead { cursor: pointer; user-select: none; display: flex; align-items: center; }

/* ── 生成ルール: styles.css の 10px 未満クラス → ラベル寸法 (10px/.16em/500) ── */
.sec-label,
.g-sub,
.scale-sync-text,
.ti-block h4,
.ti-block .sub,
.oct-label,
.param-label,
.ab-label,
.seed-label,
.seed-input,
.midi-in-select,
.midi-in-status,
footer,
.chain-label,
select.chain-sel,
.gate-indicator,
.resolve-indicator,
.ls-lstr,
.nh-field label,
.nh-prog-label,
.nh-axis-bar .axis-label,
.nh-chord-card .chord-notes-nh,
.nh-section-label,
.ecb-title,
.ecb-group-label,
.ecb-label,
.hum-meter-label,
.mkv-cell,
.mkv-axis,
.sv-row label,
.sv-op,
.sv-density-bar,
.sv-viz-label,
.boids-agent .ag-name,
.boids-agent .ag-vel,
.boids-rule-card .rc-title,
.boids-out-card .oc-label,
.sf-fc-name,
.sf-fc-cat,
.sf-cat-label,
.sf-sel-summary,
.bb-carrier-label,
.ct-iv-name,
.lz-state,
.ca-rule-name,
.ca-override-label,
.sp-resonant,
.cp-slot-bars,
.cp-borrowed-src-label,
.cp-smooth-label,
.sm-slot-scale,
.sm-slot-bars,
.sm-slot-del,
.sm-add-select,
.sm-smooth-label,
.sm-seq-seg,
.sm-diff-pair,
.at-map-label,
.at-map-select,
.at-param-label,
.cca-lane-label,
.cca-lane-cc-name,
.cca-ctrl-label,
.cca-select,
.pcs-ctrl-label,
.pcs-hover-detail,
.prev-title,
.prev-time,
.prev-ch-label,
.sp-title,
.sp-input,
.sp-slot-name,
.sp-slot-date,
.sp-slot-del {
  font-family: var(--lien-font) !important;
  font-size: 10px !important; letter-spacing: .16em !important;
  font-weight: 500 !important; line-height: 1.4 !important;
}

/* ── 生成ルール: ボタン/バッジ類 → mini-btn 寸法 (10px/.12em/500) ── */
.t-tab,
.scale-sync-badge,
.scale-output-badge,
.scale-track-warn-chip,
.s-btn,
.seed-btn,
.midi-in-btn,
.badge,
.c-btn,
.ep-btn,
.ls-add-btn,
.ls-pre-btn,
.ls-grow-btn,
.ecb-preset-btn,
.ecb-badge,
.hum-mode-btn,
.mkv-bias-btn,
.mkv-scale-btn,
.mkv-note-pill,
.sv-badge,
.sv-add-btn,
.sv-mode-btn,
.sv-preset-btn,
.boids-badge,
.boids-mode-btn,
.boids-preset-btn,
.sf-badge,
.sf-mode-btn,
.sf-preset-btn,
.bb-band-btn,
.bb-preset-btn,
.bb-mode-btn,
.ct-temp-btn,
.ct-sync-btn,
.ct-ch-btn,
.lz-badge,
.lz-preset-btn,
.ca-badge,
.ca-rule-btn,
.ca-seed-btn,
.rb-badge,
.rb-preset-btn,
.rb-dir-btn,
.sp-badge,
.sp-timbre-btn,
.cp-badge,
.cp-preset-btn,
.cp-sim-badge span,
.cp-borrowed-btn,
.cp-borrowed-btn7,
.cp-add-btn,
.cp-mode-btn,
.sm-badge,
.sm-preset-btn,
.sm-add-btn,
.sm-mode-btn,
.nr-preset-btn,
.nr-op-btn--combo,
.nr-op-btn--reset,
.nr-path-btn,
.nr-add-prog-btn,
.nr-add-chord-btn,
.cv-edit-btn,
.cv-reset-btn,
.rc-mode-btn,
.rc-preset-btn,
.ji-mode-btn,
.at-badge,
.at-type-btn,
.at-preset-btn,
.cca-badge,
.cca-preset-btn,
.me-layer-btn,
.pcs-mode-btn,
.prev-badge,
.sp-btn,
.sp-btn-auto {
  font-family: var(--lien-font) !important;
  font-size: 10px !important; letter-spacing: .12em !important;
  font-weight: 500 !important; line-height: 1.4 !important;
}

/* ── 生成ルール: 説明文クラス → help 寸法 (11px/字間normal/行間1.7) ── */
.scale-active-info,
.tog-desc,
.ls-sym-card .sc-desc,
.ls-info,
.nh-info-box,
.mkv-info,
.sv-info-box,
.boids-rule-card .rc-desc,
.boids-info-box,
.sf-fc-desc,
.sf-info-box,
.bb-beat-desc,
.bb-info,
.ct-info,
.lz-info,
.ca-info,
.rb-info,
.sp-info,
.cp-info-line,
.cp-info,
.sm-info-line,
.sm-info,
.cv-info,
.rc-info,
.ji-info,
.at-info,
.cca-info,
.pcs-info-row,
.sp-empty {
  font-family: var(--lien-font) !important;
  font-size: 11px !important; letter-spacing: normal !important;
  font-weight: 400 !important; line-height: 1.6 !important;
}

/* ── 生成ルール: 数値クラス → 12px mono / tabular ── */
.nh-slot .slot-num,
.sv-result-bar,
.rb-ratio,
.sp-score-label,
.nr-path-result,
.cca-num,
.cca-val {
  font-family: var(--lien-mono) !important;
  font-size: 12px !important; letter-spacing: .02em !important;
  font-variant-numeric: tabular-nums;
}

/* ── 高さの補正 (寸法を上げた分を Noise 寸法の余白で吸収) ──
   パネル内余白は Noise のセクション body と同じ 16px、行間は
   Noise の .field と同じ 10px。文字寸法は一切下げない。 */
.panel, .ecb { padding: 16px !important; }
.param-row { margin-bottom: 10px !important; }
.tog-row { padding: 6px 0 !important; }
.g-btn { padding: 10px !important; }
.sec-label { margin-bottom: 10px !important; }
/* 注入パネルの見出しは上マージン 26px が Lien 寸法外 — 詰める */
.tp-head, .ab-head, .daw-head, .vl-head, .crt-head, .rnd-head {
  margin-top: 14px !important; margin-bottom: 8px !important;
}
/* 1800px 以上は v2 の方針 (広い画面では行間をさらに詰める) を継続 */
@media (min-width: 1800px) {
  .param-row { margin-bottom: 8px !important; }
  .tog-row { padding: 5px 0 !important; }
}
/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Card lift (2026-11-15 v4)
   user: 「項目を並べて、カーソル合わせると浮き上がるようにしたい」。
   v1–v3 でフレームレス (罫なし・面のみ) に寄せたパネルを、Lien の
   panel-border (#262626) を持つ「カード」として輪郭づけ、hover で
   わずかに浮き上がらせる。色は使わない (影は無彩色の黒のみ)。
   - レイアウト (95) は flow 配置で transform を一切使わないため、
     浮上は独立プロパティ translate で行う。offsetHeight の計測・
     文書高・隣接パネルの位置には影響しない (検証で実測)。
   - 罫の追加で増える 2px は padding (16→15 / sp 18・20→17・19) で
     相殺し、静止時の外寸と文書高は v3 と同一に保つ。
   - hover は (hover:hover) and (pointer:fine) のデバイスのみ。
     prefers-reduced-motion では浮上そのものが発動しない。
   ════════════════════════════════════════════════════════════════ */

/* ── カードの輪郭 (静止時): Lien panel-border / 角丸12は既存を継承 ── */
.panel, .ecb {
  border: 1px solid #262626 !important;
  padding: 15px !important;
}
.sp-panel {
  border: 1px solid #262626 !important;
  padding: 17px 19px !important;
}
.panel, .ecb, .sp-panel {
  transition: translate .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out;
}

/* ── 中の項目 (チップ/カード型コントロール) の遷移 ──
   styles.css 側の transition:all を浮上に必要な分へ置き換える
   (背景・文字・罫の状態遷移は従来通り残す)。 */
.panel button[class*="-btn"]:not(.del-btn):not(.btn-gen):not(.btn-dl),
.ecb button[class*="-btn"]:not(.del-btn):not(.btn-gen):not(.btn-dl),
.panel button.chip, .ecb button.chip,
.panel .oct-pill, .panel .cca-lane-tog, .panel .bb-beat-tog,
.ecb .ecb-tog {
  transition: translate .16s ease-out, box-shadow .16s ease-out,
    background-color .16s ease-out, color .16s ease-out, border-color .16s ease-out !important;
}
/* トグルスイッチは背景遷移 (modern 既存) を保ったまま浮上を足す */
.panel .tog, .ecb .tog {
  transition: background .18s, translate .16s ease-out, box-shadow .16s ease-out !important;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* パネルカード: −3px 浮上 + 罫を一段明るく + 柔らかい黒影。
     translate はスタッキング文脈を作るため、浮いたカードが隣の
     カードの上に描かれる。lien-flash 中はリングを優先し影は触らない。 */
  .panel:hover, .ecb:hover, .sp-panel:hover {
    translate: 0 -3px;
    border-color: #404040 !important;
  }
  .panel:hover:not(.lien-flash), .ecb:hover, .sp-panel:hover {
    box-shadow: 0 16px 38px rgba(0,0,0,.6) !important;
  }
  /* 中の項目: −2px の小さな浮上 + 影 + 面を一段明るく (白の薄転写)。
     このスキンのチップ類は設計上 border:0 のため、「罫を明るく」は
     面の明度アップ + 影で表現する (罫のある項目は下で罫も上げる)。 */
  .panel button[class*="-btn"]:not(.del-btn):not(.btn-gen):not(.btn-dl):hover,
  .ecb button[class*="-btn"]:not(.del-btn):not(.btn-gen):not(.btn-dl):hover,
  .panel button.chip:hover, .ecb button.chip:hover,
  .panel .oct-pill:hover, .panel .cca-lane-tog:hover, .panel .bb-beat-tog:hover,
  .ecb .ecb-tog:hover {
    translate: 0 -2px;
    box-shadow: 0 5px 14px rgba(0,0,0,.5) !important;
    background-image: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.05)) !important;
  }
  /* 罫を持つ項目 (ピル/レーントグル) は罫も一段明るく */
  .panel .oct-pill:hover, .panel .cca-lane-tog:hover, .panel .bb-beat-tog:hover {
    border-color: #404040 !important;
  }
  /* トグルスイッチ: −1px の最小の浮上 + 影のみ */
  .panel .tog:hover, .ecb .tog:hover {
    translate: 0 -1px;
    box-shadow: 0 3px 10px rgba(0,0,0,.5);
  }
}

/* reduced-motion では遷移も止める (浮上自体は上の条件で発動しない) */
@media (prefers-reduced-motion: reduce) {
  .panel, .ecb, .sp-panel,
  .panel button[class*="-btn"], .ecb button[class*="-btn"],
  .panel button.chip, .ecb button.chip,
  .panel .tog, .ecb .tog {
    transition: none !important;
  }
}
/* ════════════════════════════════════════════════════════════════
   MEIKYOSHISUI — Family flyouts (2026-11-15 v5)
   user: 「同じ系統でまとめてカーソルで出す方式」→「全系統で試作」。
   パネルを系統ごとにまとめ、動線帯の中に系統バー (アイコン +
   ラベル + ON バッジのチップ) を置く。チップにホバーすると、
   その系統のパネルが Lien 流のフローティングパネル (フライア
   ウト) として浮いて出る。パネル自体は js/96-family-flyouts.js
   が DOM ノードのまま系統コンテナへ移す (配線・保存は不変)。
   - コア導線 (コード入力 / ジャンル / 生成 / プレビュー / 保存 /
     書き出し) はページに残り、系統パネルだけが本文から抜ける
   - 色は使わない。面 #0a0a0a / 罫 #262626 / 角丸12 / 黒の柔ら
     かい影は v1–v4 の作法を継承
   - CLASSIC では 96 がバーを畳み、95 の復元でパネルが戻る
   ════════════════════════════════════════════════════════════════ */

/* ── 系統バー (動線帯の3行目) ── */
.lien-fam-row { border-top: 1px solid rgba(255,255,255,.06); padding-top: 5px; margin-top: 3px; }
.lien-nav button.fam-chip {
  display: inline-flex !important; align-items: center; gap: 7px;
  border: 1px solid #262626 !important; border-radius: 8px !important;
  background: transparent !important; color: rgba(255,255,255,.78) !important;
  font-size: 12px !important; letter-spacing: .04em !important;
  padding: 6px 10px !important; min-height: 32px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.lien-nav button.fam-chip:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; border-color: #404040 !important; }
.lien-nav button.fam-chip.open { border-color: #525252 !important; color: #fff !important; background: rgba(255,255,255,.06) !important; }
.lien-nav button.fam-chip:focus-visible { outline: 2px solid rgba(255,255,255,.4); outline-offset: 2px; }
.fam-ico { display: inline-flex; flex: none; }
.fam-ico svg { width: 16px; height: 16px; display: block; }
.fam-badge {
  font-family: var(--lien-mono); font-size: 10px; line-height: 1;
  background: #e8e8e8; color: #111; border-radius: 999px; padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}
.fam-badge[hidden] { display: none; }
.fam-hint { font-size: 11px; color: #737373; margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) { .fam-hint { display: none; } }

/* ── フライアウト (Lien のフローティングパネル) ── */
.fam-flyout {
  position: fixed; z-index: 90; width: min(880px, 94vw);
  background: #0a0a0a; border: 1px solid #262626; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.65);
  display: flex; flex-direction: column; overflow: hidden;
  animation: famIn .14s ease-out;
}
.fam-flyout[hidden] { display: none !important; }
@keyframes famIn { from { opacity: 0; translate: 0 4px; } }
.fam-flyout-head {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 10px 14px; border-bottom: 1px solid #1c1c1c;
}
.fam-flyout-title { font-size: 12px; font-weight: 600; letter-spacing: .12em; color: rgba(255,255,255,.85); }
.fam-flyout-en { font-size: 10px; font-weight: 500; letter-spacing: .16em; color: #737373; margin-left: 6px; }
.fam-flyout-close {
  margin-left: auto; background: transparent; border: 0; color: #a3a3a3;
  font-size: 16px; line-height: 1; width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; flex: none;
}
.fam-flyout-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.fam-flyout-body {
  overflow-y: auto; padding: 14px; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.fam-flyout-body > .panel { margin: 0 !important; flex: none; width: auto; }
/* v5.1: チップ⇔フライアウト間の隙間を覆う見えない橋 (js/96 が配置)。
   .fam-flyout は overflow:hidden のため ::before では外に張り出せないので
   独立要素にする。ポインタが橋の上にいる間はフライアウト側にいる扱い。 */
.fam-bridge { position: fixed; z-index: 89; background: transparent; }
.fam-bridge[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .fam-flyout { animation: none; }
  .lien-nav button.fam-chip { transition: none; }
}

/* ── 2026-11-16 Focus B (js/97): ⌘K パレット / 集中モード / ECB サマリー / 動線圧縮 ──
   モノクロのみ。集中 ON (body.focus-on) のときだけ効く規則と、パレットの
   規則だけを足す。集中 OFF では v36 と同じ表示に戻る。 */
.focus-row { align-items: center; }
.focus-row #focusToggleBtn.on { color: #fff !important; border-color: #525252 !important; background: rgba(255,255,255,.08) !important; }
body.focus-on #lienNav .lien-steps,
body.focus-on #lienNav .lien-jumps { display: none !important; }
.ecb-summary {
  display: none; align-items: center; gap: 10px;
  padding: 6px 2px 10px; margin-bottom: 4px;
}
body.focus-on .ecb-summary { display: flex; }
.ecb-summary-text { font-size: 12px; font-weight: 600; letter-spacing: .12em; color: rgba(255,255,255,.85); }
.ecb-summary-btn {
  margin-left: auto; background: transparent; color: #d4d4d4;
  border: 1px solid #333; border-radius: 8px; padding: 6px 12px;
  font-size: 11px; font-weight: 500; letter-spacing: .08em; cursor: pointer; min-height: 32px;
}
.ecb-summary-btn:hover { background: rgba(255,255,255,.08); color: #fff; border-color: #525252; }
#engineControlBar.ecb-collapsed .ecb-header,
#engineControlBar.ecb-collapsed #ecbGrid,
#engineControlBar.ecb-collapsed #ecbStatus { display: none !important; }
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.62);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh 12px 12px;
}
.cmdk-overlay[hidden] { display: none !important; }
.cmdk-box {
  width: min(640px, 94vw); max-height: 72vh; display: flex; flex-direction: column;
  background: #0a0a0a; border: 1px solid #333; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.65); overflow: hidden;
}
#cmdkInput {
  width: 100%; background: transparent; border: 0; outline: none;
  color: #fff; font-size: 15px; padding: 14px 16px;
  border-bottom: 1px solid #1c1c1c; font-family: inherit;
}
#cmdkInput::placeholder { color: #737373; }
#cmdkList { overflow-y: auto; padding: 6px; min-height: 0; }
.cmdk-section {
  font-size: 10px; font-weight: 600; letter-spacing: .16em; color: #737373;
  padding: 10px 10px 4px;
}
.cmdk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.cmdk-row.active { background: rgba(255,255,255,.08); }
.cmdk-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cmdk-row-title { font-size: 13px; color: #e5e5e5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-row-sub { font-size: 11px; color: #8a8a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-star {
  flex: none; background: transparent; border: 0; cursor: pointer;
  color: #737373; font-size: 15px; width: 30px; height: 30px; border-radius: 8px;
}
.cmdk-star.on { color: #fff; }
.cmdk-star:hover { background: rgba(255,255,255,.08); }
.cmdk-empty { padding: 18px 12px; color: #8a8a8a; font-size: 13px; }
.cmdk-foot {
  padding: 8px 14px; border-top: 1px solid #1c1c1c;
  font-size: 11px; color: #737373; flex: none;
}
@media (prefers-reduced-motion: reduce) {
  .cmdk-box { animation: none; }
}

/* ═══ v7.0 (item 9): content-visibility ═══
   対象はフライアウト内パネルのみ。フライアウトはチップ/ボックスの
   矩形しか計測せず (js/96)、パネル個別の高さには依存しない。
   メインフローのパネルは js/95 が offsetHeight を実測して列パッキング
   するため対象外 (推定高さが混ざると配分が壊れる)。 */
.fam-flyout-body .panel {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}
