.ss-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 20, 38, .56);
  backdrop-filter: blur(5px);
}
.ss-dialog {
  width: min(100%, 760px);
  max-height: min(90dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f4;
  border-radius: 22px;
  background: #fff;
  color: var(--text, #1f2329);
  box-shadow: 0 30px 100px rgba(12, 26, 60, .25);
  font: 14px/1.6 var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Arial, sans-serif);
}
.ss-dialog * { box-sizing: border-box; }
.ss-dialog button, .ss-dialog input, .ss-dialog select { font: inherit; }
.ss-header {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 26px 30px 22px;
  border-bottom: 1px solid #eef1f6;
  background: linear-gradient(130deg, #f5f8ff, #fff 72%);
}
.ss-kicker { color: var(--brand, #2f6bff); font-size: 12px; font-weight: 700; letter-spacing: .6px; }
.ss-header h2 { margin: 4px 0 3px; font-size: 27px; line-height: 1.25; letter-spacing: -.6px; }
.ss-header p { margin: 0; color: var(--muted, #6b7280); font-size: 13px; }
.ss-close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8c95a5;
  font-size: 25px !important;
  line-height: 1;
  cursor: pointer;
}
.ss-close:hover { background: #eef3ff; color: #1f2329; }
.ss-body { min-height: 0; overflow-y: auto; padding: 0 30px 18px; overscroll-behavior: contain; }
.ss-section { padding: 23px 0 24px; border-bottom: 1px solid #eef1f6; }
.ss-section:last-of-type { border-bottom: 0; }
.ss-section h3 { margin: 0 0 15px; font-size: 16px; line-height: 1.3; }
.ss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ss-switch-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  padding: 14px 16px;
  border: 1px solid #e9edf5;
  border-radius: 15px;
  background: #fbfcff;
  cursor: pointer;
}
.ss-switch-row:hover { border-color: #dbe5f8; background: #f8faff; }
.ss-switch-row strong, .ss-unavailable strong { display: block; font-size: 14px; font-weight: 600; }
.ss-switch-row small, .ss-unavailable small { display: block; margin-top: 2px; color: var(--muted, #6b7280); font-size: 12px; line-height: 1.45; }
.ss-switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ss-switch-row i {
  width: 42px;
  height: 24px;
  flex: none;
  position: relative;
  border-radius: 999px;
  background: #dce2eb;
  transition: background .18s;
}
.ss-switch-row i::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0002;
  transition: transform .18s;
}
.ss-switch-row input:checked + i { background: var(--brand, #2f6bff); }
.ss-switch-row input:checked + i::after { transform: translateX(18px); }
.ss-switch-row:has(input:focus-visible) { outline: 3px solid rgba(47, 107, 255, .3); outline-offset: 2px; }
.ss-subpanel { margin-top: 12px; padding: 17px; border: 1px solid #e5ebf7; border-radius: 15px; background: #f8faff; }
.ss-subpanel[hidden], .ss-field[hidden] { display: none !important; }
.ss-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
.ss-field input, .ss-field select {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: #1f2329;
  font-weight: 400;
}
.ss-field input:focus, .ss-field select:focus { border-color: var(--brand, #2f6bff); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.ss-field small, .ss-help { margin: 0; color: var(--muted, #6b7280); font-size: 12px; font-weight: 400; line-height: 1.55; }
.ss-extension-help { grid-column: 1 / -1; margin-top: -3px; }
.ss-extension-help a { margin: 0 3px; color: var(--brand, #2f6bff); text-decoration: underline; text-underline-offset: 2px; }
.ss-subpanel .ss-help { margin: 8px 0 10px; }
.ss-node-list { display: grid; grid-template-columns: 1fr; gap: 7px; max-height: 260px; overflow-y: auto; }
.ss-node { display: grid; grid-template-columns: 16px minmax(0,1fr) 72px 72px; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border: 1px solid #e7ecf5; border-radius: 10px; background: #fff; }
.ss-node:hover { border-color: #cbd9f5; }
.ss-node input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand, #2f6bff); }
.ss-node .ss-rotation-number { width: 100%; min-width: 0; height: 31px; padding: 4px 6px; border: 1px solid #dfe4ee; border-radius: 7px; text-align: center; }
.ss-node span { display: block; min-width: 0; }
.ss-node strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.ss-node small { display: block; color: #9aa1ab; font-size: 11px; }
.ss-unavailable { position: relative; min-height: 76px; grid-column: 1 / -1; padding: 14px 16px; border: 1px dashed #dce2eb; border-radius: 15px; background: #fafbfc; color: #7e8797; }
.ss-unavailable span { position: absolute; top: 17px; right: 16px; padding: 2px 8px; border-radius: 999px; background: #edf0f4; color: #8790a0; font-size: 11px; }
.ss-file-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.ss-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid transparent; border-radius: 999px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, transform .15s; }
.ss-button:hover { transform: translateY(-1px); }
.ss-button:disabled { opacity: .5; cursor: wait; transform: none; }
.ss-outline { border-color: #dde5f3; background: #fff; color: #31415d; }
.ss-outline:hover { background: #f5f8ff; }
.ss-primary { background: var(--brand, #2f6bff); color: #fff; }
.ss-primary:hover { background: var(--brand-hover, #1f57e6); }
.ss-status { min-height: 20px; margin: 8px 0 0; color: #13845a; font-size: 12px; }
.ss-status.ss-error { color: #d33b43; }
.ss-footer { flex: none; display: flex; justify-content: flex-end; gap: 9px; padding: 16px 30px; border-top: 1px solid #eef1f6; background: #fff; }
html.netscope-theme-dark .ss-dialog { color: #e7ecf5; background: #111d2f; border-color: #33435c; }
html.netscope-theme-dark .ss-header { background: linear-gradient(130deg, #192b47, #111d2f 72%); border-color: #29364b; }
html.netscope-theme-dark .ss-close { color: #a9b8cb; }
html.netscope-theme-dark .ss-close:hover { color: #fff; background: #20314a; }
html.netscope-theme-dark .ss-section, html.netscope-theme-dark .ss-footer { border-color: #29364b; }
html.netscope-theme-dark .ss-footer { background: #111d2f; }
html.netscope-theme-dark .ss-switch-row, html.netscope-theme-dark .ss-node, html.netscope-theme-dark .ss-unavailable { color: #e7ecf5; background: #17243a; border-color: #33435c; }
html.netscope-theme-dark .ss-switch-row:hover, html.netscope-theme-dark .ss-node:hover { background: #20314a; border-color: #45618d; }
html.netscope-theme-dark .ss-subpanel { background: #15243a; border-color: #33435c; }
html.netscope-theme-dark .ss-field input, html.netscope-theme-dark .ss-field select, html.netscope-theme-dark .ss-node .ss-rotation-number { color: #e7ecf5; background: #0d1727; border-color: #3c4d68; }
html.netscope-theme-dark .ss-unavailable span { color: #a9b8cb; background: #20314a; }
html.netscope-theme-dark .ss-outline { color: #dce6f5; background: #17243a; border-color: #3c4d68; }
html.netscope-theme-dark .ss-outline:hover { background: #20314a; }
html.netscope-theme-dark .ss-status { color: #73d7a5; }
html.netscope-theme-dark .ss-status.ss-error { color: #f5a5aa; }
@media (max-width: 640px) {
  .ss-overlay { align-items: end; padding: 0; }
  .ss-dialog { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .ss-header { padding: 21px 18px 18px; }
  .ss-header h2 { font-size: 23px; }
  .ss-body { padding: 0 18px 12px; }
  .ss-section { padding: 20px 0; }
  .ss-grid, .ss-node-list { grid-template-columns: 1fr; }
  .ss-node-list { max-height: 155px; }
  .ss-node { grid-template-columns: 16px minmax(0,1fr) 55px 55px; gap: 5px; }
  .ss-footer { padding: 14px 18px max(14px, env(safe-area-inset-bottom)); }
  .ss-footer .ss-button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-dialog *, .ss-dialog *::after { transition: none !important; }
}
