@charset "UTF-8";
/* ==========================================================================
   MIDI Transfer Studio 1.8 — design system and application shell
   Tokens → base → shell → components → views. Instrument faceplates live in
   /panels/panel.css; the controller deck in deck.css.
   ========================================================================== */

:root {
  color-scheme: dark;
  /* surfaces */
  --bg: #0b0d0f; --bg-2: #0e1114; --surface-0: #101316; --surface-1: #14181c; --surface-2: #1a1f24; --surface-3: #21272d; --surface-4: #2a3138;
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.12); --line-3: rgba(255,255,255,.2);
  /* ink */
  --ink: #e9edf0; --ink-2: #c6ced5; --ink-dim: #8d979f; --ink-faint: #5d6770;
  /* signature colours */
  --accent: #5ee6c8; --accent-2: #2fc7a8; --accent-ink: #04221b; --accent-soft: rgba(94,230,200,.12); --accent-line: rgba(94,230,200,.38);
  --amber: #ffb547; --amber-soft: rgba(255,181,71,.12);
  --live: #ff5a48; --live-soft: rgba(255,90,72,.14);
  --info: #6fb6ff; --ok: #6be38d; --error: #ff8a7a; --error-soft: rgba(255,90,72,.12);
  /* type */
  --sans: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-mono: var(--mono);
  --hw: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;
  /* geometry */
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -18px rgba(0,0,0,.9);
  --shadow-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 60px -30px rgba(0,0,0,.95), 0 0 0 1px var(--line);
  --sidebar-w: 248px; --topbar-h: 76px;
  /* legacy aliases used by older modules */
  --sidebar: var(--surface-0); --panel: var(--surface-1); --panel-raised: var(--surface-2); --line-soft: var(--line); --text: var(--ink); --muted: var(--ink-2); --dim: var(--ink-dim); --accent-hover: #86f0d9; --green: var(--ok);
}

/* ── base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; scrollbar-color: var(--surface-4) transparent; }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: radial-gradient(1200px 600px at 75% -10%, rgba(94,230,200,.06), transparent 60%), radial-gradient(900px 500px at 10% 110%, rgba(111,182,255,.04), transparent 60%), var(--bg); background-attachment: fixed; }
button, input, select, textarea { font: inherit; color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.18; letter-spacing: -.015em; }
h1 { font-size: 28px; margin-bottom: 2px; letter-spacing: -.025em; }
h2 { font-size: 22px; margin-bottom: 0; }
h3 { font-size: 17px; margin-bottom: 0; }
h4 { font-size: 14px; margin-bottom: 0; }
p { margin-bottom: 14px; }
strong { font-weight: 600; }
code, kbd, pre { font-family: var(--mono); }
kbd { font-size: 10px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-dim); }
::selection { background: rgba(94,230,200,.28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 16px; }
.eyebrow { margin: 0 0 6px; font: 600 10.5px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.muted, .quiet { color: var(--ink-dim); }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── shell ──────────────────────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.app-shell.nav-collapsed { --sidebar-w: 72px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 20;
  background: linear-gradient(180deg, rgba(20,24,28,.96), rgba(12,14,17,.98)); border-right: 1px solid var(--line); backdrop-filter: blur(14px); transition: width .2s ease; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.brand-mark { height: 30px; width: 30px; flex: none; display: flex; gap: 2.5px; align-items: center; justify-content: center; border-radius: 9px; background: linear-gradient(145deg, #1d2a28, #0f1615); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 18px rgba(94,230,200,.15); }
.brand-mark i { display: block; width: 2.6px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 7px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 13px; }
.brand-mark i:nth-child(3) { height: 18px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.brand-copy strong { font: 700 17px/1 var(--display); letter-spacing: .08em; }
.brand-copy span { font: 600 8.5px/1 var(--mono); letter-spacing: .24em; color: var(--ink-dim); }
.sidebar-rule { display: none; }
.navigation { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.nav-caption { margin: 14px 10px 6px; font: 600 9.5px/1 var(--mono); letter-spacing: .2em; color: var(--ink-faint); white-space: nowrap; }
.nav-item { position: relative; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); text-align: left; font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s; }
.nav-item svg { width: 19px; height: 19px; color: var(--ink-dim); transition: color .12s; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--ink); }
.nav-item:hover svg { color: var(--ink); }
.nav-item.active { background: linear-gradient(90deg, var(--accent-soft), rgba(94,230,200,.03)); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(94,230,200,.16); }
.nav-item.active svg { color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-index { font: 600 9px/1 var(--mono); letter-spacing: .08em; color: var(--ink-faint); padding: 3px 5px; border-radius: 4px; background: rgba(255,255,255,.035); }
.nav-item.active .nav-index { color: var(--accent); background: rgba(94,230,200,.1); }
.sidebar-bottom { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-dim); position: relative; }
.sidebar-bottom p { margin: 6px 0 8px; line-height: 1.5; }
.sidebar-meters { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font: 600 9px/1 var(--mono); letter-spacing: .12em; color: var(--ink-faint); }
.sidebar-meters span:not(.meter-led) { margin-right: 8px; }
.meter-led, .port-led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #23292e; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); transition: background .05s, box-shadow .05s; }
.meter-led.lit, .port-led.lit { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.meter-led[data-meter="out"].lit, .port-led[data-meter="out"].lit { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.local-label { display: flex; align-items: center; gap: 8px; font: 600 9.5px/1.3 var(--mono); letter-spacing: .1em; color: var(--ink-2); white-space: nowrap; }
.version { display: block; font: 500 9.5px/1 var(--mono); letter-spacing: .12em; color: var(--ink-faint); white-space: nowrap; }
.sidebar-collapse { position: absolute; right: 2px; bottom: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface-1); color: var(--ink-dim); }
.sidebar-collapse svg { width: 16px; height: 16px; }
.sidebar-collapse:hover { color: var(--ink); border-color: var(--line-2); }
.nav-collapsed .sidebar { padding-inline: 10px; }
.nav-collapsed .brand { justify-content: center; padding-inline: 0; }
.nav-collapsed :is(.brand-copy, .nav-item > span, .nav-caption, .sidebar-bottom > :not(.sidebar-collapse)) { display: none; }
.nav-collapsed .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.nav-collapsed .navigation { gap: 6px; padding-top: 10px; }
.nav-collapsed .sidebar-collapse { position: static; margin: 0 auto; }
.nav-collapsed .sidebar-collapse svg { transform: scaleX(-1); }

.workspace { grid-column: 2; min-width: 0; padding: 0 32px 28px; display: flex; flex-direction: column; outline: none; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 18px; min-height: var(--topbar-h); margin: 0 -32px 22px; padding: 14px 32px;
  background: linear-gradient(180deg, rgba(11,13,15,.92), rgba(11,13,15,.78)); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -20px rgba(0,0,0,.9); }
.workspace-header { min-width: 0; margin-right: auto; }
.workspace-header .eyebrow { margin-bottom: 3px; font-size: 9.5px; }
.workspace-header h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-dot { color: var(--accent); }
.header-description { margin: 0; font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.port-strip { display: flex; align-items: stretch; gap: 8px; padding: 5px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.port-label, .port-symbol, .port-divider { display: none; }
.port-field { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 3px 8px 4px; border-radius: var(--r-sm); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); }
.port-field label { display: flex; align-items: center; gap: 6px; font: 600 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.port-field select { width: 190px; max-width: 22vw; height: 22px; padding: 0 18px 0 0; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%238d979f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") right center/12px no-repeat; appearance: none; color: var(--ink); font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; box-shadow: none; min-height: 0; }
.port-field select:focus-visible { outline-offset: 2px; }
.port-field select:disabled { color: var(--ink-faint); opacity: 1; }
.connection-heading { display: flex; align-items: center; gap: 10px; flex: none; }
.command-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-1); color: var(--ink-dim); font-size: 12.5px; }
.command-trigger svg { width: 16px; height: 16px; }
.command-trigger:hover { color: var(--ink); border-color: var(--line-2); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 999px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3b4248; }
.status-pill.connected { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); background: var(--accent-soft); }
.status-pill.connected::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3b4248; flex: none; }
.status-dot.local, .status-dot.ready, .status-dot.connected { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-dot.capturing, .status-dot.active { background: var(--live); box-shadow: 0 0 8px var(--live); }

/* ── buttons & form controls ────────────────────────────────────────────── */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 4px 10px -6px rgba(0,0,0,.8); transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; }
.button svg { width: 17px; height: 17px; }
.button:hover:not(:disabled) { border-color: var(--line-3); background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)), var(--surface-3); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { border-color: transparent; color: var(--accent-ink); background: linear-gradient(180deg, #7ff0d6, var(--accent) 45%, var(--accent-2)); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 22px -10px rgba(94,230,200,.7); }
.button-primary:hover:not(:disabled) { border-color: transparent; background: linear-gradient(180deg, #9af5e1, #6eeccf 45%, #3fd4b4); }
.button-primary svg { color: var(--accent-ink); }
.button-quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.button-quiet:hover:not(:disabled) { background: rgba(255,255,255,.05); border-color: var(--line); }
.button-danger { color: #ffd6d0; border-color: rgba(255,90,72,.4); background: linear-gradient(180deg, rgba(255,90,72,.22), rgba(255,90,72,.1)); }
.button-small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
input[type="text"], input[type="search"], input[type="number"], input:not([type]), select, textarea {
  min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-0); color: var(--ink); font-size: 13px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4); transition: border-color .12s, box-shadow .12s; }
select { padding-right: 30px; appearance: none; background: var(--surface-0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%238d979f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center/12px no-repeat; }
select[multiple] { background-image: none; padding-right: 11px; }
:is(input, select, textarea):hover:not(:disabled) { border-color: var(--line-3); }
:is(input, select, textarea):focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(94,230,200,.14), inset 0 1px 2px rgba(0,0,0,.4); }
:is(input, select, textarea):disabled { opacity: .5; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="range"] { accent-color: var(--accent); }
textarea { line-height: 1.5; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .filter-field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.unit-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-0); overflow: hidden; }
.unit-input input { border: 0; box-shadow: none; width: 100%; background: transparent; }
.unit-input span { padding: 0 12px; font: 600 11px var(--mono); color: var(--ink-dim); }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; }
.checkbox-field small { display: block; color: var(--ink-dim); font-size: 11.5px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; }
.search-field svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--ink-dim); pointer-events: none; }
.search-field input { width: 100%; padding-left: 38px; }

/* ── notices ────────────────────────────────────────────────────────────── */
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border-radius: var(--r); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: #cdf7ec; font-size: 13px; white-space: pre-line; }
.notice::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.notice-error { background: var(--error-soft); box-shadow: inset 0 0 0 1px rgba(255,90,72,.4); color: #ffd9d3; }
.notice-error::before { background: var(--live); box-shadow: 0 0 8px var(--live); }

/* ── generic structures ─────────────────────────────────────────────────── */
.view { animation: view-in .22s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { font-size: 26px; letter-spacing: -.02em; }
.subtle-label, .count-pill { font: 600 10.5px/1 var(--mono); letter-spacing: .1em; color: var(--ink-dim); text-transform: uppercase; }
.count-pill { padding: 7px 11px; border-radius: 999px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); color: var(--accent); }
.panel { position: relative; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 40%), var(--surface-1); box-shadow: var(--shadow-2); }
.panel-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.panel-heading > div:nth-child(2) { flex: 1; min-width: 0; }
.panel-heading .eyebrow { margin-bottom: 3px; }
.panel-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--accent); }
.panel-step { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font: 700 11px var(--mono); color: var(--ink-dim); box-shadow: inset 0 0 0 1px var(--line-2); }
.panel-description { color: var(--ink-dim); font-size: 13px; }
.panel-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-status, .import-status { font-size: 12.5px; color: var(--ink-dim); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--ink-dim); }
.empty-state h3 { color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; font-size: 13px; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--accent); margin-bottom: 6px; }
.view-footnote { margin-top: 16px; font-size: 12px; color: var(--ink-faint); }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border-radius: 5px; font: 700 10px/1.4 var(--mono); letter-spacing: .06em; background: var(--surface-3); color: var(--ink-2); }

/* ── transfer desk ──────────────────────────────────────────────────────── */
.drop-zone { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--r-lg); cursor: pointer;
  background: repeating-linear-gradient(135deg, rgba(94,230,200,.03) 0 10px, transparent 10px 20px), var(--surface-1); border: 1.5px dashed rgba(94,230,200,.28); transition: border-color .15s, background .15s; }
.drop-zone:hover, body.file-drag .drop-zone, .drop-zone.drag-over, .drop-zone.dragover { border-color: var(--accent); background-color: rgba(94,230,200,.06); }
.drop-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.drop-copy { display: flex; flex-direction: column; gap: 3px; }
.drop-copy strong { font: 600 17px var(--display); }
.drop-copy > span { color: var(--ink-dim); font-size: 13px; }
.file-format { display: flex; flex-direction: column; align-items: flex-end; font: 700 18px/1 var(--mono); color: var(--accent); }
.file-format small { margin-top: 5px; font: 500 10.5px var(--sans); color: var(--ink-dim); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.import-status { margin: 10px 4px 22px; }
.transfer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.capture-meter { display: flex; align-items: center; gap: 18px; padding: 16px 18px; margin: 4px 0 14px; border-radius: var(--r); background: #060809; box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 12px rgba(0,0,0,.7); }
.capture-meter > div:not(.signal-bars) { display: flex; flex-direction: column; gap: 4px; }
.meter-value { font: 700 24px/1 var(--mono); color: var(--accent); text-shadow: 0 0 10px rgba(94,230,200,.4); }
.meter-label { font: 600 9px/1 var(--mono); letter-spacing: .16em; color: var(--ink-faint); }
.meter-rule { width: 1px; align-self: stretch; background: var(--line-2); }
.signal-bars { margin-left: auto; display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.signal-bars i { width: 4px; border-radius: 2px; background: #1b2226; }
.signal-bars i:nth-child(1) { height: 20%; } .signal-bars i:nth-child(2) { height: 35%; } .signal-bars i:nth-child(3) { height: 55%; } .signal-bars i:nth-child(4) { height: 75%; } .signal-bars i:nth-child(5) { height: 100%; } .signal-bars i:nth-child(6) { height: 70%; } .signal-bars i:nth-child(7) { height: 50%; } .signal-bars i:nth-child(8) { height: 32%; } .signal-bars i:nth-child(9) { height: 18%; }
.capture-panel.capturing .signal-bars i, .capture-panel.is-recording .signal-bars i, body:has(#captureStop:not(:disabled)) .signal-bars i { background: var(--accent); animation: bars 0.9s ease-in-out infinite alternate; }
.signal-bars i:nth-child(2n) { animation-delay: .15s; } .signal-bars i:nth-child(3n) { animation-delay: .3s; }
@keyframes bars { from { opacity: .35; transform: scaleY(.6); } to { opacity: 1; transform: none; } }
.record-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); }
.button-primary .record-dot { background: #8b1d12; box-shadow: none; }
.stop-square { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.selected-file { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; margin: 4px 0 14px; border-radius: var(--r); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); }
.selected-file strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.selected-file span { font-size: 12px; color: var(--ink-dim); }
.file-outline { width: 30px; height: 30px; color: var(--accent); }
.file-chip { font: 700 10px/1 var(--mono); letter-spacing: .1em; padding: 6px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.send-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.transfer-progress { margin: 6px 0 12px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-0); appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-0); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 8px; box-shadow: 0 0 10px var(--accent); }
.send-footnote { color: var(--amber); font-size: 12px; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.preview-panel { margin-top: 18px; border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--shadow-2); overflow: hidden; }
.preview-panel summary { display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.preview-panel summary::-webkit-details-marker { display: none; }
.preview-panel summary .muted { font-weight: 400; font-size: 12px; }
.hex-preview { margin: 0; max-height: 320px; overflow: auto; padding: 16px 18px; background: #050607; border-top: 1px solid var(--line); font: 12px/1.7 var(--mono); color: #9fe9d8; white-space: pre-wrap; word-break: break-all; }

/* ── library ────────────────────────────────────────────────────────────── */
.library-toolbar, .monitor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.library-head, .monitor-head { display: flex; justify-content: space-between; padding: 0 18px 8px; font: 600 9.5px/1 var(--mono); letter-spacing: .16em; color: var(--ink-faint); }
.library-list { display: flex; flex-direction: column; gap: 8px; }
.library-row, .library-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .12s, background .12s; }
.library-row:hover { background: var(--surface-2); }
.library-row.selected { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 3px rgba(94,230,200,.08); background: linear-gradient(90deg, rgba(94,230,200,.06), transparent), var(--surface-1); }
.item-copy { min-width: 0; }
.item-title { font-size: 15px; margin-bottom: 3px; overflow-wrap: anywhere; }
.item-meta { margin: 0; font-size: 12px; color: var(--ink-dim); overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-actions button { min-height: 32px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface-2); font-size: 12px; font-weight: 600; }
.row-actions button:hover:not(:disabled) { border-color: var(--line-3); background: var(--surface-3); }
.details-dialog { width: min(560px, 92vw); padding: 24px; border: 0; border-radius: var(--r-lg); background: var(--surface-1); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.8), 0 0 0 1px var(--line-2); }
.details-dialog::backdrop { background: rgba(4,6,8,.7); backdrop-filter: blur(4px); }
.details-dialog form { display: flex; flex-direction: column; gap: 12px; }
.details-dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); }

/* ── monitor ────────────────────────────────────────────────────────────── */
.filter-field { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.monitor-panel { border-radius: var(--r-lg); background: #07090a; box-shadow: var(--shadow-2); overflow: hidden; }
.monitor-head { display: grid; grid-template-columns: 110px 64px 180px 1fr; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.monitor-list { max-height: 60vh; overflow: auto; }
.monitor-row, .monitor-entry { display: grid; grid-template-columns: 110px 64px 180px 1fr; align-items: center; gap: 0; padding: 7px 18px; border-bottom: 1px solid rgba(255,255,255,.035); font-size: 12px; }
.monitor-row:nth-child(even) { background: rgba(255,255,255,.012); }
.monitor-row time { font: 11px var(--mono); }
.monitor-row strong { font-weight: 600; color: var(--ink-2); }
.monitor-row .badge { justify-self: start; }
.hex { font: 11.5px/1.5 var(--mono); color: #9fe9d8; overflow-wrap: anywhere; }

/* ── guide ──────────────────────────────────────────────────────────────── */
.guide-intro { position: relative; overflow: hidden; padding: 34px 36px; margin-bottom: 18px; border-radius: var(--r-xl); background: radial-gradient(600px 260px at 85% 0%, rgba(94,230,200,.16), transparent 70%), linear-gradient(135deg, #142321, #0f1416); box-shadow: var(--shadow-2); }
.guide-intro h3 { font-size: 30px; letter-spacing: -.03em; margin: 8px 0 12px; }
.guide-intro p { max-width: 70ch; color: var(--ink-2); margin: 0; }
.guide-kicker { font: 700 10.5px var(--mono); letter-spacing: .2em; color: var(--accent); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.guide-card { padding: 20px; border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-2); }
.guide-card h3 { color: var(--ink); margin: 8px 0 10px; }
.guide-number { font: 700 10px/1 var(--mono); letter-spacing: .16em; color: var(--accent); }
.guide-tip { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--ink-dim); }
.eventide-note { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 24px; align-items: center; padding: 22px 24px; margin-bottom: 18px; border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(255,181,71,.08), transparent 60%), var(--surface-1); box-shadow: inset 0 0 0 1px rgba(255,181,71,.22); }
.eventide-note .eyebrow { color: var(--amber); }
.eventide-note p { margin: 0; color: var(--ink-2); font-size: 13px; }
.local-note { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-dim); font-size: 13px; }
.local-note svg { color: var(--accent); }
.local-note p { margin: 0; }

/* ── footer ─────────────────────────────────────────────────────────────── */
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 22px; font: 500 11px var(--mono); color: var(--ink-faint); }
.workspace-footer > * { margin-top: 18px; }
.activity { display: flex; align-items: center; gap: 9px; color: var(--ink-dim); }
.footer-format { letter-spacing: .1em; }

/* ── command palette ────────────────────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 1000; display: grid; justify-items: center; align-items: start; padding-top: 12vh; background: rgba(4,6,8,.6); backdrop-filter: blur(6px); }
.palette-box { width: min(640px, 92vw); border-radius: var(--r-lg); background: var(--surface-1); box-shadow: 0 40px 120px rgba(0,0,0,.85), 0 0 0 1px var(--line-2); overflow: hidden; animation: view-in .14s ease both; }
.palette-input { width: 100%; min-height: 56px !important; padding: 0 20px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 16px !important; }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-item { display: grid; grid-template-columns: 120px minmax(0, auto) 1fr; align-items: baseline; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.palette-item.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(94,230,200,.25); }
.palette-kind { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item strong { font-size: 14px; white-space: nowrap; }
.palette-item small { color: var(--ink-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 20px; margin: 0; color: var(--ink-dim); text-align: center; }
.palette-hint { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font: 500 10.5px var(--mono); color: var(--ink-faint); }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1380px) { .header-description { display: none; } .port-field select { width: 150px; } .command-trigger span, .command-trigger kbd { display: none; } }
@media (max-width: 1100px) {
  .app-shell { --sidebar-w: 72px; }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; padding-inline: 0; }
  :is(.brand-copy, .nav-item > span, .nav-caption, .sidebar-bottom > :not(.sidebar-collapse)) { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .sidebar-collapse { display: none; }
  .topbar { flex-wrap: wrap; }
  .transfer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; width: auto; height: 64px; flex-direction: row; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); }
  .brand, .sidebar-bottom, .nav-caption { display: none; }
  .navigation { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; }
  .nav-item { min-width: 48px; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: -6px; width: auto; height: 3px; }
  .workspace { grid-column: 1; padding: 0 16px 84px; }
  .topbar { margin: 0 -16px 16px; padding: 12px 16px; }
  .port-strip { order: 3; width: 100%; }
  .port-field { flex: 1; }
  .port-field select { width: 100%; max-width: none; }
  .drop-zone { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .send-settings, .eventide-note { grid-template-columns: 1fr; }
  .monitor-head, .monitor-row { grid-template-columns: 80px 46px 1fr; }
  .monitor-row .hex, .monitor-head span:last-child { grid-column: 1 / -1; }
  h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ── design chooser & switcher (shell.mjs) ─────────────────────────────── */
.design-trigger { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-1); color: var(--ink); cursor: pointer; line-height: 1.1; }
.design-trigger small { font: 600 8.5px/1 var(--mono); letter-spacing: .16em; color: var(--ink-faint); }
.design-trigger span { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.design-chooser { position: fixed; inset: 0; z-index: 2000; overflow: auto; padding: 36px max(24px, env(safe-area-inset-left, 0px)) 48px; background: rgba(6,7,8,.94); backdrop-filter: blur(10px); color: #eef0f2; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
.design-chooser-head { position: relative; max-width: 1500px; margin: 0 auto 26px; }
.design-chooser-kicker { margin: 0 0 6px; font: 600 11px/1 "Cascadia Mono", Consolas, monospace; letter-spacing: .18em; color: #ffb547; }
.design-chooser-head h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.02em; }
.design-chooser-sub { margin: 0; max-width: 75ch; color: #a3aab1; }
.design-chooser-close { position: absolute; right: 0; top: 0; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #eef0f2; cursor: pointer; }
.design-chooser-grid { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); gap: 22px; }
.design-card { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: #111315; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 60px -30px rgba(0,0,0,.9); }
.design-card.current { box-shadow: 0 0 0 2px #ffb547, 0 30px 60px -30px rgba(0,0,0,.9); }
.design-card-shot { position: relative; aspect-ratio: 1440 / 900; max-width: 100%; overflow: hidden; background: #000; }
.design-card-shot iframe { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; transform: scale(var(--shot-scale, .4)); pointer-events: none; }
.design-card-body { position: relative; display: grid; gap: 6px; padding: 16px 18px 18px 64px; }
.design-card-index { position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #ffb547; color: #1c1200; font-weight: 800; }
.design-card-body h3 { margin: 0; font-size: 18px; }
.design-card-body p { margin: 0; color: #a3aab1; font-size: 13.5px; }
.design-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
html[data-preview="1"] .design-trigger { display: none; }
