:root {
  color-scheme: light dark;
  --page: light-dark(#f3f5fa, #11151e);
  --surface: light-dark(#fff, #191f2b);
  --soft: light-dark(#f7f8fc, #202738);
  --line: light-dark(#e2e6f1, #344059);
  --ink: light-dark(#1b2540, #eef3ff);
  --muted: light-dark(#55627e, #adb9d4);
  --accent: light-dark(#4f38aa, #c8baff);
  --accent-text: light-dark(#fff, #221444);
  --tint: light-dark(#eee9ff, #342854);
  --green: light-dark(#18644d, #93dfbf);
  --danger: light-dark(#a72745, #ff9eb5);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-size: 23px; font-weight: 680; letter-spacing: -.035em; }
h3 { font-size: 14px; font-weight: 650; }
small { display: block; color: var(--muted); font-size: 12px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:is(button, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 12px; max-width: 1360px; margin: auto; min-height: 63px; padding: 10px 32px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.mark { display: grid; place-items: center; width: 33px; height: 33px; font-size: 18px; border-radius: 8px; background: var(--accent); color: var(--accent-text); }
.demo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px; background: var(--soft); font-size: 12px; color: var(--muted); }
.demo::before, .presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.demo::before { color: var(--accent); }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.help { font-weight: 700; }
.stage { max-width: 1360px; margin: auto; padding: 28px 32px; display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(330px, 1fr); gap: 20px; align-items: start; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel-head p, .caption { margin-top: 4px; color: var(--muted); }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; min-height: 36px; background: var(--surface); color: var(--ink); padding: 6px 11px; font-weight: 600; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--soft); }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent), var(--ink) 12%); }
.button.subtle, .icon-button.subtle { border-color: transparent; background: transparent; }
.button.danger, .icon-button.danger { color: var(--danger); }
.icon-button { width: 36px; flex: none; padding: 0; font-size: 18px; }
.icon-button.play { font-size: 13px; color: var(--accent); background: var(--tint); border-color: transparent; }
.icon-button.play:hover { background: color-mix(in srgb, var(--tint), var(--accent) 12%); }
.table { width: 100%; border-collapse: collapse; }
.table :is(th, td) { border-bottom: 1px solid var(--line); padding: 9px 6px; text-align: left; overflow-wrap: anywhere; }
.table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.table :is(th, td):first-child { width: 25px; padding-left: 0; }
.table :is(th, td):last-child { padding-right: 0; }
.table tr.selected { background: var(--soft); }
.table input { display: block; width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.bot { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.bot:hover strong { color: var(--accent); text-decoration: underline; }
.avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--accent); background: var(--tint); font-size: 11px; flex: none; }
.presence { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.presence.online { color: var(--green); }
.bulk { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--tint); border-radius: 8px; padding: 3px 7px; margin-bottom: 5px; }
.bulk span { padding: 5px 4px; color: var(--accent); }
.scenarios .panel-head { margin-bottom: 8px; }
.scenario { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scenario:last-child { border-bottom: 0; padding-bottom: 1px; }
.scenario h3 { overflow-wrap: anywhere; }
.scenario small { margin-top: 2px; }
.more { position: relative; }
.menu { position: absolute; z-index: 2; top: calc(100% + 5px); right: 0; width: 150px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 5px 16px color-mix(in srgb, var(--ink), transparent 88%); }
.menu button { display: block; width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 4px; background: none; }
.menu button:hover { background: var(--soft); }
.menu .danger { color: var(--danger); }
.feedback { max-width: 1360px; margin: 0 auto; padding: 0 32px; color: var(--muted); }
dialog { width: min(590px, calc(100% - 24px)); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); padding: 21px; }
dialog::backdrop { background: light-dark(#20284373, #0009); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
form, .field { display: grid; gap: 6px; min-width: 0; }
form { gap: 14px; }
.field :is(input, select) { width: 100%; min-height: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; }
.fields { display: grid; grid-template-columns: minmax(85px, 1fr) minmax(0, 2fr); gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
dialog:has(.session-details) { width: min(380px, calc(100% - 24px)); }
dialog:has(.session-details) .dialog-head { margin-bottom: 8px; }
dialog:has(.session-details) h2 { font-size: 20px; }
.session-details { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.session-actions { justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.error { color: var(--danger); }
.editor-table { table-layout: fixed; }
.editor-table :is(th, td):first-child { width: 28%; padding-left: 8px; }
.editor-table th:nth-child(2) { width: 7.6rem; white-space: nowrap; }
.editor-table :is(th, td):last-child { width: 43px; text-align: right; }
.editor-table :is(input, select) { display: block; width: 100%; min-width: 0; height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.editor-table input[type="number"] { appearance: textfield; }
.editor-table input::-webkit-inner-spin-button { appearance: none; }
.editor-table input::placeholder { color: var(--muted); opacity: 1; }
.editor-table tbody tr:last-child td { border-bottom: 0; }
.editor-table .icon-button svg { width: 17px; height: 17px; }
.definitions { display: grid; gap: 13px; margin: 0; }
.definitions dt { font-weight: 650; }
.definitions dd { margin: 2px 0 0; color: var(--muted); }
.login { max-width: 390px; margin: 28px auto; }
.login .actions { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 910px) {
  .stage { padding: 20px 18px; gap: 12px; grid-template-columns: minmax(0, 1.7fr) minmax(273px, 1fr); }
  .panel { padding: 15px; }
}
@media (max-width: 710px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .top-inner { padding-inline: 18px; }
  .feedback { padding-inline: 18px; }
}
@media (max-width: 430px) {
  .top-inner, .stage, .feedback { padding-inline: 10px; }
  .top-inner { gap: 7px; flex-wrap: wrap; }
  .brand { font-size: 15px; }
  .avatar { display: none; }
  .table :is(td, th) { padding-inline: 3px; font-size: 12px; }
  dialog { padding: 14px; }
  .editor-table :is(th, td):first-child { padding-left: 3px; }
  .editor-table th:nth-child(2) { width: 6.5rem; }
  .editor-table :is(input, select) { padding-inline: 3px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .icon-button { width: 44px; min-height: 44px; }
  .table input { width: 22px; height: 22px; }
}
.login { width: min(390px, calc(100% - 20px)); }
.login form { margin-top: 16px; }
#dialog-title, .top-actions button { overflow-wrap: anywhere; }
