/* Свет над столами — сукно и тёплый свет ламп */
:root {
  --bg: #f4f2ed;
  --card: #ffffff;
  --card-2: #faf9f6;
  --text: #19201c;
  --muted: #6b726d;
  --line: #e7e3da;
  --felt: #1d5a3e;
  --felt-deep: #123a28;
  --felt-dim: #dfe9e2;
  --lamp: #f2b632;
  --lamp-deep: #d9930b;
  --lamp-soft: #fdf1d3;
  --wood: #7a4a2a;
  --primary: #1d5a3e;
  --primary-text: #ffffff;
  --err: #c0392b;
  --warn: #b7791f;
  --blue: #2f6fd6;
  --heat-empty: #eef0ea;
  --shadow: 0 1px 2px rgba(25, 32, 28, .05), 0 4px 16px rgba(25, 32, 28, .05);
  --shadow-lg: 0 10px 30px rgba(25, 32, 28, .12);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1310; --card: #151d19; --card-2: #19231e; --text: #e7ece9; --muted: #92a199; --line: #25312b;
    --felt-dim: #173225; --lamp-soft: #3a2f14; --primary: #2c8a5d; --err: #ec6b5e; --warn: #e3a645;
    --blue: #6e9cf0; --heat-empty: #1b2520;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1310; --card: #151d19; --card-2: #19231e; --text: #e7ece9; --muted: #92a199; --line: #25312b;
  --felt-dim: #173225; --lamp-soft: #3a2f14; --primary: #2c8a5d; --err: #ec6b5e; --warn: #e3a645;
  --blue: #6e9cf0; --heat-empty: #1b2520;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1;
}
a { color: inherit; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .45rem; }
code { background: var(--card-2); border: 1px solid var(--line); padding: .05rem .35rem; border-radius: 6px; font-size: .86em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Шапка */
header.top {
  background:
    radial-gradient(1200px 120px at 15% -40px, rgba(242, 182, 50, .22), transparent 70%),
    linear-gradient(135deg, var(--felt-deep), var(--felt));
  color: #f3f6f2; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.top-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--lamp);
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 24px rgba(242, 182, 50, .35); }
.brand-text { font-weight: 700; font-size: 1.05rem; line-height: 1.15; display: flex; flex-direction: column; }
.brand-text small { font-weight: 400; font-size: .74rem; opacity: .65; }
nav { display: flex; gap: .2rem; flex-wrap: wrap; background: rgba(0, 0, 0, .18); padding: .25rem; border-radius: 12px; }
nav a { text-decoration: none; padding: .38rem .85rem; border-radius: 9px; color: rgba(243, 246, 242, .82); font-weight: 500; font-size: .93rem; }
nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
nav a.active { background: #f3f6f2; color: var(--felt-deep); }
nav a.muted-link { opacity: .6; }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.4rem 1rem 2rem; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

/* Заголовок страницы */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.eyebrow { margin: 0 0 .15rem; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--lamp-deep); }
.toolbar { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; justify-content: space-between; }
.toolbar.filters { justify-content: flex-start; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.toolbar.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); font-weight: 500; }
.daynav { display: flex; gap: .35rem; align-items: center; }
.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.row.center { justify-content: center; }

/* Поля и кнопки */
input, select, button { font: inherit; color: inherit; }
input, select {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .65rem; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--felt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--felt) 18%, transparent); }
input[type="checkbox"] { accent-color: var(--felt); width: 1rem; height: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: .45rem .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--muted) 60%, transparent); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.icon { width: 2.3rem; padding: .45rem 0; font-size: 1.2rem; line-height: 1; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn.danger { color: var(--err); }
.btn.ghost { background: transparent; }
.btn.small { padding: .22rem .6rem; font-size: .84rem; border-radius: 8px; }
.btn.link { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

.flash { background: var(--lamp-soft); border: 1px solid color-mix(in srgb, var(--lamp) 40%, transparent); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.flash.error { color: var(--err); background: var(--card); }

/* Карточки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.section { margin-bottom: 1rem; }
.section-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.section-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; }
.grid-2 > .card { margin-bottom: 1rem; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--line); }
.dot.on { background: var(--lamp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 30%, transparent), 0 0 12px var(--lamp); }
.badge { display: inline-block; font-size: .78rem; font-weight: 500; padding: .12rem .55rem; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); text-decoration: none; }
.badge.on { background: var(--lamp-soft); border-color: transparent; color: color-mix(in srgb, var(--lamp-deep) 70%, var(--text)); }
.badge.err { color: var(--err); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.badge.warn { color: var(--warn); background: var(--lamp-soft); border-color: transparent; }

/* Демо-баннер */
.demo-banner { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--lamp-soft), transparent); border: 1px dashed color-mix(in srgb, var(--lamp) 60%, transparent);
  border-radius: 12px; padding: .55rem .9rem; margin-bottom: 1rem; font-size: .9rem; }

/* Показатели */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { display: flex; gap: .85rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.kpi.live { background: linear-gradient(160deg, var(--lamp-soft), var(--card) 70%); }
.kpi-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; }
.kpi-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-icon.amber { background: var(--lamp-soft); color: var(--lamp-deep); }
.kpi-icon.green { background: var(--felt-dim); color: var(--felt); }
.kpi-icon.blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.kpi-icon.lamp { background: var(--lamp-soft); color: var(--lamp); }
.kpi-label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kpi-value { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
.kpi-value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.kpi-sub { color: var(--muted); font-size: .78rem; }

/* Мини-стол */
.mini-table { position: relative; width: 74px; height: 46px; border-radius: 9px; flex: none;
  background: #4a2e1c; padding: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.mini-table i { display: block; width: 100%; height: 100%; border-radius: 4px; background: #1d3a2b; transition: background .3s, box-shadow .3s; }
.mini-table span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: rgba(255, 255, 255, .55); }
.mini-table.lit { background: #8a5530; box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 25%, transparent), 0 6px 22px color-mix(in srgb, var(--lamp) 55%, transparent); }
.mini-table.lit i { background: radial-gradient(ellipse at 50% 45%, #48c07e, #24834f 75%); }
.mini-table.lit span { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.table-card { display: flex; gap: .9rem; align-items: center; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.table-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.table-card.on { border-color: color-mix(in srgb, var(--lamp) 55%, var(--line)); background: linear-gradient(135deg, var(--lamp-soft), var(--card) 60%); }
.tc-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.tc-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 99px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.pill.on { background: var(--lamp); color: #3b2a05; border-color: transparent; }
.pill.on i { width: 6px; height: 6px; border-radius: 50%; background: #3b2a05; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.tc-foot { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); }
.tc-foot b { color: var(--text); }
.bar { display: block; height: 5px; background: var(--felt-dim); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lamp), var(--lamp-deep)); border-radius: 99px; }

/* Лента дня */
.legend { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.legend .lg { width: 14px; height: 8px; border-radius: 3px; display: inline-block; margin-left: .4rem; }
.lg.seg-c { background: linear-gradient(90deg, var(--lamp), var(--lamp-deep)); }
.lg.open-c { background: repeating-linear-gradient(45deg, var(--lamp), var(--lamp) 3px, var(--lamp-soft) 3px, var(--lamp-soft) 6px); }
.timeline { display: flex; flex-direction: column; gap: .5rem; }
.tl-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: .9rem; align-items: center; }
.tl-name { display: flex; align-items: center; gap: .5rem; overflow: hidden; white-space: nowrap; font-weight: 500; }
.tl-name a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.tl-name a:hover { text-decoration: underline; }
.tl-bar { position: relative; height: 28px; background: var(--felt-dim); border-radius: 8px; }
.tl-scale .tl-bar { background: none; height: 16px; }
.tl-scale span { position: absolute; transform: translateX(-50%); font-size: .72rem; color: var(--muted); }
.tl-scale span:first-child { transform: none; }
.tl-scale span:last-child { transform: translateX(-100%); }
.tl-bar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--felt) 12%, transparent); }
.tl-bar .seg { position: absolute; top: 4px; bottom: 4px; min-width: 3px; border-radius: 5px;
  background: linear-gradient(180deg, #ffd56b, var(--lamp) 45%, var(--lamp-deep));
  box-shadow: 0 0 10px color-mix(in srgb, var(--lamp) 45%, transparent); }
.tl-bar .seg.open { background: repeating-linear-gradient(45deg, var(--lamp), var(--lamp) 6px, #ffd977 6px, #ffd977 12px); background-size: 17px 17px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 17px 0; } }
.tl-bar .now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--err); border-radius: 2px; }
.tl-bar .now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--err); }
.tl-sum { white-space: nowrap; text-align: right; font-size: .9rem; }

/* Период */
.period-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin: 1.6rem 0 .8rem; }
.period-head h2 { margin: 0; font-size: 1.2rem; }
.period-head h2 .muted { font-weight: 400; font-size: .95rem; }
.seg-switch { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg-switch button { border: 0; background: none; padding: .3rem .7rem; border-radius: 8px; cursor: pointer; font-size: .85rem; color: var(--muted); font-weight: 500; }
.seg-switch button.active { background: var(--felt); color: #fff; }

.chart-box { position: relative; height: 300px; }
.grid-2 .chart-box { height: 360px; }
.chart-box.small { height: 180px; margin: .6rem 0; }

.ranking { display: flex; flex-direction: column; gap: .7rem; }
.rank-row { display: grid; grid-template-columns: 1.6rem minmax(70px, 1fr) 2fr 4.4rem; gap: .6rem; align-items: center; font-size: .9rem; }
.rank-no { width: 1.6rem; height: 1.6rem; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--card-2); border: 1px solid var(--line); }
.rank-row:nth-child(1) .rank-no { background: var(--lamp); border-color: transparent; color: #3b2a05; }
.rank-row:nth-child(2) .rank-no, .rank-row:nth-child(3) .rank-no { background: var(--lamp-soft); border-color: transparent; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 10px; background: var(--felt-dim); border-radius: 99px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--felt), #2f9b65); border-radius: 99px; }
.rank-val { text-align: right; font-weight: 600; white-space: nowrap; }

/* Тепловая карта */
.heat-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 2rem repeat(24, minmax(22px, 1fr)); gap: 3px; min-width: 640px; }
.heat .hh { font-size: .68rem; color: var(--muted); text-align: center; }
.heat .hd { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; }
.heat i, .heat-legend i { display: block; aspect-ratio: 1.6; border-radius: 4px;
  background: color-mix(in srgb, var(--lamp) calc(var(--v) * 100%), var(--heat-empty));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lamp-deep) calc(var(--v) * 40%), transparent); }
.heat i:hover { outline: 2px solid var(--felt); outline-offset: 1px; }
.heat-legend i { width: 16px; aspect-ratio: auto; height: 10px; }

/* Пустое состояние */
.empty-state { text-align: center; padding: 2.8rem 1.2rem; }
.empty-state p { max-width: 520px; margin: .2rem auto 1rem; }
.empty-art { display: flex; justify-content: center; margin-bottom: 1rem; }
.empty-art .mini-table { width: 120px; height: 72px; padding: 9px; }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--card-2); }
thead tr th:first-child { border-top-left-radius: 8px; }
thead tr th:last-child { border-top-right-radius: 8px; }
tbody tr:hover td { background: var(--card-2); }
td.num, th.num { text-align: right; }
td.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }

/* Сводки на странице сессий */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); border-top: 3px solid var(--lamp); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat .value { font-size: 1.35rem; font-weight: 750; letter-spacing: -.01em; }

/* Формы */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .85rem 1rem; margin-bottom: .8rem; }
.grid-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; color: var(--muted); font-weight: 500; }
.grid-form label input, .grid-form label select { color: var(--text); font-weight: 400; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
details.hint { margin-top: .5rem; color: var(--muted); font-size: .9rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; }
details.hint summary { cursor: pointer; color: var(--text); font-weight: 500; }

/* Редактор зон */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; align-items: start; }
.canvas-wrap { position: relative; background: #000; border-radius: 12px; overflow: hidden; line-height: 0; box-shadow: var(--shadow-lg); }
.canvas-wrap img { width: 100%; height: auto; display: block; user-select: none; }
.canvas-wrap canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.no-snap { color: #ccc; padding: 4rem 1rem; text-align: center; line-height: 1.5; }
.zone-list { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.zone-item { display: grid; grid-template-columns: 12px 1fr 72px auto; gap: .4rem; align-items: center; padding: .3rem; border-radius: 8px; }
.zone-item.sel { background: var(--card); box-shadow: var(--shadow); }
.zone-item .sw { width: 12px; height: 12px; border-radius: 4px; }
.zone-item input, .zone-item select { padding: .28rem .45rem; border-radius: 8px; }

.zone-card { border-top: 1px solid var(--line); padding: 1rem 0 .4rem; }
.zone-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.th-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem .8rem; align-items: end; }
.th-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; color: var(--muted); font-weight: 500; }
.th-form label input { color: var(--text); }

progress { width: 100%; height: 8px; accent-color: var(--felt); }

/* Вход */
body.login { display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(900px 400px at 50% -10%, rgba(242, 182, 50, .25), transparent 70%), linear-gradient(160deg, var(--felt-deep), var(--felt)); }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: .8rem; box-shadow: var(--shadow-lg); }
.login-card h1 { display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; }
.login-card p { margin: 0; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { padding: 1rem 16px 1.5rem; }
  h1 { font-size: 1.4rem; }
  .top-inner { padding: .6rem 16px; }
  .brand-text small { display: none; }
  nav { width: 100%; justify-content: space-between; }
  nav a { padding: .35rem .6rem; flex: 1; text-align: center; }
  .editor { grid-template-columns: 1fr; }
  .kpis { gap: .6rem; }
  .kpi { padding: .8rem; gap: .6rem; flex-direction: column; }
  .kpi-value { font-size: 1.25rem; }
  .tl-row { grid-template-columns: 1fr auto; gap: .25rem .6rem; }
  .tl-row .tl-bar { grid-column: 1 / -1; grid-row: 2; }
  .tl-scale .tl-name, .tl-scale .tl-sum { display: none; }
  .tl-scale .tl-bar { grid-row: 1; }
  .tl-scale span:nth-child(even) { display: none; }
  .tables-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .table-card { flex-direction: column; align-items: stretch; gap: .55rem; padding: .7rem; }
  .table-card .mini-table { width: 100%; height: 40px; }
  .tc-name { font-size: .92rem; }
  .pill { font-size: .72rem; white-space: nowrap; padding: .1rem .45rem; }
  .page-tools { width: 100%; justify-content: space-between; }
}
.eyebrow a { text-decoration: none; } .eyebrow a:hover { text-decoration: underline; }
