:root {
  --bg: #17171a;
  --rail: #26262b;
  --rail-edge: #34343a;
  --toolbar: #202024;
  --text: #e4e4e7;
  --muted: #9a9aa3;
  --accent: #f2c12e;
  --popup: #2a2a30;
  --popup-hover: #3a3a42;
  --surround: #0e0e10;
  --rack-pad: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px -apple-system, system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#toolbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--toolbar);
  border-bottom: 1px solid #000;
  z-index: 10;
}

.brand { display: block; height: 19px; width: auto; margin: 0 10px 0 2px; user-select: none; -webkit-user-drag: none; }
.spacer { flex: 1; }
#status { color: var(--muted); font-variant-numeric: tabular-nums; }

button {
  font: inherit;
  color: var(--text);
  background: #2f2f36;
  border: 1px solid #44444c;
  border-radius: 5px;
  padding: 0 12px;
  min-height: 28px;
  cursor: pointer;
}
button:hover { background: #3a3a42; }
button:active { background: #45454e; }

/* The rack sits in a darker surround with a margin all round (--rack-pad), like the
   frame of a case. A grid container counts its padding in the scroll area on all sides. */
#viewport {
  position: fixed;
  inset: 40px 0 0 0;
  overflow: auto;
  display: grid;
  align-content: start;
  justify-content: start;
  padding: var(--rack-pad);
  background: var(--surround);
}

#rack {
  position: relative;
  background: var(--bg);
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #2c2c32, 0 8px 28px rgb(0 0 0 / 0.45);
  overflow: hidden;
}

.rail {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--rail);
  border-top: 1px solid var(--rail-edge);
  border-bottom: 1px solid var(--rail-edge);
}

.module {
  position: absolute;
  touch-action: none;
}
.module.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
#rack.panning { cursor: grabbing; }
/* The box drawn by dragging on empty rack space. */
.selbox { position: absolute; z-index: 5; pointer-events: none; border: 1px solid var(--accent); background: rgb(242 193 46 / 0.08); border-radius: 2px; }
.module.dragging { opacity: 0.85; z-index: 2; }
.module > * { position: absolute; }
.panel { inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* A Eurorack knob seen from above: a dark skirt with a crisp rim, a slightly raised cap lit
   from the top (fixed), and a white pointer. Only .rot turns. */
/* Parameter widgets (widgets.js): the box is what you grab, the SVG draws the style. */
.knob { cursor: ns-resize; }
.knob.w-toggle, .knob.w-switch, .knob.w-button, .knob.w-latch { cursor: pointer; }
.knob.w-slider { cursor: ns-resize; }
.knob .wsvg { position: absolute; overflow: visible; pointer-events: none; }
.wsvg .wvalue { opacity: 0; transition: opacity 0.15s; }
.knob:hover .wsvg .wvalue, .knob:active .wsvg .wvalue { opacity: 0.9; }
.wsvg .wglow { filter: drop-shadow(0 0 0.7px var(--glow)); }
.wsvg .wled { fill: var(--led); opacity: 0.2; }
.wsvg .wled.on { opacity: 1; filter: drop-shadow(0 0 0.8px var(--led)); }
.wsvg .wraised { filter: drop-shadow(0 0.5px 0.35px rgb(0 0 0 / 0.45)); }

.port {
  border-radius: 50%;
  background: radial-gradient(circle, #0b0b0c 0 42%, #c9c9cc 47%, #8d8d92 72%, #6a6a70);
  cursor: crosshair;
}
/* Jacks per collection style (set on each module): the house style's dark rings with outputs
   ringed in the accent, Studio's light nuts, Classic's hex nuts. */
[data-style="studio"] .port { background: radial-gradient(circle, #050506 0 44%, #b9b8b3 48% 70%, #e6e5e1 74%, #d3d2cd 94%, rgb(0 0 0 / 0.3) 97%, transparent 100%); }
[data-style="classic"] .port { border-radius: 0; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: radial-gradient(circle, #050506 0 42%, #9c9ca0 46% 64%, #d4d4d6 68%, #bdbdc0 100%); }
[data-style="kabelwerk"] .port { background: radial-gradient(circle, #050506 0 44%, #1a1b1f 48% 66%, #2b2c31 70% 92%, #46474e 95%, transparent 100%); }
[data-style="kabelwerk"] .port[data-kind="out"] { box-shadow: inset 0 0 0 1.5px var(--mod-accent); }
[data-style="kabelwerk"][data-theme="light"] .port { background: radial-gradient(circle, #050506 0 44%, #c9ccd2 48% 66%, #e4e6ea 70% 92%, #a9adb5 95%, transparent 100%); }
.port:hover, .port.target { box-shadow: 0 0 0 2px var(--accent); }

.light {
  border-radius: 50%;
  background: rgb(var(--rgb) / 0.15);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.5);
  pointer-events: none;
}
/* Lit LED: a solid body with a small halo whose size follows the Light glow setting
   (--light-glow, 0..1). Only the opacity changes at runtime. */
.light .glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgb(255 255 255 / 0.55), rgb(var(--rgb)) 45%);
  box-shadow: 0 0 calc(var(--light-glow, 0.35) * 14px) calc(var(--light-glow, 0.35) * 2px) rgb(var(--rgb) / 0.55);
  opacity: 0;
  will-change: opacity;
}

svg.cables {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
svg.cables path { fill: none; stroke-linecap: round; opacity: var(--cable-opacity, 0.85); }
svg.cables circle { opacity: min(1, calc(var(--cable-opacity, 0.85) + 0.1)); }

.popup {
  position: fixed;
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--popup);
  border: 1px solid #000;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
}

#menu[hidden], #tooltip[hidden] { display: none; }
#menu { max-height: 80vh; overflow-y: auto; min-width: 200px; }
#menu li.heading { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 10px 2px; }
#menu li.heading:hover { background: none; }
#menu li.choice::before { content: '✓'; display: inline-block; width: 1.3em; visibility: hidden; }
#menu li.choice.on::before { visibility: visible; }
#menu li.sep { height: 1px; padding: 0; margin: 4px 6px; background: #44444c; }
#menu li { padding: 6px 10px; border-radius: 5px; cursor: default; }
#menu li:hover { background: var(--popup-hover); }

#tooltip {
  position: fixed;
  z-index: 30;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgb(0 0 0 / 0.85);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}

.transport { display: flex; align-items: center; gap: 6px; margin-right: 12px; }
#play { width: 40px; padding: 0; }
#play.on { background: #2f6b3c; border-color: #3fbf6a; }
#link.on { background: #5c4a14; border-color: var(--accent); }
#tempo {
  width: 64px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #1d1d21;
  border: 1px solid #44444c;
  border-radius: 5px;
  padding: 4px 6px;
}
#tempo::-webkit-inner-spin-button { display: none; }
.unit { color: var(--muted); }
#position { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }

.knob.target { box-shadow: 0 0 0 3px var(--accent); border-radius: 50%; }
svg.modring { pointer-events: none; overflow: visible; }
svg.modring path { fill: none; stroke-width: 0.13; stroke-linecap: round; }
svg.modring .track { stroke: rgb(0 0 0 / 0.35); }
svg.modring .range { opacity: 0.9; }
svg.cables path.mod { stroke-dasharray: 6 5; opacity: calc(var(--cable-opacity, 0.85) * 0.9); }
/* Where a modulation cable ends: the knob's centre (transparent grab area). */
.modend { border-radius: 50%; cursor: grab; z-index: 1; }

/* Port activity light in the jack's hole. */
.port .act {
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  pointer-events: none;
  isolation: isolate;
}
.port .act > div {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  will-change: opacity;
  mix-blend-mode: screen; /* positive + negative (audio) adds up to yellow */
}
.port .act .pos { background: #42ff7b; box-shadow: 0 0 4px #42ff7b; }
.port .act .neg { background: #ff4a3d; box-shadow: 0 0 4px #ff4a3d; }
.port .act .poly { background: #4fb2ff; box-shadow: 0 0 4px #4fb2ff; }

#view-popover { width: 240px; padding: 10px 12px; display: grid; gap: 10px; }
#view-popover[hidden] { display: none; }
#view-popover label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
#view-popover label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
#view-popover input[type=range] { width: 100%; accent-color: var(--accent); }

/* Host-filled screens on panels (e.g. the Audio module's device). */
.display {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 6px;
  box-sizing: border-box;
  font: 600 9px/1.2 ui-monospace, Menlo, monospace;
  color: #ececec;
  cursor: pointer;
  overflow: hidden;
}
.display .line { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.display .sub { font-size: 8px; font-weight: 500; color: #9a9aa2; }
.display.error .sub { color: #ff6b5a; }
.display:hover { background: rgb(255 255 255 / 0.04); }
.module.inactive .display { color: #6c6c74; }
.module.inactive .display .sub { color: #55555c; }
.module.inactive > .panel { filter: brightness(0.7); }

/* Screens drawn by a module's own UI (info.ui). */
.display.custom { padding: 0; cursor: default; display: block; }
.display.custom:hover { background: none; }
.display .ui-error { padding: 4px 6px; color: #ff6b5a; font-size: 8px; white-space: normal; }

/* Notices (module package build errors), bottom right. */
#notices { position: fixed; right: 12px; bottom: 12px; z-index: 25; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.notice { background: var(--popup); border: 1px solid #5a2a26; border-left: 3px solid #ff6b5a; border-radius: 8px; padding: 10px 34px 10px 12px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); position: relative; }
.notice .title { font-weight: 600; }
.notice .close { position: absolute; top: 6px; right: 6px; min-height: 22px; padding: 0 7px; }
.notice summary { color: var(--muted); font-size: 12px; margin-top: 4px; cursor: pointer; }
.notice pre { max-height: 240px; overflow: auto; font: 11px/1.35 ui-monospace, Menlo, monospace; white-space: pre-wrap; margin: 6px 0 0; }

/* Settings sheet */
.modal { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 72px; }
.modal[hidden] { display: none; }
.modal .sheet { width: 520px; max-height: calc(100vh - 120px); overflow-y: auto; background: var(--popup); border: 1px solid #000; border-radius: 10px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.6); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #000; }
.modal nav { display: flex; gap: 4px; }
.modal nav button { background: none; border-color: transparent; }
.modal nav button.on { background: #3a3a42; border-color: #4c4c55; }
.modal header .close { padding: 0 9px; }
.modal section { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal section[hidden] { display: none; }
.modal label { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; }
.modal label.check { display: flex; gap: 8px; }
.modal select { font: inherit; color: var(--text); background: #1d1d21; border: 1px solid #44444c; border-radius: 5px; min-height: 28px; padding: 0 6px; }
.modal .hint { color: var(--muted); font-size: 12px; margin: 0; }
.modal p { margin: 0; }
.modal code { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }
.modal ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.modal h3 { margin: 6px 0 0; font-size: 13px; padding-top: 14px; border-top: 1px solid #3a3a42; }
.modal .new-module { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.modal .hint.error { color: #ff8a7a; white-space: pre-wrap; }
.modal input[type="text"] { font: inherit; color: var(--text); background: #1d1d21; border: 1px solid #44444c; border-radius: 5px; min-height: 28px; padding: 0 8px; }

/* New module */
#new-module .sheet { width: 480px; margin: 0; }
#new-module header .title { font-weight: 600; padding-left: 6px; }
#new-module .templates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#new-module label.template { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 1px solid #44444c; border-radius: 8px; cursor: pointer; }
#new-module label.template:has(input:checked) { border-color: var(--accent); background: rgb(242 193 46 / 0.07); }
#new-module label.template input { position: absolute; opacity: 0; pointer-events: none; }
#new-module .t-name { font-weight: 600; }
#new-module .t-desc { color: var(--muted); font-size: 12px; line-height: 1.35; }
#new-module footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
button.primary { background: #3d6fd8; border-color: #4f80e6; }
button.primary:hover { background: #4a7ae0; }
button.primary:disabled { opacity: 0.6; cursor: default; }

/* Patch browser */
#patches { width: 420px; outline: none; }
#patches[hidden] { display: none; }
#patch-list { list-style: none; margin: 0; padding: 0; max-height: 64vh; overflow-y: auto; }
#patch-list li { padding: 8px 10px; border-radius: 5px; cursor: pointer; }
#patch-list li.active { background: var(--popup-hover); }
#patch-list .name { font-weight: 600; }
#patch-list .desc { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
#patch-list .tag { float: right; color: var(--muted); font-size: 11px; }
#patches footer { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid #44444c; margin-top: 4px; }
.notice.info { border-color: #2a5a36; border-left-color: #3fbf6a; }

/* Panel editor (editor.js) */
.panel-editing .module:not(.editing) { opacity: 0.35; }
.module.editing { outline: 2px solid #4da3ff; outline-offset: 2px; z-index: 5; }
.module.editing .edit-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgb(77 163 255 / 0.10) 1px, transparent 1px), linear-gradient(90deg, rgb(77 163 255 / 0.10) 1px, transparent 1px),
    linear-gradient(rgb(77 163 255 / 0.22) 1px, transparent 1px), linear-gradient(90deg, rgb(77 163 255 / 0.22) 1px, transparent 1px);
  background-size: 3px 3px, 3px 3px, 15.24px 15.24px, 15.24px 15.24px; }
.module.editing .knob, .module.editing .port, .module.editing .light, .module.editing .display { outline: 1px dashed rgb(77 163 255 / 0.8); outline-offset: 3px; cursor: move; }
.module.editing .edit-sel { outline: 2px solid #4da3ff !important; box-shadow: 0 0 0 6px rgb(77 163 255 / 0.18); }
.module.editing .modring, .module.editing .modend { display: none; }
.edit-guide { position: absolute; background: #ff5ad1; z-index: 6; pointer-events: none; }
.edit-readout { position: absolute; z-index: 7; font: 600 11px ui-monospace, Menlo, monospace; background: #4da3ff; color: #fff; padding: 2px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.edit-bar { position: absolute; z-index: 8; display: flex; gap: 6px; align-items: center; background: var(--popup); border: 1px solid #000; border-radius: 8px; padding: 5px 6px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); font-size: 12px; }
.edit-bar .title { font-weight: 600; padding: 0 6px; }
.edit-bar button.on { background: #24486e; border-color: #4da3ff; }
.edit-inspector { position: fixed; right: 0; top: 41px; bottom: 0; width: 300px; background: var(--popup); border-left: 1px solid #000; z-index: 9; padding: 12px; font-size: 12px; overflow-y: auto; box-sizing: border-box; }
.edit-inspector h3 { margin: 0 0 8px; font-size: 13px; }
.edit-inspector .row { display: grid; grid-template-columns: 1fr 56px 56px 38px; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 5px; }
.edit-inspector .row.wide { grid-template-columns: 1fr 70px; }
.edit-inspector .row.sel { background: #24486e; }
.edit-inspector .head { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.edit-inspector input { width: 100%; box-sizing: border-box; font: 12px ui-monospace, Menlo, monospace; color: var(--text); background: #1d1d21; border: 1px solid #44444c; border-radius: 4px; padding: 3px 5px; }
.edit-inspector .kind { color: var(--muted); font-size: 10px; }
.edit-inspector .hint { color: var(--muted); margin-top: 12px; line-height: 1.4; }

/* ---- Module browser (library.js): real panels on shelves, over a dimmed rack ---- */
#library { position: fixed; inset: 0; z-index: 30; background: rgb(8 8 10 / 0.55); backdrop-filter: blur(6px) saturate(0.8); -webkit-backdrop-filter: blur(6px) saturate(0.8); }
#library[hidden] { display: none; }
#library.dragging { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
#library.dragging .lib-sheet { opacity: 0; transition: opacity 0.12s; }
.lib-sheet { position: absolute; inset: 52px 16px 16px; display: flex; flex-direction: column; background: rgb(22 22 26 / 0.94); border: 1px solid #2c2c32; border-radius: 12px; box-shadow: 0 30px 80px rgb(0 0 0 / 0.6); overflow: hidden; }
.lib-sheet header { display: grid; grid-template-columns: minmax(240px, 340px) 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #26262b; }
.lib-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; color: var(--muted); background: #141417; border: 1px solid #3a3a42; border-radius: 9px; }
.lib-search:focus-within { border-color: #5a5a64; }
.lib-search input { flex: 1; min-width: 0; font: 15px -apple-system, system-ui, sans-serif; color: var(--text); background: none; border: 0; outline: none; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip, .lib-favs { font: inherit; font-size: 12px; color: var(--muted); background: #1c1c20; border: 1px solid #303036; border-radius: 99px; padding: 0 11px; min-height: 26px; cursor: pointer; white-space: nowrap; }
.lib-chip:hover, .lib-favs:hover { color: var(--text); background: #26262c; }
.lib-chip.on, .lib-favs.on { color: #141417; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.lib-chip i { font-style: normal; opacity: 0.6; margin-left: 5px; }
.lib-tools { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.lib-size { display: flex; align-items: center; gap: 6px; }
.lib-size input { width: 90px; accent-color: var(--accent); }
.lib-close { min-height: 28px; padding: 0 10px; font-size: 16px; }
.lib-wall { flex: 1; overflow: auto; padding: 4px 18px 28px; display: flex; flex-wrap: wrap; gap: 22px 26px; align-content: flex-start; --thumb: 0.58; --mm: calc(var(--thumb) * 3px); }
.lib-wall section h3 { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 7px 8px; font-weight: 600; }
.lib-wall section h3 i { font-style: normal; opacity: 0.5; margin-left: 6px; }
.lib-shelf { position: relative; display: flex; padding: 0 8px; }
/* rack rails behind the panels, peeking out at the ends */
.lib-shelf::before, .lib-shelf::after { content: ''; position: absolute; left: 0; right: 0; height: calc(5 * var(--mm)); background: linear-gradient(#34343a, #26262b 40%, #1f1f23); border-top: 1px solid #3e3e45; border-bottom: 1px solid #111; border-radius: 2px; }
.lib-shelf::before { top: calc(-1 * var(--mm)); }
.lib-shelf::after { bottom: calc(-1 * var(--mm)); }
.lib-item { position: relative; z-index: 1; cursor: grab; }
.lib-item:hover { z-index: 3; } /* above its neighbours, so the outline shows on every side */
.lib-item .lib-panel { transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 2px 6px rgb(0 0 0 / 0.5); }
.lib-item:hover .lib-panel { transform: translateY(-6px); box-shadow: 0 16px 30px rgb(0 0 0 / 0.6), 0 0 0 2px var(--accent); }
/* Favorite: a round badge on the panel's top-right corner, half outside, so it never covers the name. */
.lib-star { position: absolute; z-index: 2; top: -9px; right: -9px; width: 22px; height: 22px; min-height: 0; padding: 0; display: grid; place-items: center; font-size: 13px; line-height: 1; color: #d8d8de; background: #26262c; border: 1px solid #44444c; border-radius: 50%; box-shadow: 0 2px 6px rgb(0 0 0 / 0.5); opacity: 0; transition: opacity 0.15s, transform 0.15s; }
.lib-item:hover .lib-star { opacity: 1; transform: translateY(-6px); }
.lib-star.on { opacity: 1; color: #141417; background: var(--accent); border-color: var(--accent); }
.lib-star:hover { background: #34343c; color: #fff; }
.lib-star.on:hover { background: #ffd34d; color: #141417; }
.lib-panel { position: relative; flex: none; border-radius: 2px; zoom: var(--thumb, 1); }
.lib-ghost.lib-panel { zoom: 1; }
.lib-panel > * { position: absolute; }
.lib-panel > img { inset: 0; width: 100%; height: 100%; }
.lib-panel .knob { cursor: inherit; }
.lib-ghost { position: fixed; z-index: 50; pointer-events: none; opacity: 0.9; filter: drop-shadow(0 18px 30px rgb(0 0 0 / 0.6)); }
.lib-card { position: fixed; z-index: 40; pointer-events: none; width: 290px; padding: 10px 12px; background: rgb(29 29 34 / 0.96); border: 1px solid #3a3a42; border-radius: 10px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.5); }
.lib-card[hidden] { display: none; }
.lib-card b { font-size: 14px; }
.lib-card .lib-meta { color: var(--muted); font-size: 12px; }
.lib-card p { margin: 5px 0 6px; color: #c6c6cc; line-height: 1.4; }
.lib-card .lib-ports { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.lib-empty { color: var(--muted); padding: 30px 8px; }
.lib-sheet footer { display: flex; align-items: center; gap: 18px; padding: 8px 18px; border-top: 1px solid #26262b; color: var(--muted); font-size: 12px; }
.lib-sheet footer .lib-count { margin-left: auto; }
.lib-new { min-height: 26px; }

.zoom-row { display: flex; align-items: center; gap: 6px; }
.zoom-row span { flex: 1; }
.zoom-row button { min-width: 30px; padding: 0 8px; }
.zoom-row #zoom-reset { min-width: 58px; font-variant-numeric: tabular-nums; }


.look-row { display: flex; align-items: center; gap: 10px; }
.look-row > span { flex: 0 0 52px; color: var(--muted); }
.modal .look-row > span { flex-basis: 130px; color: inherit; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: #1a1a1e; border: 1px solid #3a3a42; border-radius: 7px; }
.seg button { min-height: 24px; padding: 0 10px; background: none; border: 0; border-radius: 5px; color: var(--muted); }
.seg button:hover { color: var(--text); background: #2a2a30; }
.seg button.on { color: #141417; background: var(--accent); font-weight: 600; }
