:root {
  --bg: #101316;
  --panel: #101316;
  --panel-2: #1f252a;
  --card: #171b1f;
  --head: #1c2126;
  --field: rgba(240, 238, 233, .05);
  --line: rgba(240, 238, 233, .08);
  --text: #f0eee9;
  --soft: #b8bcc1;
  --muted: #7d838a;
  --accent: #3ea69f;
  --on-accent: #0b1a19;
  --tint: color-mix(in srgb, var(--accent) 14%, transparent);
  --danger: #e8605a;
  --ok: #4fa37a;
  --stage: #17191e;
  --warn: #d9a047;
  --hover: rgba(255, 255, 255, .06);
  --primary: #f1f2f4;
  --primary-text: #111318;
  --primary-hover: #d9dbe0;
  --scheme: dark;
  --drums: #ec7b6b;
  --bass: #e3a848;
  --guitar: #85c76e;
  --keys: #46bccd;
  --vocal: #bc95f2;
  --playback: #6c9bf2;
  --room: #979eab;
  --pink: #ec7fb0;
}

:root[data-group="sound"] { --accent: #a28fe8; }
:root[data-group="stage"] { --accent: #8fbf7f; }
:root[data-group="money"] { --accent: #d6a65c; }
:root[data-theme="light"] { --accent: #1f7f79; --on-accent: #fff; }
:root[data-theme="light"][data-group="sound"] { --accent: #6c55c7; }
:root[data-theme="light"][data-group="stage"] { --accent: #4c7f3f; }
:root[data-theme="light"][data-group="money"] { --accent: #9a6a1c; }

:root[data-theme="light"] {
  --bg: #f0eee9;
  --panel: #f0eee9;
  --panel-2: #fff;
  --card: #fbfaf7;
  --head: #f5f3ee;
  --field: rgba(40, 30, 10, .045);
  --line: rgba(40, 30, 10, .1);
  --text: #1c1e21;
  --soft: #4d525b;
  --muted: #7d828b;
  --danger: #cc3a33;
  --ok: #2f8560;
  --stage: #fff;
  --warn: #9a5f08;
  --hover: rgba(0, 0, 0, .05);
  --primary: #15171c;
  --primary-text: #fff;
  --primary-hover: #33363d;
  --scheme: light;
  --drums: #cf4f3e;
  --bass: #b57a12;
  --guitar: #4b9633;
  --keys: #16899b;
  --vocal: #7e55d6;
  --playback: #3b6fd4;
  --room: #6e7582;
  --pink: #c94a86;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; height: 100%; }
#print { display: none; }

#topbar {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 188px;
  padding: 46px 10px 12px;
  background: var(--card);
  border-right: 1px solid var(--line);
  -webkit-app-region: drag;
}
#topbar button { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 7px; margin: 0 10px 14px; font-size: 15px; font-weight: 600; }
#tabs { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 1px; overflow-y: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; }
#top-actions { display: grid; flex: none; grid-template-columns: 1fr 1fr; align-items: center; gap: 6px; margin-bottom: 14px; }
#top-actions .btn { min-width: 0; }
#top-actions .btn.primary, #top-actions .save-btn { grid-column: span 2; }
.label-short { display: none; }
.save-btn.dirty { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.save-btn.dirty::after { content: " •"; }
.tab-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.tab-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--field); border: 1px solid transparent; border-radius: 7px; color: var(--muted); }
.tab-toggle.on { border-color: var(--accent); color: var(--text); }
.tab-toggle:not(.on) span { text-decoration: line-through; }
.gear { display: flex; padding: 5px; border-radius: 6px; }
.gear:hover { background: var(--hover); }
#doc-name { flex: none; margin: 0 10px 8px; padding: 0; background: none; border: 0; color: var(--muted); font-size: 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
#doc-name:hover { color: var(--text); }

#main { --main-top: 28px; flex: 1; overflow: auto; padding: var(--main-top) 36px 48px; background: radial-gradient(900px 300px at 50% -130px, var(--tint), transparent 72%) no-repeat; }

button { font: inherit; color: inherit; cursor: pointer; }
.tab { display: flex; align-items: center; gap: 9px; background: none; border: 0; border-radius: 7px; padding: 7px 10px; color: var(--soft); text-align: left; }
.tab svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: var(--tint); color: var(--text); font-weight: 600; }
.tab.active svg { color: var(--accent); }
.subtabs { display: flex; gap: 16px; }
.subtab { background: none; border: 0; padding: 4px 0; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; }
.subtab:hover { color: var(--text); }
.subtab em { font-style: normal; color: var(--muted); font-weight: 400; }
.subtab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.btn { background: var(--field); border: 0; border-radius: 7px; padding: 5px 11px; color: var(--soft); white-space: nowrap; transition: background .12s, color .12s; }
.btn:hover { background: var(--tint); color: var(--text); }
.btn[data-action$="-add"] { background: var(--tint); color: var(--accent); font-weight: 600; }
.btn em { font-style: normal; color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); color: var(--on-accent); }
.btn.danger:hover { color: var(--danger); }
.icon { background: none; border: 0; padding: 2px 5px; color: var(--muted); opacity: .55; }
tr:hover .icon { opacity: 1; }
.icon:hover { color: var(--text); opacity: 1; }
.icon.danger:hover { color: var(--danger); }

.panel { flex: 1; min-width: 0; max-width: 1200px; margin: 0 auto; }
h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.015em; }
h3 { display: flex; align-items: center; gap: 7px; margin: 28px 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
h3::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--accent); }
h4 { margin: 14px 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.page-head > .btn, .page-head .page-actions { margin: 0 0 0 auto; }
.page-stat { color: var(--soft); font-variant-numeric: tabular-nums; }
.warn-inline { color: var(--warn); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin-bottom: 14px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field span { font-size: 12px; color: var(--muted); }
.field.hero span { display: none; }
.field.hero input { padding: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.015em; background: none; border-width: 0 0 1px; border-radius: 0; }
.field.hero input:focus { border-bottom-color: var(--accent); }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  color-scheme: var(--scheme);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }

.sheet-wrap { margin-top: 10px; overflow-x: auto; }
/* Шапка таблиці лишається зверху, поки гортаєш: тож обгортка в основному вікні не обрізає (гортає #main), а у вікнах-вибірках гортає сама. */
#main .sheet-wrap:not(.pick-wrap) { overflow: visible; }
/* Липка шапка впритул до верху вікна, а не під відступом #main. */
#main .sheet th { top: calc(-1 * var(--main-top)); }
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.sheet-wrap .sheet { margin-top: 0; }
.sheet.fixed { table-layout: fixed; min-width: 100%; }
.sheet th { position: sticky; top: 0; z-index: 3; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 7px 6px; background: var(--head); border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet th:first-child { border-top-left-radius: 9px; }
.sheet th:last-child { border-top-right-radius: 9px; }
.sheet td { padding: 2px 3px; border-bottom: 1px solid var(--line); }
.sheet:not(.fixed) td.key { min-width: 120px; }
.sheet tbody tr:last-child td { border-bottom: 0; }
.sheet th + th, .sheet td + td, .overview-table th + th, .overview-table td + td { border-left: 1px solid var(--line); }
.sheet tbody tr:last-child td:first-child { border-bottom-left-radius: 9px; }
.sheet tbody tr:last-child td:last-child { border-bottom-right-radius: 9px; }
.sheet tbody tr:hover td { background: var(--hover); }
.col-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; }
.col-grip:hover::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 2px; background: var(--accent); }
.col-resizing, .col-resizing * { cursor: col-resize !important; user-select: none; }
.sheet input, .sheet select { background: transparent; border-color: transparent; color: var(--soft); padding: 5px 4px; }
tr[data-family="drums"] { --family: var(--drums); }
tr[data-family="bass"] { --family: var(--bass); }
tr[data-family="guitar"] { --family: var(--guitar); }
tr[data-family="keys"] { --family: var(--keys); }
tr[data-family="vocal"] { --family: var(--vocal); }
tr[data-family="playback"] { --family: var(--playback); }
tr[data-family="room"] { --family: var(--room); }
tr[data-family="pink"] { --family: var(--pink); }
.ch-cell { position: relative; }
.ch-swatch { position: absolute; top: 0; bottom: 0; left: 0; width: 12px; padding: 0; background: none; border: 0; }
.ch-swatch::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--family, transparent); transition: width .1s; }
.sheet tr:hover .ch-swatch::before { background: var(--family, var(--line)); }
.sheet tr .ch-swatch:hover::before { width: 7px; }
#swatches { position: fixed; z-index: 30; display: none; grid-template-columns: repeat(4, 22px); gap: 6px; padding: 8px; background: var(--panel-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
#swatches.show { display: grid; }
.swatch { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; }
.swatch:hover, .swatch.current { box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 3px var(--text); }
.swatch-auto { grid-column: 1 / -1; padding: 3px; background: var(--field); border: 0; border-radius: 6px; color: var(--soft); font-size: 12px; }
.swatch-auto:hover, .swatch-auto.current { color: var(--text); }
.sheet tr[data-family] .w-num input { color: var(--family, var(--muted)); font-weight: 600; text-align: center; }
input[data-path$=".phantom"] { accent-color: #e5534b; }
.sheet select { appearance: none; cursor: pointer; padding-right: 16px; background-color: var(--field); }
.sheet select, input[data-combo]:hover, input[data-combo]:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%2371767f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E"); background-position: right 6px center; background-repeat: no-repeat; }
input[data-combo] { cursor: pointer; text-overflow: ellipsis; padding-right: 20px; }
input[type="date"], input[type="time"] { cursor: pointer; }
.sheet input:not([type="checkbox"])[value=""], .sheet input:not([type="checkbox"]):hover { background-color: var(--field); }
.sheet input:focus, .sheet select:focus { border-color: var(--accent); }
.sheet input:focus { background-color: var(--bg); color: var(--text); }
.cell-row { display: flex; align-items: center; gap: 2px; }
.cell-row input { min-width: 0; }
.cell-btn { flex: none; display: flex; padding: 6px; background: none; border: 0; border-radius: 6px; color: var(--muted); }
.cell-btn:hover { background: var(--tint); color: var(--accent); }
.w-call { width: 150px; }
.sheet select:focus { color: var(--text); }
.sheet .key input, .sheet .key select { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet .w-num input { font-variant-numeric: tabular-nums; color: var(--muted); }
.sheet input::-webkit-inner-spin-button { display: none; }
.sheet input::-webkit-calendar-picker-indicator { opacity: 0; }
.sheet tr:hover input::-webkit-calendar-picker-indicator { opacity: .5; }
.block { margin-top: 18px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.block .team-head { margin: 0 0 12px; }
.block .sheet { background: none; border: 0; border-radius: 0; margin-top: 0; }
.block .sheet th { background: none; }
.block .sheet tbody tr td { padding-top: 4px; padding-bottom: 4px; }
.block .muted { margin: 0; }
.sheet select[data-status] { font-weight: 600; }
select[data-status="Готово"] { color: var(--ok); }
.sheet select[data-status="Готово"] { background-color: color-mix(in srgb, var(--ok) 15%, transparent); }
.sheet select[data-status="В процесі"] { background-color: color-mix(in srgb, var(--warn) 15%, transparent); }
select[data-status="В процесі"] { color: var(--warn); }
.tight { width: 1%; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.w-num { width: 52px; }
.w-time { width: 110px; }
.w-mic { width: 30%; }
.w-stand { width: 90px; }
.w-socket { width: 160px; }
.w-freq { width: 130px; }
.w-position { width: 220px; }
.muted { color: var(--muted); }

.team-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 26px 0 12px; }
.team-head h3 { margin: 0; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.page-head .row-actions, .team-head .row-actions { margin: 0; }
.page-head .row-actions.page-actions { margin-left: auto; }
.row-actions .push { margin-left: auto; }
.dim { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.dim input { width: 58px; padding: 3px 5px; }
.dim input[type="time"] { width: 110px; }

.acts { display: flex; gap: 32px; align-items: flex-start; max-width: 1360px; margin: 0 auto; }
.act-list { width: 180px; flex: none; display: flex; flex-direction: column; gap: 1px; }
.act-list .btn { align-self: flex-start; margin-top: 8px; }
/* На вузькому вікні список артистів вужчий, щоб таблиця каналів влазила разом із кнопкою видалення. */
@media (max-width: 1240px) { .acts { gap: 18px; } .act-list { width: 140px; } }
.act-item { position: relative; text-align: left; background: none; border: 0; border-radius: 6px; padding: 6px 10px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-item:hover { background: var(--hover); }
.act-item.active { color: var(--text); font-weight: 600; background: var(--tint); box-shadow: inset 2px 0 0 var(--accent); }

#main.full { padding: 0; overflow: hidden; }
.editor { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 33.333%); height: 100%; }
.lib { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.lib-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.lib-search .dim { white-space: nowrap; }
.lib-search .dim input { width: 56px; }
.lib-search input[type="search"] { max-width: 340px; padding: 6px 10px 6px 30px; border-color: var(--line); background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%2371767f' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.2'/%3E%3Cpath d='M9.2 9.2 12.5 12.5'/%3E%3C/svg%3E") 10px center no-repeat; }
.lib-search input[type="search"]:focus { border-color: var(--accent); }
#plot-lib { flex: 1; overflow: auto; }
.lib-head { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; padding: 8px 12px 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.lib-head:hover { color: var(--text); }
.lib-head em { font-style: normal; font-weight: 400; margin-left: 4px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 2px; padding: 0 8px 8px; }
.lib-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 0 8px 8px; }
.lib-tile { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; border-radius: 6px; padding: 6px 2px; font-size: 11px; color: var(--muted); cursor: grab; }
.lib-tile:hover { background: var(--hover); color: var(--text); }
.lib-tile svg, .lib-tile img { width: 44px; height: 34px; object-fit: contain; }
.lib-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-add b { display: flex; align-items: center; justify-content: center; width: 44px; height: 34px; font-size: 18px; font-weight: 300; }
.lib-del { position: absolute; top: 2px; right: 4px; display: none; font-style: normal; font-size: 14px; color: var(--muted); }
.lib-tile:hover .lib-del { display: block; }
.lib-del:hover { color: var(--danger); }
.gear-hit { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 4px; cursor: grab; }
.gear-hit:hover { background: var(--hover); }
.gear-hit i { flex: none; width: 30px; height: 24px; }
.gear-hit i svg { display: block; width: 100%; height: 100%; }
.gear-hit span { display: flex; flex-direction: column; min-width: 0; }
.gear-hit b { font-weight: 500; }
.gear-hit small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.canvas { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.canvas-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.layer-tabs { flex: 0 1 460px; }
.view-tabs { flex: none; margin-left: 10px; }
.layer-tabs button { padding: 7px 20px; font-size: 14px; }
.canvas-bar > .tool, .canvas-bar > .btn { flex: none; white-space: nowrap; }
.canvas-bar > .btn { margin-left: auto; }
/* На вузькому вікні панель переходить у два рядки, а кнопки не стискаються до злиплого тексту. */
.canvas-bar { flex-wrap: wrap; row-gap: 6px; }
.canvas-bar .segment { flex-shrink: 0; }
.canvas-bar .segment button { white-space: nowrap; }
@media (max-width: 1240px) { .layer-tabs { flex: none; } .layer-tabs button { padding: 6px 12px; font-size: 13px; } .canvas-bar { gap: 6px; padding: 10px; } }
.canvas-bar select { width: auto; max-width: 180px; background: none; border-color: transparent; font-weight: 600; }
.bar-gap { width: 8px; }
.bar-fill { flex: 1; }
.tool { background: none; border: 0; border-radius: 6px; padding: 3px 8px; color: var(--muted); }
.tool:hover { background: var(--hover); color: var(--text); }
.tool.on { color: var(--text); }
.canvas-scroll { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.zoom-box { position: absolute; right: 14px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.zoom-box .tool { min-width: 28px; font-variant-numeric: tabular-nums; }
#plot-stage { flex: none; outline: none; touch-action: none; }
.booting #app { visibility: hidden; }
#splash { display: none; }
.splashing #splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg); animation: splash-dark 0.5s ease 1.75s forwards, splash-out 0.55s ease 2.15s forwards; }
:root[data-theme="light"].splashing #splash { animation-name: splash-light, splash-out; }
/* Заставка: буква S з лого малюється знизу вгору, на верхньому кінці спалахує синя крапка. */
#splash svg { width: 110px; height: 140px; overflow: visible; animation: splash-fade 0.45s ease 1.7s forwards; }
.splash-s { stroke: var(--text); stroke-dasharray: 1 2; stroke-dashoffset: 1.001; animation: splash-draw 1.15s cubic-bezier(.6, 0, .25, 1) 0.15s forwards; }
.splash-dot { fill: #3b82f6; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: splash-pop 0.35s cubic-bezier(.3, 1.6, .5, 1) 1.2s forwards; }
@keyframes splash-draw { to { stroke-dashoffset: 0; } }
@keyframes splash-pop { to { transform: scale(1); } }
@keyframes splash-fade { to { opacity: 0; transform: scale(.96); } }
@keyframes splash-dark { to { background: #000; } }
@keyframes splash-light { to { background: #fff; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
.menu-switch #tabs, .menu-switch #top-actions, .menu-switch #main { animation: menu-in .32s cubic-bezier(.2, .7, .3, 1); }
@keyframes menu-in { from { opacity: 0; transform: translateX(10px); } }
tr[data-pair="L"] td.ch-cell { box-shadow: inset 3px 0 0 var(--accent); border-top-left-radius: 6px; }
tr[data-pair="R"] td.ch-cell { box-shadow: inset 3px 0 0 var(--accent); border-bottom-left-radius: 6px; }
.plan-card { margin-top: 14px; }
.plan-card .page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-card .page-head h3 { margin: 0; }
.plan-drop { display: grid; place-items: center; min-height: 220px; max-height: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.plan-drop.empty { border-style: dashed; color: var(--muted); }
.plan-drop.over { border-color: var(--accent); background: var(--tint); }
.plan-drop img, .plan-drop svg { display: block; max-width: 100%; max-height: 540px; height: auto; }
.print-plot-img { display: block; max-width: 100%; max-height: 240mm; margin: 0 auto; }
#plot-stage:has(.plot-3d), #plot-stage:has(.plot-3d-note) { position: relative; }
.plot-3d { display: block; width: 100%; height: 100%; cursor: grab; }
.plot-3d:active { cursor: grabbing; }
.plot-3d-note { display: grid; place-items: center; height: 100%; color: var(--muted); }
.plot-3d-hint { position: absolute; left: 14px; bottom: 12px; max-width: calc(100% - 300px); padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 78%, transparent); font-size: 12px; color: var(--soft); pointer-events: none; }
.plot-hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted); pointer-events: none; max-width: calc(100% - 200px); }
#plot-stage svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; }
.pi { cursor: grab; }
.pi.ghost { opacity: .28; pointer-events: none; }
.size-badge, .res-dot, .overlap { pointer-events: none; }
.res-handle { cursor: nwse-resize; }
.res-handle[data-sx="1"][data-sy="-1"], .res-handle[data-sx="-1"][data-sy="1"] { cursor: nesw-resize; }
.rot-zone { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 15a8 8 0 0 1 9-9' stroke='%23000' stroke-width='4.5'/%3E%3Cpath d='M6 15a8 8 0 0 1 9-9' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M14 2l5 4-5 4zM2 14l4 5 4-5z' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E") 12 12, grab; }

.props { position: absolute; z-index: 5; width: 220px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.props[hidden] { display: none; }
.props .field { margin-bottom: 8px; }
.hint { margin: 0; font-size: 12px; }

.hang-title { flex: 1; }
.hang-title input { padding: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.015em; background: none; border-color: transparent; border-radius: 0; }
.pa-types { max-width: 520px; margin-top: 14px; }
.pa-types + .hint, .segment + .hint { margin-top: 8px; }
.array-edit { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 14px; }
.array-edit .sheet { margin-top: 0; }
.array-edit .hint { margin-bottom: 8px; }
.panel .start-cards { margin-top: 16px; }
.hang-view { color: var(--soft); }
.hang-view svg { display: block; width: 100%; max-height: 420px; }
.act-item.source { display: flex; flex-direction: column; }
.act-item.source small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
#side-foot { flex: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.side-link { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; background: none; border: 0; border-radius: 7px; color: var(--soft); text-align: left; }
.side-link svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.active { background: var(--tint); color: var(--text); font-weight: 600; }
.side-link.active svg { color: var(--accent); }
.company-search { width: 200px; padding: 4px 8px; }
.short { flex: none; padding: 1px 6px; background: color-mix(in srgb, var(--danger) 16%, transparent); border-radius: 5px; color: var(--danger); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.short.covered { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.company-name { flex: 0 1 260px; }
.company-contact { flex: 0 1 240px; min-width: 200px; }
.partners td { padding: 8px 6px; }
.gap-left { margin-left: 10px; }
.modal-card:has(.rider-modal) { width: 460px; max-width: calc(100vw - 40px); }
@media (max-height: 760px) { .tab { padding: 4px 10px; } }
.partner-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.partner-chips .use { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 4px 2px 9px; background: var(--tint); border-radius: 7px; color: var(--text); }
.partner-chips em { color: var(--muted); font-style: normal; }
.offers { white-space: nowrap; }
.chip { margin: 1px 4px 1px 0; padding: 2px 8px; background: var(--tint); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 12px; cursor: pointer; }
.chip em { color: var(--muted); font-style: normal; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.logo-row { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.logo-preview { max-width: 120px; max-height: 36px; padding: 3px; background: #fff; border-radius: 5px; }
.send-note { margin-top: 8px; }
.socials { display: flex; gap: 2px; margin: 6px 0 0 4px; }
.social { display: flex; padding: 6px; background: none; border: 0; border-radius: 7px; color: var(--muted); }
.social:hover { background: var(--tint); color: var(--accent); }

.overview-sub { margin: 4px 0 20px; color: var(--soft); }
.io-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.io-head .io-tabs { margin: 0; }
.patch-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.uses { min-width: 130px; }
.use { display: inline-block; margin-right: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.use b { color: var(--soft); font-weight: 600; }
.warn { display: block; font-size: 12px; color: var(--warn); }
.warn.error { color: var(--danger); font-weight: 600; }
.sheet tbody tr.row-bad td { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.sheet tr.row-bad input[data-path$=".freq"], .sheet input.bad, .sheet tr[data-family] .w-num input.bad { color: var(--danger); font-weight: 600; }
.sheet input.bad { background-color: color-mix(in srgb, var(--danger) 16%, transparent); }
#issues { display: flex; flex-direction: column; gap: 4px; }
#issues:not(:empty) { margin: 0 0 12px; }
.issue { padding: 6px 11px; background: color-mix(in srgb, var(--warn) 12%, transparent); border: 0; border-radius: 7px; color: var(--warn); font-size: 12px; text-align: left; }
.issue-fix { margin-left: 10px; padding: 1px 8px; background: var(--warn); border: 0; border-radius: 5px; color: var(--bg); font-size: 12px; font-weight: 600; }
.issue.error { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); font-weight: 600; }
.checks { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tab.has-warn::after, .tab.has-error::after { content: ""; flex: none; width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--warn); }
.tab.has-error::after { background: var(--danger); }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 8px; }
.stat { display: flex; flex-direction: column; min-width: 130px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stat b { color: var(--accent); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); }
#tour-stats .stat { flex: 1 1 150px; min-width: max-content; padding: 10px 14px; }
#tour-stats .stat b { font-size: 20px; white-space: nowrap; }
.timeline { display: flex; flex-wrap: wrap; gap: 10px 36px; }
.timeline div { display: flex; flex-direction: column; }
.timeline span { font-size: 12px; color: var(--muted); }
.timeline b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.overview-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.overview-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 7px 10px; background: var(--head); border-bottom: 1px solid var(--line); }
.overview-table th:first-child { border-top-left-radius: 9px; }
.overview-table th:last-child { border-top-right-radius: 9px; }
.overview-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--soft); }
.overview-table tr:last-child td { border-bottom: 0; }
.overview-table b { color: var(--text); font-weight: 600; }
.todo { display: flex; flex-wrap: wrap; gap: 8px; }
.todo .btn { color: var(--warn); }

#modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); z-index: 10; }
#modal.show { display: flex; }
/* Головний екран увесь тягне вікно, а macOS забирає кліки в зоні перетягування навіть під вікнами поверх неї. */
#modal, #modal *, #combo, #toast { -webkit-app-region: no-drag; }
body:has(#modal.show) #start { -webkit-app-region: no-drag; }
body:has(#start.show) #topbar { -webkit-app-region: no-drag; }
.modal-card { width: 340px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 20px 22px; background: var(--panel-2); border-radius: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .4); }
.modal-card h2 { font-size: 17px; margin-bottom: 10px; }
.modal-actions { justify-content: flex-end; gap: 6px; margin: 16px 0 0; }
.segment { display: flex; gap: 2px; padding: 2px; background: var(--hover); border-radius: 8px; }
.segment button { flex: 1; background: none; border: 0; border-radius: 6px; padding: 5px 8px; color: var(--muted); }
.segment button.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

#combo { position: fixed; z-index: 30; display: none; max-height: 260px; padding: 4px; overflow-y: auto; background: var(--panel-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
#combo.show { display: block; }
.combo-item { display: block; width: 100%; padding: 5px 8px; background: none; border: 0; border-radius: 5px; color: var(--soft); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item:hover, .combo-item.active { background: var(--hover); color: var(--text); }
.combo-item.current { color: var(--accent); font-weight: 600; }

.live { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; margin: 8px 0 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.live div { display: flex; flex-direction: column; min-width: 0; }
.live span { font-size: 12px; color: var(--muted); }
.live b { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .clock { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }
.btn.live-on { color: var(--accent); font-weight: 600; }
.sheet tr.now td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.clock-cell, .sum-cell { padding-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid.budget-head { grid-template-columns: 2fr 1fr 1fr 1fr; margin-top: 12px; }
.budget-section td { padding-top: 10px; padding-bottom: 6px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-top: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-bottom: 1px solid var(--line); }
.budget-section td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.budget-section .section-name { width: auto; min-width: 220px; font-weight: 600; font-size: 14px; background: transparent; border-color: transparent; padding-left: 8px; }
.budget-section .section-name:hover, .budget-section .section-name:focus { border-color: var(--line); background: var(--field, rgba(255,255,255,.04)); }
.budget-section .tool { margin-left: 8px; font-weight: 400; }
.patch-solo-head { grid-template-columns: 2fr 1.4fr 1fr; margin-bottom: 14px; }
.quick-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 2px; }
.start-top .quick-prefs { padding: 0; margin-right: 6px; }
.pill { display: inline-flex; gap: 1px; padding: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 999px; }
.pill button { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; cursor: pointer; }
.pill button:hover { color: var(--text); }
.pill button.on { background: var(--card, rgba(255,255,255,.08)); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.preset-pick { width: auto; max-width: 150px; height: 28px; padding: 0 8px; font-size: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 7px; color: var(--soft); }
.chl-strip { display: grid; grid-template-columns: repeat(8, 1fr); border: 1px solid #000; margin: 0 0 6mm; }
.chl-cell { height: 13mm; padding: 1mm 1.5mm; border-right: 1px solid #000; display: flex; flex-direction: column; justify-content: center; overflow: hidden; border-top: 3mm solid var(--chl, #fff); }
.chl-cell:last-child { border-right: 0; }
.chl-cell b { font-size: 8pt; }
.chl-cell span { font-size: 9pt; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chl-cell[data-family="drums"] { --chl: #ec7b6b; } .chl-cell[data-family="bass"] { --chl: #e3a848; } .chl-cell[data-family="guitar"] { --chl: #85c76e; } .chl-cell[data-family="keys"] { --chl: #46bccd; }
.chl-cell[data-family="vocal"] { --chl: #bc95f2; } .chl-cell[data-family="playback"] { --chl: #6c9bf2; } .chl-cell[data-family="room"] { --chl: #979eab; } .chl-cell[data-family="pink"] { --chl: #ec7fb0; }
.chl-tags { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; }
.chl-tag { border: 1px dashed #000; padding: 1.5mm 2mm; height: 14mm; display: flex; flex-direction: column; overflow: hidden; }
.chl-tag b { font-size: 12pt; } .chl-tag span { font-size: 9pt; font-weight: 600; } .chl-tag em { font-size: 7pt; font-style: normal; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo-pair { display: inline-flex; gap: 2px; white-space: nowrap; }
.w-box { width: 140px; }
.box-sum { margin: 10px 0 0; font-size: 12px; }
.box-ports { white-space: nowrap; } .box-ports input { width: 52px; } .box-ports span { margin: 0 4px; color: var(--muted); }
.balcony-head { margin: 12px 0 6px; font-size: 13px; }
.warn-field { color: #e5484d; } .warn-field input { border-color: #e5484d; }
.merge-box { max-width: 640px; }
.merge-part { padding: 8px 0; border-bottom: 1px solid var(--line); }
.merge-part .muted { font-weight: 400; margin-left: 6px; }
.merge-sub { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px 26px; }
.sum-cell.no-disc { color: var(--muted); }
.disc-hint { margin: 4px 0 10px; }
.budget-note { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: normal; }
.key input + .budget-note { padding-left: 9px; }
.warn-mark { color: #e5484d; }
.ok-line { color: #46a758; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-top: 16px; }
.totals div { display: flex; gap: 24px; }
.totals span { color: var(--muted); }
.totals b { font-weight: 600; font-variant-numeric: tabular-nums; }
.totals .total b { font-size: 22px; }
.lib-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-card:has(.base) { width: 620px; }
.modal-card:has(.settings-modal) { width: 380px; height: min(760px, calc(100vh - 40px)); }
.base .segment { margin-bottom: 8px; }
.base-search { margin-bottom: 8px; }
.base-rows { height: 280px; overflow-y: auto; }
.btn.base-item { min-width: 0; flex: 1; overflow: hidden; background: none; color: var(--text); font-weight: 400; text-align: left; text-overflow: ellipsis; }
.btn.base-item:hover { background: var(--tint); }
.lib-save { display: flex; gap: 6px; margin-top: 12px; }
.lib-save input { flex: 1; }

#app.solo #doc-name, #app.solo [data-action="base-open"], #app.solo [data-action="export-pdf"], #app.solo #side-foot [data-tab="company"] { display: none; }
#app.solo #top-actions .btn { flex: none; }
#start { position: fixed; inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; background: var(--bg) radial-gradient(900px 420px at 50% -80px, var(--tint), transparent 72%) no-repeat; -webkit-app-region: drag; }
#start.show { display: flex; }
/* На весь екран: без зони перетягування, інакше хвиля за курсором не отримує рух миші. */
body.fullscreen #start { -webkit-app-region: no-drag; }
#start button { -webkit-app-region: no-drag; }
.start-burger { position: absolute; top: 10px; left: 84px; display: flex; padding: 6px; background: none; border: 0; border-radius: 7px; color: var(--soft); }
.start-resume { position: absolute; top: 10px; left: 122px; max-width: 320px; padding: 6px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-resume:hover { background: var(--tint); color: var(--text); }
.start-top { position: absolute; top: 10px; right: 14px; display: flex; gap: 8px; }
.start-tool { display: flex; align-items: center; gap: 7px; padding: 6px 12px; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--soft); }
.start-tool:hover { background: var(--hover); color: var(--text); }
.start-tool.quit:hover { color: var(--danger); }
.start-burger:hover { background: var(--hover); color: var(--text); }
.start-menu { position: absolute; top: 46px; left: 84px; display: none; flex-direction: column; gap: 1px; width: 280px; max-height: calc(100% - 64px); padding: 6px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); -webkit-app-region: no-drag; z-index: 5; }
.start-menu.open { display: flex; }
.start-menu h4 { margin: 10px 8px 4px; }
.menu-item { padding: 6px 8px; background: none; border: 0; border-radius: 6px; color: var(--text); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover { background: var(--tint); }
.recent-row { display: flex; align-items: center; gap: 2px; }
.recent-row .menu-item { flex: 1; min-width: 0; }
.recent-tool { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); opacity: 0; }
.recent-row:hover .recent-tool, .recent-tool:focus-visible { opacity: 1; }
.recent-tool:hover { color: var(--text); background: var(--tint); }
.recent-clear { margin-top: 4px; color: var(--muted); font-size: 12px; }
.menu-empty { margin: 0 8px 6px; color: var(--muted); font-size: 12px; }
.start-box { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 1080px; max-width: 100%; padding: 24px; }
.start-box h1 { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -.02em; }
.start-box p { margin: 0 0 22px; color: var(--soft); font-size: 15px; }
.start-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; width: 100%; margin-bottom: 16px; }
/* Дев'ять і більше карток: п'ять у ряд, щоб остання не лишалась сама. Вікно ширшає, коробка теж. */
@media (min-width: 960px) { .start-box:has(.start-cards > :nth-child(9)) { width: 1260px; } .start-cards:has(> :nth-child(9)) { grid-template-columns: repeat(5, 1fr); } }
.start-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 170px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: left; transition: border-color .12s, background .12s; }
.start-card:hover { background: var(--tint); border-color: var(--accent); }
.start-card svg { width: 26px; height: 26px; color: var(--accent); }
.start-logo { max-width: 140px; max-height: 40px; padding: 3px; background: #fff; border-radius: 5px; }
.start-card b { font-size: 19px; font-weight: 650; }
.start-card span { color: var(--soft); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 500;
  opacity: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity .2s;
}
#toast.show { opacity: 1; }

@media print {
  html, body { height: auto; overflow: visible; background: #fff; color: #111; font-size: 11px; }
  #app, #toast, #modal, #modal.show, #combo, #swatches { display: none; }
  #print { display: block; }
  .print-page { position: relative; break-after: page; }
  #print.bw .print-plot, #print.bw img, #print.bw .swatch { filter: grayscale(1) contrast(1.15); }
  .print-logo { position: absolute; top: 0; right: 0; max-width: 150px; max-height: 40px; }
  .print-page:last-child { break-after: auto; }
  .break-before { break-before: page; }
  #print h1 { font-size: 22px; margin: 0 0 10px; }
  #print h2 { font-size: 16px; margin: 0 0 8px; }
  #print h3 { font-size: 12px; margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; color: #333; }
  .pre { white-space: pre-wrap; margin: 0; }
  .print-sub { margin: -6px 0 12px; color: #444; }
  .kv { border-collapse: collapse; }
  .kv th { text-align: left; padding: 2px 16px 2px 0; font-weight: 600; color: #444; }
  .kv td { padding: 2px 0; }
  .grid-table { width: 100%; border-collapse: collapse; }
  .grid-table th { text-align: left; background: #e9ebef; }
  .grid-table th, .grid-table td { border: 1px solid #aab; padding: 3px 6px; }
  .grid-table tr { break-inside: avoid; }
  /* Розділ кошторису: темна смуга, відступ зверху, не відривається від своїх рядків. */
  .grid-table tr.print-section td { background: #2b2f38; color: #fff; font-weight: 700; letter-spacing: .04em; padding: 5px 6px; border-color: #2b2f38; }
  .grid-table tr.print-section td:last-child { text-align: right; }
  .grid-table tr.print-section { break-after: avoid; }
  .grid-table tbody tr.print-section:not(:first-child) td { border-top: 10px solid #fff; }
  #print.bw .grid-table tr.print-section td { background: #222; }
  .array-print { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
  #print .hang-view { color: #111; }
  #print .hang-view svg { max-height: 240px; }
  .print-label h1 { font-size: 40px !important; }
  .print-plot svg { display: block; width: 100%; height: auto; }
  .rider-plot svg, .rider-plot img { max-height: 125mm; width: auto; max-width: 100%; margin: 0 auto; }
  .rider-lists { display: grid; grid-template-columns: 3fr 2fr; gap: 6mm; align-items: start; }
  .rider-lists > div:only-child { grid-column: 1 / -1; }
  .rider .grid-table { font-size: 8.5px; }
  .rider .grid-table td, .rider .grid-table th { padding: 1.5px 4px; }
  .rider.dense .rider-plot svg, .rider.dense .rider-plot img { max-height: 80mm; }
  .rider.dense .grid-table { font-size: 6.8px; }
  .rider.dense .grid-table td, .rider.dense .grid-table th { padding: 0.5px 3px; line-height: 1.15; }
  .waybill-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-bottom: 4mm; }
  .waybill-total { margin: 6px 0 0; font-weight: 600; }
  .waybill-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; margin-top: 14mm; break-inside: avoid; }
  .waybill-signs .sign { display: grid; gap: 2px; }
  .waybill-signs .sign span { font-weight: 600; }
  .waybill-signs .sign i { display: block; height: 10mm; border-bottom: 1px solid #111; }
  .waybill-signs .sign em { font-style: normal; font-size: 9px; color: #666; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Райдер по розділах */
.rider-sub { margin: 22px 0 8px; }
.rider-sub h3 { margin: 0; }
.rider-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.rider-sections .field textarea { min-height: 64px; }
.musicians td input { width: 100%; }
.rider-found { margin: 6px 0 14px; padding: 0; list-style: none; }
.rider-found li { padding: 3px 0; }
.rider-found b { font-variant-numeric: tabular-nums; }
.acts .panel.drop-over { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* QR складу: наклейки A4 і сканер */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, var(--lw)); grid-auto-rows: var(--lh); justify-content: center; align-content: start; }
.qr-roll { width: var(--lw); height: var(--lh); overflow: hidden; }
.qr-roll .qr-label { width: var(--lw); height: var(--lh); border: 0; }
.qr-label { display: flex; align-items: center; gap: calc(var(--lh) * 0.08); width: var(--lw); height: var(--lh); padding: calc(var(--lh) * 0.07); border: 0.2mm dashed #bbb; overflow: hidden; background: #fff; color: #222; box-sizing: border-box; }
.qr-label svg { flex: none; width: var(--qr); height: var(--qr); }
.qr-label div { display: flex; flex-direction: column; gap: 0.6mm; min-width: 0; font-size: var(--fs); line-height: 1.15; }
.qr-label b { font-size: calc(var(--fs) * 1.2); overflow-wrap: anywhere; }
.qr-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-label .qr-own { white-space: normal; font-weight: 600; }
.qr-label code { font: calc(var(--fs) * 0.85) Menlo, monospace; color: #555; }
.modal-card:has(.labels-modal) { width: 440px; }
.labels-modal ~ select, .labels-modal ~ input { width: 100%; }
.label-size { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.label-size.hidden { display: none; }
.label-size input { width: 70px; }
.label-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); }
.label-preview { display: flex; justify-content: center; max-height: 230px; padding: 10px; overflow: auto; background: var(--hover); border-radius: 8px; }
.label-preview .qr-label { border-style: solid; border-color: #999; }
.modal-card:has(.scan-modal) { width: 420px; }
.scan-pick { width: 100%; margin-top: 8px; }
.scan-camera { display: none; margin: 10px 0; overflow: hidden; background: #000; border-radius: 8px; }
.scan-camera.on { display: block; }
.scan-camera video { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.scan-log { max-height: 180px; margin: 10px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.scan-log li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.scan-log li.warn { color: var(--warn, #e0a03a); }
.scan-count { display: block; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Відбір на складі: взяте зеленіє, частково взяте жовтіє, невзяте лишається як є */
tr.pick-done td { background: color-mix(in srgb, var(--ok) 14%, transparent); }
tr.pick-done td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.pick-part td { background: color-mix(in srgb, var(--warn) 12%, transparent); }
tr.pick-part td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.flash td { animation: pick-flash 1.2s ease; }
@keyframes pick-flash { 0% { background: color-mix(in srgb, var(--ok) 45%, transparent); } }
.pick-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 12px; }
.pick-bar { flex: 1 1 220px; max-width: 420px; height: 8px; overflow: hidden; background: var(--hover); border-radius: 4px; }
.pick-bar span { display: block; height: 100%; background: var(--warn); border-radius: 4px; transition: width .3s; }
.pick-progress.done .pick-bar span { background: var(--ok); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.scan-dock { display: flex; gap: 16px; align-items: stretch; margin: 0 0 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.scan-dock-main { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.scan-dock .segment { align-self: flex-start; }
.scan-last { margin: 0; font-size: 15px; font-weight: 600; }
.scan-last.warn { color: var(--warn); }
.scan-dock .scan-pick { width: auto; margin: 0; }
.dock-camera { flex: none; width: 220px; margin: 0; }
.scan-dock.camera .dock-camera { display: block; }
.dock-camera video { height: 140px; }

/* Живлення: звідки взяте споживання */
.watts-src { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.2; white-space: nowrap; }
.watts-src.guess { color: var(--warn); }
.power-actions { margin: 6px 0 14px; align-items: center; }

.start-demo { margin: 22px auto 0; padding: 8px 16px; background: none; border: 1px dashed var(--line-strong, rgba(255, 255, 255, .18)); border-radius: 10px; color: var(--soft); font-size: 13px; cursor: pointer; -webkit-app-region: no-drag; }
.start-demo:hover { border-color: var(--accent); color: var(--accent); }

/* Калькулятори */
.modal-card:has(.calc-modal) { width: 560px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); overflow-y: auto; }
.calc-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 8px 0; }
.calc-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.calc-field input, .calc-field select { width: 110px; }
.calc-field.wide, .calc-field.wide textarea, .calc-field.wide select { width: 100%; }
.calc-row .calc-field.wide { flex: 1 1 220px; }
.calc-out { display: flex; flex-direction: column; gap: 3px; margin: 12px 0; padding: 12px 14px; background: var(--hover); border-radius: 10px; }
.calc-out b { color: var(--accent); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-out span { color: var(--soft); }
.calc-table { max-height: 220px; overflow-y: auto; margin: 6px 0 10px; }
.calc-table .sheet { margin-top: 0; }
.ok-text { color: var(--ok); }

/* Інтермодуляція: вердикт, спектр, картки конфліктів */
.im-verdict { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 6px; padding: 12px 14px; border-radius: 10px; }
.im-verdict b { font-size: 18px; }
.im-verdict.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.im-verdict.ok b { color: var(--ok); }
.im-verdict.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.im-verdict.bad b { color: var(--danger); }
.im-verdict span { color: var(--soft); }
.im-spectrum { display: block; width: 100%; height: 92px; margin: 6px 0 0; }
.im-spectrum .sp-axis { stroke: var(--line); stroke-width: 1.5; }
.im-spectrum .sp-ok line { stroke: var(--ok); stroke-width: 2; }
.im-spectrum .sp-bad line { stroke: var(--danger); stroke-width: 3; }
.im-spectrum text { fill: var(--muted); font-size: 9px; }
.im-spectrum .sp-bad text { fill: var(--danger); font-weight: 700; }
.im-spectrum .sp-prod { fill: var(--muted); opacity: .55; }
.im-spectrum .sp-hit { fill: var(--danger); }
.im-spectrum .sp-edge { font-size: 9px; }
.im-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 10px; color: var(--muted); font-size: 11.5px; }
.im-legend i { display: inline-block; margin-right: 4px; vertical-align: middle; }
.im-legend .lg-ok, .im-legend .lg-bad { width: 3px; height: 12px; background: var(--ok); }
.im-legend .lg-bad { background: var(--danger); }
.im-legend .lg-dot { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; }
.im-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0; padding: 10px 12px; background: var(--hover); border-left: 3px solid var(--danger); border-radius: 8px; }
.im-card p { margin: 3px 0 0; color: var(--soft); }
.im-card .btn { flex: none; }
.mono { font-variant-numeric: tabular-nums; font-family: Menlo, monospace; font-size: 12px; }
.im-found { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.im-more { margin-top: 14px; }
.im-more summary { cursor: pointer; color: var(--soft); }
/* Справи: зроблене бліде й закреслене, прострочене з червоною смужкою, на сьогодні з жовтою. */
tr.todo-done td input:not([type="checkbox"]) { color: var(--muted); text-decoration: line-through; }
tr.todo-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.todo-late input[type="date"] { color: var(--danger); }
tr.todo-today td:first-child { box-shadow: inset 3px 0 0 var(--warn, #d9a23a); }
.page-stat.late-stat { color: var(--danger); }
.sheet th.sortable { cursor: pointer; }
.sheet th.sortable:hover { color: var(--text); }
.sheet th.sorted { color: var(--accent); }
.sheet th.sorted::after { content: " ↑"; }
.sheet th.sorted.desc::after { content: " ↓"; }
.modal-card:has(.case-block) { width: min(680px, 92vw); max-width: none; }
.case-block + .case-block { margin-top: 14px; }
.case-block input[type="number"] { width: 70px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.calendar-opts { display: grid; gap: 8px; margin: 10px 0 4px; }
/* Разом: спільна робота по мережі */
.side-link.live { color: var(--accent); }
.side-link.live svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 60%, transparent)); }
.modal-card:has(.collab) { width: min(520px, 92vw); max-width: none; }
.collab { display: grid; gap: 10px; }
.collab h4 { margin: 8px 0 0; }
.collab-pin { display: grid; grid-template-columns: auto 1fr; gap: 24px; padding: 12px 14px; background: var(--field); border-radius: 10px; }
.collab-pin div { display: grid; gap: 2px; }
.collab-pin b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.collab-pin div + div b { font-size: 15px; }
.collab-host { display: flex; align-items: center; gap: 8px; }
.collab-host > div { display: grid; flex: 1; min-width: 0; }
.collab-host #collab-address { flex: 1; min-width: 0; }
.collab-pin-input { width: 64px; text-align: center; }
.collab-people { display: flex; flex-wrap: wrap; gap: 6px; }
/* Невисоке вікно: 13 вкладок, «Зберегти» і «Разом» мають влазити без прокрутки, тож рядки щільніші,
   а «Зберегти» й «Експорт PDF» стоять поруч. */
@media (max-height: 820px) {
  .tab { padding: 4px 10px; }
  .side-link { padding-block: 4px; }
  #top-actions .save-btn, #top-actions .btn.primary { grid-column: auto; }
  #top-actions { margin-bottom: 8px; }
  #top-actions .label-long { display: none; }
  #top-actions .label-short { display: inline; }
}
@media (max-height: 700px) {
  .tab, .side-link { padding-block: 3px; line-height: 1.25; }
  #doc-name { margin-bottom: 5px; }
}
.hire-note { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.hire-lead { margin: 4px 0 10px; color: var(--soft); }
/* Загальний патч: стовпчик на артиста і рядки з конфліктом */
.sheet td.act-cell { text-align: center; font-variant-numeric: tabular-nums; }
.sheet td.act-cell.free { color: var(--muted); opacity: .5; }
.sheet tr.row-clash td.uses { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.sheet td.uses .warn { display: block; }
.warn-btn { margin-left: 10px; color: var(--warn); }
.waybill-preview { margin: 6px 0 10px; padding: 10px 12px; background: var(--field); border-radius: 8px; color: var(--soft); line-height: 1.5; }
@media print {
  .waybill-text { margin: 4mm 0 5mm; font-size: 12px; line-height: 1.6; }
}
.modal-card:has(.stock-pick) { width: min(760px, 94vw); max-width: none; }
.stock-pick .team-head { gap: 10px; }
.pick-wrap { max-height: min(52vh, 460px); overflow-y: auto; }
.stock-pick tr.picked td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stock-pick input[type="number"] { width: 64px; }
.map-pick { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.map-frame { display: block; width: 100%; height: 380px; border: 0; border-radius: 10px; background: var(--field); }
.cell-btn.booking-btn { font-weight: 700; font-size: 11px; color: #3b6fd6; }

/* Пульти в загальному патчі: перемикач Джерело / FOH / MON / … і рядки, які пульт не бере. */
.desk-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.desk-adds .btn { padding-inline: 10px; }
.desk-fields { margin-bottom: 8px; }
.desk-table tr.desk-off td { opacity: .45; }
.desk-table tr.desk-off td:first-child { opacity: 1; }
.desk-mode { margin: 4px 0 10px; }

/* Схема сигналу */
.flow-wrap { overflow-x: auto; margin: 6px 0 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.flow-svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.flow-svg .flow-node[data-action] { cursor: pointer; }
.flow-cards { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-card { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 6px; border: 1px solid var(--line); border-left: 3px solid var(--cc); border-radius: 7px; background: color-mix(in srgb, var(--cc) 10%, transparent); }
.flow-card select { width: 104px; }
.flow-card input[type="text"] { width: 64px; }
.flow-card input[type="number"] { width: 58px; }
.flow-table td { vertical-align: middle; }
.flow-table select { min-width: 150px; }
.print-flow svg { max-width: 100%; height: auto; }

/* Синхронізація вручну */
.sync-link { position: relative; }
.sync-link.waiting { color: var(--accent); }
.sync-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--warn); vertical-align: middle; }
.cloud-sync-mode { align-items: center; gap: 10px; margin-top: 8px; }
.cloud-sync-mode .subtabs { margin: 0; }
.start-cloud-row { display: flex; align-items: center; gap: 4px; }
.start-cloud-row .menu-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 13px; color: var(--soft); cursor: pointer; }

/* Фон головного екрана: рифлене скло й хвиля за курсором (start-fx.js). Під усім вмістом. */
#start .start-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Вимірювання */
.meas { display: grid; gap: 12px; }
.meas-head, .meas-io, .meas-tools, .meas-traces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.meas-head h2 { margin: 0 8px 0 0; }
.meas-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.meas-field select, .meas-field input { width: auto; min-width: 90px; }
.meas-io select { max-width: 220px; }
.meas-delay { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.meas-delay input { width: 86px; }
#meas-noise-db { width: 110px; }
.meas-canvas { width: 100%; height: min(62vh, 560px); border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: block; }
.meas-canvas.rta { height: min(52vh, 460px); }
.meas-spl { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.meas-spl > div { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.meas-spl b { font-size: 34px; font-variant-numeric: tabular-nums; }
.meas-spl > div:first-child b { font-size: 72px; line-height: 1; color: var(--accent); }
.meas-trace { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.meas-trace i { width: 10px; height: 10px; border-radius: 50%; }
.meas-trace.off { opacity: .45; }
.meas-trace .link { background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
@media (max-width: 700px) { .meas-spl { grid-template-columns: 1fr; } .meas-canvas { height: 52vh; } }

/* Швидкий доступ на головному екрані */
.start-quick { margin-top: 2px; display: grid; gap: 10px; justify-items: center; }
.tool-card { min-height: 132px; }
/* Карток стало більше: на невисокому вікні вони нижчі, а блок не робить верхні кнопки зоною перетягування. */
#start .start-box { -webkit-app-region: no-drag; }
@media (max-height: 760px) {
  .start-box { padding-top: 48px; }
  .start-box p { margin-bottom: 14px; }
  .start-card { min-height: 128px; padding: 16px; gap: 6px; }
  .tool-card { min-height: 104px; }
}
.quick-edit { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px dashed var(--line); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--muted); font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); }
.quick-edit:hover { border-color: var(--accent); color: var(--fg); }
.quick-edit.on { color: var(--accent); border-color: var(--accent); border-style: solid; }
.quick-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); }
.quick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.quick-chip.on { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.meas-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 18px; font-size: 13px; line-height: 1.45; }
.meas-help p { margin: 0; }
.meas-help p.muted { grid-column: 1 / -1; }

.meas .segment button { white-space: nowrap; }
.plan-card .page-head .muted { flex: 1 1 220px; }

/* Конструктор реків */
.rk { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 14px; align-items: start; }
.rk-list { display: grid; gap: 6px; position: sticky; top: 0; }
.rk-pick { display: flex; justify-content: space-between; gap: 8px; text-align: left; }
.rk-pick em { color: var(--muted); font-style: normal; }
.rk-pick.active { border-color: var(--accent); color: var(--fg); }
.rk-main { display: grid; gap: 12px; min-width: 0; }
.rk-head { flex-wrap: wrap; gap: 8px; }
.rk-head > input { max-width: 260px; font-size: 18px; font-weight: 600; }
.rk-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.rk-stats b { color: var(--fg); font-weight: 600; }
.rk-stats em { font-style: normal; }
.rk-issues { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, #e04848 14%, transparent); color: #f0a0a0; font-size: 13px; }
.rk-issues p { margin: 0; }
.rk-case { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.rk-form { display: grid; gap: 8px; }
.rk-drawings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.rk-drawings figure, .rk-print-draw figure { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rk-drawings figcaption { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.rk-svg { display: block; width: 100%; height: auto; max-height: 64vh; color: var(--fg); }
.rk-cut .sheet { margin-bottom: 8px; }
.rk-fill { display: grid; grid-template-columns: 250px minmax(0, 1fr) 230px; gap: 14px; align-items: start; }
.rk-lib { display: grid; gap: 8px; max-height: 72vh; overflow: auto; position: sticky; top: 0; }
.rk-cats { flex-wrap: wrap; gap: 4px; }
.rk-cats .subtab { font-size: 12px; padding: 3px 8px; }
.rk-devs { display: grid; gap: 6px; }
.rk-dev { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 6px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); cursor: grab; }
.rk-dev:hover { border-color: var(--accent); }
.rk-dev em { font-style: normal; font-size: 11px; color: var(--muted); }
.rk-dev-name { font-size: 12px; font-weight: 600; }
.rk-thumb { display: block; width: 100%; max-height: 80px; overflow: hidden; border-radius: 3px; background: #26282c; }
.rk-thumb img { display: block; width: 100%; height: 100%; object-fit: fill; }
.rk-part { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(90deg, #26282c 0 10px, #1c1d20 10px 14px); }
.rk-part.rk-blank, .rk-part.rk-dev { background: #26282c; }
.rk-elev { display: grid; gap: 8px; min-width: 0; }
.rk-view { justify-self: start; }
#rk-elev-host { cursor: grab; user-select: none; }
.rk-side { display: grid; gap: 8px; position: sticky; top: 0; }
.rk-props h3 { margin: 0 0 6px; }
.rk-hint { font-size: 13px; }
.rk-3d { display: grid; gap: 8px; }
.rk-3d-host { height: min(70vh, 640px); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.rk-3d-canvas { display: block; width: 100%; height: 100%; }
.rk-print-draw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.rk-print-draw .rk-svg, .rk-print-front .rk-svg { color: #111; max-height: 120mm; }
.rk-print-front .rk-svg { max-height: 200mm; }
@media (max-width: 1100px) { .rk { grid-template-columns: 1fr; } .rk-list { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; } .rk-fill { grid-template-columns: 220px minmax(0, 1fr); } .rk-side { grid-column: 1 / -1; position: static; } .rk-case { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .rk-fill { grid-template-columns: 1fr; } .rk-elev { order: -1; } .rk-lib { max-height: 46vh; position: static; } }
@media (max-width: 760px) { .rk { grid-template-columns: 1fr; } .rk-list { position: static; grid-auto-flow: column; overflow-x: auto; } .rk-fill { grid-template-columns: 1fr; } .rk-lib { max-height: 40vh; position: static; } }
/* Розсилка в Telegram: зліва люди зі статусом, справа що надіслати */
.modal-card:has(.base.tg) { width: min(980px, calc(100vw - 40px)); }
.base.tg { width: 100%; }
.tg-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tg-cols h3 { margin: 0 0 8px; }
.tg-people { display: grid; gap: 4px; max-height: 52vh; overflow: auto; }
.tg-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.tg-person input[type=checkbox] { grid-row: 1 / 3; }
.tg-person b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-person em { grid-column: 2; font-style: normal; color: var(--muted); font-size: 12px; }
.tg-state { grid-column: 3; grid-row: 1 / 3; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 12px; }
.tg-ok { color: var(--accent); }
.tg-off { color: var(--muted); }
.tg-bad { color: var(--warn, #e5734a); }
.tg-preview { margin: 8px 0; padding: 10px 12px; max-height: 34vh; overflow: auto; white-space: pre-wrap; font: 13px/1.45 inherit; font-family: inherit; background: var(--field); border-radius: 9px; }
.tg-doc { display: grid; gap: 8px; margin-top: 8px; }
.tg-doc label, .tg label { display: grid; gap: 4px; color: var(--soft); font-size: 13px; }
.tg .segment { margin-bottom: 8px; }
.tg-remind { display: flex !important; align-items: center; gap: 8px; margin-top: 12px; }
.tg-remind input[type=time] { width: 96px; }
.btn.small { padding: 3px 8px; font-size: 12px; }
@media (max-width: 760px) { .tg-cols { grid-template-columns: 1fr; } }
/* Вікно «Сцена»: форма, язик, закулісся */
.stage-shape .stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 6px 0 4px; }
.stage-shape label { display: grid; gap: 4px; color: var(--soft); font-size: 13px; }
.stage-shape label.check { display: flex; align-items: center; gap: 8px; }
.stage-shape h3 label.check { color: inherit; font-size: inherit; }
.modal-card:has(.stage-shape) { width: min(640px, calc(100vw - 40px)); }
@media (max-width: 600px) { .stage-shape .stage-grid { grid-template-columns: 1fr 1fr; } }

/* Саби й топи, зал (stageplot-pa.js) */
.plot-warn { margin: -2px 0 8px; padding: 6px 8px; border-radius: 6px; background: rgba(230, 120, 60, .15); color: #f0a070; font-size: 12px; }
.plot-hint-line { margin: -2px 0 8px; color: var(--muted); font-size: 12px; }
.stage-color { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.stage-color input[type=color] { width: 44px; height: 28px; padding: 0 2px; border-radius: 6px; cursor: pointer; }
.hall-sum { margin: 6px 0 4px; font-weight: 600; color: var(--accent); }

/* Конструктор райдера: кроки, вимоги галочками, інструменти складу */
.rider-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.rider-step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--soft); font-weight: 600; }
.rider-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: 12px; }
.rider-step:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.rider-step.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--field)); }
.rider-step.active b, .rider-step.pdf b { background: var(--accent); color: #fff; }
.rider-step.pdf { color: var(--text); }
.pdf3d-toggle { display: inline-flex; align-items: center; gap: 8px; }
.rider-builder .acts, .acts.rider-builder { display: block; }
.rider-box { display: flex; flex-direction: column; gap: 6px; }
.req-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rider-box-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.req-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; }
.req-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.req-chip.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.req-chip.on::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.musicians tr.gear-row td { background: color-mix(in srgb, var(--hover) 50%, transparent); }
.gear-item { display: flex; align-items: center; gap: 6px; padding-left: 14px; }
.gear-item input { flex: 1; min-width: 0; }
@media print {
  .print-3d svg { display: block; width: 100%; height: auto; }
  .print-note { margin: 4px 0 0; font-size: 9px; color: #555; }
  .req-list { margin: 2px 0 4px 16px; padding: 0; }
  .req-list li { margin: 1px 0; }
}
