/* style-qnx.css — EXPORTアプリ(.qn-ex*)専用。JSはqn-app-export.js。style-tuner.cssの直後に読む。寸法・色・フォントはstyle-core.cssのトークンとTUNERと同仕様 */
.qn-ex {
  --qn-ex-wave: var(--accent-primary);
  --qn-ex-dim: rgba(255, 255, 255, 0.18);
  flex: 1; min-height: 0; position: relative;
  display: grid; grid-template-columns: 375px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  color: var(--text-bright); font-family: var(--font-body, 'Instrument Sans'), sans-serif; font-size: var(--fs-body);
}
.qn-ex.qn-ex-collapsed { grid-template-columns: 0 1fr; }
.qn-ex.qn-ex-collapsed .qn-ex-panel { display: none; }
.qn-ex-panel { grid-column: 1; grid-row: 1 / span 2; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.qn-ex-panel-header { padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border-subtle); font-family: var(--font-display, 'Instrument Sans'), sans-serif; font-size: var(--fs-title); font-weight: 600; letter-spacing: .5px; color: var(--icon-muted); flex-shrink: 0; }
.qn-ex-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-bottom: 16px; }
.qn-ex-fbtns { display: flex; gap: 8px; padding: 12px 16px 4px 20px; }
.qn-ex-fbtns[hidden] { display: none; }
.qn-ex-flist { padding: 8px 0; }
.qn-ex-flist .qn-ex-row { padding: 9px 16px 9px 20px; border-bottom: none; }
.qn-ex-fempty { padding: 16px 20px; margin: 0; }
.qn-ex-fempty[hidden] { display: none; }

/* ---------- ステージ ---------- */
.qn-ex-stage { grid-column: 2; grid-row: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; overflow-y: auto; }
.qn-ex-stage.is-drop { outline: 2px dashed var(--accent-primary); outline-offset: -8px; }
.qn-ex-top { display: flex; gap: 8px; flex-wrap: wrap; }
.qn-ex-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--btn-h); padding: 0 var(--btn-pad-x); border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: none; color: var(--icon-muted); font-family: var(--font-display, 'Instrument Sans'), sans-serif; font-size: var(--fs-btn); font-weight: 600; letter-spacing: .3px; white-space: nowrap; cursor: pointer; transition: background var(--dur-hover, 130ms) ease, color var(--dur-hover, 130ms) ease, transform var(--dur-press, 100ms) ease; }
.qn-ex-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.qn-ex-btn:active { transform: scale(.95); }
.qn-ex-btn.is-on, .qn-ex-btn.is-primary { background: var(--accent-primary); border-color: transparent; color: var(--text-pure-white); }
.qn-ex-btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) { .qn-ex-btn:not(.is-on):not(.is-primary):not(:disabled):hover { background: var(--bg-hover-subtle); color: var(--text-bright); } }

.qn-ex-listbox { position: relative; flex: 0 1 auto; min-height: 96px; max-height: 40vh; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); }
.qn-ex-empty { padding: 28px 20px; text-align: center; color: var(--icon-muted); }
.qn-ex-empty[hidden] { display: none; }
.qn-ex-empty p { margin: 0 0 6px; }
.qn-ex-sub { font-size: var(--fs-small); opacity: .8; }
.qn-ex-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.qn-ex-row:last-child { border-bottom: none; }
.qn-ex-detail { margin: 12px 16px 16px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 12px; }
.qn-ex-detail-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin-bottom: 2px; }
.qn-ex-detail-f { font-weight: 600; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-ex-drow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.qn-ex-dk { opacity: .6; }
.qn-ex-dv.is-off { opacity: .4; }
.qn-ex-row.is-sel { background: var(--bg-hover-subtle); }
.qn-ex-row.is-off .qn-ex-name { opacity: .45; }
.qn-ex-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-ex-src, .qn-ex-dur { font-size: var(--fs-small); color: var(--icon-muted); flex-shrink: 0; }
.qn-ex-check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px; border: 1.5px solid var(--border-strong); background: none; padding: 0; position: relative; display: inline-block; cursor: pointer; }
.qn-ex-check.is-on { background: var(--accent-primary); border-color: transparent; }
.qn-ex-check.is-on::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--text-pure-white); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.qn-ex-x { width: 28px; height: 28px; flex-shrink: 0; border: none; background: none; color: var(--icon-muted); cursor: pointer; border-radius: 50%; padding: 4px; }
.qn-ex-x svg { width: 100%; height: 100%; fill: currentColor; }
@media (hover: hover) and (pointer: fine) { .qn-ex-x:hover { background: var(--bg-hover-subtle); color: var(--text-bright); } }

/* ---------- 波形とトリム ---------- */
.qn-ex-wave { position: relative; flex: 0 0 120px; min-height: 120px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); touch-action: none; user-select: none; }
.qn-ex-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.qn-ex-wave-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--icon-muted); pointer-events: none; }
.qn-ex-handle { position: absolute; top: 0; bottom: 0; width: 28px; margin-left: -14px; cursor: ew-resize; z-index: 2; touch-action: none; }
.qn-ex-handle[hidden] { display: none; }
.qn-ex-handle i { position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--accent-primary); }
.qn-ex-handle i::after { content: ""; position: absolute; top: 50%; left: -6px; width: 14px; height: 28px; margin-top: -14px; border-radius: 7px; background: var(--accent-primary); }
.qn-ex-wave-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--icon-muted); font-size: var(--fs-small); }

/* ---------- 下部バー ---------- */
.qn-ex-bar { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--border-subtle); }
.qn-ex-barinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small); color: var(--icon-muted); }
.qn-ex-progbox { height: 4px; border-radius: 2px; background: var(--border-subtle); overflow: hidden; }
.qn-ex-progbox[hidden] { display: none; }
.qn-ex-prog { height: 100%; width: 0; background: var(--accent-primary); transition: width .15s linear; }
.qn-ex-status, .qn-ex-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-ex-run { min-width: 140px; }

/* ---------- EQ ---------- */
.qn-ex-eq { display: flex; gap: 2px; justify-content: space-between; width: 100%; padding-top: 6px; }
.qn-ex-eq-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.qn-ex-eq-g, .qn-ex-eq-f { font-size: 10px; color: var(--icon-muted); }
.qn-ex-eq-r { -webkit-appearance: slider-vertical; appearance: slider-vertical; writing-mode: vertical-lr; direction: rtl; width: 22px; height: 110px; margin: 0; accent-color: var(--accent-primary); }

/* ---------- 出力名・Library選択 ---------- */
.qn-ex-pick { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qn-ex-pick-box { width: min(480px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--bg-surface, var(--bg-primary)); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; }
.qn-ex-pick-head { padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--border-subtle); }
.qn-ex-pick-list { flex: 1; overflow-y: auto; }
.qn-ex-pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: none; background: none; color: var(--text-bright); text-align: left; cursor: pointer; font-size: var(--fs-body); }
.qn-ex-pick-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-subtle); }

/* ---------- スマホ ---------- */
@media screen and (max-width: 900px) {
  .qn-ex { display: flex; flex-direction: column; }
  .qn-ex-stage { order: 1; flex: 1; padding: 16px; }
  .qn-ex-panel { order: 2; flex: 1; border-right: none; border-top: 1px solid var(--border-subtle); }
  .qn-ex-bar { order: 3; flex-shrink: 0; padding: 10px 16px; }
  .qn-ex[data-panel="none"] .qn-ex-panel { display: none; }
  .qn-ex:not([data-panel="none"]) .qn-ex-stage, .qn-ex:not([data-panel="none"]) .qn-ex-bar { display: none; }
  .qn-ex-panel-header { font-size: var(--fs-heading); padding: 12px 16px; }
  .qn-ex-listbox { max-height: 30vh; }
}

/* ---------- 分割した範囲(Parts) ---------- */
.qn-ex-wave-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.qn-ex-segs { max-height: 28vh; overflow-y: auto; }
.qn-ex-seg { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.qn-ex-seg:last-child { border-bottom: none; }
.qn-ex-seg.is-sel { background: var(--bg-hover-subtle); }
.qn-ex-seg.is-off .qn-ex-segname { opacity: .45; }
.qn-ex-segname { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: var(--radius-md, 10px); border: 1px solid var(--border-subtle); background: none; color: var(--text-bright); font-size: var(--fs-body); font-family: inherit; }
.qn-ex-segname:focus { border-color: var(--accent-primary); outline: none; }
.qn-ex-segrange { flex-shrink: 0; font-size: var(--fs-small); color: var(--icon-muted); font-variant-numeric: tabular-nums; }
.qn-ex-x:disabled { opacity: .3; cursor: default; }

/* ---------- 範囲ごとの設定帯(チップ+アイコン)。All partsは同じ部品で一括指定 ---------- */
.qn-ex-seg { flex-direction: column; align-items: stretch; gap: 8px; }
.qn-ex-seg-top { display: flex; align-items: center; gap: 10px; }
.qn-ex-bulk { padding: 8px 12px 10px; border-bottom: 1px solid var(--border-strong); background: var(--bg-hover-subtle); display: flex; flex-direction: column; gap: 6px; }
.qn-ex-bulk-l { font-size: var(--fs-small); font-weight: 600; color: var(--text-bright); letter-spacing: .3px; }
.qn-ex-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; }
.qn-ex-chip { height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: none; color: var(--icon-muted); font-family: var(--font-display, 'Instrument Sans'), sans-serif; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background var(--dur-hover, 130ms) ease, color var(--dur-hover, 130ms) ease, transform var(--dur-press, 100ms) ease; }
.qn-ex-chip:active { transform: scale(.95); }
.qn-ex-chip.is-on { color: var(--accent-primary); border-color: var(--accent-primary); }
@media (hover: hover) and (pointer: fine) { .qn-ex-chip:hover { background: var(--bg-hover-subtle); color: var(--text-bright); } }
.qn-ex-icons { display: flex; gap: 2px; }
.qn-ex-pico { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 46px; padding: 4px 6px; border: none; border-radius: 8px; background: none; color: var(--icon-muted); cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background var(--dur-hover, 130ms) ease, color var(--dur-hover, 130ms) ease, transform var(--dur-press, 100ms) ease; }
.qn-ex-pico svg { width: 22px; height: 22px; fill: currentColor; }
.qn-ex-pico-l { font-size: 10px; font-weight: 600; letter-spacing: .2px; line-height: 1.2; white-space: nowrap; }
.qn-ex-pico:active { transform: scale(.94); }
.qn-ex-pico.is-on { color: var(--accent-primary); }
.qn-ex-pico[data-pop]:not([data-pop=""])::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 0; height: 0; border-style: solid; border-width: 0 0 6px 6px; border-color: transparent transparent var(--icon-muted) transparent; opacity: .7; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .qn-ex-pico:hover { background: var(--bg-hover-subtle); color: var(--text-bright); } .qn-ex-pico.is-on:hover { color: var(--accent-primary); } }
.qn-quickpop .qn-ex-eq { padding: 4px 0 8px; min-width: 250px; }
.qn-quickpop .qn-ex-eq-r { height: 96px; }
@media screen and (max-width: 900px) { .qn-ex-icons { width: 100%; justify-content: space-between; } .qn-ex-pico { flex: 1; min-width: 0; } }

/* ---------- v4.73.0 ファイルごとのブロック / 1ボタン+アイコン下のスイッチ ---------- */
.qn-ex-file { border-bottom: 1px solid var(--border-strong); }
.qn-ex-file:last-child { border-bottom: none; }
.qn-ex-file-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-hover-subtle); }
.qn-ex-file.is-off .qn-ex-file-head .qn-ex-name { opacity: .45; }
.qn-ex-segs { max-height: none; overflow: visible; }
.qn-ex-main { display: flex; flex-wrap: wrap; gap: 6px; }
.qn-ex-main .qn-ex-chip { height: 32px; padding: 0 14px; font-size: var(--fs-body); }
.qn-ex-main .qn-ex-chip.is-on { color: var(--accent-primary); border-color: var(--accent-primary); }
.qn-ex-sw { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qn-ex-sw .qn-set-switch { transform: scale(.72); transform-origin: center top; margin-bottom: -6px; }
.qn-ex-pico { min-width: 54px; }
.qn-ex-pico[data-pop]::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 0; height: 0; border-style: solid; border-width: 0 0 6px 6px; border-color: transparent transparent var(--icon-muted) transparent; opacity: .7; pointer-events: none; }
@media screen and (max-width: 900px) { .qn-ex-main { width: 100%; } .qn-ex-main .qn-ex-chip { flex: 1; padding: 0 8px; } .qn-ex-sw { flex: 1; } }

/* ---------- v4.74.0 サイドバー撤去・曲ごとにたためるブロック ---------- */
.qn-ex-allbox { border: 1px solid var(--border-strong); border-radius: var(--radius-md, 10px); overflow: hidden; flex-shrink: 0; }
.qn-ex-allbox .qn-ex-bulk { border-bottom: none; }
.qn-ex-files { display: flex; flex-direction: column; gap: 12px; }
.qn-ex-file { border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); overflow: hidden; }
.qn-ex-file.is-active { border-color: var(--border-strong); }
.qn-ex-file-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.qn-ex-file.is-folded .qn-ex-file-body { display: none; }
.qn-ex-file-body .qn-ex-bulk { border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); }
.qn-ex-file-body .qn-ex-segs { border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); overflow: hidden; }
.qn-ex-fold { width: 28px; height: 28px; flex-shrink: 0; border: none; background: none; color: var(--icon-muted); cursor: pointer; border-radius: 50%; padding: 2px; transition: transform var(--dur-hover, 130ms) ease; }
.qn-ex-fold svg { width: 100%; height: 100%; fill: currentColor; }
.qn-ex-file.is-folded .qn-ex-fold { transform: rotate(-90deg); }
.qn-ex-wave { flex: 0 0 120px; }
.qn-ex-save { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qn-ex-save-l { font-size: var(--fs-small); color: var(--icon-muted); }
.qn-ex-suffix-in { width: 120px; height: 32px; padding: 0 10px; border-radius: var(--radius-md, 10px); border: 1px solid var(--border-subtle); background: none; color: var(--text-bright); font-size: var(--fs-small); font-family: inherit; }
@media screen and (max-width: 900px) {
  .qn-ex { display: flex; flex-direction: column; }
  .qn-ex-bar { flex-wrap: wrap; gap: 8px 12px; }
  .qn-ex-barinfo { flex-basis: 100%; }
  .qn-ex-suffix-in { width: 90px; }
  .qn-ex-file-body { padding: 8px; }
}
