/* =========================================================================
   Call Copilot — тёмная тема. Один экран, ничего не уезжает за вьюпорт.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* флекс-раскладка не должна перебивать атрибут hidden */
[hidden] { display: none !important; }

:root {
  --bg:        #0a0d13;
  --surface:   #12161f;
  --surface-2: #1a202b;
  --surface-3: #222a37;
  --line:      #232b39;
  --line-soft: #1b222d;

  --text:      #e9edf5;
  --text-2:    #9aa5b8;
  --text-3:    #626d80;

  --accent:    #4f8cff;
  --amber:     #ffc93f;
  --green:     #34d17f;
  --red:       #ff6b6b;
  --yellow:    #f5b83d;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;

  --shadow: 0 8px 32px rgba(0,0,0,.45);
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

kbd {
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: inherit;
  opacity: .6;
  letter-spacing: .3px;
}

.banner {
  flex: 0 0 auto;
  background: #6d2626;
  color: #ffdada;
  padding: 9px 16px;
  text-align: center;
  font-size: 13px;
}

/* ============================ HEADER ============================ */

.header {
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.brand span { background: linear-gradient(90deg, #fff, #a9bde0); -webkit-background-clip: text; background-clip: text; color: transparent; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--line-soft);
}
.tab-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); background: var(--surface-3); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px 5px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
  position: relative;
}
.pill::before {
  content: "";
  position: absolute;
  left: 10px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: currentColor;
}
.pill-live { color: var(--green); border-color: rgba(52,209,127,.35); background: rgba(52,209,127,.08); }
.pill-live::before { animation: pulse 1.6s ease-out infinite; }
.pill-warn { color: var(--yellow); border-color: rgba(245,184,61,.35); background: rgba(245,184,61,.08); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,209,127,.55); }
  100% { box-shadow: 0 0 0 7px rgba(52,209,127,0); }
}

.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ============================ LAYOUT ============================ */

.main { flex: 1; min-height: 0; display: flex; }
.tab-panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab-panel.active { display: flex; }

.plaque {
  flex: 0 0 auto;
  margin: 12px 16px 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--yellow);
  background: rgba(245,184,61,.09);
  border: 1px solid rgba(245,184,61,.28);
  border-radius: var(--r);
}

.live-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 34%) 1fr;
  gap: 12px;
  padding: 12px 16px;
}

.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.panel-sub {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================ ТРАНСКРИПТ ============================ */

.transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t-entry { padding-left: 11px; border-left: 2px solid var(--line); }
.t-entry.client { border-left-color: var(--accent); }
.t-entry.you    { border-left-color: var(--text-3); }

.t-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}
.t-who {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.t-entry.client .t-who { color: var(--accent); }
.t-entry.you .t-who    { color: var(--text-3); }
.t-time { font-size: 10px; color: var(--text-3); opacity: .7; }
.t-text { font-size: 14px; color: var(--text); word-break: break-word; }

.t-entry.interim { opacity: .6; border-left-style: dashed; }
.t-entry.interim .t-text { font-style: italic; color: var(--text-2); }
.t-entry.manual .t-who::after { content: " ✍"; }

/* ============================ ОТВЕТЫ ============================ */

.answers {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answers-empty {
  margin: auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  max-width: 280px;
  line-height: 1.6;
}

.answer {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: opacity .2s;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  color: var(--text-3);
}
.ttft { color: var(--green); font-weight: 700; }
.badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.stale-label  { color: var(--red);    background: rgba(255,107,107,.14); }
.broken-label { color: var(--yellow); background: rgba(245,184,61,.14); }

.answer-actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.answer:hover .answer-actions, .answer.current .answer-actions { opacity: 1; }
.act-btn {
  font: inherit;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.act-btn:hover { color: var(--text); border-color: var(--accent); }

.answer .en {
  font-size: 25px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -.01em;
  word-break: break-word;
}
.answer .ru {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  word-break: break-word;
}
.answer .ru:empty { display: none; }

.answer.current { border-color: rgba(79,140,255,.35); background: var(--surface-2); box-shadow: 0 0 0 1px rgba(79,140,255,.12); }
.answer.streaming .en::after {
  content: "▌";
  color: var(--accent);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.answer.old {
  opacity: .5;
  padding: 10px 14px;
  background: transparent;
}
.answer.old .en { font-size: 15px; font-weight: 400; color: var(--text-2); }
.answer.old .ru { font-size: 11px; }
.answer.old:hover { opacity: .85; }
.answer.stale { opacity: .3; }

/* ============================ УПРАВЛЕНИЕ ============================ */

.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.controls-spacer { flex: 1; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #241d00;
  background: linear-gradient(180deg, #ffd45f, #ffbe28);
  border: none;
  border-radius: var(--r);
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255,190,40,.22);
  transition: filter .12s, transform .06s;
}
.btn-primary:hover  { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .bp-icon { font-size: 15px; }
.btn-primary kbd { background: rgba(0,0,0,.14); color: #241d00; opacity: .5; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.btn:hover { color: var(--text); border-color: var(--surface-3); background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: default; }

.btn-lg { padding: 13px 16px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 9px; width: 38px; justify-content: center; font-size: 15px; }
.btn-danger:hover { color: var(--red); border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.08); }

.btn.on { color: var(--text); border-color: rgba(79,140,255,.45); background: rgba(79,140,255,.12); }
#btn-capture.on { color: var(--green); border-color: rgba(52,209,127,.4); background: rgba(52,209,127,.09); }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex: 0 0 auto;
}
#btn-capture.on .dot { background: var(--green); box-shadow: 0 0 8px rgba(52,209,127,.8); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  padding: 0 4px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 34px; height: 19px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background .15s, border-color .15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track { background: rgba(52,209,127,.22); border-color: rgba(52,209,127,.5); }
.switch input:checked + .switch-track::after { transform: translateX(15px); background: var(--green); }
.switch input:checked ~ .switch-label { color: var(--text); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ручной ввод */
.manual-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
  background: var(--surface);
}
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  flex: 0 0 auto;
}
.seg-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.seg-btn:hover { color: var(--text-2); }
.seg-btn.active { color: var(--text); background: var(--surface-3); }

.manual-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 14px;
  outline: none;
  transition: border-color .12s;
}
.manual-input:focus { border-color: var(--accent); }
.manual-input::placeholder { color: var(--text-3); }

/* ============================ СКРИПТЫ ============================ */

.scripts-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; gap: 12px; padding: 12px 16px; }

.scripts-nav {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.scripts-nav button {
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--text-2);
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .12s, background .12s;
}
.scripts-nav button:hover { color: var(--text); background: var(--surface-2); }
.scripts-nav button.active { color: var(--text); background: var(--surface-3); }

.scripts-body {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.script-cat-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.script-cat-sub { font-size: 13px; color: var(--text-2); margin: 4px 0 18px; }

.script-item {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .12s, transform .06s;
}
.script-item:hover { border-color: rgba(79,140,255,.4); }
.script-item:active { transform: translateY(1px); }
.s-en { font-size: 15px; line-height: 1.5; }
.s-ru { font-size: 12px; line-height: 1.45; color: var(--text-2); margin-top: 7px; }
.s-tech {
  display: inline-block;
  margin-top: 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(79,140,255,.12);
  padding: 3px 7px;
  border-radius: 4px;
}

/* ============================ НАСТРОЙКИ ============================ */

.settings-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  padding: 12px 16px 20px;
  align-items: start;
  max-width: 1500px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
}
.card-wide { grid-column: 1 / -1; }
@media (min-width: 1200px) { .card-wide { grid-column: span 2; } }

.card-head { margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(255,201,63,.13);
  padding: 3px 7px;
  border-radius: 4px;
}

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-tight { display: flex; gap: 6px; align-items: stretch; }
.row-tight select { flex: 1; min-width: 0; }

.label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.hint-inline { font-weight: 400; color: var(--text-3); font-size: 11px; margin-left: 4px; }

.field input[type="text"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color .12s;
}
.field textarea { resize: vertical; line-height: 1.5; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field select { cursor: pointer; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: 4px; }

.hint { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; color: var(--text-3); }
.hint a { color: var(--accent); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.toolbar-select {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 9px;
  outline: none;
  cursor: pointer;
  max-width: 100%;
}
.toolbar-select:focus { border-color: var(--accent); }
.toolbar-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }

#preset-note:empty { display: none; }
#preset-note { margin: -6px 0 12px; }

textarea.drop-target { border-color: var(--accent) !important; background: rgba(79,140,255,.07); }
.save-note { font-size: 11px; color: var(--text-3); margin-top: 14px; }

.test-results { margin-top: 12px; font-size: 13px; line-height: 1.7; }
.test-ok { color: var(--green); }
.test-fail { color: var(--red); }

.bench-results { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.bench-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 12px;
  text-align: left;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color .12s;
}
.bench-row:hover { border-color: var(--accent); }
.bench-row.current { border-color: rgba(52,209,127,.5); background: rgba(52,209,127,.07); }
.bench-row.current::after { content: "выбрана"; margin-left: auto; font-size: 10px; color: var(--green); }
.b-ms { color: var(--amber); font-weight: 700; min-width: 58px; }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-wait { font-size: 11px; color: var(--text-3); padding: 4px 2px; }

/* ============================ OVERLAY / MODAL ============================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4,6,10,.8);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 30px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.modal-sm { max-width: 440px; }
.modal h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 18px; }
.modal-text { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 16px; font-size: 14px; }
.steps li::marker { color: var(--text-3); font-weight: 700; }
.steps a { color: var(--accent); }
.steps input {
  display: block;
  width: 100%;
  margin-top: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  outline: none;
}
.steps input:focus { border-color: var(--accent); }

.chrome-mock {
  max-width: 340px;
  margin: 10px 0 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-size: 11px;
}
.cm-title { padding: 7px 11px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.cm-tabs { display: flex; gap: 2px; padding: 6px 9px; }
.cm-tabs span { padding: 4px 9px; border-radius: 5px; color: var(--text-3); }
.cm-tabs span.on { background: var(--surface-3); color: var(--text); }
.cm-screen { text-align: center; font-size: 30px; padding: 8px; }
.cm-check { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-top: 1px solid var(--line); }
.cm-arrow { color: var(--amber); font-weight: 700; margin-left: auto; }

/* ============================ TOASTS ============================ */

.toasts {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  font-size: 13px;
  padding: 11px 15px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  animation: toast-in .16s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.ok    { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================ SCROLLBARS ============================ */

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #313b4c; background-clip: padding-box; }

/* ============================ АДАПТИВ ============================ */

/* рабочие ноуты 1366×768 */
@media (max-height: 820px) {
  .answer .en { font-size: 21px; }
  .answer { padding: 12px 14px; }
  .btn-primary { padding: 11px 22px; font-size: 15px; }
  .btn-lg { padding: 11px 14px; }
  .controls { padding: 10px 16px; }
  .live-grid { padding: 10px 12px; gap: 10px; }
  .panel-head { padding: 10px 14px 8px; }
}
@media (max-width: 1000px) {
  .live-grid { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 30%) 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .scripts-layout { grid-template-columns: 180px 1fr; }
}
