:root {
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  --bg: #f5f7f8;
  --surface: #fff;
  --subtle: #f8faf9;
  --text: #243733;
  --muted: #7b8985;
  --line: #e2e9e5;
  --accent: #176e56;
  --tint: #e8f3ed;
  --input: #fff;
  --danger: #b24646;
  --shadow: #133d2010;
  --grid: #edf1ef;
  --bar: #a7cdb9;
  --notice-bg: #fff7e7;
  --notice-line: #e5d3a1;
  --notice-text: #88672a;
}

/* A neutral, compact operations workspace. */
:root {
  --bg: #f7f8fb;
  --surface: #fff;
  --subtle: #f6f8fc;
  --text: #182235;
  --muted: #778399;
  --line: #e5eaf2;
  --accent: #3168f5;
  --tint: #edf2ff;
  --input: #fff;
  --shadow: #152a4a0a;
  --grid: #edf0f6;
  --bar: #a5bdfb;
}
[data-theme="dark"] {
  --bg: #111318;
  --surface: #191c23;
  --subtle: #20242c;
  --text: #e7e9ee;
  --muted: #9ca3b1;
  --line: #30343e;
  --accent: #90b4ff;
  --tint: #242e43;
  --input: #151820;
  --danger: #f19696;
  --shadow: #0003;
  --grid: #2c3039;
  --bar: #455c83;
  --notice-bg: #322c20;
  --notice-line: #574a2f;
  --notice-text: #e4c58a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button {
  border: 0;
  background: none;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 10px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 7px;
}
h3 {
  font-size: 14px;
  margin-bottom: 6px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 14px;
}
.workspace {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 34px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.8px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 7px;
}
.brand-mark {
  display: inline-block;
  font-size: 27px;
  line-height: 42px;
  text-align: center;
  font-weight: 750;
  width: 42px;
  flex-shrink: 0;
  background: var(--tint);
  color: var(--accent);
  border-radius: 11px;
  letter-spacing: -3px;
  padding-right: 4px;
}
.brand-mark span {
  color: #90af7b;
}
.nav-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 48px 13px 18px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 3px 0;
  color: var(--muted);
}
.sidebar nav button span {
  font-size: 19px;
  width: 20px;
  text-align: center;
}
.sidebar nav button.active {
  background: var(--tint);
  color: var(--accent);
  font-weight: 600;
}
.sidebar nav button:hover {
  background: var(--subtle);
}
.sidebar-footer {
  margin-top: auto;
  font-size: 9px;
  color: var(--muted);
  padding: 18px 7px 0;
  border-top: 1px solid var(--line);
  line-height: 1.7;
}
.sidebar-footer small {
  display: block;
  font-size: 8px;
  margin: 7px 0 0 12px;
}
.dot {
  display: inline-block;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  background: #65ac80;
  margin-right: 4px;
}
main {
  width: calc(100% - 224px);
  margin-left: 224px;
}
.topbar {
  height: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  font-size: 11px;
}
.breadcrumb {
  color: var(--muted);
}
.breadcrumb i {
  margin: 0 14px;
  font-style: normal;
  opacity: 0.5;
}
.breadcrumb b {
  font-weight: 500;
  color: var(--text);
}
.account {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 180px;
}
.theme-control {
  position: fixed;
  right: 28px;
  top: 24px;
  z-index: 5;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.theme-control select {
  padding: 5px 8px;
  font-size: 10px;
  width: 85px;
}
.theme-control label {
  margin: 0;
  font-size: 9px;
}
.page {
  max-width: 1480px;
  padding: 38px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.page-heading .muted {
  margin-bottom: 0;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.primary,
.secondary {
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 11px;
  white-space: nowrap;
  display: inline-flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.primary {
  background: var(--accent);
  color: var(--surface);
  font-weight: 600;
}
[data-theme="dark"] .primary {
  color: #111c32;
}
.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
}
.secondary:hover {
  border-color: var(--accent);
}
.text-button {
  color: var(--accent);
  font-size: 11px;
  padding: 7px 0;
}
.danger {
  color: var(--danger);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 23px;
}
.bot-picker {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 0;
}
.bot-picker select {
  width: 190px;
  font-size: 12px;
  padding: 9px 12px;
  letter-spacing: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
  border-radius: 5px;
  padding: 6px 8px;
  background: var(--surface);
  white-space: nowrap;
}
.badge.live {
  background: var(--tint);
  color: var(--accent);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.metric,
.card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 24px;
}
.metric > span {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric i {
  font-style: normal;
  color: var(--accent);
  background: var(--tint);
  border-radius: 6px;
  padding: 5px 8px;
}
.metric strong {
  display: block;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -1.5px;
  margin: 13px 0 10px;
  line-height: 1.1;
}
.metric small {
  color: var(--muted);
  font-size: 9px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}
.card-heading .muted {
  font-size: 11px;
  margin: 6px 0 0;
}
.chart {
  height: 220px;
  margin-top: 25px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 12px;
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 53px,
    var(--grid) 54px,
    var(--grid) 55px
  );
}
.bar {
  flex: 1;
  min-width: 4px;
  position: relative;
  height: var(--height);
  background: var(--bar);
  border-radius: 3px 3px 0 0;
}
.bar:last-child {
  background: var(--accent);
}
.bar:hover {
  background: var(--accent);
}
.bar span {
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--text);
  color: var(--surface);
  font-size: 9px;
  padding: 6px 8px;
  border-radius: 4px;
}
.bar:hover span,
.bar:focus span {
  opacity: 1;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  margin-top: 17px;
}
.bot-profile {
  text-align: center;
}
.bot-profile > .eyebrow {
  text-align: left;
  font-size: 8px;
  color: var(--muted);
}
.bot-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--tint);
  color: var(--accent);
  font-size: 23px;
  margin: 22px auto 13px;
}
.bot-profile .muted {
  font-size: 10px;
}
.bot-profile dl {
  font-size: 10px;
  text-align: left;
  margin: 26px 0;
}
.bot-profile dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 0;
}
.bot-profile dt {
  color: var(--muted);
}
.bot-profile dd {
  margin: 0;
}
.full {
  width: 100%;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 17px;
  gap: 16px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading .muted {
  margin: 7px 0 0;
}
.table-card {
  padding: 0;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
}
th {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  background: var(--subtle);
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
.member-name {
  color: var(--text);
  font-weight: 550;
}
.source-tag {
  display: inline-block;
  background: var(--tint);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 9px;
}
.mono,
code {
  font-family: Consolas, monospace;
  font-size: 11px;
}
code {
  color: var(--accent);
}
.empty {
  text-align: center;
  padding: 55px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.empty h2 {
  color: var(--text);
}
.empty-symbol {
  font-size: 34px;
  display: block;
  color: var(--accent);
  margin-bottom: 18px;
}
.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  color: var(--notice-text);
  padding: 13px 18px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.8;
  margin: 23px 0;
}
.notice.success {
  background: var(--tint);
  border-color: var(--line);
  color: var(--accent);
}
.search {
  display: flex;
  gap: 8px;
}
.search input {
  width: 270px;
}
.count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-left: 10px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 20px;
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.source-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 3fr 60px;
  gap: 20px;
  align-items: center;
  margin: 26px 0;
  font-size: 11px;
}
.source-track {
  height: 7px;
  background: var(--subtle);
  border-radius: 6px;
  overflow: hidden;
}
.source-fill {
  height: 100%;
  width: var(--width);
  background: var(--accent);
  border-radius: 6px;
}
.source-row strong {
  text-align: right;
  font-size: 12px;
  font-weight: 550;
}
.info {
  background: var(--tint);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
  padding: 14px 16px;
  margin: 18px 0 22px;
}
.info code {
  font-size: 10px;
}
.switch {
  width: 34px;
  height: 20px;
  appearance: none;
  background: var(--line);
  border: 0;
  border-radius: 14px;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  padding: 0;
}
.switch:checked {
  background: var(--accent);
}
.switch:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.15s;
}
.switch:checked:before {
  transform: translateX(14px);
}
footer {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 1.8px;
  color: var(--muted);
}
footer span {
  letter-spacing: 0.2px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, var(--tint), transparent 60%), var(--bg);
  padding: 24px;
}
.login-card {
  width: 420px;
  max-width: 100%;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 20px 80px var(--shadow);
}
.login-card .brand-mark {
  margin-bottom: 30px;
}
.login-card h1 {
  font-size: 26px;
}
.login-card .primary {
  width: 100%;
  margin-top: 25px;
  justify-content: space-between;
}
.login-card small {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.5px;
}
.error {
  color: var(--danger);
  font-size: 11px;
  line-height: 1.7;
  min-height: 18px;
}
.error:empty {
  min-height: 0;
}
label {
  display: block;
  font-size: 11px;
  margin-top: 20px;
  color: var(--muted);
}
label input,
label select,
label textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
}
label small {
  font-size: 10px;
  line-height: 1.7;
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.8;
  min-height: 100px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: center;
  line-height: 1.6;
}
.checkbox-label input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.narrow {
  max-width: 560px;
}
.narrow .primary {
  margin-top: 24px;
}
.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 18px;
  margin-top: 25px;
}
.bot-card .bot-avatar {
  margin: 0;
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.bot-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.bot-card-header h2 {
  margin: 0 0 5px;
}
.bot-card-header .muted {
  font-size: 10px;
  margin: 0;
}
.bot-card .actions {
  margin-top: 22px;
  flex-wrap: wrap;
}
.bot-card .actions button {
  font-size: 10px;
}
.bot-card .status-error {
  color: var(--danger);
  font-size: 10px;
  margin-top: 15px;
}
.stack {
  display: grid;
  gap: 15px;
}
.reply-content {
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.8;
  max-height: 150px;
  overflow: auto;
  margin-top: 18px;
}
.reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}
.reply-footer small {
  color: var(--muted);
  font-size: 10px;
}
.photo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}
.photo-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
}
.upload {
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}
.photo-card .text-button {
  margin-left: 15px;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  width: 610px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #08150f88;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.dialog-heading .eyebrow {
  margin-bottom: 8px;
}
.dialog-heading h2 {
  font-size: 21px;
}
.icon-button {
  font-size: 25px;
  color: var(--muted);
  padding: 0 5px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.helper {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 15px;
}
.inline-code {
  background: var(--subtle);
  padding: 13px;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 10px;
  color: var(--muted);
}
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr 24px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 12px;
  background: var(--subtle);
}
.button-details {
  grid-column: 1 / -1;
}
.button-details textarea {
  min-height: 75px;
}
.button-row label {
  margin-top: 10px;
}
.button-row button {
  padding-bottom: 12px;
  font-size: 20px;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 192px;
    padding: 28px 14px;
  }
  main {
    width: calc(100% - 192px);
    margin-left: 192px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    width: 36px;
    line-height: 38px;
  }
  .brand small {
    font-size: 6px;
  }
  .page {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .theme-control label {
    display: none;
  }
  .account {
    padding-right: 100px;
  }
  .overview-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
  }
  .metrics {
    gap: 12px;
  }
  .card,
  .metric {
    padding: 20px;
  }
  .table-card {
    padding: 0;
  }
  .chart {
    gap: 7px;
  }
  .actions {
    gap: 6px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace {
    display: block;
  }
  .brand {
    font-size: 15px;
  }
  .brand small,
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    margin-top: 14px;
    overflow: auto;
  }
  .sidebar nav button {
    padding: 9px;
    font-size: 10px;
    justify-content: center;
    gap: 5px;
    margin: 0;
    white-space: nowrap;
    width: auto;
  }
  .sidebar nav button span {
    font-size: 15px;
    width: auto;
  }
  main {
    width: 100%;
    margin: 0;
  }
  .topbar {
    height: 52px;
    padding: 0 18px;
  }
  .page {
    padding: 26px 18px;
  }
  .theme-control {
    top: 20px;
    right: 18px;
    position: absolute;
  }
  .theme-control label {
    display: none;
  }
  .account {
    padding: 0;
    font-size: 10px;
    gap: 10px;
  }
  .account .badge {
    display: none;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .page-heading {
    flex-wrap: wrap;
    gap: 18px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading .muted {
    font-size: 11px;
  }
  .page-heading .actions {
    width: 100%;
    justify-content: flex-end;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 16px 12px;
  }
  .metric > span {
    font-size: 9px;
  }
  .metric i {
    display: none;
  }
  .metric strong {
    font-size: 28px;
  }
  .metric small {
    font-size: 8px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .bot-profile {
    display: none;
  }
  .toolbar {
    gap: 12px;
  }
  .bot-picker {
    font-size: 7px;
    gap: 7px;
  }
  .bot-picker select {
    width: 150px;
    font-size: 11px;
  }
  .toolbar .badge {
    font-size: 8px;
    max-width: 120px;
    white-space: normal;
    text-align: center;
  }
  .section-heading {
    flex-wrap: wrap;
  }
  .search {
    width: 100%;
  }
  .search input {
    flex: 1;
    width: auto;
  }
  .chart {
    height: 180px;
  }
  .source-row {
    gap: 10px;
    font-size: 10px;
  }
  th,
  td {
    padding: 13px 15px;
  }
  footer {
    font-size: 7px;
  }
  .login-card {
    padding: 30px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 22px;
  }
  .photo-card .muted {
    font-size: 10px;
  }
  .bot-grid {
    grid-template-columns: 1fr;
  }
}

/* Workspace refresh */
[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151a24;
  --subtle: #1a202d;
  --text: #edf1fa;
  --muted: #8d9ab2;
  --line: #262f40;
  --accent: #83a9ff;
  --tint: #202e4e;
  --input: #111722;
  --grid: #252e3f;
  --bar: #3e5b95;
}
.sidebar {
  width: 236px;
  padding: 32px 20px;
  background: var(--surface);
}
main {
  margin-left: 236px;
  width: calc(100% - 236px);
}
.brand {
  gap: 12px;
  font-size: 18px;
  letter-spacing: -0.7px;
}
.brand-mark {
  background: linear-gradient(145deg, #326cf6, #739dff);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 15px #326cf625;
}
.brand-mark span {
  color: #d5e6ff;
}
.brand small {
  font-size: 7px;
  letter-spacing: 1.8px;
  margin-top: 6px;
}
.sidebar nav button {
  padding: 13px 14px;
  font-size: 12px;
  border-radius: 9px;
  gap: 13px;
  margin: 4px 0;
  transition:
    background 0.16s,
    color 0.16s;
}
.sidebar nav button.active {
  background: var(--tint);
  position: relative;
}
.sidebar nav button.active:before {
  content: "";
  height: 17px;
  width: 3px;
  background: var(--accent);
  border-radius: 3px;
  position: absolute;
  left: -20px;
}
.sidebar nav button span {
  display: grid;
  place-items: center;
}
.nav-icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-label {
  margin-top: 39px;
  font-size: 8px;
}
.sidebar-footer {
  font-size: 10px;
  padding-top: 18px;
}
.topbar {
  height: 78px;
  padding: 0 42px;
  background: var(--surface);
}
.page {
  max-width: 1560px;
  padding: 38px 42px;
}
.page-heading {
  padding: 0 0 5px;
}
.page-heading h1 {
  font-size: 32px;
  letter-spacing: -1px;
}
.page-heading .muted {
  font-size: 12px;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 1.7px;
  font-weight: 650;
}
.account {
  font-size: 12px;
}
.account > .badge {
  font-size: 9px;
  text-transform: capitalize;
  background: var(--subtle);
}
.primary,
.secondary {
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 11px;
}
.primary {
  box-shadow: 0 3px 8px #3168f51a;
}
.primary:hover {
  filter: brightness(1.06);
}
.secondary {
  box-shadow: 0 1px 2px #12203004;
}
.text-button {
  font-weight: 550;
}
.badge {
  border-radius: 6px;
  font-size: 9px;
}
.badge.live {
  border-color: transparent;
}
.toolbar {
  margin: 26px 0 23px;
}
.bot-picker select {
  border-radius: 9px;
  padding: 11px 13px;
  min-width: 195px;
}
.metrics {
  gap: 19px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media(max-width:1100px) { .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.metric,
.card {
  border-radius: 14px;
  border-color: var(--line);
  box-shadow: 0 2px 8px var(--shadow);
}
.metric {
  padding: 24px 25px;
}
.metric > span {
  font-size: 12px;
}
.metric strong {
  font-size: 39px;
  letter-spacing: -1.7px;
  font-weight: 580;
  margin: 15px 0 12px;
}
.metric small {
  font-size: 10px;
}
.metric i {
  border-radius: 8px;
  min-width: 30px;
  text-align: center;
}
.card {
  padding: 25px;
}
h2 {
  font-size: 16px;
}
.overview-grid {
  margin-top: 21px;
  gap: 20px;
}
.bot-avatar {
  background: var(--tint);
  border-radius: 14px;
  font-weight: 600;
}
.bot-profile dl {
  font-size: 11px;
}
.table-card {
  padding: 0;
  border-radius: 13px;
}
.table-card table {
  font-size: 12px;
}
th {
  font-size: 10px;
  background: var(--subtle);
  padding: 17px 22px;
}
td {
  padding: 18px 22px;
}
.source-tag {
  font-size: 10px;
  border-radius: 5px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.source-registry {
  margin-top: 20px;
}
.source-code {
  display: block;
  font:
    10px Consolas,
    monospace;
  color: var(--muted);
  margin-top: 5px;
}
.source-row {
  font-size: 12px;
}
.source-track {
  height: 6px;
}
.source-row strong {
  font-size: 13px;
}
.source-row > span {
  overflow-wrap: anywhere;
}
.section-heading {
  flex-wrap: wrap;
}
.section-heading .search {
  margin-left: auto;
}
.search input {
  border-radius: 8px;
  font-size: 11px;
  min-width: 230px;
}
.pagination {
  font-size: 11px;
}
.notice {
  border-radius: 10px;
}
.bot-card {
  padding: 25px;
}
.broadcast-excerpt {
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.broadcast-progress {
  height: 5px;
  background: var(--subtle);
  border-radius: 5px;
  overflow: hidden;
  margin: 17px 0;
}
.broadcast-progress > span {
  display: block;
  background: var(--accent);
  height: 100%;
}
.broadcast-summary {
  display: flex;
  gap: 22px;
  font-size: 11px;
  color: var(--muted);
  margin: 15px 0 20px;
}
.broadcast-summary b {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.broadcast-summary small {
  margin-left: auto;
}
.broadcast-card {
  padding: 27px;
}
.reply-content a {
  pointer-events: none;
  color: var(--accent);
}
dialog {
  border-radius: 17px;
  box-shadow: 0 30px 120px #0005;
  padding: 28px;
}
dialog::backdrop {
  background: #0b15246b;
  backdrop-filter: blur(5px);
}
.dialog-actions {
  position: relative;
  gap: 9px;
}
dialog.message-editor {
  width: 1110px;
  max-width: calc(100vw - 36px);
  padding: 28px;
}
.message-editor .editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 28px;
  margin-top: 16px;
}
.message-editor #editor-fields {
  overflow: auto;
  max-height: calc(90vh - 220px);
  padding-right: 16px;
  padding-bottom: 10px;
  scrollbar-width: thin;
}
.message-editor #reply-preview {
  max-height: calc(90vh - 220px);
  overflow: auto;
  padding: 0 0 10px 24px;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}
.message-editor .dialog-actions {
  margin-top: 16px;
}
.preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.preview-heading .eyebrow {
  margin: 0 0 5px;
}
.preview-heading h3 {
  font-size: 18px;
  margin: 0;
}
.preview-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 5px 0 15px;
}
.preview-controls label {
  font-size: 10px;
  margin-top: 12px;
}
.preview-controls select {
  font-size: 10px;
  padding: 8px;
}
.preview-footnote {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 12px;
}
.preview-feedback {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.preview-feedback:empty {
  display: none;
}
.preview-samples {
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
}
.preview-samples summary {
  cursor: pointer;
}
.preview-samples label {
  margin-top: 10px;
}
.preview-samples p {
  line-height: 1.7;
  margin-top: 10px;
}
.format-toolbar {
  display: flex;
  gap: 5px;
  margin: 10px 0 7px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
}
.format-toolbar button {
  height: 27px;
  min-width: 28px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
}
.format-toolbar button:hover {
  background: var(--tint);
  color: var(--accent);
}
/* Telegram preview: self-contained client colors, independent of panel appearance. */
.tg-chat {
  --tg-bg: #0e1621;
  --tg-header: #17212b;
  --tg-input: #17212b;
  --tg-sent: #2b5278;
  --tg-received: #182533;
  --tg-text: #f4f7fa;
  --tg-muted: #8db5d8;
  --tg-link: #8acaff;
  --tg-button: #ffffff18;
  --tg-composer-text: #7f91a2;
  font-family: Roboto, Arial, sans-serif;
  background: var(--tg-bg);
  color: var(--tg-text);
  border-radius: 17px;
  overflow: hidden;
  border: 1px solid #0002;
  box-shadow: 0 8px 24px #00000012;
}
.tg-chat[data-appearance="light"] {
  --tg-bg: #d8e2d3;
  --tg-header: #fff;
  --tg-input: #fff;
  --tg-sent: #e3ffc7;
  --tg-received: #fff;
  --tg-text: #101820;
  --tg-muted: #75a75a;
  --tg-link: #1683ba;
  --tg-button: #ffffffbb;
  --tg-composer-text: #8e9ba5;
}
.tg-header {
  height: 63px;
  background: var(--tg-header);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border-bottom: 1px solid #00000008;
}
.tg-back {
  font: 35px Arial;
  color: var(--tg-composer-text);
  width: 17px;
  line-height: 1;
}
.tg-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  background: linear-gradient(140deg, #5fa7ed, #3474c2);
  border-radius: 50%;
  flex-shrink: 0;
}
.tg-header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tg-header-title strong {
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}
.tg-header-title small {
  font-size: 10px;
  color: var(--tg-composer-text);
}
.tg-more {
  margin-left: auto;
  font-size: 23px;
  color: var(--tg-composer-text);
}
.tg-conversation {
  min-height: 350px;
  padding: 14px 9px 18px;
  background-image:
    radial-gradient(circle at 13px 17px, #ffffff04 1.7px, transparent 2px),
    radial-gradient(circle at 45px 52px, #ffffff04 1.7px, transparent 2px);
  background-size: 65px 76px;
}
.tg-date {
  margin: 0 auto 18px;
  width: max-content;
  color: #fff;
  background: #00000026;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 10px;
}
.tg-message-stack {
  width: 100%;
  max-width: 320px;
  margin-left: auto;
}
.tg-chat[data-direction="incoming"] .tg-message-stack {
  margin: 0 auto 0 0;
}
.tg-bubble {
  background: var(--tg-sent);
  color: var(--tg-text);
  border-radius: 12px 12px 3px 12px;
  position: relative;
  box-shadow: 0 1px 2px #0002;
  overflow: visible;
}
.tg-bubble:after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 0;
  border: 6px solid transparent;
  border-bottom-color: var(--tg-sent);
  border-left-width: 3px;
  border-right-width: 3px;
}
.tg-chat[data-direction="incoming"] .tg-bubble {
  background: var(--tg-received);
  border-radius: 12px 12px 12px 3px;
}
.tg-chat[data-direction="incoming"] .tg-bubble:after {
  right: auto;
  left: -5px;
  border-bottom-color: var(--tg-received);
}
.tg-photo {
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #0001;
  min-height: 30px;
}
.tg-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 330px;
  object-fit: contain;
}
.tg-photo > div {
  height: 180px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--tg-composer-text);
}
.tg-caption {
  padding: 7px 10px 8px;
  display: flow-root;
}
.tg-text {
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  display: inline;
}
.tg-text b,
.tg-text strong {
  font-weight: 700;
}
.tg-text a {
  color: var(--tg-link);
  text-decoration: underline;
  text-underline-offset: 1px;
}
.tg-text code {
  font:
    12px Consolas,
    monospace;
  color: inherit;
  background: #0001;
  padding: 1px 3px;
  border-radius: 3px;
}
.tg-text pre {
  white-space: pre-wrap;
  background: #0002;
  border-radius: 6px;
  padding: 9px;
  margin: 7px 0;
}
.tg-text blockquote {
  background: #00000012;
  border-left: 3px solid var(--tg-link);
  padding: 5px 8px;
  margin: 6px 0;
  border-radius: 3px;
}
.tg-text .tg-spoiler {
  background: currentColor;
  border-radius: 3px;
  color: #8298af;
  cursor: pointer;
}
.tg-text .tg-spoiler:hover {
  background: transparent;
  color: inherit;
}
.tg-meta {
  font-size: 10px;
  float: right;
  white-space: nowrap;
  line-height: 14px;
  color: var(--tg-muted);
  margin: 6px 0 -2px 8px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.tg-checks {
  font-size: 12px;
  letter-spacing: -5px;
  padding-right: 5px;
}
.tg-chat[data-direction="incoming"] .tg-checks {
  display: none;
}
.tg-inline-buttons {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}
.tg-button-row {
  display: flex;
  gap: 3px;
}
.tg-inline-button {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 34px;
  background: var(--tg-button);
  border-radius: 5px;
  color: var(--tg-text);
  font-size: 11px;
  line-height: 1.35;
  padding: 9px 19px 9px 9px;
  overflow-wrap: anywhere;
}
.tg-inline-button:hover {
  filter: brightness(1.12);
}
.tg-button-icon {
  position: absolute;
  right: 5px;
  top: 5px;
  font-size: 11px;
  opacity: 0.85;
}
.tg-contact-prompt {
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
  max-width: 305px;
  background: var(--tg-received);
  border-radius: 10px;
  margin: 13px 0 0;
  white-space: pre-wrap;
}
.tg-contact-keyboard {
  display: grid;
  gap: 5px;
  background: var(--tg-input);
  padding: 8px;
}
.tg-contact-keyboard button {
  background: var(--tg-button);
  color: var(--tg-text);
  border-radius: 5px;
  padding: 12px;
  font-size: 11px;
}
.tg-composer {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 12px;
  background: var(--tg-input);
  color: var(--tg-composer-text);
  font-size: 22px;
}
.tg-composer > span:nth-child(2) {
  font-size: 12px;
  flex: 1;
}
.tg-send {
  color: #60a9ec;
  font-size: 19px;
  transform: rotate(-15deg);
}
@media (max-width: 1100px) {
  .sidebar {
    width: 204px;
    padding: 26px 15px;
  }
  main {
    margin-left: 204px;
    width: calc(100% - 204px);
  }
  .page {
    padding: 28px;
  }
  .sidebar nav button.active:before {
    left: -15px;
  }
  .topbar {
    padding: 0 28px;
  }
  .message-editor .editor-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
  }
  .message-editor #reply-preview {
    padding-left: 16px;
  }
  .message-editor #editor-fields {
    padding-right: 8px;
  }
}
@media (max-width: 850px) {
  dialog.message-editor {
    width: 680px;
  }
  .message-editor .editor-workspace {
    grid-template-columns: 1fr;
  }
  .message-editor #editor-fields {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .message-editor #reply-preview {
    max-height: none;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
    max-width: 390px;
    margin: 12px auto 0;
    width: 100%;
  }
  .preview-controls {
    gap: 14px;
  }
  .broadcast-summary {
    flex-wrap: wrap;
    gap: 14px;
  }
  .broadcast-summary small {
    width: 100%;
    margin: 0;
  }
  .page {
    padding: 25px 20px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .bot-profile {
    display: none;
  }
}
@media (max-width: 760px) {
  .sidebar {
    width: auto;
    position: static;
    padding: 17px;
    border-bottom: 1px solid var(--line);
  }
  main {
    margin: 0;
    width: 100%;
  }
  .sidebar nav button.active:before {
    display: none;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .topbar {
    padding: 0 20px;
  }
  .metric {
    padding: 16px 13px;
  }
  .metric strong {
    font-size: 29px;
  }
  .metric > span {
    font-size: 10px;
  }
  .metric small {
    font-size: 9px;
  }
  .card {
    padding: 21px;
  }
  .table-card {
    padding: 0;
  }
  .page-heading .actions {
    width: auto;
  }
  .section-heading .search {
    margin-left: 0;
    order: 3;
  }
  .search input {
    min-width: 0;
  }
  .sidebar nav button {
    font-size: 11px;
    padding: 10px;
  }
  .nav-icon {
    width: 17px;
    height: 17px;
  }
  .source-row {
    grid-template-columns: minmax(100px, 1fr) 1.5fr 44px;
  }
  .message-editor {
    padding: 20px !important;
  }
  .metrics {
    gap: 9px;
  }
  .metrics .metric i {
    display: none;
  }
}

.format-toolbar + label {
  margin-top: 7px;
}

.tg-text .tg-spoiler {
  color: transparent;
  background: #a9b9cb66;
  text-shadow: 0 0 7px #a9b9cb;
}
.tg-text .tg-spoiler:hover {
  color: transparent;
  background: #a9b9cb66;
}
.tg-text .tg-spoiler.revealed {
  color: inherit;
  text-shadow: none;
  background: transparent;
}

a[aria-disabled="true"] {
  pointer-events: none;
  opacity: .45;
}

.message-variables {
  margin: 20px 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.variables-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.variables-heading h3 { margin: 0; font-size: 13px; }
.variables-heading input { width: 170px; max-width: 100%; margin: 0; padding: 8px 10px; }
.message-variables > .helper { margin: 9px 0 12px; }
.variable-list { display: flex; flex-wrap: wrap; gap: 8px; }
.variable-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
  text-align: left;
}
.variable-chip code { font-size: 11px; color: var(--accent); }
.variable-chip span { font-size: 10px; color: var(--muted); }
.variable-chip:hover, .variable-chip:focus-visible { border-color: var(--accent); background: var(--tint); }
.variable-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#variable-feedback:empty { display: none; }

.phone-count {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--tint);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
