:root {
  --bg: #f6f6f8; --panel: #ffffff; --panel2: #f0f0f4; --line: #e3e3ea; --text: #15161c; --muted: #6b6e7b; --faint: #9a9caa;
  --accent: #5b5bf7; --accent-ink: #ffffff; --accent-soft: #ececfe;
  --good: #14915a; --warn: #b7791f; --bad: #d03a3a;
  --fb: #1877f2; --ig: #d62976; --tt: #111111; --gg: #188038;
  --r: 10px; --shadow: 0 1px 2px rgba(16,18,30,.06), 0 4px 16px rgba(16,18,30,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e12; --panel: #15161c; --panel2: #1c1d25; --line: #272935; --text: #ececf2; --muted: #9a9cab; --faint: #6c6e7c;
    --accent: #7b7bff; --accent-ink: #0d0e12; --accent-soft: #23234a; --tt: #e9e9ee; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e12; --panel: #15161c; --panel2: #1c1d25; --line: #272935; --text: #ececf2; --muted: #9a9cab; --faint: #6c6e7c;
  --accent: #7b7bff; --accent-ink: #0d0e12; --accent-soft: #23234a; --tt: #e9e9ee; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; }
.logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 12px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a.on { background: var(--panel2); color: var(--text); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; flex: none; }
.view { max-width: 1480px; margin: 0 auto; padding: 18px 24px 80px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: var(--faint); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.in { height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.in:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea.in { height: auto; padding: 8px 12px; width: 100%; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 18px 0 8px; }
.card-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }

/* search bar */
.searchbar { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }
.searchbar .in { border: 0; height: 42px; font-size: 16px; background: transparent; }
.searchbar .in:focus { outline: none; }
.plats { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap; font-size: 13px; user-select: none; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip .n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-facebook { background: var(--fb); } .d-instagram { background: var(--ig); } .d-tiktok { background: var(--tt); } .d-google { background: var(--gg); } .d-meta { background: var(--fb); }
.d-messenger, .d-audience_network { background: #8a8df0; } .d-threads { background: #555; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 12px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 9px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.tab.on { color: var(--text); border-color: var(--accent); }
.tab .n { background: var(--panel2); border-radius: 999px; padding: 0 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 0 10px; height: 32px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--text); }

.status-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.pstat { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 0; }
.pstat .grow { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.p-ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.p-run { background: var(--accent-soft); color: var(--accent); }
.p-blocked, .p-error { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.p-partial { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.ad { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.ad-h { display: flex; gap: 8px; align-items: center; padding: 9px 10px; min-width: 0; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); }
.ad-h .nm { font-weight: 600; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.ad-h .sub { font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.media { position: relative; aspect-ratio: 4/5; background: var(--panel2); cursor: pointer; overflow: hidden; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); padding: 14px; text-align: center; font-size: 12.5px; }
.badge-age { position: absolute; left: 8px; top: 8px; background: rgba(10,10,16,.78); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-age.hot { background: var(--accent); color: #fff; }
.badge-type { position: absolute; right: 8px; top: 8px; background: rgba(10,10,16,.6); color: #fff; padding: 2px 7px; border-radius: 6px; font-size: 11px; }
.ad-b { padding: 9px 10px 4px; flex: 1; }
.txt { font-size: 12.8px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.meta-line { display: flex; gap: 6px 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.meta-line .lnk { overflow-wrap: anywhere; }
.ad-f { display: flex; gap: 6px; padding: 8px 10px 10px; flex-wrap: wrap; }
.ad-f .btn { flex: 1; }
.saved { color: var(--good) !important; border-color: var(--good) !important; }

.fallback { border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.fallback b { font-size: 13.5px; }

/* table view */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; background: var(--panel2); position: sticky; top: 0; }
.tbl td.t { min-width: 220px; max-width: 420px; overflow-wrap: anywhere; }
.tbl img.th { width: 46px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--panel2); }
.tbl tr:hover td { background: color-mix(in srgb, var(--panel2) 50%, transparent); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* vault layout */
.split { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.side { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 2px; }
.side a, .side button.lk { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; }
.side a.on, .side button.lk.on { background: var(--panel2); }
.side .h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 12px 10px 4px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-bg { position: absolute; inset: 0; background: rgba(5,6,10,.6); }
.modal-box { position: relative; width: min(1120px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-x { position: absolute; right: 10px; top: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 20px; cursor: pointer; line-height: 1; }
.mgrid { display: grid; grid-template-columns: minmax(0, 420px) 1fr; }
.mplayer { background: #000; display: flex; align-items: center; justify-content: center; min-height: 360px; border-radius: 14px 0 0 14px; overflow: hidden; }
.mplayer video, .mplayer img { width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.mplayer iframe { width: 100%; aspect-ratio: 9/16; max-height: 78vh; border: 0; }
.mside { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mside .full { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; max-height: 260px; overflow: auto; background: var(--panel2); border-radius: 8px; padding: 10px 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div { overflow-wrap: anywhere; min-width: 0; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; flex: none; }

/* contact card */
.contact { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); }
.contact h3 { margin: 0 0 8px; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.cf { display: grid; grid-template-columns: 92px 1fr auto; gap: 6px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12.8px; }
.cf:first-of-type { border-top: 0; }
.cf .k { color: var(--muted); }
.cf .v { overflow-wrap: anywhere; min-width: 0; }
.cf .src { display: block; font-size: 11px; color: var(--faint); }
.st { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; z-index: 60; font-size: 13px; max-width: calc(100vw - 32px); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.note-box { font-size: 12.5px; color: var(--muted); background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
.links a { margin-right: 10px; white-space: nowrap; }

@media (max-width: 860px) {
  .top { padding: 8px 16px; gap: 10px; }
  .brand b { display: none; }
  .view { padding: 14px 16px 80px; }
  .split { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side .h { display: none; }
  .side a, .side button.lk { white-space: nowrap; }
  .mgrid { grid-template-columns: 1fr; }
  .mplayer { border-radius: 14px 14px 0 0; min-height: 240px; }
  .modal { padding: 0; place-items: end center; }
  .modal-box { max-height: 94vh; border-radius: 14px 14px 0 0; }
}
@media (max-width: 520px) {
  .searchbar { grid-template-columns: 1fr auto; }
  .searchbar .country { grid-column: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ad-h { padding: 7px 8px; }
  .ad-b { padding: 7px 8px 2px; }
  .ad-f { padding: 6px 8px 8px; gap: 4px; }
  .ad-f .btn { padding: 0 6px; font-size: 12px; }
  .kv { grid-template-columns: 92px 1fr; }
  .cf { grid-template-columns: 76px 1fr auto; }
}

/* home: big search + platform tiles */
.hero { margin: 4px 0 16px; }
.searchbar.big { padding: 10px; border-radius: 14px; }
.searchbar.big .in { height: 50px; font-size: 17px; }
.searchbar.big .btn.pri { height: 50px; padding: 0 26px; font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.tile { position: relative; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 34px 10px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; user-select: none; transition: border-color .15s, background .15s; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile .ti svg { width: 34px; height: 34px; display: block; }
.tile .tl { font-weight: 600; font-size: 13.5px; line-height: 1.15; min-width: 0; }
.tile .tl small { display: block; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.tile .tc { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .tc.warn { font-size: 12px; color: var(--warn); font-weight: 600; }
.tile .tick { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); background: var(--panel); }
.tile.on { border-color: var(--accent); background: var(--accent-soft); }
.tile.on .tick { background: var(--accent); border-color: var(--accent); }
.tile.on .tick::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tile:not(.on) { opacity: .62; }
.tile:not(.on) .ti { filter: grayscale(1); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 12px; }
/* contact action buttons */
.cacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cact { position: relative; display: flex; min-width: 0; }
.act { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 7px 28px 7px 10px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; line-height: 1.25; }
.act:hover { filter: brightness(1.08); }
.act b { font-size: 12.5px; }
.act span { font-size: 11.5px; opacity: .85; overflow-wrap: anywhere; }
.act.off { background: var(--panel2); color: var(--faint); cursor: default; }
.cp { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: rgba(255,255,255,.18); color: inherit; color: var(--accent-ink); font-size: 12px; line-height: 20px; cursor: pointer; }
.cp:hover { background: rgba(255,255,255,.32); }
.spin.sm { width: 9px; height: 9px; margin-left: 4px; }
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 9px 30px 9px 9px; gap: 8px; grid-template-columns: 28px 1fr auto; }
  .tile .ti svg { width: 28px; height: 28px; }
  .tile .tc { font-size: 17px; }
  .searchbar.big .in, .searchbar.big .btn.pri { height: 46px; }
}

[hidden]{display:none!important}

/* fixes 10-29: tiles never squeeze the label; phone nav on its own full row (no cut "Store spy") */
.tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { padding-right: 40px; }
.tile .tl { white-space: nowrap; }
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding-right: 34px; gap: 7px; }
  .tile .tl { font-size: 13px; }
  .top { flex-wrap: wrap; padding: 8px 12px 6px; row-gap: 6px; }
  .brand { flex: 1; }
  .nav { order: 3; flex: 0 0 100%; justify-content: space-between; gap: 0; }
  .nav a { padding: 6px 7px; font-size: 13.5px; }
}
.split.split-adv { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 860px) { .split.split-adv { grid-template-columns: minmax(0, 1fr); } .split.split-adv aside { order: -1; } }
