/* Tonic — dialogs, file-drop veil, export / import / projects / palette. */

.file-veil { position: fixed; inset: 0; z-index: 3500; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, rgba(14, 16, 40, .55)); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.file-veil.on { opacity: 1; }
.file-veil > div { display: grid; gap: 6px; justify-items: center; padding: 44px 64px; border-radius: 24px; border: 2px dashed rgba(255, 255, 255, .7); color: #fff; text-align: center; background: rgba(255, 255, 255, .06); transform: scale(.96); transition: transform .35s var(--ease-spring); }
.file-veil.on > div { transform: none; }
.file-veil b { font-size: 20px; letter-spacing: -.02em; } .file-veil span { opacity: .8; font-weight: 500; }

.dl-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; min-height: 36px; }
.dl-row > label { font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.dl-ctl { display: flex; align-items: center; gap: 12px; min-width: 0; } .dl-ctl .field { flex: 1; }
.dl-ctl .slider { flex: 1; } .gen-lbl { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.ex-hint { font-size: 12px; color: var(--muted); font-weight: 500; } .ex-hint b { color: var(--ink); font-family: var(--mono); font-weight: 500; }

/* export */
.modal-card.export { width: min(820px, 100%); }
.ex-layout { display: grid; grid-template-columns: 236px 1fr; gap: 22px; min-height: 380px; }
.ex-nav { display: grid; gap: 5px; align-content: start; }
.ex-tab { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 13px; text-align: left; color: var(--ink-2); transition: background .15s, color .15s, transform .2s var(--ease-out); }
.ex-tab:hover { background: var(--panel-3); } .ex-tab.on { background: var(--accent-ghost); color: var(--accent); }
.ex-tab b { display: block; font-weight: 800; font-size: 13px; letter-spacing: -.01em; } .ex-tab small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.ex-tab .ico { flex: none; }
.ex-pane { display: grid; gap: 16px; align-content: start; min-width: 0; } .ex-pane.in { animation: pane-in .4s var(--ease-out); }
.ex-pane h3 { font: 800 20px/1.2 var(--sans); letter-spacing: -.02em; } .ex-lead { color: var(--muted); font-size: 13px; line-height: 1.6; font-weight: 500; max-width: 54ch; margin-top: -8px; }
.ex-stats { display: flex; gap: 8px; } .ex-stats > div { flex: 1; padding: 11px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); } .ex-stats b { display: block; font: 500 18px/1.1 var(--mono); } .ex-stats small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ex-opts { display: grid; gap: 4px; padding: 6px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.ex-opts .dl-row { grid-template-columns: 1fr auto; } .ex-opts .dl-ctl { justify-content: flex-end; }
.ex-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; } .ex-actions.col { flex-direction: column; align-items: stretch; } .ex-actions.col .btn { justify-content: flex-start; }
.drag-file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; cursor: grab; border: 1.5px dashed var(--line-2); color: var(--accent); transition: border-color .15s, background .15s; }
.drag-file:hover { border-color: var(--accent); background: var(--accent-ghost); } .drag-file:active { cursor: grabbing; }
.drag-file b { display: block; font: 700 12.5px var(--mono); color: var(--ink); } .drag-file small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.ex-progress { height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; opacity: 0; transition: opacity .2s; } .ex-progress.on { opacity: 1; }
.ex-progress i { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--accent); animation: slide 1.1s var(--ease-io) infinite; } @keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.ex-status { font-size: 12px; color: var(--muted); font-weight: 600; min-height: 18px; }
pre.chart { margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font: 500 12.5px/1.65 var(--mono); color: var(--ink); overflow: auto; max-height: 300px; white-space: pre; }

/* projects */
.proj-top { display: flex; gap: 8px; margin-bottom: 14px; } .proj-body { display: grid; gap: 6px; max-height: 52vh; overflow: auto; margin: 0 -6px; padding: 0 6px 2px; }
.proj-item { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 15px; border-radius: 13px; cursor: pointer; background: var(--panel-2); border: 1px solid var(--line); transition: background .15s, border-color .15s, transform .2s var(--ease-out); }
.proj-item:hover, .proj-item:focus-visible { background: var(--accent-ghost); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); transform: translateX(2px); } .proj-item.cur { border-color: var(--accent); }
.pi-main { flex: 1; min-width: 0; } .pi-main b { display: block; font-weight: 800; font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pi-main small { color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* shortcuts */
.modal-card.shortcuts { width: min(920px, 100%); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 22px 28px; }
.sc-group h4 { font: 800 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.sc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.sc-keys { display: inline-flex; align-items: center; gap: 6px; flex: none; } .sc-keys em { font-size: 10.5px; color: var(--faint); font-style: normal; }

/* command palette */
.cmdk-scrim { position: fixed; inset: 0; z-index: 2600; display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; background: rgba(14, 16, 40, .34); backdrop-filter: blur(5px); animation: fade-in .16s; }
.cmdk-scrim.out { opacity: 0; transition: opacity .15s; }
.cmdk { width: min(620px, calc(100vw - 28px)); border-radius: 18px; background: var(--raised); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-2); overflow: hidden; animation: modal-in .32s var(--ease-out); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 58px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-input input { flex: 1; height: 100%; background: none; border: 0; outline: none; font: 600 15px var(--sans); color: var(--ink); letter-spacing: -.01em; } .cmdk-input input::placeholder { color: var(--muted); font-weight: 500; }
.cmdk-input input:focus-visible { box-shadow: none; border-radius: 0; }
.cmdk-list { max-height: min(52vh, 420px); overflow: auto; padding: 8px; }
.cmd-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 10px 12px; border-radius: 11px; text-align: left; color: var(--ink-2); }
.cmd-item.on { background: var(--accent-ghost); color: var(--ink); } .ci-ico { width: 20px; display: grid; place-items: center; color: var(--muted); } .cmd-item.on .ci-ico { color: var(--accent); }
.ci-main { flex: 1; min-width: 0; } .ci-main b { display: block; font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; } .ci-main small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.cmdk-foot { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 600; background: var(--panel-2); } .cmdk-foot kbd { margin-right: 2px; }

/* midi / generator */
.midi-last { padding: 12px 14px; border-radius: 11px; background: var(--panel-2); border: 1px dashed var(--line-2); font: 500 12.5px var(--mono); color: var(--muted); text-align: center; }
.gen-pop { width: 340px; } .gen { padding: 16px; display: grid; gap: 14px; }
.gen-head b { display: block; font-weight: 800; font-size: 14px; letter-spacing: -.01em; } .gen-head small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 3px; font-weight: 500; }
.gen-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gen-style { padding: 10px 12px; border-radius: 11px; text-align: left; background: var(--panel-3); transition: background .15s, box-shadow .15s, transform .18s var(--ease-out); } .gen-style:hover { transform: translateY(-1px); }
.gen-style b { display: block; font-weight: 800; font-size: 12.5px; } .gen-style small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; font-weight: 500; line-height: 1.3; }
.gen-style.on { background: var(--accent-ghost); box-shadow: inset 0 0 0 1.5px var(--accent); } .gen-style.on b { color: var(--accent); }
.gen .dl-row { grid-template-columns: 62px 1fr; } .gen-actions { display: flex; gap: 8px; } .gen-actions .btn.primary { flex: 1; }
@media (max-width: 720px) { .ex-layout { grid-template-columns: 1fr; } .ex-nav { grid-template-columns: 1fr 1fr; } .dl-row { grid-template-columns: 1fr; gap: 6px; } }
