:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --sidebar: #111827;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: var(--sidebar); color: #fff; padding: 22px 14px; }
.brand { font-size: 18px; font-weight: 800; margin: 0 0 22px 8px; }
.nav { display: block; color: #d1d5db; padding: 11px 12px; border-radius: 10px; margin-bottom: 6px; }
.nav:hover { background: #1f2937; color: white; }
.nav.logout { margin-top: 24px; color: #fecaca; }
.main { margin-left: 220px; padding: 26px; min-height: 100vh; }
.main.full { margin-left: 0; display: flex; align-items: center; justify-content: center; }
h1 { margin: 0 0 18px; font-size: 26px; }
h2 { margin: 0 0 14px; font-size: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: 0 10px 20px rgba(15,23,42,.04); }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 10px 20px rgba(15,23,42,.04); }
.card b { display: block; font-size: 28px; margin-bottom: 4px; }
.card span { color: var(--muted); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
label { display: block; font-weight: 700; margin: 10px 0 7px; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; background: white; font: inherit; }
textarea { resize: vertical; min-height: 140px; }
button, .button { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 9px 13px; cursor: pointer; font-weight: 700; display: inline-block; }
button.primary, .button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.danger, .button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.big { padding: 13px 20px; margin-top: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-size: 14px; }
th { background: #f9fafb; color: #374151; }
small, .muted { color: var(--muted); }
.ok { color: var(--success); font-weight: 800; }
.bad { color: var(--danger); font-weight: 800; }
.badge { display: inline-block; padding: 4px 8px; background: #e5e7eb; border-radius: 999px; font-size: 12px; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line); background: white; }
.alert.success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.login-card { width: 390px; background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 20px 45px rgba(15,23,42,.08); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: end; }
.inline-form input { max-width: 340px; }
.group-selects { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.channel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.channel-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 0; font-weight: 400; }
.channel-item input, .checkline input { width: auto; }
.channel-item span { font-weight: 700; display: block; }
.channel-item small { display: block; margin-top: 2px; }
.checkline { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.code-block { background: #111827; color: #e5e7eb; border-radius: 14px; padding: 14px; overflow: auto; line-height: 1.55; }
.error-text { max-width: 520px; word-break: break-word; color: #7f1d1d; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .panel.two, .grid.cards, .form-grid, .channel-list { grid-template-columns: 1fr; }
  .inline-form { display: block; }
}

.help-panel { margin-bottom: 16px; }
.soft-code { background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: #374151; line-height: 1.55; white-space: pre-wrap; }
.channel-title { display: inline-block; margin-left: 8px; }
.modal-mask { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .48); padding: 28px; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: 18px; border: 1px solid var(--line); padding: 18px; box-shadow: 0 25px 70px rgba(15,23,42,.28); }
.modal-card.wide { width: min(760px, 100%); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.modal-header h2 { margin: 0; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 999px; font-size: 22px; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
@media (max-width: 900px) {
  .modal-mask { padding: 16px; align-items: flex-start; }
}
.preview-box { margin-top: 10px; padding: 10px 12px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; border-radius: 12px; font-weight: 700; }
.target-tools { display: grid; grid-template-columns: auto auto minmax(220px, 360px); gap: 8px; align-items: center; margin-bottom: 12px; }
.compact-panel { max-width: 860px; }
.settings-actions { margin-top: 12px; }
@media (max-width: 900px) { .target-tools { grid-template-columns: 1fr; } }

/* v5: 创建发布任务改为弹窗，表单一行一行向下排列 */
.task-modal-card { width: min(780px, 100%); }
.form-stack label { margin-top: 12px; }
.form-stack input,
.form-stack textarea,
.form-stack select { display: block; width: 100%; }
.form-stack .section-title { margin-top: 18px; margin-bottom: 10px; }
.compact-check { margin-top: 12px; }
.channel-list.one-column { grid-template-columns: 1fr; max-height: 300px; }
.single-line-tools { grid-template-columns: auto auto minmax(220px, 1fr); }
.top-create-btn { margin-top: 0; }
@media (max-width: 900px) {
  .single-line-tools { grid-template-columns: 1fr; }
}

/* v6: 修复创建任务弹窗频道列表刷新，以及静默发送复选框被拉宽的问题 */
.form-stack .checkline input[type="checkbox"],
.form-stack input[type="checkbox"] {
  width: auto;
  min-width: auto;
}
.compact-check {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}
.channel-item > div {
  min-width: 0;
}

/* v7: 任务编辑、启动/暂停、分组频道管理 */
.table-wrap { overflow-x: auto; }
.task-actions { min-width: 260px; }
.task-actions button { white-space: nowrap; }
.status-paused { background: #fef3c7; color: #92400e; }
.status-scheduled, .status-pending { background: #dbeafe; color: #1d4ed8; }
.status-sending { background: #ede9fe; color: #6d28d9; }
.status-completed { background: #dcfce7; color: #166534; }
.status-failed, .status-partial_failed, .status-cancelled { background: #fee2e2; color: #991b1b; }
.inline-pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
  background: transparent;
  border: 0;
  padding: 0;
}

/* v10: 发布任务列表改成卡片，隐藏完整消息ID，按钮固定好点 */
.task-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.task-card-main { min-width: 0; }
.task-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.task-id { color: var(--muted); font-weight: 800; }
.task-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.task-meta-grid div {
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.task-meta-grid small,
.task-meta-grid em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}
.task-meta-grid b {
  display: block;
  margin-top: 3px;
  word-break: break-word;
}
.task-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 700;
  word-break: break-word;
}
.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  min-width: 320px;
}
.task-card-actions form { margin: 0; }
.task-card-actions button { white-space: nowrap; }
.empty-panel { text-align: center; }
.proxy-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.proxy-heading h2 { margin-bottom:4px; }
.proxy-heading p { margin:0; }
.proxy-dialog { width:min(720px, calc(100% - 32px)); border:0; border-radius:18px; padding:24px; color:var(--text); box-shadow:0 24px 70px rgba(15,23,42,.25); }
.proxy-dialog::backdrop { background:rgba(15,23,42,.55); }
.proxy-dialog-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.proxy-dialog-head h2 { margin:0; }
.proxy-fields { display:grid; grid-template-columns:1fr 1fr; gap:4px 18px; }
.proxy-dialog-actions { justify-content:flex-end; margin-top:22px; }
@media (max-width:600px) { .proxy-fields { grid-template-columns:1fr; } }
@media (max-width: 1100px) {
  .task-card { grid-template-columns: 1fr; }
  .task-card-actions { justify-content: flex-start; min-width: 0; }
  .task-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .task-meta-grid { grid-template-columns: 1fr; }
}

.task-table-wrap { padding: 0; overflow-x: auto; }
.task-table { min-width: 940px; }
.task-table th, .task-table td { vertical-align: middle; white-space: nowrap; }
.task-link { color: var(--primary); font-weight: 700; }
.task-row-actions { display: flex; gap: 6px; align-items: center; }
.task-row-actions form { margin: 0; }
.task-row-actions button, .task-row-actions .button { padding: 6px 9px; white-space: nowrap; }

.task-table { min-width: 1200px; }
.task-table th { background: #f6f8fb; color: #74859b; font-weight: 700; }
.task-table td { padding: 12px 9px; height: 62px; }
.task-table tbody tr:hover { background: #f9fbff; }
.task-type { display:inline-block; border:1px solid #dce5f1; background:#f6f8fb; border-radius:20px; padding:4px 10px; color:#607792; font-weight:600; }
.task-table .badge { padding:5px 10px; background:#fff0c3; color:#a86300; }
.task-table .status-failed, .task-table .status-partial_failed { background:#fef0f0; color:#c24141; }
.task-table .status-completed { background:#e4f7eb; color:#16804b; }
.task-table .status-paused, .task-table .status-cancelled { background:#eef1f5; color:#66758a; }
.task-table td form { margin:0; }
.task-switch { width:42px; height:24px; padding:3px; border:0; border-radius:20px; background:#aab4c3; vertical-align:middle; }
.task-switch span { display:block; width:18px; height:18px; border-radius:50%; background:white; }
.task-switch.on { background:#2563eb; }
.task-switch.on span { margin-left:auto; }
.task-row-actions .task-view { color:#c66b15; background:#fff8f1; border-color:#ffd5b4; }
.task-row-actions .task-run { color:#2563eb; background:#f0f6ff; border-color:#c9d9ff; }
.task-row-actions .task-delete { color:#dc2626; background:#fff3f3; border-color:#ffcaca; }
.task-table td:last-child { width: 1%; white-space: nowrap; }
.task-row-actions { display: inline-flex; flex-wrap: nowrap; white-space: nowrap; }
.task-row-actions form { display: inline-flex; flex: 0 0 auto; }
.task-row-actions .button, .task-row-actions button { flex: 0 0 auto; }

.task-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; }
.task-settings-grid .settings-field { min-width:0; }
.task-settings-grid .settings-field[hidden] { display:none; }
.task-settings-grid label { margin:0 0 6px; }
.task-settings-grid .settings-wide { grid-column:1 / -1; }
.task-settings-grid textarea { min-height:80px; }
.task-settings-grid small { display:block; margin-top:4px; }
.settings-options { display:flex; flex-wrap:wrap; gap:12px 28px; align-items:center; }
.settings-options .checkline { margin:4px 0; }
.settings-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:16px; }
@media (max-width:700px) { .task-settings-grid { grid-template-columns:1fr; } .task-settings-grid .settings-wide { grid-column:auto; } .settings-footer { align-items:flex-start; flex-direction:column; } }

.task-detail-modal { width:min(1100px, 100%); height:min(90vh, 950px); display:flex; flex-direction:column; overflow:hidden; }
.task-detail-modal .modal-header { flex:none; }
.task-detail-modal iframe { border:0; width:100%; flex:1; min-height:0; }
.embedded-task .sidebar { display:none; }
.embedded-task .main { margin-left:0; padding:12px; }
.embedded-task .topbar a[href="/tasks"] { display:none; }

.detail-fold { padding: 12px 16px; }
.detail-fold > summary { cursor: pointer; font-weight: 700; }
.detail-fold[open] > summary { margin-bottom: 12px; }
.task-detail-modal { width:min(78vw, 1450px); height:68vh; max-height:780px; }
@media (max-width:700px) { .task-detail-modal { width:96vw; height:82vh; } }

.embedded-task .main { height:100%; overflow-y:auto; }
.detail-fold { margin-bottom:12px; }
.detail-fold > h2 { margin:0 0 10px; }
.task-detail-modal { height:58vh; max-height:620px; }
.embedded-task .main { padding:4px 8px; }
.embedded-task .topbar { margin-bottom:6px; }
.embedded-task h1 { font-size:20px; margin:0; }
.embedded-task .main > p { margin:4px 0 8px; font-size:13px; }
.embedded-task .panel { padding:8px 12px; margin-bottom:6px; border-radius:10px; box-shadow:none; }
.embedded-task .detail-fold > h2 { font-size:15px; margin:0 0 5px; }
.embedded-task label { margin:4px 0 3px; font-size:13px; }
.embedded-task input, .embedded-task select, .embedded-task textarea { padding:6px 9px; border-radius:7px; font-size:13px; }
.embedded-task textarea[name="target_text"] { height:68px; min-height:68px; }
.embedded-task #detail-messages { height:58px; min-height:58px; }
.embedded-task .task-settings-grid { gap:4px 10px; }
.embedded-task .task-settings-grid small, .embedded-task .muted { font-size:11px; }
.embedded-task .settings-options { gap:4px 14px; }
.embedded-task .settings-footer { margin-top:6px; gap:5px; }
.embedded-task .settings-footer .muted { display:none; }
.embedded-task .embedded-task .actions { gap:4px; }
.embedded-task button { padding:5px 9px; font-size:12px; }
.embedded-task .main > .panel:last-of-type { padding:7px 10px; }
.embedded-task .main > .panel:last-of-type h2 { font-size:15px; margin-bottom:3px; }
.embedded-task .main > .panel:last-of-type p { display:none; }
.embedded-task .main > .panel:last-of-type th, .embedded-task .main > .panel:last-of-type td { padding:4px 6px; font-size:11px; }
@media (max-width:700px) { .task-detail-modal { height:78vh; } }
.task-detail-modal { height:68vh; max-height:68vh; }
.embedded-task .main { height:auto; min-height:0; overflow:visible; padding:0 8px 8px; }
.embedded-task .topbar { display:none; }
.embedded-task .task-settings-grid { grid-template-columns:1fr; gap:3px; }
.embedded-task .task-settings-grid .settings-wide { grid-column:auto; }
.embedded-task .task-settings-grid textarea, .embedded-task #detail-messages { height:44px; min-height:44px; }
.embedded-task textarea[name="target_text"] { height:52px; min-height:52px; }
.embedded-task .detail-fold { padding:6px 9px; margin-bottom:5px; }
.embedded-task .detail-fold > h2 { font-size:13px; margin-bottom:3px; }
.embedded-task .settings-field label { margin:2px 0; }
.embedded-task .settings-footer { margin-top:4px; }
.modal-mask.show { align-items:center; }
@media (max-width:900px) { .modal-mask.show { align-items:center; } }
@media (max-width:700px) { .task-detail-modal { height:82vh; max-height:82vh; } }
.task-detail-modal { width:40vw; height:34vh; max-width:760px; max-height:390px; min-width:520px; }
@media (max-width:700px) { .task-detail-modal { width:92vw; min-width:0; height:55vh; max-height:55vh; } }
.task-detail-modal { width:min(76vw, 1320px); height:78vh; max-height:900px; min-width:640px; }
@media (max-width:700px) { .task-detail-modal { width:94vw; min-width:0; height:88vh; max-height:88vh; } }

/* Task detail controls: keep the compact two-column editor and a clear silent toggle. */
.embedded-task .task-settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }
.embedded-task .task-settings-grid .settings-wide { grid-column:1 / -1; }
.task-settings-grid .switch-field { display:flex; align-items:center; justify-content:space-between; }
.switch-control { display:inline-flex; align-items:center; margin:0 !important; cursor:pointer; }
.switch-control input { position:absolute; opacity:0; width:1px; height:1px; }
.switch-track { width:42px; height:24px; border-radius:999px; background:#cbd5e1; position:relative; transition:background .18s ease; }
.switch-track::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; background:#fff; border-radius:50%; box-shadow:0 1px 3px #0002; transition:transform .18s ease; }
.switch-control input:checked + .switch-track { background:#2563eb; }
.switch-control input:checked + .switch-track::after { transform:translateX(18px); }
.switch-control input:focus-visible + .switch-track { outline:3px solid #93c5fd; outline-offset:2px; }
@media (max-width:700px) { .embedded-task .task-settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.task-table { width:100%; min-width:1120px; table-layout:fixed; }
.task-table th, .task-table td { padding:12px 10px; white-space:normal; overflow-wrap:anywhere; vertical-align:middle; }
.task-table th:nth-child(1), .task-table td:nth-child(1) { width:58px; }
.task-table th:nth-child(2), .task-table td:nth-child(2) { width:15%; }
.task-table th:nth-child(3), .task-table td:nth-child(3) { width:190px; }
.task-table th:nth-child(4), .task-table td:nth-child(4) { width:150px; }
.task-table th:nth-child(5), .task-table td:nth-child(5) { width:155px; }
.task-table th:nth-child(6), .task-table td:nth-child(6) { width:110px; }
.task-table th:nth-child(7), .task-table td:nth-child(7) { width:110px; }
.task-table th:nth-child(8), .task-table td:nth-child(8) { width:150px; }
.task-table td:last-child, .task-row-actions { white-space:nowrap; }
.task-table td:nth-child(7) form { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.task-row-actions { display:flex; align-items:center; gap:8px; }
.task-table-wrap { overflow-x:auto; }
.embedded-task textarea[name="target_text"] { height:180px; min-height:180px; }
/* Share the same compact two-column task editor between create and detail dialogs. */
.modal-card.wide.task-modal-card { width:min(66vw, 1120px); max-height:84vh; padding:14px 16px; }
.task-detail-modal { width:min(66vw, 1120px); min-width:0; max-height:82vh; }
.task-modal-card .modal-header { margin-bottom:6px; }
.task-settings-grid { gap:7px 12px; }
.embedded-task .task-settings-grid { gap:6px 10px; }
.task-settings-grid textarea { min-height:72px; }
.embedded-task .task-settings-grid textarea, .embedded-task #message_ids_text { height:72px; min-height:72px; }
.task-modal-form .target-field { margin-top:8px; }
.task-modal-form .target-field textarea { min-height:92px; }
.task-modal-form .modal-actions { margin-top:10px; }
@media (max-width:700px) {
  .modal-card.wide.task-modal-card, .task-detail-modal { width:94vw; min-width:0; }
  .task-settings-grid, .embedded-task .task-settings-grid { grid-template-columns:1fr; }
  .task-settings-grid .settings-wide { grid-column:auto; }
}
@media (max-width:900px) {
  .task-table { min-width:900px; table-layout:auto; }
  .task-table th, .task-table td { white-space:nowrap; }
}
.task-detail-modal { width:min(76vw, 1320px); height:78vh; max-height:900px; min-width:640px; }
@media (max-width:700px) { .task-detail-modal { width:94vw; min-width:0; height:88vh; max-height:88vh; } }

/* Reduce the two highlighted horizontal gaps in the embedded task detail editor. */
.embedded-task .main { padding-left:2px; padding-right:2px; }
.embedded-task .task-settings.detail-fold { padding-left:5px; padding-right:5px; }
.embedded-task .task-settings-grid { column-gap:6px; }

/* Keep both detail columns compact so the controls do not leave a large gap. */
.modal-card.task-detail-modal,
.modal-card.wide.task-modal-card { width:min(560px, 100%); min-width:0; }

.task-settings-grid.task-editor-fields {
  width:100%;
  max-width:500px;
  margin-inline:auto;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 12px;
}
.task-editor-fields.task-settings-grid .settings-wide { grid-column:1 / -1; }
.task-editor-fields .settings-field > label { margin:0 0 4px; }
.task-editor-fields .switch-field { justify-content:flex-start; gap:10px; }
.task-editor-fields .switch-field > label { margin:0; }

.logs-table-wrap { overflow-x:auto; }
.logs-table { min-width:480px; }
.logs-table td:first-child { overflow-wrap:anywhere; }
.log-error-list { margin:8px 0 0; padding-left:20px; }
.log-error-list li { margin-bottom:6px; }
.logs-pagination { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }

.settings-page { max-width:1200px; }
.settings-section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.settings-section-head h2 { margin:0 0 4px; }
.settings-section-head p { margin:0; }
.settings-enabled { color:#166534; background:#dcfce7; }
.bot-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:18px 0; }
.bot-summary > div { padding:12px 14px; background:#f8fafc; border:1px solid var(--line); border-radius:10px; }
.bot-summary span { display:block; color:var(--muted); font-size:13px; margin-bottom:5px; }
.bot-summary strong { overflow-wrap:anywhere; }
.settings-bot-form { max-width:620px; }
.settings-bot-form .checkline { margin-top:14px; }
.settings-table-wrap { overflow-x:auto; }
.settings-table-wrap table { min-width:680px; }
@media(max-width:600px) { .bot-summary { grid-template-columns:1fr; } .proxy-heading { align-items:flex-start; gap:12px; flex-wrap:wrap; } }

.monitor-detail { width:min(980px, calc(100% - 32px)); max-height:85vh; overflow:auto; }
.monitor-detail table { min-width:650px; }

.monitor-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.monitor-toolbar p { margin:0; }
.monitor-toolbar input { width:min(320px, 100%); }

/* Keep the switch and action buttons in separate columns at every width. */
.task-table-wrap { overflow-x:auto; }
.task-table { min-width:1050px; table-layout:auto; }
.task-table th, .task-table td { padding:12px clamp(8px, 1vw, 16px); }
.task-table th:nth-child(7), .task-table td:nth-child(7) { width:120px; white-space:nowrap; }
.task-table th:nth-child(8), .task-table td:nth-child(8) { width:175px; white-space:nowrap; }
.task-table td:nth-child(7) form { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.task-table .task-switch { flex:0 0 42px; }
.task-row-actions { display:flex; flex-wrap:nowrap; align-items:center; gap:clamp(4px, .5vw, 8px); }
