:root {
  --bg: #050505;
  --bg-2: #101010;
  --card: #161616;
  --raised: #1e1e1e;
  --ink: #f3f3f3;
  --silver: #c4c4c4;
  --muted: #9b9b9b;
  --gold: #c6a35a;
  --gold-soft: #e4d2a4;
  --gold-dim: rgba(198, 163, 90, 0.16);
  --danger: #f0c2b8;
  --danger-bg: #2a1714;
  --warn: #e4d2a4;
  --warn-bg: #2a2418;
  --ok: #dedede;
  --ok-bg: #222222;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius: 20px;
  --space: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 10px 12px; z-index: 9; border-radius: 12px; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: #000;
  color: var(--silver);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 10px 22px; }
.brand strong { display: block; color: var(--ink); font-weight: 650; letter-spacing: 0.01em; }
.brand small { color: var(--muted); }
.mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #111;
  font-weight: 750;
}
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side a {
  color: var(--silver);
  padding: 11px 14px;
  border-radius: 14px;
}
.side a.on, .side a:hover { background: var(--gold-dim); color: var(--gold-soft); }
.maincol { min-width: 0; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 28px 32px 0;
}
.top h1 { margin: 0; font-size: 1.55rem; font-weight: 620; color: var(--ink); }
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.who { color: var(--muted); font-size: .92rem; }
main { padding: 22px 32px 56px; }
main > * + *, form > * + * { margin-top: var(--space); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--gold-soft);
  font-weight: 620;
}
.card h3:not(:first-child) { margin-top: 22px; }
.cards > .card h3 {
  margin: 0 0 8px;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.card .num { font-size: 1.7rem; font-variant-numeric: tabular-nums; font-weight: 680; color: var(--ink); }
.card small, .card p { color: var(--silver); }
.toolbar, .filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin: 0; }
label.field { display: flex; flex-direction: column; gap: 8px; font-size: .86rem; color: var(--silver); min-width: 0; }
input, select, textarea {
  background: var(--raised);
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--gold-dim); }
textarea { min-height: 110px; resize: vertical; }
.btn {
  border: 0;
  background: var(--gold);
  color: #16120b;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
}
.btn:hover { background: var(--gold-soft); color: #16120b; }
.btn-ghost { background: var(--raised); color: var(--silver); }
.btn-ghost:hover { background: #2a2a2a; color: var(--ink); }
.btn-danger { background: #6a3030; color: #fff4f1; }
.btn-danger:hover { background: #7d3939; color: #fff4f1; }
.btn-sm { padding: 8px 12px; font-size: .85rem; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.table-wrap { overflow: auto; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 14px 16px; text-align: left; vertical-align: top; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  background: #121212;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
td.clip, th.clip { white-space: normal; min-width: 180px; max-width: 320px; }
.numc { font-variant-numeric: tabular-nums; text-align: right; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 700;
  background: var(--raised);
  color: var(--silver);
}
.badge.DROP { background: var(--danger-bg); color: var(--danger); }
.badge.NO_REFILL { background: var(--warn-bg); color: var(--warn); }
.badge.NO_DROP { background: var(--ok-bg); color: var(--ok); }
.badge.ERROR, .badge.NOT_ANALYSABLE { background: var(--raised); color: var(--muted); }
.badge.instagram, .badge.youtube, .badge.tiktok { background: var(--gold-dim); color: var(--gold-soft); }
.badge.facebook, .badge.telegram { background: #2a2a2a; color: var(--silver); }
a.chip { color: var(--silver); }
a.chip.on, a.chip.on:hover { color: #16120b; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; align-items: baseline; }
.kv span { color: var(--muted); }
.remark input { min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0;
  background: var(--raised);
  color: var(--silver);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.chip.on { background: var(--gold); color: #16120b; }
.pager { display: flex; gap: 12px; align-items: center; color: var(--silver); }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); }
.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 880px);
  overflow: auto;
  background: #121212;
  border-radius: 24px;
  padding: 22px 22px 26px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 620; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { background: var(--bg); border-radius: 16px; padding: 14px; }
.stat span { display: block; color: var(--muted); font-size: .75rem; }
.stat strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #2a2a2a; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar > i { display: block; height: 100%; background: var(--gold); }
.warn { color: var(--warn); }
.err { color: var(--danger); }
.empty, .error-state { padding: 32px 20px; text-align: center; color: var(--muted); }
.skeleton {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a, #1a1a1a);
  background-size: 200% 100%;
  animation: shine 1.1s linear infinite;
}
@keyframes shine { to { background-position: -200% 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.toast { background: var(--gold); color: #16120b; padding: 12px 14px; border-radius: 14px; max-width: 340px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #050505; }
.login-card { width: min(440px, 100%); }
.login-card h1 { margin: 0 0 18px; color: var(--gold-soft); font-weight: 640; }
.progress { height: 10px; background: #2a2a2a; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold); width: 0; }
.hidden { display: none !important; }
.guide { max-width: 720px; }
.guide h2 { margin: 28px 0 8px; font-size: 1.05rem; font-weight: 640; color: var(--gold-soft); }
.guide p { margin: 0 0 10px; color: var(--silver); }
.override { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.override input { width: auto; }
#probe-raw { white-space: pre-wrap; color: var(--silver); }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; z-index: 6; padding: 14px 14px 10px; }
  .brand { padding-bottom: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side a { white-space: nowrap; }
  .grid-2, .stats, .form-grid, .compare { grid-template-columns: 1fr; }
  main, .top { padding-left: 16px; padding-right: 16px; }
  .top { padding-top: 18px; align-items: flex-start; }
  .filters .field { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .top h1 { font-size: 1.3rem; }
  th, td { padding: 12px; }
  .card, .modal-card { padding: 16px; }
}
