:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* Instrument chrome — near-black, hairline, BENDYpost mauve */
  --surface-1: #0c0c0b;
  --surface-2: #141413;
  --surface-3: #1c1c1a;
  --text-primary: #e8e6e0;
  --text-secondary: #b8b6ac;
  --text-muted: #7a7970;
  --part-head: #c4a0b4;
  --link: #d4b8c8;
  --border: #2a2a27;
  --danger: #e66767;
  --ok: #4a9a6a;
  --btn-primary-bg: #3a2a34;
  --btn-primary-border: #c4a0b4;
  --focus-ring: #d4b8c8;
  --highlight-ink: #f4f1ea;

  /* Character highlights — dark enough for light text */
  --ch-sam: #5c2428;
  --ch-fuller: #1e3a5c;
  --ch-caleb: #1f4534;
  --ch-josh: #5a4820;
  --ch-richardson: #3d2d52;
  --ch-ron: #2d4028;
  --ch-parents: #4a382c;
  --ch-unit: #4a3226;
  --ch-evans: #1f403c;
  --ch-michael: #342e42;

  --bg: var(--surface-1);
  --panel: var(--surface-2);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --line: var(--border);
  --accent: var(--part-head);
  --accent-soft: color-mix(in srgb, #c4a0b4 16%, #141413);
  --selection-bg: #5a3a4a;
  --selection-fg: #ffffff;
  --rail: var(--surface-1);
  --rail-ink: var(--text-primary);
  --rail-muted: var(--text-muted);
  --focus: var(--part-head);
  --warn: #c98500;
  --font: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ui: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 2px;
}

[data-theme="light"] {
  color-scheme: light;
  --surface-1: #f0eeea;
  --surface-2: #f7f6f3;
  --surface-3: #ffffff;
  --text-primary: #1c1b19;
  --text-secondary: #3d3a35;
  --text-muted: #6a655e;
  --part-head: #7a4a5c;
  --link: #7a4a5c;
  --border: #d4cfc6;
  --danger: #8a3a2a;
  --ok: #2f5d50;
  --btn-primary-bg: #7a4a5c;
  --btn-primary-border: #7a4a5c;
  --focus-ring: #7a4a5c;
  --highlight-ink: #1c1b19;

  /* Original pastel highlights — dark ink on light wash */
  --ch-sam: #f8d5d5;
  --ch-fuller: #d3e4f7;
  --ch-caleb: #d5efdf;
  --ch-josh: #f6ebc9;
  --ch-richardson: #e4d9f2;
  --ch-ron: #dce8d2;
  --ch-parents: #eadfd4;
  --ch-unit: #f0dfd0;
  --ch-evans: #d5ebe8;
  --ch-michael: #e2dde9;

  --bg: var(--surface-1);
  --panel: var(--surface-2);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --line: var(--border);
  --accent: var(--part-head);
  --accent-soft: #e8dce2;
  --selection-bg: #7a4a5c;
  --selection-fg: #ffffff;
  --rail: #141413;
  --rail-ink: #e8e4dc;
  --rail-muted: #9aa39c;
  --focus: #7a4a5c;
  --warn: #8a5a12;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}
::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}
body {
  margin: 0;
  color: var(--text-primary);
  background: var(--surface-1);
  font: 13px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
a { color: var(--link); }

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.rail {
  background: var(--rail);
  color: var(--rail-ink);
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
}
[data-theme="light"] .rail { border-right-color: #4a524e; }

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.brand-logo {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  border-radius: var(--radius);
  /* 3D extrusion sits low-left — nudge so it optically centers with the type */
  transform: translateY(-0.28rem);
}
.login-brand .brand-logo {
  width: 5rem;
  height: 5rem;
  transform: translateY(-0.22rem);
}
.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  padding-top: 0.02rem;
}
.brand-mark {
  width: 2.25rem; height: 2.25rem;
  border: 1px solid color-mix(in srgb, var(--rail-ink) 22%, transparent);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--ui); font-size: 0.72rem; font-weight: 650;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--rail-ink) 8%, transparent);
  color: var(--rail-ink);
}
.brand-name { font-family: var(--ui); font-weight: 600; font-size: 0.95rem; color: var(--rail-ink); line-height: 1.15; }
.brand-sub { font-family: var(--ui); font-size: 0.72rem; color: var(--rail-muted); line-height: 1.2; }

.field { display: grid; gap: 0.35rem; font-family: var(--ui); font-size: 0.72rem; color: var(--rail-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.field select {
  background: color-mix(in srgb, var(--rail-ink) 10%, transparent);
  color: var(--rail-ink);
  border: 1px solid color-mix(in srgb, var(--rail-ink) 22%, transparent);
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius);
}

.nav { display: grid; gap: 0.15rem; }
.nav-item {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--rail-ink);
  padding: 0.5rem 0.6rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  opacity: 0.88;
}
.nav-item:hover { background: color-mix(in srgb, var(--rail-ink) 10%, transparent); opacity: 1; }
.nav-item.is-active {
  border-left-color: var(--part-head);
  background: color-mix(in srgb, var(--rail-ink) 10%, transparent);
  opacity: 1;
}
[data-theme="light"] .nav-item.is-active { border-left-color: #c4a0b4; }

.rail-foot { margin-top: auto; }
.hint { font-family: var(--ui); font-size: 0.72rem; color: var(--rail-muted); line-height: 1.4; margin: 0 0 0.6rem; }
.hint.muted { opacity: 0.8; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.topbar h1 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.subtitle { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.8125rem; }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
#globalSearch {
  width: min(280px, 36vw);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.45rem 0.6rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  border-radius: var(--radius);
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.4rem 0.65rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  border-radius: var(--radius);
}
.btn:hover { border-color: var(--text-muted); }
.btn.ghost { background: transparent; }
.btn.primary {
  background: var(--btn-primary-bg);
  color: #fff;
  border-color: var(--btn-primary-border);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.is-on {
  background: var(--accent-soft);
  border-color: var(--part-head);
  color: var(--text-primary);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.workspace.notes-open {
  grid-template-columns: 1fr 320px;
}

.view {
  padding: 1.25rem 1.5rem 3rem;
  outline: none;
  min-height: 0;
  overflow: auto;
}
.view:has(.picture-layout) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.75rem 1rem 0.65rem;
}

.notes-panel {
  border-left: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.75rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  min-height: 0;
}
.notes-panel[hidden] { display: none !important; }
.notes-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.notes-head h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.notes-count {
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.notes-head-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.notes-context {
  margin: 0.2rem 0 0;
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  max-width: 16rem;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.notes-context:not(:disabled):hover { color: var(--text-primary); text-decoration: underline; }
.notes-context:disabled { cursor: default; opacity: 1; }
.notes-id-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.notes-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.notes-toolbar input[type="search"] {
  flex: 1 1 10rem;
  min-width: 0;
  width: auto;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.4rem 0.5rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  border-radius: var(--radius);
}
.notes-toolbar #notesCollapseAll {
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
}
.notes-scope { display: flex; gap: 0.3rem; }
.notes-scope .btn { flex: 1; font-size: 0.72rem; padding: 0.28rem 0.4rem; }

.notes-thread {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 6rem;
  padding-right: 0.1rem;
}
.notes-composer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.notes-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.notes-quick {
  font-family: var(--ui);
  font-size: 0.7rem;
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
}
.notes-quick:hover { border-color: var(--part-head); color: var(--text-primary); }
.notes-quick.is-on {
  background: var(--accent-soft);
  border-color: var(--part-head);
  color: var(--text-primary);
}
.note-empty-block {
  padding: 0.75rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.note-empty-hint {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.note-who { font-weight: 600; color: var(--text-primary); }
.note-who-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text-muted) 55%, transparent);
  text-underline-offset: 0.15em;
}
.note-who-btn:hover { color: var(--accent, var(--part-head)); }
.note-when { color: var(--text-muted); }
.note-when-abs { opacity: 0.85; }
.note-handoff {
  margin: 0.25rem 0 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--ui);
}
.note-ctx,
.note-anchor {
  font-size: 0.72rem;
  max-width: 100%;
  text-align: left;
}
.note-anchor-row { margin: 0.35rem 0 0; }
.note-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.note-context-actions .btn { font-size: 0.72rem; padding: 0.22rem 0.45rem; }
.note-place-inline {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.notes-index-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.notes-index-toolbar input[type="search"] {
  flex: 1;
  min-width: 12rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.4rem 0.5rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  border-radius: var(--radius);
}
.notes-index-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.notes-index-list .note-card {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  background: var(--surface-3);
  border-radius: var(--radius);
}
.notes-index-head { margin-bottom: 0.75rem; }
.notes-hint { font-family: var(--ui); font-size: 0.7rem; color: var(--text-muted); }

.notes-triage-presets { margin-top: 0.65rem; }
.notes-triage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
}
.notes-triage-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.notes-triage-filters select,
.note-chip-select {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--line, var(--border));
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text, var(--text-primary));
  min-width: 7.5rem;
}
.notes-composer-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0.45rem 0 0.15rem;
}
.note-track-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.note-track-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.note-tracking {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin: 0.4rem 0 0.25rem;
}
.note-card.priority-urgent {
  border-color: color-mix(in srgb, #d4654a 55%, var(--border));
  box-shadow: inset 3px 0 0 #d4654a;
}
.note-card.priority-high {
  border-color: color-mix(in srgb, #c4893a 40%, var(--border));
  box-shadow: inset 3px 0 0 #c4893a;
}
.note-chip-select.status-open { border-color: color-mix(in srgb, #6a8fad 50%, var(--border)); }
.note-chip-select.status-in_progress { border-color: color-mix(in srgb, #b8954a 55%, var(--border)); }
.note-chip-select.status-review { border-color: color-mix(in srgb, #8a7bb8 50%, var(--border)); }
.note-chip-select.status-completed { border-color: color-mix(in srgb, #5a9a6e 50%, var(--border)); opacity: 0.9; }
.note-chip-select.priority-low { opacity: 0.75; }
.note-chip-select.priority-urgent {
  border-color: #d4654a;
  color: #e8a090;
}
.note-chip-select.priority-high { border-color: #c4893a; }
.notes-inbox-strip {
  margin-bottom: 1rem;
  border-color: color-mix(in srgb, var(--part-head) 35%, var(--border));
}
.notes-urgent-count { color: #e07050; }

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: oklch(0.095 0.006 91 / 0.92);
  padding: 1.25rem;
}
.login-gate[hidden] { display: none !important; }
.login-card {
  width: min(420px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-primary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.login-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.login-brand .brand-mark {
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.login-brand .brand-name { color: var(--text-primary); }
.login-brand .brand-sub { color: var(--text-muted); }
.login-copy {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.login-field input {
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.65rem;
  background: var(--surface-3);
  font-family: var(--ui);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
}
.login-error {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.8rem;
  color: var(--danger);
}
.login-bootstrap {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.login-bootstrap code {
  font-size: 0.78rem;
  background: var(--surface-3);
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Fully hide app shell while signed out — no blurred preview */
.app.is-locked {
  display: none !important;
}

.session-chip {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius);
}
.session-chip .kicker { color: var(--text-muted); }
.session-name {
  margin: 0 0 0.15rem;
  font-family: var(--ui);
  font-size: 0.92rem;
  color: var(--text-primary);
}
.session-meta {
  margin: 0 0 0.5rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.session-actions { display: flex; gap: 0.35rem; }
.session-chip .btn.ghost {
  color: var(--text-secondary);
  border-color: var(--border);
  background: transparent;
}
.session-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.people-form .people-fields {
  display: grid;
  gap: 0.55rem;
  margin: 0.5rem 0 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.people-form label {
  display: grid;
  gap: 0.25rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.people-form .people-span { grid-column: 1 / -1; }
.people-form .people-projects .kicker { margin-bottom: 0.25rem; }
.people-form .people-proj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.4rem;
}
.people-projects-preview {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-form .people-check {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  align-content: end;
}
.people-form input[type="text"],
.people-form input[type="email"],
.people-form input[type="tel"],
.people-form select {
  font: inherit;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text-primary);
}
.people-name-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.people-name-btn:hover strong { text-decoration: underline; }
.people-contact-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.contact-card {
  position: absolute;
  z-index: 80;
  min-width: 16rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 8px 28px color-mix(in srgb, #000 28%, transparent);
  color: var(--text-primary);
}
.contact-card-inner { padding: 0.7rem 0.8rem 0.75rem; }
.contact-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.contact-card-name {
  font-family: var(--ui);
  font-size: 0.95rem;
}
.contact-card-close {
  padding: 0.1rem 0.35rem !important;
  line-height: 1.2;
}
.contact-card-meta {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.contact-card-row {
  margin: 0.3rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
}
.contact-card-k {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  min-width: 3.2rem;
}
.contact-card-row a { color: var(--text-primary); }
.contact-card-note {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}
.contact-card-empty {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.contact-copy { font-size: 0.7rem !important; padding: 0.15rem 0.4rem !important; }
.notes-export-group { flex-wrap: wrap; }
.midi-export-help {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 4rem;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 8px 28px color-mix(in srgb, #000 28%, transparent);
  color: var(--text-primary);
  font-family: var(--ui);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.midi-export-help[hidden] { display: none !important; }
.midi-export-help-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.midi-export-help-head strong {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.midi-export-help ol {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.15rem;
}
.midi-export-help li + li { margin-top: 0.35rem; }
.midi-export-help p { margin: 0 0 0.35rem; }
.people-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.85rem !important;
  color: var(--ink) !important;
}
.people-actions { white-space: nowrap; }
.people-activity {
  font-size: 0.82rem;
  line-height: 1.35;
  min-width: 9.5rem;
}
.people-activity-when,
.people-activity-ip,
.people-activity-counts { display: block; }
.people-ip {
  font-size: 0.78rem;
  word-break: break-all;
}
.people-activity-card p { margin: 0.35rem 0 0; }
.login-token-code {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.table tr.is-inactive { opacity: 0.55; }

.token-section { display: flex; flex-direction: column; gap: 0.3rem; }
.token-hint {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.68rem;
  color: var(--muted);
}
.token-entry {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--line);
  background: var(--surface-3);
  min-height: 2.2rem;
  cursor: text;
}
.token-chips {
  display: contents;
}
.token-input {
  flex: 1;
  min-width: 7rem;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--ui);
  font-size: 0.8rem;
  padding: 0.2rem 0.15rem;
  color: var(--ink);
}
.token-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  background: var(--surface-3);
  border: 1px solid var(--line);
  max-height: 12rem;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.token-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  padding: 0.4rem 0.55rem;
  font-family: var(--ui);
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--ink);
}
.token-suggest-item:last-child { border-bottom: 0; }
.token-suggest-item:hover,
.token-suggest-item.is-on { background: var(--surface-2); }

.tok {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: var(--ui);
  font-size: 0.7rem;
  padding: 0.12rem 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-secondary);
  line-height: 1.2;
  border-radius: var(--radius);
}
button.tok { cursor: pointer; }
button.tok:hover { border-color: var(--part-head); color: var(--text-primary); }
.tok-kind {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.58rem;
  color: var(--text-muted);
}
.tok-x { color: var(--text-muted); font-size: 0.9rem; line-height: 1; }
.tok-user { border-left: 2px solid #c98500; }
.tok-role { border-left: 2px solid var(--part-head); }
.tok-dept { border-left: 2px solid #199e70; }
.tok-craft { border-left: 2px solid #8a897f; }
.tok-character { border-left: 2px solid #d95926; }
.tok-status { border-left: 2px solid #c98500; }
.tok-risk { border-left: 2px solid var(--danger); }
.tok-tag { border-left: 2px solid #9b7bd4; }

[data-theme="light"] .tok {
  background: #f4f1ec;
  color: var(--ink);
}
[data-theme="light"] .tok-user { background: #f3ebe3; }
[data-theme="light"] .tok-role { background: #efe8ec; }
[data-theme="light"] .tok-dept { background: #e9f0ea; }
[data-theme="light"] .tok-craft { background: #eef3f0; }
[data-theme="light"] .tok-character { background: #f6ecec; }
[data-theme="light"] .tok-status { background: #f3efe4; }
[data-theme="light"] .tok-risk { background: #f3e4e0; }
[data-theme="light"] .tok-tag { background: #efeaf4; }

[data-theme="light"] .pill.craft { border-color: #c9d5cf; background: #eef3f0; color: var(--ink); }
[data-theme="light"] .pill.open { border-color: #dcc9a0; background: #f7f0e2; color: var(--warn); }
[data-theme="light"] .pill.seq { background: var(--accent-soft); border-color: #d4c0ca; color: var(--ink); }
[data-theme="light"] .pill.risk-high { background: #f3e4e0; border-color: #e0c4bc; color: var(--ink); }
[data-theme="light"] .pill.risk-prefer { background: #f3efe4; border-color: #ddd4b8; color: var(--ink); }

[data-theme="light"] .login-gate { background: #1c1a17; }
[data-theme="light"] .login-card {
  background: #f7f4ef;
  color: #1c1a17;
  border-color: #ddd4c8;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
[data-theme="light"] .login-brand .brand-mark { background: #7a4a5c; color: #fff; border-color: #7a4a5c; }
[data-theme="light"] .login-brand .brand-name { color: #1c1a17; }
[data-theme="light"] .login-brand .brand-sub,
[data-theme="light"] .login-copy,
[data-theme="light"] .login-field,
[data-theme="light"] .login-bootstrap { color: #6b6560; }
[data-theme="light"] .login-field input {
  background: #fff;
  color: #1c1a17;
  border-color: #ddd4c8;
}

[data-theme="light"] .script-reader {
  background: #fff;
}
[data-theme="light"] .script-reader pre { color: var(--ink); }
[data-theme="light"] .scene-list button.is-active { background: #efeae2; color: var(--ink); }
[data-theme="light"] .char-table tr.is-focus { background: #f7f1ec; }
[data-theme="light"] .char-table tr:hover { background: #f7f4ef; }
[data-theme="light"] .co-matrix td.has-co { background: #f3efe8; }
[data-theme="light"] .stub {
  background: #f7f4ef;
  border-color: #b7b0a4;
  color: var(--ink);
}
[data-theme="light"] .toast {
  background: var(--rail);
  color: var(--rail-ink);
  border-color: #4a524e;
}
[data-theme="light"] .legend-item i { border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .notes-panel,
[data-theme="light"] .card,
[data-theme="light"] .note-card {
  background: var(--panel);
}
[data-theme="light"] .notes-index-list .note-card,
[data-theme="light"] .token-entry,
[data-theme="light"] .token-suggest,
[data-theme="light"] .token-suggest-item,
[data-theme="light"] #notesEditor,
[data-theme="light"] .people-form input[type="text"],
[data-theme="light"] .people-form input[type="email"],
[data-theme="light"] .people-form input[type="tel"],
[data-theme="light"] .people-form select,
[data-theme="light"] #globalSearch,
[data-theme="light"] .notes-toolbar input[type="search"],
[data-theme="light"] .notes-index-toolbar input[type="search"],
[data-theme="light"] .notes-quick,
[data-theme="light"] .btn:not(.primary):not(.ghost) {
  background: #fff;
  color: var(--ink);
}
[data-theme="light"] .token-suggest-item.is-on,
[data-theme="light"] .token-suggest-item:hover { background: #f7f4ef; }

.theme-toggle {
  font-size: 0.75rem;
  min-width: 4.5rem;
}

.media-lab-banner {
  margin-bottom: 1rem;
  border-color: var(--part-head);
}
.media-lab-source { margin: 0.35rem 0 0.65rem; font-size: 0.875rem; }

.picture-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: 100%;
}
.picture-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  min-width: 0;
  min-height: 0;
}
.picture-stems {
  min-width: 0;
  min-height: 8rem;
  flex: 1 1 auto;
  overflow: auto;
}
.picture-player-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 8rem;
  overflow: hidden;
  padding: 0.55rem 0.7rem 0.45rem;
}
.picture-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
#picturePark {
  display: none !important;
}
[data-theme="light"] .picture-stage {
  background: #fff;
}
.picture-load {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.75rem 0.65rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #f2f2f2;
  pointer-events: none;
  z-index: 2;
}
.picture-load[hidden] {
  display: none !important;
}
.picture-load-label {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
  opacity: 0.92;
}
.picture-load-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.picture-load-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--part-head, #c4a35a);
  transition: width 0.15s ease-out;
}
[data-theme="light"] .picture-load {
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.88));
  color: #1a1a1a;
}
[data-theme="light"] .picture-load-track {
  background: rgba(0, 0, 0, 0.12);
}
.picture-split {
  flex: 0 0 10px;
  position: relative;
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  background: transparent;
}
.picture-split::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 1px;
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
}
.picture-split:hover::before,
.picture-split:focus-visible::before,
.picture-split.is-dragging::before {
  background: var(--part-head);
  height: 3px;
}
.picture-split:focus-visible {
  outline: none;
}
.picture-split.is-dragging {
  background: color-mix(in srgb, var(--part-head) 12%, transparent);
}
.picture-player-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}
.picture-player-title { margin: 0; }
.media-picture-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.65rem 0 0;
}
.media-picture-row {
  border: 1px solid var(--border, rgba(127,127,127,0.35));
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}
.media-picture-row.is-hero {
  border-color: var(--accent, #c4a06a);
  background: color-mix(in srgb, var(--accent, #c4a06a) 12%, transparent);
}
.media-picture-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.media-picture-row-label { font-size: 0.95rem; }
.media-picture-row-actions { flex-shrink: 0; }
.picture-transport {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.picture-transport .picture-meter {
  margin: 0;
  gap: 0.4rem 0.55rem;
}
.picture-transport .picture-tc {
  font-size: 0.95rem;
}
.picture-transport .picture-tc-jump {
  margin: 0;
  gap: 0.3rem;
}
.picture-transport .picture-tc-jump-label {
  font-size: 0.7rem;
}
.picture-transport .picture-tc-input {
  width: 7.5rem;
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
}
.picture-transport .btn {
  font-size: 0.75rem;
  padding: 0.28rem 0.45rem;
}
.picture-help {
  position: relative;
}
.picture-help-btn {
  min-width: 1.7rem;
  font-weight: 700;
  padding: 0.28rem 0.4rem;
}
.picture-help-pop {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 12;
  width: min(22rem, 78vw);
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.picture-help-pop .picture-spotting-list {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.picture-help-pop .picture-spotting-list li + li { margin-top: 0.18rem; }
.picture-controls {
  display: none;
}
.picture-spotting {
  min-width: 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 1px solid var(--line);
}
@media (max-width: 720px) {
  .picture-spotting {
    padding: 0.75rem 0 0;
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
.picture-spotting-details > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.picture-spotting-details > summary::-webkit-details-marker { display: none; }
.picture-spotting-details > summary::after {
  content: ' ▸';
  font-size: 0.75em;
  color: var(--text-muted);
}
.picture-spotting-details[open] > summary::after { content: ' ▾'; }
.picture-spotting .kicker { margin: 0 0 0.35rem; }
.picture-spotting-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.picture-spotting-list li + li { margin-top: 0.2rem; }
.picture-spotting-list kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75em;
  padding: 0.05rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.picture-video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 0;
  margin: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.picture-video:focus,
.picture-video:focus-visible,
.picture-video:hover {
  outline: none;
  background: #000;
  filter: none;
  box-shadow: none;
}
[data-theme="light"] .picture-video,
[data-theme="light"] .picture-video:hover,
[data-theme="light"] .picture-video:focus,
[data-theme="light"] .picture-video:focus-visible {
  background: #fff;
}
.picture-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: baseline;
  font-family: var(--ui);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}
.picture-tc {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: text;
}
.picture-tc:hover { color: var(--part-head); }
.picture-secs { color: var(--text-muted); font-size: 0.85rem; }
.picture-fps { color: var(--text-muted); font-size: 0.75rem; }
.picture-tc-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.35rem 0 0.5rem;
}
.picture-tc-jump-label {
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.picture-tc-input,
.notes-tc-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  width: 9.5rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
}
.picture-tc-input.is-invalid,
.notes-tc-input.is-invalid {
  border-color: var(--danger);
}
.picture-tc-input:focus,
.notes-tc-input:focus {
  outline: none;
  border-color: var(--part-head);
}
.picture-actions { margin-top: 0.65rem; }
.picture-file-label { cursor: pointer; display: inline-flex; align-items: center; }

.note-tc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--part-head);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.12rem 0.35rem;
  cursor: pointer;
}
.note-tc:hover { border-color: var(--part-head); }
.note-retime {
  font-size: 0.85rem;
  padding: 0.1rem 0.35rem;
  line-height: 1;
  color: var(--text-muted);
}
.note-retime:hover { color: var(--part-head); border-color: var(--part-head); }

.pending-picture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-height: 0;
  margin: 0.25rem 0 0.15rem;
}
.pending-picture-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--part-head);
  border: 1px solid var(--part-head);
  border-radius: var(--radius);
  padding: 0.2rem 0.45rem;
  background: var(--accent-soft);
}
.pending-picture-chip[hidden] { display: none !important; }

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.35rem;
}

.note-card {
  border: 1px solid var(--border);
  background: var(--surface-3);
  padding: 0.5rem 0.6rem;
  font-family: var(--ui);
  font-size: 0.82rem;
  border-radius: var(--radius);
}
.note-card.is-compact {
  padding: 0.28rem 0.4rem;
}
.note-card.is-compact .note-detail {
  display: none;
}
.note-card.is-expanded .note-compact-preview {
  font-weight: 550;
}
.note-compact-row {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.45rem;
  min-width: 0;
  width: 100%;
}
.note-card:not(.is-compact) .note-compact-row {
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.note-compact-toggle {
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0.1rem 0.15rem;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.note-compact-toggle:hover { color: var(--text-primary); }
.note-compact-chevron {
  display: inline-block;
  width: 0.75rem;
  font-size: 0.7rem;
}
.note-compact-preview {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.1rem 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-compact-preview:hover { color: var(--part-head); }
.note-compact-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  flex: 0 1 auto;
  max-width: 45%;
  justify-content: flex-end;
}
.note-compact-status,
.note-compact-pri,
.note-compact-who {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 5.5rem;
}
.note-compact-pri.priority-urgent,
.note-compact-pri.priority-high {
  color: var(--warn, #c98500);
  font-weight: 600;
}
.note-compact-status.status-completed { opacity: 0.7; }
.note-tc-empty {
  opacity: 0.45;
  cursor: default;
  border-style: dashed;
}
.note-collapse {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
}
.note-card .note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
  align-items: center;
}
.note-card .note-delete {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  color: var(--text-muted);
}
.note-card .note-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.note-card .note-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
}
.note-edit-block { margin-top: 0.4rem; }
.note-edit-body {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  box-sizing: border-box;
}
.note-edit-body:focus {
  outline: none;
  border-color: var(--part-head);
}
.note-edit-actions {
  margin-top: 0.45rem;
  align-items: center;
}
.note-edit-tc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.4rem 0.5rem;
  margin-top: 0.45rem;
}
.note-edit-tc-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex: 1 1 10rem;
  min-width: 8rem;
}
.note-edit-tc {
  font: inherit;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line, var(--border));
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text, var(--text-primary));
  width: 100%;
  max-width: 12rem;
  box-sizing: border-box;
}
.note-edit-tc.is-invalid {
  border-color: #c45c4a;
}
.note-card.is-editing {
  border-color: color-mix(in srgb, var(--part-head) 45%, var(--line));
}
.note-empty {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

#notesEditor {
  width: 100%;
  min-height: 4.2rem;
  max-height: 40vh;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 0.55rem 0.6rem;
  background: var(--surface-3);
  line-height: 1.45;
  font-family: var(--ui);
  font-size: 0.88rem;
}
.notes-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--muted);
}
.notes-meta .btn.primary { margin-right: auto; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .workspace.notes-open { grid-template-columns: 1fr; }
  .notes-panel { position: fixed; right: 0; top: 0; height: 100vh; width: min(360px, 92vw); z-index: 20; box-shadow: -8px 0 32px rgba(0,0,0,0.45); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: relative; height: auto; }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
}
.card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.card p { margin: 0 0 0.55rem; }
.card p:last-child { margin-bottom: 0; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.pill {
  font-family: var(--ui);
  font-size: 0.72rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-secondary);
  border-radius: var(--radius);
}
.pill.craft { border-color: oklch(0.45 0.04 147); background: oklch(0.22 0.03 147); }
.pill.open { border-color: oklch(0.55 0.08 85); background: oklch(0.24 0.04 85); color: oklch(0.86 0.08 85); }
.pill.seq { background: var(--accent-soft); border-color: var(--part-head); color: var(--text-primary); }

.ch {
  padding: 0.05em 0.22em;
  border-radius: 0.15em;
  color: var(--highlight-ink);
}
.ch-sam { background: var(--ch-sam); }
.ch-fuller { background: var(--ch-fuller); }
.ch-caleb { background: var(--ch-caleb); }
.ch-josh { background: var(--ch-josh); }
.ch-richardson { background: var(--ch-richardson); }
.ch-ron { background: var(--ch-ron); }
.ch-parents { background: var(--ch-parents); }
.ch-unit { background: var(--ch-unit); }
.ch-evans { background: var(--ch-evans); }
.ch-michael { background: var(--ch-michael); }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.script-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 980px) {
  .script-layout { grid-template-columns: 1fr; }
}
.scene-list {
  border: 1px solid var(--line);
  background: var(--panel);
  max-height: calc(100vh - 160px);
  overflow: auto;
  position: sticky;
  top: 90px;
}
.scene-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.55rem 0.65rem;
  font-family: var(--ui);
  font-size: 0.75rem;
  line-height: 1.35;
}
.scene-list button:hover,
.scene-list button.is-active { background: var(--accent-soft); color: var(--text-primary); }
.scene-list .pg {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
}

.script-reader {
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 1.25rem 1.35rem 2rem;
  min-height: 60vh;
  border-radius: var(--radius);
}
.script-reader .heading {
  font-family: var(--ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
  color: var(--text-primary);
}
.script-reader pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.script-reader .ch-hit {
  border: 0;
  padding: 0.05em 0.2em;
  border-radius: 0.15em;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.script-reader .ch-hit:hover {
  outline: 1px solid var(--text-muted);
}
.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.filters button.is-on {
  background: var(--btn-primary-bg);
  color: #fff;
  border-color: var(--btn-primary-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th, .table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-family: var(--ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.arc {
  border-left: 2px solid var(--line);
  padding-left: 0.75rem;
  margin: 0.65rem 0;
}
.arc-stage { font-weight: 650; }
.arc-meta { font-family: var(--ui); font-size: 0.78rem; color: var(--muted); }

.stub {
  border: 1px dashed var(--border);
  padding: 2rem 1.25rem;
  background: var(--surface-2);
  text-align: center;
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.stub h2 { margin: 0 0 0.5rem; }

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--surface-3);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  font-family: var(--ui);
  font-size: 0.8125rem;
  z-index: 50;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.legend { display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem; margin: 0.5rem 0 1rem; }
.legend span,
.legend-item {
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--muted);
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.legend i,
.legend-item i {
  width: 0.8rem;
  height: 0.8rem;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.legend-item {
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  border-radius: 0.15rem;
}
.legend-item:hover { border-color: var(--border); color: var(--text-primary); background: var(--surface-3); }
.legend-item.is-focus {
  border-color: var(--part-head);
  color: var(--text-primary);
  background: var(--accent-soft);
}
.legend-item.is-selected {
  box-shadow: inset 0 -2px 0 var(--part-head);
}

.kicker {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

/* Characters · lines / together / ADR */
.char-select-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
}
.char-select-bar.is-empty {
  background: transparent;
  border-style: dashed;
}
.char-select-hint {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}
.char-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 8rem;
}
.char-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--ui);
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  background: var(--surface-3);
  cursor: pointer;
}
.char-select-chip:hover { border-color: var(--accent); }
.char-select-x { color: var(--muted); font-size: 1rem; line-height: 1; }
.char-select-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.char-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.95fr);
  gap: 1rem;
  margin-top: 0.85rem;
  align-items: start;
}
@media (max-width: 980px) {
  .char-layout { grid-template-columns: 1fr; }
}
.char-summary { margin-bottom: 0; }
.char-roster { overflow: auto; padding: 0.5rem 0.65rem; }
.char-side { position: sticky; top: 0.75rem; }
.char-table th.num,
.char-table td.num,
.table th.num,
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.char-table th.sel,
.char-table td.sel {
  width: 2rem;
  text-align: center;
  vertical-align: middle;
}
.char-table td.sel input { cursor: pointer; accent-color: var(--part-head); }
.char-table tr.is-focus { background: var(--accent-soft); }
.char-table tr.is-selected td.sel { box-shadow: inset 3px 0 0 var(--part-head); }
.char-table tr { cursor: pointer; }
.char-table tr:hover { background: var(--surface-3); }
.char-name-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.char-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
}
.char-name-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
  line-height: 1.25;
}
.char-name-full {
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}
.char-actor {
  display: block;
  margin: 0;
  font-family: var(--ui);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-muted);
}
.char-actor-detail {
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.char-cast-source {
  margin: 0.35rem 0 0;
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.char-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}
.char-detail-head h3 { margin: 0; }
.co-pair {
  display: inline-flex;
  align-items: stretch;
  margin: 0 0.2rem 0.2rem 0;
}
.co-pair .pill {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  cursor: pointer;
}
.co-add {
  font-family: var(--ui);
  font-size: 0.78rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-left: none;
  background: var(--surface-3);
  cursor: pointer;
  color: var(--muted);
}
.co-add:hover { color: var(--text-primary); background: var(--surface-3); }
.char-scene-list { line-height: 1.55; }
.dim { color: var(--muted); font-weight: 400; margin-left: 0.1rem; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.65rem 0 0.85rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-row .stat-n {
  display: block;
  font-family: var(--ui);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-row .stat-l {
  font-family: var(--ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.char-chip .ch { pointer-events: none; }
.co-matrix th,
.co-matrix td { font-size: 0.78rem; white-space: nowrap; }
.co-matrix td.has-co { background: oklch(0.24 0.03 147); }
.select-inline {
  font-family: var(--ui);
  font-size: 0.78rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--line);
  background: var(--surface-3);
}
.pill.risk-high { background: oklch(0.22 0.045 25); border-color: oklch(0.45 0.08 25); color: #f0a0a0; }
.pill.risk-prefer { background: oklch(0.24 0.04 85); border-color: oklch(0.5 0.08 85); color: oklch(0.88 0.08 85); }
.char-detail-empty { color: var(--muted); }

/* —— Media management —— */
.media-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  grid-template-areas:
    "pic bus"
    "pic stems";
  align-items: start;
}
.media-picture-card { grid-area: pic; }
.media-bus-card { grid-area: bus; min-width: 0; }
.media-stems-section { grid-area: stems; min-width: 0; }
.media-bus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.media-bus-block .kicker { margin: 0 0 0.35rem; }
@media (max-width: 960px) {
  .media-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "pic"
      "bus"
      "stems";
  }
  .media-bus-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .media-bus-grid { grid-template-columns: 1fr; }
}
.media-file-title {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.05rem;
}
.media-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.media-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.45rem 0;
}
.media-field-row label { min-width: 8rem; font-size: 0.85rem; }
.media-offset-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.media-offset-sign {
  min-width: 1.75rem;
  padding: 0.2rem 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
}
.media-offset-sign.is-neg {
  border-color: var(--part-head);
  color: var(--part-head);
}
.media-offset-tc {
  width: 8.5rem;
  max-width: 9.5rem;
}
.media-offset-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
}
.media-field-row select,
.media-field-row input[type="number"],
.media-gain-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: var(--radius);
  max-width: 9rem;
}
.media-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0 !important;
}
.media-stem-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.media-stem-table th,
.media-stem-table td {
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.media-stem-table tr.is-solo { background: color-mix(in srgb, var(--part-head) 12%, transparent); }
.media-stem-table tr.is-muted-row { opacity: 0.55; }
.media-ms { white-space: nowrap; }
.media-ms .btn.is-on,
.mixer-row .btn.is-on {
  border-color: var(--part-head);
  color: var(--part-head);
}
.media-wave-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-right: 0.35rem;
}
.picture-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.picture-mixer-card { min-width: 0; }
.picture-wave-canvas {
  display: block;
  width: 100%;
  height: 72px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 0.65rem;
  background: var(--surface-3);
}
.viewer-wave-canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: 56px;
  margin: 0;
  box-sizing: border-box;
}
.viewer-waves-card {
  min-width: 0;
  width: 100%;
  padding: 0.55rem 0.65rem 0.6rem;
  margin: 0;
}
.viewer-waves-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.viewer-waves-toolbar .kicker { margin: 0; margin-right: auto; }
.viewer-wave-lanes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
.viewer-wave-lane {
  position: relative;
  display: block;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.viewer-lane-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  /* Above lane-head gradient so the bar stays solid end-to-end */
  z-index: 4;
  pointer-events: none;
  background: #e07050;
}
.viewer-lane-playhead[hidden] {
  display: none !important;
}
[data-theme="light"] .viewer-lane-playhead {
  background: #b84a2e;
}
.viewer-wave-lane.is-active {
  border-color: color-mix(in srgb, var(--stem-tint, var(--part-head)) 55%, transparent);
  background: color-mix(in srgb, var(--stem-tint, var(--part-head)) 10%, transparent);
}
.viewer-wave-lane.is-sip {
  border-color: var(--stem-tint, var(--part-head));
  box-shadow: inset 3px 0 0 var(--stem-tint, var(--part-head));
}
.viewer-wave-lane.is-solo:not(.is-sip) {
  border-color: color-mix(in srgb, var(--stem-tint, var(--part-head)) 40%, transparent);
  background: color-mix(in srgb, var(--stem-tint, var(--part-head)) 8%, transparent);
}
.viewer-wave-lane.is-solo-dimmed .mixer-name {
  color: var(--text-muted);
}
.viewer-wave-lane.is-solo-dimmed .viewer-role-tag,
.viewer-wave-lane.is-solo-dimmed .viewer-bus-hint {
  opacity: 0.65;
}
.viewer-wave-lane.is-muted-row .viewer-wave-canvas {
  /* mute cue is greyscale paint — keep lane chrome readable */
  filter: none;
}
.viewer-wave-lane.is-muted-row .mixer-name {
  color: var(--text-muted);
}
.viewer-wave-lane-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
  min-width: 0;
  width: 100%;
  padding: 0.12rem 0.35rem;
  box-sizing: border-box;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-1) 88%, transparent) 0%,
    color-mix(in srgb, var(--surface-1) 35%, transparent) 70%,
    transparent 100%
  );
}
.viewer-wave-lane-head > * { pointer-events: auto; }
.viewer-wave-lane-head .mixer-name {
  flex: 1 1 auto;
  min-width: 4rem;
  font-size: 0.72rem;
  padding: 0.05rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-wave-lane-head .btn {
  font-size: 0.68rem;
  padding: 0.12rem 0.35rem;
  line-height: 1.1;
}
.viewer-role-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 0.05rem 0.28rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.viewer-bus-hint {
  white-space: nowrap;
  font-size: 0.65rem;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}
.viewer-level {
  width: 0.45rem;
  height: 1.1rem;
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.viewer-level-fill {
  width: 100%;
  height: 0%;
  background: #3d9e5a;
  transition: height 60ms linear, background-color 80ms linear;
}
.viewer-level-fill.is-warm { background: #e09820; }
.viewer-level-fill.is-hot { background: #e07030; }
.media-stem-wave,
.viewer-wave-canvas,
.picture-wave-canvas {
  background: #1a1816;
}
[data-theme="light"] .media-stem-wave,
[data-theme="light"] .viewer-wave-canvas,
[data-theme="light"] .picture-wave-canvas {
  background: #ebe7e0;
}
.media-stem-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  background: var(--stem-tint, #c4a0b4);
  flex-shrink: 0;
}
.media-stem-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.media-stem-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--surface-3) 70%, transparent);
  min-width: 0;
}
.media-stem-card.is-solo {
  border-color: color-mix(in srgb, var(--part-head) 50%, transparent);
}
.media-stem-card.is-muted-row { opacity: 0.65; }
.media-stem-card.is-hidden-from-viewer {
  opacity: 0.72;
  border-style: dashed;
}
.media-stem-card.is-hidden-from-viewer .media-stem-wave {
  filter: grayscale(1);
  opacity: 0.7;
}
.media-stem-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.45rem;
}
.media-stem-card-title {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  min-width: 0;
}
.media-stem-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  max-width: 100%;
}
.media-stem-card-actions .btn {
  font-size: 0.72rem;
  padding: 0.22rem 0.4rem;
}
.media-stem-wave {
  display: block;
  width: 100%;
  height: 56px;
  border-radius: var(--radius);
  background: var(--surface-3);
  margin-bottom: 0.55rem;
}
.media-stem-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem 0.85rem;
  align-items: end;
}
.media-stem-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
}
.media-stem-field select,
.media-stem-field .media-gain-input {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.media-stem-wave-tools {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  text-transform: none;
  letter-spacing: normal;
}
.media-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.media-color-chip {
  width: 1rem;
  height: 1rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: var(--swatch);
  padding: 0;
  cursor: pointer;
}
.media-color-chip.is-on {
  outline: 2px solid var(--text-primary);
  outline-offset: 1px;
}
.media-color-picker {
  width: 1.5rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.mixer-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.mixer-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.mixer-row.is-active { border-color: var(--part-head); background: color-mix(in srgb, var(--part-head) 10%, transparent); }
.mixer-row.is-muted-row { opacity: 0.55; }
.mixer-name {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.mixer-name:hover { color: var(--part-head); }

