:root{
  --bg: #0b0b0d;
  --surface: #161618;
  --surface-2: #1c1c1f;
  --border: #29292d;
  --text: #f2f2f3;
  --text-dim: #9a9aa1;
  --text-faint: #626268;
  --accent: #e2723f;
  --accent-2: #d9673a;
  --accent-soft: rgba(226,114,63,.14);
  --green: #3ecf6b;
  --green-soft: rgba(62,207,107,.12);
  --red: #e5484d;
  --red-soft: rgba(229,72,77,.12);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* shared "elevated glass" surface — subtle top sheen + real depth shadow, used by every card/tile/list */
  --surface-bg: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0) 45%), var(--surface);
  --surface-shadow: 0 10px 22px -10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}

*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
button,input{ font-family:inherit; color:inherit; }
button{ appearance:none; -webkit-appearance:none; margin:0; cursor:pointer; text-align:left; }
button:focus{ outline:none; }
html,body{height:100%;}
body{
  margin:0;
  background:
    radial-gradient(120% 46% at 50% -8%, rgba(226,114,63,.10), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Inter,sans-serif;
  font-size:15px;
  line-height:1.4;
  overscroll-behavior-y:none;
  user-select:none;
}

#app{
  position:relative; z-index:1;
  min-height:100vh;
  min-height:100dvh;
  min-height:var(--tg-vh, 100dvh);
  display:flex;
  flex-direction:column;
}

/* ---------- Ambient floating background orbs ---------- */
.bg-orb{
  position:fixed; z-index:0; pointer-events:none;
  border-radius:50%;
  filter:blur(60px);
  opacity:.32;
  will-change:transform;
}
.bg-orb-1{
  width:260px; height:260px; top:-70px; left:-70px;
  background:radial-gradient(circle, var(--accent), transparent 70%);
  animation:orbFloat1 24s ease-in-out infinite;
}
.bg-orb-2{
  width:230px; height:230px; bottom:-60px; right:-70px;
  background:radial-gradient(circle, #4d9bf5, transparent 70%);
  animation:orbFloat2 28s ease-in-out infinite;
}
@keyframes orbFloat1{
  0%,100%{ transform:translate(0,0) scale(1); }
  33%{ transform:translate(50px,70px) scale(1.15); }
  66%{ transform:translate(-25px,35px) scale(.92); }
}
@keyframes orbFloat2{
  0%,100%{ transform:translate(0,0) scale(1); }
  50%{ transform:translate(-55px,-80px) scale(1.2); }
}
@media (prefers-reduced-motion: reduce){
  .bg-orb{ animation:none; }
}

/* ---------- Top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; gap:10px;
  padding: calc(var(--safe-top) + 14px) 16px 14px;
  background:rgba(11,11,13,.86);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.topbar .back-btn{
  width:34px; height:34px; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  border-radius:10px;
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--text);
}
.topbar .back-btn:active{ background:var(--surface-2); }
.topbar .brand{ display:flex; align-items:center; gap:10px; }
.topbar .logo{
  width:32px; height:32px; border-radius:9px;
  background:linear-gradient(135deg,var(--accent),#c9532b);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:14px; color:#fff; flex:0 0 auto;
}
.topbar .titles{ display:flex; flex-direction:column; line-height:1.15; min-width:0; }
.topbar .titles .t1{ font-weight:600; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .titles .t2{ font-size:11.5px; color:var(--text-faint); letter-spacing:.03em; }
.topbar .spacer{ flex:1; }
.badge{
  display:flex; align-items:center; gap:5px;
  font-size:11.5px; font-weight:600;
  padding:5px 9px; border-radius:100px;
  white-space:nowrap; border:none;
}
.badge.green{ background:var(--green-soft); color:var(--green); }
.badge .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; animation:pulseDot 2s ease-in-out infinite; }
.badge .icon{ width:13px; height:13px; }
@keyframes pulseDot{ 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ---------- Content ---------- */
.content{
  flex:1;
  padding: 18px 16px calc(var(--safe-bottom) + 96px);
  overflow-y:auto;
  overflow-x:hidden;
}
.section-title{
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  color:var(--text-faint); margin: 24px 4px 10px;
}
.section-title:first-child{ margin-top:2px; }

.hero{
  padding: 2px 2px 20px;
}
.hero h1{ font-size:24px; margin:2px 0 5px; font-weight:800; letter-spacing:-.02em; }
.hero p{ margin:0; color:var(--text-dim); font-size:13.5px; }

/* ---------- Quick access dashboard grid ---------- */
.quick-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
  margin-bottom:12px;
}
.quick-tile{
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; gap:9px;
  background:var(--surface-bg); border:1px solid var(--border);
  border-radius:18px; padding:17px 8px 15px; width:100%;
  box-shadow: var(--surface-shadow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.quick-tile:active{
  background:var(--surface-2); transform:scale(.96) translateY(1px);
  box-shadow: 0 4px 10px -6px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
}
.quick-tile .row-icon{ width:44px; height:44px; box-shadow: var(--surface-shadow), 0 6px 14px -6px var(--tile-glow, transparent); }
.quick-label{ font-size:12px; font-weight:600; color:var(--text); }

/* ---------- List rows (hub) ---------- */
.row-list{
  background:var(--surface-bg);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--surface-shadow);
}
.row{
  display:flex; align-items:center; gap:12px;
  width:100%; padding:14px 16px;
  border:none; border-bottom:1px solid var(--border);
  background:transparent;
}
.row:last-child{ border-bottom:none; }
.row:active{ background:var(--surface-2); }
.row-icon{
  width:38px; height:38px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background:var(--accent-soft); color:var(--accent);
  flex:0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.row-icon.neutral{ background:var(--surface-2); color:var(--text-dim); }
/* Official brand logomarks — soft tinted tile, icon rendered in its true brand color */
.row-icon.logo-tile{ background:var(--tile-bg); color:var(--tile-fg); }
.row-icon.logo-tile .icon{ width:24px; height:24px; }
/* Brand / per-tool icon tints */
.row-icon.bg-recon{ background:linear-gradient(135deg,#f0995f,#d9673a); color:#fff; }
.row-icon.bg-maps{ background:linear-gradient(135deg,#a78bfa,#7c5cf0); color:#fff; }
.row-icon.bg-export{ background:linear-gradient(135deg,#34d399,#16a374); color:#fff; }
.row-icon.bg-license{ background:linear-gradient(135deg,#4ade80,#22b866); color:#fff; }
.row .row-body{ flex:1; min-width:0; }
.row .row-title{ font-weight:600; font-size:14.5px; }
.row .row-sub{ font-size:12.5px; color:var(--text-faint); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row .chev{ color:var(--text-faint); flex:0 0 auto; }
.row .row-tag{
  font-size:11px; font-weight:700; color:var(--text-faint);
  background:var(--surface-2); padding:3px 7px; border-radius:6px; flex:0 0 auto;
}

/* ---------- Icons ---------- */
.icon{ display:inline-flex; width:20px; height:20px; }
.icon svg{ width:100%; height:100%; stroke:currentColor; stroke-width:2; fill:none; }
.row-icon .icon{ width:19px; height:19px; }
/* Filled brand-logo icons (VK / Telegram) draw their own color, no stroke outline */
.icon.icon-logo svg{ stroke:none; }

/* ---------- Cards / panels ---------- */
.card{
  background:var(--surface-bg);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:18px;
  margin-bottom:16px;
  box-shadow: var(--surface-shadow);
}
.card p.desc{ color:var(--text-dim); font-size:13.5px; margin:8px 0 0; }
.card h2{ font-size:17px; margin:0; font-weight:700; letter-spacing:-.01em; }

/* connected account banner */
.account-banner{
  display:flex; align-items:center; gap:12px;
  background:var(--surface-bg); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:14px 16px; margin-bottom:16px;
  box-shadow: var(--surface-shadow);
}
.avatar{
  width:42px; height:42px; border-radius:50%;
  background:linear-gradient(135deg,#5b8def,#3f6fd1);
  box-shadow: 0 4px 12px -4px rgba(91,141,239,.5), inset 0 1px 0 rgba(255,255,255,.25);
  flex:0 0 auto;
}
.account-banner .who{ flex:1; min-width:0; }
.account-banner .name{ font-weight:600; font-size:14.5px; }
.account-banner .id{ font-size:12px; color:var(--text-faint); }
.link-btn{
  display:flex; align-items:center; gap:5px;
  font-size:12.5px; font-weight:600; color:var(--red);
  background:var(--red-soft); border:none; padding:8px 10px; border-radius:9px;
  flex:0 0 auto;
}
.link-btn:active{ opacity:.7; }

/* ---------- Buttons ---------- */
.btn{
  display:flex; align-items:center; justify-content:center; gap:7px;
  width:100%; padding:13px 16px; border-radius:var(--radius-md);
  font-size:14.5px; font-weight:600; border:none;
  color:var(--text); background:var(--surface-2);
  border:1px solid var(--border);
}
.btn .icon{ width:17px; height:17px; }
.btn:active{ transform:scale(.98); }
.btn-primary{
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; border:none;
  box-shadow: 0 8px 20px -8px rgba(226,114,63,.55), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary:active{ box-shadow: 0 4px 10px -6px rgba(226,114,63,.5); }
.btn-danger{ color:var(--red); background:var(--red-soft); border:1px solid transparent; }
.btn-ghost{ background:transparent; border:1px solid var(--border); color:var(--text-dim); }
.btn[disabled]{ opacity:.45; }
.btn-row{ display:flex; flex-direction:column; gap:9px; margin-bottom:16px; }

/* ---------- Tabs (segmented, scrollable) ---------- */
.tabs{
  display:flex; gap:4px; overflow-x:auto; padding:2px 2px 12px;
  -ms-overflow-style:none; scrollbar-width:none;
  touch-action:pan-x; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain;
}
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  flex:0 0 auto; white-space:nowrap;
  font-size:13px; font-weight:600; color:var(--text-dim);
  background:transparent; border:1px solid transparent;
  padding:9px 13px; border-radius:100px;
  display:flex; align-items:center; gap:6px;
  transition: background .15s ease, color .15s ease;
}
.tab.active{ background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.tab .icon{ width:15px; height:15px; }

/* ---------- Search ---------- */
.search-bar{
  display:flex; align-items:center; gap:9px;
  background:var(--surface-bg); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:0 14px; margin-bottom:12px;
  box-shadow: var(--surface-shadow);
  transition: border-color .15s ease;
}
.search-bar:focus-within{ border-color: rgba(226,114,63,.45); }
.search-bar .icon{ color:var(--text-faint); flex:0 0 auto; }
.search-bar input{
  flex:1; border:none; background:transparent; color:var(--text);
  padding:13px 0; font-size:16px; outline:none; min-width:0;
  user-select:text;
}
.search-bar input::placeholder{ color:var(--text-faint); }

/* ---------- Empty state ---------- */
.empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:44px 20px;
  background:var(--surface-bg); border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow: var(--surface-shadow);
}
.empty .icon-lg{
  width:48px; height:48px; border-radius:50%;
  background:var(--surface-2); color:var(--text-faint);
  display:flex; align-items:center; justify-content:center; margin-bottom:12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 10px -6px rgba(0,0,0,.4);
}
.empty .icon-lg .icon{ width:22px; height:22px; }
.empty .t{ font-weight:600; font-size:14.5px; margin-bottom:3px; }
.empty .s{ font-size:12.5px; color:var(--text-faint); max-width:230px; }

/* ---------- Settings rows ---------- */
.setting-row{
  display:flex; align-items:center; gap:12px;
  padding:15px 16px; border-bottom:1px solid var(--border);
}
.setting-row:last-child{ border-bottom:none; }
.setting-row .info{ flex:1; min-width:0; }
.setting-row .info .t{ font-weight:600; font-size:14px; }
.setting-row .info .s{ font-size:12px; color:var(--text-faint); margin-top:2px; }

.segmented{
  display:flex; background:var(--surface-2); border-radius:10px; padding:3px; flex:0 0 auto;
}
.segmented button{
  border:none; background:transparent; color:var(--text-dim);
  font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:8px;
}
.segmented button.active{ background:var(--accent); color:#fff; }

.switch{
  position:relative; width:44px; height:26px; flex:0 0 auto;
  background:var(--surface-2); border-radius:100px; border:1px solid var(--border);
}
.switch.on{ background:var(--accent); border-color:var(--accent); }
.switch .knob{
  position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%;
  background:#fff; transition:transform .15s ease;
}
.switch.on .knob{ transform:translateX(18px); }

/* ---------- License ---------- */
.status-banner{
  display:flex; align-items:center; gap:10px;
  background:linear-gradient(135deg, rgba(62,207,107,.16), rgba(62,207,107,.07));
  border:1px solid rgba(62,207,107,.18);
  color:var(--green);
  border-radius:var(--radius-md); padding:14px 16px; margin-bottom:16px;
  font-size:13.5px; font-weight:600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.status-banner .icon{ width:18px; height:18px; flex:0 0 auto; }
.field-label{ font-size:11px; font-weight:700; letter-spacing:.05em; color:var(--text-faint); margin:0 2px 8px; text-transform:uppercase; }
.hwid-row{
  display:flex; align-items:center; gap:10px;
  background:var(--surface-bg); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:13px 14px; margin-bottom:10px;
  box-shadow: var(--surface-shadow);
}
.hwid-row code{
  flex:1; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px; color:var(--text); word-break:break-all; user-select:text;
}
.copy-btn{
  flex:0 0 auto; display:flex; align-items:center; gap:5px;
  background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  font-size:12px; font-weight:600; padding:8px 10px; border-radius:8px;
}
.copy-btn.copied{ background:var(--green-soft); color:var(--green); border-color:transparent; }
.note{ font-size:12px; color:var(--text-faint); margin: 0 2px; }

/* ---------- Bottom nav — floating glass dock ---------- */
.bottomnav{
  position:fixed; left:16px; right:16px; bottom: calc(var(--safe-bottom) + 14px); z-index:30;
  display:flex; justify-content:space-around; align-items:center;
  padding: 8px 6px;
  border-radius:24px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(50,50,56,.36), rgba(14,14,17,.46));
  -webkit-backdrop-filter:blur(32px) saturate(240%);
  backdrop-filter:blur(32px) saturate(240%);
  border:1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(0,0,0,.15);
  transition: transform .18s ease, opacity .18s ease;
}
/* While an input is focused the on-screen keyboard resizes the viewport, which drags this
   fixed bar up and makes it look like it's floating above the keyboard — just hide it instead. */
body.kb-open .bottomnav{
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}
.navbtn{
  position:relative;
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:2px; color:var(--text-faint); background:transparent; border:none;
  font-size:10px; font-weight:600; max-width:76px;
}
/* Diffused colour glow bleeding into the frosted glass behind each icon — no shape, just colour */
.navbtn::before{
  content:''; position:absolute; left:50%; top:44%;
  width:34px; height:34px; border-radius:50%;
  background:var(--tint, transparent);
  filter:blur(13px);
  opacity:0;
  transform:translate(-50%,-50%) scale(.7);
  transition:opacity .22s ease, transform .22s ease;
  z-index:0; pointer-events:none;
}
.navbtn.active::before{ opacity:.65; transform:translate(-50%,-50%) scale(1.25); }
.navbtn .navicon{
  position:relative; z-index:1;
  width:40px; height:29px;
  display:flex; align-items:center; justify-content:center;
}
.navbtn .icon{ width:21px; height:21px; transition: color .18s ease; }
.navlabel{ position:relative; z-index:1; transition: color .18s ease; }
.navbtn.active{ color:var(--text); }
.navbtn.active .icon{ color: var(--tint, var(--accent)); }

/* ---------- Sheet (more menu) ---------- */
.sheet-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:40;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.sheet-backdrop.open{ opacity:1; pointer-events:auto; }
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:41;
  background:linear-gradient(180deg, rgba(40,40,45,.7), rgba(14,14,16,.82));
  -webkit-backdrop-filter:blur(34px) saturate(200%);
  backdrop-filter:blur(34px) saturate(200%);
  border-radius:22px 22px 0 0;
  border:1px solid rgba(255,255,255,.12); border-bottom:none;
  padding: 0 16px calc(var(--safe-bottom) + 18px);
  transform:translateY(100%); transition:transform .28s cubic-bezier(.32,.72,0,1);
  touch-action:none;
}
.sheet.open{ transform:translateY(0); }
.sheet.dragging{ transition:none; }
.sheet .sheet-handle{ padding:10px 0 4px; cursor:grab; }
.sheet .grabber{ width:38px; height:5px; background:rgba(255,255,255,.22); border-radius:100px; margin:0 auto 12px; }
.sheet .sheet-title{ font-weight:700; font-size:15px; margin:2px 4px 10px; touch-action:auto; }
.sheet .row-list{ touch-action:auto; }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:96px; transform:translateX(-50%) translateY(10px);
  background:#1f1f22; border:1px solid var(--border); color:var(--text);
  padding:10px 16px; border-radius:100px; font-size:13px; font-weight:600;
  z-index:60; opacity:0; transition:opacity .18s ease, transform .18s ease;
  pointer-events:none; white-space:nowrap;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* page transition */
.page-enter{ animation:fadeUp .18s ease; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none; } }

::selection{ background:var(--accent-soft); }

/* ---------- Small-phone fit (iPhone SE, compact Android, ~360px and under) ---------- */
@media (max-width: 360px){
  .topbar{ padding-left:14px; padding-right:14px; gap:8px; }
  .content{ padding-left:14px; padding-right:14px; }
  .hero h1{ font-size:21px; }
  .quick-grid{ gap:8px; }
  .quick-tile{ padding:13px 6px 12px; }
  .quick-label{ font-size:11.5px; }
  .bottomnav{ left:10px; right:10px; padding:7px 4px; }
  .navbtn{ font-size:9.5px; }
  .navbtn .navicon{ width:36px; }
}

/* ---------- Large-phone breathing room (6.5"+, ~430px and up) ---------- */
@media (min-width: 430px){
  .quick-tile{ padding:18px 8px 16px; }
  .row-icon{ width:40px; height:40px; }
}
