/* ============================================================
   varzytines.com — app.css (dashboard + demo)
   Dizaino sistema pagal SPEC v1. Mobile-first.
   ============================================================ */

:root {
  /* Fonas — gilesnis, su subtiliu mėlynu atspalviu */
  --bg-0:#07070d; --bg-1:#0c0c14; --bg-2:#13131d; --bg-3:#1a1a26;
  --border:rgba(255,255,255,0.07); --border-strong:rgba(255,255,255,0.14);
  --text:#f5f5f7; --text-2:#b4b4c0; --text-3:#8a8a9a;
  /* Akcentas — violetinė→mėlyna (esamas brand) */
  --accent:#8b5cf6; --accent-2:#a855f7; --accent-3:#6366f1; --accent-4:#3b82f6;
  --grad:linear-gradient(135deg,#8b5cf6 0%,#6366f1 50%,#3b82f6 100%);
  /* Verdiktai */
  --buy:#22c55e; --buy-bg:rgba(34,197,94,0.12);
  --check:#f59e0b; --check-bg:rgba(245,158,11,0.12);
  --reject:#64748b; --reject-bg:rgba(100,116,139,0.10);
  --danger:#ef4444;
  --radius:12px; --radius-lg:18px;
  --font:'Inter',-apple-system,system-ui,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;

  /* Išvestiniai (ne SPEC tokenai) */
  --header-h:56px;
  --shadow-lg:0 32px 64px -16px rgba(0,0,0,0.7);
  --shadow-md:0 12px 32px -8px rgba(0,0,0,0.55);
}

/* ---------- Bazė ---------- */
*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--bg-0); color:var(--text);
  font-family:var(--font); font-size:15px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4 { margin:0; line-height:1.25; }
p { margin:0; }
a { color:var(--accent-2); text-decoration:none; }
a:hover { text-decoration:underline; }
img { max-width:100%; display:block; }
button { font-family:inherit; }
[hidden] { display:none !important; }

.mono, .num {
  font-family:var(--mono);
  font-variant-numeric:tabular-nums;
}

:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:4px;
}

::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-track { background:var(--bg-0); }
::-webkit-scrollbar-thumb { background:var(--bg-3); border-radius:6px; border:2px solid var(--bg-0); }

.visually-hidden {
  position:absolute; width:1px; height:1px; margin:-1px;
  clip:rect(0 0 0 0); overflow:hidden; white-space:nowrap;
}

/* ---------- Mygtukai ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:10px 16px;
  border-radius:10px; border:1px solid var(--border);
  background:var(--bg-2); color:var(--text);
  font-size:0.9rem; font-weight:500; cursor:pointer;
  transition:background 160ms, border-color 160ms, transform 160ms, opacity 160ms;
  white-space:nowrap;
}
.btn:hover { background:var(--bg-3); border-color:var(--border-strong); }
.btn:disabled { opacity:0.5; cursor:not-allowed; }
.btn svg { width:18px; height:18px; flex:none; }

.btn-primary {
  background:var(--grad); border:0; color:#fff; font-weight:600;
}
.btn-primary:hover { background:var(--grad); filter:brightness(1.12); }

.btn-ghost { background:transparent; border-color:transparent; color:var(--text-2); }
.btn-ghost:hover { background:var(--bg-2); color:var(--text); border-color:transparent; }

.btn-danger { color:var(--danger); border-color:rgba(239,68,68,0.3); background:rgba(239,68,68,0.08); }
.btn-danger:hover { background:rgba(239,68,68,0.16); border-color:rgba(239,68,68,0.5); }

.btn-icon {
  width:44px; min-width:44px; height:44px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.btn-sm { min-height:36px; padding:6px 12px; font-size:0.85rem; }

/* ---------- Header ---------- */
.app-header {
  position:sticky; top:0; z-index:60;
  height:var(--header-h);
  display:flex; align-items:center; gap:10px;
  padding:0 14px;
  background:rgba(12,12,20,0.88);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.app-logo {
  display:flex; align-items:center; gap:8px;
  font-weight:800; font-size:1.02rem; letter-spacing:-0.01em;
  color:var(--text); text-decoration:none;
}
.app-logo:hover { text-decoration:none; }
.app-logo .logo-mark {
  width:28px; height:28px; border-radius:8px; flex:none;
  background:var(--grad);
  display:grid; place-items:center; color:#fff;
}
.app-logo .logo-mark svg { width:16px; height:16px; }
.app-logo .logo-ai {
  background:var(--grad);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.header-spacer { flex:1; }
.header-user { color:var(--text-3); font-size:0.82rem; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.select {
  min-height:44px; padding:8px 34px 8px 12px;
  background:var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border:1px solid var(--border); border-radius:10px;
  color:var(--text); font-family:inherit; font-size:0.9rem;
  appearance:none; -webkit-appearance:none; cursor:pointer;
}
.select:hover { border-color:var(--border-strong); }

/* ---------- Toolbar ---------- */
.toolbar {
  position:sticky; top:var(--header-h); z-index:50;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 14px;
  background:rgba(7,7,13,0.92);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.toolbar-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; width:100%; }

.view-toggle {
  display:inline-flex; padding:3px; gap:2px;
  background:var(--bg-2); border:1px solid var(--border); border-radius:11px;
}
.view-toggle button {
  display:inline-flex; align-items:center; gap:7px;
  min-height:38px; padding:6px 14px;
  border:0; border-radius:8px; background:transparent;
  color:var(--text-2); font-size:0.88rem; font-weight:500; cursor:pointer;
  transition:background 160ms, color 160ms;
}
.view-toggle button svg { width:16px; height:16px; }
.view-toggle button[aria-pressed="true"] {
  background:var(--grad); color:#fff; font-weight:600;
}

/* Filtrai (desktop — toolbar'e; mobile — perkeliami į sheet) */
.filters {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.filters .select, .filters .input { min-width:0; }

.input {
  min-height:44px; padding:8px 12px;
  background:var(--bg-2); border:1px solid var(--border); border-radius:10px;
  color:var(--text); font-family:inherit; font-size:0.9rem;
  width:100%;
}
.input::placeholder { color:var(--text-3); }
.input:hover { border-color:var(--border-strong); }
.input.num { font-family:var(--mono); font-variant-numeric:tabular-nums; }

.field { display:grid; gap:6px; }
.field > label { font-size:0.8rem; color:var(--text-2); font-weight:500; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field .hint { font-size:0.75rem; color:var(--text-3); }

/* Range slider */
.range-wrap { display:flex; align-items:center; gap:10px; min-width:170px; }
.range-wrap output { font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:0.85rem; color:var(--text-2); min-width:42px; text-align:right; }
input[type="range"] {
  -webkit-appearance:none; appearance:none;
  flex:1; height:44px; background:transparent; cursor:pointer; margin:0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height:4px; border-radius:2px;
  background:linear-gradient(to right, var(--accent) var(--fill,0%), var(--bg-3) var(--fill,0%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
  background:var(--accent); border:2px solid var(--bg-0);
  margin-top:-7px;
}
input[type="range"]::-moz-range-track { height:4px; border-radius:2px; background:var(--bg-3); }
input[type="range"]::-moz-range-progress { height:4px; border-radius:2px; background:var(--accent); }
input[type="range"]::-moz-range-thumb {
  width:14px; height:14px; border-radius:50%;
  background:var(--accent); border:2px solid var(--bg-0);
}

/* Multi-select dropdown (savivaldybės) */
.dropdown { position:relative; }
.dropdown-menu {
  position:absolute; top:calc(100% + 6px); left:0; z-index:70;
  min-width:230px; max-height:320px; overflow:auto;
  background:var(--bg-2); border:1px solid var(--border-strong);
  border-radius:var(--radius); padding:6px;
  box-shadow:var(--shadow-lg);
}
.dropdown-menu.menu-right { left:auto; right:0; }
.check-item {
  display:flex; align-items:center; gap:10px;
  min-height:44px; padding:6px 10px; border-radius:8px;
  font-size:0.88rem; color:var(--text-2); cursor:pointer; user-select:none;
}
.check-item:hover { background:var(--bg-3); color:var(--text); }
.check-item input { accent-color:var(--accent); width:16px; height:16px; flex:none; }

/* ---------- Chips ---------- */
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.chip {
  display:inline-flex; align-items:center; gap:6px;
  min-height:44px; padding:8px 14px;
  border-radius:999px; border:1px solid var(--border);
  background:var(--bg-2); color:var(--text-2);
  font-size:0.84rem; font-weight:500; cursor:pointer;
  transition:background 160ms, border-color 160ms, color 160ms;
}
.chip svg { width:15px; height:15px; }
.chip:hover { border-color:var(--border-strong); color:var(--text); }
.chip[aria-pressed="true"] {
  background:rgba(139,92,246,0.16); border-color:var(--accent);
  color:#d6c6ff;
}
.chip .num { font-size:0.8rem; }

/* ---------- Statuso juosta ---------- */
.results-bar {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:12px 14px 0; color:var(--text-3); font-size:0.84rem;
}
.results-bar strong { color:var(--text-2); font-weight:600; }

/* ---------- Kortelių grid ---------- */
.cards-grid {
  display:grid; grid-template-columns:1fr; gap:14px;
  padding:14px;
}
@media (min-width:700px)  { .cards-grid { grid-template-columns:repeat(2,1fr); } }
@media (min-width:1100px) { .cards-grid { grid-template-columns:repeat(3,1fr); gap:16px; padding:16px; } }
@media (min-width:1700px) { .cards-grid { grid-template-columns:repeat(4,1fr); } }

/* ---------- Kortelė ---------- */
.card {
  position:relative; display:flex; flex-direction:column;
  background:var(--bg-1); border:1px solid var(--border);
  border-radius:var(--radius-lg); overflow:hidden;
  transition:transform 180ms, border-color 180ms, box-shadow 180ms;
  cursor:pointer;
}
.card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.card[data-verdict="PIRKTI"]:hover   { border-color:var(--buy); }
.card[data-verdict="TIKRINTI"]:hover { border-color:var(--check); }
.card[data-verdict="ATMESTA"]:hover, .card[data-verdict="PRALEISTI"]:hover { border-color:var(--reject); }
.card[data-verdict="STEBĖTI"]:hover { border-color:#3b82f6; }
.card:hover { border-color:var(--border-strong); }

.card-media {
  position:relative; aspect-ratio:16/9; background:var(--bg-2); overflow:hidden;
}
.card-media img { width:100%; height:100%; object-fit:cover; }
.card-media .ph {
  width:100%; height:100%;
  display:grid; place-items:center; color:rgba(255,255,255,0.45);
  background:linear-gradient(135deg, rgba(139,92,246,0.25), rgba(99,102,241,0.18) 50%, rgba(59,130,246,0.22));
}
.card-media .ph svg { width:42px; height:42px; }

.pill {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 11px; border-radius:999px;
  font-size:0.72rem; font-weight:700; letter-spacing:0.06em;
  text-transform:uppercase;
}
.pill-PIRKTI   { background:var(--buy-bg);   color:var(--buy);   border:1px solid rgba(34,197,94,0.35); }
.pill-TIKRINTI { background:var(--check-bg); color:var(--check); border:1px solid rgba(245,158,11,0.35); }
.pill-ATMESTA, .pill-PRALEISTI { background:var(--reject-bg);color:var(--reject);border:1px solid rgba(100,116,139,0.35); }
.pill-STEBĖTI { background:rgba(59,130,246,0.12);color:#3b82f6;border:1px solid rgba(59,130,246,0.35); }
.card-media .pill { position:absolute; top:10px; left:10px; backdrop-filter:blur(6px); }

.card-star {
  position:absolute; top:8px; right:8px;
  width:44px; height:44px; border-radius:12px; border:0;
  display:grid; place-items:center; cursor:pointer;
  background:rgba(7,7,13,0.55); color:#fff;
  backdrop-filter:blur(6px);
  transition:background 160ms, color 160ms, transform 160ms;
}
.card-star:hover { background:rgba(7,7,13,0.8); transform:scale(1.06); }
.card-star svg { width:20px; height:20px; }
.card-star[aria-pressed="true"] { color:var(--check); }
.card-star[aria-pressed="true"] svg { fill:var(--check); }

.card-body { display:flex; flex-direction:column; gap:10px; padding:14px; flex:1; }
.card-title {
  font-size:0.95rem; font-weight:600; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  min-height:2.6em;
}
.card-loc {
  display:flex; align-items:center; gap:6px;
  color:var(--text-3); font-size:0.8rem;
}
.card-loc svg { width:13px; height:13px; flex:none; }

.card-stats {
  display:grid; grid-template-columns:1fr 1fr; gap:8px 14px;
  padding:10px 12px; border-radius:10px;
  background:var(--bg-2); border:1px solid var(--border);
}
.stat { display:grid; gap:1px; min-width:0; }
.stat .lbl { font-size:0.68rem; color:var(--text-3); text-transform:uppercase; letter-spacing:0.05em; }
.stat .val {
  font-family:var(--mono); font-variant-numeric:tabular-nums;
  font-size:0.92rem; font-weight:600; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.stat .val.pos { color:var(--buy); }
.stat .val.neg { color:var(--danger); }
.stat .val.warn { color:var(--check); }

/* Progresas iki pabaigos */
.deadline { display:grid; gap:5px; }
.deadline-row { display:flex; justify-content:space-between; align-items:baseline; font-size:0.76rem; color:var(--text-3); }
.deadline-row .left { font-family:var(--mono); font-variant-numeric:tabular-nums; color:var(--text-2); font-weight:500; }
.deadline-row .left.urgent { color:var(--danger); }
.deadline-row .left.soon { color:var(--check); }
.progress { height:4px; border-radius:2px; background:var(--bg-3); overflow:hidden; }
.progress > span { display:block; height:100%; border-radius:2px; background:var(--accent-3); transition:width 300ms; }
.progress > span.soon { background:var(--check); }
.progress > span.urgent { background:var(--danger); }

.card-actions { display:flex; gap:8px; margin-top:auto; }
.card-actions .btn { flex:1; min-height:40px; font-size:0.84rem; }

/* ---------- Žemėlapis ---------- */
.map-wrap {isolation:isolate;
  position:relative;
  height:calc(100vh - var(--header-h) - 65px);
  min-height:420px;
}
#map, .leaflet-host { width:100%; height:100%; background:var(--bg-0); }
.leaflet-container { background:#0a0a12; font-family:var(--font); }
.leaflet-control-zoom a {
  background:var(--bg-2) !important; color:var(--text) !important;
  border-color:var(--border) !important;
  width:38px !important; height:38px !important; line-height:38px !important;
}
.leaflet-control-attribution {
  background:rgba(12,12,20,0.8) !important; color:var(--text-3) !important; font-size:10px !important;
}
.leaflet-control-attribution a { color:var(--text-2) !important; }

.map-note {
  position:absolute; left:50%; bottom:18px; transform:translateX(-50%);
  z-index:1000; max-width:min(92%, 480px);
  display:flex; align-items:center; gap:10px;
  padding:12px 16px; border-radius:var(--radius);
  background:rgba(19,19,29,0.94); border:1px solid rgba(139,92,246,0.45);
  box-shadow:var(--shadow-lg);
  font-size:0.84rem; color:var(--text-2);
  backdrop-filter:blur(10px);
}
.map-note svg { width:18px; height:18px; color:var(--accent-2); flex:none; }
.map-note a { font-weight:600; }

/* Markeriai ir clusteriai */
.vz-marker { background:transparent; border:0; }
.vz-marker .dot {
  width:16px; height:16px; border-radius:50%;
  border:2px solid rgba(255,255,255,0.85);
  box-shadow:0 0 0 4px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.6);
}
.vz-marker .dot.v-PIRKTI   { background:var(--buy); }
.vz-marker .dot.v-TIKRINTI { background:var(--check); }
.vz-marker .dot.v-ATMESTA, .vz-marker .dot.v-PRALEISTI { background:var(--reject); }
.vz-marker .dot.v-STEBĖTI { background:#3b82f6; }

.vz-cluster { background:transparent; border:0; }
.vz-cluster .bubble {
  display:grid; place-items:center;
  width:40px; height:40px; border-radius:50%;
  font-family:var(--mono); font-variant-numeric:tabular-nums;
  font-weight:700; font-size:0.82rem; color:#fff;
  border:2px solid rgba(255,255,255,0.85);
  box-shadow:0 0 0 5px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.55);
}
.vz-cluster .bubble.v-PIRKTI   { background:var(--buy); }
.vz-cluster .bubble.v-TIKRINTI { background:var(--check); color:#1a1206; }
.vz-cluster .bubble.v-ATMESTA, .vz-cluster .bubble.v-PRALEISTI { background:var(--reject); }
.vz-cluster .bubble.v-STEBĖTI { background:#3b82f6; }

/* Šoninis panelis (desktop) */
.side-panel {
  position:absolute; top:0; right:0; bottom:0; z-index:1001;
  width:380px; max-width:92vw;
  background:var(--bg-1); border-left:1px solid var(--border-strong);
  box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column;
  transform:translateX(105%);
  transition:transform 240ms cubic-bezier(0.32,0.72,0.25,1);
}
.side-panel.open { transform:translateX(0); }
.panel-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px; border-bottom:1px solid var(--border); flex:none;
}
.panel-head h3 { font-size:0.92rem; color:var(--text-2); font-weight:600; }
.panel-body { overflow-y:auto; padding:14px; flex:1; }
.panel-body .card { cursor:default; }
.panel-body .card:hover { transform:none; }

/* ---------- Bottom sheet (mobile) ---------- */
.sheet-backdrop {
  position:fixed; inset:0; z-index:1190;
  background:rgba(0,0,0,0.6); backdrop-filter:blur(3px);
  opacity:0; pointer-events:none; transition:opacity 200ms;
}
.sheet-backdrop.open { opacity:1; pointer-events:auto; }
.sheet {
  position:fixed; left:0; right:0; bottom:0; z-index:1195;
  max-height:84vh; display:flex; flex-direction:column;
  background:var(--bg-1); border:1px solid var(--border-strong); border-bottom:0;
  border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:0 -20px 60px rgba(0,0,0,0.6);
  transform:translateY(105%);
  transition:transform 260ms cubic-bezier(0.32,0.72,0.25,1);
  padding-bottom:env(safe-area-inset-bottom);
}
.sheet.open { transform:translateY(0); }
.sheet-handle {
  width:44px; height:5px; border-radius:3px;
  background:var(--border-strong); margin:10px auto 4px; flex:none;
}
.sheet-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 16px 10px; border-bottom:1px solid var(--border); flex:none;
}
.sheet-head h3 { font-size:1rem; }
.sheet-body { overflow-y:auto; padding:16px; display:grid; gap:16px; }
.sheet-foot { padding:12px 16px; border-top:1px solid var(--border); display:flex; gap:10px; flex:none; }
.sheet-foot .btn { flex:1; }

/* Filtrai sheet'e — vertikalus layout */
.sheet .filters { flex-direction:column; align-items:stretch; }
.sheet .filters > * { width:100%; }
.sheet .dropdown-menu { position:static; max-height:240px; min-width:0; box-shadow:none; margin-top:6px; }

/* ---------- Modal ---------- */
.modal {
  position:fixed; inset:0; z-index:1200;
  display:grid; place-items:center; padding:16px;
  background:rgba(0,0,0,0.72); backdrop-filter:blur(8px);
  opacity:0; pointer-events:none; transition:opacity 200ms;
}
.modal.open { opacity:1; pointer-events:auto; }
.modal-box {
  width:100%; max-width:560px; max-height:90vh;
  display:flex; flex-direction:column;
  background:var(--bg-1); border:1px solid var(--border-strong);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  transform:translateY(14px) scale(0.985);
  transition:transform 220ms cubic-bezier(0.32,0.72,0.25,1);
}
.modal.open .modal-box { transform:none; }
.modal-box.wide { max-width:760px; }
.modal-head {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:16px 20px; border-bottom:1px solid var(--border); flex:none;
}
.modal-head h2 { font-size:1.1rem; }
.modal-body { overflow-y:auto; padding:20px; display:grid; gap:16px; }
.modal-foot {
  display:flex; gap:10px; justify-content:flex-end;
  padding:14px 20px; border-top:1px solid var(--border); flex:none;
}

/* ---------- Detali kortelė (modal turinys) ---------- */
.detail-hero { position:relative; border-radius:var(--radius); overflow:hidden; aspect-ratio:16/8; background:var(--bg-2); }
.detail-hero img { width:100%; height:100%; object-fit:cover; }
.detail-hero .ph { width:100%; height:100%; display:grid; place-items:center; color:rgba(255,255,255,0.4);
  background:linear-gradient(135deg, rgba(139,92,246,0.25), rgba(59,130,246,0.2)); }
.detail-hero .ph svg { width:52px; height:52px; }
.detail-hero .pill { position:absolute; top:12px; left:12px; }

.detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
@media (min-width:560px) { .detail-grid { grid-template-columns:repeat(3,1fr); } }
.detail-stat {
  padding:10px 12px; border-radius:10px;
  background:var(--bg-2); border:1px solid var(--border); display:grid; gap:2px;
}
.detail-stat .lbl { font-size:0.68rem; color:var(--text-3); text-transform:uppercase; letter-spacing:0.05em; }
.detail-stat .val { font-family:var(--mono); font-variant-numeric:tabular-nums; font-weight:600; font-size:0.98rem; }
.detail-stat .val.pos { color:var(--buy); }
.detail-stat .val.warn { color:var(--check); }

.ai-box {
  padding:14px 16px; border-radius:var(--radius);
  background:rgba(139,92,246,0.08); border:1px solid rgba(139,92,246,0.3);
  display:grid; gap:8px;
}
.ai-box .ai-head { display:flex; align-items:center; gap:8px; font-weight:600; font-size:0.88rem; color:#d6c6ff; }
.ai-box .ai-head svg { width:16px; height:16px; }
.ai-box p { color:var(--text-2); font-size:0.88rem; line-height:1.55; }

.risk-line { display:flex; align-items:center; gap:8px; font-size:0.85rem; color:var(--text-2); }
.risk-line svg { width:15px; height:15px; color:var(--check); flex:none; }
.risk-line.high svg { color:var(--danger); }

.mini-map { height:200px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); }

/* ---------- Alertų panelis ---------- */
.alerts-pop {
  position:absolute; top:calc(100% + 8px); right:0; z-index:75;
  width:340px; max-width:92vw; max-height:420px; overflow-y:auto;
  background:var(--bg-2); border:1px solid var(--border-strong);
  border-radius:var(--radius); box-shadow:var(--shadow-lg); padding:10px;
}
.alert-item {
  display:flex; align-items:center; gap:10px;
  padding:10px; border-radius:10px;
}
.alert-item:hover { background:var(--bg-3); }
.alert-item .meta { flex:1; min-width:0; }
.alert-item .name { font-weight:600; font-size:0.88rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alert-item .crit { font-size:0.75rem; color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alert-item.inactive .name { color:var(--text-3); }

/* Toggle switch */
.switch { position:relative; display:inline-flex; flex:none; width:40px; height:24px; cursor:pointer; }
.switch input { position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.switch .track {
  width:100%; height:100%; border-radius:999px;
  background:var(--bg-3); border:1px solid var(--border-strong);
  transition:background 160ms;
}
.switch .track::after {
  content:""; position:absolute; top:3px; left:3px;
  width:18px; height:18px; border-radius:50%; background:var(--text-3);
  transition:transform 160ms, background 160ms;
}
.switch input:checked + .track { background:rgba(139,92,246,0.5); border-color:var(--accent); }
.switch input:checked + .track::after { transform:translateX(16px); background:#fff; }
.switch input:focus-visible + .track { outline:2px solid var(--accent); outline-offset:2px; }

/* Kanalų pasirinkimas */
.channel-row { display:flex; gap:10px; flex-wrap:wrap; }
.channel-opt {
  display:flex; align-items:center; gap:8px; flex:1;
  min-height:44px; padding:8px 14px;
  border:1px solid var(--border); border-radius:10px;
  background:var(--bg-2); cursor:pointer; font-size:0.88rem; color:var(--text-2);
  user-select:none;
}
.channel-opt:has(input:checked) { border-color:var(--accent); background:rgba(139,92,246,0.12); color:var(--text); }
.channel-opt input { accent-color:var(--accent); width:16px; height:16px; }

/* ---------- Tuščios būsenos ---------- */
.empty-state {
  grid-column:1/-1;
  display:grid; place-items:center; gap:14px;
  text-align:center; padding:60px 24px;
}
.empty-state .icon {
  width:64px; height:64px; border-radius:18px;
  display:grid; place-items:center;
  background:var(--bg-2); border:1px solid var(--border); color:var(--text-3);
}
.empty-state .icon svg { width:30px; height:30px; }
.empty-state h3 { font-size:1.05rem; }
.empty-state p { color:var(--text-3); font-size:0.9rem; max-width:420px; line-height:1.6; }
.empty-state .actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }

/* ---------- Onboarding tour ---------- */
.tour-overlay { position:fixed; inset:0; z-index:1400; pointer-events:none; }
.tour-overlay.active { pointer-events:auto; }
.tour-spot {
  position:fixed; z-index:1401; border-radius:12px;
  box-shadow:0 0 0 9999px rgba(0,0,0,0.74), 0 0 0 3px var(--accent);
  transition:all 280ms cubic-bezier(0.32,0.72,0.25,1);
  pointer-events:none;
}
.tour-tip {
  position:fixed; z-index:1402;
  width:320px; max-width:calc(100vw - 24px);
  background:var(--bg-1); border:1px solid rgba(139,92,246,0.5);
  border-radius:var(--radius-lg); padding:18px;
  box-shadow:var(--shadow-lg);
  display:grid; gap:10px;
}
.tour-tip .step-no { font-family:var(--mono); font-size:0.72rem; color:var(--accent-2); letter-spacing:0.08em; }
.tour-tip h4 { font-size:1rem; }
.tour-tip p { color:var(--text-2); font-size:0.87rem; line-height:1.55; }
.tour-tip .tour-nav { display:flex; align-items:center; gap:8px; margin-top:4px; }
.tour-tip .tour-nav .spacer { flex:1; }
.tour-dots { display:flex; gap:5px; }
.tour-dots span { width:7px; height:7px; border-radius:50%; background:var(--bg-3); }
.tour-dots span.on { background:var(--accent); }

/* ---------- Toast ---------- */
.toast-host {
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%);
  z-index:1500; display:grid; gap:8px; width:min(92vw, 420px);
  pointer-events:none;
}
.toast {
  display:flex; align-items:center; gap:10px;
  padding:12px 16px; border-radius:var(--radius);
  background:var(--bg-2); border:1px solid var(--border-strong);
  box-shadow:var(--shadow-lg); font-size:0.88rem;
  animation:toast-in 240ms cubic-bezier(0.32,0.72,0.25,1);
  pointer-events:auto;
}
.toast.ok { border-color:rgba(34,197,94,0.45); }
.toast.err { border-color:rgba(239,68,68,0.5); }
.toast svg { width:17px; height:17px; flex:none; }
.toast.ok svg { color:var(--buy); }
.toast.err svg { color:var(--danger); }
@keyframes toast-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ---------- Skeleton ---------- */
.skel-card { border-radius:var(--radius-lg); background:var(--bg-1); border:1px solid var(--border); overflow:hidden; }
.skel-card .sk-img { aspect-ratio:16/9; background:var(--bg-2); }
.skel-card .sk-body { padding:14px; display:grid; gap:10px; }
.skel-line { height:13px; border-radius:6px; background:var(--bg-2); }
.skel-line.w60 { width:60%; }
@keyframes skel-pulse { 0%,100% { opacity:1; } 50% { opacity:0.45; } }
.skel-card { animation:skel-pulse 1.6s ease-in-out infinite; }

/* ---------- DEMO elementai ---------- */
.demo-badge {
  display:inline-flex; align-items:center; gap:7px;
  padding:5px 12px; border-radius:999px;
  background:rgba(245,158,11,0.14); border:1px solid rgba(245,158,11,0.45);
  color:var(--check); font-size:0.74rem; font-weight:700;
  letter-spacing:0.06em; text-transform:uppercase; white-space:nowrap;
}
.demo-badge svg { width:13px; height:13px; }

.demo-ctabar {
  position:fixed; left:12px; right:12px; bottom:12px; z-index:1180;
  max-width:680px; margin:0 auto;
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:14px 18px; border-radius:var(--radius-lg);
  background:rgba(19,19,29,0.97); border:1px solid rgba(139,92,246,0.5);
  box-shadow:var(--shadow-lg); backdrop-filter:blur(12px);
  transform:translateY(130%); transition:transform 300ms cubic-bezier(0.32,0.72,0.25,1);
  padding-bottom:max(14px, env(safe-area-inset-bottom));
}
.demo-ctabar.show { transform:none; }
.demo-ctabar .txt { flex:1; min-width:200px; }
.demo-ctabar .txt strong { display:block; font-size:0.92rem; }
.demo-ctabar .txt span { color:var(--text-3); font-size:0.8rem; }

/* ---------- Responsive ---------- */
.only-mobile { display:initial; }
.only-desktop { display:none !important; }
@media (min-width:768px) {
  .only-mobile { display:none !important; }
  .only-desktop { display:initial !important; }
  .toolbar { padding:10px 16px; }
}

@media (max-width:767px) {
  .app-header { padding:0 10px; gap:6px; }
  .header-user { display:none; }
  .map-wrap { height:calc(100vh - var(--header-h) - 64px); height:calc(100dvh - var(--header-h) - 64px); }
  .side-panel { display:none; }
  .modal { padding:0; align-items:end; }
  .modal-box { max-width:100%; max-height:94vh; border-radius:var(--radius-lg) var(--radius-lg) 0 0; border-bottom:0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
    scroll-behavior:auto !important;
  }
  .card:hover { transform:none; }
  .skel-card { animation:none; }
}
