dialog{max-width:min(92vw,640px);border:1px solid var(--line);border-radius:16px;padding:24px;color:var(--ink);background:var(--page)}dialog::backdrop{background:#10264499}dialog code{display:block;overflow-wrap:anywhere;margin:16px 0}dialog button{margin:4px}.menu-toggle{display:none}pre{overflow-wrap:anywhere;white-space:pre-wrap}input[type=checkbox]{width:auto}main{min-width:0}details.card>summary{cursor:pointer}body.dark{--ink:#e3edff;--muted:#a8b8d0;--page:#121c2e;--line:#34435d;--navy:#e3edff;background:var(--page)}body.dark .card,body.dark .sidebar,body.dark .topbar,body.dark .stat-card{background:#1c2940;color:var(--ink)}body.dark input,body.dark textarea,body.dark select{background:#121c2e;color:#e3edff;border-color:#43516a}body.dark a{color:#92bfff}body.dark th,body.dark td{border-color:#34435d}body.dark .section-head p,body.dark .muted{color:#abbcd5}.form-preview{white-space:pre-wrap;line-height:1.8}.filter-input{margin-bottom:12px}.button-editor-row{flex-wrap:wrap}.button-editor-row input{min-width:120px}.source-row{padding:12px;border:1px solid var(--line);border-radius:12px;margin:8px 0}.source-row legend{font-weight:700}
@media(max-width:820px){.menu-toggle{display:inline-flex}.sidebar{position:fixed;inset:0 auto 0 0;height:100dvh;width:260px;transform:translateX(-100%);transition:transform .15s;box-shadow:8px 0 35px #0003}.nav-open .sidebar{transform:translateX(0)}.side-nav{display:block;overflow-y:auto;white-space:normal}.side-nav a{display:flex}.sidebar-bottom{display:block}.brand-panel{display:block}.topbar{position:sticky;top:0}.nav-open::before{content:'';position:fixed;inset:0;background:#0006;z-index:25}.nav-open .menu-toggle{position:fixed;left:270px;top:15px;z-index:40}.table-scroll{max-width:100%;overflow:auto}.topbar-right{gap:6px}.topbar-kicker{display:none}}
@media(max-width:560px){.online-pill{display:none}.field-grid{grid-template-columns:1fr}main{padding:14px}.card{padding:16px}.button-editor-row{display:flex;flex-direction:column;align-items:stretch}.topbar{gap:8px}.topbar-title{font-size:13px}}

/* Shared management workspace */
.app-shell {
  --workspace-surface: #f4f7fb;
  --workspace-panel: #fff;
  --workspace-border: #dce5f0;
  background: var(--workspace-surface);
}
body.dark .app-shell {
  --workspace-surface: #121c2e;
  --workspace-panel: #1c2940;
  --workspace-border: #34435d;
}
.app-shell .sidebar,
.app-shell .topbar {
  background: var(--workspace-panel);
  border-color: var(--workspace-border);
}
.app-shell .side-nav a {
  min-height: 44px;
  border-radius: 10px;
}
.app-shell .side-nav a.active {
  font-weight: 700;
}
.app-shell .main-area main {
  width: min(100%, 1480px);
  margin-inline: auto;
  padding: clamp(16px, 3vw, 42px);
}
.app-shell .card,
.app-shell .stat-card {
  background: var(--workspace-panel);
  border: 1px solid var(--workspace-border);
  border-radius: 14px;
  box-shadow: 0 3px 10px #142d5510;
}
.app-shell .table-scroll {
  border: 1px solid var(--workspace-border);
  border-radius: 10px;
}
.app-shell .table-scroll :is(th, td) {
  padding-block: 12px;
}
.app-shell :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid #347ef2;
  outline-offset: 2px;
}
@media (max-width: 560px) {
  .app-shell .main-area main { padding: 12px; }
  .app-shell .section-head { flex-wrap: wrap; }
  .app-shell .card { border-radius: 12px; }
}

.app-shell .sidebar {
  background: #0c2345;
  color: #e9f2ff;
}
.app-shell .sidebar a, .app-shell .sidebar .brand-name {
  color: #e9f2ff;
}
.app-shell .sidebar .nav-label, .app-shell .sidebar .brand-tagline {
  color: #a9bdd8;
}
.app-shell .side-nav a.active {
  background: #0785ed;
  color: white;
}
.telegram-preview {
  background: #e6f1fa;
}
.telegram-preview p {
  background: white;
  color: #172b46;
  padding: 18px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.preview-button-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.preview-button-row button {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.button-workbench { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.button-workbench > * { min-width: 0; }
.button-editor-row { display: flex; gap: 8px; margin: 12px 0; }
.button-editor-row input, .button-editor-row select { flex: 1 1 160px; max-width: 100%; }
body.dark .telegram-preview { background: #243c55; }
body.dark .telegram-preview p { background: #14283e; color: #e9f2ff; }

.app-shell .sidebar .nav-icon { color: #2867ab; }
.app-shell .side-nav a:hover { background: #163c68; color: white; }

.field-grid > div:has(> textarea[name="buttons"]) { grid-column: 1 / -1; }
