/* ==========================================================================
   Sounds & banks — native patch editing, bank organisation, factory library
   ========================================================================== */
.native-studio { display: flex; flex-direction: column; gap: 12px; }
.native-toolbar { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r); background: rgba(20,24,28,.92); backdrop-filter: blur(12px); box-shadow: var(--shadow-2); }
.native-tabs { display: flex; flex-wrap: wrap; max-width: 100%; min-width: 0; gap: 3px; padding: 3px; margin-right: auto; border-radius: var(--r-sm); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); }
.native-tabs .button { min-height: 32px; border: 0; background: transparent; box-shadow: none; color: var(--ink-dim); font-size: 12.5px; }
.native-tabs .button:hover:not(:disabled) { background: rgba(255,255,255,.05); color: var(--ink); }
.native-tabs .button.active { color: var(--accent-ink); background: linear-gradient(180deg, #85f1d9, var(--accent)); box-shadow: 0 4px 12px -6px rgba(94,230,200,.8); }
.native-toolbar > .button { min-height: 34px; font-size: 12.5px; }
.native-status { margin: 0 4px; font: 11.5px/1.6 var(--mono); color: var(--ink-dim); }
.native-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.native-bank-list { position: sticky; top: calc(var(--topbar-h) + 66px); display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--topbar-h) - 90px); overflow: auto; padding: 14px; border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--shadow-2); }
.native-bank-list h3 { font-size: 14px; }
.native-bank-list details summary { cursor: pointer; font-size: 12px; color: var(--ink-dim); padding: 6px 2px; }
.native-bank-list details .button { width: 100%; justify-content: flex-start; margin-top: 4px; font-size: 12px; min-height: 30px; }
.native-bank { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; margin-bottom: 4px; border: 0; border-radius: var(--r-sm); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: var(--ink); transition: background .1s, box-shadow .1s; }
.native-bank:hover { background: var(--surface-2); }
.native-bank.selected { background: linear-gradient(90deg, var(--accent-soft), transparent), var(--surface-0); box-shadow: inset 0 0 0 1px var(--accent-line); }
.native-bank strong { font-size: 13px; overflow-wrap: anywhere; }
.native-bank small { font: 10px var(--mono); color: var(--ink-dim); }
.native-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.native-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.native-field input, .native-field select { font-weight: 400; }
.native-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.native-help { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-dim); }
.native-warning { margin: 0; padding: 10px 14px; border-radius: var(--r-sm); font-size: 12.5px; color: #ffe1b3; background: var(--amber-soft); box-shadow: inset 0 0 0 1px rgba(255,181,71,.3); }
.native-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.native-actions .button { min-height: 32px; font-size: 12px; padding: 0 11px; }
.native-actions > span { font: 11px var(--mono); color: var(--ink-dim); padding: 0 8px; }
.native-receive, .native-hardware { border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.native-receive > summary, .native-hardware > summary { padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 600; }
.native-receive > :not(summary), .native-hardware > :not(summary) { margin: 0 16px 12px; }
.native-hardware > .button { margin: 0 0 12px 16px; min-height: 32px; font-size: 12px; }
.native-hardware select { margin-bottom: 10px; }
.native-empty { padding: 50px 40px; border-radius: var(--r-xl); text-align: center; background: radial-gradient(600px 260px at 50% -20%, rgba(94,230,200,.16), transparent 70%), var(--surface-1); box-shadow: var(--shadow-2); }
.native-empty h2 { font-size: 30px; letter-spacing: -.03em; margin: 6px 0 10px; }
.native-empty p { max-width: 60ch; margin: 0 auto 18px; color: var(--ink-dim); }
.native-bank-head { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--shadow-2); }
.native-bank-head input { font: 600 16px var(--display); }
.native-sound-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.native-sounds { position: sticky; top: calc(var(--topbar-h) + 66px); display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - var(--topbar-h) - 90px); padding: 12px; border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--shadow-2); }
.native-sound-rows { display: flex; flex-direction: column; gap: 2px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.native-sound { display: grid !important; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 0 8px; min-height: 40px !important; padding: 6px 10px !important; border: 0 !important; border-radius: var(--r-xs) !important; background: transparent !important; box-shadow: none !important; text-align: left; font-weight: 500 !important; }
.native-sound:hover { background: rgba(255,255,255,.04) !important; }
.native-sound.selected { background: linear-gradient(90deg, var(--accent-soft), transparent) !important; box-shadow: inset 2px 0 0 var(--accent) !important; }
.native-index { grid-row: span 2; font: 600 11px var(--mono); color: var(--ink-faint); }
.native-sound.selected .native-index { color: var(--accent); }
.native-sound > span:not(.native-index) { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.native-sound small { font: 10px var(--mono); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.native-editor { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.native-oled { position: relative; padding: 18px 22px; border-radius: 14px; overflow: hidden; font-family: var(--mono); color: #6af0d2;
  background: radial-gradient(120% 140% at 20% 0%, rgba(106,240,210,.08), transparent 60%), #020405;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 30px rgba(0,0,0,.9), 0 0 0 5px #111417, 0 0 0 6px rgba(255,255,255,.06); }
.native-oled::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(165deg, rgba(255,255,255,.06), transparent 35%), repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px); }
.native-oled-top { font-size: 10px; letter-spacing: .14em; color: rgba(106,240,210,.5); }
.native-oled h2 { margin: 6px 0 4px; font: 700 28px/1.1 var(--mono); color: #e9fff9; text-shadow: 0 0 14px rgba(106,240,210,.45); overflow-wrap: anywhere; }
.native-oled p { margin: 0; font-size: 11px; color: rgba(106,240,210,.6); }
.native-oled-value { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(106,240,210,.14); font-size: 13px; color: #ffb547; }
.native-param-filters { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; align-items: end; padding: 10px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.native-param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.native-param { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "dial label" "dial display" "number number" "meta meta"; align-items: center; gap: 4px 10px; padding: 12px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.native-param:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.native-param-label { grid-area: label; font-size: 12px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.native-dial { grid-area: dial; position: relative; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 45% 30%, #4a5258, #1e2226 70%); box-shadow: 0 4px 8px rgba(0,0,0,.6), 0 0 0 1px #050607, 0 0 0 4px rgba(94,230,200,.08); }
.native-dial i { position: absolute; inset: 0; display: block; }
.native-dial i::before { content: ""; position: absolute; left: calc(50% - 1.25px); top: 6px; width: 2.5px; height: 12px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.native-dial input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.native-param-display { grid-area: display; font: 600 12px var(--mono); color: var(--accent); overflow-wrap: anywhere; }
.native-param > input[type="number"] { grid-area: number; min-height: 30px; font: 12px var(--mono); }
.native-param > select { grid-column: 1 / -1; min-height: 30px; font-size: 12px; }
.native-param > small { grid-column: 1 / -1; font: 9.5px var(--mono); color: var(--ink-faint); overflow-wrap: anywhere; }
.native-param:has(input:disabled) { opacity: .7; }
.native-param:has(input:disabled) .native-dial i::before { background: var(--ink-faint); box-shadow: none; }
.native-hex { margin: 0; max-height: 280px; overflow: auto; padding: 14px; border-radius: var(--r); background: #050607; box-shadow: inset 0 0 0 1px var(--line); font: 11.5px/1.7 var(--mono); color: #9fe9d8; white-space: pre-wrap; word-break: break-all; }
.native-factory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.native-factory-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(255,255,255,.03), transparent 50%), var(--surface-1); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.native-factory-card h3 { font-size: 16px; overflow-wrap: anywhere; }
.native-factory-card p { margin: 0; font-size: 12px; color: var(--ink-dim); }
.native-factory-card a { font-size: 12px; color: var(--accent); text-underline-offset: 3px; }
.native-factory-card .button { align-self: flex-start; min-height: 32px; font-size: 12px; }
.native-coverage-count { margin: 0; font: 11.5px var(--mono); color: var(--accent); }
.native-coverage-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.native-capability { padding: 3px 8px; border-radius: 999px; font: 600 10px var(--mono); background: var(--surface-3); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.native-capability-editor { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(94,230,200,.25); }
.native-capability-inspector { color: var(--info); background: rgba(111,182,255,.1); }
.native-capability-research { color: var(--amber); background: var(--amber-soft); }
.native-coverage-details summary { cursor: pointer; font-size: 12px; color: var(--ink-dim); }
.native-coverage-details a { display: block; margin-top: 4px; }
.native-backup-workbench { padding: 14px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.native-backup-result { margin-top: 10px; }
.native-compare-regions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.native-compare-scroll { max-height: 360px; overflow: auto; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); }
.native-compare-table { width: 100%; border-collapse: collapse; font: 11px var(--mono); }
.native-compare-table th, .native-compare-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.native-compare-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-dim); }

/* native patch panel (kit-rendered view of decoded fields) */
.native-panel { border-radius: var(--r-lg); overflow: hidden; }
.native-panel .hw-host { margin-bottom: 0; }
.native-panel-note { margin: 6px 4px 0; font-size: 11.5px; color: var(--ink-faint); }
.native-view-switch { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-0); box-shadow: inset 0 0 0 1px var(--line); align-self: flex-start; }
.native-view-switch .button { min-height: 28px; border: 0; background: transparent; box-shadow: none; color: var(--ink-dim); font-size: 12px; }
.native-view-switch .button.active { color: var(--accent-ink); background: var(--accent); }

@media (max-width: 1280px) { .native-layout { grid-template-columns: 1fr; } .native-bank-list { position: static; max-height: 300px; } }
@media (max-width: 980px) { .native-sound-layout { grid-template-columns: 1fr; } .native-sounds { position: static; max-height: 340px; } .native-bank-head, .native-param-filters { grid-template-columns: 1fr; } }

/* read-only pattern inspection */
.native-pattern { padding: 16px; border-radius: var(--r-lg); background: #050708; box-shadow: inset 0 0 0 1px var(--line); }
.native-pattern-lane { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 3px; height: 150px; margin: 6px 0 10px; }
.native-pattern-step { position: relative; display: grid; grid-template-rows: 1fr 1fr auto; gap: 3px; opacity: .35; }
.native-pattern-step.active { opacity: 1; }
.native-pattern-step i { position: relative; border-radius: 2px; background: rgba(255,255,255,.04); overflow: hidden; }
.native-pattern-step i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; }
.native-pattern-step .vel::after { height: calc(var(--velocity) * 100%); background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.native-pattern-step .gate::after { top: 0; bottom: auto; height: calc(var(--gate) * 100%); background: var(--amber); }
.native-pattern-step small { font: 8.5px var(--mono); color: var(--ink-faint); text-align: center; }

/* Official maker / unit logos (local-assets/logos, local only). Light artwork sits on a dark chip, dark artwork on a light one. */
.native-logo { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; border-radius: 8px; }
.native-logo img { display: block; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.native-logo.tone-light, .native-logo.tone-any { background: #0c0c0e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.native-logo.tone-dark { background: #f0f0f2; }
html[data-design="graphite"] .native-bank:has(> .native-logo) { grid-template-columns: 88px minmax(0, 1fr); }
.native-bank > .native-logo { grid-row: 1 / 3; width: 88px; height: 40px; padding: 6px 8px; }
.native-factory-card > .native-logo { justify-content: flex-start; height: 46px; padding: 9px 12px; }
.native-factory-card > .native-logo img { max-width: 70%; }
