/* NexDesk console styles (system console and merchant console) on top of
 * Layui components. Tokens are shared with desk.css and visitor.css. */
:root {
  --nd-primary: #0f6e62;
  --nd-primary-strong: #0b5a50;
  --nd-primary-weak: #e3f1ee;
  --nd-top: #18202b;
  --nd-top-2: #263140;
  --nd-text: #1c2430;
  --nd-muted: #6b7686;
  --nd-border: #e3e7ec;
  --nd-bg: #f3f5f7;
  --nd-surface: #ffffff;
  --nd-ok: #16a34a;
  --nd-warn: #d97706;
  --nd-err: #dc2626;
  --nd-info: #2563eb;
  --nd-violet: #7c3aed;
  --nd-radius: 8px;
  --nd-row: 40px;
  --nd-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --global-primary-color: #0f6e62;
}
body { color: var(--nd-text); font-size: 14px; background: var(--nd-bg); margin: 0; }
body.nd-density-compact { --nd-row: 32px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.nd-num, .nd-stat .v { font-variant-numeric: tabular-nums; font-family: var(--nd-mono); }

/* Layui accents in the product colour */
.layui-btn { background-color: var(--nd-primary); border-radius: 6px; }
.layui-btn:hover { opacity: 1; background-color: var(--nd-primary-strong); color: #fff; }
.layui-btn-primary { background: #fff; color: var(--nd-text); border-color: var(--nd-border); }
.layui-btn-primary:hover { background: #fff; color: var(--nd-primary); border-color: var(--nd-primary); }
.layui-btn-danger { background-color: var(--nd-err); }
.layui-btn-danger:hover { background-color: #b91c1c; }
.layui-input:focus, .layui-textarea:focus, select:focus { border-color: var(--nd-primary) !important; box-shadow: 0 0 0 2px var(--nd-primary-weak); }
a { color: var(--nd-primary); }
:focus-visible { outline: 2px solid var(--nd-primary); outline-offset: 2px; }

/* Top bar (shared with auth pages) */
.nd-top { position: fixed; inset: 0 0 auto 0; height: 52px; z-index: 100; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--nd-top); color: #e7ecf2; }
.nd-top-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff !important; font-weight: 600; font-size: 16px; white-space: nowrap; }
.nd-logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--nd-primary); color: #fff; }
.nd-logo-mark .ic { width: 17px; height: 17px; }
.nd-port-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--nd-top-2); }
.nd-port-seg a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 6px; color: #c3ccd7; font-size: 13px; white-space: nowrap; }
.nd-port-seg a:hover { color: #fff; }
.nd-port-seg a.is-current { background: #fff; color: var(--nd-text); font-weight: 600; }
.nd-port-seg .ic { width: 16px; height: 16px; }
.nd-port-name { padding: 4px 10px; border-radius: 6px; background: var(--nd-top-2); font-size: 13px; }
.nd-app-context { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 6px; background: var(--nd-top-2); white-space: nowrap; font-size: 13px; }
.nd-app-context strong { color: #fff; }
.nd-app-context code { color: #9aa6b4; font-size: 12px; }
.nd-app-label { color: #9aa6b4; font-size: 12px; }
.nd-app-context .nd-switch summary { color: #c3ccd7; padding: 2px 4px; }
.nd-app-context .nd-switch summary:hover, .nd-app-context .nd-switch[open] summary { background: rgba(255,255,255,.08); }
.nd-top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nd-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; color: #c3ccd7; background: none; border: 0; cursor: pointer; }
.nd-iconbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nd-dot-count { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--nd-err); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.nd-user summary { display: flex; align-items: center; gap: 8px; color: #e7ecf2; }
.nd-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #3a4656; color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.nd-user-text { display: flex; flex-direction: column; line-height: 1.15; }
.nd-user-text b { font-weight: 500; font-size: 13px; }
.nd-user-text small { color: #9aa6b4; font-size: 11px; }
.nd-switch { position: relative; }
.nd-switch summary { cursor: pointer; list-style: none; padding: 5px 8px; border-radius: 6px; user-select: none; white-space: nowrap; }
.nd-switch summary::-webkit-details-marker { display: none; }
.nd-top .nd-switch summary:hover, .nd-top .nd-switch[open] summary { background: rgba(255,255,255,.08); }
.nd-switch ul { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1000; min-width: 170px; margin: 0; list-style: none; background: #fff; border: 1px solid var(--nd-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,32,.16); padding: 4px 0; }
.nd-app-context .nd-switch ul { left: 0; right: auto; }
.nd-switch li a, .nd-switch li .nd-linkbtn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; color: var(--nd-text); width: 100%; text-align: left; box-sizing: border-box; }
.nd-switch li a:hover, .nd-switch li .nd-linkbtn:hover { background: var(--nd-bg); }
.nd-linkbtn { background: none; border: 0; color: var(--nd-primary); cursor: pointer; padding: 0; font: inherit; }

/* Left menu */
.nd-aside { position: fixed; top: 52px; bottom: 0; left: 0; width: 200px; overflow-y: auto; background: var(--nd-surface); border-right: 1px solid var(--nd-border); padding: 8px 10px 24px; box-sizing: border-box; }
.nd-aside-group { color: #8a95a3; font-size: 12px; padding: 14px 10px 6px; }
.nd-menu { list-style: none; margin: 0; padding: 0; }
.nd-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--nd-text); font-size: 14px; }
.nd-menu a:hover { background: var(--nd-bg); }
.nd-menu .is-current a { background: var(--nd-primary-weak); color: var(--nd-primary); font-weight: 600; }
.nd-menu .ic { color: #5b6676; }
.nd-menu .is-current .ic { color: var(--nd-primary); }
.nd-body { margin-left: 200px; padding-top: 52px; min-height: 100vh; box-sizing: border-box; }
.nd-crumb { color: var(--nd-muted); font-size: 12px; margin: 0 0 6px; }

/* Main */
.nd-main { padding: 16px 20px 40px; max-width: 1600px; }
.nd-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.nd-pagehead h1 { font-size: 20px; font-weight: 600; margin: 0; }
.nd-pagehead-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nd-sub { color: var(--nd-muted); margin: 4px 0 0; }
.nd-muted { color: var(--nd-muted); }
.nd-hint { color: var(--nd-muted); font-size: 12px; margin: 4px 0 0; }
.nd-card { background: #fff; border: 1px solid var(--nd-border); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.nd-card h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.nd-card h3 { font-size: 14px; font-weight: 600; margin: 12px 0 8px; }
.nd-grid { display: grid; gap: 16px; }
.nd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nd-split { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; }
@media (max-width: 1200px) { .nd-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nd-split { grid-template-columns: 1fr; } }
.nd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.nd-stat { background: #fff; border: 1px solid var(--nd-border); border-radius: 8px; padding: 12px 14px; display: block; color: inherit; }
a.nd-stat:hover { border-color: var(--nd-primary); }
.nd-stat .v { font-size: 24px; font-weight: 600; line-height: 1.3; }
.nd-stat .k { color: var(--nd-muted); font-size: 13px; }
.nd-stat.warn .v { color: var(--nd-warn); }
.nd-stat.err .v { color: var(--nd-err); }

/* Dashboard (A10/A12) */
.nd-seg { display: inline-flex; border: 1px solid var(--nd-border); border-radius: 7px; overflow: hidden; background: #fff; }
.nd-seg a { padding: 5px 14px; color: var(--nd-text); font-size: 13px; border-left: 1px solid var(--nd-border); white-space: nowrap; }
.nd-seg a:first-child { border-left: 0; }
.nd-seg a:hover { background: var(--nd-bg); }
.nd-seg a[aria-current] { background: var(--nd-primary-weak); color: var(--nd-primary); font-weight: 600; }
.nd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.nd-kpi { background: #fff; border: 1px solid var(--nd-border); border-radius: var(--nd-radius); padding: 16px 18px; }
.nd-kpi .k { color: var(--nd-muted); font-size: 13px; }
.nd-kpi .v { font-family: var(--nd-mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; margin: 6px 0 4px; }
.nd-kpi .d { font-family: var(--nd-mono); font-size: 12px; color: var(--nd-ok); }
.nd-kpi .d span { font-family: inherit; color: var(--nd-muted); }
.nd-kpi-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--nd-primary-weak); color: var(--nd-primary); flex: none; }
.nd-kpi-row { display: flex; gap: 12px; align-items: center; }
.nd-kpi-row .v { margin: 2px 0 0; font-size: 24px; }
.nd-kpi-ic.is-blue { background: #e0ecff; color: #2563eb; }
.nd-kpi-ic.is-amber { background: #fef3c7; color: #b45309; }
.nd-kpi-ic.is-red { background: #fee2e2; color: #dc2626; }
.nd-dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.nd-dash-grid > .nd-card { margin-bottom: 16px; }
.nd-chart { width: 100%; height: auto; display: block; }
.nd-chart-grid { stroke: #eef1f4; stroke-width: 1; }
.nd-chart-tick { fill: #8a95a3; font-size: 11px; font-family: var(--nd-mono); }
.nd-chart-area { fill: var(--nd-primary); fill-opacity: .08; }
.nd-chart-line { fill: none; stroke: var(--nd-primary); stroke-width: 2; stroke-linejoin: round; }
.nd-chart-line2 { fill: none; stroke: var(--nd-violet); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.nd-legend { display: flex; gap: 14px; font-size: 12px; color: var(--nd-muted); }
.nd-legend span::before { content: ""; display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--nd-primary); }
.nd-legend .l2::before { background: var(--nd-violet); }
.nd-bar-row { margin-bottom: 14px; }
.nd-bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.nd-bar { display: block; height: 6px; border-radius: 3px; background: #eef1f4; overflow: hidden; flex: 1; }
.nd-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--nd-primary); }
.nd-bar.is-low > span { background: var(--nd-warn); }
.nd-bar.is-red > span { background: var(--nd-err); }
.nd-bar-inline { display: flex; align-items: center; gap: 10px; }
.nd-bar-k { flex: 0 0 56px; font-size: 13px; color: var(--nd-muted); }
.nd-bar-inline .nd-num { flex: 0 0 40px; text-align: right; font-size: 13px; }
.nd-minibar { display: flex; align-items: center; gap: 8px; }
.nd-minibar .nd-bar { flex: 0 0 90px; }
.nd-minibar .nd-num { font-size: 12px; }
.nd-plain { border: 0; border-radius: 0; }
.nd-plain .layui-table th { background: transparent; color: var(--nd-muted); font-weight: 500; font-size: 12px; }
.nd-stats-flat { margin-bottom: 0; }
.nd-stats-flat .nd-stat { background: #fafbfc; }
@media (max-width: 1200px) { .nd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nd-dash-grid { grid-template-columns: 1fr; } }

/* Live monitor (A10) */
.nd-autorefresh { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--nd-ok); white-space: nowrap; }
.nd-pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 0 8px; border-radius: 10px; line-height: 20px; background: var(--nd-bg); color: var(--nd-muted); vertical-align: 2px; }
.nd-pill-err { background: #fee2e2; color: #b91c1c; }
.nd-pill-warn { background: #fef3c7; color: #92400e; }
.nd-alerts { list-style: none; margin: 0 -20px; padding: 0; }
.nd-alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #f0f2f5; }
.nd-alert-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; flex: none; background: #fef3c7; color: #b45309; }
.is-error .nd-alert-ic { background: #fee2e2; color: #dc2626; }
.nd-alert-body { flex: 1; min-width: 0; }
.nd-alert-text { color: #3a4656; font-size: 13px; margin-top: 2px; }
.nd-live-dot { font-size: 12px; color: var(--nd-ok); }
.nd-live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--nd-ok); margin-right: 6px; vertical-align: 1px; }
.nd-who { display: flex; gap: 10px; align-items: center; }
.nd-avatar-sm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #eef1f4; color: #3a4656; font-weight: 600; font-size: 13px; flex: none; }
.nd-small { font-size: 12px; }
.nd-intent-accepting { background: #dcfce7; color: #166534; }
.nd-intent-busy { background: #fee2e2; color: #b91c1c; }
.nd-intent-away { background: #fef3c7; color: #92400e; }
.nd-intent-offline { background: #eef0f3; color: #6b7280; }
.nd-loadcell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.nd-loadcell .nd-num { font-size: 12px; min-width: 32px; }
.nd-filter-flat { border: 0; padding: 0 0 12px; margin: 0; background: transparent; }
.nd-empty .ic { color: var(--nd-ok); vertical-align: -4px; }
/* Big-screen mode: no chrome, larger figures */
.nd-screen .nd-aside, .nd-screen .nd-top, .nd-screen .nd-crumb { display: none; }
.nd-screen .nd-body { margin-left: 0; padding-top: 0; }
.nd-screen .nd-main { max-width: none; }
.nd-screen .nd-kpi .v { font-size: 40px; }

.nd-rating { font-size: 12px; padding: 0 8px; border-radius: 10px; line-height: 20px; display: inline-block; }
.nd-rating-satisfied { background: #dcfce7; color: #166534; }
.nd-rating-neutral { background: #eef0f3; color: #4b5563; }
.nd-rating-dissatisfied { background: #fee2e2; color: #991b1b; }

/* 客服与分组 (A13) */
.nd-group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.nd-group-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--nd-border); border-radius: var(--nd-radius); padding: 14px 16px; color: var(--nd-text); }
a.nd-group-card:hover { border-color: var(--nd-primary); }
.nd-group-card.is-all { border-color: var(--nd-primary); background: var(--nd-primary-weak); }
.nd-group-nums { display: flex; gap: 12px; font-size: 13px; color: var(--nd-muted); }
.nd-group-nums b { color: var(--nd-text); font-family: var(--nd-mono); font-weight: 600; }
.nd-section-title { font-size: 15px; margin: 8px 0 12px; }
.nd-who .nd-live-dot::before { margin-right: 0; }

/* Filters & tables */
.nd-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: #fff; border: 1px solid var(--nd-border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.nd-filter .nd-f { display: flex; flex-direction: column; gap: 4px; }
.nd-filter label { font-size: 12px; color: var(--nd-muted); }
.nd-filter .layui-input, .nd-filter select { height: 32px; min-width: 140px; }
.nd-table-wrap { background: #fff; border: 1px solid var(--nd-border); border-radius: 8px; overflow-x: auto; }
.nd-table-wrap .layui-table { margin: 0; }
.layui-table td, .layui-table th { padding: 8px 14px; height: var(--nd-row); border-color: #eef1f4 !important; }
.layui-table th { background: #f8fafb; font-weight: 500; color: #5b6676; font-size: 13px; }
.layui-table tbody tr:hover { background: #fafbfc; }
.nd-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.nd-empty { padding: 32px; text-align: center; color: var(--nd-muted); }
.nd-pager { display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding: 10px 0; color: var(--nd-muted); }
.nd-tag { display: inline-block; padding: 0 8px; border-radius: 10px; background: var(--nd-bg); font-size: 12px; line-height: 20px; margin: 1px 2px; }
.nd-state { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; line-height: 20px; background: var(--nd-bg); }
.nd-state-serving, .nd-state-active, .nd-state-completed { background: #dcfce7; color: #166534; }
.nd-state-queued, .nd-state-processing, .nd-state-stop_new, .nd-state-draining { background: #fef3c7; color: #92400e; }
.nd-state-manual_pending, .nd-state-disabled, .nd-state-revoked { background: #fee2e2; color: #991b1b; }
.nd-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--nd-muted); }
.nd-ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Forms */
.nd-form { display: flex; flex-direction: column; gap: 4px; }
.nd-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.nd-form-grid .nd-full { grid-column: 1 / -1; }
.nd-label { font-weight: 500; margin-top: 8px; display: block; }
.nd-req::after { content: " *"; color: var(--nd-err); }
.nd-field-error { color: var(--nd-err); font-size: 12px; margin-top: 2px; }
.nd-fieldset { border: 1px solid var(--nd-border); border-radius: 6px; padding: 8px 12px 12px; margin: 8px 0; }
.nd-fieldset legend { padding: 0 6px; font-weight: 500; }
.nd-fieldset label { display: block; margin: 6px 0; }
.nd-form select, .nd-form textarea, .nd-form-grid select, .nd-form-grid textarea { width: 100%; }
textarea.layui-textarea { min-height: 80px; }
.nd-form-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.nd-danger-zone { border-color: #fecaca; }
.nd-danger-zone h2 { color: var(--nd-err); }
.nd-confirm { border: 1px solid #fde68a; background: #fffbeb; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.nd-confirm dt { font-weight: 600; }
.nd-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.nd-dl dt { color: var(--nd-muted); }
.nd-dl dd { margin: 0; word-break: break-all; }
.nd-inline { display: inline; }
.nd-mt { margin-top: 12px; }
.nd-mb { margin-bottom: 12px; }

/* Alerts (persistent for important states) */
.nd-alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid; }
.nd-alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.nd-alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.nd-alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.nd-alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Auth pages */
.nd-auth { background: var(--nd-bg); min-height: 100vh; }
.nd-auth-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--nd-border); flex-wrap: wrap; gap: 8px; }
.nd-brand { font-size: 18px; font-weight: 600; color: var(--nd-text); display: inline-flex; align-items: center; }
.nd-auth-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nd-who { color: var(--nd-muted); }
.nd-auth-main { padding: 84px 16px 32px; display: flex; flex-direction: column; align-items: center; }
.nd-login { width: 380px; max-width: 100%; margin-top: 6vh; }
.nd-login h1, .nd-narrow h1 { font-size: 22px; margin: 0 0 4px; }
.nd-narrow { width: 720px; max-width: 100%; }
.nd-demo { border-top: 1px solid var(--nd-border); padding-top: 14px; }
.nd-demo h2 { font-size: 15px; margin: 0 0 4px; }
.nd-demo-pw { font-family: var(--nd-mono); background: var(--nd-primary-weak); color: var(--nd-primary-strong); padding: 1px 6px; border-radius: 4px; }
.nd-demo-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.nd-demo-pick { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--nd-border); border-radius: 6px; color: var(--nd-text); background: #fff; }
.nd-demo-pick span { color: var(--nd-muted); font-size: 12px; }
.nd-demo-pick:hover, .nd-demo-pick.is-picked { border-color: var(--nd-primary); background: var(--nd-primary-weak); }
.nd-port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.nd-port-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--nd-border); border-radius: 8px; color: var(--nd-text); background: #fff; }
.nd-port-tile:hover { border-color: var(--nd-primary); box-shadow: 0 2px 8px rgba(30,111,217,.12); }
.nd-port-tile span { color: var(--nd-muted); font-size: 13px; }
.nd-mfa-setup { display: flex; gap: 16px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.nd-secret { display: block; font-size: 15px; letter-spacing: 1px; padding: 6px 8px; background: var(--nd-bg); border-radius: 4px; word-break: break-all; margin: 4px 0; }

/* Preview (brand) */
.nd-preview { border: 1px dashed var(--nd-border); border-radius: 8px; padding: 12px; background: #fafbfc; }
.nd-preview-chat { width: 340px; max-width: 100%; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.12); background: #fff; margin: 0 auto; }
.nd-preview-chat header { padding: 12px 14px; color: #fff; font-weight: 600; }
.nd-preview-chat .body { padding: 12px; min-height: 160px; background: #f7f8fa; }
.nd-preview-chat .bubble { display: inline-block; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--nd-border); margin: 4px 0; max-width: 80%; }
.nd-preview-note { color: var(--nd-muted); font-size: 12px; text-align: center; margin-top: 8px; }

@media (max-width: 900px) {
  .nd-aside { display: none; }
  .nd-body { margin-left: 0; }
  .nd-port-seg span, .nd-user-text, .nd-app-context code { display: none; }
  .nd-form-grid, .nd-grid-2 { grid-template-columns: 1fr; }
}

/* Access network allowlist (B02) */
.nd-dl-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; }
.nd-dl-row dt { color: var(--nd-muted, #6b7685); }
.nd-dl-row dd { margin: 0; }
.nd-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-weight: 600; }
.nd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nd-hint-list { margin: 16px 0 0; padding-left: 18px; color: #6b7685; font-size: 13px; line-height: 1.8; }

/* Handled monitor alerts (A10) */
.nd-alert-row.is-handled { opacity: 0.7; }

/* Detail drawer (A11) */
.nd-drawer-wrap { position: fixed; inset: 0; z-index: 900; }
.nd-drawer-mask { position: absolute; inset: 0; background: rgba(24, 32, 43, 0.32); }
.nd-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--nd-surface, #fff); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; outline: none; }
.nd-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--nd-border); }
.nd-drawer-head h2 { margin: 0; font-size: 16px; }
.nd-drawer-head p { margin: 4px 0 0; }
.nd-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.nd-drawer-body h3 { font-size: 14px; margin: 20px 0 8px; }
.nd-drawer-foot { padding: 12px 20px; border-top: 1px solid var(--nd-border); text-align: right; }
.nd-drawer-segs { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.9; }
.nd-drawer-open { overflow: hidden; }
.nd-nowrap { white-space: nowrap; }

/* Notification bell (A17) */
.nd-bell summary { position: relative; display: inline-flex; align-items: center; padding: 6px 8px; color: #cfd6df; }
.nd-bell-count { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e5484d; color: #fff;
  font-size: 11px; line-height: 16px; text-align: center; box-sizing: border-box; }
.nd-bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; background: #fff; color: var(--nd-text); border: 1px solid var(--nd-border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); z-index: 950; }
.nd-bell-title { padding: 10px 14px; border-bottom: 1px solid var(--nd-border); font-weight: 600; }
.nd-bell-list { list-style: none; margin: 0; padding: 4px 0; max-height: 360px; overflow-y: auto; }
.nd-bell-list > li.nd-muted { padding: 12px 14px; }
.nd-bell-list a { display: grid; gap: 2px; padding: 8px 14px; color: var(--nd-text); border-left: 3px solid transparent; }
.nd-bell-list a:hover { background: var(--nd-bg); }
.nd-bell-list a.is-error { border-left-color: #e5484d; }
.nd-bell-list a.is-warn { border-left-color: #f5a524; }
.nd-bell-list a.is-info { border-left-color: var(--nd-primary); }
.nd-bell-list strong { font-size: 12px; color: #6b7685; font-weight: 600; }
.nd-bell-list small { color: #6b7685; }
.nd-bell .nd-bell-list { position: static; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.nd-bell .nd-bell-list a { display: grid; gap: 2px; padding: 8px 14px; white-space: normal; }

/* Work-number watermark (B03) over chat content; never intercepts input. */
.nd-watermark { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; user-select: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: flex-start; }
.nd-watermark span { flex: 0 0 280px; height: 170px; display: flex; align-items: center; justify-content: center;
  transform: rotate(-22deg); color: rgba(24, 32, 43, 0.075); font-size: 14px; white-space: nowrap; letter-spacing: 0.5px; }
@media print { .nd-watermark { display: flex !important; } .nd-watermark span { color: rgba(0, 0, 0, 0.12); } }
