:root {
  color-scheme: dark;
  --bg: #11120f;
  --ink: #f2f0e8;
  --muted: #aaa8a0;
  --panel: #191a17;
  --panel-soft: #20211d;
  --panel-strong: #292a25;
  --line: #3b3c36;
  --accent: #e9e6d8;
  --accent-ink: #171813;
  --blue: #60a5fa;
  --danger: #fb7185;
  --warn-bg: #332816;
  --warn-line: #d6a64c;
  --brand-black: #1d1f1a;
  --brand-cream: #efeee6;
  --brand-grey: #9f9f98;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  --field-bg: #0e1620;
  --control-bg: #16212d;
  --surface-bg: #0f1720;
  --surface-strong: #20211d;
  --drop-start: #14202b;
  --rider-head-bg: #101821;
  --table-bg: #0f1720;
  --table-head-bg: #172231;
  --table-hover-bg: #142234;
  --channel-mode-top: #0d1823;
  --channel-mode-bottom: #0a121b;
  --sidebar-width: 520px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(239, 238, 230, 0.09), transparent 340px),
    linear-gradient(180deg, #1a1b17 0, var(--bg) 320px);
  color: var(--ink);
}

body.light-theme {
  color-scheme: light;
  --bg: #f4f3ee;
  --ink: #171813;
  --muted: #5f6259;
  --panel: #ffffff;
  --panel-soft: #f5f4ee;
  --panel-strong: #ebe9df;
  --line: #d7d4c8;
  --accent: #1d1f1a;
  --accent-ink: #f7f5ec;
  --brand-cream: #ffffff;
  --brand-grey: #74766d;
  --shadow: 0 14px 32px rgba(29, 31, 26, 0.12);
  --field-bg: #fffdf7;
  --control-bg: #f0eee4;
  --surface-bg: #f5f4ee;
  --surface-strong: #ebe9df;
  --drop-start: #ebe9df;
  --rider-head-bg: #f5f4ee;
  --table-bg: #ffffff;
  --table-head-bg: #e9e6d8;
  --table-hover-bg: #edf4ff;
  --channel-mode-top: #f5f4ee;
  --channel-mode-bottom: #ffffff;
  background:
    radial-gradient(circle at top left, rgba(29, 31, 26, 0.07), transparent 340px),
    linear-gradient(180deg, #ffffff 0, var(--bg) 320px);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 18px;
  place-items: center;
}

.login-card {
  background: rgba(25, 26, 23, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-width: 390px;
  padding: 26px;
  width: min(100%, 390px);
}

.login-card img {
  display: block;
  height: 66px;
  object-fit: contain;
  object-position: left center;
  width: 132px;
}

.login-card h1 {
  font-size: 1.55rem;
  line-height: 1.05;
  margin: -4px 0 2px;
}

.login-card .primary-btn {
  width: 100%;
}

.login-error {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 7px;
  color: #fecdd3;
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0;
  padding: 9px 10px;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar,
.workspace {
  max-width: 1760px;
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  min-height: 58px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 13px;
  min-width: 0;
}

.brand-lockup img {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  height: 54px;
  object-fit: contain;
  padding: 0;
  width: 54px;
}

.eyebrow {
  color: var(--brand-grey);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.35rem);
}

h2 {
  font-size: 1.05rem;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

.topbar-actions,
.export-actions,
.rider-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, var(--sidebar-width)) 14px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.setup-panel {
  margin-right: 6px;
}

.patch-panel {
  margin-left: 6px;
}

.workspace-resizer {
  align-self: stretch;
  cursor: col-resize;
  min-height: calc(100vh - 112px);
  position: relative;
  touch-action: none;
}

.workspace-resizer::before {
  background: var(--line);
  border-radius: 999px;
  content: "";
  inset: 8px 5px;
  opacity: 0.75;
  position: absolute;
  transition: background 0.15s ease, opacity 0.15s ease, inset 0.15s ease;
}

.workspace-resizer:hover::before,
.workspace-resizer:focus-visible::before,
body.is-resizing-workspace .workspace-resizer::before {
  background: var(--accent);
  inset-inline: 4px;
  opacity: 1;
}

body.is-resizing-workspace {
  cursor: col-resize;
  user-select: none;
}

.panel,
.rider-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-header.compact {
  align-items: start;
  flex-wrap: wrap;
}

.patch-panel .panel-header.compact > div:first-child {
  min-width: 220px;
}

.patch-panel .export-actions {
  gap: 6px;
  justify-content: end;
  margin-left: auto;
}

.patch-panel .export-actions button,
.patch-panel .row-actions button,
.patch-tabs .ghost-btn {
  min-height: 32px;
  padding-inline: 9px;
}

.list-controls {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(170px, 280px) minmax(260px, 1fr);
  margin: -2px 0 10px;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.row-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patch-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 10px;
}

.patch-tab {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
  min-height: 34px;
  padding: 7px 10px;
}

.patch-tab.is-active {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.input-only,
.output-only {
  margin-left: auto;
}

label {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.15;
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--control-bg);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  font-size: 0.84rem;
  min-height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 8px 10px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-ink);
}

.ghost-btn {
  background: var(--surface-bg);
  color: var(--ink);
  border-color: var(--line);
}

.ghost-btn:hover,
.primary-btn:hover {
  filter: brightness(0.98);
}

.danger-btn {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.08);
  border-color: var(--line);
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.upload-action {
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.upload-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.festival-fields,
.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar {
  grid-template-columns: 1fr 210px;
}

.block-color-panel {
  align-items: center;
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 132px 1fr;
  margin-bottom: 10px;
  padding: 10px;
}

.block-color-panel strong {
  color: var(--ink);
  display: block;
  font-size: 0.86rem;
}

.block-color-panel span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  margin-top: 2px;
}

.block-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.block-color-editor {
  display: grid;
  gap: 10px;
}

.color-tabs {
  display: inline-flex;
  gap: 4px;
}

.color-tab {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 30px;
  padding: 5px 10px;
}

.color-tab.is-active {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.block-color {
  align-items: center;
  background: color-mix(in srgb, var(--block-color) 16%, var(--field-bg));
  border: 1px solid color-mix(in srgb, var(--block-color) 55%, var(--line));
  border-radius: 7px;
  color: var(--ink);
  display: flex;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
}

.block-color span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
  min-width: 42px;
}

.block-color input {
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  height: 22px;
  min-height: 22px;
  padding: 0;
  width: 32px;
}

.mic-panel {
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
}

.output-capacity-panel {
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
}

.output-capacity-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
}

.output-capacity-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.mic-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
}

.mic-database-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.mic-db-row,
.mic-add-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto 30px;
}

.mic-add-row {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}

.mic-db-row input[type="text"],
.mic-add-row input {
  min-height: 34px;
}

.mic-phantom-toggle {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  justify-content: center;
  margin: 0;
  min-height: 34px;
  padding: 0 8px;
  white-space: nowrap;
}

.mic-phantom-toggle input {
  accent-color: var(--accent);
  margin: 0;
}

.mic-phantom-toggle:has(input:checked) {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.45);
  color: var(--ink);
}

.mic-remove {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 30px;
}

.mic-remove:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.drop-zone {
  align-items: center;
  border: 1px dashed rgba(45, 212, 191, 0.5);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--drop-start), var(--surface-bg));
  color: var(--ink);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 86px;
  padding: 14px;
  text-align: left;
}

.drop-zone-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.drop-zone strong {
  font-size: 1.05rem;
}

.drop-zone span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  max-width: 560px;
}

.drop-zone-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-end;
  max-width: 260px;
  flex-wrap: wrap;
}

.ai-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  flex: 1 0 100%;
  gap: 6px;
  justify-content: flex-end;
  min-height: 20px;
  order: 2;
  padding: 0;
  white-space: nowrap;
}

.ai-toggle input {
  accent-color: var(--accent);
  min-height: auto;
  width: auto;
}

.ai-toggle span {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 750;
}

.upload-action,
.file-info {
  order: 1;
}

.file-info {
  position: relative;
}

.file-info summary {
  align-items: center;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  list-style: none;
  width: 32px;
}

.file-info summary::-webkit-details-marker {
  display: none;
}

.file-info span {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: none;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 8px 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  z-index: 3;
}

.file-info[open] span,
.file-info:hover span,
.file-info:focus-within span {
  display: block;
}

.drop-zone.is-dragging {
  outline: 3px solid rgba(45, 212, 191, 0.24);
}

.status-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.status-list:empty {
  display: none;
}

.status-list div {
  background: var(--surface-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 8px 10px;
}

.rider-list {
  display: grid;
  gap: 12px;
}

.rider-card {
  box-shadow: none;
  overflow: hidden;
}

.rider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--rider-head-bg);
  border-bottom: 1px solid var(--line);
}

.rider-title {
  display: grid;
  gap: 3px;
}

.rider-title span {
  color: var(--muted);
  font-size: 0.84rem;
}

.rider-lines {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding: 12px;
}

.line-grid {
  display: grid;
  grid-template-columns: 30px minmax(150px, 1.2fr) minmax(110px, 0.8fr) minmax(82px, 0.55fr) 54px minmax(160px, 1fr) 38px;
  gap: 6px;
  min-width: 800px;
  align-items: center;
}

.line-grid-head {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.line-row input {
  min-height: 36px;
}

.line-row.is-dragging {
  opacity: 0.55;
}

.line-row.is-drop-target {
  outline: 1px solid rgba(239, 238, 230, 0.24);
}

.line-row.is-drop-before {
  border-top: 2px solid var(--accent);
}

.line-row.is-drop-after {
  border-bottom: 2px solid var(--accent);
}

.line-drag {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: grab;
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  padding: 0;
  touch-action: none;
  user-select: none;
  width: 30px;
}

.line-drag:active {
  cursor: grabbing;
}

.check-cell {
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field-bg);
}

.check-cell input {
  min-height: auto;
  width: auto;
}

.remove-line {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 36px;
  min-height: 36px;
  background: var(--table-bg);
  color: var(--danger);
}

.add-line {
  justify-self: start;
  margin-top: 4px;
}

.warnings {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #ffe7a3;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  width: 100%;
}

table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8rem;
  background: var(--table-bg);
}

table.materials-table {
  min-width: 440px;
}

table.materials-table .col-device,
table.materials-table .col-stand,
table.materials-table .col-phantom,
table.materials-table .col-notes,
table.materials-table .col-bands,
table.materials-table th:nth-child(n+5),
table.materials-table td:nth-child(n+5) {
  display: none;
}

table.materials-table .col-source {
  width: auto;
}

.col-drag {
  width: 24px;
}

.col-channel {
  width: 42px;
}

.col-snake {
  width: 72px;
}

.col-source {
  width: 20%;
}

.col-bands {
  width: 58px;
}

.col-device {
  width: 11%;
}

.col-stand {
  width: 64px;
}

.col-phantom {
  width: 52px;
}

.col-notes {
  width: 12%;
}

.col-actions {
  width: 34px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 4px 5px;
  text-align: left;
  vertical-align: top;
}

td .mic-select,
td .source-edit,
td .stand-select,
td .output-edit {
  min-height: 28px;
  padding: 4px 6px;
  width: 100%;
}

td .source-edit {
  font-weight: 750;
}

.source-cell-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.channel-mode {
  align-items: center;
  background: linear-gradient(180deg, var(--channel-mode-top), var(--channel-mode-bottom));
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
  padding: 2px;
}

.channel-mode.is-stereo {
  border-color: rgba(45, 212, 191, 0.56);
}

.channel-mode-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  overflow: hidden;
  padding: 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-mode button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  min-height: 22px;
  min-width: 0;
  padding: 2px 5px;
}

.channel-mode button + button {
  margin-top: 0;
}

.channel-mode button.is-active {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--accent-ink);
}

.stereo-linked {
  color: var(--muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 5px;
  line-height: 1.2;
}

.stereo-linked::before {
  color: var(--accent);
  content: "↳";
}

.stand-select {
  font-size: 0.78rem;
}

.phantom-toggle {
  align-items: center;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  gap: 4px;
  min-height: 28px;
  padding: 3px 4px;
}

.phantom-toggle input {
  min-height: auto;
  width: auto;
}

.phantom-toggle:has(input:checked) {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.52);
  color: var(--ink);
}

tbody tr.stereo-left-row td.cell-source {
  border-bottom-color: rgba(45, 212, 191, 0.34);
}

tbody tr.stereo-right-row td.cell-source {
  background: rgba(45, 212, 191, 0.035);
}

.cell-compact {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.cell-notes .cell-compact {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.cell-bandRider .cell-compact {
  line-height: 1.25;
}

.band-badge {
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-grid;
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 22px;
  min-width: 36px;
  padding: 2px 6px;
  place-items: center;
  white-space: nowrap;
}

th {
  background: var(--table-head-bg);
  color: var(--muted);
  font-size: 0.72rem;
  position: sticky;
  top: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

tbody tr:hover {
  background: var(--table-hover-bg);
}

tbody tr.is-selected {
  outline: 2px solid rgba(96, 165, 250, 0.78);
  outline-offset: -2px;
}

tbody tr.is-dragging {
  opacity: 0.48;
}

tbody tr.is-drop-target {
  outline: 1px solid rgba(239, 238, 230, 0.22);
}

tbody tr.is-drop-before {
  box-shadow: inset 0 3px 0 var(--accent);
}

tbody tr.is-drop-after {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.drag-cell {
  color: var(--muted);
  cursor: grab;
  font-weight: 700;
  text-align: center;
  touch-action: none;
  user-select: none;
  width: 28px;
}

.drag-cell:active {
  cursor: grabbing;
}

.row-action-cell {
  text-align: center;
  white-space: nowrap;
}

.row-select-btn {
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 28px;
  min-width: 28px;
  padding: 3px 6px;
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
  background: #fffdf7;
}

body.light-theme .ghost-btn,
body.light-theme .patch-tab,
body.light-theme .band-badge,
body.light-theme .row-select-btn {
  background: #f0eee4;
}

body.light-theme th {
  background: #e9e6d8;
  color: #484a42;
}

body.light-theme tbody tr:hover {
  background: #edf4ff;
}

body.light-theme tbody tr.attention {
  background: #fff2bd;
}

body.light-theme tbody tr.unused {
  background: #eceae0;
  color: #8b8b82;
}

body.light-theme tbody tr.unused input,
body.light-theme tbody tr.unused select,
body.light-theme tbody tr.unused .phantom-toggle,
body.light-theme tbody tr.unused .channel-mode {
  background: #efeee7;
  border-color: #d3d0c4;
  color: #8b8b82;
}

tbody tr.attention {
  background: var(--warn-bg);
}

tbody tr.band-active {
  background: rgba(239, 238, 230, 0.035);
}

tbody tr.band-active td.cell-bandRider .band-badge {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

tbody tr.unused {
  background: #0d0e0b;
  color: #666760;
}

tbody tr.unused td:nth-child(n+3) {
  background: rgba(255, 255, 255, 0.018);
  color: #666760;
}

tbody tr.unused td:first-child,
tbody tr.unused td:nth-child(2) {
  filter: grayscale(1) brightness(0.58);
}

tbody tr.unused input,
tbody tr.unused select,
tbody tr.unused .phantom-toggle,
tbody tr.unused .channel-mode {
  background: #11120f;
  border-color: #282923;
  color: #5f605a;
}

tbody tr.unused input::placeholder {
  color: #4f504a;
}

tbody tr.unused .source-edit,
tbody tr.unused .mic-select,
tbody tr.unused .stand-select {
  opacity: 0.62;
}

tbody tr.unused .band-badge {
  background: #11120f;
  border-color: #30312b;
  color: #77766f;
}

tbody tr.unused .band-badge:empty::before {
  content: "-";
}

tbody tr.material-row {
  background: #121a22;
}

tbody tr.material-row:hover {
  background: #162330;
}

tbody tr.material-row td:first-child {
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

tbody tr.material-row td.cell-channel {
  color: var(--accent);
  font-size: 0.94rem;
  font-weight: 900;
  text-align: center;
}

tbody tr.material-row td.cell-snake {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr.material-row td.cell-source strong {
  color: var(--ink);
  font-weight: 900;
}

tbody tr.material-row .band-badge {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.material-drag-cell {
  cursor: default;
}

tbody tr.unused:hover {
  background: #12130f;
}

.warnings ul {
  display: grid;
  gap: 3px;
  margin: 8px 0 0 18px;
  padding: 0;
}

.review-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.review-item {
  align-items: center;
  background: rgba(14, 22, 32, 0.72);
  border: 1px solid rgba(220, 165, 50, 0.36);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
}

.review-item strong,
.review-item span {
  display: block;
}

.review-item span {
  color: #f8d98b;
  font-size: 0.78rem;
  margin-top: 2px;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.review-actions button {
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  min-height: 30px;
  padding: 5px 8px;
}

.review-actions button[data-review-action="accepted"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.review-actions button[data-review-action="remove"] {
  color: var(--danger);
}

.review-more {
  color: #f8d98b;
  font-size: 0.8rem;
}

tbody tr.channel-block td:first-child {
  border-left: 6px solid transparent;
  font-weight: 700;
}

tbody tr.channel-block td:nth-child(2) {
  font-weight: 700;
}

tbody tr.channel-block td:first-child,
tbody tr.channel-block td:nth-child(2) {
  border-left-color: var(--block-color);
}

tbody tr.channel-block td:nth-child(2) {
  background: color-mix(in srgb, var(--block-color) 22%, transparent);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 34px 12px;
}

#print-root {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-mode {
    background: #efeee6;
    color: #1d1f1a;
  }

  body.print-mode .app-shell {
    display: none;
  }

  body.print-mode #print-root {
    color: #f2f0e8;
    display: block;
    font-family: Arial, sans-serif;
    font-size: 10px;
  }

  #print-root header {
    background: #1d1f1a;
    border-bottom: 3px solid #9f9f98;
    break-after: avoid;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  #print-root .print-brand {
    align-items: center;
    display: flex;
    gap: 10px;
  }

  #print-root .print-brand img {
    background: transparent;
    border-radius: 0;
    display: block;
    height: 42px;
    object-fit: contain;
    padding: 0;
    width: 42px;
  }

  #print-root .print-brand strong {
    color: #9f9f98;
    display: block;
    font-size: 8px;
    letter-spacing: 0;
    margin-bottom: 2px;
    text-transform: uppercase;
  }

  #print-root h1 {
    color: #f2f0e8;
    font-size: 20px;
    margin: 0 0 4px;
  }

  #print-root h2 {
    color: #f2f0e8;
    font-size: 13px;
    margin: 12px 0 2px;
  }

  #print-root p {
    color: #c9c7bd;
    margin: 0;
  }

  #print-root .print-section {
    break-inside: avoid;
    margin-top: 8px;
  }

  #print-root table {
    border-collapse: collapse;
    font-size: 9px;
    table-layout: fixed;
    width: 100%;
  }

  #print-root th,
  #print-root td {
    border: 1px solid #3b3c36;
    padding: 4px 5px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
  }

  #print-root th {
    background: #efeee6;
    color: #1d1f1a;
    font-size: 8px;
    text-transform: uppercase;
  }

  #print-root td {
    background: #191a17;
  }

  #print-root tr {
    break-inside: avoid;
  }

  #print-root .block {
    background: var(--block-color);
    color: #06110f;
    font-weight: 700;
    text-align: center;
  }

  #print-root .source {
    color: #fffdf5;
    font-weight: 700;
  }

  #print-root .notes {
    color: #aaa8a0;
    font-size: 8px;
  }

  #print-root .unused td {
    background: #151611;
    color: #77766f;
  }

  #print-root .unused .block {
    opacity: 0.72;
  }

  #print-root .attention td {
    background: #fde68a;
    color: #111827;
    font-weight: 700;
  }

  #print-root .attention .block {
    background: #dca532;
    color: #111827;
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .setup-panel,
  .patch-panel {
    margin: 0;
  }

  .workspace-resizer {
    display: none;
  }

  table {
    min-width: 740px;
  }

  .col-snake {
    width: 72px;
  }

  .col-notes {
    width: 10%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .panel-header,
  .rider-head {
    display: grid;
  }

  .festival-fields,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .block-color-panel {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    align-items: start;
    display: grid;
  }

  .drop-zone-actions {
    flex-wrap: wrap;
  }

  .review-item {
    grid-template-columns: 1fr;
  }

  .review-actions {
    justify-content: start;
  }
}
