:root {
  --ink: #17241f;
  --muted: #66736d;
  --line: #d9e1dd;
  --line-strong: #c5d0ca;
  --line-soft: #e9eeeb;
  --canvas: #f5f7f6;
  --paper: #ffffff;
  --forest: #173f31;
  --forest-dark: #073a2a;
  --forest-bright: #27634d;
  --sage: #dfece4;
  --sage-light: #f0f6f3;
  --amber: #9b681e;
  --amber-light: #fcf5e7;
  --red: #983f37;
  --red-light: #fff3f1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 46, 35, .04), 0 10px 30px rgba(20, 46, 35, .035);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 252px;
  flex-direction: column;
  color: #f1f6f3;
  background: var(--forest-dark);
  border-right: 0;
}

.brand {
  display: flex;
  height: 92px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 0;
}
.brand-mark { display: none; }
.brand strong { display: block; font: 750 24px/1 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.75px; }
.brand small { display: block; margin-top: 7px; color: #9db4a8; font-size: 9px; letter-spacing: 1.7px; text-transform: uppercase; }
.brand-version { display: block; margin-top: 4px; color: #83968d; font-size: 8px; font-weight: 600; letter-spacing: .15px; }

.section-nav { flex: 1; padding: 8px 12px 18px; overflow-y: auto; }
.nav-module-label { margin: 0 13px 7px; color: #82998e; font-size: 8px; font-weight: 750; letter-spacing: 1.2px; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  width: calc(100% - 4px);
  min-height: 52px;
  align-items: center;
  gap: 17px;
  padding: 10px 13px;
  border: 0;
  border: 0;
  border-radius: 9px;
  color: #b6c5bd;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .14s, background .14s, border-color .14s;
}
.nav-item:hover { color: #fff; background: rgba(224, 240, 231, .08); }
.nav-item.active { color: #123c2e; background: #d9ebe1; font-weight: 700; }
.nav-item[hidden] { display: none; }
.nav-item.active::before { display: none; }
.nav-item span { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border: 1px solid rgba(219, 236, 227, .28); border-radius: 6px; color: #d6e5dd; font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nav-item.active span { border-color: rgba(18, 60, 46, .16); color: #123c2e; background: rgba(255,255,255,.72); }
.nav-item em { min-width: 21px; margin-left: auto; padding: 1px 4px; border: 0; border-radius: 8px; color: #afc2b8; background: rgba(255,255,255,.08); font-size: 9px; font-style: normal; text-align: center; }
.nav-item.active em { color: #315f4d; background: rgba(255,255,255,.65); }

.sidebar-note { display: flex; gap: 11px; align-items: flex-start; margin: 0 20px 12px; padding: 17px 4px 0; border: 0; border-top: 1px solid rgba(224, 240, 231, .3); border-radius: 0; background: transparent; }
.status-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #87bd9c; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 10px; font-weight: 650; }
.sidebar-note small { margin-top: 3px; color: #8ea69a; font-size: 9px; }
.product-signature { margin: 0 24px 21px; color: #85918b; font-size: 9px; line-height: 1.5; }
.product-signature strong, .product-signature span, .product-signature small { display: block; }
.product-signature strong { color: #a0aaa5; font-size: 9px; font-weight: 650; }
.product-signature span { margin-top: 4px; }
.product-signature small { color: #78847e; font-size: 8px; }
.mobile-product-signature { display: none; }

.workspace { min-height: 100vh; margin-left: 252px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 17px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
}
.topbar-show { min-width: 190px; }
.topbar .eyebrow { display: block; margin-bottom: 4px; }
.topbar h1 { max-width: 380px; margin: 0; overflow: hidden; font: 700 18px/1.25 Inter, ui-sans-serif, sans-serif; letter-spacing: -.3px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: flex-end; gap: 12px; }
.eyebrow { margin: 0; color: #6e8378; font-size: 9px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; }
.save-state { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #4a7a60; font-size: 10px; white-space: nowrap; }
.save-state i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #4d8e68; }
.save-state.saving i { background: #d29b3f; }

.target-desk-control, .template-menu { position: relative; display: grid; gap: 6px; height: auto; }
.target-desk-control { min-width: 210px; }
.template-menu { min-width: 176px; }
.target-desk-control > span, .toolbar-label { position: static; color: #36473f; font-size: 9px; font-weight: 700; letter-spacing: .2px; text-transform: none; }
.target-desk-control select { width: 100%; height: 42px; padding: 0 31px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; font: 600 11px/1 Inter, sans-serif; }
#template-button { width: 100%; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 650; line-height: 1; text-decoration: none; transition: color .14s, background .14s, border-color .14s, box-shadow .14s; white-space: nowrap; }
.button:hover { transform: none; }
.button.primary { color: #fff; background: var(--forest); border-color: var(--forest); box-shadow: 0 5px 14px rgba(23, 63, 49, .16); }
.button.primary:hover { background: #0f3428; }
.button.secondary, .button.ghost { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.button.secondary:hover, .button.ghost:hover { color: var(--forest); background: var(--sage-light); border-color: var(--forest); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-group { display: flex; gap: 8px; }
.text-button { padding: 8px 0; border: 0; color: var(--forest-bright); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }

.export-menu, .template-menu { position: relative; }
.export-menu { align-self: end; }
.export-popover, .template-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: none; width: 310px; max-height: calc(100vh - 112px); overflow-y: auto; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(13, 48, 37, .14); }
.export-popover.open, .template-popover.open { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.export-popover button, .template-popover button { display: block; width: 100%; padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; }
.export-popover button[hidden], .template-popover button[hidden] { display: none; }
.export-popover button:hover, .template-popover button:hover { background: var(--sage-light); }
.export-popover strong, .export-popover small, .template-popover strong, .template-popover small { display: block; }
.export-popover strong, .template-popover strong { font-size: 11px; }
.export-popover small, .template-popover small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.menu-label { margin: 7px 11px 4px; color: #657a70; font-size: 8px; font-weight: 750; letter-spacing: 1.2px; }
.menu-divider { height: 1px; margin: 5px 3px; background: var(--line); }
.export-popover p { margin: 8px 10px; color: #707c76; font-size: 9px; line-height: 1.45; }
.experimental-tag { display: inline-block; margin-left: 5px; padding: 1px 5px; border: 0; border-radius: 8px; color: #775019; background: #fff0cf; font-size: 7px; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.export-popover button.experimental-option { background: #fffbf2; }
.export-toggle { display: flex; align-items: flex-start; gap: 9px; margin: 6px 4px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbf9; cursor: pointer; }
.export-toggle input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--forest); }
.export-toggle span { min-width: 0; }
.export-toggle strong, .export-toggle small { display: block; }
.export-toggle strong { font-size: 10px; }
.export-toggle small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }

.notice { display: flex; align-items: center; justify-content: space-between; margin: 20px 39px -3px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--forest-bright); border-radius: 10px; background: var(--sage-light); }
.notice[hidden] { display: none; }
.notice > div { display: flex; align-items: flex-start; gap: 11px; }
.notice-copy { min-width: 0; }
.notice > div > span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--forest); background: transparent; font-size: 10px; }
.notice p { margin: 0; }
.notice strong, .notice small { display: block; }
.notice strong { font-size: 10px; }
.notice small { color: #617169; font-size: 9px; }
.notice details { margin-top: 6px; color: #6d5839; font-size: 9px; }
.notice summary { width: fit-content; cursor: pointer; font-weight: 700; }
.notice ol { margin: 7px 0 2px; padding-left: 18px; line-height: 1.55; }
.notice code { padding: 1px 3px; background: rgba(104, 65, 15, .08); font-size: 9px; }
.notice > button { border: 0; color: #718079; background: transparent; cursor: pointer; font-size: 18px; }
.experimental-notice { border-left-color: var(--amber); background: #fffaf0; }
.experimental-notice > div > span { color: #7a4b13; }
.experimental-notice strong { color: #68410f; }
.experimental-notice small { color: #7f6949; }
.edition-notice { border-left-color: #708278; background: #f4f7f5; }
.edition-notice > div > span { color: #385047; }
.edition-notice strong { color: #253e35; }
.edition-notice small { color: #607069; }
.compatibility-notice { border-left-color: var(--red); background: var(--red-light); }
.compatibility-notice > div > span, .compatibility-notice strong { color: #76261d; }
.compatibility-notice details { color: #71413a; }
.compatibility-notice ul { display: grid; gap: 5px; margin: 7px 0 2px; padding: 0; list-style: none; }
.compatibility-notice li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 7px 9px; border: 1px solid #e4b8b0; border-radius: 7px; background: #fff; line-height: 1.45; }
.compatibility-notice li > span { min-width: 0; }
.compatibility-notice li button, .compatibility-notice .compatibility-remove-all { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #c9877b; border-radius: 6px; color: #872e23; background: #fff; cursor: pointer; font-size: 9px; font-weight: 700; }
.compatibility-notice .compatibility-remove-all { margin-top: 7px; color: #fff; background: #983c31; border-color: #983c31; }

.view { display: none; max-width: 1460px; padding: 32px 40px 52px; margin: 0 auto; animation: reveal .16s ease-out; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(2px); } }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding-bottom: 0; border-bottom: 0; }
.view-heading .eyebrow { display: none; }
.view-heading h2 { margin: 0 0 7px; font: 750 36px/1.1 Inter, ui-sans-serif, sans-serif; letter-spacing: -1.1px; color: #123c2e; }
.view-heading p:not(.eyebrow) { max-width: 760px; margin: 0; color: #4f5d56; font-size: 12px; }
.inline-heading { align-items: end; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.summary-card { position: relative; display: flex; min-height: 104px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 0; padding: 20px 24px 20px 45px; border-right: 1px solid var(--line); text-align: left; }
.summary-card::before { content: ""; position: absolute; left: 24px; width: 9px; height: 9px; border-radius: 50%; background: #4f9b72; box-shadow: 0 0 0 6px #eaf5ee; }
.summary-card:last-child { border-right: 0; }
.summary-card small { order: -1; color: #263a31; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.summary-card strong { margin: 4px 0 2px; font: 750 21px/1 Inter, ui-sans-serif, sans-serif; color: var(--forest); }
.summary-card > span { color: var(--muted); font-size: 9px; }

.panel { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.form-panel { padding: 24px; border: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 0 0 17px; margin-bottom: 19px; border-bottom: 1px solid var(--line); }
.panel-heading h3, .subheading h3 { margin: 0; font: 700 18px/1.2 Inter, ui-sans-serif, sans-serif; letter-spacing: -.25px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.section-tag { display: none; }

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 19px 28px; }
.field { display: flex; grid-column: span 6; flex-direction: column; gap: 7px; }
.field-name, .field-artist, .field-engineer { grid-column: span 4; }
.field-venue { grid-column: span 7; }
.field-wide { grid-column: 1 / -1; }
.field-date { grid-column: span 5; }
.field-notes { grid-column: 1 / -1; }
.field > span { color: #27372f; font-size: 10px; font-weight: 700; letter-spacing: .1px; text-transform: none; }
.field > small { color: #7f8a85; font-size: 9px; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; outline: none; transition: border-color .14s, box-shadow .14s; }
input, select { height: 45px; padding: 8px 12px; }
textarea { padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(39, 99, 77, .13); }
input::placeholder, textarea::placeholder { color: #8c9992; }

.source-panel { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding: 18px 20px; border-width: 1px; }
.source-panel > div { display: flex; align-items: center; gap: 12px; }
.source-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: var(--forest); background: #e6f2eb; font-size: 15px; }
.source-panel h3 { margin: 0; font-size: 10px; }
.source-panel p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }

.table-panel { overflow: hidden; }
.input-bulk-toolbar { display: flex; align-items: flex-end; gap: 11px; margin-bottom: 13px; padding: 13px 15px; flex-wrap: wrap; }
.input-bulk-toolbar[hidden] { display: none; }
.bulk-select-all { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 0 4px; font-size: 11px; font-weight: 700; }
.bulk-select-all input, .input-select-cell input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
#input-selection-count { display: grid; min-width: 72px; min-height: 42px; align-items: center; color: var(--muted); font-size: 10px; }
.bulk-colour-control { display: grid; min-width: 210px; gap: 5px; }
.bulk-colour-control > span { color: #36473f; font-size: 9px; font-weight: 700; }
.bulk-colour-control select { height: 42px; padding: 0 31px 0 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 13px; color: #44564d; background: var(--sage-light); border-bottom: 1px solid var(--line-strong); font-size: 8px; font-weight: 750; letter-spacing: .8px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { height: 55px; padding: 8px 8px 8px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf9; }
td input, td select { min-width: 86px; height: 36px; border-color: transparent; background: transparent; }
.p16-source-select { min-width: 250px; width: 100%; }
.input-link-select { min-width: 154px; }
.incompatible-select { border-color: var(--amber); background: #fff7e6; color: #6f4300; }
td input:hover, td select:hover { border-color: var(--line); background: #fff; }
td input:focus, td select:focus { border-color: var(--forest); background: #fff; }
.number-col { width: 76px; min-width: 76px; }
.select-col { width: 66px; min-width: 66px; }
.color-col { width: 164px; min-width: 164px; }
.number-input { width: 64px; min-width: 64px; padding-right: 5px; padding-left: 5px; text-align: center; appearance: textfield; }
.number-input::-webkit-inner-spin-button, .number-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.name-input { min-width: 140px; font-weight: 650; }
.notes-input { min-width: 150px; }
.stacked-cell { display: grid; min-width: 145px; gap: 3px; }
.stacked-cell select { height: 36px; min-height: 36px; }
.stacked-cell input { height: 30px; color: var(--muted); font-size: 10px; }
.type-category-cell { display: flex; min-width: 250px; align-items: center; gap: 7px; }
.type-category-cell select { width: 112px; min-width: 112px; }
.type-category-cell .category-input { min-width: 130px; }
.strip-color-control { display: flex; min-width: 155px; align-items: center; gap: 7px; }
.strip-color-control select { min-width: 126px; }
.strip-color-swatch { width: 19px; height: 19px; flex: 0 0 19px; border: 1px solid rgba(27, 48, 39, .24); border-radius: 5px; background: var(--strip-color); box-shadow: 0 1px 2px rgba(19, 43, 33, .12); }
.strip-color-control.inverted .strip-color-swatch { background: var(--strip-color); box-shadow: inset 0 0 0 6px #202a25, 0 1px 2px rgba(19, 43, 33, .12); }
.strip-color-control.unset .strip-color-swatch { border-style: dashed; background: linear-gradient(135deg, transparent 44%, #aeb9b3 45%, #aeb9b3 55%, transparent 56%); box-shadow: none; }
#inputs-table td { height: 84px; }
#inputs-table .input-select-cell { text-align: center; }
#view-inputs .table-panel { overflow: visible; }
#view-inputs .table-scroll { padding-bottom: 3px; border-radius: 0; }
.path-label { color: #5e7167; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.incompatible-row { background: #fff8f6; }
.field-warning { color: #a33b2d; font-size: 8px; font-weight: 700; line-height: 1.25; }
.row-delete { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid transparent; border-radius: 7px; color: #7f8b85; background: transparent; cursor: pointer; }
.row-delete:hover { color: var(--red); border-color: #d9aaa5; background: var(--red-light); }
.empty-row td { padding: 34px; color: #7a8781; text-align: center; }
.subheading { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-strong); }
.subheading span { color: var(--muted); font-size: 9px; }

.safety-callout { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 13px 16px; border: 1px solid #e1c896; border-left: 4px solid var(--amber); border-radius: 10px; background: var(--amber-light); }
.safety-callout > span { display: grid; min-width: 38px; height: 38px; place-items: center; border: 0; border-radius: 9px; color: #6d4813; background: #f5e4c2; font-size: 10px; font-weight: 800; }
.safety-callout p { margin: 0; color: #6f5a38; font-size: 10px; }
.safety-callout strong { color: #4f3d21; }
.soft-patch-callout { border-color: #a9cabe; border-left-color: var(--forest-bright); background: var(--sage-light); }
.soft-patch-callout > span { color: #fff; background: var(--forest); }
.soft-patch-callout p { color: #476257; }
.soft-patch-callout strong { color: var(--forest); }
.soft-patch-callout small { display: block; margin-top: 4px; color: #60766c; font-weight: 700; }
#x32-soft-patch-notice[hidden] { display: none; }
.soft-patch-cell { display: grid; min-width: 125px; gap: 3px; }
.soft-patch-cell strong { color: var(--forest); font-size: 10px; }
.soft-patch-cell small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.soft-patch-cell.direct strong { color: #53665d; }
.soft-patch-cell.unresolved strong { color: #8a5a17; }
.soft-patch-cell.unresolved small { color: #8a6a38; }
.soft-patch-unresolved { display: grid; min-width: 130px; gap: 3px; padding: 6px 8px; border-radius: 7px; background: var(--amber-light); }
.soft-patch-unresolved strong { color: #754b12; font-size: 9px; }
.soft-patch-unresolved small { color: #866b43; font-size: 8px; }
.x32-source-bank-editor { margin-bottom: 18px; overflow: hidden; }
.x32-source-bank-editor[hidden] { display: none; }
.x32-source-bank-editor .panel-heading { align-items: center; padding: 20px 24px 18px; margin: 0; }
.x32-source-bank-editor .panel-heading h3 { margin: 0 0 2px; font-size: 20px; }
.x32-source-bank-editor .panel-heading p { max-width: 650px; margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.x32-source-bank-editor .panel-heading > span { padding: 5px 9px; border-radius: 999px; color: var(--forest); background: var(--sage); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.x32-source-bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.x32-source-bank-row { display: grid; grid-template-columns: minmax(105px, .8fr) minmax(130px, 1fr) minmax(110px, .8fr); align-items: end; gap: 10px; padding: 14px 16px; background: #fff; }
.x32-source-bank-row > strong { align-self: center; color: var(--forest); font-size: 10px; }
.x32-source-bank-row label { display: grid; gap: 4px; }
.x32-source-bank-row label span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.x32-source-bank-row select { min-width: 0; height: 38px; }
.wing-routing-callout[hidden],
.wing-routing-panel[hidden] { display: none; }
.wing-routing-panel, .sq-routing-panel { margin-bottom: 18px; }
.wing-pair-row td { background: #f5fbf7; }
.wing-pair-start td { border-top: 1px solid #bddbc9; }
.wing-pair-end td { border-bottom: 1px solid #bddbc9; }
.wing-pair-row td:first-child { border-left: 4px solid var(--forest-bright); }
.wing-pair-start td:first-child { border-top-left-radius: 7px; }
.wing-pair-end td:first-child { border-bottom-left-radius: 7px; }
.wing-source-cell { display: grid; gap: 2px; }
.wing-source-cell strong { color: var(--ink); font-size: 11px; }
.wing-source-cell small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.wing-stereo-cell { display: grid; gap: 2px; min-width: 116px; color: #40554b; }
.wing-stereo-cell strong { font-size: 9px; }
.wing-stereo-cell small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.wing-stereo-cell.paired { position: relative; padding: 5px 8px; border: 1px solid #bddbc9; border-radius: 7px; background: #fff; }
.wing-stereo-cell.paired strong { color: var(--forest); }
.wing-status-summary, .sq-status-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.wing-status-summary[hidden], .sq-status-summary[hidden] { display: none; }
.wing-status-summary > div, .sq-status-summary > div { display: grid; gap: 3px; min-height: 62px; padding: 13px 16px; background: #fbfdfc; }
.wing-status-summary strong, .sq-status-summary strong { color: var(--forest); font-size: 9px; text-transform: uppercase; }
.wing-status-summary span, .sq-status-summary span { color: #53665d; font-size: 9px; line-height: 1.45; }
.wing-projection-note, .sq-projection-note { display: inline-flex; align-items: center; max-width: 260px; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: var(--sage); color: var(--forest); font-size: 8px; font-weight: 750; text-transform: uppercase; white-space: normal; }
.wing-projection-note.warn { background: #fff0d9; color: #7a4a00; }
.sq-projection-note.warn { background: #fff0d9; color: #7a4a00; }
.sq-projection-note.block { background: var(--red-light); color: #76261d; }
.source-read-only { display: grid; min-width: 105px; gap: 2px; color: #40554b; font-size: 10px; }
.source-read-only small { color: var(--muted); font-size: 8px; }
.advanced-level-warning { border-color: #dfaaa3; border-left-color: var(--red); background: var(--red-light); }
.advanced-level-warning > span { color: #fff; background: #973b31; }
.advanced-level-warning p { color: #70433d; }
.advanced-level-warning strong { color: #76261d; }
.advanced-safety-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 15px 18px; border-left: 4px solid var(--forest-bright); }
.advanced-safety-state strong { font-size: 11px; }
.advanced-safety-state p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.advanced-safety-state p.active { color: #8b3229; font-weight: 700; }
.advanced-safety-state > span { padding: 5px 9px; border-radius: 999px; color: #52665c; background: var(--sage); font-size: 8px; font-weight: 750; text-transform: uppercase; white-space: nowrap; }
.advanced-panel { margin-top: 16px; }
.advanced-panel .subheading h3 { margin: 0; }
.advanced-panel .subheading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.advanced-bus-heading { gap: 18px; }
.advanced-bus-heading > label { display: grid; min-width: 210px; gap: 5px; }
.advanced-bus-heading > label span { color: #36473f; font-size: 9px; font-weight: 700; }
.advanced-bus-heading select { height: 38px; }
.advanced-level-control { display: grid; min-width: 270px; grid-template-columns: minmax(120px, 1fr) 70px 20px; align-items: center; gap: 8px; }
.advanced-level-control input[type="range"] { width: 100%; height: 24px; padding: 0; border: 0; accent-color: var(--forest-bright); }
.advanced-level-control .advanced-level-number { min-width: 70px; height: 34px; padding: 5px 7px; border-color: var(--line); background: #fff; text-align: right; }
.advanced-level-control > span { color: var(--muted); font-size: 9px; }
.advanced-read-only { color: #7c8882; font-size: 9px; }
.advanced-send-toggle { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
#advanced-unavailable { margin: 0; }
#advanced-editor[hidden], #advanced-unavailable[hidden] { display: none; }
.compact-panel { padding: 18px 20px; }
.compact-panel .panel-heading { padding: 0; margin: 0; border: 0; }

.routing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.routing-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.routing-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.routing-card h3 { margin: 0; font: 700 17px/1.2 Inter, ui-sans-serif, sans-serif; }
.routing-card header span { color: #6f7f77; font-size: 8px; text-transform: uppercase; }
.routing-block { padding: 10px 0; border-top: 1px solid var(--line); }
.routing-block strong { display: block; margin-bottom: 5px; font-size: 9px; }
.routing-block code { display: block; overflow-wrap: anywhere; color: #53655c; font-size: 9px; line-height: 1.6; }
.routing-empty { margin: 0; color: #7f8b85; font-size: 10px; }

.confirmation-list { display: grid; gap: 9px; margin-bottom: 19px; }
.confirmation-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.confirmation-item span { display: grid; min-width: 25px; height: 25px; place-items: center; border: 0; border-radius: 7px; color: #79551d; background: var(--amber-light); font-size: 10px; }
.confirmation-item input { flex: 1; border-color: transparent; }
.readiness-panel { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--sage-light); }
.readiness-icon { display: grid; min-width: 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; color: var(--forest); background: #dfeee5; }
.readiness-panel h3 { margin: 0; font: 700 17px/1.2 Inter, ui-sans-serif, sans-serif; }
.readiness-panel p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.readiness-panel .button { margin-left: auto; }
.developer-notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.developer-note-card { align-content: start; min-height: 150px; }
.developer-note-card .experimental-tag { width: fit-content; margin: 0 0 12px; }
.developer-note-card h3 { margin: 0 0 7px; color: var(--forest); font-size: 15px; }
.developer-note-card p { margin: 0; color: #596961; font-size: 11px; line-height: 1.55; }

.choice-dialog-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: rgba(12, 35, 28, .46); backdrop-filter: blur(4px); }
.choice-dialog-backdrop[hidden] { display: none; }
.choice-dialog { width: min(560px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(7, 28, 21, .25); }
.choice-dialog h2 { margin: 5px 0 7px; color: var(--forest); font: 760 28px/1.08 Inter, ui-sans-serif, sans-serif; letter-spacing: -.8px; }
.choice-dialog p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.choice-actions { display: grid; gap: 10px; margin: 18px 0 12px; }
.choice-card { display: grid; gap: 5px; width: 100%; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: #f8fbf9; cursor: pointer; text-align: left; }
.choice-card:hover, .choice-card:focus-visible { border-color: var(--forest); background: var(--sage-light); outline: none; box-shadow: 0 0 0 3px rgba(77, 142, 104, .16); }
.choice-card strong { font-size: 13px; }
.choice-card span { color: #65746d; font-size: 10px; line-height: 1.45; }
.choice-card.warning { background: #fffaf0; }
.choice-card.warning:hover, .choice-card.warning:focus-visible { border-color: #b8822a; background: #fff5dd; box-shadow: 0 0 0 3px rgba(184, 130, 42, .16); }

.toast { position: fixed; right: 25px; bottom: 25px; z-index: 50; max-width: 360px; padding: 12px 15px; border: 0; border-radius: 10px; color: #fff; background: #173f31; box-shadow: 0 14px 35px rgba(15,30,23,.2); font-size: 10px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #713d38; }
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; color: #fff; background: rgba(13, 48, 37, .78); backdrop-filter: blur(3px); }
.loading[hidden] { display: none; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.loading p { font-size: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .brand { padding: 0 22px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .topbar-show { width: 100%; }
  .topbar-actions { width: 100%; flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
  .target-desk-control { flex: 0 0 210px; }
  .template-menu { flex: 0 0 176px; }
}

@media (max-width: 900px) {
  .sidebar { position: sticky; top: 0; z-index: 30; display: flex; width: 100%; height: 62px; flex-direction: row; align-items: stretch; overflow: hidden; }
  .brand { width: 154px; height: 62px; flex: 0 0 154px; padding: 0 17px; border-right: 1px solid rgba(224, 240, 231, .18); }
  .brand strong { font-size: 19px; }
  .brand small { display: none; }
  .brand-version { margin-top: 4px; font-size: 7px; }
  .section-nav { display: flex; align-items: center; gap: 3px; padding: 8px 28px 8px 8px; overflow-x: auto; border: 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); }
  .section-nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; min-width: max-content; min-height: 40px; padding: 8px 11px; border: 0; border-radius: 8px; color: #c3d1ca; font-size: 11px; scroll-snap-align: start; }
  .nav-item.active { color: #fff; background: rgba(217, 235, 225, .14); }
  .nav-item span, .nav-item em, .nav-module-label, .sidebar-note, .product-signature { display: none; }
  .workspace { margin-left: 0; }
  .topbar { position: relative; z-index: 20; min-height: 0; padding: 16px 18px; }
  .topbar-actions { gap: 8px; }
  .export-menu, .template-menu { position: static; }
  .export-popover, .template-popover {
    right: 18px;
    left: 18px;
    width: auto;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 150px);
    overscroll-behavior: contain;
  }
  .target-desk-control, .template-menu { display: grid; }
  .view { padding: 27px 18px 42px; }
  .notice { margin: 15px 18px -2px; }
  .view-heading { align-items: flex-start; }
  .view-heading h2 { font-size: 31px; }
  .form-grid { gap: 17px; }
  .field, .field-date, .field-notes, .field-wide { grid-column: 1 / -1; }
  .routing-grid { grid-template-columns: 1fr; }
  .x32-source-bank-grid { grid-template-columns: 1fr; }
  .advanced-safety-state, .advanced-bus-heading { align-items: flex-start; flex-direction: column; }
  .advanced-bus-heading > label { width: 100%; }
  .button-group { flex-direction: column; }
  .mobile-product-signature { display: block; margin: 0 18px 18px; padding-top: 14px; border-top: 1px solid var(--line); color: #78827d; font-size: 8px; line-height: 1.6; text-align: left; }
  .mobile-product-signature strong, .mobile-product-signature span { display: block; }
  .mobile-product-signature strong { color: #65706a; font-weight: 650; }
}

@media (max-width: 600px) {
  .sidebar { height: 56px; }
  .brand { width: 128px; height: 56px; flex-basis: 128px; padding: 0 13px; }
  .brand strong { font-size: 17px; letter-spacing: -.5px; }
  .section-nav { padding-top: 7px; padding-bottom: 7px; }
  .nav-item { min-height: 36px; padding: 7px 9px; font-size: 10px; }
  .mobile-product-signature { margin: 0 14px 14px; }
  .topbar h1 { max-width: 100%; }
  .topbar-actions { padding-bottom: 6px; }
  .export-popover, .template-popover { right: 14px; left: 14px; max-width: calc(100vw - 28px); }
  .target-desk-control { min-width: 210px; flex-basis: 210px; }
  .template-menu { min-width: 176px; flex-basis: 176px; }
  .button { min-height: 42px; padding: 8px 12px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-card { min-height: 98px; padding: 15px; }
  .summary-card::before { display: none; }
  .summary-card:nth-child(2) { border-right: 0; }
  .summary-card:nth-child(-n+2) { border-bottom: 1px solid var(--line-strong); }
  .summary-card strong { font-size: 21px; }
  .view-heading { display: block; }
  .view-heading > .button, .view-heading > .button-group { margin-top: 16px; }
  .readiness-panel { align-items: flex-start; flex-wrap: wrap; }
  .readiness-panel .button { width: 100%; margin-left: 0; }
  .developer-notes-grid { grid-template-columns: 1fr; }
  .x32-source-bank-row { grid-template-columns: 1fr 1fr; }
  .x32-source-bank-row > strong { grid-column: 1 / -1; }
  .choice-dialog { padding: 19px; }
  .choice-dialog h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
