/* ── Retro-Win Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #c0c0c0;
  height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 0;
  font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
}

/* In dedicated tool windows, suppress main scanner shell before JS switches layout. */
html.tool-window-boot #mainWin {
  display: none !important;
}

/* ── Window frame ── */
.retro-win {
  width: 100%;
  background: #c0c0c0;
  border: none;
  box-shadow: none;
  user-select: none;
}

#mainWin {
  position: relative;
  width: 100%;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

/* ── Title bar ── */
.titlebar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  padding: 3px 4px 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

#mainWin > .titlebar {
  cursor: move;
  touch-action: none;
}
.titlebar .icon { font-size: 12px; }
.titlebar .title { flex: 1; }
.title-fill { flex: 1; }
.titlebar-btns { display: flex; gap: 2px; }
.title-btn {
  width: 16px; height: 14px;
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom:1px solid #808080;
  font-size: 9px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  cursor: default; color: #000; line-height: 1;
}
.title-btn:active { border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #fff; border-bottom:1px solid #fff; }
.title-icon-img { vertical-align: middle; flex-shrink: 0; }
.title-btn-clickable { cursor: pointer; }
.title-btn-close { cursor: pointer; font-weight: 900; }
.title-btn-reset-danger {
  background: #c63b34;
  color: #fff;
  border-top: 1px solid #f0b3af;
  border-left: 1px solid #f0b3af;
  border-right: 1px solid #7d201b;
  border-bottom: 1px solid #7d201b;
  box-shadow: inset 1px 1px 0 #ef8e88;
}
.title-btn-reset-danger:active {
  background: #9f221d;
  color: #fff;
  border-top: 1px solid #7d201b;
  border-left: 1px solid #7d201b;
  border-right: 1px solid #f0b3af;
  border-bottom: 1px solid #f0b3af;
  box-shadow: none;
}
.cursor-move { cursor: move; }

/* ── Icon selection flash (selectIcon) ── */
.icon-selected            { background: #000080 !important; }
.icon-img-selected        { filter: invert(1) sepia(1) saturate(5) hue-rotate(180deg); }

/* ── Body cursor while dragging window ── */
body.dragging             { cursor: move !important; }

/* ── Tool window fullscreen mode ── */
.tool-fullscreen {
  display: block !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  max-width: 100vw !important; max-height: 100vh !important;
  transform: none !important;
  z-index: 1;
}

/* flex tool windows must restore flex display in fullscreen mode */
.sniffer-win.tool-fullscreen,
.scanwatch-win.tool-fullscreen,
.wifi-detector-win.tool-fullscreen,
.gnss-win.tool-fullscreen,
.lte-win.tool-fullscreen,
.imgmeta-win.tool-fullscreen { display: flex !important; }

/* ── Flag emoji in country list ── */
.flag-emoji { font-size: 16px; line-height: 1; }
.flex-spacer { flex: 1; }
.ml-auto { margin-left: auto !important; }
.ml-10 { margin-left: 10px; }
.is-hidden { display: none; }
.cursor-pointer { cursor: pointer !important; }
.cursor-context-menu { cursor: context-menu !important; }
.status-time { font-size: 10px; color: #000080; font-weight: bold; }

/* ── Content area ── */
.win-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow: hidden; min-height: 0; }

/* ── Toolbar row ── */
.toolbar {
  display: flex; gap: 4px; align-items: center;
  border-bottom: 1px solid #808080;
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.btn95 {
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom:1px solid #808080;
  box-shadow: inset 1px 1px 0 #dfdfdf;
  font-family: inherit; font-size: 11px;
  padding: 3px 10px;
  cursor: pointer; color: #000;
  white-space: nowrap;
}
.btn95:active, .btn95.pressed {
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  box-shadow: none;
  padding: 4px 9px 2px 11px;
}
.btn95:disabled { color: #808080; cursor: default; }
.btn95:disabled .btn-shadow { color: #fff; }
.btn-stop95 { background: #c0c0c0; }
.toolbar .btn95.btn-reset-danger {
  background: #c63b34;
  color: #fff;
  border-top: 1px solid #f0b3af;
  border-left: 1px solid #f0b3af;
  border-right: 1px solid #7d201b;
  border-bottom: 1px solid #7d201b;
  box-shadow: inset 1px 1px 0 #ef8e88;
}
.toolbar .btn95.btn-reset-danger:active,
.toolbar .btn95.btn-reset-danger.pressed {
  background: #9f221d;
  color: #fff;
  border-top: 1px solid #7d201b;
  border-left: 1px solid #7d201b;
  border-right: 1px solid #f0b3af;
  border-bottom: 1px solid #f0b3af;
  box-shadow: none;
}

/* ── Mode selector ── */
.groupbox {
  border: 1px solid #808080;
  border-top: 1px solid #808080;
  box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #808080;
  padding: 10px 8px 8px 8px;
  position: relative;
}
.groupbox-legend {
  position: absolute; top: -6px; left: 8px;
  background: #c0c0c0; padding: 0 3px;
  font-size: 11px;
}

/* ── Mode tabs (styled as radio buttons) ── */
.mode-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.mode-radio { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.mode-radio input[type=radio] { cursor: pointer; }

/* ── IP Range row ── */
.range-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.range-label { white-space: nowrap; }

/* Segmented IP input — sunken box */
.ip-box {
  display: inline-flex; align-items: center;
  background: #fff;
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  box-shadow: inset 1px 1px 0 #404040;
  padding: 1px 3px;
  gap: 1px;
}
.oct {
  width: 28px; border: none; outline: none;
  font-family: inherit; font-size: 11px;
  background: transparent; color: #000;
  text-align: center; padding: 1px 0;
}
.oct-dot { font-size: 13px; color: #000; line-height: 1; }

/* ── Port hint ── */
.port-hint { font-size: 10px; color: #000080; margin-top: 3px; }

/* ── Progress ── */
.progress-wrap { display: flex; flex-direction: column; gap: 3px; }
.progress-bar-bg {
  height: 14px;
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  background: #c0c0c0;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%; width: 0%;
  background: #000080;
  transition: width 180ms;
  display: flex; align-items: center; padding-left: 4px;
}
.progress-pct {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #000; mix-blend-mode: difference;
  filter: invert(1);
}
.stats-row { display: flex; gap: 14px; font-size: 10px; color: #000; }
.stat-item { display: flex; gap: 3px; align-items: center; }
/* Port progress bar (all-ports mode) */
.port-progress-wrap { display: none; flex-direction: column; gap: 1px; margin-top: 2px; }
.port-progress-wrap.active { display: flex; }
.port-progress-label { font-size: 9px; color: #444; }
.port-progress-bg {
  height: 10px;
  border-top: 1px solid #808080; border-left: 1px solid #808080;
  border-right: 1px solid #fff;  border-bottom: 1px solid #fff;
  background: #c0c0c0; overflow: hidden; position: relative;
}
.port-progress-fill { height: 100%; width: 0%; background: #008080; transition: width 80ms; }
.stat-val { font-weight: bold; color: #000080; }

/* ── Results list ── */
.listview-wrap {
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.listview-header {
  display: grid;
  grid-template-columns: var(--lv-cols, 20px 18px 18px 87px 26px 56px);
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  min-width: 250px;
  color: #101010;
}
.lv-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  font-size: 11px; font-weight: bold;
  border-right: 1px solid #808080;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
}
.lv-col:first-child { border-left: none; }
.lv-col:last-child  { border-right: none; }

.listview-body {
  flex: 1;
  overflow-y: scroll;
  overflow-x: auto;
  min-height: 0;
}
/* Classic retro-win scrollbar approximation */
.listview-body::-webkit-scrollbar { width: 16px; }
.listview-body::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  box-shadow: inset 1px 1px 0 #909090;
}
.listview-body::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom:1px solid #404040;
  box-shadow: inset 1px 1px 0 #dfdfdf;
}
.listview-body::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}
.listview-body::-webkit-scrollbar-button {
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom:1px solid #808080;
  height: 16px;
  display: block;
}

.lv-row {
  display: grid;
  grid-template-columns: var(--lv-cols, 20px 18px 18px 87px 26px 56px);
  cursor: default;
  border-bottom: 1px solid #f0f0f0;
  animation: rowIn 200ms ease-out;
  min-width: 250px;
}
@keyframes rowIn { from{opacity:0;background:#000080;color:#fff} to{opacity:1} }
@keyframes cmdBlink { 0%,100%{opacity:1} 50%{opacity:0} }
.lv-row:hover   { background: #000080; color: #fff; }
.lv-row.selected { background: #000080; color: #fff; }
.lv-row.selected .lv-cell { color: #fff; }
.lv-row:hover .lv-cell { color: #fff; }
.lv-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  font-size: 11px; color: #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.lv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
}
.lv-star {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.star-on  { color: #f5a623; }
.star-off { color: #888; }
.lv-light {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 22px;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}
.lv-light span {
  display: inline-block;
  transform: translateY(-1px);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 0 4px rgba(255, 255, 255, 0.18);
}
.light-on  {
  color: #22c55e;
  font-weight: 700;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.95),
    0 0 4px rgba(34, 197, 94, 0.95),
    0 0 10px rgba(34, 197, 94, 0.65),
    0 1px 1px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.75));
}
.light-dead {
  color: #ef4444;
  background: radial-gradient(circle at 35% 28%, #fff0f0 0%, #ff9c9c 20%, #f45b5b 48%, #c02626 78%, #8a1f1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 2px rgba(255, 255, 255, 0.4),
    0 0 4px rgba(239, 68, 68, 0.62),
    0 0 8px rgba(239, 68, 68, 0.34),
    0 1px 1px rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.18)) drop-shadow(0 0 2px rgba(239, 68, 68, 0.38));
}
.light-suspect {
  color: #3b82f6;
  font-weight: 700;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 0 4px rgba(59, 130, 246, 0.9),
    0 0 10px rgba(59, 130, 246, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.7));
}
.light-off {
  color: #ef4444;
  font-weight: 700;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.8),
    0 0 3px rgba(239, 68, 68, 0.45),
    0 1px 1px rgba(0, 0, 0, 0.3);
}
.icon-ok       { color: green; font-weight: bold; cursor: pointer; }
.icon-ok-off   { color: #bbb;  font-weight: bold; cursor: pointer; }
.icon-err { color: #c00; font-weight: bold; }
.empty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-size: 11px;
  color: #808080;
  background: #fff;
  border: none;
}

/* ── Paths popup ── */
.paths-row {
  display: none;
  grid-column: 1 / -1;
  background: #fffff0;
  border-top: 1px solid #c0c0c0;
  flex-direction: column;
  gap: 0;
}
.paths-row.open { display: flex; }
.path-port-line {
  display: grid;
  grid-template-columns: 20px 18px 18px 124px 26px 1fr;
  align-items: center;
  min-height: 18px;
  border-bottom: 1px solid #f0efe0;
}
.path-port-line:last-child { border-bottom: none; }
.path-col-spacer {
  border-right: 1px solid #d8d8c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #ccc;
}
.path-port-label {
  font-size: 10px;
  font-weight: bold;
  color: #000;
  padding: 1px 4px;
  white-space: nowrap;
}
.path-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  padding: 1px 4px;
}

/* ── Row expand button ── */
.row-expand-btn {
  display: inline-block;
  font-weight: bold; font-size: 10px;
  cursor: pointer; user-select: none;
  padding: 0 3px;
  border: 1px solid #808080;
  min-width: 13px; text-align: center;
  vertical-align: middle;
  margin-left: 0;
}
.lv-expand-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 2px;
}
.lv-expand-empty {
  border: none;
  padding: 0;
}
/* ── Enrich detail popup ── */
.enrich-popup {
  position: fixed;
  width: 320px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000;
  z-index: 3000;
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 11px;
}
.enrich-popup-bar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: #fff; font-size: 11px; font-weight: bold;
  padding: 3px 4px 3px 6px;
  display: flex; align-items: center; gap: 4px;
  cursor: move; user-select: none;
}
.enrich-popup-body {
  padding: 8px 10px; min-height: 52px;
  font-size: 11px; line-height: 1.7;
  max-height: 360px; overflow: auto;
}
.path-link {
  font-size: 10px; color: #000080;
  text-decoration: underline; cursor: pointer;
  white-space: nowrap;
}
.path-link:hover { color: #c00; }

/* ── Preview frame ── */
.preview-wrap {
  display: none;
}
.preview-wrap.open { display: block; }
.preview-titlebar {
  background: #000080; color: #fff;
  font-size: 10px; padding: 2px 6px;
  display: flex; align-items: center; gap: 6px;
}
.preview-url-label { flex: 1; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-iframe {
  width: 100%; height: 300px; border: none;
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  background: #fff;
  display: block;
}
.preview-blocked {
  height: 300px;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: #808080;
}
.preview-blocked a { color: #000080; font-size: 11px; }
.preview-wrap.preview-blocked-active .preview-iframe  { display: none; }
.preview-wrap.preview-blocked-active .preview-blocked { display: flex; }

/* ── Status bar ── */
.statusbar {
  border-top: 1px solid #808080;
  padding: 3px 6px;
  font-size: 10px;
  color: #000;
  display: flex;
  gap: 10px;
}
.status-panel {
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  padding: 1px 6px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-panel.ok  { color: green; }
.status-panel.err { color: #c00; }
.status-panel.warn{ color: #808000; }

/* ── IP Scan Watch dialog ── */
.scanwatch-dlg {
  width: 620px;
  max-width: 92vw;
}

.scanwatch-status {
  margin-top: 10px;
  padding: 6px;
  font-size: 11px;
}

.scanwatch-status-warn {
  color: #7f0000;
}

.scanwatch-status-busy {
  color: #000080;
  font-weight: bold;
}

.scanwatch-table-wrap {
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
}

.scanwatch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.scanwatch-table th {
  text-align: left;
  border-bottom: 1px solid #7f7f7f;
  padding: 4px;
}

.scanwatch-table td {
  padding: 4px;
}

.scanwatch-row td {
  border-bottom: 1px dotted #aaa;
}

.scanwatch-num {
  text-align: right !important;
}

.scanwatch-empty-row td {
  padding: 6px;
  color: #555;
}

/* ── WiFi Detector dialog ── */
.wifi-detector-dlg {
  width: 520px;
  max-width: 92vw;
}

.wifi-detector-status {
  margin-top: 10px;
  padding: 6px;
  font-size: 11px;
}

.wifi-detector-status-warn {
  color: #7f0000;
}

.wifi-detector-status-busy {
  color: #000080;
  font-weight: bold;
}

.wifi-detector-content {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
}

.wifi-detector-pane {
  min-width: 0;
}

.wifi-detector-pane-title {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 4px;
}

.wifi-detector-net-list {
  min-height: 220px;
  max-height: 240px;
  overflow: auto;
}

.wifi-detector-net-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}

.wifi-detector-net-item:hover {
  background: #000080;
  color: #fff;
}

.wifi-detector-net-item.active {
  background: #000080;
  color: #fff;
}

.wifi-detector-net-meta {
  display: block;
  opacity: 0.85;
  font-size: 10px;
}

.wifi-detector-empty {
  padding: 8px;
  color: #555;
  font-size: 11px;
}

.wifi-detector-table-wrap {
  min-height: 220px;
  max-height: 240px;
  overflow: auto;
}

.wifi-detector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.wifi-detector-table td {
  padding: 4px;
  border-bottom: 1px dotted #aaa;
}

.wifi-detector-key {
  width: 40%;
  font-weight: bold;
}

.wifi-detector-value {
  width: 60%;
}

/* ── AI Assistant dialog ── */
.ai-assistant-win {
  width: 760px;
  height: 700px;
  max-width: 94vw;
  max-height: 92vh;
  left: 110px;
  top: 34px;
}

.ai-assistant-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  height: calc(100% - 32px);
  box-sizing: border-box;
  overflow: auto;
}

.ai-input-grow {
  flex: 1;
  min-width: 220px;
}

.ai-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-prompt-box {
  width: 100%;
  min-height: 90px;
  max-height: 180px;
  resize: vertical;
  font-size: 11px;
  font-family: Consolas, 'Courier New', monospace;
  padding: 6px;
  box-sizing: border-box;
}

.ai-response-box {
  width: 100%;
  min-height: 110px;
  max-height: 260px;
  resize: vertical;
  font-size: 11px;
  font-family: Consolas, 'Courier New', monospace;
  padding: 6px;
  box-sizing: border-box;
}

.ai-status {
  margin-top: 10px;
  padding: 6px 8px;
  font-size: 11px;
}

.ai-status-busy {
  color: #000080;
  font-weight: bold;
}

.ai-status-warn {
  color: #7f0000;
}

.ai-assistant-footer {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .wifi-detector-content {
    grid-template-columns: 1fr;
  }
}

/* ── Floating tool window shell ── */
.tool-win-shell {
  display: none;
  position: fixed;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000, inset 1px 1px 0 #dfdfdf;
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
}

/* ── Detail panel (expandable under row) ── */
.detail-row {
  display: none;
  grid-column: 1 / -1;
  background: #fffff0;
  border-top: 1px solid #c0c0c0;
  padding: 6px 10px 8px 28px;
  font-size: 10px;
  color: #000;
  gap: 0;
}
.detail-row.open { display: block; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.detail-section {
  border: 1px solid #c0c0c0;
  box-shadow: inset 1px 1px 0 #808080, 1px 1px 0 #fff;
  background: #fff;
  padding: 4px 8px 5px;
  margin-top: 4px;
}
.detail-section-title {
  font-weight: bold; font-size: 10px;
  color: #000080; margin-bottom: 3px;
  border-bottom: 1px solid #c0c0c0;
  padding-bottom: 2px;
}
.detail-line { line-height: 1.7; }
.detail-line b { color: #000080; }
.detail-tag {
  display: inline-block;
  font-size: 9px; font-weight: bold;
  padding: 0 4px;
  border: 1px solid;
  border-radius: 2px;
  margin-left: 4px;
}
.tag-vpn    { color: #c00; border-color: #c00; background: #fff0f0; }
.tag-dc     { color: #808000; border-color: #808000; background: #fffff0; }
.tag-open   { color: green; border-color: green; background: #f0fff0; }
.tag-device { color: #000080; border-color: #000080; background: #f0f0ff; }

/* ── Inline badge pills (enrich popups) ── */
.badge {
  display: inline-block;
  padding: 0 3px;
  font-size: 9px;
  margin-left: 3px;
  color: #fff;
}
.badge-vpn         { background: #800080; }
.badge-dc          { background: #808080; }
.badge-recognized  { background: green; }

/* ── Geo info line ── */
.geo-info-line { line-height: 1.9; }

/* ── Context menu ── */
.ctxmenu {
  position: fixed; display: none;
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom:1px solid #808080;
  box-shadow: 2px 2px 0 #000;
  z-index: 9999;
  min-width: 150px;
}
.ctxmenu.open { display: block; }
.ctx-item {
  padding: 4px 20px 4px 24px;
  font-size: 11px; cursor: default;
}
.ctx-item:hover { background: #000080; color: #fff; }
.ctx-item.ctx-disabled { color: #808080; pointer-events: none; }
.ctx-item.ctx-disabled:hover { background: transparent; color: #808080; }
.ctx-sep { height: 1px; background: #808080; margin: 2px 0; box-shadow: 0 1px 0 #fff; }

.country-item {
  padding: 2px 8px; font-size: 11px; cursor: default;
  border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 5px;
}
.country-item:hover  { background: #000080; color: #fff; }
.country-item.active { background: #000080; color: #fff; }
.range-item {
  padding: 2px 4px; cursor: default; border-bottom: 1px dotted #e0e0e0;
  display: flex; align-items: center; justify-content: space-between;
}
.range-item:hover  { background: #000080; color: #fff; }
.range-item.active { background: #000080; color: #fff; }

/* ── Menu bar ── */
.menubar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 1px 2px;
  display: flex;
  position: relative;
  z-index: 200;
}
.menu-item {
  padding: 2px 8px;
  font-size: 11px;
  cursor: default;
  position: relative;
  user-select: none;
}
.menu-item:hover, .menu-item.open { background: #000080; color: #fff; }
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: 2px 2px 0 #000;
  z-index: 300;
  min-width: 150px;
}
.menu-item.open .menu-dropdown { display: block; }
.menu-dd-item {
  padding: 4px 24px 4px 28px;
  font-size: 11px;
  white-space: nowrap;
  cursor: default;
}
.menu-dd-item:hover { background: #000080; color: #fff; }
.menu-dd-sep { height: 1px; background: #808080; margin: 2px 4px; box-shadow: 0 1px 0 #fff; }

/* Use the native Tauri window menu on desktop. */
body.tauri-native-menu .menubar { display: none; }
body.tauri-native-menu #mainWin > .titlebar { display: none; }
body.tauri-native-menu #btnGlobe,
body.tauri-native-menu #btnCmdConsole,
body.tauri-native-menu #btnMacroToolbar,
body.tauri-native-menu #btnSpeedToolbar,
body.tauri-native-menu #btnProtoToolbar,
body.tauri-native-menu #btnTopologyToolbar {
  display: inline-flex !important;
}

/* Tool windows render only their panel and use native titlebar/chrome. */
body.tool-window-mode {
  padding: 0;
  overflow: hidden;
}
body.tool-window-mode #mainWin {
  display: none !important;
}

/* ── Settings dialog ── */
.dlg-overlay {
  display: none;
  position: fixed; top:0;left:0;right:0;bottom:0;
  z-index: 400;
}
.dlg-overlay.open { display: block; }
.dlg95 {
  position: fixed; top:50%;left:50%;
  transform: translate(-50%,-50%);
  background: #c0c0c0;
  border-top: 2px solid #fff; border-left: 2px solid #fff;
  border-right: 2px solid #808080; border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000;
  min-width: 260px;
  font-size: 11px;
  z-index: 500;
}
.dlg-title {
  background: linear-gradient(to right,#000080,#1084d0);
  color:#fff; font-size:11px; font-weight:bold;
  padding:3px 4px 3px 6px;
  display:flex; align-items:center; gap:4px;
}
.dlg-title span { flex:1; }
.dlg-title span:first-child { flex: 0 0 auto; }
.dlg-body { padding: 14px 16px 8px; }
.dlg-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.dlg-footer { display:flex; justify-content:flex-end; gap:6px; padding:6px 8px; border-top:1px solid #808080; }
.dlg-footer button { min-width:64px; }

.dlg-icon-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dlg-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.dlg-icon-versions {
  line-height: 1.2;
}

.dlg-content-fill {
  flex: 1;
  min-width: 0;
}

.dlg-sunken-box {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #fff;
}

.dlg-input95 {
  font-family: inherit;
  font-size: 11px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 1px 4px;
  background: #fff;
}

.dlg-input95-courier {
  font-family: 'Courier New', monospace;
}

.dlg-label-40 {
  width: 40px;
  flex-shrink: 0;
}

.dlg-label-98 {
  width: 98px;
  flex-shrink: 0;
}

.dlg-btn-xs {
  font-size: 10px;
  padding: 2px 10px;
}

.dlg-btn-xxs {
  font-size: 10px;
  padding: 2px 8px;
}

.dlg-note-muted {
  font-size: 10px;
  color: #808080;
  margin-top: 4px;
}

.dlg-presets-list-wrap {
  margin-bottom: 8px;
}

.dlg-presets-list {
  height: 140px;
  overflow-y: auto;
}

.dlg-inline-row {
  display: flex;
  gap: 4px;
}

.dlg-inline-row-top {
  margin-top: 5px;
}

.dlg-num-input {
  width: 58px;
  padding: 1px 3px;
}

.dlg-versions-body {
  max-height: 58vh;
  overflow: auto;
  padding: 10px 12px 8px;
}

.dlg-versions-card {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
}

.dlg-body-compact {
  padding: 10px 12px 6px;
}

.dlg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dlg-col-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.country-search-input {
  padding: 2px 6px;
}

.country-list-box {
  height: 280px;
  overflow-y: auto;
}

.country-name {
  font-size: 11px;
  font-weight: bold;
  color: #000080;
}

.country-meta,
.country-hint {
  font-size: 10px;
  color: #808080;
}

.country-ranges {
  flex: 1;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 6px;
}

.dlg-actions-row {
  display: flex;
  gap: 4px;
}

.dlg-btn-use-range {
  font-size: 10px;
  padding: 2px 14px;
}

/* ── Settings Panel ── */
.settings-row     { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.settings-row-sm  { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.settings-row-sm-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.label-nowrap     { white-space: nowrap; }
.label-muted-sm   { font-size: 10px; color: #808080; }
.label-ml         { margin-left: 8px; }
.select95 {
  font-family: inherit; font-size: 11px;
  border-top: 1px solid #808080; border-left: 1px solid #808080;
  border-right: 1px solid #fff; border-bottom: 1px solid #fff;
  background: #fff; padding: 1px 4px;
}
.active-ports-display {
  font-family: 'Courier New', monospace; font-size: 10px; color: #000080;
  border-top: 1px solid #808080; border-left: 1px solid #808080;
  border-right: 1px solid #fff; border-bottom: 1px solid #fff;
  background: #fff; padding: 1px 6px; flex: 1; min-width: 80px;
}
.ip-result-label { font-family: inherit; font-size: 11px; color: #000080; font-weight: bold; }
.btn-action-sm   { padding: 2px 8px; font-size: 10px; }
.btn-wide-132    { width: 132px; }
.input-num-sm {
  width: 38px; font-family: inherit; font-size: 11px;
  border-top: 1px solid #808080; border-left: 1px solid #808080;
  border-right: 1px solid #fff; border-bottom: 1px solid #fff;
  padding: 1px 3px; background: #fff;
}

/* ── Main UI misc ── */
.preview-btn-sm    { padding: 1px 8px; font-size: 10px; }
.status-count-panel { flex: 0 0 auto; min-width: 80px; }

/* ── Globe toolbar extras ── */
.map-live-label     { font-size: 10px; color: #000080; }
.globe-rotate-label { display: flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 10px; margin-left: 6px; }
.globe-rotate-label.hidden { display: none; }

/* ── Customize dialog ── */
.dlg-customize-body { display: flex; align-items: flex-start; gap: 12px; }
.dlg-icon-xl        { font-size: 28px; line-height: 1; flex-shrink: 0; }
.dlg-check-col      { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.dlg-check-label    { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ── List view header columns ── */
.lv-col-dot    { font-size: 9px; }
.lv-col-center { text-align: center; }

/* ── List filter bar ── */
.listview-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-bottom: 1px solid #808080;
  background: #c0c0c0;
}

/* IP blur mode */
.ip-blur-active .lv-ip-cell {
  filter: blur(5px);
  transition: filter 0.15s;
  user-select: none;
}
.ip-blur-active .lv-ip-cell:hover {
  filter: none;
}
.ip-blur-active .path-port-label {
  filter: blur(5px);
  transition: filter 0.15s;
  user-select: none;
}
.ip-blur-active .path-port-label:hover {
  filter: none;
}
.ip-range-blurred #boxFrom,
.ip-range-blurred #boxTo {
  filter: blur(5px);
  transition: filter 0.15s;
}
.ip-range-blurred #boxFrom:focus-within,
.ip-range-blurred #boxTo:focus-within {
  filter: none;
}
.ip-detect-blurred #myIpResult,
.ip-detect-blurred #myLocalIpResult,
.ip-detect-blurred #localSubnetsResult {
  filter: blur(5px);
  transition: filter 0.15s;
  user-select: none;
}
.ip-detect-blurred #myIpResult:hover,
.ip-detect-blurred #myLocalIpResult:hover,
.ip-detect-blurred #localSubnetsResult:hover {
  filter: none;
}

/* Columns button */
.btn-cols {
  font-size: 10px;
  padding: 1px 8px;
  cursor: pointer;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  font-family: inherit;
  margin-left: 6px;
}
.btn-cols.active,
.btn-cols:active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

/* Columns panel */
.cols-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 4px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000;
  z-index: 3000;
  min-width: 0;
  width: max-content;
  padding: 2px 0;
}
.cols-panel.open { display: block; }
.cols-panel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.cols-panel-item:hover { background: #000080; color: #fff; }
.cols-panel-item input { cursor: pointer; margin: 0; }

/* Extra enrichment cells in rows */
.lv-extra-cell {
  display: none;
  padding: 2px 4px;
  font-size: 10px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
}
.listview-filter .filter-label {
  font-size: 10px;
  color: #000;
  margin-right: 2px;
  white-space: nowrap;
}
.btn-filter {
  font-size: 10px;
  padding: 1px 8px;
  cursor: pointer;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  font-family: inherit;
}
.btn-filter.active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #c0c0c0;
}

/* ── Preview ── */
.preview-blocked-icon { font-size: 24px; }

/* ── Presets dialog save btn ── */
.btn-save-sm { margin-top: 6px; font-size: 10px; padding: 2px 12px; }

.dlg-btn-use-all {
  font-size: 10px;
  padding: 2px 10px;
}

/* ── Dialog size variants ── */
#dlgExternalIpOverlay .dlg95  { min-width: 340px; max-width: 440px; }
#dlgLargeRangeOverlay .dlg95  { min-width: 320px; max-width: 420px; }
#dlgCountriesOverlay .dlg95   { min-width: 500px; max-width: 96vw; }
#dlgPresetsOverlay .dlg95     { min-width: 380px; }
#dlgDefaultsOverlay .dlg95    { min-width: 290px; }
#dlgVersionsOverlay .dlg95    { min-width: 470px; max-width: 94vw; }
#dlgCustomizeOverlay .dlg95   { min-width: 300px; }

/* ── dlg-icon-body compact padding (Presets dialog) ── */
.dlg-icon-body-compact { padding: 10px 12px 4px; }

/* ── dlg-row spacing variants ── */
.dlg-row-mb6 { margin-bottom: 6px; }
.dlg-row-mb0 { margin-bottom: 0; }

/* ── defaults dialog helper classes ── */
.dlg-row-indent-24 { margin-left: 24px; margin-top: 6px; }
.dlg-groupbox-mt12 { margin-top: 12px; }
.port-mode-label { display: flex; align-items: center; margin-bottom: 6px; }
.port-mode-radio { margin-right: 6px; }
.port-mode-text { font-size: 11px; }

/* ── presetEditBox disabled state ── */
#presetEditBox.disabled { opacity: 0.4; pointer-events: none; }

/* ── preset list row ── */
.preset-row {
  padding: 3px 8px;
  font-size: 11px;
  cursor: default;
  background: #fff;
  color: #000;
}
.preset-row.selected { background: #000080; color: #fff; }

/* ── macro folder list row ── */
.macro-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  cursor: default;
  border-bottom: 1px solid #f0f0f0;
}
.macro-list-row:hover { background: #000080; color: #fff; }
.macro-list-empty { padding: 8px; color: #666; }

/* ── cmd file menu item hover ── */
.cmd-file-action:hover { background: #000080; color: #fff; }

/* ── initially-hidden elements (shown by JS when needed) ── */
.initially-hidden { display: none; }

/* ── preset select min-width ── */
#presetSelect { min-width: 120px; }

/* ── local subnet select min-width ── */
#localSubnetSelect { min-width: 180px; }

.dlg-alert-body {
  padding: 14px 16px 10px;
}

.dlg-headline {
  font-weight: bold;
  margin-bottom: 6px;
}

.dlg-text-11 {
  font-size: 11px;
}

.dlg-lh-15 {
  line-height: 1.5;
}

.dlg-lh-16 {
  line-height: 1.6;
}

.dlg-icon-32 {
  font-size: 32px;
}

.dlg-content-pad {
  padding: 16px 18px 8px;
}

.dlg-muted-block {
  padding: 0 18px 8px;
  font-size: 10px;
  color: #808080;
}

.dlg-footer-bar {
  border-top: 1px solid #808080;
  padding: 6px 8px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-min-60 {
  min-width: 60px;
}

.trace-title {
  flex: 1;
}

.trace-body {
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trace-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trace-target-input {
  width: 160px;
  padding: 2px 4px;
}

.trace-hint {
  font-size: 10px;
  color: #808080;
}

.trace-status {
  font-size: 10px;
  color: #000080;
  min-height: 14px;
}

.version-head {
  font-weight: bold;
  color: #000080;
  margin-bottom: 6px;
}

.version-note {
  margin-bottom: 8px;
}

/* Versions dialog: keep panel width stable and wrap text inside content box. */
#dlgVersionsOverlay .dlg95 {
  width: min(720px, 94vw);
  max-width: 94vw;
}

#dlgVersionsOverlay .dlg-body > div {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.dlg-groupbox {
  border:1px solid #808080;
  box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #808080;
  padding: 10px 12px 8px;
  position:relative; margin-bottom:10px;
}
.dlg-groupbox-legend {
  position:absolute; top:-6px; left:8px;
  background:#c0c0c0; padding:0 3px; font-size:11px;
}
.dlg-radio-row { display:flex; flex-direction:column; gap:5px; }
.dlg-radio { display:flex; align-items:center; gap:6px; cursor:pointer; }

/* ── Ping coloring ── */
.ping-fast { color: green;   font-weight: bold; }
.ping-ok   { color: #808000; font-weight: bold; }
.ping-slow { color: #c00;    font-weight: bold; }
.ping-none { color: #808080; }

/* ── lv-row acc span ── */
.lv-acc-span { font-size: 9px; }

/* ── detail panel muted text ── */
.detail-muted { color: #808080; }

/* ── access open/ok text ── */
.text-ok { color: green; }

/* ── expand btn open state ── */
.row-expand-btn.open { color: #c00; }

/* ── enrich popup bar label / close ── */
.enrich-bar-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.enrich-bar-close {
  cursor: pointer;
  font-size: 10px;
  padding: 0 5px;
  margin-left: 4px;
}
.enrich-body-loading { color: #808080; font-style: italic; }
.enrich-body-empty   { color: #808080; }
.enrich-body-error   { color: #c00; }

/* ── Settings Row with History ── */
.settings-row-sm-with-history {
  display: flex; gap: 0; align-items: flex-start; margin-bottom: 6px;
}

.settings-row-sm-col {
  flex: 1; display: flex; flex-direction: column; margin-right: 12px;
}

.settings-row-sm-extractor {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: 5px;
}

.ip-extractor-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ip-extractor-head-spacer {
  flex: 0 0 66px;
}

.ip-extractor-label {
  width: 190px;
}

.ip-extractor-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.btn-ip-extractor {
  flex: 0 0 auto;
  min-width: 66px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-extractor-input {
  width: 190px;
  height: 64px;
  resize: none;
  box-sizing: border-box;
  padding: 4px;
  font-size: 10px;
  line-height: 1.3;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  color: #000;
  overflow-y: auto;
}

.settings-row-sm-history {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; width: 190px;
}

.scan-history-label {
  font-size: 10px; font-weight: bold; color: #000080; white-space: nowrap;
}

.scan-history-list {
  border-top:   1px solid #808080;
  border-left:  1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom:1px solid #fff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  height: 64px;
  font-size: 10px;
  min-width: 0;
}

.scan-history-list::-webkit-scrollbar {
  width: 12px;
}

.scan-history-list::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  box-shadow: inset 1px 1px 0 #909090;
}

.scan-history-list::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top:   1px solid #fff;
  border-left:  1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom:1px solid #404040;
  box-shadow: inset 1px 1px 0 #dfdfdf;
}

.scan-history-list::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

.scan-history-empty {
  padding: 6px 4px;
  color: #808080;
  font-style: italic;
  text-align: center;
  font-size: 9px;
}

.scan-history-item {
  padding: 3px 4px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-history-item:hover {
  background: #f0f8ff;
}

.scan-history-item-range {
  flex: 1;
  min-width: 23ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #000;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.scan-history-range-text {
  display: inline-flex;
  align-items: center;
}

.scan-history-ip {
  display: inline-flex;
  align-items: center;
}

.scan-history-octet {
  display: inline-block;
  width: 3ch;
  text-align: center;
}

.scan-history-sep,
.scan-history-range-dash {
  display: inline-block;
}

.scan-history-item:hover .scan-history-item-range {
  color: #000080;
  font-weight: bold;
}

.scan-history-item-delete {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #808080;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 1px;
}

.scan-history-item-delete:hover {
  background: #ff6b6b;
  color: #fff;
  border-color: #c92a2a;
}

.scan-history-item.selected {
  background: #000080;
  color: #fff;
}

.scan-history-item.selected .scan-history-item-range {
  color: #fff;
}

/* ── country list ranges count ── */
.country-ranges-count {
  margin-left: auto;
  font-size: 9px;
  color: #808080;
}
.country-item.active .country-ranges-count { color: #ccc; }

/* ── range item size ── */
.range-size { font-size: 9px; color: inherit; opacity: 0.7; }

/* ── Globe tooltip ── */
#globeTooltip {
  position: absolute; display: none;
  background: #000080; color: #fff;
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 10px; padding: 3px 8px;
  border-top: 1px solid #fff; border-left: 1px solid #fff;
  border-right: 1px solid #808080; border-bottom: 1px solid #808080;
  pointer-events: none; z-index: 800; white-space: nowrap;
  box-shadow: 1px 1px 0 #000;
}
#globeTooltip.visible { display: block; }

/* ── Status feedback states (IP detect, trace) ── */
.status-loading { color: #808000; }
.status-ok      { color: #000080; }
.status-error   { color: #c00; }
.status-success { color: green; }

/* Bluetooth Detector */
.bt-detector-win {
  width: 780px;
  height: 580px;
  left: 130px;
  top: 40px;
}

.bt-detector-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  height: calc(100% - 32px);
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, "MS Sans Serif", "Microsoft Sans Serif", sans-serif;
}

.bt-detector-settings {
  margin-bottom: 0;
}

.bt-detector-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bt-detector-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.bt-detector-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bt-detector-pane-title {
  font-size: 11px;
  margin-bottom: 4px;
}

.bt-detector-list,
.bt-detector-detail {
  flex: 1;
  overflow: auto;
  padding: 6px;
}

.bt-device-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  padding: 4px 6px;
  border-bottom: 1px solid #d0d0d0;
  cursor: pointer;
}

.bt-device-row:hover {
  background: #d4d0c8;
}

.bt-device-row-active,
.bt-device-row-active:hover {
  background: #000080;
  color: #fff;
}

.bt-device-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-device-rssi {
  font-size: 10px;
  opacity: 0.8;
}

.bt-empty {
  color: #666;
  font-size: 11px;
  font-style: italic;
}

.bt-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: bold;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 2px;
}

.bt-badge-ble {
  background: #003f8a;
  color: #fff;
}

.bt-badge-classic {
  background: #005f20;
  color: #fff;
}

.bt-rssi {
  font-weight: bold;
}

.bt-rssi-good {
  color: #006400;
}

.bt-rssi-fair {
  color: #8b8000;
}

.bt-rssi-weak {
  color: #7f0000;
}

.bt-rssi-unknown {
  color: #888;
}

.bt-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.bt-detail-key {
  width: 120px;
  color: #555;
  padding: 3px 4px;
  vertical-align: top;
}

.bt-detail-val {
  padding: 3px 4px;
}

.bt-services-head {
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #444;
}

.bt-services-list {
  margin: 0;
  padding-left: 16px;
  font-size: 10px;
  text-transform: none;
}

.bt-detector-status {
  font-size: 11px;
  padding: 5px 7px;
}

.bt-status-warn {
  color: #8b0000;
}

.bt-status-busy {
  color: #000080;
}

/* ── Network Sniffer ─────────────────────────────────── */
.sniffer-win {
  width: 860px;
  height: 480px;
  min-width: 600px;
  min-height: 320px;
}

  .sniffer-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 8px;
    gap: 6px;
    font-family: "Segoe UI", Tahoma, "MS Sans Serif", sans-serif;
    font-size: 11px;
  }

  .sniffer-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .sniffer-search {
    flex: 1;
    min-width: 100px;
  }

  .sniffer-live-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
  }

  .sniffer-table-wrap {
    flex: 1;
    overflow: auto;
    padding: 0;
    min-height: 0;
  }

  .sniffer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    font-family: "Segoe UI", Tahoma, "MS Sans Serif", sans-serif;
  }

  .sniffer-table thead th {
    background: #c0c0c0;
    border: 1px solid #808080;
    padding: 3px 6px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    user-select: none;
  }

  .sniffer-table thead th:hover {
    background: #d4d0c8;
  }

  .sniffer-table thead th.sn-sort-asc::after  { content: ' ▲'; font-size: 9px; }
  .sniffer-table thead th.sn-sort-desc::after { content: ' ▼'; font-size: 9px; }

  .sniffer-table tbody tr {
    cursor: default;
  }

  .sniffer-table tbody tr:hover {
    background: #d4e8ff;
  }

  .sniffer-table tbody tr.sn-row-selected {
    background: #0a246a;
    color: #fff;
  }

  .sniffer-table tbody tr.sn-row-selected .sn-state-chip {
    border-color: #fff !important;
    color: #fff !important;
    background: transparent !important;
  }

  .sniffer-table td {
    border-bottom: 1px solid #e0e0e0;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  .sn-pid   { width: 46px;  color: #555; }
  .sn-proc  { max-width: 130px; font-weight: bold; }
  .sn-proto { width: 44px; text-align: center; font-weight: bold; }
  .sn-addr  { font-family: Consolas, "Courier New", monospace; font-size: 11px; max-width: 180px; }

  .sn-proto-tcp { color: #003580; }
  .sn-proto-udp { color: #004d00; }

  .sn-state-chip {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    padding: 1px 5px;
    border: 1px solid;
    border-radius: 2px;
    line-height: 1.4;
    white-space: nowrap;
  }

  .sn-empty {
    text-align: center;
    color: #888;
    padding: 16px;
    font-style: italic;
  }

  .sniffer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .sniffer-stats {
    font-size: 10px;
    color: #444;
    flex: 1;
  }

  .sniffer-status {
    font-size: 11px;
    color: #000080;
  }

/* ── IP Scan Watch (tool-win-shell) ─────────────────── */
.scanwatch-win {
  width: 680px;
  height: 460px;
  min-width: 480px;
  min-height: 300px;
}

.scanwatch-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 8px;
  gap: 6px;
  font-size: 11px;
}

.scanwatch-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}

/* ── WiFi Detector (tool-win-shell) ─────────────────── */
.wifi-detector-win {
  width: 780px;
  height: 520px;
  min-width: 500px;
  min-height: 320px;
}

.wifi-detector-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 8px;
  gap: 6px;
  font-size: 11px;
}

.wifi-detector-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}

/* ── GNSS Monitor ───────────────────────────────────── */
.gnss-win {
  width: 940px;
  height: 640px;
  min-width: 700px;
  min-height: 460px;
}

.gnss-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  flex: 1;
  min-height: 0;
  font-size: 11px;
}

.gnss-controls,
.gnss-audit-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gnss-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(320px, 1.3fr);
  gap: 8px;
  min-height: 0;
}

.gnss-card {
  padding: 6px;
  min-height: 0;
  overflow: hidden;
}

.gnss-card-title {
  font-weight: bold;
  color: #000080;
  margin-bottom: 6px;
}

.gnss-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.gnss-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dotted #b4b4b4;
  padding-bottom: 2px;
}

#gnssSkyplot {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 6px;
  border: 1px solid #9a9a9a;
  background: #f2f2f2;
}

.gnss-sat-list-wrap {
  max-height: 180px;
  overflow: auto;
}

.gnss-sat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.gnss-sat-table th,
.gnss-sat-table td {
  border: 1px solid #c4c4c4;
  padding: 2px 4px;
  white-space: nowrap;
}

.gnss-sat-table th {
  background: #d6d6d6;
}

.gnss-audit-box {
  padding: 6px;
}

.gnss-audit-list {
  min-height: 64px;
  max-height: 140px;
  overflow: auto;
  margin-top: 6px;
  padding: 6px;
}

.gnss-audit-row {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  padding: 2px 0;
  border-bottom: 1px dashed #d0d0d0;
}

.gnss-status {
  padding: 4px 6px;
  color: #000080;
}

/* ── LTE Monitor ───────────────────────────────────── */
.lte-win {
  width: 960px;
  height: 670px;
  min-width: 720px;
  min-height: 480px;
}

.lte-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  flex: 1;
  min-height: 0;
  font-size: 11px;
}

.lte-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lte-inline-label {
  color: #333;
}

.lte-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 8px;
  min-height: 0;
}

.lte-card {
  padding: 6px;
  min-height: 0;
  overflow: hidden;
}

.lte-card-title {
  font-weight: bold;
  color: #000080;
  margin-bottom: 6px;
}

.lte-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.lte-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dotted #b4b4b4;
  padding-bottom: 2px;
}

.lte-handover-list,
.lte-audit-list,
.lte-corr-list,
.lte-watchdog-list {
  min-height: 72px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid #b8b8b8;
  padding: 4px;
  background: #fff;
}

.lte-row {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  padding: 2px 0;
  border-bottom: 1px dashed #d0d0d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lte-empty {
  color: #666;
  font-style: italic;
  padding: 6px 4px;
}

.lte-corr-summary {
  margin-top: 6px;
  font-size: 10px;
  font-weight: bold;
  color: #0a246a;
}

.lte-ok {
  color: #0a5d0a;
}

.lte-fail {
  color: #9a0000;
}

.lte-status {
  padding: 4px 6px;
  color: #000080;
}

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

/* ═══════════════════════════════════════════════════════════════
   IMAGE METADATA ANALYZER
═══════════════════════════════════════════════════════════════ */
.imgmeta-win {
  width: 740px;
  height: 580px;
  min-width: 480px;
  min-height: 340px;
}

.imgmeta-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  gap: 6px;
}

.imgmeta-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.imgmeta-info-pop {
  display: none;
  border: 1px solid #666;
  background: #fffff0;
  box-shadow: 2px 2px 0 #808080;
  max-height: 220px;
  overflow: hidden;
}

.imgmeta-info-pop.is-open {
  display: flex;
  flex-direction: column;
}

.imgmeta-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #000080;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
}

.imgmeta-info-close {
  min-width: 22px;
  padding: 0 4px;
  line-height: 1.2;
}

.imgmeta-info-body {
  padding: 6px 8px;
  overflow: auto;
  font-size: 11px;
}

.imgmeta-info-section {
  margin: 0 0 6px;
}

.imgmeta-info-section strong {
  color: #000080;
}

.imgmeta-info-list {
  margin: 2px 0 0 16px;
  padding: 0;
}

.imgmeta-info-list li {
  margin: 0;
}

.imgmeta-drop-zone {
  border: 2px dashed #888;
  background: #f0f0f0;
  text-align: center;
  padding: 14px 8px;
  cursor: pointer;
  font-size: 12px;
  color: #444;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  position: relative;
}

.imgmeta-drop-zone.drag-over {
  background: #dce8ff;
  border-color: #0000cc;
  color: #0000cc;
}

.imgmeta-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.imgmeta-filename {
  font-weight: bold;
  color: #000080;
  font-size: 11px;
  margin-left: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imgmeta-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: auto;
  border: 1px solid #999;
  background: #fff;
}

.imgmeta-status {
  flex-shrink: 0;
}

.imgmeta-table-wrap::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.imgmeta-table-wrap::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.imgmeta-table-wrap::-webkit-scrollbar-thumb {
  background: #dfdfdf;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
}

.imgmeta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.imgmeta-table thead {
  display: none;
}

.imgmeta-group-head th {
  padding: 0;
  border-bottom: 1px solid #999;
  background: #d8d8d8;
  position: sticky;
  top: 0;
  z-index: 2;
}

.imgmeta-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: #d8d8d8;
  color: #000;
  font: inherit;
  font-weight: bold;
  padding: 4px 6px;
  text-align: left;
  cursor: pointer;
}

.imgmeta-group-toggle:hover {
  background: #c8d9ff;
}

.imgmeta-group-toggle-icon {
  width: 14px;
  text-align: center;
  font-size: 12px;
}

.imgmeta-group-toggle-label {
  flex: 1;
}

.imgmeta-group-count {
  color: #555;
  font-weight: normal;
}

.imgmeta-table-headrow th {
  background: #000080;
  color: #fff;
  padding: 3px 6px;
  text-align: left;
  position: sticky;
  top: 24px;
  z-index: 1;
  font-weight: bold;
  user-select: none;
}

.imgmeta-group.is-collapsed .imgmeta-table-headrow,
.imgmeta-group.is-collapsed .imgmeta-row-editable,
.imgmeta-group.is-collapsed .imgmeta-row-readonly {
  display: none;
}

.imgmeta-table th {
  background: #000080;
  color: #fff;
  padding: 3px 6px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: bold;
  user-select: none;
}

.imgmeta-table td {
  padding: 2px 6px;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
  word-break: break-all;
}

.imgmeta-table tr:nth-child(even) td { background: #f5f5f5; }
.imgmeta-table tr:hover td { background: #dce8ff; }

.imgmeta-col-section { width: 90px; color: #555; font-style: italic; }
.imgmeta-col-key     { width: 160px; font-weight: bold; color: #000080; }
.imgmeta-col-value   { }

.imgmeta-row-editable .imgmeta-col-value {
  padding-top: 1px;
  padding-bottom: 1px;
}

.imgmeta-value-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px inset #fff;
  background: #fff;
  color: #000;
  font: inherit;
  padding: 1px 4px;
  min-height: 18px;
}

.imgmeta-value-input:focus {
  outline: none;
  background: #ffffe0;
}

.imgmeta-section-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  background: #555;
}
.imgmeta-section-badge.s-File     { background: #6b6b6b; }
.imgmeta-section-badge.s-Image    { background: #2a6496; }
.imgmeta-section-badge.s-JFIF     { background: #5a7a3a; }
.imgmeta-section-badge.s-EXIF     { background: #8b4513; }
.imgmeta-section-badge.s-ExifIFD  { background: #7b3f8a; }
.imgmeta-section-badge.s-GPS      { background: #1a7a4a; }
.imgmeta-section-badge.s-PNG      { background: #1a5276; }
.imgmeta-section-badge.s-GIF      { background: #6e4c99; }
.imgmeta-section-badge.s-BMP      { background: #7a5c00; }
.imgmeta-section-badge.s-WebP     { background: #c0392b; }
.imgmeta-section-badge.s-PSD      { background: #2980b9; }
.imgmeta-section-badge.s-IPTC     { background: #c0392b; }
.imgmeta-section-badge.s-XMP      { background: #1abc9c; }
.imgmeta-section-badge.s-Text     { background: #e67e22; }
.imgmeta-section-badge.s-Color    { background: #27ae60; }
.imgmeta-section-badge.s-Adobe    { background: #e74c3c; }
.imgmeta-section-badge.s-Comment  { background: #7f8c8d; }

.imgmeta-status {
  padding: 4px 6px;
  color: #000080;
  font-size: 11px;
  flex-shrink: 0;
}


