:root {
  --bg: #0e0d16;
  --bg-2: #15141f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-solid: #1a1926;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f2f8;
  --text-2: #a9a7ba;
  --text-3: #6f6d82;
  --accent: #ff5e3a;
  --accent-2: #ff9a3c;
  --accent-3: #8b5cf6;
  --accent-soft: rgba(255, 94, 58, 0.14);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.13);
  --tg: #2aabee;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.75);
  --radius: 20px;
  --radius-sm: 12px;
  --logo-color: #fff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5fa;
    --bg-2: #ecebf3;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-2: rgba(20, 18, 40, 0.05);
    --surface-solid: #ffffff;
    --border: rgba(20, 18, 40, 0.08);
    --border-strong: rgba(20, 18, 40, 0.16);
    --text: #16151f;
    --text-2: #5b596c;
    --text-3: #8e8ca0;
    --accent-soft: rgba(255, 94, 58, 0.1);
    --shadow: 0 10px 30px -14px rgba(30, 20, 60, 0.25);
    --shadow-lg: 0 30px 60px -24px rgba(30, 20, 60, 0.35);
    --logo-color: #0e0d16;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- background ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; animation: drift 22s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: var(--accent); top: -200px; left: -160px; }
.bg-orbs span:nth-child(2) { width: 460px; height: 460px; background: var(--accent-3); top: 30%; right: -220px; animation-delay: -7s; opacity: 0.22; }
.bg-orbs span:nth-child(3) { width: 380px; height: 380px; background: var(--accent-2); bottom: -180px; left: 30%; animation-delay: -14s; opacity: 0.18; }
@media (prefers-color-scheme: light) { .bg-orbs span { opacity: 0.16; } }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.15); } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #1d1b2b, #0e0d16);
  position: relative; box-shadow: 0 6px 20px -6px rgba(255, 94, 58, 0.55), inset 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
}
.brand-logo::after {
  content: ""; position: absolute; inset: 7px; background: #fff;
  -webkit-mask: url(../icons/logo-white.png) center / contain no-repeat;
  mask: url(../icons/logo-white.png) center / contain no-repeat;
}
.brand-logo::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 55%, rgba(255, 94, 58, 0.55), transparent 65%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: -0.02em; }
.brand-text span { font-size: 12px; color: var(--text-2); }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.container {
  max-width: 1320px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) calc(40px + var(--safe-bottom)) max(16px, env(safe-area-inset-left));
}
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; animation: rise .7s var(--ease) both; }
.hero h1 { margin: 0; font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.035em; line-height: 1.05; }
.hero p { margin: 8px 0 0; color: var(--text-2); }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: flex; gap: 10px; }
.stat {
  min-width: 96px; padding: 12px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.stat b { display: block; font-size: 24px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-2); }
.stat[data-k="published"] b { color: var(--ok); }
.stat[data-k="pending"] b { color: var(--accent); }
.stat b.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.25); } }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.setup-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 16px;
  background: linear-gradient(100deg, rgba(42, 171, 238, 0.18), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(42, 171, 238, 0.35);
  animation: rise .6s var(--ease) both;
}
.setup-banner div { display: flex; flex-direction: column; }
.setup-banner span { color: var(--text-2); font-size: 13px; }

/* ---------- tabs ---------- */
.tabs {
  position: relative; display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%;
}
.tab {
  position: relative; z-index: 1; border: 0; background: none; padding: 9px 14px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .25s;
}
.tab.active { color: var(--text); }
.tab em { font-style: normal; font-size: 12px; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.tab-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px;
  background: var(--surface-solid); box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform .4s var(--ease), width .4s var(--ease);
}

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { color: var(--text-3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.select-wrap { position: relative; flex: none; }
.select-wrap select {
  height: 44px; padding: 0 36px 0 14px; appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; outline: 0; font-size: 14px; font-weight: 600;
}
.select-wrap::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.select-wrap option { background: var(--surface-solid); color: var(--text); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 13px;
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); transform: translateY(-1px); }
.chip small { opacity: .6; font-weight: 500; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: cardIn .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
  .card:hover .card-media img { transform: scale(1.06); }
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
.card.leaving-publish { animation: flyOut .65s var(--ease) forwards; pointer-events: none; }
.card.leaving-discard { animation: dropOut .45s var(--ease) forwards; pointer-events: none; }
@keyframes flyOut {
  0% { transform: none; }
  30% { transform: scale(1.03); box-shadow: 0 0 0 3px var(--ok), var(--shadow-lg); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.85) rotate(-3deg); }
}
@keyframes dropOut { to { opacity: 0; transform: translateY(30px) scale(0.9) rotate(2deg); filter: blur(4px) grayscale(1); } }

.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); cursor: zoom-in; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s, transform .8s var(--ease); }
.card-media img.loaded { opacity: 1; }
.skeleton { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%) var(--bg-2); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.badge-score, .badge-cat, .badge-link {
  position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: #fff; background: rgba(10, 10, 16, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.14);
}
.badge-score { top: 10px; left: 10px; }
.badge-score.hot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: 0 6px 18px -6px var(--accent); }
.badge-cat { bottom: 10px; left: 10px; font-weight: 600; }
.badge-link { top: 10px; right: 10px; padding: 7px; text-decoration: none; transition: background .2s; }
.badge-link:hover { background: rgba(10, 10, 16, 0.8); }
.badge-link svg { width: 16px; height: 16px; }

.card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; flex: 1; }
.card-title {
  width: 100%; resize: none; border: 1px solid transparent; background: transparent; border-radius: 10px;
  padding: 6px 8px; margin: -6px -8px 0; width: calc(100% + 16px);
  font-size: 16px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; outline: 0; overflow: hidden;
  transition: border-color .2s, background .2s;
}
.card-title:hover { border-color: var(--border); }
.card-title:focus { border-color: var(--accent); background: var(--surface-2); }
.card-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 14px; height: 14px; }
.card-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.card-reasons span { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2); }
.card-reasons span.warn { background: rgba(250, 204, 21, 0.14); color: #eab308; }
.card-reasons span.lic { background: var(--surface-2); color: var(--text-2); }
.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.price {
  display: flex; align-items: center; height: 48px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s;
}
.price:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.price input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0 14px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price input::placeholder { color: var(--text-3); font-weight: 600; font-size: 16px; }
.price b { padding: 0 16px; font-size: 18px; color: var(--text-2); }
.price.shake { animation: shake .4s; border-color: var(--danger); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.btn-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 15px;
  transition: transform .2s var(--ease), background .2s, box-shadow .25s, opacity .2s; user-select: none; overflow: hidden;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn svg { width: 18px; height: 18px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 22px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 12px 28px -8px var(--accent); }
.btn-tg { background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; box-shadow: 0 8px 22px -10px var(--tg); }
.btn-tg:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-discard { background: var(--danger-soft); color: var(--danger); border-color: transparent; padding: 0 14px; }
.btn-discard:hover { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.35); animation: ripple .6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.done-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.done-row .tag { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.done-row .tag.ok { background: var(--ok-soft); color: var(--ok); }
.done-row .tag.no { background: var(--danger-soft); color: var(--danger); }
.done-row time { color: var(--text-3); font-size: 12px; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 70px 20px; animation: rise .6s var(--ease) both; }
.empty h2 { margin: 18px 0 6px; letter-spacing: -0.02em; }
.empty p { margin: 0 auto; color: var(--text-2); max-width: 460px; }
.empty-art {
  width: 110px; height: 110px; margin: 0 auto; border-radius: 30px; position: relative;
  background: linear-gradient(145deg, #1d1b2b, #0e0d16); box-shadow: 0 20px 50px -16px var(--accent);
  animation: float 4s ease-in-out infinite;
}
.empty-art::after { content: ""; position: absolute; inset: 22px; background: #fff; -webkit-mask: url(../icons/logo-white.png) center / contain no-repeat; mask: url(../icons/logo-white.png) center / contain no-repeat; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-3deg); } }
.foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 40px; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 5, 10, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s both; }
.sheet-backdrop.closing { animation: fade .25s reverse both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; right: 0; top: 0; bottom: 0; width: min(460px, 100%);
  display: flex; flex-direction: column; background: var(--surface-solid); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: slideIn .45s var(--ease) both; padding-top: var(--safe-top);
}
.sheet.closing { animation: slideIn .3s var(--ease) reverse both; }
@keyframes slideIn { from { transform: translateX(100%); } }
.sheet-handle { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.sheet-body { overflow-y: auto; padding: 4px 20px calc(24px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.hint { color: var(--text-2); font-size: 13px; margin: 0 0 12px; display: block; }
small.hint { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); outline: 0; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.field-row .btn { height: 44px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin: 6px 0 4px; }
.sheet-actions.wrap { flex-wrap: wrap; justify-content: flex-start; }
.chat-list { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 14px; }
.chat-list button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); animation: rise .35s var(--ease) both; }
.chat-list button:hover { border-color: var(--tg); }
.chat-list small { display: block; color: var(--text-3); }

@media (max-width: 640px) {
  .sheet {
    top: auto; left: 0; right: 0; width: auto; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--border);
    border-radius: 24px 24px 0 0; animation-name: slideUp;
    padding-top: 0;
  }
  @keyframes slideUp { from { transform: translateY(100%); } }
  .sheet-handle { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 10px auto 0; }
}

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(5,5,10,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: zoom-out; animation: fade .25s both; }
.lightbox img { max-width: min(1000px, 100%); max-height: 80dvh; border-radius: 18px; box-shadow: var(--shadow-lg); animation: zoomIn .4s var(--spring) both; }
.lightbox-cap { color: #fff; margin-top: 14px; font-weight: 600; text-align: center; max-width: 700px; }
@keyframes zoomIn { from { transform: scale(.85); opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 70; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: toastIn .45s var(--spring) both; font-size: 14px; font-weight: 600;
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .ico { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--ok-soft); color: var(--ok); }
.toast.err .ico { background: var(--danger-soft); color: var(--danger); }
.toast.info .ico { background: rgba(42,171,238,.15); color: var(--tg); }
.toast .ico svg { width: 16px; height: 16px; }
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: var(--accent-2); font-weight: 800; padding: 4px 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.95); } }

/* ---------- confetti ---------- */
.confetti { position: fixed; z-index: 80; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; will-change: transform, opacity; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .container { padding-top: 16px; }
  .hero { gap: 14px; margin-bottom: 16px; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 10px 12px; }
  .stat b { font-size: 20px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 9px 6px; font-size: 13px; }
  .tab em { display: none; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .brand-text span { font-size: 11px; }
  .toolbar .select-wrap select { padding-right: 30px; font-size: 13px; max-width: 150px; }
}
@media (min-width: 641px) and (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: var(--bg); animation: fade .3s both; }
.login::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 400px at 50% 30%, rgba(255, 94, 58, 0.22), transparent 70%); pointer-events: none; }
.login-card {
  position: relative; width: min(380px, 100%); padding: 32px 24px 24px; border-radius: 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: rise .6s var(--ease) both;
}
.login-card h1 { margin: 16px 0 2px; font-size: 26px; letter-spacing: -0.03em; }
.login-card > p { margin: 0 0 22px; color: var(--text-2); }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; }
.login-card .hint { margin-top: 12px; color: var(--danger); min-height: 1em; }
.login-logo {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 24px; position: relative;
  background: linear-gradient(145deg, #1d1b2b, #0e0d16); box-shadow: 0 18px 40px -14px var(--accent); animation: float 4s ease-in-out infinite;
}
.login-logo::after { content: ""; position: absolute; inset: 16px; background: #fff; -webkit-mask: url(../icons/logo-white.png) center / contain no-repeat; mask: url(../icons/logo-white.png) center / contain no-repeat; }
.login-card.shake { animation: shake .4s; }

.bot-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.bot-status .dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.bot-status.err .dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.bot-status small { display: block; color: var(--text-3); }
