/*
  LinePro console theme.
  The class names intentionally mirror Tailwind concepts while keeping the app
  dependency-free and fully embedded in the Go binary.
*/
:root {
  --bg: #f8fafc;
  --shell: #0f172a;
  --shell-2: #1e293b;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue: #4f46e5;
  --amber: #b45309;
  --red: #dc2626;
  --green-soft: #ecfdf5;
  --blue-soft: #eef2ff;
  --amber-soft: #fffbeb;
  --red-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
}

body {
  color: #0f172a;
  background: #f8fafc;
}

button,
input,
select,
textarea {
  border-radius: 0.75rem;
}

button {
  border-color: #e2e8f0;
  color: #334155;
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

button:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
  color: #3730a3;
}

button.primary,
button.blue {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #ffffff;
}

button.primary:hover,
button.blue:hover {
  border-color: #4338ca;
  background: #4338ca;
  color: #ffffff;
}

button.danger {
  border-color: #fecaca;
  background: #dc2626;
  color: #ffffff;
}

button.danger:hover {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

button.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.app {
  background: #f8fafc;
}

aside {
  border-right: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02);
}

.brand {
  color: #0f172a;
}

.brand .mark {
  border-radius: 1rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.2);
}

nav button {
  border-color: transparent;
  color: #475569;
  background: transparent;
  box-shadow: none;
}

nav button:hover {
  background: #eef2ff;
  color: #3730a3;
}

nav button.active {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.nav-icon,
.icon-inline {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

header {
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.header-title h1,
.section-head h2,
.panel-title h3,
.card-title strong {
  color: #0f172a;
}

.header-title span,
.section-head p,
.panel-title span,
.card-title span,
.trend,
.muted,
.mono-line {
  color: #64748b;
}

.panel,
.data-card,
.metric,
.auth-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.panel-title,
.card-head {
  border-color: #eef2f7;
}

.metric {
  padding: 18px;
}

.metric .meta span:first-child {
  color: #64748b;
  font-weight: 600;
}

.metric strong {
  color: #0f172a;
}

table {
  color: #334155;
}

th {
  color: #334155;
  font-weight: 700;
  background: #f8fafc;
}

td {
  color: #334155;
}

.table-preview {
  display: grid;
  min-width: 240px;
  max-width: 560px;
  gap: 6px;
}

.preview-text {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr.task-row-highlight {
  background: #ecfdf5;
  box-shadow: inset 4px 0 0 #10b981;
}

tbody tr.task-row-highlight:hover {
  background: #dcfce7;
}

input,
select,
textarea {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
  outline: none;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.badge.portal,
.badge.success,
.badge.online,
.badge.issued,
.badge.OK,
.badge.enabled {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.badge.bridge,
.badge.running,
.badge.pending {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.badge.failed,
.badge.offline,
.badge.down,
.badge.FAIL {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.badge.warning,
.badge.issuing,
.badge.degraded,
.badge.WARN {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.badge.unknown,
.badge.disabled,
.badge.direct,
.badge.canceled,
.badge.cancelled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.card-actions,
.row-actions,
.actions,
.toolbar {
  gap: 8px;
}

.auth-card {
  border-radius: 1.25rem;
}

.login-screen {
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.12), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(99, 102, 241, 0.10), transparent 24%),
    #f8fafc;
}

.user-pill {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #334155;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-wide {
  width: min(1120px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 20px;
}

.modal-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.modal-head span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.modal-card form,
.modal-body {
  overflow: auto;
  padding: 20px;
}

.modal-actions {
  position: sticky;
  bottom: -20px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  margin: 4px -20px -20px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.detail-modal-actions {
  position: static;
  margin: 0;
  padding: 14px 20px;
}

.modal-card form.tunnel-form-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  overflow: auto;
  padding: 20px;
}

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

.protocol-pair-wide {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
}

.protocol-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 14px;
}

.protocol-card-full {
  grid-column: 1 / -1;
}

.protocol-card-primary {
  border-color: #c7d2fe;
}

.protocol-card-backup {
  border-color: #bae6fd;
}

.protocol-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.protocol-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  background: #eef2ff;
  color: #4f46e5;
}

.protocol-card-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
}

.protocol-card-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.advanced-box,
.advanced-card {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.advanced-card {
  padding: 0;
}

.advanced-box summary,
.advanced-card summary {
  display: flex;
  min-width: 0;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #334155;
  list-style: none;
}

.advanced-box summary::-webkit-details-marker,
.advanced-card summary::-webkit-details-marker {
  display: none;
}

.advanced-box summary::after,
.advanced-card summary::after {
  content: "+";
  margin-left: auto;
  color: #4f46e5;
  font-weight: 700;
}

.advanced-box[open] summary::after,
.advanced-card[open] summary::after {
  content: "-";
}

.advanced-box summary span,
.advanced-card summary span {
  min-width: 0;
}

.advanced-box summary strong,
.advanced-card summary strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.advanced-box summary em,
.advanced-card summary em {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.advanced-box > .field-grid,
.advanced-card > .field-grid {
  padding: 0 12px 12px;
}

.advanced-box > .param-tips,
.advanced-card > .param-tips {
  margin: 0 12px 12px;
}

.field-grid,
.entry-form-grid {
  display: grid;
  gap: 12px;
}

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

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

.field-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-wide {
  grid-column: span 2;
}

.param-tips {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
  list-style: none;
}

.param-tips li {
  min-width: 0;
}

.param-tips strong {
  color: #3730a3;
  font-weight: 700;
}

.param-tips code {
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

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

.entry-form-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
}

.entry-form-card-wide {
  grid-column: 1 / -1;
}

.entry-form-card textarea {
  min-height: 78px;
}

.json-policy-box {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.json-policy-box:focus {
  outline: none;
  border-color: rgba(15, 23, 42, 0.28);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}

.entry-form-card .shadowsocks-controls {
  grid-template-columns: minmax(76px, .55fr) minmax(105px, .7fr) minmax(180px, 1.25fr) minmax(92px, .65fr);
}

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

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

.vpn-policy-editors {
  grid-template-columns: minmax(520px, 0.92fr) minmax(640px, 1.08fr);
  align-items: start;
}

.vpn-policy-panel {
  min-width: 0;
}

.vpn-policy-form {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.vpn-policy-form .form-grid {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 14px;
}

.vpn-policy-form label {
  color: #64748b;
  font-weight: 700;
  line-height: 1.35;
}

.vpn-policy-form input,
.vpn-policy-form select {
  min-width: 0;
  text-overflow: ellipsis;
}

.vpn-policy-form > .checkline,
.vpn-policy-form .check-row {
  min-width: 0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
}

.vpn-policy-form .check-row {
  margin-top: 0;
}

.vpn-policy-form .actions {
  justify-content: flex-end;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}

.checkline input {
  width: auto;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.health-action-buttons {
  min-width: 230px;
}

.health-action-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.health-action-notice svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.health-action-notice.running {
  color: #0369a1;
  background: #f0f9ff;
}

.health-action-notice.success {
  color: #047857;
  background: #ecfdf5;
}

.health-action-notice.warning {
  color: #b45309;
  background: #fffbeb;
}

.health-action-notice.error {
  color: #be123c;
  background: #fff1f2;
}

.health-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.health-metric span:last-child {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.health-card {
  gap: 12px;
}

.vpn-user-health-card {
  gap: 12px;
}

.vpn-user-health-card .card-head {
  gap: 14px;
}

.vpn-user-health-card .card-fields {
  align-items: stretch;
  gap: 10px;
}

.vpn-user-health-card .card-field {
  min-width: 0;
}

.vpn-user-health-card .health-detail,
.vpn-user-health-card .mono-line {
  overflow-wrap: anywhere;
}

#vpnUserHealthCards .cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

#vpnChainsTable code,
#vpnUsersTable code,
#vpnChainsTable .mono-line,
#vpnUsersTable .mono-line {
  overflow-wrap: anywhere;
  white-space: normal;
}

.health-card-highlight {
  box-shadow: 0 0 0 2px #38bdf8, 0 18px 36px rgba(14, 165, 233, 0.14);
}

.health-detail {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-list code,
.card-field code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: #f8fafc;
  padding: 5px 7px;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.copy-snippet {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.copy-snippet code {
  flex: 1 1 auto;
}

.copy-command {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  transition: all 0.2s ease;
}

.copy-command:hover {
  transform: scale(1.02);
  background: #f8fafc;
  color: #0f172a;
}

.copy-command .lucide {
  width: 15px;
  height: 15px;
}

.acceptance-last {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.acceptance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.udp-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.udp-result-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.raw-output {
  margin-top: 12px;
}

.raw-output summary {
  cursor: pointer;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.task-output {
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mfa-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  color: #334155;
  font-size: 13px;
}

.mfa-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.mfa-panel form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  overflow: visible;
  padding: 0;
}

.mfa-panel .modal-actions {
  position: static;
  justify-content: flex-end;
  border-top: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.mfa-secret-box {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.mfa-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.mfa-qr-wrap span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.mfa-qr-code {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.mfa-qr-code svg {
  width: 150px;
  height: 150px;
  display: block;
}

.mfa-qr-error {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mfa-secret-fields {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.mfa-secret-box textarea {
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

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

.detail-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.detail-block h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 14px;
}

.detail-block-full {
  grid-column: 1 / -1;
}

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

.traffic-chart {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.traffic-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #475569;
  font-size: 12px;
}

.traffic-chart-head strong {
  color: #0f172a;
  font-size: 13px;
}

.traffic-bars {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(7px, 1fr);
  align-items: end;
  gap: 4px;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid #cbd5e1;
  padding: 6px 0 18px;
}

.traffic-bars .muted {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.traffic-bar-wrap {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.traffic-bar {
  display: block;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #6366f1, #0ea5e9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.traffic-bar-wrap em {
  height: 12px;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 8px;
  color: #334155;
  font-size: 13px;
}

.detail-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.path-map {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(210px, .95fr) minmax(300px, 1.55fr) minmax(230px, 1fr);
  align-items: center;
  gap: 12px;
}

.path-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.path-live-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}

.path-node,
.path-lane {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  color: #334155;
  font-size: 12px;
}

.path-map-live .path-node {
  position: relative;
  padding-left: 42px;
  min-width: 0;
}

.path-entry-node {
  align-content: start;
  min-height: 90px;
}

.path-side-node {
  min-height: 58px;
}

.path-node > span:last-child {
  min-width: 0;
}

.path-icon {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
}

.path-node strong,
.path-lane strong {
  color: #0f172a;
  font-size: 13px;
}

.path-lanes {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.path-lane {
  border-color: #c7d2fe;
  min-width: 0;
}

.path-lane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.path-lane-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-lane.active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #3730a3;
  box-shadow: inset 4px 0 0 #4f46e5;
}

.path-lane.down {
  border-color: #fecaca;
  background: #fef2f2;
}

.path-flow {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.path-flow i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #6366f1, #0ea5e9, transparent);
  opacity: 0.22;
}

.path-flow.moving i {
  opacity: 0.95;
  animation: path-flow 1.2s linear infinite;
}

@keyframes path-flow {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(300%);
  }
}

.path-connection-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.entry-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.entry-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-badge strong {
  color: inherit;
}

.entry-badge em {
  color: #475569;
  font-style: normal;
}

.entry-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.entry-line {
  display: flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 5px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 3px 8px;
  line-height: 1.35;
}

.entry-line strong {
  flex: 0 0 auto;
  color: #312e81;
  font-size: 11px;
}

.entry-address {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  padding: 1px 5px;
  font-size: 11px;
  white-space: nowrap;
}

.node-service-list {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.node-service-badge {
  display: flex;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.node-service-badge.online {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.node-service-badge.offline {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.node-service-badge.unknown {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.node-service-badge strong {
  flex: 0 0 auto;
  color: inherit;
}

.node-service-badge span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.node-token {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}

.connection-chip {
  max-width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  padding: 4px 10px 4px 4px;
  font-size: 12px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.connection-chip strong {
  color: #0f172a;
}

.connection-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-chip.primary {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.connection-chip.backup,
.connection-chip.degraded {
  border-color: #fde68a;
  background: #fffbeb;
}

.connection-chip.more {
  padding: 6px 10px;
  color: #64748b;
}

.runtime-lines {
  display: grid;
  max-height: 260px;
  overflow: auto;
  gap: 8px;
}

.runtime-lines code {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.detail-pre {
  min-height: 260px;
  max-height: 62vh;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .modal {
    padding: 12px;
  }

  .detail-grid,
  .traffic-grid,
  .path-map,
  .mfa-secret-box,
  .protocol-pair-grid,
  .protocol-pair-wide,
  .two-col,
  .form-grid,
  .inline-form,
  .udp-result-grid,
  .field-grid-4,
  .field-grid-3,
  .entry-form-grid {
    grid-template-columns: 1fr;
  }

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

  .field-wide,
  .entry-form-card-wide {
    grid-column: 1 / -1;
  }

  .entry-form-card .shadowsocks-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-preview {
    min-width: 180px;
    max-width: 100%;
  }

  .path-live-head {
    display: grid;
  }

  .path-live-meta {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .field-grid-2,
  .inline-form,
  .entry-form-card .entry-controls,
  .entry-form-card .shadowsocks-controls {
    grid-template-columns: 1fr;
  }
}
