:root {
  --navy: #17263d;
  --navy-soft: #223553;
  --accent: #3167c5;
  --accent-soft: #eaf1ff;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe3ee;
  --line-strong: #c7d3e2;
  --text: #1d2939;
  --muted: #66758a;
  --ok: #16805c;
  --warn: #a96500;
  --bad: #c33d4b;
  --radius: 12px;
  --shadow: 0 5px 18px rgba(24, 48, 82, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
button:hover { background: #2858ad; border-color: #2858ad; }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
button.small { padding: 6px 10px; font-size: 12px; }
button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--navy-soft); }
button.secondary:hover { background: var(--accent-soft); border-color: #aac2ef; }
button.danger { background: var(--bad); border-color: var(--bad); }
input, select { width: 100%; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); padding: 7px 10px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(49, 103, 197, .18); outline-offset: 1px; border-color: var(--accent); }
.topbar { min-height: 64px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; box-shadow: 0 2px 10px rgba(15, 30, 51, .14); }
.identity, .top-status { display: flex; align-items: center; gap: 11px; }
.identity { letter-spacing: .04em; font-size: 13px; }
.brand-mark { display: block; width: 34px; height: 34px; border-radius: 9px; object-fit: contain; flex: 0 0 auto; }
.top-status { font-size: 12px; color: #dce7f7; }
.top-status .secondary { background: transparent; border-color: rgba(255,255,255,.34); color: #fff; }
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { background: var(--navy); padding: 18px 12px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: #c9d5e6; text-align: left; padding: 0 13px; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: #2a4165; color: #fff; font-weight: 700; }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { flex: 0 0 auto; max-width: 92px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 2px 6px; background: rgba(255,255,255,.12); color: #fff; font-size: 10px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.danger-nav { margin-top: 20px; }
.admin-nav { padding: 6px 0 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-subitem { display: block; width: 100%; min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: #aebdd2; text-align: left; padding: 6px 10px 6px 24px; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.admin-subitem:hover, .admin-subitem.active { background: rgba(75, 126, 206, .22); color: #fff; font-weight: 700; }
.admin-toggle { position: relative; padding-right: 34px; }
.admin-toggle::after { content: "▾"; position: absolute; right: 13px; font-size: 13px; transition: transform .15s ease; }
.admin-toggle[aria-expanded="false"]::after { transform: rotate(-90deg); }
.content { width: min(100%, 1680px); padding: 24px 30px 42px; overflow: auto; }
.content-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.content-head h1 { margin: 0; color: var(--navy); font-size: clamp(23px, 2vw, 30px); letter-spacing: -.03em; }
.content-head span { color: var(--muted); font-size: 12px; }
.view { display: none; }
.view.active { display: block; }
.status-grid { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 12px; margin-bottom: 16px; }
.status-cell, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.status-cell { min-height: 80px; padding: 15px; display: grid; grid-template-columns: 11px 1fr; gap: 4px 9px; align-content: center; }
.status-cell strong { font-size: 14px; }
.status-cell small { grid-column: 2; color: var(--muted); line-height: 1.35; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { padding: 21px; margin-bottom: 16px; }
.panel h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 17px; color: var(--navy); font-size: 17px; letter-spacing: -.015em; }
.panel h2::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 2; }
.panel h2 > * { order: 3; }
.panel h3, .settings-group h3, .review-panel h3 { margin: 0 0 10px; color: var(--navy-soft); font-size: 14px; }
.panel-status { font-size: 11px; font-weight: 600; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #8795a8; }
.dot.online, .dot.running, .dot.healthy, .dot.active, .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,128,92,.12); }
.dot.warning, .dot.standby, .dot.degraded { background: var(--warn); }
.dot.offline, .dot.unavailable { background: var(--bad); }
table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--surface); }
th, td { border-bottom: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: top; line-height: 1.4; }
th { background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fcfdff; }
.kv th { width: 40%; }
.state { font-weight: 700; }
.state.online, .state.running, .state.healthy, .state.active, .state.ok { color: var(--ok); }
.state.warning, .state.standby, .state.degraded { color: var(--warn); }
.state.offline, .state.unavailable { color: var(--bad); }
.compact-table th, .compact-table td { font-size: 12px; padding: 8px 9px; }
.muted, .setting-description, .setting-meta, .setting-key { color: var(--muted); }
.muted { line-height: 1.55; }
.help-text, .field-help { display: block; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.empty-state, .notice { padding: 17px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-soft); color: var(--muted); line-height: 1.55; }
.notice { border-style: solid; }
.warning-note { border: 1px solid #efd49e; border-radius: 9px; padding: 10px 12px; background: #fff9ec; color: #805700; line-height: 1.45; }
.error { min-height: 22px; color: var(--bad); }
.date-toolbar, .filter-row, .pagination { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.date-toolbar label, .filter-row label, .egress-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.date-toolbar label input { min-width: 160px; }
.pagination { align-items: center; justify-content: flex-end; margin: 16px 0 0; }
.pagination span { color: var(--muted); font-size: 12px; }
.filter-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); margin: 14px 0 16px; }
.selected-day { margin: -7px 0 14px; color: var(--muted); font-size: 13px; }
.event-details { display: block; margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 16px; }
.stats-section { margin: 8px 0; }
.stats-grid .stats-section { margin: 0; }
details summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.settings-group { margin: 22px 0 0; border-top: 1px solid var(--line); padding-top: 18px; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; }
.setting-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 14px; }
.setting-card label { display: block; color: var(--navy-soft); font-weight: 700; }
.setting-card input { width: 100%; margin: 8px 0 3px; }
.setting-description, .setting-meta, .setting-key, .setting-error { display: block; font-size: 12px; margin-top: 5px; line-height: 1.4; }
.setting-error { min-height: 16px; color: var(--bad); }
.setting-pending { color: var(--warn); font-weight: 700; }
.credential-panel { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.credential-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 14px; margin-top: 12px; }
.credential-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.credential-card-heading strong { color: var(--navy-soft); }
.credential-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.credential-state.configured { color: var(--ok); font-weight: 700; }
.credential-form { margin-top: 12px; }
.credential-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.credential-input-row { display: flex; align-items: stretch; gap: 8px; }
.credential-input-row input { min-width: 0; flex: 1; }
.credential-toggle { flex: 0 0 auto; }
.credential-actions { margin: 10px 0 0; }
.credential-form .settings-status { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.settings-actions, .egress-actions { display: flex; gap: 9px; margin: 18px 0 0; flex-wrap: wrap; }
.setting-field { display: grid; gap: 6px; max-width: 640px; margin-top: 12px; color: var(--navy-soft); font-weight: 600; }
.setting-field input { font-weight: 400; }
.review-panel { border: 1px solid #efd49e; border-radius: 10px; background: #fffdf5; padding: 15px; margin: 16px 0; }
.protection-card { border-left: 4px solid var(--ok); border-radius: 7px; padding: 10px 12px; margin: 8px 0; background: #f1faf6; }
.protection-card strong, .protection-card small { display: block; }
.protection-card small { color: var(--muted); margin-top: 4px; }
.egress-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.egress-form label { min-width: 190px; flex: 1; }
.egress-form input, .egress-form select { width: 100%; }
.egress-actions { margin: 0; gap: 6px; }
.neutral-state { color: var(--muted); font-weight: 700; }
.telemetry-live { color: var(--ok); }
.telemetry-stale { color: var(--bad); }
.network-summary, .destination-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.destination-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card, .destination-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 14px; }
.metric-card strong, .destination-card h3 { display: block; color: var(--navy); margin: 0 0 6px; }
.metric-card small, .destination-card small { color: var(--muted); }
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-box { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 45px rgba(24,48,82,.14); padding: 0 30px 28px; }
.brand-strip { height: 62px; margin: 0 -30px 25px; padding: 0 20px; border-radius: 14px 14px 0 0; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; }
.login-box h1 { font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.login-box form { display: grid; gap: 14px; }
.login-box label { display: grid; gap: 6px; }
[hidden] { display: none !important; }
@media (max-width: 1100px) { .status-grid { grid-template-columns: repeat(3, minmax(135px, 1fr)); } .destination-grid { grid-template-columns: 1fr; } .network-summary { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }
@media (max-width: 900px) { .layout { grid-template-columns: 185px minmax(0, 1fr); } .content { padding: 20px; } .two-column, .stats-grid { grid-template-columns: 1fr; } .settings-fields { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .topbar { padding: 12px 16px; flex-wrap: wrap; } .layout { display: block; } .sidebar { display: flex; gap: 5px; overflow-x: auto; padding: 8px; } .nav-item { min-width: 120px; } .admin-nav { display: flex; } .admin-subitem { min-width: 170px; padding: 7px 11px; } .content { padding: 18px 12px; } .status-grid, .network-summary { grid-template-columns: 1fr; } .login-box { width: 100%; } }

/* UI polish round 2: aligned parameter rows and contained wide tables. */
.content, .view, .panel, .panel > *, .table-scroll { min-width: 0; }
.panel { overflow: hidden; }
.settings-group { margin-top: 18px; padding-top: 14px; }
.settings-group h3, .review-panel h3 { margin-bottom: 10px; line-height: 1.35; letter-spacing: .01em; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.security-protection-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.security-protection-card h3 { margin-bottom: 5px; font-size: 16px; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; background: var(--line); color: var(--navy); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-badge.enabled { background: #dff4e8; color: #17643b; }
.status-badge.disabled { background: #fbe1e1; color: #8b2424; }
.security-protection-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.security-protection-actions label { min-width: 280px; }
#security-protection-reason { margin-top: 5px; }
#security-protection-result { min-height: 20px; margin: 10px 0 0; }
.bot-prompt-card textarea { min-height: 260px; resize: vertical; font-family: inherit; line-height: 1.5; }
.bot-prompt-card .prompt-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.bot-prompt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.web-admin-users-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 9px; margin: 12px 0; }
.web-admin-users-table { min-width: 720px; }
.web-admin-users-table strong, .web-admin-users-table small { display: block; }
.web-admin-users-table small { margin-top: 3px; color: var(--muted); }
.web-admin-user-editor, .web-admin-user-detail { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.web-admin-user-editor summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.web-admin-user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.web-admin-user-form > label, .web-admin-password-form > label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.web-admin-user-form > .web-admin-account-switch { display: inline-flex; align-items: center; justify-content: flex-start; gap: 9px; grid-column: 1 / -1; width: min(100%, 430px); min-height: 30px; color: var(--text); cursor: pointer; }
.web-admin-account-switch .web-admin-account-state { margin-left: auto; color: var(--muted); font-weight: 700; }
.web-admin-account-switch.is-disabled { cursor: default; opacity: .72; }
.web-admin-user-form .web-admin-permissions { grid-column: 1 / -1; }
.web-admin-permissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.web-admin-permissions fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.web-admin-permissions legend { padding: 0 4px; color: var(--navy-soft); font-size: 12px; font-weight: 700; }
.web-admin-permission { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px; margin: 5px 0; color: var(--text) !important; font-size: 12px !important; font-weight: 400 !important; }
.web-admin-permission input { width: auto; min-height: 15px; }
.web-admin-user-detail h4 { margin: 0 0 8px; color: var(--navy-soft); }
.web-admin-user-detail .web-admin-user-form { margin-top: 16px; }
.web-admin-audit-row { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .web-admin-users-toolbar, .web-admin-user-form, .web-admin-permissions { grid-template-columns: 1fr; } }

/* Prompt editor: give long multiline instructions a contained full-width workspace. */
.bot-prompt-card { width: 100%; max-width: 100%; min-width: 0; }
.bot-prompt-card textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: clamp(360px, 48vh, 560px);
  resize: vertical;
  overflow: auto;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bot-prompt-card textarea:focus {
  outline: 3px solid rgba(49, 103, 197, .18);
  outline-offset: 1px;
  border-color: var(--accent);
}
.prompt-warning { color: #8b5b00; }
@media (max-width: 700px) { .panel-heading-row { flex-direction: column; } .security-protection-actions { align-items: stretch; flex-direction: column; } .security-protection-actions label { min-width: 0; } }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overscroll-behavior-x: contain; }
.table-scroll > table { min-width: 100%; margin: 0; border: 0; }
table { width: 100%; max-width: 100%; table-layout: fixed; border: 0; }
th, td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 11px; line-height: 1.4; overflow-wrap: anywhere; word-break: break-word; }
thead th { border-bottom: 2px solid var(--line-strong); line-height: 1.3; white-space: normal; }
tbody tr:last-child > th, tbody tr:last-child > td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }
.kv tbody th { width: 40%; background: var(--surface-soft); color: var(--navy-soft); font-weight: 650; }
.kv tbody td { color: var(--text); font-variant-numeric: tabular-nums; }
.compact-table th, .compact-table td { padding: 8px 9px; line-height: 1.35; }
.table-scroll > table.telemetry-table { min-width: 1280px; }
.table-scroll > table.egress-sources-table { min-width: 980px; }
.table-scroll > table.egress-nodes-table { min-width: 900px; }
.table-scroll > table.logs-table { min-width: 760px; }
.egress-actions { display: flex; align-items: center; gap: 6px; min-width: 155px; margin: 0; flex-wrap: wrap; }
.egress-form { align-items: stretch; }
.egress-form label { min-width: min(190px, 100%); line-height: 1.35; }
.egress-form button { align-self: end; white-space: normal; }
.setting-card { line-height: 1.4; }
.setting-card label { line-height: 1.35; }
.empty-state, .notice, .warning-note { line-height: 1.5; }
@media (max-width: 1100px) { .table-scroll > table.telemetry-table { min-width: 1160px; } .table-scroll > table.egress-sources-table { min-width: 900px; } .table-scroll > table.egress-nodes-table { min-width: 820px; } .table-scroll > table.logs-table { min-width: 700px; } }
@media (max-width: 650px) { .table-scroll { border-radius: 7px; } .table-scroll > table.telemetry-table { min-width: 1080px; } .table-scroll > table.egress-sources-table { min-width: 820px; } .table-scroll > table.egress-nodes-table { min-width: 760px; } .table-scroll > table.logs-table { min-width: 640px; } th, td { padding: 8px; } }

/* Journal 2.0 presentation: full-width details and compact, contained rows. */
#logs .filter-card { padding: 14px; }
#logs #log-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 10px; margin: 0; }
#logs #log-filter label { min-width: 0; }
#logs #log-filter input, #logs #log-filter select { min-width: 0; width: 100%; }
#logs #log-filter button { align-self: end; min-width: 0; white-space: nowrap; }
#logs .logs-table { width: 100%; min-width: 0; table-layout: fixed; }
#logs .logs-table th, #logs .logs-table td { word-break: normal; overflow-wrap: anywhere; }
#logs .logs-table th:nth-child(1), #logs .logs-table td:nth-child(1) { width: 12%; }
#logs .logs-table th:nth-child(2), #logs .logs-table td:nth-child(2) { width: 10%; }
#logs .logs-table th:nth-child(3), #logs .logs-table td:nth-child(3) { width: 12%; }
#logs .logs-table th:nth-child(4), #logs .logs-table td:nth-child(4) { width: 16%; }
#logs .logs-table th:nth-child(5), #logs .logs-table td:nth-child(5) { width: 11%; }
#logs .logs-table th:nth-child(6), #logs .logs-table td:nth-child(6) { width: 10%; }
#logs .logs-table th:nth-child(7), #logs .logs-table td:nth-child(7) { width: 29%; }
#logs .logs-table .event-row > td { vertical-align: middle; }
#logs .logs-table .event-details-row > td { padding: 0; border-bottom: 1px solid var(--line); }
#logs .logs-table .event-details-row[hidden] { display: none; }
#logs .event-details-cell { background: var(--surface-soft); }
#logs .journal-details { padding: 14px 16px 16px; }
#logs .journal-details-grid, #logs .journal-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
#logs .journal-detail-item { min-width: 0; display: grid; grid-template-columns: minmax(120px, .38fr) minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
#logs .journal-detail-label { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; overflow-wrap: normal; word-break: normal; }
#logs .journal-detail-value { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; word-break: normal; }
#logs .journal-technical-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
#logs .journal-details-heading { margin: 14px 0 2px; color: var(--navy-soft); font-size: 12px; }
#logs .journal-details-grid .journal-detail-item:nth-last-child(-n + 2) { border-bottom: 0; }
#logs .journal-extra-grid .journal-detail-item:last-child { border-bottom: 0; }
#logs .journal-details-toggle { display: inline-flex; margin: 7px 0 0; padding: 4px 8px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
#logs .journal-details-toggle:hover { background: #dce8ff; border: 0; }
#logs .journal-badge { display: inline-flex; max-width: 100%; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 7px; color: var(--navy-soft); background: var(--surface-soft); font-size: 11px; font-weight: 700; line-height: 1.15; white-space: normal; }
#logs .journal-level-warning, #logs .journal-level-error, #logs .journal-level-critical { color: var(--warn); border-color: #efd49e; background: #fff9ec; }
#logs .journal-level-error, #logs .journal-level-critical { color: var(--bad); border-color: #f0c4ca; background: #fff5f6; }
#logs .journal-outcome-success, #logs .journal-outcome-recovered, #logs .journal-outcome-healthy { color: var(--ok); border-color: #b9dfd0; background: #f1faf6; }
#logs .journal-outcome-failed, #logs .journal-outcome-denied { color: var(--bad); border-color: #f0c4ca; background: #fff5f6; }
#logs .journal-raw-code { display: block; margin-top: 3px; color: var(--muted); font: 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
#logs .journal-summary { display: inline; }
@media (max-width: 1100px) {
  #logs #log-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #logs #log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #logs .journal-details-grid, #logs .journal-extra-grid { grid-template-columns: 1fr; }
  #logs .journal-detail-item { grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr); }
}
@media (max-width: 480px) {
  #logs #log-filter { grid-template-columns: 1fr; }
  #logs .journal-detail-item { grid-template-columns: 1fr; gap: 3px; }
}

/* Manual diagnostics: bounded operator tools, separate from automatic checks. */
.manual-diagnostics-form { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.manual-diagnostics-form label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.manual-diagnostics-form input, .manual-diagnostics-form select { width: 100%; min-width: 0; }
.manual-diagnostic-option { display: none !important; }
.manual-diagnostic-port { min-width: 90px; }
.manual-diagnostics-form[data-tool="ping"] .manual-diagnostic-option, .manual-diagnostics-form[data-tool="tracert"] .manual-diagnostic-option { display: grid !important; }
.manual-diagnostics-form .manual-diagnostic-timeout { display: grid !important; }
.manual-diagnostics-form[data-tool="dns"] .manual-diagnostic-dns, .manual-diagnostics-form[data-tool="http"] .manual-diagnostic-http { display: grid !important; }
.diagnostic-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#diagnostic-presets { display: flex; gap: 6px; flex-wrap: wrap; }
#diagnostic-presets button { padding: 5px 9px; font-size: 12px; }
.manual-diagnostics-result { margin-top: 16px; min-width: 0; }
.manual-diagnostic-summary { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.manual-diagnostic-summary .metric-card { min-width: 0; }
.diagnostic-output { max-height: 260px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; color: var(--navy-soft); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.diagnostic-history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.diagnostic-history h3 { margin-bottom: 9px; }
.diagnostic-history-list { display: grid; gap: 6px; }
.diagnostic-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 12px; }
.diagnostic-history-item span { min-width: 0; overflow-wrap: anywhere; }
.diagnostic-status-success { color: var(--ok); font-weight: 700; }
.diagnostic-status-partial { color: var(--warn); font-weight: 700; }
.diagnostic-status-error, .diagnostic-status-timeout { color: var(--bad); font-weight: 700; }
@media (max-width: 1100px) { .manual-diagnostics-form { grid-template-columns: repeat(3, minmax(0, 1fr)); } .manual-diagnostics-form label:first-child { grid-column: span 2; } .manual-diagnostic-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .manual-diagnostics-form { grid-template-columns: 1fr; } .manual-diagnostics-form label:first-child { grid-column: auto; } .manual-diagnostic-summary { grid-template-columns: 1fr; } }

/* Active chats: bounded operator workspace with independent list/timeline scrolling. */
#chats { min-width: 0; }
#chats .chat-layout { display: grid; grid-template-columns: minmax(300px, 34%) minmax(0, 1fr); gap: 16px; height: min(820px, calc(100vh - 142px)); min-height: 540px; min-width: 0; }
#chats .chat-list-panel, #chats .chat-detail-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; padding: 18px; }
#chats .chat-panel-heading, #chats .chat-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
#chats .chat-panel-heading h2, #chats .chat-detail-header h2 { min-width: 0; margin-bottom: 4px; }
#chats .chat-panel-heading h2::after, #chats .chat-detail-header h2::after { display: none; }
#chats .chat-panel-heading .help-text { margin-bottom: 0; }
#chats .chat-refresh-status { flex: 0 0 auto; }
#chats .chat-filter { display: grid; gap: 10px; margin: 14px 0; }
#chats .chat-search { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
#chats .chat-filter-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
#chats .chat-filter-label { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; }
#chats .chat-filter-chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
#chats .chat-filter-chip { min-height: 30px; padding: 5px 9px; border-color: var(--line); background: var(--surface); color: var(--navy-soft); font-size: 12px; }
#chats .chat-filter-chip:hover, #chats .chat-filter-chip.active { border-color: #aac2ef; background: var(--accent-soft); color: var(--accent); }
#chats .chat-filter-secondary { align-items: end; }
#chats .chat-filter-secondary label { display: grid; flex: 1 1 120px; min-width: 0; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
#chats .chat-filter-secondary input, #chats .chat-filter-secondary select { min-width: 0; min-height: 34px; padding: 6px 8px; }
#chats .chat-filter-secondary button { flex: 0 0 auto; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
#chats .chat-list { display: grid; flex: 1 1 auto; align-content: start; gap: 7px; min-height: 0; overflow-y: auto; padding: 2px 4px 2px 0; }
#chats .chat-list-item { display: grid; width: 100%; min-width: 0; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 11px 12px; text-align: left; }
#chats .chat-list-item:hover, #chats .chat-list-item.selected { background: var(--accent-soft); border-color: #aac2ef; }
#chats .chat-list-item:focus-visible { position: relative; z-index: 1; }
#chats .chat-list-top, #chats .chat-list-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
#chats .chat-list-identity { display: flex; align-items: center; gap: 7px; min-width: 0; }
#chats .chat-list-icon { display: inline-grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-soft); font-size: 14px; }
#chats .chat-list-item strong { min-width: 0; overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
#chats .chat-list-item small { min-width: 0; margin: 0; color: var(--muted); line-height: 1.35; }
#chats .chat-list-username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chats .chat-list-item .chat-preview { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#chats .chat-list-bottom { margin-top: 2px; }
#chats .chat-list-bottom small { font-size: 11px; }
#chats .chat-list-item .chat-unread { color: var(--accent); font-size: 11px; font-weight: 700; }
#chats .chat-status { display: inline-flex !important; flex: 0 0 auto; width: fit-content; align-items: center; margin: 0 !important; border-radius: 999px; padding: 3px 7px; background: var(--surface-soft); color: var(--muted) !important; font-size: 11px; font-weight: 700; white-space: nowrap; }
#chats .chat-status.active { background: #f1faf6; color: var(--ok) !important; }
#chats .chat-status.idle { background: #fff9ec; color: var(--warn) !important; }
#chats .chat-status.inactive { background: #f4f6f8; color: var(--muted) !important; }
#chats .chat-detail-header { flex: 0 0 auto; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
#chats .chat-detail-header .help-text { margin-top: 3px; }
#chats .chat-timeline { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 0; max-height: none; overflow-y: auto; align-items: stretch; padding: 14px 5px 10px 1px; scroll-behavior: smooth; }
#chats .chat-timeline.empty-state { display: grid; place-items: center; align-content: center; min-height: 0; padding: 24px; }
#chats .chat-day-separator { display: flex; align-items: center; gap: 10px; margin: 5px 0; color: var(--muted); font-size: 11px; font-weight: 700; }
#chats .chat-day-separator::before, #chats .chat-day-separator::after { height: 1px; flex: 1; background: var(--line); content: ""; }
#chats .chat-message { display: flex; flex: 0 0 auto; flex-direction: column; width: fit-content; max-width: 74%; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; background: var(--surface-soft); box-shadow: 0 2px 7px rgba(24, 48, 82, .035); }
#chats .chat-message.user { align-self: flex-start; border-left: 3px solid var(--accent); }
#chats .chat-message.bot { align-self: flex-end; border-right: 3px solid var(--ok); background: #f1faf6; }
#chats .chat-message.system { align-self: center; max-width: 80%; background: #fff9ec; }
#chats .chat-message-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; color: var(--muted); font-size: 11px; }
#chats .chat-message-head strong { color: var(--navy-soft); font-size: 12px; }
#chats .chat-message-type { color: var(--muted); }
#chats .chat-message-text { min-width: 0; margin-top: 7px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
#chats .chat-photo-placeholder, #chats .chat-plant-result { display: grid; gap: 4px; min-width: 190px; }
#chats .chat-photo-placeholder { grid-template-columns: auto 1fr; align-items: center; }
#chats .chat-photo-placeholder-icon { grid-row: span 2; font-size: 25px; }
#chats .chat-photo-placeholder strong, #chats .chat-plant-result strong { color: var(--navy-soft); }
#chats .chat-photo-placeholder small, #chats .chat-plant-result small { color: var(--muted); font-size: 11px; }
#chats .chat-plant-result-label { color: var(--navy-soft); font-size: 12px; font-weight: 700; }
#chats .chat-message-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; color: var(--muted); font-size: 11px; }
#chats .chat-delivery { display: inline-flex; align-items: center; gap: 4px; }
#chats .chat-delivery::before { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); content: ""; }
#chats .chat-delivery.pending::before { background: var(--warn); }
#chats .chat-delivery.failed::before { background: var(--bad); }
#chats .chat-message details { margin-top: 7px; }
#chats .chat-message details summary { display: inline-flex; padding: 2px 0; color: var(--muted); font-size: 11px; font-weight: 600; }
#chats .chat-message details[open] summary { color: var(--accent); }
#chats .chat-technical-details { display: grid; gap: 4px; margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#chats .chat-technical-details code { min-width: 0; color: var(--navy-soft); font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
#chats .chat-new-messages { align-self: center; flex: 0 0 auto; min-height: 30px; padding: 5px 10px; border-color: #aac2ef; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
#chats .chat-list-panel > .pagination, #chats .chat-detail-panel > .pagination { flex: 0 0 auto; margin: 12px 0 0; }
#chats .chat-empty { min-height: 120px; margin: 0; }
@media (max-width: 1100px) {
  #chats .chat-layout { grid-template-columns: minmax(280px, 36%) minmax(0, 1fr); }
  #chats .chat-filter-secondary { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  #chats .chat-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  #chats .chat-list-panel, #chats .chat-detail-panel { height: auto; min-height: 360px; }
  #chats .chat-list { max-height: 320px; }
  #chats .chat-timeline { min-height: 360px; }
  #chats .chat-message { max-width: 100%; }
}

/* Database users frame: compact operator view with a contained details panel. */
#database .database-users-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; }
#database .database-users-heading h2 { min-width: 0; }
#database .database-users-heading h2::after { display: none; }
#database .users-filter { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto auto; align-items: end; gap: 10px; margin: 14px 0; }
#database .users-filter label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
#database .users-filter input, #database .users-filter select { min-width: 0; min-height: 34px; padding: 6px 8px; }
#database .users-table { min-width: 980px; table-layout: fixed; }
#database .users-table th, #database .users-table td { overflow-wrap: anywhere; vertical-align: middle; }
#database .users-table th:nth-child(1) { width: 16%; }
#database .users-table th:nth-child(2) { width: 11%; }
#database .users-table th:nth-child(3) { width: 10%; }
#database .users-table th:nth-child(4) { width: 12%; }
#database .users-table th:nth-child(5), #database .users-table th:nth-child(6) { width: 13%; }
#database .users-table th:nth-child(7), #database .users-table th:nth-child(8), #database .users-table th:nth-child(9) { width: 7%; }
#database .users-table th:nth-child(10) { width: 8%; }
#database .user-status, #database .user-role { font-weight: 700; white-space: nowrap; }
#database .user-status.active { color: var(--ok); }
#database .user-status.blocked { color: var(--bad); }
#database .user-status.restricted { color: var(--warn); }
#database .user-role { color: var(--navy-soft); }
#database .user-detail { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
#database .user-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#database .user-detail-heading h3 { margin: 0; color: var(--navy); }
#database .user-detail-status { margin: 5px 0 14px; color: var(--muted); font-size: 12px; }
#database .user-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0 0 16px; }
#database .user-detail-row { display: grid; grid-template-columns: minmax(120px, 42%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
#database .user-detail-row dt { color: var(--muted); font-size: 12px; }
#database .user-detail-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 13px; }
#database .user-detail-section { margin-top: 14px; }
#database .user-detail-section h4 { margin: 0 0 8px; color: var(--navy-soft); font-size: 13px; }
#database .user-role-form, #database .user-block-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
#database .user-role-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
#database .user-role-form input, #database .user-role-form select, #database .user-block-form input { min-width: 180px; min-height: 34px; padding: 6px 8px; }
#database .user-plant-row, #database .user-audit-row { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
#database .pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
@media (max-width: 1100px) { #database .users-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 650px) { #database .users-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } #database .user-detail-grid { grid-template-columns: 1fr; } }

/* Provider operations: dense common summary with full-width, readable details. */
#providers .provider-table-rich { table-layout: fixed; }
#providers .provider-table-rich th, #providers .provider-table-rich td { word-break: normal; overflow-wrap: anywhere; vertical-align: middle; }
#providers .provider-table-rich th:nth-child(1), #providers .provider-table-rich td:nth-child(1) { width: 11%; }
#providers .provider-table-rich th:nth-child(2), #providers .provider-table-rich td:nth-child(2) { width: 10%; }
#providers .provider-table-rich th:nth-child(3), #providers .provider-table-rich td:nth-child(3) { width: 15%; }
#providers .provider-table-rich th:nth-child(4), #providers .provider-table-rich td:nth-child(4) { width: 14%; }
#providers .provider-table-rich th:nth-child(5), #providers .provider-table-rich td:nth-child(5) { width: 9%; }
#providers .provider-table-rich th:nth-child(6), #providers .provider-table-rich td:nth-child(6) { width: 16%; }
#providers .provider-table-rich th:nth-child(7), #providers .provider-table-rich td:nth-child(7) { width: 8%; }
#providers .provider-table-rich th:nth-child(8), #providers .provider-table-rich td:nth-child(8) { width: 9%; }
#providers .provider-table-rich th:nth-child(9), #providers .provider-table-rich td:nth-child(9) { width: 8%; }
#providers .provider-details-cell { padding: 0; background: var(--surface-soft); }
#providers .provider-details { padding: 14px 16px 16px; }
#providers .provider-details > summary { display: inline-flex; margin-bottom: 12px; padding: 4px 9px; border-radius: 6px; background: var(--accent-soft); font-size: 12px; }
#providers .provider-details h4 { margin: 14px 0 7px; color: var(--navy-soft); font-size: 12px; }
#providers .provider-details h4:first-of-type { margin-top: 0; }
#providers .provider-detail-table { margin: 0; }
#providers .provider-detail-table th { width: 34%; font-weight: 650; text-transform: none; letter-spacing: 0; }
#providers .provider-detail-table th, #providers .provider-detail-table td { padding: 7px 9px; }
#providers .provider-table-rich .state { white-space: normal; }
@media (max-width: 1100px) {
  #providers .provider-table-rich { min-width: 900px; }
}
@media (max-width: 650px) {
  #providers .provider-table-rich { min-width: 820px; }
  #providers .provider-details-grid { grid-template-columns: 1fr; }
}

/* Durable media and provider history: previews stay compact; originals open only on demand. */
.chat-photo-preview, .provider-history-thumb, .user-photo-card img { display: block; object-fit: cover; border: 1px solid var(--line); background: var(--surface-soft); cursor: zoom-in; }
.chat-photo-preview { width: min(280px, 100%); max-height: 220px; border-radius: 9px; }
.user-photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.user-photo-card { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.user-photo-card img { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; }
.user-photo-card small { display: block; margin-top: 6px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.media-viewer { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(14, 28, 48, .72); }
.media-viewer-content { display: grid; max-width: min(1100px, 94vw); max-height: 94vh; gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 48px rgba(0,0,0,.28); }
.media-viewer-close { justify-self: end; }
.media-viewer-image { display: block; max-width: min(1060px, 90vw); max-height: 78vh; object-fit: contain; }
.media-viewer-info { color: var(--muted); font-size: 12px; }
.provider-history-summary { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.provider-history-summary-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--navy-soft); font-size: 13px; font-weight: 700; }
.provider-history-table { table-layout: fixed; }
.provider-history-table th, .provider-history-table td { vertical-align: middle; overflow-wrap: anywhere; }
.provider-history-thumb { width: 52px; height: 40px; border-radius: 5px; }
.provider-history-detail { margin-top: 14px; }
.provider-history-detail-grid { display: grid; grid-template-columns: minmax(150px, 28%) minmax(0, 1fr); gap: 0 14px; margin: 0; }
.provider-history-detail-grid dt, .provider-history-detail-grid dd { min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.provider-history-detail-grid dt { color: var(--muted); font-size: 12px; }
.provider-history-detail-grid dd { margin: 0; color: var(--text); white-space: pre-wrap; }
.provider-history-detail-image { display: block; max-width: min(440px, 100%); max-height: 360px; margin-top: 14px; border-radius: 8px; cursor: zoom-in; object-fit: contain; }
@media (max-width: 700px) {
  .provider-history-summary { grid-template-columns: 1fr; }
  .provider-history-detail-grid { grid-template-columns: 1fr; }
  .provider-history-detail-grid dt { padding-bottom: 2px; border-bottom: 0; }
  .provider-history-detail-grid dd { padding-top: 2px; }
  .media-viewer { padding: 12px; }
}

.notification-section { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.notification-card { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.notification-card-content { min-width: 0; }
.notification-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy-soft); color: var(--surface); font-size: 12px; font-weight: 750; }
.notification-section h3 { margin: 0 0 8px; color: var(--navy-soft); }
.notification-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.notification-field { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.notification-section textarea { width: 100%; min-height: 150px; resize: vertical; line-height: 1.5; }
.notification-section input, .notification-section select { min-width: 0; }
.notification-counter { margin: 5px 0 0; color: var(--muted); font-size: 12px; text-align: right; }
.notification-switch { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; }
.notification-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.notification-switch-control { position: relative; display: inline-block; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 11px; background: var(--line); transition: background .15s ease; }
.notification-switch-control::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); content: ""; box-shadow: 0 1px 2px rgb(0 0 0 / 18%); transition: transform .15s ease; }
.notification-switch input:checked + .notification-switch-control { background: var(--accent); }
.notification-switch input:checked + .notification-switch-control::after { transform: translateX(16px); }
.notification-switch input:focus-visible + .notification-switch-control { outline: 2px solid var(--accent); outline-offset: 2px; }
.notification-ai-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); align-items: end; gap: 12px; }
.notification-ai-fields .notification-instruction { grid-column: 1 / -1; }
.notification-ai-fields textarea { min-height: 110px; }
.notification-ai-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; }
.notification-ai-actions button { min-width: 170px; }
.notification-manual-note { margin: 12px 0 0; padding: 9px 11px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--surface); }
.notification-meta-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.notification-final-card textarea { min-height: 210px; }
.notification-send-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12px; }
.notification-send-summary strong { color: var(--text); font-weight: 700; }
.notification-recipient-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.notification-recipient-tools input { flex: 1 1 220px; min-width: 150px; }
.notification-recipients { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 330px; overflow: auto; }
.notification-recipient { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.notification-recipient > span { min-width: 0; display: grid; gap: 2px; }
.notification-recipient strong, .notification-recipient small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-recipient small { color: var(--muted); }
.notification-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.notification-history-panel { margin-top: 16px; }
.notification-table { table-layout: fixed; }
.notification-table th, .notification-table td { overflow-wrap: anywhere; vertical-align: middle; }
.notification-detail { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.notification-detail-message { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border-radius: 8px; background: var(--surface); }
.notification-delivery-table { margin-top: 12px; }
@media (max-width: 900px) { .notification-section-heading { align-items: flex-start; flex-direction: column; } .notification-ai-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .notification-card { grid-template-columns: 1fr; } .notification-step { margin-bottom: -4px; } .notification-ai-fields { grid-template-columns: 1fr; } .notification-ai-fields .notification-instruction, .notification-ai-actions { grid-column: auto; } .notification-ai-actions { align-items: stretch; flex-direction: column; } .notification-ai-actions button { width: 100%; } .notification-switch { justify-content: space-between; width: 100%; } }
