﻿:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 6px;
  background: #246bfe;
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform .08s ease, filter .12s ease, background-color .12s ease;
}
button:disabled { background: #a8b2c1; cursor: not-allowed; }
button:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(.92);
}
button.is-busy {
  filter: saturate(.8);
}
button.secondary { background: #64748b; }
input, select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
}
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f6;
}
.login-panel {
  width: min(380px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 48px rgba(31, 41, 51, .12);
}
.login-panel h1 { margin: 0 0 24px; font-size: 24px; }
.login-panel label { display: grid; gap: 8px; margin-bottom: 16px; }
.login-panel button { width: 100%; margin-top: 8px; }
#loginMsg { color: #c2410c; min-height: 22px; }

.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.sidebar {
  background: #172033;
  color: #dbeafe;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { font-size: 20px; font-weight: 700; margin: 6px 8px 24px; }
.nav {
  width: 100%;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  margin-bottom: 6px;
}
.nav.active, .nav:hover { background: #26344f; color: #fff; }
.nav-group {
  margin: 8px 0;
}
.nav-parent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.nav-parent span {
  transition: transform .12s ease;
}
.nav-group.collapsed .nav-parent span {
  transform: rotate(-90deg);
}
.nav-group.collapsed .nav-children {
  display: none;
}
.nav-sub {
  padding-left: 24px;
  font-size: 14px;
  background: transparent;
  color: #b7c4d8;
}
.nav-sub.active {
  color: #fff;
  background: #246bfe;
}
.nav-sub:hover {
  color: #0f172a;
}
}
.content { padding: 22px; min-width: 0; }
.content.compact-topbar {
  padding-top: 0;
}
.content.compact-topbar .topbar {
  display: none;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar h2 { margin: 0 0 4px; }
.topbar p { margin: 0; color: #667085; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.content.dns-profile-page #deviceSelect {
  display: none !important;
}
.content.dns-profile-page .topbar .toolbar {
  display: none !important;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.metric, .panel {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}
.metric { padding: 16px; }
.metric span { display: block; color: #64748b; margin-bottom: 10px; }
.metric strong { font-size: 26px; }
.dashboard-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
}
.dashboard-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}
.dashboard-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.dashboard-status-ok { color: #15803d; background: #ecfdf3; }
.dashboard-status-watch { color: #b45309; background: #fff7ed; }
.dashboard-status-bad { color: #b91c1c; background: #fef2f2; }
.dashboard-metric {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}
.dashboard-metric.metric-watch { border-left-color: #f59e0b; }
.dashboard-metric.metric-bad { border-left-color: #ef4444; }
.dashboard-metric small {
  display: block;
  margin-top: 9px;
  color: #64748b;
  font-size: 12px;
}
.panel { padding: 16px; margin-bottom: 14px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.panel-head h3 { margin: 0; }
.panel-head span { color: #667085; font-size: 14px; }
.panel-subtitle {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}
.traffic-panel {
  overflow: visible;
}
.traffic-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.traffic-summary-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}
.traffic-summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 12px;
}
.traffic-summary-grid strong {
  color: #0f172a;
  font-size: 14px;
}
.traffic-canvas-wrap {
  position: relative;
  min-height: 320px;
}
.traffic-canvas-wrap canvas {
  width: 100%;
  height: 320px;
  max-height: none;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.traffic-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 178px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(15, 23, 42, .94);
  color: #fff;
  padding: 9px 11px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .2);
  font-size: 12px;
  line-height: 1.55;
}
.ranking-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ranking-title span {
  color: #64748b;
  font-size: 12px;
}
.ranking-panel tbody tr:hover {
  background: #f8fbff;
}
.distribution-panel {
  overflow: hidden;
  min-height: 350px;
}
.distribution-body {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: 12px;
  min-height: 290px;
}
.distribution-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  align-content: center;
}
.distribution-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
}
.distribution-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.distribution-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.distribution-legend-value {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.distribution-empty {
  grid-column: 1 / -1;
  color: #64748b;
  text-align: center;
}
.donut-canvas {
  width: 100%;
  height: 280px;
  max-height: none;
  border: 0;
  background: transparent;
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.inline-form {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.vpn-form {
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}
.vpn-form input[readonly] {
  color: #64748b;
  background: #f8fafc;
}
.vpn-allocation-hint {
  margin: -2px 0 12px;
  color: #64748b;
  font-size: 13px;
}
.device-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
}
.wan-meta-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}
.wan-meta-panel {
  padding: 0;
  overflow: visible;
}
.wan-meta-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #d9e2ec;
  padding: 14px 16px 6px;
}
.wan-meta-sticky .panel-head {
  margin-bottom: 10px;
}
.wan-meta-sticky .wan-meta-form {
  margin-bottom: 0;
}
.wan-meta-table-wrap {
  overflow-x: auto;
  padding: 0 16px 16px;
}
.terminal-profile-form {
  grid-template-columns: repeat(4, minmax(145px, 1fr)) auto;
}
.user-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
}
.ai-form {
  display: grid;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
.ai-workbench {
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #eef3f8;
}
.ai-workbench-head {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.ai-workbench-grid {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  min-height: calc(100vh - 150px);
}
.ai-workbench-grid.ai-consultation-layout {
  grid-template-columns: 270px minmax(0, 1fr);
  height: calc(100vh - 88px);
  min-height: 650px;
  overflow: hidden;
  background: #eef3f8;
}
.ai-command-panel {
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 16px;
}
.ai-fixed-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: #eef2f7;
}
.ai-context-title {
  display: grid;
  gap: 3px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.ai-context-title strong {
  color: #0f172a;
  font-size: 18px;
}
.ai-context-title span,
.ai-context-controls span,
.ai-quick-scenarios > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.ai-context-controls {
  display: grid;
  gap: 10px;
}
.ai-quick-scenarios {
  display: grid;
  gap: 7px;
  min-height: 0;
  padding: 10px;
}
.ai-quick-scenarios button,
.ai-choice-grid button {
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #1f2933;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
}
.ai-quick-scenarios button:hover,
.ai-choice-grid button:hover,
.ai-choice-grid button.active {
  border-color: #246bfe;
  background: #f8fbff;
  color: #1d4ed8;
}
.ai-result-panel {
  min-width: 0;
  background: #f5f8fc;
  padding: 0;
}
.ai-chat-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  overflow: hidden;
  padding: 12px;
}
.ai-result-summary {
  border: 1px solid #c7d7f3;
  border-left: 4px solid #246bfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.ai-summary-empty,
.ai-summary-main {
  display: grid;
  gap: 5px;
}
.ai-summary-empty span,
.ai-summary-main span,
.ai-summary-meta span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.ai-summary-empty strong,
.ai-summary-main strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.25;
}
.ai-summary-empty p,
.ai-summary-main p {
  margin: 0;
  color: #475569;
  line-height: 1.45;
}
.ai-summary-main.good strong { color: #15803d; }
.ai-summary-main.watch strong,
.ai-summary-main.warning strong { color: #b45309; }
.ai-summary-main.bad strong,
.ai-summary-main.critical strong { color: #b91c1c; }
.ai-impact-details,
.ai-progress-details {
  border-top: 1px solid #dbe3ef;
  padding: 8px 0 0;
  color: #334155;
  font-size: 13px;
}
.ai-impact-details summary,
.ai-progress-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 700;
}
.ai-impact-details ul,
.ai-progress-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.ai-progress-details li { margin: 4px 0; }
.ai-progress-details li.completed,
.ai-progress-details li.ready { color: #166534; }
.ai-progress-details li.pending,
.ai-progress-details li.processing { color: #a16207; }
.ai-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ai-session-actions button { min-height: 36px; }
.ai-summary-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ai-summary-meta div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
  min-width: 0;
}
.ai-summary-meta strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.ai-summary-actions {
  margin-top: 10px;
}
.ai-next-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}
.ai-next-action {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.ai-next-action:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}
.ai-next-action:disabled {
  opacity: 0.55;
  cursor: wait;
}
.ai-evidence-fold {
  border: 1px solid #d6e1ec;
  border-radius: 8px;
  background: #f7fafc;
  overflow: hidden;
}
.ai-evidence-fold summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.ai-evidence-fold > .ai-evidence-panel {
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  max-height: 360px;
  overflow: auto;
}
.ai-answer-fold {
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  background: #eef6ff;
}
.ai-answer-fold summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.ai-answer-fold > .chat-box {
  border-top: 1px solid #dbe7f4;
  max-height: 420px;
  overflow: auto;
}
.ai-input-dock {
  display: grid;
  gap: 10px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04);
}
.ai-scenario-form {
  border: 1px solid #d9e2ec;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}
.ai-input-dock .ai-scenario-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.ai-input-dock .workflow-step {
  display: none;
}
.ai-input-dock .workflow-symptom,
.ai-input-dock .workflow-actions {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
}
.ai-input-dock .workflow-symptom .step-title,
.ai-input-dock .workflow-actions .step-title,
.ai-input-dock #aiSymptomTags,
.ai-input-dock #aiSymptoms {
  display: none;
}
.ai-input-dock .workflow-actions .step-fields {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.ai-input-dock .workflow-actions button {
  width: 110px;
  min-height: 46px;
}
.ai-input-dock .ai-question {
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
  border-radius: 8px;
  font-size: 15px;
}
.ai-side-target-form {
  display: grid;
  gap: 10px;
  min-height: 0;
}
.ai-side-target-form .workflow-step {
  margin: 0;
}
.ai-side-target-form .step-title {
  margin-bottom: 8px;
}
.ai-side-target-form .step-title strong {
  font-size: 13px;
}
.ai-side-target-form .step-title span {
  display: none;
}
.ai-side-target-form .ai-scope-summary {
  display: none;
}
.ai-side-target-form .ai-primary-target {
  padding: 10px;
}
.ai-side-target-form .ai-primary-target input {
  min-height: 38px;
  font-size: 14px;
}
.ai-side-target-form .ai-primary-target p {
  display: none;
}
.ai-side-target-form .ai-advanced-options summary {
  padding: 8px 10px;
}
.ai-side-target-form .ai-wan-picker {
  grid-template-columns: 1fr;
  max-height: 180px;
}
.ai-accordion {
  border: 1px solid #d5e1ec;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.ai-accordion summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}
.ai-accordion summary::-webkit-details-marker {
  display: none;
}
.ai-accordion summary strong {
  color: #0f172a;
  font-size: 14px;
}
.ai-accordion summary span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.ai-accordion[open] summary {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fbff;
}
.ai-accordion-body {
  padding: 10px;
}
.ai-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.ai-accordion-device .ai-device-strip {
  margin: 0;
}
.ai-accordion-device .ai-device-strip span {
  display: none;
}
.ai-accordion-device select,
.ai-side-target-form input,
.ai-side-target-form select {
  width: 100%;
}
.ai-consultation-layout .diagnosis-preset-grid,
.ai-consultation-layout #aiModeGuide {
  display: none !important;
}
.ai-consultation-layout .ai-deep-actions {
  display: grid;
  gap: 8px;
  align-items: stretch;
}
.ai-consultation-layout .ai-deep-actions.hidden {
  display: none;
}
.ai-consultation-layout .ai-deep-actions::before {
  content: none;
}
.ai-consultation-layout .ai-deep-actions button {
  width: 100%;
}
.ai-consultation-layout .chat-box {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 14px;
}
.ai-consultation-layout .chat-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: #64748b;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: rgba(255,255,255,0.65);
}
.ai-consultation-layout .chat-row {
  max-width: 880px;
}
.ai-consultation-layout .chat-row.chat-user {
  margin-left: auto;
}
.ai-consultation-layout .chat-row.chat-user .ai-message {
  background: #dbeafe;
  color: #0f172a;
}
.ai-consultation-layout .chat-row.chat-user .ai-message pre {
  color: #0f172a;
}
.ai-consultation-layout .chat-row.chat-assistant .ai-message {
  background: #fff;
  border: 1px solid #dbe7f4;
}
.ai-primary-target {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}
.ai-primary-target label {
  display: grid;
  gap: 7px;
}
.ai-primary-target span {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.ai-primary-target input {
  min-height: 44px;
  font-size: 16px;
  font-weight: 700;
}
.ai-primary-target p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.ai-target-kinds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.ai-target-kinds button {
  min-height: 32px;
  border: 1px solid #d5e1ec;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
}
.ai-target-kinds button.active,
.ai-target-kinds button:hover {
  border-color: #246bfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.ai-target-status {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
  padding: 7px 8px;
}
.ai-target-status strong {
  color: #1e3a8a;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ai-target-status span {
  color: #475569;
  font-size: 11px;
  line-height: 1.35;
}
.ai-capture-interface {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
.ai-capture-interface label {
  display: grid;
  gap: 5px;
}
.ai-capture-interface select {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}
.ai-capture-interface small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
.ai-target-suggestions {
  display: grid;
  gap: 5px;
  max-height: 164px;
  overflow-y: auto;
  padding-right: 2px;
}
.ai-target-suggestions button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #fff;
  padding: 7px 8px;
  text-align: left;
}
.ai-target-suggestions button:hover {
  border-color: #60a5fa;
  background: #f8fbff;
}
.ai-target-suggestions strong,
.ai-target-suggestions span {
  overflow-wrap: anywhere;
}
.ai-target-suggestions strong {
  color: #1f2937;
  font-size: 12px;
}
.ai-target-suggestions span {
  color: #64748b;
  font-size: 11px;
}
.ai-pppoe-picker {
  display: grid;
  gap: 8px;
}
.ai-advanced-options {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0;
}
.ai-advanced-options summary {
  cursor: pointer;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}
.ai-advanced-options > div {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding: 10px 12px 12px;
}
.ai-advanced-options select,
.ai-pppoe-picker input,
.ai-pppoe-picker select {
  width: 100%;
}
.ai-workflow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}
.workflow-step {
  border: 1px solid #d9e2ec;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}
.workflow-step:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(36, 107, 254, 0.08);
}
.step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: #0f172a;
}
.step-title span {
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}
.step-title strong {
  font-size: 14px;
}
.step-fields {
  display: grid;
  gap: 10px;
}
.step-fields input,
.step-fields select,
.step-fields textarea {
  width: 100%;
  min-width: 0;
}
.workflow-actions .step-fields {
  grid-template-columns: minmax(220px, 280px) 1fr;
  align-items: center;
}
.workflow-actions button {
  width: 100%;
  min-height: 42px;
}
.ai-scope-summary {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px 12px;
}
.ai-scope-summary span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ai-scope-summary strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  margin-bottom: 4px;
}
.ai-scope-summary p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.ai-workflow.global-mode .workflow-scope .ai-mode-field,
.ai-workflow.global-mode .workflow-scope .ai-wan-picker {
  display: none !important;
}
.ai-workflow.global-mode .ai-question {
  min-height: 92px;
}
#aiPrimaryHint {
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.symptom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.symptom-tag {
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1;
}
.symptom-tag:hover {
  border-color: #246bfe;
  color: #1d4ed8;
  background: #f8fbff;
}
.symptom-tag.active {
  border-color: #246bfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.ai-form textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  font: inherit;
}
.ai-wan-multi {
  min-height: 136px;
}
.ai-wan-multi {
  display: none;
}
.ai-wan-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding: 2px;
}
.ai-wan-option {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 10px;
  min-height: 78px;
}
.ai-wan-option:hover {
  border-color: #246bfe;
  background: #f8fbff;
}
.ai-wan-option.active {
  border-color: #246bfe;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #246bfe;
}
.ai-wan-option.failed {
  border-color: #fecaca;
}
.ai-wan-option strong {
  color: #0f172a;
  font-size: 15px;
}
.ai-wan-option.active strong {
  color: #1d4ed8;
}
.ai-wan-option span,
.ai-wan-option em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ai-wan-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  padding: 16px;
  text-align: center;
  font-size: 13px;
}
.ai-wan-compare-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
}
.ai-wan-compare-dialog::backdrop {
  background: rgba(15, 23, 42, .42);
}
.ai-wan-compare-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px;
}
.ai-wan-compare-head span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}
.ai-wan-compare-head h3 {
  margin: 0;
  font-size: 18px;
}
.ai-wan-compare-head button {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 13px;
}
.ai-wan-compare-context {
  display: grid;
  gap: 4px;
  margin: 16px 16px 10px;
}
.ai-wan-compare-context strong {
  font-size: 15px;
}
.ai-wan-compare-context span,
.ai-wan-compare-boundary {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}
.ai-wan-compare-options {
  display: grid;
  gap: 8px;
  margin: 0 16px;
}
.ai-wan-compare-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
}
.ai-wan-compare-option:hover {
  border-color: #60a5fa;
  background: #f8fbff;
}
.ai-wan-compare-option input {
  margin: 3px 0 0;
}
.ai-wan-compare-option span {
  display: grid;
  gap: 3px;
}
.ai-wan-compare-option strong {
  font-size: 14px;
}
.ai-wan-compare-option em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}
.ai-wan-compare-option small {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ai-wan-compare-badge {
  display: inline-flex;
  width: fit-content;
  margin-left: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  padding: 1px 5px;
  font-size: 11px !important;
  font-style: normal;
  font-weight: 700;
  vertical-align: middle;
}
.ai-wan-compare-boundary {
  margin: 12px 16px 0;
}
.ai-wan-compare-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  margin-top: 16px;
  padding: 12px 16px;
}
.ai-question {
  grid-column: auto;
}
.hint-box {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
}
.table-hint {
  margin: 6px 0 10px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.diagnosis-preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-device-strip {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #0f172a;
  font-weight: 700;
}
.ai-device-strip select {
  width: 100%;
  min-width: 0;
  color: #1f2933;
  font-weight: 400;
}
.preset-card {
  display: grid;
  gap: 4px;
  min-height: 0;
  text-align: left;
  align-content: start;
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #1f2933;
  padding: 12px;
  border-radius: 8px;
}
.preset-card:hover {
  border-color: #246bfe;
  background: #f8fbff;
}
.preset-card.active {
  border-color: #246bfe;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #246bfe;
}
.preset-card.active strong {
  color: #1d4ed8;
}
.preset-card strong {
  font-size: 15px;
}
.preset-card span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.diagnosis-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  color: #475569;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}
.diagnosis-note strong {
  color: #0f172a;
}
.diagnosis-note span {
  color: #64748b;
}
.ai-mode-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: start;
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}
.ai-mode-guide strong {
  color: #1d4ed8;
}
.ai-mode-guide span {
  color: #334155;
}
.ai-deep-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}
.ai-deep-actions::before {
  content: "进阶检测";
  grid-column: 1 / -1;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}
.ai-deep-actions span {
  grid-column: 1 / -1;
  color: #475569;
  font-size: 13px;
  line-height: 1.4;
}
.ai-deep-actions button {
  width: 100%;
}
.ai-evidence-panel {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  margin: 0 0 12px;
  padding: 16px;
}
.ai-result-panel .ai-evidence-panel {
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}
.ai-result-panel .customer-summary {
  display: grid;
  gap: 14px;
}
.ai-result-panel .customer-result {
  border-radius: 8px;
  padding: 14px;
}
.ai-result-panel .chat-box {
  max-height: 420px;
}
.ai-evidence-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}
.ai-evidence-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.ai-evidence-head span {
  color: #64748b;
  font-size: 13px;
}
.diagnosis-decision {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.customer-summary {
  display: grid;
  gap: 14px;
}
.customer-result {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}
.customer-result::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #94a3b8;
}
.customer-result.good {
  border-color: #86efac;
  background: #f0fdf4;
}
.customer-result.good::before { background: #16a34a; }
.customer-result.watch {
  border-color: #fde68a;
  background: #fffbeb;
}
.customer-result.watch::before { background: #d97706; }
.customer-result.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.customer-result.bad::before { background: #dc2626; }
.customer-result.unknown::before { background: #64748b; }
.customer-result span {
  display: block;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}
.customer-result strong {
  display: block;
  color: #0f172a;
  font-size: 22px;
  margin-bottom: 6px;
  line-height: 1.3;
}
.customer-result p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}
.diagnosis-overview {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(160px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.overview-primary,
.overview-card,
.overview-evidence {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  min-width: 0;
}
.overview-primary {
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}
.overview-primary span,
.overview-card span,
.overview-evidence > span {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}
.overview-primary strong {
  display: block;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.overview-primary p {
  margin: 6px 0 0;
  color: #334155;
  line-height: 1.45;
}
.overview-card strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.overview-evidence {
  grid-column: 1 / -1;
}
.overview-evidence div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.overview-evidence em {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  padding: 4px 7px;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.customer-key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.customer-key-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.customer-key-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 5px;
}
.customer-key-grid strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.packet-plain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.packet-plain-grid div {
  min-height: 74px;
}
.packet-plain-grid strong {
  font-size: 13px;
  line-height: 1.5;
}
.ai-summary-meta.packet-summary-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.operator-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.operator-steps div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  min-height: 64px;
}
.operator-steps span {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.operator-steps strong {
  color: #0f172a;
  font-size: 13px;
}
.operator-steps em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.operator-steps .good span { background: #dcfce7; color: #166534; }
.operator-steps .watch span { background: #fef3c7; color: #92400e; }
.operator-steps .bad span { background: #fee2e2; color: #991b1b; }
.operator-steps .muted span { background: #e5e7eb; color: #4b5563; }
.customer-report {
  display: grid;
  gap: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f7fef9;
  padding: 14px;
}
.customer-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.customer-report-head span {
  display: block;
  color: #15803d;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.customer-report-head strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.35;
}
.customer-report-head button {
  white-space: nowrap;
}
.customer-report p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}
.customer-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.customer-report-grid div {
  border: 1px solid #dcfce7;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}
.customer-report-grid span {
  display: block;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.customer-report-grid ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.5;
}
.customer-report-text {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid #dcfce7;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 10px;
  line-height: 1.5;
  font-size: 13px;
}
.tech-mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  opacity: .86;
}
.tech-mini-grid div {
  background: #f8fafc;
}
.tech-mini-grid span,
.tech-mini-grid strong {
  font-size: 12px;
}
.customer-actions {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}
.customer-actions h4 {
  margin: 0 0 8px;
  font-size: 15px;
}
.customer-actions ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.55;
}
.customer-actions li + li {
  margin-top: 4px;
}
.operator-quick-actions {
  display: grid;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 10px;
}
.operator-quick-actions > span {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.operator-quick-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.operator-quick-actions button {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}
.operator-quick-actions button.primary {
  background: #1d4ed8;
  color: #fff;
}
.operator-quick-actions button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}
.account-closure-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  padding: 12px;
}
.account-closure-box > div:first-child span {
  display: block;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.account-closure-box > div:first-child strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  margin-bottom: 4px;
}
.account-closure-box p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}
.access-action-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.access-action-box.account_first {
  border-color: #fecaca;
  background: #fff7f7;
}
.access-action-box > div:first-child span {
  display: block;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.access-action-box.account_first > div:first-child span {
  color: #b91c1c;
}
.access-action-box > div:first-child strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  margin-bottom: 4px;
}
.access-action-box p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}
.access-failure-hint {
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  padding: 10px;
}
.access-failure-hint strong {
  display: block;
  color: #9a3412;
  font-size: 14px;
  margin-bottom: 4px;
}
.access-failure-hint p {
  color: #7c2d12;
  margin: 0 0 6px;
}
.access-failure-hint ul {
  margin: 0;
  padding-left: 18px;
  color: #7c2d12;
  line-height: 1.45;
}
.access-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.access-action-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px;
}
.access-action-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.access-action-grid strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.access-quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.access-quality-card {
  display: grid;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  min-height: 112px;
}
.access-quality-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.access-quality-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.access-quality-card strong {
  color: #0f172a;
  font-size: 14px;
}
.access-quality-card p {
  margin: 0;
  color: #111827;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.access-quality-card small {
  color: #475569;
  line-height: 1.45;
}
.access-quality-card.good { border-left-color: #16a34a; background: #f7fff9; }
.access-quality-card.warning { border-left-color: #d97706; background: #fffbeb; }
.access-quality-card.bad { border-left-color: #dc2626; background: #fff7f7; }
.access-quality-card.unknown { border-left-color: #64748b; background: #f8fafc; }
.diagnosis-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.diagnosis-flow-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  padding: 11px;
  min-height: 118px;
}
.diagnosis-flow-step > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 800;
}
.diagnosis-flow-step strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.3;
}
.diagnosis-flow-step em {
  display: inline-flex;
  width: fit-content;
  margin: 5px 0;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 4px;
  padding: 2px 6px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.diagnosis-flow-step p,
.diagnosis-flow-step small {
  display: block;
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.diagnosis-flow-step small {
  margin-top: 5px;
  color: #64748b;
}
.technical-details {
  margin-top: 14px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}
.technical-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.diagnosis-closure {
  border: 1px solid #93c5fd;
  background: #f0f7ff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.diagnosis-closure > div:first-child span {
  display: block;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.diagnosis-closure > div:first-child strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  margin-bottom: 6px;
}
.diagnosis-closure p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}
.closure-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.closure-grid div {
  border: 1px solid #dbeafe;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
}
.closure-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.closure-grid strong {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.35;
}
.closure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.closure-actions span {
  border: 1px solid #facc15;
  background: #fef9c3;
  color: #854d0e;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.closure-actions button {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  background: #1d4ed8;
}
.onu-sn-continue {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.onu-sn-continue label {
  display: grid;
  gap: 5px;
  margin: 0;
}
.onu-sn-continue label span {
  color: #1e40af;
  font-size: 13px;
  font-weight: 800;
}
.onu-sn-continue input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 14px;
}
.onu-sn-continue button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: #dbeafe;
  color: #0f172a;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}
.onu-sn-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.onu-sn-buttons button:first-child {
  background: #15803d;
}
.onu-sn-continue button:disabled {
  opacity: .65;
  cursor: wait;
}
.onu-sn-continue small {
  grid-column: 1 / -1;
  color: #64748b;
  line-height: 1.45;
}
.next-step-onu-sn {
  margin-top: 10px;
}
.next-step-onu-sn .onu-sn-continue {
  border-color: #86efac;
  background: #f0fdf4;
}
.packet-access-actions {
  display: grid;
  gap: 10px;
  border: 1px solid #bfdbfe;
  background: #f8fbff;
  border-radius: 8px;
  padding: 12px;
}
.packet-access-actions h4 {
  margin: 0;
  color: #0f4fd7;
  font-size: 15px;
}
.wan-boundary {
  display: grid;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}
.wan-boundary.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.wan-boundary.watch {
  border-color: #fde68a;
  background: #fffbeb;
}
.wan-boundary.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.wan-boundary-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.wan-boundary-head span {
  color: #1e40af;
  font-size: 12px;
  font-weight: 800;
}
.wan-boundary-head strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.wan-boundary-head em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.wan-boundary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.wan-boundary-grid div {
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  padding: 9px;
  min-width: 0;
}
.wan-boundary-grid span {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}
.wan-boundary-grid p,
.wan-boundary-grid ul {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}
.wan-boundary-grid ul {
  padding-left: 16px;
}
.wan-boundary-grid li {
  margin: 3px 0;
  overflow-wrap: anywhere;
}
.onu-realtime-box {
  display: grid;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 9px;
  margin-top: 8px;
}
.onu-realtime-box strong {
  color: #0f172a;
  font-size: 13px;
}
.onu-realtime-box span {
  color: #475569;
  font-size: 12px;
}
.access-assessment {
  display: grid;
  gap: 4px;
  border-radius: 6px;
  padding: 9px;
  margin-bottom: 9px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
}
.access-assessment strong {
  color: #1e40af;
  font-size: 13px;
}
.access-assessment span {
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.access-assessment.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.access-assessment.bad strong {
  color: #b91c1c;
}
.access-assessment.warning {
  border-color: #fde68a;
  background: #fffbeb;
}
.access-assessment.warning strong {
  color: #92400e;
}
.access-assessment.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.access-assessment.good strong {
  color: #15803d;
}
.decision-confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbeafe;
}
.decision-confidence span {
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
}
.decision-confidence strong {
  color: #1d4ed8;
  font-size: 16px;
}
.decision-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}
.decision-list h4 {
  margin: 0 0 6px;
  color: #1f2937;
  font-size: 13px;
}
.decision-list ul {
  margin: 0;
  padding-left: 17px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.decision-list li + li {
  margin-top: 4px;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.evidence-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.evidence-card h4,
.evidence-tables h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.evidence-card p {
  margin: 0 0 8px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.diagnosis-topology-card {
  grid-column: span 4;
}
.diagnosis-topology {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 116px;
  overflow-x: auto;
  padding: 2px 0 8px;
}
.topology-step {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 150px;
}
.topology-node {
  display: grid;
  gap: 5px;
  width: 150px;
  min-height: 104px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
}
.topology-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.topology-node-head span,
.topology-node small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}
.topology-node-head strong {
  color: #334155;
  font-size: 11px;
  white-space: nowrap;
}
.topology-node b {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.topology-edge {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 2px;
  background: #94a3b8;
  margin: 0 8px;
}
.topology-edge::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 7px solid #94a3b8;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.topology-edge span {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  min-width: max-content;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}
.topology-ok,
.topology-good,
.topology-found,
.topology-online {
  border-color: #86efac;
  background: #f0fdf4;
}
.topology-ok .topology-node-head strong,
.topology-good .topology-node-head strong,
.topology-found .topology-node-head strong,
.topology-online .topology-node-head strong {
  color: #15803d;
}
.topology-warning,
.topology-ambiguous,
.topology-waiting_for_onu_sn {
  border-color: #fde68a;
  background: #fffbeb;
}
.topology-warning .topology-node-head strong,
.topology-ambiguous .topology-node-head strong,
.topology-waiting_for_onu_sn .topology-node-head strong {
  color: #92400e;
}
.topology-bad,
.topology-offline,
.topology-not_found,
.topology-no_olt_configured,
.topology-collector_not_ready,
.topology-expired,
.topology-disabled {
  border-color: #fecaca;
  background: #fef2f2;
}
.topology-bad .topology-node-head strong,
.topology-offline .topology-node-head strong,
.topology-not_found .topology-node-head strong,
.topology-no_olt_configured .topology-node-head strong,
.topology-collector_not_ready .topology-node-head strong,
.topology-expired .topology-node-head strong,
.topology-disabled .topology-node-head strong {
  color: #b91c1c;
}
.topology-page .panel-head {
  align-items: flex-start;
}
.topology-page .panel-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topology-page .panel-actions input,
.topology-page .panel-actions select {
  min-width: 160px;
}
.topology-canvas {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.topology-page-main {
  display: grid;
  gap: 12px;
}
.topology-page-main .diagnosis-topology-card {
  grid-column: auto;
}
.topology-page-main .diagnosis-topology {
  min-height: 138px;
  padding: 8px 2px 14px;
}
.topology-page-main .topology-node {
  width: 172px;
  min-height: 116px;
}
.topology-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
}
.topology-detail-row {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e2e8f0;
  padding: 9px 0;
}
.topology-detail-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.topology-detail-row strong {
  color: #0f172a;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.topology-detail-row span,
.topology-detail-row small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.evidence-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}
.evidence-line span {
  color: #64748b;
  flex: 0 0 auto;
}
.evidence-line strong {
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.evidence-tags,
.evidence-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.evidence-tags span,
.evidence-missing span {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.evidence-tables {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.evidence-tables table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.evidence-tables th,
.evidence-tables td {
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}
.chat-box {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.chat-row {
  display: grid;
  gap: 6px;
}
.chat-role {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.chat-row pre {
  max-height: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.ai-message pre {
  margin: 0;
}
.ai-report {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: #1f2933;
  line-height: 1.72;
}
.ai-report h4 {
  margin: 12px 0 6px;
  color: #0f4fd7;
  font-size: 16px;
}
.ai-report h4:first-child {
  margin-top: 0;
}
.ai-report strong {
  color: #111827;
}
.ai-bullet {
  color: #246bfe;
  font-weight: 700;
}
.chat-user pre {
  background: #e0f2fe;
  border-color: #bae6fd;
}
.chat-assistant pre {
  background: #fff;
}
.chat-empty {
  color: #64748b;
  padding: 10px;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-actions span {
  color: #64748b;
  font-size: 13px;
}
canvas { width: 100%; max-height: 260px; border: 1px solid #e5e7eb; border-radius: 6px; }
pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}
.remote-pppoe-box {
  display: grid;
  gap: 12px;
}
.remote-pppoe-box h4 {
  margin: 8px 0 0;
  font-size: 15px;
}
.remote-pppoe-box table {
  min-width: 900px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table { min-width: 1180px; }
.compact-table {
  min-width: 0;
}
.panel { overflow-x: auto; }
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.diagnostic-grid h4 {
  margin: 0 0 8px;
  color: #334155;
  font-size: 15px;
}
.diagnostic-grid table {
  min-width: 520px;
}
.diagnostic-wide {
  margin-top: 18px;
}
.diagnostic-wide h4 {
  margin: 0 0 8px;
  color: #334155;
  font-size: 15px;
}
.diagnostic-wide table {
  min-width: 980px;
}
small {
  color: #64748b;
}
th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}
th { color: #475569; background: #f8fafc; }
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.table-actions button {
  padding: 7px 10px;
}
.vpn-edit-row input {
  width: 100%;
  min-width: 120px;
  padding: 7px 8px;
}
.vpn-edit-row [data-vpn-field="route_cidr"] {
  min-width: 260px;
}
.yellow {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}
.red {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}
.status-online {
  color: #047857;
  font-weight: 700;
}
.status-offline {
  color: #dc2626;
  font-weight: 700;
}
.state-enabled {
  color: #16a34a;
  font-weight: 700;
}
.state-disabled {
  color: #dc2626;
  font-weight: 700;
}
.link-actions {
  white-space: nowrap;
}
.link-actions button {
  background: transparent;
  color: #246bfe;
  padding: 0 8px 0 0;
  border-radius: 0;
}
.link-actions button:hover {
  text-decoration: underline;
}
.sort-head {
  background: transparent;
  color: #475569;
  padding: 0;
  font-weight: 700;
}
.sort-head:hover {
  color: #246bfe;
  text-decoration: underline;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
}
.pager span {
  color: #475569;
}
.diagnostic-record-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.8fr);
  gap: 14px;
}
.diagnostic-record-list {
  overflow-x: auto;
}
.diagnostic-record-list tr[data-diagnostic-record] {
  cursor: pointer;
}
.diagnostic-record-list tr[data-diagnostic-record]:hover {
  background: #f8fbff;
}
.diagnostic-record-detail {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-height: 260px;
}
.record-detail-head span {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
.record-detail-head strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  margin: 6px 0;
}
.record-detail-head p {
  margin: 0 0 12px;
  color: #334155;
  line-height: 1.5;
}
.record-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.record-detail-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px;
  background: #f8fafc;
}
.record-detail-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.record-detail-grid strong {
  display: block;
  color: #0f172a;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.record-packet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.record-packet-grid div {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 9px;
  background: #eff6ff;
}
.record-packet-grid span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
.record-packet-grid strong {
  display: block;
  color: #0f172a;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.record-boundary {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.55;
}
.record-access-card {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 10px;
  margin: 8px 0 12px;
}
.record-access-card.warning {
  border-color: #fde68a;
  background: #fffbeb;
}
.record-access-card.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.record-access-card.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.record-access-card > div:first-child span {
  display: block;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}
.record-access-card.warning > div:first-child span { color: #92400e; }
.record-access-card.bad > div:first-child span { color: #b91c1c; }
.record-access-card.good > div:first-child span { color: #15803d; }
.record-access-card > div:first-child strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  margin: 4px 0;
}
.record-access-card > div:first-child p {
  margin: 0 0 10px;
  color: #334155;
  line-height: 1.5;
}
.record-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.record-access-grid div {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 7px;
  padding: 8px;
}
.record-access-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.record-access-grid strong {
  display: block;
  color: #0f172a;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.record-loop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.record-loop-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.record-loop-grid span {
  display: block;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 6px;
}
.record-loop-grid ul {
  padding-left: 18px;
}
.diagnostic-record-detail h4 {
  margin: 12px 0 6px;
}
.diagnostic-record-detail ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.55;
}
.diagnostic-record-detail pre {
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  max-height: 360px;
  overflow: auto;
}
.record-severity {
  font-weight: 700;
}
.record-severity.good { color: #15803d; }
.record-severity.watch { color: #b45309; }
.record-severity.bad { color: #b91c1c; }
.record-severity.unknown { color: #64748b; }
.access-evidence-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.access-evidence-summary span {
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}
#accessEvidenceBody tr[data-diagnostic-record] {
  cursor: pointer;
}
#accessEvidenceBody tr[data-diagnostic-record]:hover {
  background: #f8fbff;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    top: auto;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }
  .brand {
    flex: 0 0 auto;
    min-width: 0;
    margin: 0 6px 0 0;
    font-size: 16px;
  }
  .nav-group {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
  }
  .nav-children {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .nav-group.collapsed .nav-children { display: none; }
  .nav {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .nav-sub { padding-left: 10px; }
  .topbar, .toolbar { align-items: stretch; flex-direction: column; }
  .metric-grid, .split { grid-template-columns: 1fr; }
  .traffic-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .traffic-panel .panel-head,
  .traffic-panel .panel-actions { align-items: stretch; flex-direction: column; }
  .distribution-body { grid-template-columns: minmax(220px, 1fr) minmax(260px, 340px); }
  .filter-bar { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .ai-form { grid-template-columns: 1fr; }
  .ai-workbench-grid { grid-template-columns: 1fr; }
  .ai-workbench-grid.ai-consultation-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .ai-consultation-layout .ai-command-panel {
    max-height: none;
    overflow: visible;
  }
  .ai-command-panel {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }
  .ai-workflow { grid-template-columns: 1fr; }
  .workflow-actions .step-fields { grid-template-columns: 1fr; }
  .ai-deep-actions { align-items: stretch; flex-direction: column; }
  .ai-deep-actions::before { margin-right: 0; }
  .diagnosis-preset-grid { grid-template-columns: 1fr; }
  .decision-columns { grid-template-columns: 1fr; }
  .customer-key-grid { grid-template-columns: 1fr 1fr; }
  .ai-summary-meta.packet-summary-meta { grid-template-columns: 1fr 1fr; }
  .diagnosis-overview { grid-template-columns: 1fr; }
  .overview-evidence { grid-column: auto; }
  .wan-boundary-grid { grid-template-columns: 1fr; }
  .access-quality-grid { grid-template-columns: 1fr; }
  .diagnosis-flow { grid-template-columns: 1fr 1fr; }
  .onu-sn-continue { grid-template-columns: 1fr; }
  .onu-sn-buttons { align-items: stretch; flex-direction: column; }
  .access-action-grid { grid-template-columns: 1fr; }
  .operator-steps { grid-template-columns: 1fr 1fr; }
  .customer-report-head { flex-direction: column; }
  .customer-report-grid { grid-template-columns: 1fr; }
  .evidence-grid, .evidence-tables { grid-template-columns: 1fr; }
  .diagnostic-grid { grid-template-columns: 1fr; }
  .diagnostic-record-layout { grid-template-columns: 1fr; }
  .record-detail-grid { grid-template-columns: 1fr; }
  .record-access-grid { grid-template-columns: 1fr; }
  .record-packet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-loop-grid { grid-template-columns: 1fr; }
  .diagnosis-topology-card { grid-column: span 1; }
  .topology-detail-grid { grid-template-columns: 1fr; }
  .topology-page .panel-actions { justify-content: stretch; }
  .topology-page .panel-actions input,
  .topology-page .panel-actions select,
  .topology-page .panel-actions button { width: 100%; }
}

@media (max-width: 560px) {
  .sidebar { gap: 4px; padding: 7px 8px; }
  .brand { margin-right: 3px; font-size: 15px; }
  .nav { padding: 7px 9px; font-size: 13px; }
  .ai-wan-compare-head { flex-direction: column; }
  .ai-wan-compare-head button { width: 100%; }
  .ai-wan-compare-actions button { width: 100%; }
  .ai-summary-meta.packet-summary-meta { grid-template-columns: 1fr; }
  .customer-key-grid,
  .access-quality-grid,
  .diagnosis-flow {
    grid-template-columns: 1fr;
  }
  .traffic-summary-grid { grid-template-columns: 1fr; }
  .distribution-body { grid-template-columns: 1fr; }
  .distribution-legend { order: 2; }
  .donut-canvas { order: 1; }
}
#wan-meta .wan-meta-panel {
  overflow: visible;
  padding: 0;
}

#wan-meta .wan-meta-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
}

#wan-meta .wan-meta-table-wrap {
  overflow-x: auto;
}

#wan-meta {
  --wan-table-width: 1650px;
  --wan-cols: 80px 100px 460px 90px 70px 130px 210px 300px 130px 130px;
}

#wan-meta table {
  width: var(--wan-table-width);
  table-layout: fixed;
  min-width: var(--wan-table-width);
}

#wan-meta .wan-meta-fixed-head {
  width: var(--wan-table-width);
  min-width: var(--wan-table-width);
  margin-top: 8px;
  overflow: hidden;
}

#wan-meta .wan-meta-fixed-head table {
  margin: 0;
}

#wan-meta .wan-meta-fixed-head th {
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

#wan-meta .wan-meta-table-wrap thead {
  display: none;
}

#wan-meta thead th {
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}

#wan-meta table,
#wan-meta th,
#wan-meta td {
  box-sizing: border-box;
}

#wan-meta .wan-col-device { width: 80px; }
#wan-meta .wan-col-interface { width: 100px; }
#wan-meta .wan-col-info { width: 460px; }
#wan-meta .wan-col-isp { width: 90px; }
#wan-meta .wan-col-nat { width: 70px; }
#wan-meta .wan-col-role { width: 130px; }
#wan-meta .wan-col-capability { width: 210px; }
#wan-meta .wan-col-scope { width: 300px; }
#wan-meta .wan-col-remark { width: 130px; }
#wan-meta .wan-col-action { width: 130px; }

#wan-meta td {
  overflow-wrap: anywhere;
}

.wan-device-info {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.wan-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wan-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.35;
}

.wan-badge.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.wan-badge.bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.wan-badge.muted {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.wan-default-route {
  color: #2563eb;
  font-weight: 700;
}





.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.observation-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 12px;
  border: 1px solid #e5484d;
  border-left-width: 4px;
  background: #fff1f0;
  color: #8f1d22;
}

.observation-alert button {
  flex: 0 0 auto;
}

#diagnosisProfileSegmentsBody input[type="text"],
#diagnosisProfileSegmentsBody input:not([type]),
#diagnosisProfileSegmentsBody select,
#diagnosisProfilePppoeBody select {
  min-width: 110px;
  max-width: 180px;
}

#diagnosisProfileSegmentsBody input[type="checkbox"],
#diagnosisProfilePppoeBody input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* Monitoring terminal list and native five-tuple flow table */
.monitoring-list-page .panel {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.monitoring-list-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.monitoring-list-page .panel-head {
  padding: 16px 18px 10px;
}

.flow-panel-head,
.flow-refresh-controls,
.flow-audit-bar,
.monitor-pagination,
.monitor-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-panel-head,
.flow-audit-bar,
.monitor-pagination {
  justify-content: space-between;
}

.flow-refresh-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.flow-refresh-controls input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.monitor-filter-grid {
  display: grid;
  gap: 10px;
  padding: 10px 18px;
  align-items: center;
}

.terminal-filter-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto auto;
}

.flow-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 8px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.flow-filter-toolbar input,
.flow-filter-toolbar select {
  flex: 0 0 auto;
  width: 108px;
  min-width: 0;
  height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.flow-filter-toolbar button {
  flex: 0 0 auto;
  height: 32px;
  padding: 5px 11px;
  white-space: nowrap;
}

#flowApp { width: 128px; }
#flowProtocol, #flowStatus { width: 96px; }
#flowTerminalAddr, #flowDstAddr, #flowSrcAddr { width: 118px; }
#flowDomain { width: 138px; }
#flowDstPort, #flowSrcPort, #flowTerminalPort { width: 88px; }
#flowDstInterface, #flowSrcInterface { width: 112px; }

.flow-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 18px;
  border-bottom: 1px solid #dbe3ef;
}

.flow-tabs button {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #475569;
  padding: 10px 16px;
}

.flow-tabs button.active {
  border-color: #dbe3ef;
  background: #fff;
  color: #246bfe;
  font-weight: 700;
  margin-bottom: -1px;
}

.flow-audit-bar {
  margin: 12px 18px 0;
  border: 1px solid #f3c969;
  border-radius: 6px;
  background: #fff8e6;
  color: #7c4a03;
  padding: 10px 12px;
  font-size: 13px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 8px;
  padding: 0 18px 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 9px;
  font-size: 12px;
}

.monitor-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: calc(100vh - 330px);
  overflow: auto;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.monitor-data-table {
  table-layout: auto;
  margin: 0;
}

.terminal-data-table {
  min-width: 1420px;
}

.flow-data-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.monitor-data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  white-space: nowrap;
}

.monitor-data-table td {
  white-space: nowrap;
}

.flow-data-table th,
.flow-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-data-table tbody tr:hover td {
  background: #f8fbff;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #475569;
  padding: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-header:hover {
  background: transparent;
  color: #1d4ed8;
}

.sort-header.sort-asc::after { content: "▲"; font-size: 10px; }
.sort-header.sort-desc::after { content: "▼"; font-size: 10px; }

.flow-data-table .sticky-col {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.flow-data-table th.sticky-col {
  z-index: 5;
  background: #f8fafc;
}

.flow-data-table .sticky-col-1 { left: 0; }
.flow-data-table .sticky-col-2 { left: var(--flow-sticky-start-width, 150px); }
.flow-data-table .sticky-col-3 { left: calc(var(--flow-sticky-start-width, 150px) + var(--flow-sticky-app-width, 128px)); }

.flow-data-table th[data-flow-column] {
  padding-right: 11px;
}

.flow-column-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 8;
}

.flow-column-resizer::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 3px;
  width: 1px;
  background: #cbd5e1;
}

.flow-column-resizer:hover::after,
.flow-column-resizer.resizing::after {
  width: 2px;
  background: #246bfe;
}

body.flow-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.monitor-pagination {
  padding: 12px 18px;
  color: #64748b;
  font-size: 13px;
}

.monitor-pagination button,
.monitor-pagination select,
.table-actions button {
  padding: 7px 10px;
}

.flow-truncated {
  color: #b45309 !important;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .terminal-filter-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .flow-panel-head,
  .flow-audit-bar,
  .monitor-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .terminal-filter-grid {
    grid-template-columns: 1fr;
  }
}

.assignment-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .24);
}

.assignment-dialog::backdrop { background: rgba(15, 23, 42, .45); }

.assignment-dialog-head,
.assignment-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.assignment-dialog-head span,
.assignment-dialog-hint { color: #64748b; font-size: 13px; }
.assignment-dialog-head h3 { margin: 4px 0 0; }
.assignment-search { width: calc(100% - 40px); margin: 16px 20px 10px; }
.assignment-device-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 390px;
  overflow: auto;
  padding: 8px 20px 16px;
}
.assignment-device-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f8fafc;
}
.assignment-device-option input { margin-top: 3px; }
.assignment-device-option strong,
.assignment-device-option span { display: block; }
.assignment-device-option span { margin-top: 4px; color: #64748b; font-size: 12px; }
.assignment-dialog-hint { margin: 0; padding: 0 20px 12px; }
.assignment-dialog-actions { justify-content: flex-end; border-top: 1px solid #e2e8f0; border-bottom: 0; }
.role-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #eaf1ff; color: #1d4ed8; font-size: 12px; font-weight: 700; }
.role-badge.role-super_admin { background: #fef3c7; color: #92400e; }

@media (max-width: 720px) {
  .assignment-device-options { grid-template-columns: 1fr; }
}
