:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #657180;
  --line: #d9dee7;
  --accent: #1976d2;
  --accent-dark: #0f4c81;
  --ok: #0f8a5f;
  --warn: #a15c00;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button.secondary {
  background: #e9eef5;
  color: var(--accent-dark);
}

button.danger {
  background: #fbe9e7;
  color: var(--bad);
}

button.warning {
  background: #f59e0b;
  color: #fff;
}

button.link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--bad);
}

button.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #26a69a;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #aeb8c5;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  color: #d4dbe6;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
}

nav a.active,
nav a:hover {
  background: #223044;
  color: #fff;
}

.nav-group {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.nav-group-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  background: transparent;
  color: #d4dbe6;
  text-align: left;
}

.nav-group-toggle::after {
  content: "▸";
  color: #8fb4e8;
}

.nav-group.open .nav-group-toggle,
.nav-group-toggle:hover {
  background: #223044;
  color: #fff;
}

.nav-group.open .nav-group-toggle::after {
  content: "▾";
}

.nav-submenu {
  display: grid;
  gap: 4px;
}

.nav-submenu[hidden] {
  display: none;
}

.nav-submenu a {
  margin-left: 10px;
  padding-left: 16px;
}

main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(130px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.origin-form {
  grid-template-columns: minmax(160px, 1fr) 90px 90px minmax(110px, 0.7fr) auto;
  margin-top: 12px;
}

.settings-form {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input,
select {
  min-height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 74px;
  padding: 10px;
  resize: vertical;
}

label span {
  color: #8b95a3;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.domain-list {
  display: grid;
  gap: 12px;
}

.domain-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.domain-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.domain-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.status {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status.ready {
  background: #e5f7ef;
  color: var(--ok);
}

.status.pending_cname,
.status.cloudflare_pending,
.status.pending,
.status.installing,
.status.issuing,
.status.renewing {
  background: #fff4df;
  color: var(--warn);
}

.status.installed,
.status.issued {
  background: #e5f7ef;
  color: var(--ok);
}

.status.paused {
  background: #eef2f7;
  color: var(--muted);
}

.status.offline {
  background: #fee2e2;
  color: var(--bad);
}

.status.error {
  background: #fee2e2;
  color: var(--bad);
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.field {
  min-width: 0;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.field code {
  display: block;
  overflow-wrap: anywhere;
  padding: 8px;
  border-radius: 6px;
  background: #f1f4f8;
  color: #263241;
}

.origin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.origin-table th,
.origin-table td {
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

.origin-table th {
  color: var(--muted);
  font-weight: 600;
}

.table-card {
  padding: 0;
  overflow-x: auto;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.5fr) 150px 150px auto auto;
  gap: 10px;
  align-items: center;
  min-width: 860px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.list-toolbar div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.list-toolbar input,
.list-toolbar select {
  width: 100%;
}

.site-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
  font-size: 14px;
}

.node-table {
  min-width: 1180px;
}

.monitor-cell,
.bandwidth-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sync-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 96px;
}

.sync-cell small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.expiry-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}

.cache-task-panel {
  display: grid;
  gap: 12px;
}

.cache-task-form {
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.cache-task-table {
  min-width: 860px;
}

.quota-card {
  display: grid;
  gap: 18px;
}

.quota-expiry {
  display: grid;
  gap: 4px;
  text-align: right;
}

.quota-expiry span,
.quota-grid span {
  color: var(--muted);
  font-size: 12px;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.quota-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.quota-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
}

.compact-select {
  min-width: 130px;
  padding: 7px 9px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.muted-link {
  font-size: 12px;
}

.monitor-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
}

.monitor-dot.ok {
  background: var(--ok);
}

.monitor-dot.down {
  background: var(--bad);
}

.monitor-dot.unknown {
  background: var(--warn);
}

.bandwidth-pair b {
  font-size: 12px;
  margin-left: 2px;
}

.up-arrow {
  color: var(--brand);
}

.down-arrow {
  color: var(--bad);
}

.log-table {
  min-width: 1420px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-card > .pagination {
  padding: 14px;
}

.ua-cell {
  max-width: 360px;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 12px;
}

.site-table th,
.site-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.site-table th {
  color: #334155;
  font-weight: 600;
  background: #f8fafc;
}

.site-table td:first-child,
.site-table th:first-child {
  width: 40px;
}

.site-table input[type="text"],
.site-table input[type="number"],
.site-table input:not([type]) {
  min-height: 34px;
}

.site-table code {
  display: inline-block;
  max-width: 260px;
  overflow-wrap: anywhere;
  color: #263241;
}

.origin-listen-cell {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.origin-listen-cell div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.origin-listen-cell span {
  color: var(--muted);
}

.origin-listen-cell strong {
  font-weight: 500;
}

.port-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.port-badges .port-chip {
  padding: 3px 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.04);
  color: inherit;
  font: inherit;
  line-height: 1.3;
  cursor: pointer;
}

.port-badges .port-chip:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.port-badges .port-chip.is-disabled {
  opacity: 0.5;
}

.l4-group-port-line {
  margin-top: 8px;
}

.l4-batch-port-field textarea {
  min-height: 96px;
}

.port-badges code {
  padding: 2px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.table-actions {
  white-space: nowrap;
}

.table-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.message {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.empty-card {
  min-height: 160px;
  display: grid;
  place-items: center;
}

.domain-manage {
  display: grid;
  gap: 18px;
}

.domain-manage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.domain-manage-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.icon-text-button {
  border: 0;
  background: transparent;
  color: #1f3b63;
  min-width: 30px;
  padding: 4px 6px;
  font-size: 22px;
}

.run-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
}

.domain-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.domain-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #1f3b63;
}

.domain-tabs button.active {
  background: #eaf3ff;
  color: #0f5fbf;
}

.domain-manage-form {
  display: grid;
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.settings-grid label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
}

.settings-note {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 40px 16px;
  background: rgba(15, 23, 42, 0.42);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(920px, 100%);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.compact-panel {
  width: min(640px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.l4-proxy-modal {
  z-index: 35;
  padding: 18px 12px;
}

.l4-proxy-modal-panel {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 10px;
}

.l4-proxy-modal-body {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px 0;
  background: #fff;
}

.l4-proxy-modal-body .l4-editor-card {
  margin: 0;
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.l4-proxy-modal-body .l4-editor-card > form {
  margin: 0;
}

.l4-modal-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 22px 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.l4-modal-tabs button {
  position: relative;
  min-height: auto;
  padding: 10px 16px 11px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.l4-modal-tabs button.active {
  color: #1677ff;
  background: #fff;
}

.l4-modal-tabs button.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: #1677ff;
}

.l4-proxy-modal[data-l4-active-tab="basic"] [data-l4-tab-panel="protection"],
.l4-proxy-modal[data-l4-active-tab="protection"] [data-l4-tab-panel="basic"] {
  display: none !important;
}

.l4-proxy-modal .l4-editor-card > form > .section-head {
  display: none !important;
}

.l4-proxy-modal .l4-form-section {
  display: grid !important;
  grid-template-columns: 130px minmax(0, 1fr) !important;
  gap: 16px !important;
  padding: 18px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #eef2f7 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.l4-proxy-modal .l4-form-section-head h4 {
  margin-top: 2px !important;
  font-size: 14px !important;
}

.l4-proxy-modal .l4-form-section-head p {
  font-size: 12px !important;
  line-height: 1.65 !important;
}

.l4-proxy-modal .l4-form-grid,
.l4-proxy-modal .l4-basic-form-grid,
.l4-proxy-modal .l4-list-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
}

.l4-proxy-modal .l4-basic-form-grid [data-l4-origin-single],
.l4-proxy-modal .l4-basic-form-grid [data-l4-origin-weighted],
.l4-proxy-modal .l4-basic-form-grid .l4-auto-port-card {
  grid-column: 1 !important;
}

.l4-proxy-modal .l4-form-field {
  gap: 8px !important;
}

.l4-proxy-modal .l4-form-field > input,
.l4-proxy-modal .l4-form-field > select,
.l4-proxy-modal .l4-form-field > textarea {
  min-height: 36px !important;
  border-radius: 6px !important;
}

.l4-proxy-modal .l4-origin-server-row {
  grid-template-columns: minmax(0, 1fr) 82px auto !important;
  gap: 8px !important;
}

.l4-proxy-modal .l4-template-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.l4-proxy-modal .l4-template-card {
  min-height: 96px !important;
}

.l4-modal-actions {
  grid-column: 1 / -1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -22px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.l4-modal-actions button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 84px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 18px !important;
  align-self: center !important;
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
}

.site-form {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px 18px;
  align-items: center;
  padding: 24px 28px 20px;
}

.node-form {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px 18px;
  align-items: center;
  padding: 24px 28px 20px;
}

.node-form > label {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px 18px;
}

.node-form > label input,
.node-form > label select {
  grid-column: 2;
}

.inline-control {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
}

.radio-row,
.checkbox-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.radio-row > span,
.checkbox-row > span {
  color: var(--text);
  min-width: 82px;
}

.radio-row label,
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checkbox-row.vertical {
  display: grid;
  gap: 12px;
}

.input-suffix {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.input-suffix input {
  border: 0 !important;
}

.input-suffix span {
  padding: 0 10px;
  color: var(--muted);
}

.form-hint {
  grid-column: 2;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-form > label {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px 18px;
}

.site-form > label input,
.site-form > label select,
.site-form > label textarea {
  grid-column: 2;
}

.site-form > label span {
  grid-column: 2;
}

.segmented {
  grid-column: 2;
  display: inline-flex;
  width: fit-content;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f7fb;
}

.segmented button,
.dns-tabs button {
  min-width: 76px;
  background: transparent;
  color: #334155;
}

.segmented button.active,
.dns-tabs button.active {
  background: #e8f2ff;
  color: var(--accent);
  font-weight: 600;
}

.advanced {
  grid-column: 2;
  border: 0;
  padding-top: 4px;
}

.advanced summary {
  cursor: pointer;
  color: #344256;
}

.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 14px;
}

.origin-mode-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.origin-mode-section legend {
  margin-bottom: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.origin-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.origin-mode-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 3px 8px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.origin-mode-card:has(input:checked) {
  border-color: #2684ff;
  background: #f1f7ff;
}

.origin-mode-card input {
  grid-row: 1 / 3;
  width: 16px;
  min-height: 16px;
  margin: 2px 0 0;
  accent-color: #2684ff;
}

.origin-mode-card strong {
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
}

.origin-mode-card span {
  color: #64748b;
  font-size: 12px;
}

.modal-actions {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.cert-material {
  display: grid;
  gap: 16px;
  padding: 22px 28px 8px;
}

.cert-material label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 600;
}

.cert-material textarea {
  min-height: 180px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.dns-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.analytics-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.monitor-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.monitor-tabs button,
.analytics-filters button {
  width: auto;
  min-height: 34px;
}

.analytics-filters a.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #e8f2ff;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.analytics-filters a.button-like.secondary {
  border: 1px solid #cbd8ea;
  background: transparent;
  color: #334155;
  font-weight: 600;
}

.monitor-tabs button,
.analytics-filters button.secondary {
  background: transparent;
  color: #334155;
}

.monitor-tabs button.active,
.analytics-filters button.active {
  background: #e8f2ff;
  color: var(--accent);
  font-weight: 700;
}

.analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #fbfdff;
}

.analytics-filters input {
  width: 240px;
}

.analytics-filters input + input {
  width: 150px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-card {
  min-height: 318px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  background: #fff;
}

.chart-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.chart-card canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 106px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 18px;
  background: #fff;
}

.summary-card span {
  color: var(--muted);
}

.summary-card strong {
  font-size: 28px;
}

.analysis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.analysis-tabs button {
  min-height: 32px;
  border: 1px solid #d8dee9;
  border-bottom-color: #cfd7e4;
  border-radius: 4px 4px 0 0;
  background: #f8fafc;
  color: #334155;
}

.analysis-tabs button.active {
  border-color: #2684ff;
  border-bottom-color: #fff;
  background: #fff;
  color: #1677ff;
  font-weight: 700;
}

.analysis-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 16px;
}

.analysis-toolbar button,
.analysis-toolbar select {
  min-height: 32px;
  border-radius: 4px;
}

.analysis-toolbar button.secondary {
  border: 1px solid #d8dee9;
  background: #fff;
  color: #334155;
}

.analysis-toolbar button.active {
  border: 1px solid #2684ff;
  background: #eef6ff;
  color: #1677ff;
}

.analysis-toolbar input {
  width: 260px;
}

.ranking-table {
  min-width: 900px;
}

.dns-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.dns-tabs button {
  width: auto;
  border-radius: 6px;
}

.dns-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.dns-form {
  display: grid;
  grid-template-columns: 128px minmax(240px, 560px);
  gap: 14px 36px;
  align-items: center;
}

.dns-form label,
.dns-status-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  color: #334155;
}

.dns-form label > input,
.dns-form label > select,
.dns-form label > .inline-input {
  grid-column: 2;
}

.inline-input {
  display: grid;
  grid-template-columns: 190px 30px;
  align-items: center;
}

.inline-input input {
  border-radius: 6px 0 0 6px;
}

.inline-input b {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 400;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row span {
  grid-column: 2;
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #c7ccd4;
}

.switch-row span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s ease;
}

.switch-row input:checked + span {
  background: var(--accent);
}

.switch-row input:checked + span::after {
  transform: translateX(20px);
}

.dns-status-row > strong,
.dns-status-row > code {
  grid-column: 2;
  width: fit-content;
}

.ok-pill,
.bad-pill {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
}

.ok-pill {
  background: #dcfce7;
  color: #0f8a5f;
}

.bad-pill {
  background: #fee2e2;
  color: var(--bad);
}

.dns-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  nav a {
    text-align: center;
  }

  form,
  .settings-form,
  .domain-grid,
  .dns-form {
    grid-template-columns: 1fr 1fr;
  }

  .dns-form label,
  .dns-status-row,
  .site-form > label,
  .node-form > label {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dns-form label > input,
  .dns-form label > select,
  .dns-form label > .inline-input,
  .dns-status-row > strong,
  .dns-status-row > code,
  .switch-row span,
  .site-form > label input,
  .site-form > label select,
  .site-form > label textarea,
  .site-form > label span,
  .node-form > label input {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .topbar,
  .domain-head {
    align-items: stretch;
    flex-direction: column;
  }

  form,
  .settings-form,
  .metrics,
    .domain-grid,
    .site-form,
    .node-form,
    .advanced-grid,
  .origin-mode-grid,
  .dns-form,
  nav {
    grid-template-columns: 1fr;
  }

  .segmented,
  .advanced,
  .modal-actions,
  .dns-actions {
    grid-column: 1;
  }
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #eef3f8;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
}

.login-brand {
  margin-bottom: 24px;
  color: var(--text);
}

.login-brand span {
  color: var(--muted);
}

.login-form {
  grid-template-columns: 1fr;
  gap: 14px;
}

.login-message {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
}

.brand-mark-image,
.brand .logo.brand-mark-image {
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.brand-mark img,
.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-login-banner {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.brand-footer {
  margin: 28px auto 18px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-footer nav {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-footer a {
  color: var(--accent);
  text-decoration: none;
}

.brand-footer a:hover {
  text-decoration: underline;
}

/* Commercial CDN console theme override */
:root {
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe5f1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --brand: #14b8a6;
  --brand-2: #6366f1;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 46px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.18);
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at 18% -10%, rgba(20, 184, 166, 0.18), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(99, 102, 241, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fb 44%, #eaf0f8 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
}

button:active {
  transform: translateY(0);
}

button.secondary,
.button-link.secondary,
.analysis-toolbar button.secondary,
.analytics-filters button.secondary {
  border: 1px solid #cbd8ea;
  background: linear-gradient(180deg, #ffffff, #f3f7fc);
  color: #1e3a8a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

button.danger {
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fff7f7, #fee2e2);
  color: var(--bad);
  box-shadow: none;
}

button.warning {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

button.link-button,
.link-button {
  background: transparent;
  color: #2563eb;
  box-shadow: none;
  font-weight: 700;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow-y: auto;
  padding: 20px 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, 0.22), transparent 32%),
    linear-gradient(180deg, #0b1220 0%, #101827 48%, #0b1120 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 18px 0 60px rgba(15, 23, 42, 0.18);
}

.brand {
  gap: 13px;
  margin: 0 8px 22px;
  padding: 12px 10px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.95), rgba(37, 99, 235, 0.95)),
    #14b8a6;
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.28);
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand span {
  color: #93a4bb;
  letter-spacing: 0.02em;
}

nav {
  gap: 7px;
}

nav a,
.nav-group-toggle {
  position: relative;
  min-height: 44px;
  padding: 11px 13px 11px 42px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.01em;
}

nav a::before,
.nav-group-toggle::before {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  transform: translateY(-50%);
  text-align: center;
  opacity: 0.92;
  font-size: 15px;
}

nav a[href="#domains"]::before { content: "🌐"; }
nav a[href="#l4forward"]::before { content: "🔁"; }
nav a[href="#certificates"]::before { content: "🔒"; }
nav a[href="#dns"]::before { content: "🧭"; }
nav a[href="#nodes"]::before { content: "⚡"; }
nav a[href="#finance"]::before { content: "💳"; }
nav a[href="#users"]::before { content: "👥"; }
nav a[href="#system"]::before { content: "⚙"; }
nav a[href="#overview"]::before { content: "☁"; }
.nav-group[data-nav-group="packages"] .nav-group-toggle::before { content: "📦"; }
.nav-group[data-nav-group="analytics"] .nav-group-toggle::before { content: "📊"; }
.nav-group[data-nav-group="nodes"] .nav-group-toggle::before { content: "▣"; }
.nav-group[data-nav-group="sites"] .nav-group-toggle::before { content: "🌐"; }
.nav-group[data-nav-group="l4"] .nav-group-toggle::before { content: "🔁"; }
.nav-group[data-nav-group="global"] .nav-group-toggle::before { content: "⚙"; }
.nav-group[data-nav-group="finance"] .nav-group-toggle::before { content: "¥"; }
.nav-group[data-nav-group="system"] .nav-group-toggle::before { content: "🔧"; }

nav a.active,
nav a:hover,
.nav-group.open .nav-group-toggle,
.nav-group-toggle:hover {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.26), rgba(20, 184, 166, 0.11));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

nav a.active::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: #2dd4bf;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.85);
}

.nav-group {
  margin-top: 8px;
}

.nav-group-toggle {
  background: transparent;
  box-shadow: none;
  width: 100%;
}

.nav-group-toggle::after {
  content: "⌄";
  color: #93c5fd;
  font-size: 14px;
}

.nav-group.open .nav-group-toggle::after {
  content: "⌃";
}

.nav-submenu {
  gap: 3px;
  margin: 4px 0 6px;
}

.nav-submenu a {
  min-height: 36px;
  margin-left: 22px;
  padding: 8px 10px 8px 28px;
  border-radius: 11px;
  color: #b9c6d8;
  font-size: 14px;
  font-weight: 600;
}

.nav-submenu a::before {
  content: "•";
  left: 12px;
  color: #38bdf8;
}

main {
  min-width: 0;
  padding: 30px 34px 44px;
}

.topbar {
  position: relative;
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(203, 216, 234, 0.72);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.80)),
    radial-gradient(circle at 80% 10%, rgba(37, 99, 235, 0.12), transparent 36%);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.18), transparent 32%, rgba(99, 102, 241, 0.14));
  mask: linear-gradient(#000, transparent 42%);
}

h1 {
  font-size: clamp(24px, 2.5vw, 34px);
  letter-spacing: -0.035em;
  color: #0b1220;
}

p,
label,
.list-toolbar span {
  color: var(--muted);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

input,
select,
textarea {
  border-color: #d7e1ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 1.5px solid #adc0d8;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  accent-color: #2563eb;
}

input[type="checkbox"] {
  border-radius: 6px;
}

input[type="radio"] {
  border-radius: 999px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: #2563eb;
  background: #2563eb;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #334155;
  font-weight: 700;
}

label:has(> input[type="checkbox"]:checked),
label:has(> input[type="radio"]:checked) {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.10);
}

.table-actions button,
.form-actions button,
.modal-actions button,
.dns-actions button,
.topbar-actions button {
  border-radius: 999px;
}

.metrics {
  gap: 16px;
  margin-bottom: 20px;
}

.metrics div,
.domain-card,
.dns-panel,
.analytics-panel,
.chart-card,
.summary-card,
.quota-grid div,
.settings-note {
  border: 1px solid rgba(203, 216, 234, 0.78);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.metrics div {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
}

.metrics div::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -32px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15), transparent 68%);
}

.metrics span {
  font-weight: 700;
}

.metrics strong {
  margin-top: 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.domain-list {
  gap: 16px;
}

.domain-card {
  padding: 18px;
}

.domain-card:hover {
  box-shadow: var(--shadow-md);
}

.table-card {
  overflow-x: auto;
  overflow-y: hidden;
}

.list-toolbar {
  border-bottom-color: #dce7f3;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
}

.site-table th {
  background: linear-gradient(180deg, #f8fbff, #f1f6fd);
  color: #475569;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-table td,
.origin-table td,
.origin-table th {
  border-color: #e5edf7;
  word-break: keep-all;
  overflow-wrap: normal;
}

.site-table tbody tr {
  transition: background 0.14s ease;
}

.site-table tbody tr:hover {
  background: #f8fbff;
}

.status,
.ok-pill,
.bad-pill {
  border: 1px solid transparent;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.status.ready,
.status.installed,
.status.issued,
.ok-pill,
.status.hit {
  border-color: rgba(5, 150, 105, 0.18);
  background: #dcfce7;
  color: #047857;
}

.status.pending_cname,
.status.cloudflare_pending,
.status.pending,
.status.installing,
.status.issuing,
.status.renewing,
.status.miss,
.status.bypass {
  border-color: rgba(217, 119, 6, 0.18);
  background: #ffedd5;
  color: #c2410c;
}

.status.paused {
  border-color: #d8e0eb;
  background: #f1f5f9;
  color: #475569;
}

.status.offline,
.status.error,
.bad-pill {
  border-color: rgba(220, 38, 38, 0.18);
  background: #fee2e2;
  color: #b91c1c;
}

.field code,
.site-table code,
.port-badges code {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
}

.domain-tabs {
  gap: 10px;
  padding: 8px;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: #f8fbff;
}

.domain-tabs button,
.monitor-tabs button,
.analysis-tabs button,
.dns-tabs button,
.segmented button {
  border-radius: 11px;
  box-shadow: none;
}

.domain-tabs button.active,
.monitor-tabs button.active,
.analytics-filters button.active,
.analysis-tabs button.active,
.dns-tabs button.active,
.segmented button.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.segmented,
.analytics-filters,
.analysis-toolbar {
  border-radius: 14px;
  border-color: #dbe5f1;
  background: #f8fbff;
}

.origin-mode-card {
  border-radius: 16px;
  background: #fff;
}

.origin-mode-card:has(input:checked) {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.10);
}

.modal {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.modal-panel {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  padding: 18px 22px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.modal-head h2 {
  color: #0f172a;
  font-size: 18px;
}

.icon-button {
  box-shadow: none;
}

.chart-card canvas {
  border-radius: 12px;
}

.summary-card strong {
  letter-spacing: -0.04em;
}

.l4-intro-card {
  overflow: hidden;
  position: relative;
}

.l4-intro-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 68%);
}

.l4-table {
  min-width: 1120px;
}

.l4-table th:first-child,
.l4-table td:first-child {
  min-width: 180px;
  width: 180px;
  white-space: nowrap;
}

.l4-table th:nth-child(2),
.l4-table td:nth-child(2),
.l4-table th:nth-child(3),
.l4-table td:nth-child(3) {
  min-width: 140px;
}

.dispatch-groups-table {
  min-width: 1080px;
}

.dispatch-groups-table th:first-child,
.dispatch-groups-table td:first-child {
  min-width: 180px;
  width: 180px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.node-form > label > .checkbox-grid {
  grid-column: 2;
}

.node-form > label > span {
  grid-column: 2;
  display: block;
  margin-top: -2px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.node-form .form-field {
  display: grid;
  gap: 8px;
}

.node-form .form-field.full-span {
  grid-column: 1 / -1;
}

.node-form .field-label {
  color: #475569;
  font-weight: 800;
  line-height: 1.4;
}

.node-form .form-field small {
  color: #64748b;
  line-height: 1.5;
}

.choice-pill {
  margin: 0;
}

.choice-pill span {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.choice-pill small {
  color: #64748b;
  font-weight: 600;
}

.code-block {
  overflow-x: auto;
  margin: 12px 0 0;
  padding: 16px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

.portal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(20, 184, 166, 0.20), transparent 30%),
    #f4f8ff;
  color: #0f172a;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.portal-nav nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-nav a {
  color: #334155;
  text-decoration: none;
}

.portal-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

.portal-hero,
.portal-card,
.portal-grid article {
  border: 1px solid rgba(203, 216, 234, 0.78);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
}

.portal-hero {
  padding: clamp(34px, 7vw, 76px);
}

.portal-hero h1 {
  max-width: 760px;
  margin: 10px 0 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

.portal-hero p {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.8;
}

.portal-grid,
.portal-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.portal-grid article,
.portal-card {
  padding: 24px;
}

.portal-price-grid div {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

.portal-price-grid b {
  color: #2563eb;
  font-size: 22px;
}

.input-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.login-tip {
  margin: 10px 0 0;
  text-align: center;
}

@media (max-width: 760px) {
  .portal-nav,
  .portal-nav nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-grid,
  .portal-price-grid,
  .input-button-row {
    grid-template-columns: 1fr;
  }
}

.login-body {
  background:
    radial-gradient(circle at 18% 18%, rgba(20, 184, 166, 0.28), transparent 28%),
    radial-gradient(circle at 84% 0%, rgba(99, 102, 241, 0.30), transparent 34%),
    linear-gradient(135deg, #07111f 0%, #0f172a 55%, #111827 100%);
}

.login-shell {
  position: relative;
}

.login-shell::before {
  content: "商业安全加速平台";
  display: block;
  margin-bottom: 18px;
  color: rgba(226, 232, 240, 0.82);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-panel {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.login-brand {
  justify-content: center;
  text-align: left;
}

@media (max-width: 980px) {
  .sidebar {
    position: relative;
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  nav a,
  .nav-group-toggle {
    text-align: left;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .topbar {
    padding: 18px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  nav {
    grid-template-columns: 1fr;
  }
}

/* Commercial console density fixes: keep these overrides last. */
.nav-group-toggle {
  gap: 12px !important;
  padding-right: 14px !important;
}

.nav-group-toggle::after {
  content: "" !important;
  position: static !important;
  display: inline-block !important;
  width: 7px !important;
  height: 7px !important;
  margin-left: auto !important;
  flex: 0 0 7px !important;
  border-right: 2px solid #94a3b8 !important;
  border-bottom: 2px solid #94a3b8 !important;
  transform: rotate(-45deg) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.nav-group.open .nav-group-toggle::after {
  transform: rotate(45deg) !important;
}

nav a,
.nav-group-toggle,
.nav-submenu a {
  min-width: 0 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left !important;
}

.topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
  padding: 10px 14px !important;
  border-radius: 16px !important;
}

.topbar::before {
  display: none !important;
}

.topbar h1 {
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
}

#configText {
  display: none !important;
}

.topbar-actions {
  margin-left: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.topbar-actions button,
.topbar-actions .button-link {
  min-height: 32px !important;
  padding: 7px 11px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

.domain-list,
.overview-grid {
  width: 100% !important;
  max-width: 1480px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.overview-wide,
.overview-kpi-card,
.overview-hero,
.table-card {
  grid-column: 1 / -1 !important;
}

.metrics {
  grid-template-columns: repeat(3, minmax(140px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}

.metrics div,
.quota-grid div,
.commercial-stat {
  min-height: auto !important;
  padding: 14px 16px !important;
}

.metrics span,
.quota-grid span,
.commercial-stat span {
  margin-bottom: 6px !important;
}

.metrics strong,
.quota-grid strong,
.commercial-stat strong {
  font-size: clamp(18px, 1.7vw, 26px) !important;
  line-height: 1.15 !important;
}

.quota-grid,
.commercial-stat-grid,
.compact-stat-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
  gap: 12px !important;
}

.overview-kpi-card .compact-stat-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) !important;
}

.l4-intro-card .quota-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
  gap: 14px !important;
}

.domain-card {
  padding: 18px !important;
}

@media (max-width: 1180px) {
  .overview-grid,
  .settings-grid,
  .quota-grid,
  .commercial-stat-grid,
  .compact-stat-grid,
  .overview-kpi-card .compact-stat-grid,
  .l4-intro-card .quota-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .topbar-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .metrics,
  .overview-grid,
  .settings-grid,
  .quota-grid,
  .commercial-stat-grid,
  .compact-stat-grid,
  .overview-kpi-card .compact-stat-grid,
  .l4-intro-card .quota-grid {
    grid-template-columns: 1fr !important;
  }
}

/* P0 商用控制台菜单可读性修复：放在文件末尾覆盖历史主题块，避免中文菜单被窄栏挤成逐字竖排。 */
.app-shell {
  grid-template-columns: minmax(304px, 320px) minmax(0, 1fr);
}

.sidebar {
  width: 304px;
  min-width: 304px;
  padding-left: 16px;
  padding-right: 16px;
}

nav,
.nav-submenu {
  display: grid;
  grid-template-columns: 1fr;
}

nav a,
.nav-group-toggle,
.nav-submenu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

nav a,
.nav-group-toggle {
  justify-content: flex-start;
  padding-right: 34px;
}

.nav-group-toggle::after {
  margin-left: auto;
  flex: none;
}

.nav-submenu {
  margin-left: 0;
  padding-left: 18px;
}

.nav-submenu a {
  margin-left: 0;
  padding-left: 30px;
  font-size: 14px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 288px minmax(0, 1fr);
  }

  .sidebar {
    width: 288px;
    min-width: 288px;
  }
}

.l4-editor-card label:has(input[name="rateLimitPerMinute"]) {
  display: none !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
  }

  nav a,
  .nav-group-toggle,
  .nav-submenu a {
    white-space: normal;
  }
}

.commercial-site-overview {
  border-color: #dcecff;
  background:
    radial-gradient(circle at 96% 8%, rgba(22, 119, 255, 0.10), transparent 28%),
    linear-gradient(135deg, rgba(22, 119, 255, 0.08), rgba(255, 255, 255, 0.94) 42%),
    #fff;
}

.commercial-site-overview .section-head,
.domain-manage-head,
.embedded-section-head {
  align-items: flex-start;
}

.commercial-site-stats {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-top: 14px;
}

.stack-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
  line-height: 1.45;
}

.stack-cell code,
.stack-cell small,
.stack-cell span {
  overflow-wrap: anywhere;
}

.stack-cell strong {
  color: #102033;
  font-weight: 800;
}

.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.copy-inline code {
  min-width: 0;
}

.copy-inline-button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
}

.copy-inline-button:hover {
  background: #dbeafe;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.copy-field label {
  min-width: 0 !important;
}

.copy-field button {
  min-height: 38px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
  min-width: 190px;
}

.table-actions button {
  flex: 0 0 auto;
}

.domain-commercial-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.domain-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 10px;
  border: 1px solid #e2eaf5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(16, 32, 51, 0.06);
}

.domain-tabs button {
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

.domain-tabs button.active {
  border-color: #bfdbfe;
  background: #eaf3ff;
}

.domain-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.domain-section-title {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e2eaf5;
  border-radius: 16px;
  background: #f8fbff;
}

.domain-section-title h3,
.domain-section-title p {
  margin: 0;
}

.domain-section-title p,
.muted {
  color: #65758b;
}

.success {
  color: #16a34a;
}

.danger {
  color: #dc2626;
}

.embedded-table-card {
  padding: 0;
  overflow-x: auto;
}

.embedded-section-head {
  padding: 16px;
  border-bottom: 1px solid #e2eaf5;
}

.embedded-table-card .site-table {
  min-width: 820px;
}

@media (max-width: 1180px) {
  .commercial-site-stats,
  .domain-commercial-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .commercial-site-stats,
  .domain-commercial-summary,
  .domain-overview-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .domain-tabs {
    position: static;
  }
}

/* Light Cloud Console UI v2 */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #102033;
  --muted: #718096;
  --line: #e4eaf3;
  --accent: #1677ff;
  --accent-dark: #0958d9;
  --brand: #1677ff;
  --brand-2: #06b6d4;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 51, 0.04), 0 8px 24px rgba(16, 32, 51, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 32, 51, 0.05), 0 16px 38px rgba(16, 32, 51, 0.09);
  --shadow-lg: 0 28px 80px rgba(16, 32, 51, 0.16);
}

body {
  background:
    linear-gradient(90deg, rgba(22, 119, 255, 0.055) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 119, 255, 0.045) 0 1px, transparent 1px),
    linear-gradient(180deg, #f9fbff 0%, #f3f6fb 48%, #edf2f8 100%);
  background-size: 32px 32px, 32px 32px, auto;
  color: var(--text);
}

.app-shell {
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid #e5edf6;
  box-shadow: 8px 0 30px rgba(16, 32, 51, 0.05);
}

.brand {
  margin: 0 6px 18px;
  padding: 10px 8px 18px;
  border-bottom: 1px solid #edf2f7;
  color: #102033;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #06b6d4);
  box-shadow: 0 12px 22px rgba(22, 119, 255, 0.20);
}

.brand span {
  color: #7b8798;
}

nav {
  gap: 5px;
}

nav a,
.nav-group-toggle {
  min-height: 42px;
  padding: 10px 12px 10px 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #42526e;
  box-shadow: none;
  font-weight: 700;
}

nav a::before,
.nav-group-toggle::before {
  left: 13px;
  color: #5b7fb4;
  filter: none;
  opacity: 1;
}

nav a.active,
nav a:hover,
.nav-group.open .nav-group-toggle,
.nav-group-toggle:hover {
  background: #eef6ff;
  color: #0958d9;
  box-shadow: none;
}

nav a.active::after {
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 4px;
  background: #1677ff;
  box-shadow: none;
}

.nav-submenu a {
  color: #51647d;
  background: transparent;
}

.nav-submenu a:hover,
.nav-submenu a.active {
  background: #f3f8ff;
  color: #0958d9;
}

.overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-hero {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background:
    radial-gradient(circle at 10% 0%, rgba(22, 119, 255, 0.14), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.12), transparent 28%),
    #ffffff;
}

.overview-hero h2,
.commercial-module-card h2 {
  margin: 6px 0 8px;
  color: #102033;
  font-size: 24px;
}

.overview-hero p,
.commercial-module-card p {
  max-width: 760px;
  margin: 0;
  color: #607086;
  line-height: 1.7;
}

.overview-user-card {
  min-width: 210px;
  padding: 18px;
  border: 1px solid #d9e8ff;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.overview-user-card strong,
.overview-user-card span,
.overview-user-card small {
  display: block;
}

.overview-user-card strong {
  color: #0b4fc7;
  font-size: 22px;
}

.overview-user-card span {
  margin-top: 8px;
  color: #102033;
  font-weight: 800;
}

.overview-user-card small {
  margin-top: 6px;
  color: #607086;
}

.overview-wide {
  grid-column: 1 / -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0b63ce;
  font-size: 12px;
  font-weight: 800;
}

.commercial-stat-grid,
.commercial-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.commercial-stat,
.commercial-feature {
  padding: 14px;
  border: 1px solid #e4edf8;
  border-radius: 14px;
  background: #f8fbff;
}

.commercial-stat span,
.commercial-feature span {
  display: block;
  color: #65758b;
  font-size: 13px;
}

.commercial-stat strong,
.commercial-feature strong {
  display: block;
  margin-top: 8px;
  color: #102033;
  font-size: 18px;
  font-weight: 900;
}

.commercial-feature strong {
  color: #1677ff;
  font-size: 16px;
}

.security-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.security-summary-card {
  padding: 14px;
  border: 1px solid #e4edf8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 32, 51, 0.05);
}

.security-summary-card h3 {
  margin: 0 0 10px;
  color: #102033;
  font-size: 15px;
}

.mini-table th,
.mini-table td {
  padding: 8px;
  font-size: 12px;
}

.commercial-module-card {
  border-color: #dcecff;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.08), transparent 38%),
    #ffffff;
}

.commercial-module-card .section-head {
  align-items: flex-start;
}

.nav-group-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #7d93b2;
  border-bottom: 2px solid #7d93b2;
  transform: rotate(-45deg);
  margin-left: auto;
  flex: none;
}

main {
  padding: 24px 30px 40px;
}

.topbar {
  padding: 20px 22px;
  border: 1px solid #e2eaf5;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 119, 255, 0.10), transparent 30%),
    #ffffff;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.topbar::before {
  display: none;
}

h1 {
  color: #102033;
  font-size: 28px;
  letter-spacing: -0.03em;
}

button {
  border-radius: 9px;
  background: linear-gradient(180deg, #2486ff, #1677ff);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.18);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.22);
}

button.secondary,
.button-link.secondary,
.analysis-toolbar button.secondary,
.analytics-filters button.secondary {
  border: 1px solid #d8e2ef;
  background: #ffffff;
  color: #335c9f;
  box-shadow: 0 1px 2px rgba(16, 32, 51, 0.04);
}

button.danger {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #dc2626;
}

.metrics {
  gap: 14px;
}

.metrics div,
.domain-card,
.dns-panel,
.analytics-panel,
.chart-card,
.summary-card,
.quota-grid div,
.settings-note {
  border: 1px solid #e2eaf5;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.metrics div {
  padding: 17px 18px;
}

.metrics div::after {
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.10), rgba(6, 182, 212, 0.10));
}

.metrics span {
  color: #6b7c93;
  font-size: 13px;
}

.metrics strong {
  color: #102033;
  font-size: 28px;
}

.domain-card {
  padding: 18px;
}

.domain-card:hover {
  box-shadow: var(--shadow-sm);
}

.table-card {
  border-radius: 16px;
}

.list-toolbar,
.site-table th {
  background: #f8fbff;
}

.site-table th {
  color: #6b7c93;
  font-size: 12px;
}

.site-table tbody tr:hover {
  background: #f6faff;
}

input,
select,
textarea {
  border-color: #d9e4f2;
  border-radius: 10px;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

input[type="checkbox"],
input[type="radio"] {
  border-color: #b8c8dc;
  box-shadow: none;
  accent-color: #1677ff;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  border-color: #e0e9f5;
  border-radius: 12px;
  background: #ffffff;
}

label:has(> input[type="checkbox"]:checked),
label:has(> input[type="radio"]:checked) {
  border-color: #9dccff;
  background: #f0f7ff;
  color: #0958d9;
  box-shadow: none;
}

.domain-tabs {
  padding: 6px;
  border-color: #e1eaf5;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(226, 234, 245, 0.35);
}

.domain-tabs button,
.monitor-tabs button,
.analysis-tabs button,
.dns-tabs button,
.segmented button {
  border-radius: 9px;
  color: #42526e;
}

.domain-tabs button.active,
.monitor-tabs button.active,
.analytics-filters button.active,
.analysis-tabs button.active,
.dns-tabs button.active,
.segmented button.active {
  background: #1677ff;
  color: #fff;
  box-shadow: 0 7px 16px rgba(22, 119, 255, 0.18);
}

.status {
  border-radius: 999px;
  font-weight: 800;
}

.status.ready,
.status.installed,
.status.issued,
.ok-pill,
.status.hit {
  background: #eaf8f0;
  color: #15803d;
  border-color: #c7efd6;
}

.status.pending_cname,
.status.cloudflare_pending,
.status.pending,
.status.installing,
.status.issuing,
.status.renewing,
.status.miss,
.status.bypass {
  background: #fff7e6;
  color: #b45309;
  border-color: #fde7b7;
}

.status.paused {
  background: #f2f5f9;
  color: #5f6f83;
  border-color: #e0e7ef;
}

.status.offline,
.status.error,
.bad-pill {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.field code,
.site-table code,
.port-badges code {
  border-color: #d6e8ff;
  border-radius: 8px;
  background: #f3f8ff;
  color: #0958d9;
}

.modal {
  background: rgba(16, 32, 51, 0.45);
  backdrop-filter: blur(8px);
}

.modal-panel {
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  background: #f9fbff;
}

.login-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(22, 119, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(6, 182, 212, 0.18), transparent 26%),
    linear-gradient(180deg, #f9fbff 0%, #edf4fc 100%);
}

.login-shell::before {
  color: #5c6f89;
}

.login-panel {
  border-color: #e2eaf5;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  color: #102033;
}

.security-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.security-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid #e2eaf5;
}

/* 20261008 cyber login */
.login-body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  color: #e9fbff;
  background:
    radial-gradient(circle at 73% 8%, rgba(38, 194, 255, 0.10), transparent 24%),
    radial-gradient(circle at 19% 26%, rgba(0, 209, 255, 0.16), transparent 30%),
    radial-gradient(circle at 88% 92%, rgba(95, 99, 255, 0.22), transparent 34%),
    linear-gradient(115deg, #021a2b 0%, #061b34 44%, #061326 73%, #090f25 100%);
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(80, 214, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 214, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, rgba(0, 0, 0, 0.75) 42%, transparent 88%);
}

.login-body::after {
  content: "";
  position: fixed;
  width: min(720px, 58vw);
  aspect-ratio: 1;
  top: -80px;
  left: 47%;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.40;
  background:
    radial-gradient(circle at 50% 50%, transparent 53%, rgba(37, 197, 255, 0.18) 54%, transparent 56%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 38px, rgba(71, 199, 255, 0.055) 39px 40px),
    repeating-linear-gradient(28deg, transparent 0 42px, rgba(65, 204, 255, 0.055) 43px 44px),
    repeating-linear-gradient(145deg, transparent 0 58px, rgba(65, 204, 255, 0.05) 59px 60px);
  filter: blur(0.2px);
}

.login-shell.login-shell-modern,
.login-shell {
  width: min(1180px, calc(100vw - 48px));
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(380px, 430px);
  gap: 56px;
  align-items: center;
  justify-content: center;
}

.login-shell.login-shell-modern::before,
.login-shell::before {
  display: none;
}

.login-hero-panel {
  display: grid;
  gap: 26px;
  align-content: center;
}

.login-kicker {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #52f1ff;
  border: 1px solid rgba(69, 218, 255, 0.46);
  border-radius: 999px;
  background: rgba(5, 28, 50, 0.42);
  box-shadow: 0 0 26px rgba(15, 198, 255, 0.22), inset 0 0 20px rgba(63, 218, 255, 0.08);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-kicker i,
.login-status-strip i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #42f3c4;
  box-shadow: 0 0 0 6px rgba(66, 243, 196, 0.18), 0 0 18px rgba(66, 243, 196, 0.75);
}

.login-hero-panel h1 {
  margin: 0;
  color: #28dfff;
  font-size: 68px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(29, 213, 255, 0.45);
}

.login-hero-subtitle {
  margin: -10px 0 0;
  color: #3cecff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(61, 236, 255, 0.30);
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
}

.login-feature-grid article {
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid rgba(81, 202, 255, 0.16);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(7, 27, 52, 0.72), rgba(5, 20, 41, 0.48));
  box-shadow: inset 0 0 28px rgba(44, 193, 255, 0.035), 0 18px 46px rgba(0, 0, 0, 0.20);
}

.login-feature-grid b {
  display: block;
  margin-bottom: 8px;
  color: #11d5ff;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(17, 213, 255, 0.55);
}

.login-feature-grid strong {
  display: block;
  color: #f2fbff;
  font-size: 17px;
  margin-bottom: 6px;
}

.login-feature-grid span {
  color: rgba(205, 226, 238, 0.72);
  font-size: 14px;
}

.login-status-strip {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 17px;
  border: 1px solid rgba(72, 202, 255, 0.16);
  border-radius: 999px;
  color: rgba(225, 243, 250, 0.78);
  background: rgba(3, 21, 41, 0.54);
  box-shadow: 0 0 24px rgba(28, 174, 255, 0.10);
}

.login-status-strip span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-right: 18px;
  border-right: 1px solid rgba(91, 214, 255, 0.18);
}

.login-status-strip span:last-child {
  border-right: 0;
  padding-right: 0;
}

.login-status-strip strong {
  color: #48f4ff;
}

.login-panel.login-console-card,
.login-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 34px 38px 30px;
  border-radius: 23px;
  border: 1px solid rgba(120, 218, 255, 0.28);
  background:
    linear-gradient(150deg, rgba(43, 108, 139, 0.58), rgba(10, 43, 73, 0.74) 46%, rgba(19, 55, 101, 0.70));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 0 46px rgba(43, 205, 255, 0.17);
  backdrop-filter: blur(18px);
}

.login-panel.login-console-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 12%, rgba(78, 231, 255, 0.18), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 42%);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  justify-content: start;
  margin-bottom: 26px;
  text-align: left;
  color: #f2fbff;
}

.login-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #20b7ff, #7a5cff);
  box-shadow: 0 0 28px rgba(77, 184, 255, 0.44);
}

.login-brand em {
  display: block;
  margin: 3px 0 20px;
  color: rgba(228, 246, 255, 0.62);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.login-brand strong {
  display: block;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.10);
}

.login-brand span {
  display: block;
  color: rgba(225, 237, 246, 0.72);
  font-size: 14px;
}

.login-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.login-field {
  position: relative;
  display: block;
  margin: 0;
}

.login-field-icon {
  position: absolute;
  left: 19px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(87, 221, 255, 0.78);
  font-size: 18px;
  z-index: 1;
}

.login-form input {
  width: 100%;
  height: 60px;
  border: 1px solid rgba(125, 229, 255, 0.26);
  border-radius: 12px;
  padding: 0 18px 0 54px;
  color: #eefdff;
  font-size: 16px;
  background: rgba(7, 31, 57, 0.36);
  box-shadow: inset 0 0 24px rgba(17, 177, 255, 0.045);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input::placeholder {
  color: rgba(216, 235, 245, 0.48);
}

.login-form input:focus {
  border-color: rgba(39, 217, 255, 0.86);
  background: rgba(8, 39, 71, 0.58);
  box-shadow: 0 0 0 4px rgba(26, 193, 255, 0.10), 0 0 24px rgba(23, 204, 255, 0.18);
}

.login-form button {
  height: 62px;
  border: 0;
  border-radius: 12px;
  margin-top: 3px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(100deg, #24b7f7 0%, #20aef0 42%, #7a5cff 100%);
  box-shadow: 0 18px 42px rgba(45, 159, 255, 0.30), 0 0 30px rgba(118, 92, 255, 0.22);
}

.login-form button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.login-message {
  min-height: 18px;
  margin: -8px 0 0;
  color: #ff6b8b;
  font-size: 13px;
  font-weight: 700;
}

.login-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  color: rgba(217, 237, 246, 0.62);
  font-size: 14px;
}

.login-card-footer a,
.login-tip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(107, 223, 255, 0.18);
  border-radius: 999px;
  color: #dff9ff;
  text-decoration: none;
  background: rgba(46, 139, 183, 0.24);
}

.brand-footer {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(217, 237, 246, 0.45);
}

@media (max-width: 980px) {
  .login-shell.login-shell-modern,
  .login-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(620px, calc(100vw - 32px));
  }

  .login-hero-panel {
    text-align: center;
  }

  .login-kicker,
  .login-status-strip {
    justify-self: center;
  }

  .login-feature-grid {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .login-body {
    padding: 28px 16px;
  }

  .login-hero-panel h1 {
    font-size: 42px;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
  }

  .login-panel.login-console-card,
  .login-panel {
    padding: 28px 22px 24px;
  }

  .login-card-footer,
  .login-status-strip {
    flex-wrap: wrap;
  }
}
.security-card {
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.security-card h3 {
  margin: 0;
  color: #102033;
  font-size: 15px;
}

.security-card-wide,
.security-note {
  grid-column: 1 / -1;
}

.security-switch-row {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.security-card > label {
  min-width: 0;
}

.security-card textarea {
  min-height: 118px;
}

.security-card-wide textarea {
  min-height: 260px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.security-note {
  line-height: 1.8;
}

@media (max-width: 980px) {
  .sidebar {
    position: relative;
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .security-layout,
  .security-switch-row {
    grid-template-columns: 1fr;
  }
}

/* Production UI final overrides: must stay at the end of the file. */
.app-shell {
  grid-template-columns: minmax(304px, 320px) minmax(0, 1fr) !important;
}

.sidebar {
  width: 304px !important;
}

nav a,
.nav-group-toggle,
.nav-submenu a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  width: 100% !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
}

.nav-group-toggle {
  justify-content: flex-start !important;
  padding-right: 14px !important;
}

.nav-group-toggle::after {
  content: "" !important;
  position: static !important;
  display: inline-block !important;
  width: 7px !important;
  height: 7px !important;
  margin-left: auto !important;
  flex: 0 0 7px !important;
  border: 0 !important;
  border-right: 2px solid #94a3b8 !important;
  border-bottom: 2px solid #94a3b8 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: rotate(-45deg) !important;
}

.nav-group.open .nav-group-toggle::after {
  transform: rotate(45deg) !important;
}

main {
  padding: 18px 26px 36px !important;
}

.topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
  padding: 10px 14px !important;
  border-radius: 16px !important;
}

.topbar h1 {
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
}

#configText {
  display: none !important;
}

.topbar-actions {
  margin-left: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.topbar-actions button,
.topbar-actions .button-link {
  min-height: 32px !important;
  padding: 7px 11px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

.commercial-metrics-hidden .metrics,
.metrics[hidden] {
  display: none !important;
}

.domain-list,
.overview-grid {
  width: 100% !important;
  max-width: 1480px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.metrics {
  grid-template-columns: repeat(3, minmax(140px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}

.metrics div,
.quota-grid div,
.commercial-stat,
.commercial-feature {
  min-height: auto !important;
  padding: 14px 16px !important;
}

.metrics span,
.quota-grid span,
.commercial-stat span,
.commercial-feature span {
  margin-bottom: 6px !important;
}

.metrics strong,
.quota-grid strong,
.commercial-stat strong,
.commercial-feature strong {
  font-size: clamp(18px, 1.7vw, 26px) !important;
  line-height: 1.15 !important;
}

.quota-grid,
.commercial-stat-grid,
.commercial-feature-grid,
.compact-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
  gap: 12px !important;
}

.overview-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.overview-wide,
.overview-kpi-card,
.overview-hero,
.table-card {
  grid-column: 1 / -1 !important;
}

.overview-kpi-card .compact-stat-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) !important;
}

.l4-intro-card .quota-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
}

.settings-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
  gap: 14px !important;
}

.domain-card {
  padding: 18px !important;
}

.domain-card > .section-head,
.table-card > .section-head {
  gap: 12px !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 288px minmax(0, 1fr) !important;
  }

  .sidebar {
    width: 288px !important;
  }

  .overview-grid,
  .settings-grid,
  .quota-grid,
  .commercial-stat-grid,
  .commercial-feature-grid,
  .compact-stat-grid,
  .overview-kpi-card .compact-stat-grid,
  .l4-intro-card .quota-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    width: auto !important;
  }

  .topbar {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .topbar-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .metrics,
  .overview-grid,
  .settings-grid,
  .quota-grid,
  .commercial-stat-grid,
  .commercial-feature-grid,
  .compact-stat-grid,
  .overview-kpi-card .compact-stat-grid,
  .l4-intro-card .quota-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Batch/security form readability overrides. */
.node-form,
.settings-form.batch-form {
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
  gap: 16px 22px !important;
  align-items: start !important;
}

.node-form > label,
.settings-form.batch-form > label,
.security-card > label {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
  gap: 6px 18px !important;
  grid-column: 1 / -1 !important;
  align-items: start !important;
  color: #334155 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.node-form > label > input:not([type="checkbox"]):not([type="radio"]),
.node-form > label > select,
.node-form > label > textarea,
.settings-form.batch-form > label > input:not([type="checkbox"]):not([type="radio"]),
.settings-form.batch-form > label > select,
.settings-form.batch-form > label > textarea,
.security-card > label > input:not([type="checkbox"]):not([type="radio"]),
.security-card > label > select,
.security-card > label > textarea {
  grid-column: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
}

.node-form > label > textarea,
.settings-form.batch-form > label > textarea,
.security-card > label > textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
  line-height: 1.55 !important;
  resize: vertical !important;
}

.node-form > label > span,
.node-form > label > small,
.settings-form.batch-form > label > span,
.settings-form.batch-form > label > small,
.security-card > label > span,
.security-card > label > small {
  grid-column: 1 !important;
  display: block !important;
  margin-top: 2px !important;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.node-form > label > strong,
.settings-form.batch-form > label > strong,
.security-card > label > strong {
  display: block !important;
  color: #102033 !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.node-form > label:has(> input[type="checkbox"]),
.node-form > label:has(> input[type="radio"]),
.settings-form.batch-form > label:has(> input[type="checkbox"]),
.settings-form.batch-form > label:has(> input[type="radio"]),
.security-card > label:has(> input[type="checkbox"]),
.security-card > label:has(> input[type="radio"]) {
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
  align-items: center !important;
}

.node-form > label > input[type="checkbox"],
.node-form > label > input[type="radio"],
.settings-form.batch-form > label > input[type="checkbox"],
.settings-form.batch-form > label > input[type="radio"],
.security-card > label > input[type="checkbox"],
.security-card > label > input[type="radio"] {
  grid-column: 2 !important;
  justify-self: start !important;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
}

.node-form > label.switch-row,
.settings-form.batch-form > label.switch-row,
.security-card > label.switch-row {
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
  align-items: center !important;
}

.node-form > label.switch-row > span,
.settings-form.batch-form > label.switch-row > span,
.security-card > label.switch-row > span {
  grid-column: 1 !important;
  display: grid !important;
  gap: 3px !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #334155 !important;
}

.node-form > label.switch-row > span::after,
.settings-form.batch-form > label.switch-row > span::after,
.security-card > label.switch-row > span::after {
  content: none !important;
}

.node-form > label.switch-row > span strong,
.settings-form.batch-form > label.switch-row > span strong,
.security-card > label.switch-row > span strong {
  display: block !important;
  color: #102033 !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.node-form > label.switch-row > span small,
.settings-form.batch-form > label.switch-row > span small,
.security-card > label.switch-row > span small {
  display: block !important;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.node-form > label.switch-row > input,
.settings-form.batch-form > label.switch-row > input,
.security-card > label.switch-row > input {
  position: static !important;
  opacity: 1 !important;
  grid-column: 2 !important;
  justify-self: start !important;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
}

.node-form .security-card,
.node-form .security-card-wide,
.node-form .settings-note,
.node-form .checkbox-grid,
.node-form .modal-actions {
  grid-column: 1 / -1 !important;
}

.node-form .security-card > label,
.security-card.security-card-wide > label {
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) !important;
}

.security-card-wide textarea,
.node-form textarea[name*="Rules"],
.node-form textarea[name*="Config"],
.node-form textarea[name*="Ips"],
.node-form textarea[name*="Referers"],
.node-form textarea[name*="errorPage"] {
  min-height: 150px !important;
}

.node-form textarea[name*="Rules"],
.node-form textarea[name*="Config"] {
  min-height: 260px !important;
}

#nodeForm .dispatch-group-choices {
  grid-column: 2 !important;
}

@media (max-width: 860px) {
  .node-form,
  .settings-form.batch-form,
  .node-form > label,
  .settings-form.batch-form > label,
  .security-card > label,
  .node-form > label.switch-row,
  .settings-form.batch-form > label.switch-row,
  .security-card > label.switch-row,
  .node-form .security-card > label,
  .security-card.security-card-wide > label {
    grid-template-columns: 1fr !important;
  }

  .node-form > label > input,
  .node-form > label > select,
  .node-form > label > textarea,
  .node-form > label > span,
  .node-form > label > small,
  .settings-form.batch-form > label > input,
  .settings-form.batch-form > label > select,
  .settings-form.batch-form > label > textarea,
  .settings-form.batch-form > label > span,
  .settings-form.batch-form > label > small,
  .security-card > label > input,
  .security-card > label > select,
  .security-card > label > textarea,
  .security-card > label > span,
  .security-card > label > small,
  .node-form > label.switch-row > input,
  .node-form > label.switch-row > span,
  .settings-form.batch-form > label.switch-row > input,
  .settings-form.batch-form > label.switch-row > span,
  .security-card > label.switch-row > input,
  .security-card > label.switch-row > span {
    grid-column: 1 !important;
  }
}

/* Domain modal/tab layout fixes. */
.domain-manage-form {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
  align-items: start !important;
}

.domain-form-actions {
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 12px !important;
  border: 1px solid #dbeafe !important;
  border-radius: 8px !important;
  background: #f8fbff !important;
}

.domain-form-actions-sticky {
  position: sticky !important;
  top: 12px !important;
  z-index: 8 !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
}

.domain-form-actions-label {
  display: grid !important;
  gap: 2px !important;
  min-width: min(260px, 100%) !important;
  margin-right: auto !important;
  color: #0f172a !important;
}

.domain-form-actions-label small {
  color: #64748b !important;
  line-height: 1.35 !important;
}

.domain-manage-form > section,
.domain-manage-form > div,
.domain-manage-form > article {
  width: 100% !important;
  min-width: 0 !important;
}

.domain-tab-grid,
.domain-manage-form .settings-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

.domain-manage-form .settings-grid > label {
  min-width: 0 !important;
  display: grid !important;
  gap: 7px !important;
  align-content: start !important;
  color: #334155 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.domain-manage-form .settings-grid > label > input,
.domain-manage-form .settings-grid > label > select,
.domain-manage-form .settings-grid > label > textarea {
  width: 100% !important;
  min-width: 0 !important;
}

.domain-manage-form .settings-note {
  grid-column: 1 / -1 !important;
  position: static !important;
  clear: both !important;
  margin: 0 !important;
  line-height: 1.75 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.https-feature-section {
  display: grid;
  gap: 16px;
}

.https-feature-section .section-head {
  margin: 0;
  padding: 0;
  border: 0;
}

.https-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.https-feature-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 12px;
  border: 1px solid #d6dde8;
  border-radius: 6px;
  background: #fff;
  color: #102033;
}

.https-feature-card span {
  display: grid;
  gap: 8px;
}

.https-feature-card strong {
  font-size: 14px;
  font-weight: 800;
}

.https-feature-card small {
  color: #64748b;
  line-height: 1.5;
}

.https-feature-card input {
  position: absolute;
  opacity: 0;
}

.https-feature-card i {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: #cfd3da;
  transition: background 0.18s ease;
}

.https-feature-card i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.https-feature-card input:checked + i {
  background: var(--accent);
}

.https-feature-card input:checked + i::after {
  transform: translateX(22px);
}

.https-feature-card b {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f6feb;
  font-size: 12px;
}

.https-feature-card.is-pending b {
  background: #f1f5f9;
  color: #64748b;
}

.domain-security-layout {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

.security-overview-strip {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) !important;
  gap: 10px !important;
}

.security-overview-strip > div {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
  padding: 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

.security-overview-strip span {
  color: #64748b !important;
  font-size: 12px !important;
}

.security-overview-strip strong {
  min-width: 0 !important;
  color: #0f172a !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.security-overview-strip .text-ok {
  color: #047857 !important;
}

.security-overview-strip .text-muted {
  color: #64748b !important;
}

.security-quick-nav {
  position: sticky !important;
  top: 82px !important;
  z-index: 7 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
}

.domain-security-layout .security-card,
.domain-security-layout .settings-note {
  min-width: 0 !important;
}

.domain-security-layout .security-card {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
  scroll-margin-top: 144px !important;
}

.domain-security-layout .security-card h3 {
  display: flex !important;
  align-items: center !important;
  min-height: 28px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #eef2f7 !important;
}

.domain-security-layout .security-card-ip {
  order: 1 !important;
}

.domain-security-layout .security-card-region {
  order: 2 !important;
}

.domain-security-layout .security-card-waf-switch {
  order: 3 !important;
}

.domain-security-layout .security-card-autoblock {
  order: 4 !important;
}

.domain-security-layout .security-card-waf {
  order: 5 !important;
}

.domain-security-layout .security-card-hotlink {
  order: 6 !important;
}

.domain-security-layout .security-card-cc {
  order: 7 !important;
}

.domain-security-layout .security-card-cc-rules {
  order: 8 !important;
}

.domain-security-layout > .security-note {
  order: 9 !important;
}

.domain-security-layout .security-card-wide,
.domain-security-layout .security-note {
  grid-column: 1 / -1 !important;
}

.domain-security-layout .security-card > label {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
  gap: 6px 16px !important;
}

.domain-security-layout .security-card > label > small,
.domain-security-layout .security-card > label > span {
  grid-column: 1 / -1 !important;
}

.domain-security-layout .security-card > label > textarea,
.domain-security-layout .security-card > label > select,
.domain-security-layout .security-card > label > input:not([type="checkbox"]):not([type="radio"]) {
  grid-column: 2 !important;
}

.domain-security-layout .security-card-wide > label {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
}

.domain-security-layout .security-card-wide textarea[name="ccRules"],
.domain-security-layout textarea[name="wafConfigJson"] {
  min-height: 280px !important;
}

.domain-security-layout .button-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.domain-security-layout .security-card > label.switch-row {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
  align-items: center !important;
}

.domain-security-layout .security-card > label.switch-row > span {
  grid-column: 1 !important;
  display: grid !important;
  gap: 4px !important;
  margin: 0 !important;
}

.domain-security-layout .security-card > label.switch-row > input[type="checkbox"],
.domain-security-layout .security-card > label.switch-row > input[type="radio"] {
  grid-column: 2 !important;
  justify-self: start !important;
}

.security-policy-table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  margin: 12px 0 16px !important;
  clear: both !important;
}

.security-policy-table .section-head {
  min-width: 0 !important;
}

.security-policy-table .site-table,
.security-policy-table .mini-table {
  width: 100% !important;
  min-width: 520px !important;
  table-layout: fixed !important;
}

.security-policy-table th,
.security-policy-table td {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  vertical-align: middle !important;
}

.security-policy-table th:nth-child(1),
.security-policy-table td:nth-child(1) {
  width: 26% !important;
}

.security-policy-table th:nth-child(2),
.security-policy-table td:nth-child(2) {
  width: 28% !important;
}

.security-policy-table th:nth-child(3),
.security-policy-table td:nth-child(3) {
  width: 22% !important;
}

.security-policy-table th:nth-child(4),
.security-policy-table td:nth-child(4) {
  width: 24% !important;
}

.cache-task-panel {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  align-items: start !important;
  overflow-x: auto !important;
}

.cache-task-form {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(180px, 240px) minmax(320px, 1fr) auto !important;
  gap: 12px !important;
  align-items: end !important;
}

.cache-task-form label {
  min-width: 0 !important;
  display: grid !important;
  gap: 7px !important;
  color: #334155 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.cache-task-form textarea,
.cache-task-form select {
  width: 100% !important;
  min-width: 0 !important;
}

.cache-task-panel > .settings-note {
  position: static !important;
  grid-column: 1 !important;
  margin: 0 !important;
  line-height: 1.75 !important;
}

.cache-task-panel > table,
.cache-task-panel .cache-task-table {
  width: 100% !important;
  margin-top: 0 !important;
}

@media (max-width: 980px) {
  .domain-tab-grid,
  .domain-manage-form .settings-grid,
  .domain-security-layout,
  .cache-task-form {
    grid-template-columns: 1fr !important;
  }

  .domain-security-layout .security-card > label,
  .domain-security-layout .security-card-wide > label {
    grid-template-columns: 1fr !important;
  }

  .domain-security-layout .security-card > label > textarea,
  .domain-security-layout .security-card > label > select,
  .domain-security-layout .security-card > label > input,
  .domain-security-layout .security-card > label > small,
  .domain-security-layout .security-card > label > span {
    grid-column: 1 !important;
  }

  .security-overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .security-quick-nav {
    top: 96px !important;
  }
}

@media (max-width: 620px) {
  .domain-form-actions {
    align-items: stretch !important;
  }

  .domain-form-actions-label {
    flex-basis: 100% !important;
    margin-right: 0 !important;
  }

  .domain-form-actions button,
  .security-quick-nav button {
    flex: 1 1 140px !important;
  }

  .security-overview-strip {
    grid-template-columns: 1fr !important;
  }

  .security-quick-nav {
    position: static !important;
  }
}

/* L4 game forwarding form: isolate from generic settings-grid rules so
   labels, controls and help text stay aligned in add/edit forms. */
.l4-editor-card .settings-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.l4-editor-card .section-head {
  gap: 16px !important;
  align-items: flex-start !important;
}

.l4-form-section {
  display: grid !important;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
  gap: 14px 20px !important;
  padding: 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04) !important;
}

.l4-form-section-head {
  min-width: 0 !important;
}

.l4-form-section-head h4 {
  margin: 0 0 6px !important;
  color: #0f172a !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}

.l4-form-section-head p {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.65 !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.l4-form-grid {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(170px, 1fr)) !important;
  gap: 14px 16px !important;
  align-items: start !important;
}

.l4-basic-form-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.1fr) minmax(280px, 1.6fr) minmax(96px, 0.55fr) !important;
  align-items: start !important;
}

.l4-basic-form-grid [data-l4-origin-single],
.l4-basic-form-grid [data-l4-origin-weighted] {
  grid-column: span 2 !important;
}

.l4-basic-form-grid .l4-auto-port-card {
  grid-column: span 2 !important;
}

.l4-protection-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
}

.l4-list-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
}

.l4-form-field {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  align-content: start !important;
  color: #334155 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.l4-form-field[hidden] {
  display: none !important;
}

.l4-field-label {
  display: block !important;
  min-height: 18px !important;
  color: #1e293b !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.l4-form-field > input,
.l4-form-field > select,
.l4-form-field > textarea {
  width: 100% !important;
  min-width: 0 !important;
  grid-column: 1 !important;
  border-color: #dbe4ef !important;
  border-radius: 10px !important;
}

.l4-form-field > textarea {
  min-height: 122px !important;
  line-height: 1.55 !important;
  resize: vertical !important;
}

.l4-form-field > small {
  display: block !important;
  margin: 0 !important;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.l4-origin-server-grid {
  display: grid !important;
  gap: 8px !important;
  grid-column: 1 !important;
}

.l4-origin-server-row {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) 92px auto !important;
  gap: 8px !important;
  align-items: center !important;
}

.l4-origin-server-row input {
  width: 100% !important;
  min-width: 0 !important;
  border-color: #dbe4ef !important;
  border-radius: 10px !important;
}

.l4-origin-server-row input[name="originServerWeight"] {
  text-align: center !important;
}

.l4-add-origin-button,
.l4-remove-origin-button {
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

.l4-add-origin-button {
  justify-self: start !important;
  margin-top: 8px !important;
}

.l4-remove-origin-button {
  color: #b42318 !important;
  background: #fff1f2 !important;
}

.site-form > label .l7-origin-server-grid,
.site-form > label .l7-add-origin-button {
  grid-column: 2;
}

.settings-grid [data-l7-origin-weighted] {
  grid-column: 1 / -1;
}

.l4-list-grid .settings-note {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
  line-height: 1.7 !important;
  position: static !important;
}

.l4-hidden-legacy-field,
.l4-editor-card label:has(input[name="listenPort"]),
.l4-editor-card label:has(select[name="domainId"]) {
  display: none !important;
}

.l4-auto-port-card,
.l4-template-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.l4-auto-port-card {
  display: none !important;
}

.l4-auto-port-card span,
.l4-template-card span {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.l4-auto-port-card strong,
.l4-template-card strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.2;
}

.l4-auto-port-card small,
.l4-template-card small {
  color: #64748b;
  line-height: 1.55;
}

.l4-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.l4-template-card {
  position: relative;
  cursor: pointer;
  min-height: 132px;
}

.l4-template-card input {
  position: absolute;
  top: 14px;
  right: 14px;
}

.l4-template-card.active,
.l4-template-card:has(input:checked) {
  border-color: #2563eb;
  background: linear-gradient(135deg, #dbeafe, #ffffff);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.16);
}

@media (max-width: 1380px) {
  .l4-form-grid,
  .l4-protection-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr)) !important;
  }
}

.visual-rule-list {
  display: grid;
  gap: 12px;
}

.visual-rule-row {
  display: grid;
  grid-template-columns: 90px repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fbff;
}

.visual-rule-row label,
.waf-module-item {
  min-width: 0;
  display: grid !important;
  gap: 6px !important;
  color: #334155 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.visual-rule-row input,
.visual-rule-row select,
.waf-module-item select {
  width: 100% !important;
  min-width: 0 !important;
}

.cc-condition-editor,
.cc-execution-fields {
  grid-column: 1 / -1;
  min-width: 0;
}

.cc-condition-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(100px, 1fr) minmax(130px, 2fr) 36px;
  gap: 8px;
  margin: 8px 0;
}

.cc-condition-row > * {
  min-width: 0;
  width: 100%;
}

.cc-execution-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .cc-condition-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .cc-condition-row input { grid-column: 1 / 3; grid-row: 2; }
  .cc-condition-row button { grid-column: 3; grid-row: 1 / 3; }
}

.rule-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rule-order strong {
  width: 100%;
  color: #0f172a;
}

.empty-inline {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
}

.mini-actions {
  margin-top: 4px;
}

.waf-module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.waf-module-item {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.waf-ruleset-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  margin: 12px 0 18px;
}

.ruleset-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ruleset-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.waf-test-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

@media (max-width: 1280px) {
  .visual-rule-row,
  .waf-module-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 860px) {
  .visual-rule-row,
  .waf-module-grid,
  .waf-ruleset-layout,
  .ruleset-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .l4-form-section {
    grid-template-columns: 1fr !important;
  }

  .l4-form-grid,
  .l4-protection-grid,
  .l4-list-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .l4-form-grid,
  .l4-protection-grid,
  .l4-list-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Role-based visibility must override all production display utilities. */
[hidden],
.nav-group[hidden],
nav a[hidden],
.nav-group-toggle[hidden],
.nav-submenu[hidden],
.topbar-actions button[hidden],
.topbar-actions .button-link[hidden] {
  display: none !important;
}

.app-session-loading .sidebar nav {
  display: none !important;
}

.app-session-loading .sidebar::after {
  content: "菜单加载中...";
  display: block;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #64748b;
  background: rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

#aiAssistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  font-family: inherit;
}

.ai-fab {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  font-size: 25px;
}

.ai-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
}

.ai-panel.open {
  display: flex;
}

.ai-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.ai-header strong {
  display: block;
  font-size: 16px;
}

.ai-header span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.88;
}

.ai-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-size: 20px;
}

.ai-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow: auto;
  background: #f8fafc;
}

.ai-message {
  display: flex;
}

.ai-message.user {
  justify-content: flex-end;
}

.ai-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 16px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  white-space: pre-wrap;
  line-height: 1.55;
}

.ai-message.user .ai-bubble {
  color: #fff;
  background: #2563eb;
}

.ai-suggestions {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.ai-suggestions > span {
  color: #64748b;
  font-size: 12px;
}

.ai-suggestions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggestion {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 7px 11px;
  color: #1d4ed8;
  background: #eff6ff;
  cursor: pointer;
  font-size: 12px;
}

.ai-suggestion:hover {
  border-color: #60a5fa;
  background: #dbeafe;
}

.ai-suggestion:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ai-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.ai-form input {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 14px;
}

.ai-form button {
  border-radius: 999px;
  padding: 10px 16px;
}

.mini-chart {
  width: 100%;
  min-height: 180px;
  color: #2563eb;
  overflow: visible;
}

.mini-chart .chart-labels {
  fill: #64748b;
}

.install-cell {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.install-progress {
  width: 120px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.install-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.cert-progress-cell {
  display: grid;
  min-width: 180px;
  gap: 6px;
}

.cert-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.cert-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.cert-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #2563eb);
  transition: width 0.2s ease;
}

.cert-progress-reason {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.install-log-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.install-log-list {
  display: grid;
  gap: 8px;
}

.install-log-row {
  display: grid;
  grid-template-columns: 58px minmax(160px, 240px) 18px minmax(0, 1fr) 150px;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.install-log-row > * {
  min-width: 0;
}

.install-log-row.success .install-log-icon {
  color: #16a34a;
}

.install-log-row.failed .install-log-icon {
  color: #dc2626;
}

.install-log-row.recovered {
  border-color: #f6d58b;
  background: #fffbeb;
}

.install-log-row.recovered .install-log-icon {
  color: #b7791f;
}

.install-log-row.running .install-log-icon {
  color: #d97706;
}

.install-log-step {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.install-log-title {
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.install-log-row small,
.install-log-row time {
  color: #64748b;
}

.install-log-message {
  display: block;
  max-width: 100%;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.install-log-row time {
  justify-self: end;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 900px) {
  .install-log-row {
    grid-template-columns: 58px minmax(0, 1fr) 18px;
  }

  .install-log-message {
    grid-column: 1 / -1;
  }

  .install-log-row time {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }
}

.node-monitor-shell {
  display: grid;
  gap: 18px;
}

.node-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.node-summary-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.node-summary-item span,
.node-summary-item small {
  color: #64748b;
  font-size: 12px;
}

.node-summary-item strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1.1;
}

.node-summary-item.installed strong {
  color: #16a34a;
}

.node-summary-item.pending strong {
  color: #d97706;
}

.node-summary-item.error strong {
  color: #dc2626;
}

.node-monitor-filter {
  grid-template-columns: minmax(130px, 1.1fr) minmax(150px, 1.4fr) repeat(4, minmax(120px, 1fr)) auto auto;
}

.node-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.node-monitor-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
}

.node-monitor-card.online {
  border-color: #bbf7d0;
}

.node-monitor-card.warning {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fff, #fffbeb);
}

.node-monitor-card.error {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, #fff1f2);
}

.node-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.node-card-head h4 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 17px;
}

.node-card-head code {
  color: #2563eb;
  word-break: break-all;
}

.node-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.node-health-pill i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.node-health-pill.warning {
  color: #92400e;
  background: #fef3c7;
}

.node-health-pill.error {
  color: #991b1b;
  background: #fee2e2;
}

.node-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.node-card-meta span {
  min-width: 0;
}

.node-ip-select {
  width: min(100%, 180px);
  min-height: 28px;
  padding: 3px 28px 3px 8px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #0f5fbf;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.node-ip-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.node-latency-select {
  width: 100%;
  max-width: 190px;
  margin-top: 2px;
  border-radius: 10px;
  background: #fff;
  font-weight: 500;
}

.node-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.node-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.node-metric > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.node-metric span,
.node-metric small {
  color: #64748b;
  font-size: 12px;
}

.node-metric strong {
  color: #0f172a;
  font-size: 15px;
  word-break: break-word;
}

.upgrade-block-summary {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.upgrade-block-summary h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.upgrade-block-details {
  display: grid;
  gap: 4px;
  min-width: 220px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.upgrade-block-details.summary {
  min-width: 0;
  margin-top: 0;
}

.upgrade-block-details strong {
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}

.upgrade-block-details small {
  color: #78350f;
  line-height: 1.45;
}

.upgrade-block-details code {
  display: inline-block;
  margin: 1px 2px 1px 0;
  padding: 1px 4px;
  border-radius: 4px;
  background: #fef3c7;
  color: #78350f;
}

.node-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.node-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  transition: width 0.2s ease;
}

.node-progress.warn span {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.task-progress-cell {
  min-width: 120px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 4px;
}

.task-progress-cell strong {
  font-size: 12px;
}

.task-progress-cell .node-progress {
  height: 6px;
}

.node-metric-value {
  align-content: start;
}

.node-card-status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.node-card-status-row > * {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.node-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-card-actions button {
  padding: 7px 10px;
}

.dispatch-node-assignment-card {
  overflow: visible;
}

.dispatch-node-assignment-form {
  display: grid;
  gap: 16px;
}

.dispatch-node-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 360px) 1fr;
  gap: 14px;
  align-items: end;
}

.dispatch-node-toolbar label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

.dispatch-node-toolbar select,
.dispatch-node-toolbar input {
  min-height: 38px;
}

.dispatch-node-toolbar-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dispatch-node-toolbar-info span {
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}

.dispatch-node-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.dispatch-node-column {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  overflow: hidden;
}

.dispatch-node-column.assigned {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.dispatch-node-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.dispatch-node-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}

.dispatch-node-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dispatch-node-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.dispatch-node-card input {
  width: 16px;
  height: 16px;
}

.dispatch-node-main,
.dispatch-node-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dispatch-node-main strong,
.dispatch-node-main small,
.dispatch-node-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-node-main small,
.dispatch-node-meta small {
  color: #64748b;
}

.dispatch-node-meta {
  justify-items: end;
}

.empty-inline {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  text-align: center;
  background: #fff;
}

@media (max-width: 920px) {
  .l4-basic-form-grid {
    grid-template-columns: 1fr !important;
  }

  .l4-basic-form-grid [data-l4-origin-single],
  .l4-basic-form-grid [data-l4-origin-weighted],
  .l4-basic-form-grid .l4-auto-port-card {
    grid-column: 1 !important;
  }

  .l4-origin-server-row {
    grid-template-columns: minmax(0, 1fr) 80px auto !important;
  }

  .node-monitor-filter {
    grid-template-columns: 1fr 1fr;
  }

  .node-card-status-row,
  .node-metric-grid,
  .node-card-meta,
  .dispatch-node-columns,
  .dispatch-node-toolbar {
    grid-template-columns: 1fr;
  }

  .dispatch-node-toolbar-info {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  #aiAssistant {
    right: 14px;
    bottom: 14px;
  }

  .ai-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 86px;
    width: auto;
    height: 58vh;
    max-height: 58vh;
  }
}

/* 线路节点分配：按 cdnfly 左右分配方式优化显示，避免被通用表单样式压缩 */
.dispatch-node-assignment-card {
  padding: 22px !important;
}

.dispatch-node-assignment-card .section-head {
  margin-bottom: 14px !important;
}

.dispatch-node-assignment-card .section-head h3 {
  margin: 0 !important;
  font-size: 20px !important;
  color: #0f172a !important;
}

.dispatch-node-assignment-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
}

.dispatch-line-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 1px solid #dbeafe !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #f8fbff, #eff6ff) !important;
}

.dispatch-line-tabs button {
  min-width: 86px !important;
  padding: 9px 14px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #1e40af !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.dispatch-line-tabs button.active,
.dispatch-line-tabs button:hover {
  border-color: #2563eb !important;
  background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22) !important;
}

.dispatch-node-toolbar {
  order: 1 !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 360px) minmax(260px, 1fr) !important;
  align-items: end !important;
  gap: 14px !important;
  width: 100% !important;
}

.dispatch-node-toolbar.dispatch-node-toolbar-advanced {
  grid-template-columns: minmax(210px, 1.15fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(130px, 0.65fr) minmax(200px, 1fr) minmax(210px, 1.15fr) !important;
  align-items: end !important;
}

.dispatch-node-toolbar.dispatch-node-toolbar-advanced .dispatch-node-toolbar-info {
  grid-column: 1 / -1 !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding-top: 2px !important;
}

.dispatch-node-toolbar label {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  margin: 0 !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.dispatch-node-toolbar select,
.dispatch-node-toolbar input {
  width: 100% !important;
  min-height: 40px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
}

.dispatch-node-toolbar-info {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
}

.dispatch-node-toolbar-info span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.dispatch-node-columns {
  order: 2 !important;
  display: grid !important;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr) !important;
  gap: 18px !important;
  width: 100% !important;
}

.dispatch-node-column {
  min-width: 0 !important;
  border: 1px solid #dbeafe !important;
  border-radius: 18px !important;
  background: #f8fbff !important;
}

.dispatch-node-column-head {
  min-height: 58px !important;
  padding: 12px 16px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
}

.dispatch-node-column-head strong {
  color: #0f172a !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
}

.dispatch-node-column-head button {
  min-width: 72px !important;
  padding: 8px 12px !important;
  white-space: nowrap !important;
}

.dispatch-node-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 12px !important;
  max-height: 520px !important;
  overflow: auto !important;
  padding: 14px !important;
}

.dispatch-node-table-wrap {
  max-height: 520px !important;
  overflow: auto !important;
  padding: 14px !important;
}

.dispatch-node-table {
  width: 100% !important;
  min-width: 720px !important;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

.dispatch-node-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 1 !important;
  background: #f8fbff !important;
  color: #334155 !important;
}

.dispatch-node-table tbody tr {
  background: #fff !important;
  box-shadow: 0 0 0 1px #e2e8f0 !important;
}

.dispatch-node-table tbody td {
  padding: 10px 12px !important;
  vertical-align: middle !important;
}

.dispatch-node-table tbody td:first-child {
  border-radius: 12px 0 0 12px !important;
}

.dispatch-node-table tbody td:last-child {
  border-radius: 0 12px 12px 0 !important;
}

.dispatch-role-select,
.dispatch-priority-input {
  min-height: 34px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  background: #fff !important;
}

.dispatch-role-select {
  min-width: 96px !important;
}

.dispatch-priority-input {
  width: 82px !important;
}

.dispatch-node-card {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 70px !important;
  padding: 12px !important;
  border-radius: 14px !important;
}

.dispatch-node-main strong {
  color: #1e293b !important;
  font-size: 14px !important;
}

.dispatch-node-main small,
.dispatch-node-meta small {
  max-width: 100% !important;
  font-size: 12px !important;
}

.dispatch-node-meta {
  justify-items: end !important;
  min-width: 64px !important;
}

.dispatch-node-assignment-form > .modal-actions {
  order: 3 !important;
  display: flex !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 2px !important;
}

@media (max-width: 1180px) {
  .dispatch-node-columns {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 860px) {
  .dispatch-node-toolbar {
    grid-template-columns: 1fr !important;
  }

  .dispatch-node-toolbar-info {
    justify-content: flex-start !important;
  }

  .dispatch-node-list {
    grid-template-columns: 1fr !important;
  }
}

/* 企业运营 UI 优化：线路节点分配与通用后台视觉统一 */
.enterprise-panel,
.domain-card.enterprise-panel {
  border: 1px solid #d8e3f2 !important;
  border-radius: 20px !important;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.045), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
}

.enterprise-section-head {
  padding-bottom: 12px !important;
  border-bottom: 1px solid #edf2f7 !important;
}

.enterprise-section-head h3 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  letter-spacing: -0.02em !important;
}

.enterprise-section-head h3::before {
  content: "";
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1677ff, #06b6d4);
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.25);
}

.dispatch-node-assignment-card .dispatch-line-tabs {
  justify-content: flex-end !important;
  margin-top: -4px !important;
}

.dispatch-node-toolbar.dispatch-node-toolbar-advanced {
  grid-template-columns: minmax(200px, 1.1fr) minmax(210px, 1.15fr) minmax(140px, 0.72fr) minmax(120px, 0.62fr) minmax(180px, 0.95fr) minmax(210px, 1.1fr) !important;
  padding: 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  background: rgba(248, 251, 255, 0.78) !important;
}

.dispatch-node-toolbar label {
  color: #1e293b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.dispatch-node-toolbar select,
.dispatch-node-toolbar input {
  min-height: 38px !important;
  border-color: #cbd5e1 !important;
  border-radius: 10px !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}

.dispatch-node-toolbar select:focus,
.dispatch-node-toolbar input:focus {
  border-color: #1677ff !important;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12) !important;
  outline: none !important;
}

.dispatch-node-toolbar-info {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(112px, max-content)) !important;
  gap: 8px !important;
}

.dispatch-node-toolbar-info span {
  min-height: 30px !important;
  padding: 6px 10px !important;
  border: 1px solid #dbeafe !important;
  border-radius: 999px !important;
  background: #eff6ff !important;
  color: #1e40af !important;
  font-size: 12px !important;
}

.dispatch-node-column {
  overflow: hidden !important;
  border-color: #d8e3f2 !important;
  background: #f8fbff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.dispatch-node-column-head {
  border-bottom: 1px solid #e2e8f0 !important;
}

.dispatch-node-list.enterprise-node-list {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)) !important;
  align-content: start !important;
  max-height: 430px !important;
}

.dispatch-node-card.enterprise-node-card {
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  min-height: 72px !important;
  border: 1px solid #dbe5f1 !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045) !important;
}

.dispatch-node-card.enterprise-node-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.12) !important;
}

.dispatch-node-card.enterprise-node-card input {
  width: 16px !important;
  height: 16px !important;
}

.dispatch-node-card.enterprise-node-card .dispatch-node-main {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
}

.dispatch-node-card.enterprise-node-card .dispatch-node-main strong {
  overflow: hidden !important;
  color: #0f172a !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dispatch-node-card.enterprise-node-card .dispatch-node-main code,
.ip-code {
  display: inline-flex !important;
  width: fit-content !important;
  max-width: 100% !important;
  padding: 3px 7px !important;
  overflow: hidden !important;
  border: 1px solid #dbeafe !important;
  border-radius: 8px !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.node-name-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.node-name-cell strong {
  color: #0f172a;
  font-size: 14px;
}

.node-name-cell span {
  color: #64748b;
  font-size: 12px;
}

.enterprise-table thead th {
  font-size: 12px !important;
  font-weight: 800 !important;
}

.enterprise-table tbody td {
  border-top: 1px solid #edf2f7 !important;
  border-bottom: 1px solid #edf2f7 !important;
}

.enterprise-table tbody tr:hover {
  box-shadow: 0 0 0 1px #bfdbfe, 0 10px 24px rgba(37, 99, 235, 0.10) !important;
}

.dispatch-node-table-wrap {
  max-height: 430px !important;
}

.dispatch-node-table {
  min-width: 650px !important;
}

.dispatch-node-table th:nth-child(1),
.dispatch-node-table td:nth-child(1) {
  width: 44px !important;
}

.dispatch-node-table th:nth-child(4),
.dispatch-node-table td:nth-child(4) {
  width: 86px !important;
}

.dispatch-node-table th:nth-child(5),
.dispatch-node-table td:nth-child(5) {
  width: 118px !important;
}

.dispatch-node-table th:nth-child(6),
.dispatch-node-table td:nth-child(6) {
  width: 86px !important;
}

.domain-card,
.table-card,
.panel {
  border-radius: 18px;
}

.site-table th {
  white-space: nowrap;
}

button,
.button-link,
input,
select,
textarea {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

/* 新版深色科技风：由“系统设置 → 界面设置”控制，经典版不受影响 */
html[data-theme="modern"] {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0f1b2e;
  --text: #e6f0ff;
  --muted: #8ea3bd;
  --line: rgba(128, 170, 220, 0.20);
  --accent: #20c7ff;
  --accent-dark: #1286ff;
  --ok: #2dd4bf;
  --warn: #fbbf24;
  --bad: #fb7185;
}

html[data-theme="modern"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(32, 199, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(34, 197, 94, 0.10), transparent 28rem),
    linear-gradient(135deg, #06101d 0%, #081827 52%, #07111f 100%);
  color: var(--text);
}

html[data-theme="modern"] .sidebar {
  border-right: 1px solid rgba(56, 189, 248, 0.16);
  background:
    linear-gradient(180deg, rgba(10, 25, 47, 0.98), rgba(6, 15, 29, 0.98)),
    radial-gradient(circle at top, rgba(32, 199, 255, 0.16), transparent 18rem);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.26);
}

html[data-theme="modern"] .brand-mark {
  background: linear-gradient(135deg, #20c7ff, #2dd4bf);
  color: #02111f;
  box-shadow: 0 0 28px rgba(32, 199, 255, 0.38);
}

html[data-theme="modern"] .brand span,
html[data-theme="modern"] .muted,
html[data-theme="modern"] small,
html[data-theme="modern"] .section-head p,
html[data-theme="modern"] .message,
html[data-theme="modern"] .settings-note {
  color: var(--muted);
}

html[data-theme="modern"] nav a,
html[data-theme="modern"] .nav-group-toggle {
  color: #b8c7dd;
}

html[data-theme="modern"] nav a.active,
html[data-theme="modern"] nav a:hover,
html[data-theme="modern"] .nav-group-toggle:hover {
  background: linear-gradient(90deg, rgba(32, 199, 255, 0.16), rgba(45, 212, 191, 0.08));
  color: #f8fbff;
  box-shadow: inset 3px 0 0 #20c7ff;
}

html[data-theme="modern"] .content,
html[data-theme="modern"] main {
  background: transparent;
}

html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .modal-content,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .domain-card.enterprise-panel,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card {
  border: 1px solid rgba(125, 211, 252, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(17, 31, 52, 0.94), rgba(10, 22, 39, 0.94)) !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--text);
}

html[data-theme="modern"] .section-head,
html[data-theme="modern"] .enterprise-section-head {
  border-bottom-color: rgba(125, 211, 252, 0.14) !important;
}

html[data-theme="modern"] .eyebrow {
  color: #67e8f9;
  letter-spacing: 0.08em;
}

html[data-theme="modern"] h1,
html[data-theme="modern"] h2,
html[data-theme="modern"] h3,
html[data-theme="modern"] h4,
html[data-theme="modern"] .node-name-cell strong,
html[data-theme="modern"] .dispatch-node-card.enterprise-node-card .dispatch-node-main strong {
  color: #f3f8ff !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  border-color: rgba(125, 211, 252, 0.20) !important;
  background: rgba(3, 11, 22, 0.72) !important;
  color: var(--text) !important;
}

html[data-theme="modern"] input::placeholder,
html[data-theme="modern"] textarea::placeholder {
  color: #61748d;
}

html[data-theme="modern"] input:focus,
html[data-theme="modern"] select:focus,
html[data-theme="modern"] textarea:focus {
  border-color: rgba(32, 199, 255, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(32, 199, 255, 0.14), 0 0 26px rgba(32, 199, 255, 0.10) !important;
  outline: none;
}

html[data-theme="modern"] button,
html[data-theme="modern"] .button-link:not(.secondary) {
  background: linear-gradient(135deg, #1286ff, #20c7ff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(18, 134, 255, 0.24);
}

html[data-theme="modern"] button.secondary,
html[data-theme="modern"] .button-link.secondary {
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(15, 29, 49, 0.96);
  color: #9ee8ff;
}

html[data-theme="modern"] button.danger {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
}

html[data-theme="modern"] .site-table {
  color: var(--text);
}

html[data-theme="modern"] .site-table th {
  border-color: rgba(125, 211, 252, 0.16);
  background: rgba(8, 22, 39, 0.96);
  color: #9bc7e8;
}

html[data-theme="modern"] .site-table td {
  border-color: rgba(125, 211, 252, 0.10);
  color: #dce9f8;
}

html[data-theme="modern"] .site-table tbody tr:hover {
  background: rgba(32, 199, 255, 0.06);
}

html[data-theme="modern"] code,
html[data-theme="modern"] .ip-code,
html[data-theme="modern"] .dispatch-node-card.enterprise-node-card .dispatch-node-main code {
  border-color: rgba(125, 211, 252, 0.18) !important;
  background: rgba(5, 18, 32, 0.82) !important;
  color: #7dd3fc !important;
}

html[data-theme="modern"] .status.installed,
html[data-theme="modern"] .ok-pill {
  background: rgba(45, 212, 191, 0.14);
  color: #5eead4;
}

html[data-theme="modern"] .status.pending,
html[data-theme="modern"] .status.ready {
  background: rgba(251, 191, 36, 0.14);
  color: #facc15;
}

html[data-theme="modern"] .status.error,
html[data-theme="modern"] .bad-pill {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
}

html[data-theme="modern"] .dispatch-node-toolbar.dispatch-node-toolbar-advanced,
html[data-theme="modern"] .dispatch-node-column {
  border-color: rgba(125, 211, 252, 0.16) !important;
  background: rgba(8, 21, 37, 0.72) !important;
}

html[data-theme="modern"] .dispatch-node-toolbar label {
  color: #dce9f8 !important;
}

html[data-theme="modern"] .dispatch-node-toolbar-info span {
  border-color: rgba(32, 199, 255, 0.22) !important;
  background: rgba(32, 199, 255, 0.10) !important;
  color: #9ee8ff !important;
}

html[data-theme="modern"] .dispatch-node-card.enterprise-node-card {
  border-color: rgba(125, 211, 252, 0.16) !important;
  background: linear-gradient(180deg, rgba(16, 31, 53, 0.96), rgba(10, 22, 39, 0.96)) !important;
}

html[data-theme="modern"] .node-name-cell span {
  color: #8ea3bd;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.theme-choice-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  cursor: pointer;
}

.theme-choice-card input {
  margin-top: 4px;
}

.theme-choice-card span {
  display: grid;
  gap: 4px;
}

.theme-choice-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 199, 255, 0.12);
}

html[data-theme="modern"] .theme-choice-card {
  border-color: rgba(125, 211, 252, 0.16);
  background: rgba(8, 21, 37, 0.74);
}

html[data-theme="modern"] .theme-choice-card.active {
  border-color: rgba(32, 199, 255, 0.72);
  background: linear-gradient(135deg, rgba(32, 199, 255, 0.14), rgba(45, 212, 191, 0.08));
}

/* 企业控制台清晰版覆盖：减少雾化/发光，按阿里云/腾讯云控制台风格提升可读性 */
html[data-theme="modern"] body {
  background: #08111f !important;
}

html[data-theme="modern"] main {
  background: #0b1524 !important;
}

html[data-theme="modern"] .sidebar {
  background: #071225 !important;
  border-right: 1px solid #1d314d !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .dns-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .modal-content,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .domain-card.enterprise-panel {
  border: 1px solid #203653 !important;
  background: #101c2d !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
  color: #dce8f7 !important;
}

html[data-theme="modern"] .analytics-panel {
  padding: 18px !important;
  border-radius: 14px !important;
}

html[data-theme="modern"] .site-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #223956;
  border-radius: 12px;
  background: #0d1828;
}

html[data-theme="modern"] .site-table th {
  height: 44px;
  border-bottom: 1px solid #263f60 !important;
  background: #0b1727 !important;
  color: #8fc7ff !important;
  font-weight: 700;
}

html[data-theme="modern"] .site-table td {
  height: 42px;
  border-top: 1px solid rgba(42, 63, 91, 0.7) !important;
  color: #d7e7f8 !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even),
html[data-theme="modern"] .site-table tbody tr.is-even {
  background: rgba(255, 255, 255, 0.018);
}

html[data-theme="modern"] .site-table tbody tr:hover {
  background: rgba(24, 144, 255, 0.10) !important;
}

html[data-theme="modern"] .analysis-dashboard {
  display: grid;
  gap: 16px;
}

.analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analysis-kpi-card {
  position: relative;
  display: grid;
  min-height: 118px;
  gap: 6px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
}

.analysis-kpi-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(24, 144, 255, 0.08);
}

.analysis-kpi-card span,
.analysis-kpi-card small {
  color: #64748b;
}

.analysis-kpi-card strong {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.analysis-kpi-icon {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: #1677ff;
  font-size: 22px;
  opacity: 0.9;
}

html[data-theme="modern"] .analysis-kpi-card {
  border-color: #203b5f;
  background: linear-gradient(180deg, #13243a 0%, #101c2d 100%);
  box-shadow: none;
}

html[data-theme="modern"] .analysis-kpi-card::after {
  background: rgba(24, 144, 255, 0.12);
}

html[data-theme="modern"] .analysis-kpi-card span,
html[data-theme="modern"] .analysis-kpi-card small {
  color: #8ea6c4;
}

html[data-theme="modern"] .analysis-kpi-card strong {
  color: #eaf5ff !important;
  background: linear-gradient(90deg, #4aa3ff, #28d5ca);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.analysis-chart-card {
  padding: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
}

html[data-theme="modern"] .analysis-chart-card {
  border-color: #203b5f;
  background: #0d1828;
}

.analysis-card-head,
.analysis-table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.analysis-card-head h3,
.analysis-table-head h3 {
  margin: 0;
  font-size: 16px;
}

.analysis-card-head p,
.analysis-table-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.analysis-card-head > span,
.analysis-table-head > span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf6ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

html[data-theme="modern"] .analysis-card-head p,
html[data-theme="modern"] .analysis-table-head p {
  color: #8ea6c4;
}

html[data-theme="modern"] .analysis-card-head > span,
html[data-theme="modern"] .analysis-table-head > span {
  background: rgba(24, 144, 255, 0.14);
  color: #8fd0ff;
}

.analysis-trend-svg {
  display: block;
  width: 100%;
  height: 220px;
}

.analysis-grid-line {
  fill: none;
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.analysis-trend-area {
  fill: url(#analysisAreaGradient);
}

.analysis-trend-line {
  fill: none;
  stroke: url(#analysisLineGradient);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analysis-trend-dots circle {
  fill: #22d3ee;
  stroke: #0b1524;
  stroke-width: 2;
}

.analysis-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analysis-bar-list {
  display: grid;
  gap: 10px;
}

.analysis-bar-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1fr) minmax(160px, 2fr) 92px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
}

.analysis-bar-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #e8f2ff;
  color: #1677ff;
  font-size: 12px;
  font-weight: 800;
}

.analysis-bar-name {
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.analysis-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #22d3ee);
}

.analysis-bar-row strong {
  text-align: right;
  color: #0f172a;
  font-size: 12px;
}

html[data-theme="modern"] .analysis-bar-rank {
  background: rgba(24, 144, 255, 0.14);
  color: #8fd0ff;
}

html[data-theme="modern"] .analysis-bar-name,
html[data-theme="modern"] .analysis-bar-row strong {
  color: #dce8f7;
}

html[data-theme="modern"] .analysis-bar-track {
  background: #1b2c45;
}

.analysis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  background: #f7fbff;
}

.analysis-tabs button,
.analysis-toolbar button,
.analysis-toolbar select,
.analysis-toolbar input {
  min-height: 36px;
  border-radius: 8px;
}

.analysis-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-weight: 700;
}

.analysis-tabs button.active {
  border-color: #1677ff;
  background: #e8f2ff;
  color: #1677ff;
  box-shadow: inset 0 -2px 0 #1677ff;
}

.analysis-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  background: #f8fbff;
}

html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar {
  border-color: #203b5f;
  background: #0d1828;
}

html[data-theme="modern"] .analysis-tabs button {
  background: transparent;
  color: #8ea6c4;
  box-shadow: none;
}

html[data-theme="modern"] .analysis-tabs button.active,
html[data-theme="modern"] .analysis-toolbar button.active {
  border-color: #1890ff;
  background: rgba(24, 144, 255, 0.16);
  color: #dff3ff;
  box-shadow: inset 0 -2px 0 #22d3ee;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #edf2f7;
  color: #475569;
  font-weight: 800;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #f59e0b, #fde68a);
  color: #3b2600;
}

.rank-badge.silver {
  background: linear-gradient(135deg, #94a3b8, #e2e8f0);
  color: #1e293b;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #b45309, #fdba74);
  color: #2a1300;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analysis-empty-chart {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px dashed #d8e2ef;
  border-radius: 12px;
  color: #64748b;
}

html[data-theme="modern"] .analysis-empty-chart {
  border-color: #284466;
  color: #8ea6c4;
}

@media (max-width: 1180px) {
  .analysis-kpi-grid,
  .analysis-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .analysis-kpi-grid,
  .analysis-visual-grid {
    grid-template-columns: 1fr;
  }

  .analysis-bar-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .analysis-bar-track,
  .analysis-bar-row strong {
    grid-column: 2;
  }
}

/* 深色运营表格版：只覆盖 modern 主题，浅色运营版不受影响 */
html[data-theme="modern"] {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #101827;
  --text: #d8e2ef;
  --muted: #8a98ab;
  --line: #263449;
  --accent: #2f80ed;
  --accent-dark: #1f6fd1;
  --ok: #22a06b;
  --warn: #d98b13;
  --bad: #d84a4a;
}

html[data-theme="modern"] body,
html[data-theme="modern"] main,
html[data-theme="modern"] .content {
  background: #0b1220 !important;
  color: #d8e2ef !important;
}

html[data-theme="modern"] .sidebar {
  background: #0f1726 !important;
  border-right: 1px solid #253348 !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .brand-mark {
  background: #1f6fd1 !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-theme="modern"] nav a,
html[data-theme="modern"] .nav-group-toggle {
  border-radius: 4px !important;
  color: #b6c2d2 !important;
}

html[data-theme="modern"] nav a.active,
html[data-theme="modern"] nav a:hover,
html[data-theme="modern"] .nav-group-toggle:hover {
  background: #172238 !important;
  color: #f4f8fd !important;
  box-shadow: inset 3px 0 0 #2f80ed !important;
}

html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .dns-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .modal-content,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .domain-card.enterprise-panel,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card,
html[data-theme="modern"] .analysis-kpi-card,
html[data-theme="modern"] .analysis-chart-card {
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  background: #101827 !important;
  box-shadow: none !important;
  color: #d8e2ef !important;
}

html[data-theme="modern"] .section-head,
html[data-theme="modern"] .enterprise-section-head {
  border-bottom: 1px solid #263449 !important;
  padding-bottom: 12px !important;
}

html[data-theme="modern"] .eyebrow,
html[data-theme="modern"] .brand span,
html[data-theme="modern"] .muted,
html[data-theme="modern"] small,
html[data-theme="modern"] .section-head p,
html[data-theme="modern"] .message,
html[data-theme="modern"] .settings-note {
  color: #8a98ab !important;
  letter-spacing: 0 !important;
}

html[data-theme="modern"] h1,
html[data-theme="modern"] h2,
html[data-theme="modern"] h3,
html[data-theme="modern"] h4,
html[data-theme="modern"] strong {
  color: #edf3fa !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  min-height: 34px !important;
  border: 1px solid #34445c !important;
  border-radius: 4px !important;
  background: #0b1220 !important;
  color: #d8e2ef !important;
  box-shadow: none !important;
}

html[data-theme="modern"] input:focus,
html[data-theme="modern"] select:focus,
html[data-theme="modern"] textarea:focus {
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.22) !important;
  outline: none !important;
}

html[data-theme="modern"] button,
html[data-theme="modern"] .button-link:not(.secondary) {
  min-height: 32px !important;
  border: 1px solid #2f80ed !important;
  border-radius: 4px !important;
  background: #2f80ed !important;
  color: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="modern"] button:hover,
html[data-theme="modern"] .button-link:not(.secondary):hover {
  background: #1f6fd1 !important;
  border-color: #1f6fd1 !important;
}

html[data-theme="modern"] button.secondary,
html[data-theme="modern"] .button-link.secondary {
  border: 1px solid #3a4b63 !important;
  background: #172238 !important;
  color: #c9d7e7 !important;
  box-shadow: none !important;
}

html[data-theme="modern"] button.danger,
html[data-theme="modern"] button.secondary.danger {
  border-color: #8d3d3d !important;
  background: #3a1f25 !important;
  color: #ffb4b4 !important;
}

html[data-theme="modern"] .site-table {
  width: 100%;
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  border-spacing: 0 !important;
  border-collapse: separate !important;
  background: #0f1726 !important;
  color: #d8e2ef !important;
  overflow: hidden;
}

html[data-theme="modern"] .site-table th {
  height: 36px !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #314058 !important;
  background: #172238 !important;
  color: #b8c6d8 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

html[data-theme="modern"] .site-table td {
  height: 38px !important;
  padding: 7px 10px !important;
  border-top: 1px solid #243147 !important;
  color: #d8e2ef !important;
  vertical-align: middle !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even),
html[data-theme="modern"] .site-table tbody tr.is-even {
  background: #111c2e !important;
}

html[data-theme="modern"] .site-table tbody tr:hover {
  background: #1a2942 !important;
}

html[data-theme="modern"] .table-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

html[data-theme="modern"] .status {
  min-height: 22px;
  border-radius: 4px !important;
  font-weight: 700;
}

html[data-theme="modern"] .status.installed,
html[data-theme="modern"] .ok-pill {
  background: rgba(34, 160, 107, 0.16) !important;
  color: #76d6ad !important;
}

html[data-theme="modern"] .status.pending,
html[data-theme="modern"] .status.ready {
  background: rgba(217, 139, 19, 0.16) !important;
  color: #f2bf75 !important;
}

html[data-theme="modern"] .status.error,
html[data-theme="modern"] .bad-pill {
  background: rgba(216, 74, 74, 0.18) !important;
  color: #ffaaaa !important;
}

html[data-theme="modern"] .status.paused {
  background: rgba(138, 152, 171, 0.18) !important;
  color: #c5cfdb !important;
}

html[data-theme="modern"] code,
html[data-theme="modern"] .ip-code,
html[data-theme="modern"] .dispatch-node-card.enterprise-node-card .dispatch-node-main code {
  border: 1px solid #34445c !important;
  border-radius: 4px !important;
  background: #0b1220 !important;
  color: #b7cdf0 !important;
}

html[data-theme="modern"] .node-progress {
  border-radius: 999px !important;
  background: #263449 !important;
}

html[data-theme="modern"] .node-progress span {
  background: #2f80ed !important;
}

html[data-theme="modern"] .node-progress.warn span {
  background: #d84a4a !important;
}

html[data-theme="modern"] .theme-choice-card,
html[data-theme="modern"] .dispatch-node-toolbar.dispatch-node-toolbar-advanced,
html[data-theme="modern"] .dispatch-node-column,
html[data-theme="modern"] .dispatch-node-card.enterprise-node-card,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar {
  border-color: #263449 !important;
  border-radius: 6px !important;
  background: #101827 !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .theme-choice-card.active,
html[data-theme="modern"] .analysis-tabs button.active,
html[data-theme="modern"] .analysis-toolbar button.active {
  border-color: #2f80ed !important;
  background: #172238 !important;
  box-shadow: inset 0 -2px 0 #2f80ed !important;
}

html[data-theme="modern"] .analysis-kpi-card::after {
  display: none !important;
}

html[data-theme="modern"] .analysis-kpi-card strong {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: #edf3fa !important;
}

html[data-theme="modern"] .topbar {
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  background: #101827 !important;
  color: #d8e2ef !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .topbar h1 {
  color: #edf3fa !important;
}

html[data-theme="modern"] .metrics div,
html[data-theme="modern"] .quota-grid div,
html[data-theme="modern"] .summary-card,
html[data-theme="modern"] .commercial-stat,
html[data-theme="modern"] .commercial-feature,
html[data-theme="modern"] .compact-stat-grid > *,
html[data-theme="modern"] .security-summary-card {
  position: relative !important;
  min-height: auto !important;
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  background: #101827 !important;
  color: #d8e2ef !important;
  box-shadow: none !important;
  overflow: hidden;
}

html[data-theme="modern"] .metrics div::after,
html[data-theme="modern"] .summary-card::after,
html[data-theme="modern"] .commercial-stat::after,
html[data-theme="modern"] .commercial-feature::after,
html[data-theme="modern"] .analysis-kpi-card::after {
  display: none !important;
}

html[data-theme="modern"] .metrics span,
html[data-theme="modern"] .quota-grid span,
html[data-theme="modern"] .summary-card span,
html[data-theme="modern"] .commercial-stat span,
html[data-theme="modern"] .commercial-feature span,
html[data-theme="modern"] .security-summary-card span {
  color: #8a98ab !important;
}

html[data-theme="modern"] .metrics strong,
html[data-theme="modern"] .quota-grid strong,
html[data-theme="modern"] .summary-card strong,
html[data-theme="modern"] .commercial-stat strong,
html[data-theme="modern"] .commercial-feature strong,
html[data-theme="modern"] .security-summary-card strong {
  color: #edf3fa !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

html[data-theme="modern"] .commercial-stat-grid,
html[data-theme="modern"] .commercial-feature-grid,
html[data-theme="modern"] .compact-stat-grid {
  gap: 10px !important;
}

html[data-theme="modern"] .nav-group-toggle {
  border: 0 !important;
  background: transparent !important;
  color: #b6c2d2 !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .nav-group-toggle:hover,
html[data-theme="modern"] .nav-group.open .nav-group-toggle {
  background: #172238 !important;
  color: #f4f8fd !important;
  box-shadow: inset 3px 0 0 #2f80ed !important;
}

html[data-theme="modern"] .nav-submenu a {
  background: transparent !important;
  color: #b6c2d2 !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .nav-submenu a.active,
html[data-theme="modern"] .nav-submenu a:hover {
  background: #172238 !important;
  color: #f4f8fd !important;
}

/* Modern operations table hardening: final dark override only. */
html[data-theme="modern"],
html[data-theme="modern"] body {
  overflow-x: hidden !important;
}

html[data-theme="modern"] .app-shell {
  grid-template-columns: 298px minmax(0, 1fr) !important;
  background: #0b1220 !important;
}

html[data-theme="modern"] main {
  min-width: 0 !important;
  padding: 18px 24px 32px !important;
}

html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .overview-grid,
html[data-theme="modern"] .metrics {
  max-width: none !important;
  width: 100% !important;
}

html[data-theme="modern"] .topbar {
  min-height: 52px !important;
  margin-bottom: 12px !important;
  padding: 12px 16px !important;
}

html[data-theme="modern"] .topbar h1 {
  font-size: 20px !important;
  letter-spacing: 0 !important;
}

html[data-theme="modern"] .topbar-actions {
  gap: 8px !important;
}

html[data-theme="modern"] .sidebar {
  width: 298px !important;
  padding: 14px 12px !important;
}

html[data-theme="modern"] .brand {
  margin-bottom: 12px !important;
  padding-bottom: 12px !important;
}

html[data-theme="modern"] nav a,
html[data-theme="modern"] .nav-group-toggle,
html[data-theme="modern"] .nav-submenu a {
  min-height: 34px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}

html[data-theme="modern"] .nav-submenu {
  gap: 2px !important;
  margin: 3px 0 6px !important;
}

html[data-theme="modern"] .nav-submenu a {
  margin-left: 18px !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .dns-panel,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .domain-card.enterprise-panel,
html[data-theme="modern"] .table-card {
  min-width: 0 !important;
  padding: 14px !important;
}

html[data-theme="modern"] .section-head,
html[data-theme="modern"] .enterprise-section-head {
  gap: 10px !important;
  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
}

html[data-theme="modern"] .section-head h2,
html[data-theme="modern"] .section-head h3,
html[data-theme="modern"] .section-head h4 {
  margin: 0 !important;
  font-size: 18px !important;
  letter-spacing: 0 !important;
}

html[data-theme="modern"] .section-head p,
html[data-theme="modern"] p,
html[data-theme="modern"] label,
html[data-theme="modern"] small {
  color: #aab7c8 !important;
}

html[data-theme="modern"] .list-toolbar,
html[data-theme="modern"] .analysis-toolbar,
html[data-theme="modern"] .analytics-filters,
html[data-theme="modern"] .dns-actions,
html[data-theme="modern"] .domain-form-actions,
html[data-theme="modern"] .security-quick-nav {
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  background: #0f1726 !important;
  color: #d8e2ef !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .list-toolbar {
  display: grid !important;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) repeat(3, minmax(120px, 170px)) minmax(68px, auto) minmax(68px, auto) !important;
  gap: 8px !important;
  align-items: center !important;
  padding: 10px !important;
  overflow: visible !important;
}

html[data-theme="modern"] .list-toolbar > *,
html[data-theme="modern"] .list-toolbar label,
html[data-theme="modern"] .list-toolbar span {
  min-width: 0 !important;
  color: #d8e2ef !important;
}

html[data-theme="modern"] .list-toolbar input,
html[data-theme="modern"] .list-toolbar select,
html[data-theme="modern"] .list-toolbar button {
  width: 100% !important;
}

html[data-theme="modern"] .list-toolbar button {
  min-width: 68px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  white-space: nowrap !important;
}

html[data-theme="modern"] .metrics,
html[data-theme="modern"] .quota-grid,
html[data-theme="modern"] .commercial-stat-grid,
html[data-theme="modern"] .commercial-feature-grid,
html[data-theme="modern"] .compact-stat-grid,
html[data-theme="modern"] .security-summary-grid,
html[data-theme="modern"] .security-overview-strip {
  gap: 8px !important;
}

html[data-theme="modern"] .metrics div,
html[data-theme="modern"] .quota-grid div,
html[data-theme="modern"] .summary-card,
html[data-theme="modern"] .commercial-stat,
html[data-theme="modern"] .commercial-feature,
html[data-theme="modern"] .compact-stat-grid > *,
html[data-theme="modern"] .security-summary-card,
html[data-theme="modern"] .security-overview-strip > div,
html[data-theme="modern"] .overview-user-card,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card {
  border: 1px solid #263449 !important;
  border-radius: 6px !important;
  background: #101827 !important;
  color: #d8e2ef !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .metrics div,
html[data-theme="modern"] .quota-grid div,
html[data-theme="modern"] .commercial-stat,
html[data-theme="modern"] .commercial-feature,
html[data-theme="modern"] .compact-stat-grid > *,
html[data-theme="modern"] .security-summary-card {
  padding: 10px 12px !important;
}

html[data-theme="modern"] .metrics span,
html[data-theme="modern"] .quota-grid span,
html[data-theme="modern"] .summary-card span,
html[data-theme="modern"] .commercial-stat span,
html[data-theme="modern"] .commercial-feature span,
html[data-theme="modern"] .security-summary-card span,
html[data-theme="modern"] .security-overview-strip span {
  color: #aab7c8 !important;
}

html[data-theme="modern"] .metrics strong,
html[data-theme="modern"] .quota-grid strong,
html[data-theme="modern"] .summary-card strong,
html[data-theme="modern"] .commercial-stat strong,
html[data-theme="modern"] .commercial-feature strong,
html[data-theme="modern"] .security-summary-card strong,
html[data-theme="modern"] .security-overview-strip strong {
  color: #f3f7fb !important;
  font-size: 22px !important;
}

html[data-theme="modern"] .table-card {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: 100% !important;
  min-width: 0 !important;
  contain: inline-size !important;
}

html[data-theme="modern"] .site-table {
  min-width: 980px !important;
  table-layout: auto !important;
}

html[data-theme="modern"] .site-table th,
html[data-theme="modern"] .site-table td {
  font-size: 13px !important;
  line-height: 1.35 !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

html[data-theme="modern"] .site-table th:last-child,
html[data-theme="modern"] .site-table td:last-child {
  position: sticky !important;
  right: 0 !important;
  z-index: 2 !important;
  min-width: 136px !important;
  max-width: 196px !important;
  background: #101827 !important;
  box-shadow: -1px 0 0 #263449 !important;
}

html[data-theme="modern"] .site-table th:last-child {
  z-index: 3 !important;
  background: #172238 !important;
}

html[data-theme="modern"] .site-table th {
  height: 34px !important;
  padding: 7px 9px !important;
}

html[data-theme="modern"] .site-table td {
  height: auto !important;
  padding: 8px 9px !important;
}

html[data-theme="modern"] .site-table td:first-child,
html[data-theme="modern"] .site-table th:first-child {
  width: 42px !important;
}

html[data-theme="modern"] .site-table input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
}

html[data-theme="modern"] .table-actions {
  min-width: 0 !important;
  max-width: 196px !important;
  flex-wrap: wrap !important;
  white-space: normal !important;
  gap: 5px !important;
}

html[data-theme="modern"] main {
  min-width: 0 !important;
  overflow-x: hidden !important;
}

html[data-theme="modern"] .cert-renew-switch {
  min-width: 66px !important;
  gap: 5px !important;
  padding: 2px 5px !important;
  white-space: nowrap !important;
}

html[data-theme="modern"] .cert-renew-switch input[type="checkbox"] {
  left: 0 !important;
  right: auto !important;
  width: 1px !important;
  height: 1px !important;
}

html[data-theme="modern"] .site-table .cert-renew-switch span {
  white-space: nowrap !important;
}

html[data-theme="modern"] .table-actions button,
html[data-theme="modern"] .topbar-actions button,
html[data-theme="modern"] .form-actions button,
html[data-theme="modern"] .modal-actions button,
html[data-theme="modern"] .button-row button {
  min-height: 30px !important;
  padding: 6px 9px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}

html[data-theme="modern"] .table-actions button {
  min-height: 28px !important;
  padding: 5px 8px !important;
}

html[data-theme="modern"] .status,
html[data-theme="modern"] .ok-pill,
html[data-theme="modern"] .bad-pill {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 20px !important;
  padding: 2px 7px !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  min-width: 0 !important;
}

html[data-theme="modern"] label:has(> input[type="checkbox"]),
html[data-theme="modern"] label:has(> input[type="radio"]) {
  border-color: #263449 !important;
  background: #101827 !important;
  color: #d8e2ef !important;
}

html[data-theme="modern"] label:has(> input[type="checkbox"]:checked),
html[data-theme="modern"] label:has(> input[type="radio"]:checked) {
  border-color: #2f80ed !important;
  background: #172238 !important;
}

html[data-theme="modern"] .node-form > label,
html[data-theme="modern"] .settings-form.batch-form > label,
html[data-theme="modern"] .security-card > label,
html[data-theme="modern"] .domain-manage-form .settings-grid > label {
  color: #d8e2ef !important;
}

html[data-theme="modern"] .node-form > label > strong,
html[data-theme="modern"] .settings-form.batch-form > label > strong,
html[data-theme="modern"] .security-card > label > strong,
html[data-theme="modern"] .node-form > label.switch-row > span strong,
html[data-theme="modern"] .settings-form.batch-form > label.switch-row > span strong,
html[data-theme="modern"] .security-card > label.switch-row > span strong {
  color: #f3f7fb !important;
}

html[data-theme="modern"] .node-form > label > span,
html[data-theme="modern"] .node-form > label > small,
html[data-theme="modern"] .settings-form.batch-form > label > span,
html[data-theme="modern"] .settings-form.batch-form > label > small,
html[data-theme="modern"] .security-card > label > span,
html[data-theme="modern"] .security-card > label > small,
html[data-theme="modern"] .node-form > label.switch-row > span small,
html[data-theme="modern"] .settings-form.batch-form > label.switch-row > span small,
html[data-theme="modern"] .security-card > label.switch-row > span small {
  color: #aab7c8 !important;
}

html[data-theme="modern"] .settings-note,
html[data-theme="modern"] .https-feature-card,
html[data-theme="modern"] .modal-panel,
html[data-theme="modern"] .modal-head {
  border-color: #263449 !important;
  background: #101827 !important;
  color: #d8e2ef !important;
}

html[data-theme="modern"] .https-feature-card strong {
  color: #f3f7fb !important;
}

html[data-theme="modern"] .https-feature-card small {
  color: #aab7c8 !important;
}

html[data-theme="modern"] .modal {
  background: rgba(4, 8, 15, 0.72) !important;
}

html[data-theme="modern"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html[data-theme="modern"] ::-webkit-scrollbar-track {
  background: #0b1220;
}

html[data-theme="modern"] ::-webkit-scrollbar-thumb {
  border: 2px solid #0b1220;
  border-radius: 999px;
  background: #33445e;
}

@media (max-width: 1200px) {
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 260px minmax(0, 1fr) !important;
  }

  html[data-theme="modern"] .sidebar {
    width: 260px !important;
  }

  html[data-theme="modern"] .list-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .sidebar {
    width: auto !important;
  }

  html[data-theme="modern"] main {
    padding: 12px !important;
  }

  html[data-theme="modern"] .list-toolbar {
    grid-template-columns: 1fr !important;
  }
}

html[data-theme="modern"] .list-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

html[data-theme="modern"] .list-toolbar > :first-child {
  flex: 1 0 160px !important;
}

html[data-theme="modern"] .list-toolbar input[type="search"],
html[data-theme="modern"] .list-toolbar input[type="text"] {
  flex: 2 1 240px !important;
}

html[data-theme="modern"] .list-toolbar select {
  flex: 1 1 138px !important;
}

html[data-theme="modern"] .list-toolbar button {
  flex: 0 0 72px !important;
}

/* Modern operations table v88: gray-blue ops console, not pure black. */
html[data-theme="modern"] {
  --ops-bg: #eef3f8;
  --ops-surface: #ffffff;
  --ops-surface-soft: #f7fafd;
  --ops-table-head: #e8f0f8;
  --ops-sidebar: #26384d;
  --ops-sidebar-hover: #31506f;
  --ops-sidebar-active: #3a6389;
  --ops-border: #cfd8e3;
  --ops-border-strong: #b8c6d6;
  --ops-text: #1f2937;
  --ops-muted: #5f6b7a;
  --ops-blue: #2f74c0;
  --ops-blue-hover: #245f9f;
}

html[data-theme="modern"],
html[data-theme="modern"] body,
html[data-theme="modern"] .app-shell,
html[data-theme="modern"] main {
  background: var(--ops-bg) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .sidebar {
  background: var(--ops-sidebar) !important;
  color: #eaf1f8 !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="modern"] .brand,
html[data-theme="modern"] .sidebar small,
html[data-theme="modern"] .sidebar .muted {
  color: #d4e1ee !important;
}

html[data-theme="modern"] .brand-mark {
  background: #e8f0f8 !important;
  color: #26384d !important;
  box-shadow: none !important;
}

html[data-theme="modern"] nav a,
html[data-theme="modern"] .nav-group-toggle,
html[data-theme="modern"] .nav-submenu a {
  color: #dce7f2 !important;
}

html[data-theme="modern"] nav a:hover,
html[data-theme="modern"] nav a.active,
html[data-theme="modern"] .nav-group-toggle:hover,
html[data-theme="modern"] .nav-group.open .nav-group-toggle,
html[data-theme="modern"] .nav-submenu a.active,
html[data-theme="modern"] .nav-submenu a:hover {
  background: var(--ops-sidebar-hover) !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 0 #8fc2f6 !important;
}

html[data-theme="modern"] .topbar,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .dns-panel,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .domain-card.enterprise-panel,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .modal-panel,
html[data-theme="modern"] .modal-head,
html[data-theme="modern"] .settings-note {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.06) !important;
}

html[data-theme="modern"] .list-toolbar,
html[data-theme="modern"] .analysis-toolbar,
html[data-theme="modern"] .analytics-filters,
html[data-theme="modern"] .dns-actions,
html[data-theme="modern"] .domain-form-actions,
html[data-theme="modern"] .security-quick-nav {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .metrics div,
html[data-theme="modern"] .quota-grid div,
html[data-theme="modern"] .summary-card,
html[data-theme="modern"] .commercial-stat,
html[data-theme="modern"] .commercial-feature,
html[data-theme="modern"] .compact-stat-grid > *,
html[data-theme="modern"] .security-summary-card,
html[data-theme="modern"] .security-overview-strip > div,
html[data-theme="modern"] .overview-user-card,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card,
html[data-theme="modern"] label:has(> input[type="checkbox"]),
html[data-theme="modern"] label:has(> input[type="radio"]),
html[data-theme="modern"] .node-form > label,
html[data-theme="modern"] .settings-form.batch-form > label,
html[data-theme="modern"] .security-card > label,
html[data-theme="modern"] .domain-manage-form .settings-grid > label {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: none !important;
}

html[data-theme="modern"] label:has(> input[type="checkbox"]:checked),
html[data-theme="modern"] label:has(> input[type="radio"]:checked) {
  border-color: #7db4ec !important;
  background: #eef6ff !important;
}

html[data-theme="modern"] .topbar h1,
html[data-theme="modern"] .section-head h2,
html[data-theme="modern"] .section-head h3,
html[data-theme="modern"] .section-head h4,
html[data-theme="modern"] .metrics strong,
html[data-theme="modern"] .quota-grid strong,
html[data-theme="modern"] .summary-card strong,
html[data-theme="modern"] .commercial-stat strong,
html[data-theme="modern"] .commercial-feature strong,
html[data-theme="modern"] .security-summary-card strong,
html[data-theme="modern"] .security-overview-strip strong,
html[data-theme="modern"] .node-form > label > strong,
html[data-theme="modern"] .settings-form.batch-form > label > strong,
html[data-theme="modern"] .security-card > label > strong,
html[data-theme="modern"] .node-form > label.switch-row > span strong,
html[data-theme="modern"] .settings-form.batch-form > label.switch-row > span strong,
html[data-theme="modern"] .security-card > label.switch-row > span strong {
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .section-head p,
html[data-theme="modern"] p,
html[data-theme="modern"] label,
html[data-theme="modern"] small,
html[data-theme="modern"] .metrics span,
html[data-theme="modern"] .quota-grid span,
html[data-theme="modern"] .summary-card span,
html[data-theme="modern"] .commercial-stat span,
html[data-theme="modern"] .commercial-feature span,
html[data-theme="modern"] .security-summary-card span,
html[data-theme="modern"] .security-overview-strip span,
html[data-theme="modern"] .node-form > label > span,
html[data-theme="modern"] .node-form > label > small,
html[data-theme="modern"] .settings-form.batch-form > label > span,
html[data-theme="modern"] .settings-form.batch-form > label > small,
html[data-theme="modern"] .security-card > label > span,
html[data-theme="modern"] .security-card > label > small,
html[data-theme="modern"] .node-form > label.switch-row > span small,
html[data-theme="modern"] .settings-form.batch-form > label.switch-row > span small,
html[data-theme="modern"] .security-card > label.switch-row > span small {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .site-table {
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table th {
  border-color: var(--ops-border) !important;
  background: var(--ops-table-head) !important;
  color: #26384d !important;
}

html[data-theme="modern"] .site-table td {
  border-color: var(--ops-border) !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even) td {
  background: var(--ops-surface-soft) !important;
}

html[data-theme="modern"] .site-table tbody tr:hover td {
  background: #edf5ff !important;
}

html[data-theme="modern"] .site-table th:last-child,
html[data-theme="modern"] .site-table td:last-child {
  background: inherit !important;
  box-shadow: -1px 0 0 var(--ops-border) !important;
}

html[data-theme="modern"] .site-table th:last-child {
  background: var(--ops-table-head) !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  border-color: var(--ops-border-strong) !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] input::placeholder,
html[data-theme="modern"] textarea::placeholder {
  color: #8a97a6 !important;
}

html[data-theme="modern"] button,
html[data-theme="modern"] .primary {
  border-color: var(--ops-blue) !important;
  background: var(--ops-blue) !important;
  color: #ffffff !important;
}

html[data-theme="modern"] button:hover,
html[data-theme="modern"] .primary:hover {
  border-color: var(--ops-blue-hover) !important;
  background: var(--ops-blue-hover) !important;
}

html[data-theme="modern"] button.secondary,
html[data-theme="modern"] .secondary {
  border-color: var(--ops-border-strong) !important;
  background: #f6f9fc !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] button.secondary:hover,
html[data-theme="modern"] .secondary:hover {
  border-color: #9eb2c8 !important;
  background: #e8f0f8 !important;
  color: #1f2937 !important;
}

html[data-theme="modern"] .status,
html[data-theme="modern"] .ok-pill,
html[data-theme="modern"] .bad-pill {
  border-color: var(--ops-border) !important;
  background: #f6f9fc !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .modal {
  background: rgba(38, 56, 77, 0.38) !important;
}

html[data-theme="modern"] ::-webkit-scrollbar-track {
  background: #dbe5ef !important;
}

html[data-theme="modern"] ::-webkit-scrollbar-thumb {
  border-color: #dbe5ef !important;
  background: #9eb2c8 !important;
}

/* Modern operations table v90: remove remaining black panels in deep views. */
html[data-theme="modern"] .content,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .chart-grid,
html[data-theme="modern"] .node-realtime-grid {
  background: var(--ops-bg) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-kpi-card,
html[data-theme="modern"] .analysis-chart-card,
html[data-theme="modern"] .chart-card,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar,
html[data-theme="modern"] .filter-bar,
html[data-theme="modern"] .monitor-tabs,
html[data-theme="modern"] .theme-choice-card,
html[data-theme="modern"] .security-card,
html[data-theme="modern"] .domain-security-layout,
html[data-theme="modern"] .dispatch-node-toolbar,
html[data-theme="modern"] .dispatch-node-column,
html[data-theme="modern"] .dispatch-node-card,
html[data-theme="modern"] .analysis-empty-chart {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.06) !important;
}

html[data-theme="modern"] .analysis-kpi-card::after,
html[data-theme="modern"] .metrics div::after,
html[data-theme="modern"] .commercial-stat::after,
html[data-theme="modern"] .summary-card::after {
  background: #dff0fb !important;
  opacity: 0.9 !important;
}

html[data-theme="modern"] .analysis-card-head,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .section-head,
html[data-theme="modern"] .enterprise-section-head {
  border-color: var(--ops-border) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-card-head h3,
html[data-theme="modern"] .analysis-table-head h3,
html[data-theme="modern"] .chart-card h3,
html[data-theme="modern"] .analysis-kpi-card strong,
html[data-theme="modern"] .analysis-bar-row strong,
html[data-theme="modern"] .dispatch-node-main strong,
html[data-theme="modern"] .node-name-cell strong {
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-card-head p,
html[data-theme="modern"] .analysis-table-head p,
html[data-theme="modern"] .analysis-card-head > span,
html[data-theme="modern"] .analysis-table-head > span,
html[data-theme="modern"] .analysis-kpi-card span,
html[data-theme="modern"] .analysis-kpi-card small,
html[data-theme="modern"] .analysis-bar-name,
html[data-theme="modern"] .node-name-cell span,
html[data-theme="modern"] .dispatch-node-toolbar-info span {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .analysis-tabs button,
html[data-theme="modern"] .analysis-toolbar button,
html[data-theme="modern"] .monitor-tabs button {
  border-color: var(--ops-border-strong) !important;
  background: #f6f9fc !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-tabs button.active,
html[data-theme="modern"] .analysis-toolbar button.active,
html[data-theme="modern"] .monitor-tabs button.active,
html[data-theme="modern"] .theme-choice-card.active {
  border-color: #7db4ec !important;
  background: #e8f4ff !important;
  color: #1f4f7f !important;
  box-shadow: inset 0 0 0 1px #b7d8f7 !important;
}

html[data-theme="modern"] .analysis-bar-row {
  border-color: var(--ops-border) !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-bar-rank {
  background: #e8f0f8 !important;
  color: #26384d !important;
}

html[data-theme="modern"] .analysis-bar-track {
  background: #e3ebf4 !important;
}

html[data-theme="modern"] .analysis-bar-track i {
  background: linear-gradient(90deg, #2f74c0, #49a3d8) !important;
}

html[data-theme="modern"] code,
html[data-theme="modern"] .ip-code,
html[data-theme="modern"] pre {
  border-color: var(--ops-border) !important;
  background: #f3f7fb !important;
  color: #1f2937 !important;
}

html[data-theme="modern"] .message,
html[data-theme="modern"] .muted,
html[data-theme="modern"] .eyebrow {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .status.installed,
html[data-theme="modern"] .status.ready,
html[data-theme="modern"] .ok-pill {
  border-color: #9fd7b5 !important;
  background: #edf9f1 !important;
  color: #17633a !important;
}

html[data-theme="modern"] .status.pending,
html[data-theme="modern"] .status.paused {
  border-color: #f4d38a !important;
  background: #fff7df !important;
  color: #8a5a00 !important;
}

html[data-theme="modern"] .status.error,
html[data-theme="modern"] .bad-pill {
  border-color: #f2b8b5 !important;
  background: #fff1f0 !important;
  color: #9b1c1c !important;
}

html[data-theme="modern"] .analysis-trend-svg,
html[data-theme="modern"] canvas {
  background: transparent !important;
}

/* Modern operations table v93: broad readability guard for generated deep views. */
html[data-theme="modern"] .modal-content,
html[data-theme="modern"] .modal-body,
html[data-theme="modern"] .modal-foot,
html[data-theme="modern"] .drawer,
html[data-theme="modern"] .dropdown,
html[data-theme="modern"] .menu,
html[data-theme="modern"] .tabs,
html[data-theme="modern"] .tab-panel,
html[data-theme="modern"] .form-grid,
html[data-theme="modern"] .settings-grid,
html[data-theme="modern"] .settings-form,
html[data-theme="modern"] .node-form,
html[data-theme="modern"] .batch-form,
html[data-theme="modern"] .list-panel,
html[data-theme="modern"] .list-card,
html[data-theme="modern"] .log-panel,
html[data-theme="modern"] .log-card,
html[data-theme="modern"] .event-card,
html[data-theme="modern"] .detail-card,
html[data-theme="modern"] .empty-state,
html[data-theme="modern"] .feature-card,
html[data-theme="modern"] .quota-card,
html[data-theme="modern"] .revenue-card,
html[data-theme="modern"] .payment-card,
html[data-theme="modern"] .certificate-card,
html[data-theme="modern"] .task-card,
html[data-theme="modern"] .alert-card {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.06) !important;
}

html[data-theme="modern"] .modal-content *,
html[data-theme="modern"] .settings-form *,
html[data-theme="modern"] .node-form *,
html[data-theme="modern"] .list-panel *,
html[data-theme="modern"] .log-panel *,
html[data-theme="modern"] .detail-card * {
  text-shadow: none !important;
}

html[data-theme="modern"] .site-table tr,
html[data-theme="modern"] .site-table tbody tr,
html[data-theme="modern"] .site-table tbody tr.is-even {
  background: transparent !important;
}

html[data-theme="modern"] .site-table td,
html[data-theme="modern"] .site-table td:last-child,
html[data-theme="modern"] .site-table tbody tr:nth-child(even) td {
  background: #ffffff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even) td {
  background: var(--ops-surface-soft) !important;
}

html[data-theme="modern"] .site-table tbody tr:hover td,
html[data-theme="modern"] .site-table tbody tr.is-selected td {
  background: #edf5ff !important;
}

html[data-theme="modern"] .modal-content h1,
html[data-theme="modern"] .modal-content h2,
html[data-theme="modern"] .modal-content h3,
html[data-theme="modern"] .modal-content h4,
html[data-theme="modern"] .settings-form strong,
html[data-theme="modern"] .node-form strong,
html[data-theme="modern"] .list-panel strong,
html[data-theme="modern"] .detail-card strong {
  color: var(--ops-text) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] .modal-content p,
html[data-theme="modern"] .modal-content small,
html[data-theme="modern"] .settings-form small,
html[data-theme="modern"] .node-form small,
html[data-theme="modern"] .list-panel small,
html[data-theme="modern"] .detail-card small {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .badge,
html[data-theme="modern"] .pill,
html[data-theme="modern"] .tag,
html[data-theme="modern"] .chip {
  border-color: var(--ops-border) !important;
  background: #f3f7fb !important;
  color: var(--ops-text) !important;
}

.access-log-filters {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}

.access-log-filters button {
  min-height: 36px;
}

.ops-queue-board {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d5e0ec;
  border-radius: 8px;
  background: #f8fbfe;
}

.ops-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ops-queue-head strong {
  font-size: 16px;
}

.ops-queue-head span {
  color: #5f6f82;
  font-size: 13px;
}

.ops-queue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.ops-queue-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe5ef;
  border-radius: 6px;
  background: #ffffff;
}

.ops-queue-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-queue-main strong,
.ops-queue-main small,
.ops-queue-row p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-queue-main small,
.ops-queue-row p {
  margin: 0;
  color: #5f6f82;
  font-size: 12px;
}

.ops-queue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ops-queue-metrics span {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 4px;
  background: #edf4fb;
  color: #243447;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.ops-queue-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1eaf4;
}

.ops-queue-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f74c0, #4fb3d8);
}

html[data-theme="modern"] .ops-queue-board,
html[data-theme="modern"] .ops-queue-row {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.06) !important;
}

html[data-theme="modern"] .ops-queue-head span,
html[data-theme="modern"] .ops-queue-main small,
html[data-theme="modern"] .ops-queue-row p {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .ops-queue-metrics span {
  background: var(--ops-surface-strong) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .ops-queue-progress {
  background: #dbe5ef !important;
}

@media (max-width: 720px) {
  .ops-queue-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-queue-list {
    grid-template-columns: 1fr;
  }

  .ops-queue-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final modern ops readability pass: keep only the modern theme scoped. */
html[data-theme="modern"] {
  --ops-bg: #eef3f8;
  --ops-surface: #ffffff;
  --ops-surface-soft: #f7fafd;
  --ops-surface-strong: #e8f0f8;
  --ops-border: #cbd7e4;
  --ops-border-strong: #aebfd1;
  --ops-text: #1f2a37;
  --ops-muted: #536273;
  --ops-blue: #2f74c0;
  --ops-blue-hover: #245f9f;
}

html[data-theme="modern"],
html[data-theme="modern"] body,
html[data-theme="modern"] .app-shell,
html[data-theme="modern"] main,
html[data-theme="modern"] .content,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .chart-grid,
html[data-theme="modern"] .node-realtime-grid {
  background: var(--ops-bg) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] main {
  width: 100% !important;
}

html[data-theme="modern"] h1,
html[data-theme="modern"] h2,
html[data-theme="modern"] h3,
html[data-theme="modern"] h4,
html[data-theme="modern"] h5,
html[data-theme="modern"] strong,
html[data-theme="modern"] b,
html[data-theme="modern"] .node-card-head h4,
html[data-theme="modern"] .node-card-head code,
html[data-theme="modern"] .node-metric strong,
html[data-theme="modern"] .upgrade-block-summary h3,
html[data-theme="modern"] .node-metric-value,
html[data-theme="modern"] .dispatch-node-main strong,
html[data-theme="modern"] .dispatch-node-table td,
html[data-theme="modern"] .enterprise-table td,
html[data-theme="modern"] .analysis-kpi-card strong,
html[data-theme="modern"] .analysis-bar-row strong,
html[data-theme="modern"] .analysis-table-head h3,
html[data-theme="modern"] .analysis-card-head h3 {
  color: var(--ops-text) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}

html[data-theme="modern"] p,
html[data-theme="modern"] small,
html[data-theme="modern"] label,
html[data-theme="modern"] .muted,
html[data-theme="modern"] .message,
html[data-theme="modern"] .eyebrow,
html[data-theme="modern"] .section-head p,
html[data-theme="modern"] .analysis-kpi-card span,
html[data-theme="modern"] .analysis-kpi-card small,
html[data-theme="modern"] .analysis-card-head p,
html[data-theme="modern"] .analysis-table-head p,
html[data-theme="modern"] .analysis-bar-name,
html[data-theme="modern"] .node-card-meta,
html[data-theme="modern"] .node-card-meta span,
html[data-theme="modern"] .node-metric span,
html[data-theme="modern"] .node-metric small,
html[data-theme="modern"] .upgrade-block-details small,
html[data-theme="modern"] .dispatch-node-main small,
html[data-theme="modern"] .dispatch-node-meta small,
html[data-theme="modern"] .install-log-row small,
html[data-theme="modern"] .install-log-row time {
  color: var(--ops-muted) !important;
  text-shadow: none !important;
}

html[data-theme="modern"] .topbar,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .dns-panel,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .enterprise-panel,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card,
html[data-theme="modern"] .summary-card,
html[data-theme="modern"] .settings-note,
html[data-theme="modern"] .analysis-kpi-card,
html[data-theme="modern"] .analysis-chart-card,
html[data-theme="modern"] .chart-card,
html[data-theme="modern"] .security-card,
html[data-theme="modern"] .security-summary-card,
html[data-theme="modern"] .node-summary-item,
html[data-theme="modern"] .node-monitor-card,
html[data-theme="modern"] .node-metric,
html[data-theme="modern"] .upgrade-block-details,
html[data-theme="modern"] .dispatch-node-assignment-card,
html[data-theme="modern"] .dispatch-node-toolbar,
html[data-theme="modern"] .dispatch-node-column,
html[data-theme="modern"] .dispatch-node-card,
html[data-theme="modern"] .dispatch-node-table-wrap,
html[data-theme="modern"] .theme-choice-card,
html[data-theme="modern"] .install-log-panel,
html[data-theme="modern"] .install-log-row,
html[data-theme="modern"] .domain-section-title,
html[data-theme="modern"] .embedded-table-card,
html[data-theme="modern"] .visual-rule-row,
html[data-theme="modern"] .waf-module-item,
html[data-theme="modern"] .ruleset-row,
html[data-theme="modern"] .empty-inline,
html[data-theme="modern"] .modal-panel,
html[data-theme="modern"] .modal-head,
html[data-theme="modern"] .modal-body,
html[data-theme="modern"] .modal-foot {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.06) !important;
}

html[data-theme="modern"] .upgrade-block-details code {
  border: 1px solid var(--ops-border) !important;
  background: var(--ops-bg-soft) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .commercial-stat,
html[data-theme="modern"] .commercial-feature,
html[data-theme="modern"] .metrics div,
html[data-theme="modern"] .quota-grid div,
html[data-theme="modern"] .compact-stat-grid > *,
html[data-theme="modern"] .security-overview-strip > div,
html[data-theme="modern"] .overview-user-card {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .commercial-stat span,
html[data-theme="modern"] .commercial-feature span,
html[data-theme="modern"] .metrics span,
html[data-theme="modern"] .quota-grid span,
html[data-theme="modern"] .summary-card span,
html[data-theme="modern"] .node-summary-item span,
html[data-theme="modern"] .node-summary-item small {
  color: var(--ops-muted) !important;
}

html[data-theme="modern"] .commercial-stat strong,
html[data-theme="modern"] .commercial-feature strong,
html[data-theme="modern"] .metrics strong,
html[data-theme="modern"] .quota-grid strong,
html[data-theme="modern"] .summary-card strong,
html[data-theme="modern"] .node-summary-item strong {
  color: var(--ops-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  border-color: var(--ops-border-strong) !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] input::placeholder,
html[data-theme="modern"] textarea::placeholder {
  color: #7d8a99 !important;
}

html[data-theme="modern"] input:disabled,
html[data-theme="modern"] select:disabled,
html[data-theme="modern"] textarea:disabled,
html[data-theme="modern"] button:disabled {
  cursor: wait !important;
  opacity: 0.78 !important;
}

html[data-theme="modern"] button,
html[data-theme="modern"] .button-link:not(.secondary) {
  position: relative;
  border-color: var(--ops-blue) !important;
  background: var(--ops-blue) !important;
  color: #ffffff !important;
}

html[data-theme="modern"] button:hover,
html[data-theme="modern"] .button-link:not(.secondary):hover {
  border-color: var(--ops-blue-hover) !important;
  background: var(--ops-blue-hover) !important;
}

html[data-theme="modern"] button.is-busy {
  padding-right: 26px !important;
}

html[data-theme="modern"] button.is-busy::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: opsButtonSpin 0.8s linear infinite;
}

@keyframes opsButtonSpin {
  to { transform: rotate(360deg); }
}

.app-toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #d5e0ea;
  border-left: 4px solid #2f80ed;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2733;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  pointer-events: auto;
  animation: appToastIn 0.16s ease-out;
}

.app-toast-success {
  border-left-color: #1f9d55;
}

.app-toast-error {
  border-left-color: #d14343;
}

.app-toast-body {
  min-width: 0;
  white-space: pre-line;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.55;
}

.app-toast-close {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #667085;
  font-size: 18px;
  line-height: 22px;
  box-shadow: none;
}

.app-toast-close:hover {
  background: #eef3f8;
  color: #1d2733;
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes appToastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html[data-theme="modern"] .app-toast {
  border-color: var(--ops-border-strong) !important;
  border-left-color: #2f80ed !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="modern"] .app-toast-success {
  border-left-color: #1f9d55 !important;
}

html[data-theme="modern"] .app-toast-error {
  border-left-color: #d14343 !important;
}

html[data-theme="modern"] .app-toast-close {
  border: 0 !important;
  background: transparent !important;
  color: #667085 !important;
}

html[data-theme="modern"] .app-toast-close:hover {
  background: #eef3f8 !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] button.secondary,
html[data-theme="modern"] .button-link.secondary,
html[data-theme="modern"] .secondary {
  border-color: var(--ops-border-strong) !important;
  background: #f6f9fc !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] button.secondary:hover,
html[data-theme="modern"] .button-link.secondary:hover,
html[data-theme="modern"] .secondary:hover {
  border-color: #92a9c1 !important;
  background: #e8f0f8 !important;
}

html[data-theme="modern"] .list-toolbar,
html[data-theme="modern"] .analysis-toolbar,
html[data-theme="modern"] .analytics-filters,
html[data-theme="modern"] .access-log-filters,
html[data-theme="modern"] .filter-bar,
html[data-theme="modern"] .monitor-tabs,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .dns-actions,
html[data-theme="modern"] .domain-form-actions,
html[data-theme="modern"] .security-quick-nav {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .access-log-filters,
html[data-theme="modern"] .analytics-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: 10px !important;
}

html[data-theme="modern"] .analysis-dashboard {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .analysis-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}

html[data-theme="modern"] .analysis-trend-card,
html[data-theme="modern"] .analysis-visual-grid,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .ranking-table,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar {
  width: 100% !important;
  max-width: none !important;
  grid-column: 1 / -1 !important;
}

html[data-theme="modern"] .analysis-visual-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

html[data-theme="modern"] .analysis-kpi-card {
  min-height: 108px !important;
  padding: 16px !important;
}

html[data-theme="modern"] .analysis-kpi-card::after,
html[data-theme="modern"] .metrics div::after,
html[data-theme="modern"] .summary-card::after,
html[data-theme="modern"] .commercial-stat::after {
  display: none !important;
}

html[data-theme="modern"] .site-table,
html[data-theme="modern"] .dispatch-node-table,
html[data-theme="modern"] .enterprise-table,
html[data-theme="modern"] .table-wrap table {
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table th,
html[data-theme="modern"] .dispatch-node-table th,
html[data-theme="modern"] .enterprise-table th,
html[data-theme="modern"] .table-wrap th {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface-strong) !important;
  color: #26384d !important;
}

html[data-theme="modern"] .site-table td,
html[data-theme="modern"] .dispatch-node-table td,
html[data-theme="modern"] .enterprise-table td,
html[data-theme="modern"] .table-wrap td {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even) td,
html[data-theme="modern"] .site-table tbody tr.is-even td,
html[data-theme="modern"] .dispatch-node-table tbody tr:nth-child(even) td,
html[data-theme="modern"] .enterprise-table tbody tr:nth-child(even) td {
  background: var(--ops-surface-soft) !important;
}

html[data-theme="modern"] .site-table tbody tr:hover td,
html[data-theme="modern"] .dispatch-node-table tbody tr:hover td,
html[data-theme="modern"] .enterprise-table tbody tr:hover td {
  background: #edf5ff !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .status,
html[data-theme="modern"] .ok-pill,
html[data-theme="modern"] .bad-pill,
html[data-theme="modern"] .tag,
html[data-theme="modern"] .chip,
html[data-theme="modern"] .badge,
html[data-theme="modern"] .pill {
  border-color: var(--ops-border) !important;
  background: #f3f7fb !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .status.installed,
html[data-theme="modern"] .status.ready,
html[data-theme="modern"] .status.issued,
html[data-theme="modern"] .status.hit,
html[data-theme="modern"] .ok-pill,
html[data-theme="modern"] .node-health-pill,
html[data-theme="modern"] .node-monitor-card.online .node-health-pill {
  border-color: #9fd7b5 !important;
  background: #edf9f1 !important;
  color: #17633a !important;
}

html[data-theme="modern"] .status.pending,
html[data-theme="modern"] .status.paused,
html[data-theme="modern"] .status.installing,
html[data-theme="modern"] .status.miss,
html[data-theme="modern"] .status.bypass,
html[data-theme="modern"] .node-health-pill.warning {
  border-color: #f4d38a !important;
  background: #fff7df !important;
  color: #8a5a00 !important;
}

html[data-theme="modern"] .status.error,
html[data-theme="modern"] .status.offline,
html[data-theme="modern"] .bad-pill,
html[data-theme="modern"] .node-health-pill.error {
  border-color: #f2b8b5 !important;
  background: #fff1f0 !important;
  color: #9b1c1c !important;
}

html[data-theme="modern"] code,
html[data-theme="modern"] pre,
html[data-theme="modern"] .ip-code,
html[data-theme="modern"] .port-badges code,
html[data-theme="modern"] .node-ip-select,
html[data-theme="modern"] .node-latency-select {
  border-color: var(--ops-border) !important;
  background: #f3f7fb !important;
  color: #1f2937 !important;
}

html[data-theme="modern"] .install-log-title,
html[data-theme="modern"] .install-log-step,
html[data-theme="modern"] .install-log-message {
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .install-log-row.recovered {
  border-color: #f4d38a !important;
  background: #fff7df !important;
}

@media (max-width: 1380px) {
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html[data-theme="modern"] .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-visual-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v107-final: keep the CDNFly-like operations layout as the last applied rule. */
html[data-theme="modern"] .app-shell {
  grid-template-columns: 256px minmax(0, 1fr) !important;
  column-gap: 0 !important;
}

html[data-theme="modern"] .sidebar {
  box-sizing: border-box !important;
  width: 256px !important;
  max-width: 256px !important;
  padding: 12px 10px !important;
  overflow-x: hidden !important;
}

html[data-theme="modern"] main,
html[data-theme="modern"] .content,
html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .ranking-table {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] main {
  padding: 14px 16px 28px !important;
}

html[data-theme="modern"] .access-log-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table {
  min-width: 1720px !important;
  table-layout: fixed !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table {
  min-width: 0 !important;
  table-layout: auto !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table th,
html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table td {
  width: auto !important;
}

/* v107: final modern operations layout guard. This block intentionally stays
   last so older modern-theme experiments cannot reintroduce the wide blank
   gutter or squeeze access-log columns into vertical text. */
html[data-theme="modern"] .app-shell {
  grid-template-columns: 256px minmax(0, 1fr) !important;
  column-gap: 0 !important;
}

html[data-theme="modern"] .sidebar {
  width: 256px !important;
  padding: 12px 10px !important;
}

html[data-theme="modern"] main {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: 14px 16px 28px !important;
}

html[data-theme="modern"] .content,
html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .overview-grid,
html[data-theme="modern"] .metrics,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .ranking-table {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] .topbar {
  min-height: 48px !important;
  margin-bottom: 10px !important;
  padding: 10px 14px !important;
}

html[data-theme="modern"] .analytics-panel {
  overflow: visible !important;
  padding: 12px !important;
}

html[data-theme="modern"] .analytics-filters,
html[data-theme="modern"] .access-log-filters,
html[data-theme="modern"] .analysis-toolbar {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  padding: 10px !important;
  overflow: visible !important;
}

html[data-theme="modern"] .analytics-filters input,
html[data-theme="modern"] .analytics-filters select,
html[data-theme="modern"] .analytics-filters button,
html[data-theme="modern"] .analysis-toolbar input,
html[data-theme="modern"] .analysis-toolbar select,
html[data-theme="modern"] .analysis-toolbar button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
}

html[data-theme="modern"] .access-log-filters #accessLogKeyword {
  grid-column: span 2 !important;
}

html[data-theme="modern"] .access-log-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid var(--ops-border) !important;
  border-radius: 6px !important;
  background: var(--ops-surface) !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table {
  width: 100% !important;
  min-width: 1720px !important;
  table-layout: fixed !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table th,
html[data-theme="modern"] .access-log-table-wrap .log-table td {
  padding: 10px 9px !important;
  vertical-align: top !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(1),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(1) { width: 132px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(2),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(2) { width: 150px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(3),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(3) { width: 150px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(4),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(4) { width: 78px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(5),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(5) { width: 150px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(6),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(6) { width: 74px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(7),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(7) { width: 220px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(8),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(8),
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(9),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(9) { width: 86px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(10),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(10),
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(11),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(11),
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(13),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(13) { width: 86px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(12),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(12) { width: 140px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(14),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(14) { width: 190px !important; }
html[data-theme="modern"] .access-log-table-wrap .log-table th:nth-child(15),
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(15) { width: 270px !important; }

html[data-theme="modern"] .access-log-table-wrap .log-table code,
html[data-theme="modern"] .access-log-table-wrap .log-table .ua-cell {
  display: block !important;
  max-width: none !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table {
  min-width: 0 !important;
  table-layout: auto !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table th,
html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table td {
  width: auto !important;
}

@media (max-width: 1440px) {
  html[data-theme="modern"] .analytics-filters,
  html[data-theme="modern"] .access-log-filters,
  html[data-theme="modern"] .analysis-toolbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
  }

  html[data-theme="modern"] .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .sidebar {
    width: 100% !important;
  }

  html[data-theme="modern"] .analytics-filters,
  html[data-theme="modern"] .access-log-filters,
  html[data-theme="modern"] .analysis-toolbar,
  html[data-theme="modern"] .metrics {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .access-log-filters #accessLogKeyword {
    grid-column: auto !important;
  }
}

/* v106: cdnfly-like operations layout. Keep modern pages compact, full-width,
   and table-first instead of centered with empty columns. */
html[data-theme="modern"] .app-shell {
  grid-template-columns: 256px minmax(0, 1fr) !important;
}

html[data-theme="modern"] .sidebar {
  width: 256px !important;
  padding: 12px 10px !important;
}

html[data-theme="modern"] main {
  min-width: 0 !important;
  width: 100% !important;
  padding: 14px 16px 28px !important;
}

html[data-theme="modern"] .content,
html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .overview-grid,
html[data-theme="modern"] .metrics,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .panel {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] .topbar {
  min-height: 48px !important;
  margin-bottom: 10px !important;
  padding: 10px 14px !important;
}

html[data-theme="modern"] .metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

html[data-theme="modern"] .analytics-panel {
  overflow: visible !important;
  padding: 12px !important;
}

html[data-theme="modern"] .analytics-filters,
html[data-theme="modern"] .access-log-filters,
html[data-theme="modern"] .analysis-toolbar {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  padding: 10px !important;
  overflow: visible !important;
}

html[data-theme="modern"] .access-log-filters #accessLogKeyword {
  grid-column: span 2 !important;
}

html[data-theme="modern"] .analytics-filters input,
html[data-theme="modern"] .analytics-filters select,
html[data-theme="modern"] .analytics-filters button,
html[data-theme="modern"] .analysis-toolbar input,
html[data-theme="modern"] .analysis-toolbar select,
html[data-theme="modern"] .analysis-toolbar button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
}

html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .analysis-kpi-grid,
html[data-theme="modern"] .analysis-trend-card,
html[data-theme="modern"] .analysis-visual-grid,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .ranking-table,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] .access-log-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid var(--ops-border) !important;
  border-radius: 6px !important;
  background: var(--ops-surface) !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table {
  min-width: 1720px !important;
  table-layout: fixed !important;
}

html[data-theme="modern"] .log-table th,
html[data-theme="modern"] .log-table td {
  padding: 10px 9px !important;
  vertical-align: top !important;
}

html[data-theme="modern"] .log-table th:nth-child(1),
html[data-theme="modern"] .log-table td:nth-child(1) { width: 132px !important; }
html[data-theme="modern"] .log-table th:nth-child(2),
html[data-theme="modern"] .log-table td:nth-child(2) { width: 150px !important; }
html[data-theme="modern"] .log-table th:nth-child(3),
html[data-theme="modern"] .log-table td:nth-child(3) { width: 150px !important; }
html[data-theme="modern"] .log-table th:nth-child(4),
html[data-theme="modern"] .log-table td:nth-child(4) { width: 78px !important; }
html[data-theme="modern"] .log-table th:nth-child(5),
html[data-theme="modern"] .log-table td:nth-child(5) { width: 150px !important; }
html[data-theme="modern"] .log-table th:nth-child(6),
html[data-theme="modern"] .log-table td:nth-child(6) { width: 74px !important; }
html[data-theme="modern"] .log-table th:nth-child(7),
html[data-theme="modern"] .log-table td:nth-child(7) { width: 220px !important; }
html[data-theme="modern"] .log-table th:nth-child(8),
html[data-theme="modern"] .log-table td:nth-child(8),
html[data-theme="modern"] .log-table th:nth-child(9),
html[data-theme="modern"] .log-table td:nth-child(9) { width: 86px !important; }
html[data-theme="modern"] .log-table th:nth-child(10),
html[data-theme="modern"] .log-table td:nth-child(10),
html[data-theme="modern"] .log-table th:nth-child(11),
html[data-theme="modern"] .log-table td:nth-child(11),
html[data-theme="modern"] .log-table th:nth-child(13),
html[data-theme="modern"] .log-table td:nth-child(13) { width: 86px !important; }
html[data-theme="modern"] .log-table th:nth-child(12),
html[data-theme="modern"] .log-table td:nth-child(12) { width: 140px !important; }
html[data-theme="modern"] .log-table th:nth-child(14),
html[data-theme="modern"] .log-table td:nth-child(14) { width: 190px !important; }
html[data-theme="modern"] .log-table th:nth-child(15),
html[data-theme="modern"] .log-table td:nth-child(15) { width: 270px !important; }

html[data-theme="modern"] .log-table code,
html[data-theme="modern"] .log-table .ua-cell {
  display: block !important;
  max-width: none !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}

html[data-theme="modern"] .site-table td,
html[data-theme="modern"] .site-table th {
  word-break: normal !important;
}

html[data-theme="modern"] .site-table td:nth-child(5) a,
html[data-theme="modern"] .site-table td:nth-child(7) code {
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 1440px) {
  html[data-theme="modern"] .analytics-filters,
  html[data-theme="modern"] .access-log-filters,
  html[data-theme="modern"] .analysis-toolbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
  }

  html[data-theme="modern"] .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .sidebar {
    width: 100% !important;
  }

  html[data-theme="modern"] .analytics-filters,
  html[data-theme="modern"] .access-log-filters,
  html[data-theme="modern"] .analysis-toolbar,
  html[data-theme="modern"] .metrics {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .access-log-filters #accessLogKeyword {
    grid-column: auto !important;
  }
}

/* v103: final ops-table guard. The modern theme is now a light operations table,
   so generated dark leftovers must not make text unreadable. */
html[data-theme="modern"] {
  --ops-bg: #edf3f8;
  --ops-surface: #ffffff;
  --ops-surface-soft: #f7fafc;
  --ops-surface-strong: #e8f1f9;
  --ops-text: #172033;
  --ops-muted: #405168;
  --ops-faint: #5d6e83;
  --ops-border: #c8d6e5;
  --ops-border-strong: #a7bbcf;
  --ops-primary: #2473c7;
  --ops-primary-hover: #1c5fa7;
}

html[data-theme="modern"] body,
html[data-theme="modern"] .app-shell,
html[data-theme="modern"] main,
html[data-theme="modern"] .content {
  background: var(--ops-bg) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .metric-card,
html[data-theme="modern"] .stat-card,
html[data-theme="modern"] .summary-card,
html[data-theme="modern"] .node-summary-item,
html[data-theme="modern"] .node-monitor-card,
html[data-theme="modern"] .node-metric,
html[data-theme="modern"] .node-card-status-row > *,
html[data-theme="modern"] .dispatch-node-card,
html[data-theme="modern"] .dispatch-node-column,
html[data-theme="modern"] .dispatch-node-toolbar,
html[data-theme="modern"] .install-log-panel,
html[data-theme="modern"] .install-log-row,
html[data-theme="modern"] .analysis-kpi-card,
html[data-theme="modern"] .analysis-chart-card,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .list-toolbar,
html[data-theme="modern"] .filter-bar,
html[data-theme="modern"] .modal-content,
html[data-theme="modern"] .modal-panel,
html[data-theme="modern"] .modal-body,
html[data-theme="modern"] .modal-foot,
html[data-theme="modern"] .empty-inline {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.06) !important;
  text-shadow: none !important;
}

html[data-theme="modern"] h1,
html[data-theme="modern"] h2,
html[data-theme="modern"] h3,
html[data-theme="modern"] h4,
html[data-theme="modern"] h5,
html[data-theme="modern"] strong,
html[data-theme="modern"] b,
html[data-theme="modern"] .node-card-head h4,
html[data-theme="modern"] .node-card-head code,
html[data-theme="modern"] .node-metric strong,
html[data-theme="modern"] .node-metric-value,
html[data-theme="modern"] .dispatch-node-main strong,
html[data-theme="modern"] .dispatch-node-main code,
html[data-theme="modern"] .dispatch-node-meta strong,
html[data-theme="modern"] .analysis-kpi-card strong,
html[data-theme="modern"] .analysis-bar-row strong,
html[data-theme="modern"] .analysis-card-head h3,
html[data-theme="modern"] .analysis-table-head h3,
html[data-theme="modern"] .site-table strong,
html[data-theme="modern"] .site-table b,
html[data-theme="modern"] .site-table a {
  color: var(--ops-text) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}

html[data-theme="modern"] p,
html[data-theme="modern"] small,
html[data-theme="modern"] label,
html[data-theme="modern"] .muted,
html[data-theme="modern"] .message,
html[data-theme="modern"] .eyebrow,
html[data-theme="modern"] .section-head p,
html[data-theme="modern"] .node-card-meta,
html[data-theme="modern"] .node-card-meta span,
html[data-theme="modern"] .node-metric span,
html[data-theme="modern"] .node-metric small,
html[data-theme="modern"] .dispatch-node-main small,
html[data-theme="modern"] .dispatch-node-meta small,
html[data-theme="modern"] .analysis-kpi-card span,
html[data-theme="modern"] .analysis-kpi-card small,
html[data-theme="modern"] .analysis-card-head p,
html[data-theme="modern"] .analysis-table-head p,
html[data-theme="modern"] .analysis-bar-name,
html[data-theme="modern"] .site-table small,
html[data-theme="modern"] .site-table .muted,
html[data-theme="modern"] .site-table span {
  color: var(--ops-muted) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}

html[data-theme="modern"] .node-summary-item strong,
html[data-theme="modern"] .node-summary-item.installed strong {
  color: #17633a !important;
}

html[data-theme="modern"] .node-summary-item.pending strong {
  color: #8a5a00 !important;
}

html[data-theme="modern"] .node-summary-item.error strong {
  color: #9b1c1c !important;
}

html[data-theme="modern"] .site-table,
html[data-theme="modern"] .dispatch-node-table,
html[data-theme="modern"] .enterprise-table,
html[data-theme="modern"] .table-wrap table {
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .site-table th,
html[data-theme="modern"] .dispatch-node-table th,
html[data-theme="modern"] .enterprise-table th,
html[data-theme="modern"] .table-wrap th {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface-strong) !important;
  color: #24364b !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] .site-table td,
html[data-theme="modern"] .dispatch-node-table td,
html[data-theme="modern"] .enterprise-table td,
html[data-theme="modern"] .table-wrap td {
  border-color: var(--ops-border) !important;
  background: var(--ops-surface) !important;
  color: var(--ops-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] .site-table tbody tr:nth-child(even) td,
html[data-theme="modern"] .site-table tbody tr.is-even td,
html[data-theme="modern"] .dispatch-node-table tbody tr:nth-child(even) td,
html[data-theme="modern"] .enterprise-table tbody tr:nth-child(even) td {
  background: var(--ops-surface-soft) !important;
}

html[data-theme="modern"] .site-table tbody tr:hover td,
html[data-theme="modern"] .dispatch-node-table tbody tr:hover td,
html[data-theme="modern"] .enterprise-table tbody tr:hover td {
  background: #edf5ff !important;
}

html[data-theme="modern"] input,
html[data-theme="modern"] select,
html[data-theme="modern"] textarea {
  border-color: var(--ops-border-strong) !important;
  background: #ffffff !important;
  color: var(--ops-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] input::placeholder,
html[data-theme="modern"] textarea::placeholder {
  color: #74869a !important;
}

html[data-theme="modern"] button,
html[data-theme="modern"] .button-link:not(.secondary) {
  border-color: var(--ops-primary) !important;
  background: var(--ops-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] button:hover,
html[data-theme="modern"] .button-link:not(.secondary):hover {
  border-color: var(--ops-primary-hover) !important;
  background: var(--ops-primary-hover) !important;
}

html[data-theme="modern"] button.secondary,
html[data-theme="modern"] .button-link.secondary,
html[data-theme="modern"] .secondary {
  border-color: var(--ops-border-strong) !important;
  background: #f5f8fb !important;
  color: var(--ops-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] button:disabled,
html[data-theme="modern"] button.is-busy {
  cursor: wait !important;
  opacity: 0.82 !important;
}

html[data-theme="modern"] .analysis-dashboard {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="modern"] .analysis-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
}

html[data-theme="modern"] .analysis-trend-card,
html[data-theme="modern"] .analysis-visual-grid,
html[data-theme="modern"] .analysis-table-head,
html[data-theme="modern"] .ranking-table,
html[data-theme="modern"] .analysis-tabs,
html[data-theme="modern"] .analysis-toolbar {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] .analysis-visual-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

html[data-theme="modern"] .analysis-kpi-card {
  min-height: 96px !important;
  border-radius: 6px !important;
}

html[data-theme="modern"] .analysis-kpi-card::after,
html[data-theme="modern"] .metrics div::after,
html[data-theme="modern"] .summary-card::after,
html[data-theme="modern"] .commercial-stat::after {
  display: none !important;
}

html[data-theme="modern"] .analysis-tabs button,
html[data-theme="modern"] .analysis-toolbar button,
html[data-theme="modern"] .monitor-tabs button {
  border-color: var(--ops-border-strong) !important;
  background: #f5f8fb !important;
  color: var(--ops-text) !important;
}

html[data-theme="modern"] .analysis-tabs button.active,
html[data-theme="modern"] .analysis-toolbar button.active,
html[data-theme="modern"] .monitor-tabs button.active {
  border-color: #83b8ee !important;
  background: #e7f2ff !important;
  color: #174d82 !important;
}

html[data-theme="modern"] code,
html[data-theme="modern"] pre,
html[data-theme="modern"] .ip-code,
html[data-theme="modern"] .port-badges code,
html[data-theme="modern"] .node-ip-select,
html[data-theme="modern"] .node-latency-select {
  border-color: var(--ops-border) !important;
  background: #f2f6fa !important;
  color: #172033 !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] .status,
html[data-theme="modern"] .badge,
html[data-theme="modern"] .pill,
html[data-theme="modern"] .tag,
html[data-theme="modern"] .chip {
  border-color: var(--ops-border) !important;
  background: #f2f6fa !important;
  color: var(--ops-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="modern"] .status.installed,
html[data-theme="modern"] .status.ready,
html[data-theme="modern"] .status.issued,
html[data-theme="modern"] .ok-pill,
html[data-theme="modern"] .node-health-pill {
  border-color: #9fd7b5 !important;
  background: #edf9f1 !important;
  color: #17633a !important;
}

html[data-theme="modern"] .status.pending,
html[data-theme="modern"] .status.paused,
html[data-theme="modern"] .status.installing,
html[data-theme="modern"] .node-health-pill.warning {
  border-color: #f4d38a !important;
  background: #fff7df !important;
  color: #8a5a00 !important;
}

html[data-theme="modern"] .status.error,
html[data-theme="modern"] .status.offline,
html[data-theme="modern"] .bad-pill,
html[data-theme="modern"] .node-health-pill.error {
  border-color: #f2b8b5 !important;
  background: #fff1f0 !important;
  color: #9b1c1c !important;
}

@media (max-width: 1380px) {
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html[data-theme="modern"] .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-visual-grid {
    grid-template-columns: 1fr !important;
  }
}
/* v107-final-eof: last applied guard for the modern operations table theme. */
html[data-theme="modern"] .app-shell {
  grid-template-columns: 256px minmax(0, 1fr) !important;
  column-gap: 0 !important;
}

html[data-theme="modern"] .sidebar {
  width: 256px !important;
  padding: 12px 10px !important;
}

html[data-theme="modern"] main,
html[data-theme="modern"] .content,
html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .domain-card,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .commercial-module-card,
html[data-theme="modern"] .panel,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .ranking-table {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme="modern"] main {
  padding: 14px 16px 28px !important;
}

html[data-theme="modern"] .access-log-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
}

html[data-theme="modern"] .access-log-table-wrap .log-table {
  min-width: 1720px !important;
  table-layout: fixed !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table {
  min-width: 0 !important;
  table-layout: auto !important;
}

html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table th,
html[data-theme="modern"] .analytics-panel:not(.access-log-panel) .log-table td {
  width: auto !important;
}
html[data-theme="modern"] .sidebar {
  box-sizing: border-box !important;
  width: 256px !important;
  max-width: 256px !important;
  padding: 12px 10px !important;
  overflow-x: hidden !important;
}

/* v110: shared operations layout guard for classic and modern themes. */
html[data-theme="modern"] .app-shell {
  grid-template-columns: 266px minmax(0, 1fr) !important;
  column-gap: 0 !important;
}

html[data-theme="modern"] .sidebar {
  box-sizing: border-box !important;
  width: 266px !important;
  max-width: 266px !important;
  padding: 12px 10px !important;
  overflow-x: hidden !important;
}

.analysis-kpi-grid,
html[data-theme="modern"] .analysis-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
}

.analysis-kpi-card,
html[data-theme="modern"] .analysis-kpi-card {
  min-width: 0 !important;
  border-radius: 8px !important;
}

.access-log-panel,
html[data-theme="modern"] .access-log-panel {
  overflow: visible !important;
}

.access-log-table-wrap,
html[data-theme="modern"] .access-log-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid var(--ops-border, #d7e2ef) !important;
  border-radius: 6px !important;
  background: var(--ops-surface, #fff) !important;
}

.access-log-table-wrap .log-table,
html[data-theme="modern"] .access-log-table-wrap .log-table {
  width: 100% !important;
  min-width: 2020px !important;
  table-layout: fixed !important;
}

.access-log-table-wrap .log-table th,
.access-log-table-wrap .log-table td,
html[data-theme="modern"] .access-log-table-wrap .log-table th,
html[data-theme="modern"] .access-log-table-wrap .log-table td {
  padding: 10px 9px !important;
  vertical-align: top !important;
  white-space: normal !important;
}

.access-log-table-wrap .log-table th:nth-child(1),
.access-log-table-wrap .log-table td:nth-child(1) { width: 132px !important; }
.access-log-table-wrap .log-table th:nth-child(2),
.access-log-table-wrap .log-table td:nth-child(2) { width: 140px !important; }
.access-log-table-wrap .log-table th:nth-child(3),
.access-log-table-wrap .log-table td:nth-child(3) { width: 150px !important; }
.access-log-table-wrap .log-table th:nth-child(4),
.access-log-table-wrap .log-table td:nth-child(4) { width: 78px !important; }
.access-log-table-wrap .log-table th:nth-child(5),
.access-log-table-wrap .log-table td:nth-child(5) { width: 170px !important; }
.access-log-table-wrap .log-table th:nth-child(6),
.access-log-table-wrap .log-table td:nth-child(6) { width: 72px !important; }
.access-log-table-wrap .log-table th:nth-child(7),
.access-log-table-wrap .log-table td:nth-child(7) { width: 330px !important; }
.access-log-table-wrap .log-table th:nth-child(8),
.access-log-table-wrap .log-table td:nth-child(8),
.access-log-table-wrap .log-table th:nth-child(9),
.access-log-table-wrap .log-table td:nth-child(9) { width: 86px !important; }
.access-log-table-wrap .log-table th:nth-child(10),
.access-log-table-wrap .log-table td:nth-child(10),
.access-log-table-wrap .log-table th:nth-child(11),
.access-log-table-wrap .log-table td:nth-child(11),
.access-log-table-wrap .log-table th:nth-child(13),
.access-log-table-wrap .log-table td:nth-child(13) { width: 86px !important; }
.access-log-table-wrap .log-table th:nth-child(12),
.access-log-table-wrap .log-table td:nth-child(12) { width: 150px !important; }
.access-log-table-wrap .log-table th:nth-child(14),
.access-log-table-wrap .log-table td:nth-child(14) { width: 240px !important; }
.access-log-table-wrap .log-table th:nth-child(15),
.access-log-table-wrap .log-table td:nth-child(15) { width: 350px !important; }

.access-log-table-wrap .log-table code,
.access-log-table-wrap .log-table .ua-cell,
.access-log-table-wrap .log-table .access-log-node,
html[data-theme="modern"] .access-log-table-wrap .log-table code,
html[data-theme="modern"] .access-log-table-wrap .log-table .ua-cell,
html[data-theme="modern"] .access-log-table-wrap .log-table .access-log-node {
  display: block !important;
  max-width: none !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}

@media (max-width: 1380px) {
  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="modern"] .sidebar {
    width: 100% !important;
    max-width: none !important;
  }

  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v112: final layout containment for classic and modern operations themes. */
body {
  overflow-x: hidden !important;
}

.app-shell,
html[data-theme="modern"] .app-shell {
  display: grid !important;
  grid-template-columns: 266px minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100vw !important;
}

.sidebar,
html[data-theme="modern"] .sidebar {
  box-sizing: border-box !important;
  width: 266px !important;
  max-width: 266px !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

main,
html[data-theme="modern"] main {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.domain-list,
.content,
.analytics-panel,
.analysis-dashboard,
.table-card,
.domain-card,
html[data-theme="modern"] .domain-list,
html[data-theme="modern"] .content,
html[data-theme="modern"] .analytics-panel,
html[data-theme="modern"] .analysis-dashboard,
html[data-theme="modern"] .table-card,
html[data-theme="modern"] .domain-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.analysis-kpi-grid,
html[data-theme="modern"] .analysis-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.analysis-kpi-card,
html[data-theme="modern"] .analysis-kpi-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.analysis-kpi-card strong,
html[data-theme="modern"] .analysis-kpi-card strong {
  font-size: 24px !important;
  line-height: 1.2 !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

.access-log-panel,
html[data-theme="modern"] .access-log-panel {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.access-log-table-wrap,
html[data-theme="modern"] .access-log-table-wrap {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-gutter: stable !important;
}

.access-log-table-wrap .log-table,
html[data-theme="modern"] .access-log-table-wrap .log-table {
  width: 2076px !important;
  min-width: 2076px !important;
  max-width: none !important;
  table-layout: fixed !important;
}

.access-log-col-time { width: 132px; }
.access-log-col-host { width: 132px; }
.access-log-col-node { width: 150px; }
.access-log-col-port { width: 78px; }
.access-log-col-client { width: 170px; }
.access-log-col-method { width: 72px; }
.access-log-col-path { width: 360px; }
.access-log-col-status { width: 86px; }
.access-log-col-cache { width: 86px; }
.access-log-col-size { width: 86px; }
.access-log-col-duration { width: 86px; }
.access-log-col-origin { width: 150px; }
.access-log-col-origin-status { width: 86px; }
.access-log-col-referer { width: 250px; }
.access-log-col-ua { width: 350px; }

.access-log-table-wrap .log-table th,
.access-log-table-wrap .log-table td,
html[data-theme="modern"] .access-log-table-wrap .log-table th,
html[data-theme="modern"] .access-log-table-wrap .log-table td {
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.access-log-table-wrap .log-table td:nth-child(7) code,
html[data-theme="modern"] .access-log-table-wrap .log-table td:nth-child(7) code {
  display: block !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.access-log-table-wrap .log-table .access-log-node,
html[data-theme="modern"] .access-log-table-wrap .log-table .access-log-node {
  display: block !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 1180px) {
  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  .app-shell,
  html[data-theme="modern"] .app-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar,
  html[data-theme="modern"] .sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 720px) {
  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v115: operational layout fixes. Keep overview and analytics dense and stop
   older theme rules from reordering security cards. */
.overview-grid,
html[data-theme="modern"] .overview-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.overview-grid > .domain-card,
.overview-grid > .overview-wide,
.overview-grid > .overview-kpi-card,
.overview-grid > .overview-hero,
html[data-theme="modern"] .overview-grid > .domain-card,
html[data-theme="modern"] .overview-grid > .overview-wide,
html[data-theme="modern"] .overview-grid > .overview-kpi-card,
html[data-theme="modern"] .overview-grid > .overview-hero {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
}

.analysis-kpi-grid,
html[data-theme="modern"] .analysis-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}

.domain-security-layout .security-card-cc {
  order: 1 !important;
}

.domain-security-layout .security-card-ip {
  order: 2 !important;
}

.domain-security-layout .security-card-region {
  order: 3 !important;
}

.domain-security-layout .security-card-waf-switch {
  order: 4 !important;
}

.domain-security-layout .security-card-autoblock {
  order: 5 !important;
}

.domain-security-layout .security-card-waf {
  order: 6 !important;
}

.domain-security-layout .security-card-hotlink {
  order: 7 !important;
}

.domain-security-layout .security-card-cc-rules {
  order: 8 !important;
}

@media (max-width: 1380px) {
  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 860px) {
  .analysis-kpi-grid,
  html[data-theme="modern"] .analysis-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}
/* v122: compact login composition and stable operations filters. */
.login-shell.login-shell-modern,
.login-shell {
  width: min(940px, calc(100vw - 32px));
  grid-template-columns: minmax(360px, 1fr) 266px;
  gap: 112px;
}

.login-body {
  padding: 28px 16px;
}

.login-kicker {
  padding: 5px 11px;
  font-size: 9px;
  letter-spacing: 0.10em;
}

.login-hero-panel {
  gap: 16px;
}

.login-hero-panel h1 {
  font-size: 38px;
  line-height: 1.14;
}

.login-hero-subtitle {
  margin-top: -4px;
  font-size: 11px;
}

.login-feature-grid {
  max-width: 306px;
  gap: 8px;
}

.login-feature-grid article {
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 7px;
}

.login-feature-grid b {
  margin-bottom: 5px;
  font-size: 14px;
}

.login-feature-grid strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.login-feature-grid span {
  font-size: 9px;
}

.login-status-strip {
  gap: 8px;
  padding: 6px 10px;
  font-size: 9px;
}

.login-status-strip span {
  gap: 5px;
  padding-right: 9px;
}

.login-panel.login-console-card,
.login-panel {
  max-width: 266px;
  padding: 20px 22px 18px;
  border-radius: 9px;
}

.login-brand {
  grid-template-columns: 24px 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.login-brand .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
}

.login-brand em {
  margin: 2px 0 9px;
  font-size: 8px;
}

.login-brand strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.login-brand span {
  font-size: 9px;
}

.login-form {
  gap: 9px;
}

.login-form input {
  height: 33px;
  border-radius: 6px;
  padding-left: 32px;
  font-size: 10px;
}

.login-field-icon {
  left: 11px;
  font-size: 11px;
}

.login-form button {
  height: 34px;
  border-radius: 6px;
  font-size: 11px;
}

.login-card-footer {
  margin-top: 8px;
  font-size: 8px;
}

.login-card-footer a,
.login-tip a {
  min-height: 22px;
  padding: 0 10px;
}

.list-toolbar {
  grid-template-columns: minmax(86px, max-content) minmax(300px, 1fr) repeat(3, minmax(120px, 170px)) minmax(64px, auto) minmax(64px, auto);
  min-width: 980px;
}

.list-toolbar > :first-child {
  min-width: 86px;
}

.list-toolbar input[name="q"] {
  min-width: 300px;
}

html[data-theme="modern"] .list-toolbar {
  display: grid !important;
  grid-template-columns: minmax(86px, max-content) minmax(300px, 1fr) repeat(3, minmax(120px, 170px)) minmax(64px, auto) minmax(64px, auto) !important;
  min-width: 980px !important;
}

html[data-theme="modern"] .list-toolbar > :first-child {
  flex: initial !important;
}

html[data-theme="modern"] .list-toolbar input[name="q"] {
  min-width: 300px !important;
}

@media (max-width: 980px) {
  .login-shell.login-shell-modern,
  .login-shell {
    grid-template-columns: 1fr;
    gap: 24px;
    width: min(620px, calc(100vw - 32px));
  }
}

/* v124: final login scale override. Keep this at EOF so legacy login rules cannot win. */
body.login-body {
  display: grid !important;
  place-items: center !important;
  min-height: 100vh !important;
  padding: 36px 24px !important;
}

body.login-body .login-shell.login-shell-modern,
body.login-body .login-shell {
  width: min(1080px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
  grid-template-columns: minmax(480px, 596px) 420px !important;
  gap: 64px !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body.login-body .login-hero-panel {
  gap: 22px !important;
}

body.login-body .login-hero-panel h1 {
  font-size: 54px !important;
  line-height: 1.12 !important;
}

body.login-body .login-feature-grid {
  max-width: 480px !important;
  gap: 12px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.login-body .login-feature-grid article {
  min-height: 98px !important;
  padding: 16px 18px !important;
  border-radius: 8px !important;
}

body.login-body .login-panel.login-console-card,
body.login-body .login-panel {
  width: 420px !important;
  max-width: 420px !important;
  padding: 32px 34px 28px !important;
  border-radius: 10px !important;
}

body.login-body .login-brand {
  margin-bottom: 22px !important;
}

body.login-body .login-brand strong {
  font-size: 24px !important;
}

body.login-body .login-form input {
  height: 50px !important;
  border-radius: 8px !important;
  padding-left: 42px !important;
  font-size: 15px !important;
}

body.login-body .login-form button {
  height: 52px !important;
  border-radius: 8px !important;
  font-size: 16px !important;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 4px 4px 0;
  padding: 2px 7px;
  border: 1px solid var(--border-color, #d8dee8);
  border-radius: 6px;
  background: var(--surface-muted, #f5f7fb);
  color: var(--text-color, #1f2937);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.p3-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.p3-onboarding-wizard .mini-tag,
.p3-customer-report .mini-tag,
.p3-self-diagnostics-card .mini-tag {
  max-width: 240px;
}

.p3-ops-enhancement-card .commercial-stat-grid,
.p3-package-forecast .site-table,
.p3-resource-pool-forecast .site-table,
.p3-customer-report .site-table {
  margin-top: 10px;
}

.p4-ha-scale-card .commercial-stat-grid,
.p4-scale-table {
  margin-top: 10px;
}

.p5-commercial-ai-card .commercial-stat-grid,
.p5-intelligence-table {
  margin-top: 10px;
}

.p4-scale-table td:first-child {
  min-width: 210px;
}

.p4-scale-table td:nth-child(4),
.p5-intelligence-table td:nth-child(4) {
  min-width: 260px;
}

.p5-intelligence-table td:first-child {
  min-width: 240px;
}

.p3-self-diagnostics-card .analytics-filters {
  margin-top: 12px;
}

@media (max-width: 980px) {
  body.login-body .login-shell.login-shell-modern,
  body.login-body .login-shell {
    width: min(620px, calc(100vw - 32px)) !important;
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  body.login-body .login-panel.login-console-card,
  body.login-body .login-panel {
    width: min(420px, 100%) !important;
    justify-self: center !important;
  }

  body.login-body .login-hero-panel h1 {
    font-size: 40px !important;
  }
}

/* Shared console typography. Keep component sizes explicit across both themes. */
:root,
html[data-theme="modern"] {
  --bg: #f5f6f8;
  --text: #252b36;
  --muted: #687181;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, 0.03);
  --ops-bg: #f5f6f8;
  --ops-text: #252b36;
  --ops-muted: #687181;
  --ops-faint: #687181;
  --ops-border: #e5e7eb;
  --ops-border-strong: #d2d7df;
  --ops-surface-soft: #fafbfc;
  --ops-surface-strong: #f3f5f7;
}

html[data-theme] body,
html[data-theme] .app-shell,
html[data-theme] main {
  background: var(--bg) !important;
  background-image: none !important;
  color: var(--text) !important;
}

html[data-theme] .app-shell {
  grid-template-columns: 248px minmax(0, 1fr) !important;
}

html[data-theme] .sidebar {
  width: 248px !important;
  max-width: 248px !important;
  padding: 24px 12px !important;
  background: #fff !important;
  border-right: 1px solid var(--line) !important;
  box-shadow: none !important;
}

html[data-theme] main {
  padding: 24px !important;
}

html[data-theme] .sidebar .brand {
  gap: 10px;
  margin: 0 -12px 18px;
  padding: 0 24px 18px;
  border-bottom: 1px solid #edf0f3;
}

html[data-theme] .brand > div:last-child {
  min-width: 0;
}

html[data-theme] .sidebar .brand strong {
  color: #172638 !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html[data-theme] .sidebar .brand span {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #7b8798 !important;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html[data-theme] .sidebar .brand-mark {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #06b6d4) !important;
  box-shadow: 0 12px 22px rgba(22, 119, 255, 0.20) !important;
  color: #fff !important;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme] .sidebar :is(nav a, .nav-group-toggle) {
  min-height: 44px !important;
  padding: 11px 16px 11px 46px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #334b69 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

html[data-theme] .sidebar :is(nav a.active, nav a:hover, .nav-group-toggle:hover) {
  background: #edfafa !important;
  color: #009e9b !important;
}

html[data-theme] .sidebar .nav-group.open > .nav-group-toggle {
  background: transparent !important;
  color: #172e48 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

html[data-theme] .sidebar nav {
  gap: 6px;
}

html[data-theme] .sidebar nav a.active::after {
  display: none !important;
}

/* Lucide icons are bundled locally; masks follow the menu state color. */
html[data-theme] .sidebar :is(nav > a, .nav-group-toggle)::before {
  content: "" !important;
  position: absolute;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  background: #7d8aa1;
  -webkit-mask: var(--menu-icon) center / contain no-repeat;
  mask: var(--menu-icon) center / contain no-repeat;
  opacity: 1;
}

html[data-theme] .sidebar nav > a { --menu-icon: url("/menu-house.svg"); }
html[data-theme] .sidebar [data-group="analytics"] { --menu-icon: url("/menu-chart-no-axes-combined.svg"); }
html[data-theme] .sidebar [data-group="nodes"] { --menu-icon: url("/menu-server.svg"); }
html[data-theme] .sidebar [data-group="sites"] { --menu-icon: url("/menu-globe.svg"); }
html[data-theme] .sidebar [data-group="l4"] { --menu-icon: url("/menu-network.svg"); }
html[data-theme] .sidebar [data-group="global"] { --menu-icon: url("/menu-sliders-horizontal.svg"); }
html[data-theme] .sidebar [data-group="packages"] { --menu-icon: url("/menu-package.svg"); }
html[data-theme] .sidebar [data-group="finance"] { --menu-icon: url("/menu-wallet.svg"); }
html[data-theme] .sidebar [data-group="system"] { --menu-icon: url("/menu-settings-2.svg"); }

html[data-theme] .sidebar :is(nav > a.active, nav > a:hover, .nav-group-toggle:hover)::before {
  background: #00aaa5;
}

html[data-theme] .sidebar .nav-group-toggle::after {
  width: 8px !important;
  height: 8px !important;
  flex-basis: 8px !important;
  border-right: 1px solid #7d8aa1 !important;
  border-bottom: 1px solid #7d8aa1 !important;
}

html[data-theme] .nav-group {
  margin-top: 0;
}

html[data-theme] .sidebar .nav-submenu {
  gap: 3px !important;
  margin: 6px 0 10px 27px !important;
  padding: 0 0 0 9px;
  border-left: 1px solid #e0e6ee;
}

html[data-theme] .sidebar .nav-submenu a {
  min-height: 36px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 12px 8px 18px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

html[data-theme] .sidebar .nav-submenu a::before {
  display: none !important;
}

html[data-theme] .sidebar .nav-submenu a.active {
  background: #e7faf6 !important;
  color: #009e9b !important;
  font-weight: 600 !important;
}
html[data-theme] :is(h1, h2, h3, h4, strong, b) {
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

html[data-theme] .app-shell :is(h2, h3) {
  font-size: 16px !important;
  line-height: 1.5 !important;
}

html[data-theme] h4 {
  font-size: 14px !important;
}

html[data-theme] .topbar {
  min-height: 48px;
  margin-bottom: 20px !important;
  padding: 0 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme] .topbar h1 {
  font-size: 18px !important;
  line-height: 1.5 !important;
}

html[data-theme] .account-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  min-width: 0;
}

html[data-theme] .account-badge {
  display: block;
  min-width: 0;
  max-width: 200px;
  padding: 5px 12px;
  border: 1px solid #dce7f5;
  border-radius: 16px;
  background: #f4f8fd;
  color: #3d597b;
  font-size: 12px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme] .account-badge[hidden] {
  display: none;
}

html[data-theme] :is(button, .button-link) {
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

html[data-theme] .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  text-decoration: none;
}

html[data-theme] button.icon-button {
  font-size: 20px !important;
}

html[data-theme] :is(input, select, textarea) {
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

html[data-theme] :is(input, select, textarea):focus-visible,
html[data-theme] :is(button, a):focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

html[data-theme] :is(.section-head, .domain-head) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

html[data-theme] .section-head > div {
  min-width: 0;
}

html[data-theme] .section-head :is(h2, h3) {
  margin: 0 0 6px !important;
}

html[data-theme] :is(p, .settings-note, .section-head p) {
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
}

html[data-theme] .eyebrow {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

html[data-theme] :is(.domain-card, .table-card, .panel, .analytics-panel) {
  border-radius: 8px !important;
  box-shadow: none !important;
}

html[data-theme] .overview-grid {
  gap: 0 !important;
  background: #fff;
}

html[data-theme] .overview-grid > .domain-card {
  padding: 24px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

html[data-theme] :is(.metrics > div, .analysis-kpi-card) {
  padding: 16px !important;
  border-color: var(--line) !important;
  border-radius: 6px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html[data-theme] :is(.metrics > div, .analysis-kpi-card, .commercial-stat)::after {
  display: none !important;
}

html[data-theme] :is(.metrics strong, .analysis-kpi-card strong, .summary-card strong) {
  font-size: 24px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme] :is(.commercial-stat, .commercial-feature, .quota-grid > div) {
  min-width: 0;
  padding: 12px 16px !important;
  border: 0 !important;
  border-left: 2px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme] :is(.commercial-stat strong, .commercial-feature strong, .quota-grid strong) {
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

html[data-theme] :is(.metrics span, .analysis-kpi-card > span, .commercial-stat > span, .commercial-feature > span, .quota-grid span) {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

html[data-theme] :is(.status, .badge, .mini-tag) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content !important;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

html[data-theme] .commercial-stat small {
  display: block;
  margin-top: 6px;
}

html[data-theme] .node-form > :is(.settings-grid, .commercial-stat-grid, .settings-note, .modal-actions, .theme-choice-grid) {
  grid-column: 1 / -1 !important;
  min-width: 0;
}

html[data-theme] :is(.site-table, .log-table, .enterprise-table) :is(th, td) {
  padding: 11px 12px !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

html[data-theme] :is(.site-table, .log-table, .enterprise-table) th {
  background: #f6f7f9 !important;
  color: #515c6d !important;
  font-weight: 500 !important;
}

html[data-theme] .brand-footer {
  position: static;
  transform: none;
  margin: 20px 24px 12px 272px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1180px) {
  html[data-theme] :is(.commercial-stat-grid, .compact-stat-grid, .overview-kpi-card .compact-stat-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  html[data-theme] .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-theme] .sidebar {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: 44vh;
    overflow-y: auto;
    padding: 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }

  html[data-theme] .sidebar .brand {
    margin-bottom: 8px;
    padding: 0 16px 10px;
  }

  html[data-theme] .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  html[data-theme] .nav-group.open {
    grid-column: 1 / -1;
  }

  html[data-theme] main {
    padding: 16px 12px !important;
  }

  html[data-theme] .topbar {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  html[data-theme] .topbar-actions {
    width: 100% !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px !important;
  }

  html[data-theme] .account-actions {
    gap: 8px;
  }

  html[data-theme] .account-badge {
    max-width: 160px;
    padding: 4px 10px;
  }

  html[data-theme] .overview-grid > .domain-card {
    padding: 18px 14px !important;
  }

  html[data-theme] .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  html[data-theme] .metrics > div {
    min-width: 0;
    padding: 12px !important;
  }

  html[data-theme] .metrics strong {
    font-size: 22px !important;
  }

  html[data-theme] :is(.section-head, .domain-head) {
    flex-wrap: wrap;
    gap: 10px;
  }

  html[data-theme] :is(.settings-grid, .node-form, .settings-form.batch-form, .site-form) {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
  }

  html[data-theme] .node-form > label {
    display: flex !important;
    flex-direction: column;
    min-width: 0 !important;
  }

  html[data-theme] .list-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-width: 0 !important;
  }

  html[data-theme] .list-toolbar input[name="q"] {
    grid-column: 1 / -1;
    min-width: 0 !important;
  }

  html[data-theme] .brand-footer {
    margin: 16px 12px;
  }
}

.node-verification { min-width: 0; max-width: 100%; }
.node-verification summary { cursor: pointer; }
.node-verification small { display: block; margin-top: 6px; overflow-wrap: anywhere; }

/* Diagnostics use the current console palette, including legacy striped rows. */
html[data-theme] .diagnostics-page .site-table tbody tr:nth-child(n) td {
  background: #ffffff !important;
  color: var(--text) !important;
}

html[data-theme] .diagnostics-page .site-table tbody tr:nth-child(even) td {
  background: #f6f7f9 !important;
}

html[data-theme] .diagnostics-page .site-table th:first-child,
html[data-theme] .diagnostics-page .site-table td:first-child {
  width: 150px !important;
  min-width: 150px !important;
  white-space: normal !important;
  word-break: normal !important;
}

html[data-theme] .diagnostics-page .table-card { overflow-x: auto; }

/* Let the diagnostics grid item shrink before its tables scroll internally. */
html[data-theme] .diagnostics-page {
  min-width: 0;
  max-width: 100%;
}

html[data-theme] .diagnostics-page [data-diagnostics-form] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

html[data-theme] .diagnostics-page [data-diagnostics-form] input {
  min-width: 0;
  width: 100%;
}

@media (max-width: 600px) {
  html[data-theme] .diagnostics-page [data-diagnostics-form] {
    grid-template-columns: minmax(0, 1fr);
  }
}
