/* ============================================================
   FreedomFlighter — design system
   Dark "mission control" instrument panel. Cyan/violet accent,
   emerald = alive, rose = dead. System fonts only (CSP-safe).
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #080b11;
  --bg-grad:   radial-gradient(1200px 600px at 80% -10%, #11203033 0%, transparent 60%),
               radial-gradient(900px 500px at -10% 0%, #1a103022 0%, transparent 55%);
  --surface:   #0e141d;
  --surface-2: #131b27;
  --surface-3: #18222f;
  --line:      #1f2a38;
  --line-soft: #18212d;

  /* text */
  --text:  #e7eef6;
  --muted: #93a1b3;
  --faint: #5d6a7a;

  /* accents */
  --accent:      #38bdf8;
  --accent-2:    #a78bfa;
  --accent-soft: #38bdf81a;
  --ok:   #34d399;
  --ok-soft: #34d3991a;
  --fail: #fb7185;
  --fail-soft: #fb71851a;
  --warn: #fbbf24;
  --warn-soft: #fbbf241a;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 40px -16px #000c, 0 2px 8px -2px #0008;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--accent-2); color: #0b0e14; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2a3744 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #28333f; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #34424f; background-clip: content-box; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0d131c 0%, #0a0f17 100%);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 26px; line-height: 1;
  filter: drop-shadow(0 0 10px #38bdf855);
  transform: rotate(-8deg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.brand-text h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tag { margin: 1px 0 0; font-size: 11.5px; color: var(--faint); letter-spacing: .3px; }

.about-btn {
  align-self: center; background: transparent; border: 1px solid var(--line);
  color: var(--muted); padding: 4px 12px; border-radius: 999px; font-size: 12px;
  cursor: pointer; font-family: var(--sans); transition: .15s var(--ease);
}
.about-btn:hover { color: var(--accent); border-color: #2b4256; background: var(--surface); }
.about-text { font-size: 14px; line-height: 1.75; color: var(--text); margin: 10px 0 2px; }
.about-foot { margin-top: 14px; font-size: 12px; color: var(--faint); font-family: var(--mono); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.chip-stat {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface);
  font-family: var(--mono);
}
.chip-stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 0 #34d39955; }
.chip-stat.live .dot { background: var(--ok); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 #34d39955} 70%{box-shadow:0 0 0 6px #34d39900} 100%{box-shadow:0 0 0 0 #34d39900} }

.shield-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: .18s var(--ease);
}
.shield-btn:hover { color: var(--accent); border-color: #2b4256; background: var(--surface-2); }
.shield-ico { width: 20px; height: 20px; fill: currentColor; }
.shield-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  background: var(--fail); color: #1a0c10; border-radius: 999px;
}

/* ---------- layout ---------- */
.layout {
  flex: 1; display: grid; grid-template-columns: 344px 1fr;
  gap: 18px; padding: 18px 22px; min-height: 0;
}
.rail { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.content { display: flex; flex-direction: column; min-height: 0; gap: 12px; }

.panel {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.grow-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-title {
  margin: 0 0 12px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--faint);
  display: flex; align-items: center; gap: 8px;
}
.count-tag {
  font-size: 11px; color: var(--accent); background: var(--accent-soft);
  padding: 1px 7px; border-radius: 999px; letter-spacing: 0; font-weight: 600;
}

/* ---------- input panel ---------- */
.panel-help { margin: -2px 0 14px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.input-panel { padding: 18px; }
.input-panel .import-row { margin: 13px 0; }
.input-panel .import-actions { gap: 9px; margin-top: 12px; }
/* main submit box: taller by default, NO line wrapping (long config URLs
   stay on one line and scroll horizontally instead of wrapping). */
.import-box.main-box { min-height: 184px; white-space: pre; overflow: auto; }
.feedback-btn { margin-top: 2px; color: var(--muted); }
.feedback-btn:hover:not(:disabled) { color: var(--accent); }
.cached-mark { color: var(--accent-2); font-size: 12px; cursor: default; }

/* ---------- forms ---------- */
.import-box {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.import-box.small { min-height: 60px; }
.import-box:focus, .text-in:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.import-box::placeholder, .text-in::placeholder { color: #4c5a6b; }

.import-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.text-in {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; padding: 8px 11px; font-family: var(--sans);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.text-in.grow { flex: 1; min-width: 0; }
.select { cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; white-space: nowrap; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.adv { margin: 10px 0; }
.adv summary { cursor: pointer; color: var(--faint); font-size: 12px; list-style: none; user-select: none; }
.adv summary::before { content: "▸ "; }
.adv[open] summary::before { content: "▾ "; }
.adv summary:hover { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: .15s var(--ease); white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: #2b3a49; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101a; border: none; box-shadow: 0 6px 18px -8px #38bdf899;
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 24px -8px #38bdf8cc; }
.btn.ghost { background: transparent; }
.btn.danger-h:hover:not(:disabled) { color: var(--fail); border-color: var(--fail); }
.btn-badge {
  background: #07101a33; color: inherit; font-size: 11px; font-weight: 700;
  padding: 0 6px; border-radius: 999px; min-width: 16px;
}

/* ---------- saved subscriptions ---------- */
.sub-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sub-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  cursor: pointer; transition: .15s var(--ease); background: var(--surface-2);
}
.sub-item:hover { border-color: #2b4256; background: var(--surface-3); }
.sub-item .sub-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-item .sub-meta { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.sub-item .sub-del { color: var(--faint); cursor: pointer; padding: 2px 4px; border-radius: 5px; font-size: 12px; }
.sub-item .sub-del:hover { color: var(--fail); background: var(--fail-soft); }
.rail-empty, .empty-sub { color: var(--faint); font-size: 12.5px; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-group.push { margin-left: auto; }
.filters { gap: 4px; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; transition: .15s var(--ease); font-weight: 600;
}
.chip:hover { border-color: #2b3a49; color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.ok.active { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.chip.fail.active { background: var(--fail-soft); border-color: var(--fail); color: var(--fail); }

/* ---------- progress ---------- */
.progress-wrap { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.progress-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s var(--ease);
}
.progress-label { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- nodes table ---------- */
.table-scroll {
  flex: 1; min-height: 0; overflow: auto; position: relative;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
table.nodes { width: 100%; border-collapse: collapse; font-size: 13px; }
table.nodes thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2); color: var(--faint);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.nodes tbody tr {
  border-bottom: 1px solid var(--line-soft); transition: background .12s var(--ease);
}
table.nodes tbody tr:hover { background: #ffffff06; }
table.nodes tbody tr.sel { background: var(--accent-soft); }
table.nodes td { padding: 9px 12px; vertical-align: middle; }
.col-check { width: 36px; }
.col-act { width: 44px; }
.node-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint { font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .4px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface-2);
}
.badge.proto { color: var(--accent); border-color: #244a5e; background: #0d2230; }
.badge.tls { color: var(--accent-2); border-color: #3a2f5e; background: #160f28; text-transform: none; }
.badge.tls.none { color: var(--faint); border-color: var(--line); background: transparent; }
.badge-row { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.transport-tag { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pill .pdot { width: 7px; height: 7px; border-radius: 50%; }
.pill.untested { color: var(--faint); background: var(--surface-3); }
.pill.untested .pdot { background: var(--faint); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.ok .pdot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.fail { color: var(--fail); background: var(--fail-soft); }
.pill.fail .pdot { background: var(--fail); }
.pill.testing { color: var(--accent); background: var(--accent-soft); }
.pill.testing .pdot { background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* latency cell */
.lat { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; min-width: 92px; }
.lat-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; min-width: 30px; }
.lat-bar > i { display: block; height: 100%; border-radius: 2px; }
.lat-val { color: var(--muted); white-space: nowrap; }
.exit-ip { font-family: var(--mono); font-size: 12px; color: var(--ok); }
.exit-ip.none { color: var(--faint); }

.row-act { background: transparent; border: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; transition: .15s var(--ease); }
.row-act:hover { color: var(--accent-2); background: var(--surface-3); }

.err-text { color: var(--fail); font-size: 11px; font-family: var(--mono); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* empty state */
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 40px; }
.empty-art { font-size: 56px; opacity: .14; transform: rotate(-8deg); }
.empty-title { margin: 6px 0 0; font-size: 16px; font-weight: 700; color: var(--muted); }
.statusline { font-size: 12px; color: var(--faint); font-family: var(--mono); padding: 0 4px; min-height: 16px; }

/* ---------- slide-overs + overlay ---------- */
.overlay { position: fixed; inset: 0; background: #04070bcc; z-index: 40; backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.slideover {
  position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 92vw; z-index: 50;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -20px 0 50px -20px #000d;
  display: flex; flex-direction: column; animation: slidein .26s var(--ease);
}
.slideover.wide { width: 560px; }
@keyframes slidein { from { transform: translateX(100%); } }
.slideover-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.slideover-head h2 { margin: 0; font-size: 16px; }
.slideover-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; transition: .15s var(--ease); }
.icon-btn:hover { color: var(--fail); border-color: var(--fail); }

.tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* node detail */
.detail-name { font-size: 17px; font-weight: 700; margin: 0; word-break: break-word; }
.detail-section { margin-top: 20px; }
.detail-section h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin: 0 0 9px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); word-break: break-all; color: var(--text); }
.url-block {
  font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px; word-break: break-all; color: var(--muted); line-height: 1.5;
}
.reveal-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.mini-btn { font-size: 11.5px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- activity / blocks ---------- */
.feed { display: flex; flex-direction: column; gap: 1px; }
.feed-item { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); font-size: 12px; align-items: baseline; }
.feed-time { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.feed-action { font-weight: 700; font-family: var(--mono); font-size: 11.5px; }
.feed-action.parse { color: var(--accent); }
.feed-action.test { color: var(--accent-2); }
.feed-action.speedtest { color: var(--warn); }
.feed-action.abuse { color: var(--fail); }
.feed-action.reject { color: var(--fail); }
.feed-detail { color: var(--muted); flex: 1; min-width: 0; word-break: break-word; }
.feed-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

.block-card { border: 1px solid var(--fail); background: var(--fail-soft); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.block-card .block-reason { color: var(--fail); font-weight: 700; font-size: 13px; }
.block-card .block-key { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 4px 0; word-break: break-all; }
.block-card .block-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ---------- speed modal + gauges ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: #04070bcc; backdrop-filter: blur(4px); animation: fade .2s var(--ease); padding: 20px; }
.modal { width: 560px; max-width: 96vw; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; animation: pop .26s var(--ease); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .sub { font-family: var(--mono); font-size: 12px; color: var(--faint); word-break: break-all; }
.gauges { display: flex; gap: 18px; justify-content: center; margin: 18px 0 8px; flex-wrap: wrap; }
.gauge { text-align: center; }
.gauge svg { display: block; }
.gauge .g-val { font-family: var(--mono); font-size: 22px; font-weight: 700; fill: var(--text); }
.gauge .g-unit { font-size: 10px; fill: var(--faint); }
.gauge .g-label { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); }
.gauge .g-arc-bg { stroke: var(--surface-3); }
.gauge.dl .g-arc { stroke: var(--accent); }
.gauge.ul .g-arc { stroke: var(--accent-2); }
.gauge .g-arc { stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.speed-stats { display: flex; justify-content: center; gap: 26px; font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.speed-stats b { color: var(--text); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.speed-running { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px; color: var(--muted); }
.speed-phase { font-size: 13px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
  box-shadow: var(--shadow); animation: toastin .25s var(--ease); max-width: 90vw;
}
.toast.err { border-color: var(--fail); color: #ffd9df; background: #1f0f13; }
.toast.ok { border-color: var(--ok); color: #c8f7e4; background: #0d1f18; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

[hidden] { display: none !important; }

/* ---------- language select ---------- */
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 30px 8px 12px; font-size: 12.5px; cursor: pointer; font-family: var(--sans);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 13px center, right 8px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  transition: .15s var(--ease);
}
.lang-select:hover { color: var(--text); border-color: #2b4256; }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- import action buttons ---------- */
.import-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.import-actions .btn { width: 100%; }
.import-actions .btn-pair { display: flex; gap: 8px; }
.import-actions .btn-pair .btn { flex: 1; }

/* ---------- RTL (Persian) ---------- */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .tag, [dir="rtl"] .endpoint, [dir="rtl"] .url-block,
[dir="rtl"] .import-box, [dir="rtl"] .feed-time, [dir="rtl"] .lat,
[dir="rtl"] .exit-ip, [dir="rtl"] .kv dd, [dir="rtl"] .sub-meta,
[dir="rtl"] .chip-stat, [dir="rtl"] .mono { direction: ltr; }
[dir="rtl"] table.nodes thead th,
[dir="rtl"] .panel-title, [dir="rtl"] .detail-section h3 { text-align: right; }
[dir="rtl"] .slideover { left: 0; right: auto; border-left: none; border-right: 1px solid var(--line); animation: slideinL .26s var(--ease); }
@keyframes slideinL { from { transform: translateX(-100%); } }
[dir="rtl"] .shield-count { right: auto; left: -6px; }
[dir="rtl"] .lang-select { padding: 8px 12px 8px 30px; background-position: left 13px center, left 8px center; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail .panel { flex: 1; min-width: 260px; }
  .col-exit, .col-proto { display: none; }
}
