/* ==========================================================================
   CONNECTIVITY SYSTEM — main stylesheet
   Layout: 10% left · 70% playground · 20% right
   ========================================================================== */

/* ---------------------------------------------------------------- TOKENS -- */
:root{
  --bg:            #0B1020;
  --bg-2:          #10162B;
  --bg-3:          #161E38;
  --panel:         #0F1527;
  --panel-2:       #131B33;
  --line:          #202A47;
  --line-2:        #2A3760;
  --ink:           #E8ECF7;
  --ink-2:         #A8B4D0;
  --ink-3:         #6C7A9C;
  --accent:        #4CC3FF;
  --accent-2:      #7C5CFF;
  --good:          #2ED573;
  --warn:          #FFB020;
  --bad:           #FF5A6E;
  --ring:          rgba(76,195,255,.35);

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --sh-1: 0 2px 8px rgba(0,0,0,.35);
  --sh-2: 0 8px 28px rgba(0,0,0,.45);
  --sh-3: 0 20px 60px rgba(0,0,0,.55);

  --topbar-h: 58px;
  --crumb-h: 34px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --w-left: 10%;
  --w-right: 20%;
}

[data-theme="light"]{
  --bg:      #F4F6FB;
  --bg-2:    #FFFFFF;
  --bg-3:    #EDF1F9;
  --panel:   #FFFFFF;
  --panel-2: #F7F9FD;
  --line:    #DFE5F1;
  --line-2:  #C6D0E4;
  --ink:     #10182C;
  --ink-2:   #4A5670;
  --ink-3:   #7C88A4;
  --accent:  #0A84C8;
  --accent-2:#6A46E8;
  --ring:    rgba(10,132,200,.28);
  --sh-1: 0 1px 4px rgba(20,30,60,.08);
  --sh-2: 0 6px 20px rgba(20,30,60,.12);
  --sh-3: 0 16px 48px rgba(20,30,60,.18);
}

/* ------------------------------------------------------------------ BASE -- */
*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; font-family:var(--font); font-size:14px; line-height:1.5;
  background:var(--bg); color:var(--ink);
  -webkit-font-smoothing:antialiased; overflow:hidden;
}
button,input,select{ font-family:inherit; font-size:inherit; color:inherit; }
button{ cursor:pointer; border:none; background:none; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }
kbd{
  font-family:var(--mono); font-size:10px; padding:2px 5px;
  border:1px solid var(--line-2); border-radius:4px;
  background:var(--bg-3); color:var(--ink-2);
}
::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:8px; }
::-webkit-scrollbar-thumb:hover{ background:var(--ink-3); }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---------------------------------------------------------------- TOPBAR -- */
.topbar{
  height:var(--topbar-h); display:flex; align-items:center; gap:16px;
  padding:0 14px; background:var(--panel);
  border-bottom:1px solid var(--line); position:relative; z-index:60;
}
.brand{ display:flex; align-items:center; gap:10px; cursor:pointer; flex:0 0 auto; min-width:0; }
.brand-mark{ width:30px; height:30px; flex:0 0 auto; }
.bm-a{ fill:#2E9E5B } .bm-b{ fill:#00A9E0 } .bm-c{ fill:#F5821F } .bm-d{ fill:#8E44E8 }
.bm-line{ stroke:var(--line-2); stroke-width:1.3; fill:none; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; min-width:0; }
.brand-text strong{ font-size:14px; font-weight:800; letter-spacing:-.2px; white-space:nowrap; }
.brand-text span{ font-size:10.5px; color:var(--ink-3); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }

.searchwrap{ flex:1 1 auto; max-width:720px; margin:0 auto; position:relative; }
.searchbox{
  display:flex; align-items:center; gap:9px; height:38px; padding:0 10px;
  background:var(--bg-3); border:1px solid var(--line); border-radius:var(--r-md);
  transition:border-color .15s, box-shadow .15s;
}
.searchbox:focus-within{ border-color:var(--accent); box-shadow:0 0 0 3px var(--ring); }
.s-icon{ width:16px; height:16px; flex:0 0 auto; stroke:var(--ink-3); stroke-width:2;
  fill:none; stroke-linecap:round; }
.searchbox input{ flex:1; background:none; border:none; outline:none; font-size:13.5px; min-width:0; }
.searchbox input::placeholder{ color:var(--ink-3); }
.s-clear{ display:none; font-size:19px; color:var(--ink-3); line-height:1; padding:0 4px; }
.searchbox.filled .s-clear{ display:block; }
.searchbox.filled .s-kbd{ display:none; }

.search-results{
  position:absolute; top:46px; left:0; right:0; max-height:min(70vh,540px);
  overflow-y:auto; background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--r-lg); box-shadow:var(--sh-3); z-index:70; padding:6px;
}
.sr-group-title{
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px;
  color:var(--ink-3); padding:9px 10px 5px;
}
.sr-item{
  display:flex; align-items:flex-start; gap:10px; padding:8px 10px;
  border-radius:var(--r-sm); cursor:pointer;
}
.sr-item:hover,.sr-item.sel{ background:var(--bg-3); }
.sr-dot{ width:9px; height:9px; border-radius:50%; margin-top:5px; flex:0 0 auto; }
.sr-txt{ min-width:0; flex:1; }
.sr-name{ font-weight:600; font-size:13px; }
.sr-name mark{ background:rgba(76,195,255,.25); color:inherit; border-radius:2px; }
.sr-path{ font-size:11px; color:var(--ink-3); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.sr-badge{
  font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  padding:2px 6px; border-radius:20px; background:var(--bg-2);
  border:1px solid var(--line); color:var(--ink-3); flex:0 0 auto;
}
.sr-empty{ padding:24px 14px; text-align:center; color:var(--ink-3); font-size:13px; }

.topbar-actions{ display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.country-toggle{
  display:flex; background:var(--bg-3); border:1px solid var(--line);
  border-radius:var(--r-md); padding:2px;
}
.country-toggle button{
  padding:5px 11px; font-size:11.5px; font-weight:600; border-radius:7px;
  color:var(--ink-3); transition:.15s;
}
.country-toggle button.active{ background:var(--accent); color:#04121F; }
[data-theme="light"] .country-toggle button.active{ color:#fff; }

.icon-btn{
  width:34px; height:34px; display:grid; place-items:center;
  border-radius:var(--r-md); border:1px solid var(--line);
  background:var(--bg-3); transition:.15s;
}
.icon-btn:hover{ border-color:var(--accent); color:var(--accent); }
.icon-btn svg{ width:17px; height:17px; stroke:currentColor; stroke-width:1.9;
  fill:none; stroke-linecap:round; stroke-linejoin:round; }
.icon-btn .t-sun{ display:none; }
[data-theme="light"] .icon-btn .t-sun{ display:block; }
[data-theme="light"] .icon-btn .t-moon{ display:none; }
.only-mobile{ display:none; }

/* ---------------------------------------------------------------- LAYOUT -- */
.layout{
  display:grid;
  grid-template-columns: var(--w-left) 1fr var(--w-right);
  height:calc(100vh - var(--topbar-h));
  min-height:0;
}

/* ------------------------------------------------------------ LEFT PANEL -- */
.panel-left{
  background:var(--panel); border-right:1px solid var(--line);
  display:flex; flex-direction:column; min-width:0; overflow:hidden;
}
.pl-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:11px 12px 8px; font-size:10px; font-weight:800;
  text-transform:uppercase; letter-spacing:.9px; color:var(--ink-3);
  border-bottom:1px solid var(--line);
}
.mini-btn{
  width:20px; height:20px; display:grid; place-items:center; border-radius:5px;
  color:var(--ink-3); font-size:11px; line-height:1;
}
.mini-btn:hover{ background:var(--bg-3); color:var(--ink); }

.tree{ flex:1 1 auto; overflow-y:auto; overflow-x:hidden; padding:6px 4px 10px; }
.tnode{ user-select:none; }
.trow{
  display:flex; align-items:center; gap:5px; padding:5px 6px;
  border-radius:var(--r-sm); cursor:pointer; font-size:12px; line-height:1.25;
  transition:background .12s;
}
.trow:hover{ background:var(--bg-3); }
.trow.active{ background:var(--bg-3); box-shadow:inset 2px 0 0 var(--accent); }
.tcaret{
  width:13px; height:13px; flex:0 0 auto; display:grid; place-items:center;
  color:var(--ink-3); font-size:8px; transition:transform .15s;
}
.tcaret.open{ transform:rotate(90deg); }
.tcaret.leaf{ visibility:hidden; }
.tdot{ width:7px; height:7px; border-radius:50%; flex:0 0 auto; }
.tname{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tcount{ font-size:9.5px; color:var(--ink-3); font-variant-numeric:tabular-nums; flex:0 0 auto; }
.tkids{ margin-left:9px; border-left:1px dashed var(--line); padding-left:3px; }
.tkids[hidden]{ display:none; }

.skeleton-tree{ padding:8px 6px; }
.sk-row{ height:11px; margin:9px 0; border-radius:5px;
  background:linear-gradient(90deg,var(--bg-3),var(--line),var(--bg-3));
  background-size:200% 100%; animation:sk 1.3s linear infinite; }
.sk-row:nth-child(2n){ width:78% } .sk-row:nth-child(3n){ width:62% }
@keyframes sk{ 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.pl-section{ border-top:1px solid var(--line); padding:10px 10px 12px; }
.pl-title{ font-size:9.5px; font-weight:800; text-transform:uppercase;
  letter-spacing:.9px; color:var(--ink-3); margin-bottom:7px; }
.fl{ display:block; font-size:10.5px; color:var(--ink-2); margin-bottom:9px; }
.fl b{ color:var(--accent); font-variant-numeric:tabular-nums; }
.fl select,.fl input[type=range]{
  width:100%; margin-top:4px; background:var(--bg-3);
  border:1px solid var(--line); border-radius:var(--r-sm);
  padding:5px 6px; font-size:11px; outline:none;
}
.fl input[type=range]{ padding:0; height:20px; accent-color:var(--accent); }

.chips{ display:flex; flex-wrap:wrap; gap:4px; }
.chip{ position:relative; }
.chip input{ position:absolute; opacity:0; width:0; height:0; }
.chip span{
  display:block; font-size:9.5px; padding:3px 7px; border-radius:20px;
  border:1px solid var(--line); background:var(--bg-3);
  color:var(--ink-3); cursor:pointer; white-space:nowrap; transition:.12s;
}
.chip input:checked + span{
  background:rgba(76,195,255,.14); border-color:var(--accent); color:var(--accent);
}
.wide-btn{
  width:100%; margin-top:10px; padding:6px; font-size:11px; font-weight:600;
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--bg-3); color:var(--ink-2); transition:.15s;
}
.wide-btn:hover{ border-color:var(--accent); color:var(--accent); }

.pl-foot{
  border-top:1px solid var(--line); padding:9px 10px;
  font-size:9.5px; color:var(--ink-3); font-variant-numeric:tabular-nums;
}
.pl-foot b{ color:var(--ink-2); }

/* ------------------------------------------------------------ PLAYGROUND -- */
.playground{
  position:relative; background:
    radial-gradient(900px 600px at 30% 20%, rgba(76,195,255,.045), transparent 62%),
    radial-gradient(800px 700px at 75% 78%, rgba(124,92,255,.045), transparent 62%),
    var(--bg);
  overflow:hidden; min-width:0;
}
.graph-host{ position:absolute; inset:0; }
.graph-host canvas{ outline:none; }

.graph-loading{
  position:absolute; inset:0; display:grid; place-content:center;
  justify-items:center; gap:16px; background:var(--bg); z-index:12;
  transition:opacity .4s; color:var(--ink-3); font-size:13px;
}
.graph-loading.hide{ opacity:0; pointer-events:none; }
.gl-orbit{ position:relative; width:66px; height:66px; }
.gl-orbit span{
  position:absolute; inset:0; border:2px solid transparent; border-radius:50%;
  border-top-color:var(--accent); animation:spin 1.3s linear infinite;
}
.gl-orbit span:nth-child(2){ inset:11px; border-top-color:var(--accent-2);
  animation-duration:1.9s; animation-direction:reverse; }
.gl-orbit span:nth-child(3){ inset:22px; border-top-color:var(--good);
  animation-duration:2.5s; }
@keyframes spin{ to{ transform:rotate(360deg) } }

.gcontrols{
  position:absolute; top:12px; right:12px; z-index:14;
  display:flex; flex-direction:column; gap:5px;
}
.gc{
  width:32px; height:32px; display:grid; place-items:center;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-sm); color:var(--ink-2); font-size:13px;
  box-shadow:var(--sh-1); transition:.14s;
}
.gc:hover{ border-color:var(--accent); color:var(--accent); transform:translateY(-1px); }
.gc.on{ background:var(--accent); color:#04121F; border-color:var(--accent); }

.crumbbar{
  position:absolute; top:12px; left:12px; right:56px; height:var(--crumb-h);
  display:flex; align-items:center; gap:5px; padding:0 11px; z-index:13;
  background:color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter:blur(10px);
  border:1px solid var(--line); border-radius:var(--r-md);
  font-size:11.5px; overflow-x:auto; white-space:nowrap; box-shadow:var(--sh-1);
}
.crumbbar::-webkit-scrollbar{ height:0 }
.crumb-empty{ color:var(--ink-3); }
.crumb{ color:var(--ink-2); cursor:pointer; padding:2px 4px; border-radius:4px; }
.crumb:hover{ background:var(--bg-3); color:var(--accent); }
.crumb.last{ color:var(--ink); font-weight:700; }
.crumb-sep{ color:var(--ink-3); opacity:.6; }

.legend{
  position:absolute; bottom:12px; right:12px; z-index:13; width:190px;
  background:color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter:blur(10px);
  border:1px solid var(--line); border-radius:var(--r-md);
  box-shadow:var(--sh-2); overflow:hidden; font-size:10.5px;
}
.lg-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:7px 9px; font-size:9.5px; font-weight:800; text-transform:uppercase;
  letter-spacing:.8px; color:var(--ink-3); border-bottom:1px solid var(--line);
}
.lg-body{ max-height:190px; overflow-y:auto; padding:5px; }
.legend.collapsed .lg-body,.legend.collapsed .lg-edges{ display:none; }
.lgi{
  display:flex; align-items:center; gap:7px; padding:3px 5px;
  border-radius:5px; cursor:pointer;
}
.lgi:hover{ background:var(--bg-3); }
.lgi.off{ opacity:.35; }
.lgi i{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.lgi span{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lgi b{ color:var(--ink-3); font-weight:600; font-variant-numeric:tabular-nums; }
.lg-edges{ border-top:1px solid var(--line); padding:6px 9px; display:grid; gap:4px; }
.lge{ display:flex; align-items:center; gap:7px; color:var(--ink-3); font-size:9.5px; }
.lge i{ width:22px; height:2px; flex:0 0 auto; border-radius:2px; }
.l-solid{ background:var(--ink-3); }
.l-grad{ background:linear-gradient(90deg,#2E9E5B,#00A9E0); height:3px !important; }
.l-dash{ background:repeating-linear-gradient(90deg,var(--ink-3) 0 4px,transparent 4px 7px); }
.l-dot{ background:repeating-linear-gradient(90deg,var(--ink-3) 0 2px,transparent 2px 5px); }

.graph-stats{
  position:absolute; bottom:12px; left:12px; z-index:13;
  padding:5px 10px; border-radius:20px; font-size:10px;
  background:color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter:blur(10px);
  border:1px solid var(--line); color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}
.graph-stats b{ color:var(--ink-2); }

.tooltip{
  position:absolute; z-index:40; max-width:308px; pointer-events:none;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--r-md); box-shadow:var(--sh-3);
  padding:10px 12px; font-size:11.5px; line-height:1.45;
}
.tt-head{ display:flex; align-items:center; gap:7px; margin-bottom:5px; }
.tt-dot{ width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.tt-name{ font-weight:700; font-size:13px; }
.tt-path{ font-size:10px; color:var(--ink-3); margin-bottom:6px; }
.tt-desc{ color:var(--ink-2); margin-bottom:7px; }
.tt-meta{ display:flex; flex-wrap:wrap; gap:5px; margin-bottom:6px; }
.tt-pill{
  font-size:9.5px; padding:2px 7px; border-radius:20px;
  background:var(--bg-3); border:1px solid var(--line); color:var(--ink-2);
}
.tt-sec{ border-top:1px solid var(--line); padding-top:6px; margin-top:6px; }
.tt-sec-t{ font-size:9px; font-weight:800; text-transform:uppercase;
  letter-spacing:.7px; color:var(--ink-3); margin-bottom:3px; }
.tt-hint{ color:var(--ink-3); font-size:10px; margin-top:7px; font-style:italic; }
.tt-bar{ height:3px; border-radius:3px; background:var(--line); overflow:hidden; margin-top:2px; }
.tt-bar i{ display:block; height:100%; background:var(--accent); }

.ctxmenu{
  position:absolute; z-index:55; min-width:186px; padding:5px;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--r-md); box-shadow:var(--sh-3);
}
.ctxmenu button{
  display:block; width:100%; text-align:left; padding:7px 10px;
  border-radius:var(--r-sm); font-size:12px; color:var(--ink-2);
}
.ctxmenu button:hover{ background:var(--bg-3); color:var(--ink); }

/* ----------------------------------------------------------- RIGHT PANEL -- */
.panel-right{
  background:var(--panel); border-left:1px solid var(--line);
  display:flex; flex-direction:column; min-width:0; overflow:hidden;
}
.pr-empty{
  flex:1; display:flex; flex-direction:column; align-items:center;
  justify-content:center; text-align:center; padding:26px 20px; gap:11px;
}
.pr-empty-art{ width:66px; height:66px; opacity:.3;
  stroke:var(--ink-3); stroke-width:2; fill:none; }
.pr-empty h3{ margin:0; font-size:14px; }
.pr-empty p{ margin:0; font-size:11.5px; color:var(--ink-3); line-height:1.6; max-width:250px; }
.pr-hints{ margin-top:9px; display:grid; gap:5px; font-size:10px; color:var(--ink-3); }

.pr-content{ display:flex; flex-direction:column; min-height:0; flex:1; }
.pr-header{ padding:13px 14px 10px; border-bottom:1px solid var(--line); }
.pr-crumb{ font-size:9.5px; color:var(--ink-3); margin-bottom:5px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pr-crumb span{ cursor:pointer; }
.pr-crumb span:hover{ color:var(--accent); }
.pr-title{ display:flex; align-items:flex-start; gap:9px; }
.pr-swatch{ width:12px; height:12px; border-radius:50%; margin-top:5px; flex:0 0 auto; }
.pr-title h2{ margin:0; font-size:16px; font-weight:800; letter-spacing:-.3px; line-height:1.25; }
.pr-bn{ font-size:11.5px; color:var(--ink-3); margin-top:2px; }
.pr-badges{ display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }
.pr-badge{
  font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  padding:2.5px 7px; border-radius:20px; background:var(--bg-3);
  border:1px solid var(--line); color:var(--ink-3);
}
.pr-badge.hot{ background:rgba(255,90,110,.12); border-color:var(--bad); color:var(--bad); }
.pr-badge.grow{ background:rgba(46,213,115,.12); border-color:var(--good); color:var(--good); }
.pr-desc{ font-size:11.5px; color:var(--ink-2); line-height:1.6; margin-top:9px; }

.pr-tiles{
  display:grid; grid-template-columns:repeat(4,1fr); gap:1px;
  background:var(--line); border-bottom:1px solid var(--line);
}
.tile{ background:var(--panel); padding:9px 4px; text-align:center; }
.tile b{ display:block; font-size:15px; font-weight:800;
  font-variant-numeric:tabular-nums; line-height:1.1; }
.tile span{ font-size:8.5px; color:var(--ink-3); text-transform:uppercase;
  letter-spacing:.5px; }

.pr-tabs{
  display:flex; overflow-x:auto; border-bottom:1px solid var(--line);
  background:var(--panel-2); flex:0 0 auto;
}
.pr-tabs::-webkit-scrollbar{ height:0 }
.pr-tabs button{
  padding:9px 11px; font-size:11px; font-weight:600; color:var(--ink-3);
  white-space:nowrap; border-bottom:2px solid transparent; transition:.14s;
}
.pr-tabs button:hover{ color:var(--ink-2); }
.pr-tabs button.active{ color:var(--accent); border-bottom-color:var(--accent); }

.pr-body{ flex:1 1 auto; overflow-y:auto; padding:12px 13px 40px; }
.sec{ margin-bottom:18px; }
.sec-h{
  font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.9px;
  color:var(--ink-3); margin-bottom:8px; display:flex;
  align-items:center; justify-content:space-between; gap:6px;
}
.sec-h em{ font-style:normal; color:var(--ink-3); opacity:.7; font-weight:600; }

.lst{ display:grid; gap:5px; }
.li{
  display:flex; align-items:center; gap:8px; padding:7px 9px;
  background:var(--bg-3); border:1px solid transparent;
  border-radius:var(--r-sm); cursor:pointer; transition:.14s; font-size:12px;
}
.li:hover{ border-color:var(--line-2); transform:translateX(2px); }
.li-dot{ width:8px; height:8px; border-radius:50%; flex:0 0 auto; }
.li-main{ flex:1; min-width:0; }
.li-name{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.li-sub{ font-size:10px; color:var(--ink-3); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.li-right{ flex:0 0 auto; font-size:9.5px; color:var(--ink-3); text-align:right; }

.bar{ height:3px; border-radius:3px; background:var(--line); overflow:hidden; margin-top:4px; }
.bar i{ display:block; height:100%; border-radius:3px; }

.tool-card{
  display:flex; gap:9px; padding:9px; background:var(--bg-3);
  border:1px solid transparent; border-radius:var(--r-sm); transition:.14s;
}
.tool-card:hover{ border-color:var(--line-2); }
.tool-ico{
  width:30px; height:30px; border-radius:7px; flex:0 0 auto;
  display:grid; place-items:center; font-weight:800; font-size:12px;
  background:var(--bg-2); border:1px solid var(--line); color:var(--ink-2);
}
.tool-body{ flex:1; min-width:0; }
.tool-name{ font-weight:700; font-size:12px; display:flex;
  align-items:center; gap:5px; flex-wrap:wrap; }
.tool-desc{ font-size:10.5px; color:var(--ink-3); line-height:1.5; margin-top:2px; }
.lic{
  font-size:8.5px; font-weight:700; text-transform:uppercase; letter-spacing:.4px;
  padding:1.5px 5px; border-radius:20px; flex:0 0 auto;
}
.lic-free,.lic-open_source{ background:rgba(46,213,115,.14); color:var(--good); }
.lic-freemium{ background:rgba(255,176,32,.14); color:var(--warn); }
.lic-commercial,.lic-trial{ background:rgba(255,90,110,.12); color:var(--bad); }
.lic-academic{ background:rgba(124,92,255,.14); color:var(--accent-2); }

.job{
  padding:9px; background:var(--bg-3); border-radius:var(--r-sm);
  border-left:3px solid var(--accent);
}
.job-t{ font-weight:700; font-size:12px; }
.job-m{ font-size:10px; color:var(--ink-3); margin-top:2px; }
.job-s{ font-size:11px; font-weight:700; color:var(--good);
  margin-top:4px; font-variant-numeric:tabular-nums; }
.dem{ font-size:8.5px; font-weight:700; text-transform:uppercase;
  padding:1.5px 6px; border-radius:20px; letter-spacing:.4px; }
.dem-very_high{ background:rgba(255,90,110,.16); color:var(--bad); }
.dem-high{ background:rgba(255,176,32,.16); color:var(--warn); }
.dem-moderate{ background:rgba(76,195,255,.14); color:var(--accent); }
.dem-low{ background:var(--bg-2); color:var(--ink-3); }

.empty-state{
  text-align:center; padding:26px 16px; color:var(--ink-3); font-size:11.5px;
  border:1px dashed var(--line-2); border-radius:var(--r-md); line-height:1.6;
}
.empty-state b{ color:var(--ink-2); display:block; margin-bottom:4px; font-size:12.5px; }

.chartbox{ background:var(--bg-3); border-radius:var(--r-sm); padding:10px; }
.chart-svg{ width:100%; height:auto; display:block; }
.hbar{ display:grid; gap:6px; }
.hbar-row{ display:grid; grid-template-columns:82px 1fr 30px;
  gap:7px; align-items:center; font-size:10.5px; }
.hbar-row span:first-child{ color:var(--ink-3); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.hbar-track{ height:7px; background:var(--line); border-radius:4px; overflow:hidden; }
.hbar-fill{ height:100%; border-radius:4px; background:var(--accent); }
.hbar-row b{ text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }

.src{ padding:8px 9px; background:var(--bg-3); border-radius:var(--r-sm); font-size:11px; }
.src-t{ font-weight:600; }
.src-m{ font-size:9.5px; color:var(--ink-3); margin-top:3px; }

/* ---------------------------------------------------------------- MODALS -- */
.modal{
  position:fixed; inset:0; z-index:100; display:grid; place-items:center;
  padding:20px; background:rgba(4,8,18,.72); backdrop-filter:blur(5px);
  animation:fade .18s ease;
}
@keyframes fade{ from{opacity:0} }
.modal-card{
  width:100%; max-width:640px; max-height:88vh; overflow-y:auto;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--r-xl); box-shadow:var(--sh-3); padding:20px 22px 22px;
}
.modal-card.wide{ max-width:1000px; }
.modal-head{ display:flex; align-items:center; justify-content:space-between;
  margin-bottom:5px; }
.modal-head h3{ margin:0; font-size:17px; font-weight:800; }
.modal-x{ font-size:24px; color:var(--ink-3); line-height:1; padding:0 4px; }
.modal-x:hover{ color:var(--ink); }
.modal-sub{ margin:0 0 16px; font-size:12px; color:var(--ink-3); }

.path-inputs{ display:grid; grid-template-columns:1fr auto 1fr; gap:11px;
  align-items:end; margin-bottom:14px; }
.pi{ position:relative; }
.pi label{ display:block; font-size:9.5px; font-weight:800; text-transform:uppercase;
  letter-spacing:.8px; color:var(--ink-3); margin-bottom:5px; }
.pi input{
  width:100%; padding:9px 11px; background:var(--bg-3);
  border:1px solid var(--line); border-radius:var(--r-md);
  outline:none; font-size:13px;
}
.pi input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--ring); }
.pi-drop{
  position:absolute; top:100%; left:0; right:0; margin-top:4px; z-index:10;
  max-height:210px; overflow-y:auto; background:var(--panel);
  border:1px solid var(--line-2); border-radius:var(--r-md);
  box-shadow:var(--sh-2); padding:4px;
}
.pi-arrow{ font-size:19px; color:var(--ink-3); padding-bottom:9px; }
.path-opts{ display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  font-size:11.5px; color:var(--ink-2); margin-bottom:16px; }
.path-opts input[type=number]{
  width:52px; padding:5px 7px; background:var(--bg-3);
  border:1px solid var(--line); border-radius:var(--r-sm); outline:none;
}
.primary-btn{
  margin-left:auto; padding:9px 20px; border-radius:var(--r-md);
  background:var(--accent); color:#04121F; font-weight:700; font-size:12.5px;
  transition:.15s;
}
[data-theme="light"] .primary-btn{ color:#fff; }
.primary-btn:hover{ filter:brightness(1.1); transform:translateY(-1px); }

.path-chain{ display:grid; gap:0; }
.pc-node{
  display:flex; align-items:center; gap:11px; padding:11px;
  background:var(--bg-3); border-radius:var(--r-md);
}
.pc-num{
  width:24px; height:24px; border-radius:50%; display:grid; place-items:center;
  font-size:11px; font-weight:800; background:var(--bg-2);
  border:2px solid currentColor; flex:0 0 auto;
}
.pc-body{ flex:1; min-width:0; }
.pc-name{ font-weight:700; font-size:13px; }
.pc-disc{ font-size:10px; color:var(--ink-3); }
.pc-link{
  margin-left:23px; padding:9px 0 9px 19px;
  border-left:2px dashed var(--line-2); font-size:11px; color:var(--ink-3);
  line-height:1.55;
}
.pc-link b{ color:var(--accent); font-weight:600; }
.path-summary{
  padding:11px 13px; background:rgba(76,195,255,.08);
  border:1px solid var(--accent); border-radius:var(--r-md);
  font-size:12px; margin-bottom:14px; line-height:1.6;
}

.stats-body{ display:grid; gap:18px; }
.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(118px,1fr)); gap:9px; }
.stat-card{
  padding:13px; background:var(--bg-3); border-radius:var(--r-md);
  border:1px solid var(--line); text-align:center;
}
.stat-card b{ display:block; font-size:22px; font-weight:800;
  font-variant-numeric:tabular-nums; line-height:1.1; }
.stat-card span{ font-size:9.5px; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.6px; }
.bridge{
  display:flex; align-items:center; gap:9px; padding:9px 11px;
  background:var(--bg-3); border-radius:var(--r-sm); font-size:11.5px;
  cursor:pointer; margin-bottom:5px;
}
.bridge:hover{ background:var(--bg-2); }
.bridge-line{ flex:0 0 44px; height:3px; border-radius:3px; }
.bridge-txt{ flex:1; min-width:0; }
.bridge-why{ font-size:10px; color:var(--ink-3); line-height:1.5;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.bridge-w{ flex:0 0 auto; font-family:var(--mono); font-size:10px; color:var(--accent); }

.compare-body{ display:grid; gap:16px; }
.cmp-grid{ display:grid; gap:11px; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
.cmp-card{ padding:13px; background:var(--bg-3); border-radius:var(--r-md);
  border-top:3px solid var(--accent); }
.cmp-card h4{ margin:0 0 3px; font-size:13.5px; }
.cmp-metrics{ display:grid; gap:5px; margin-top:9px; font-size:11px; }
.cmp-metrics div{ display:flex; justify-content:space-between; }
.cmp-metrics b{ font-variant-numeric:tabular-nums; }

/* ---------------------------------------------------------------- TOASTS -- */
.toast-host{ position:fixed; bottom:18px; left:50%; transform:translateX(-50%);
  z-index:200; display:grid; gap:7px; }
.toast{
  padding:10px 17px; border-radius:var(--r-md); font-size:12.5px;
  background:var(--panel); border:1px solid var(--line-2);
  box-shadow:var(--sh-2); animation:pop .22s ease;
}
.toast.ok{ border-color:var(--good); } .toast.err{ border-color:var(--bad); }
@keyframes pop{ from{ opacity:0; transform:translateY(9px) } }

/* ------------------------------------------------------------ RESPONSIVE -- */
@media (max-width:1500px){ :root{ --w-left:12%; --w-right:23%; } }
@media (max-width:1280px){ :root{ --w-left:14%; --w-right:26%; } }

@media (max-width:1024px){
  .only-mobile{ display:grid; }
  .layout{ grid-template-columns:1fr; }
  .panel-left,.panel-right{
    position:fixed; top:var(--topbar-h); bottom:0; width:min(320px,86vw);
    z-index:80; transition:transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow:var(--sh-3);
  }
  .panel-left{ left:0; transform:translateX(-102%); }
  .panel-right{ right:0; transform:translateX(102%); }
  .panel-left.open,.panel-right.open{ transform:translateX(0); }
  .brand-text{ display:none; }
  .legend{ width:150px; font-size:9.5px; }
}

@media (max-width:640px){
  .country-toggle button{ padding:5px 8px; font-size:10.5px; }
  #pathBtn,#statsBtn{ display:none; }
  .searchbox input{ font-size:12.5px; }
  .s-kbd{ display:none; }
  .crumbbar{ right:12px; top:52px; }
  .gcontrols{ top:12px; }
  .pr-tiles{ grid-template-columns:repeat(2,1fr); }
}

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* Screen-reader-only text list fallback for the WebGL canvas */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
