/* ============================================================
   PulseSender Mini App — NetLoop-style + 4 темы
   Темы применяются через body.theme-{purple|night|warm|graphite}
   ============================================================ */

/* ---------- PALETTES ---------- */

body.theme-purple, body {
  --bg-page: #0B0912;
  --bg-app: #12101B;
  --bg-surface: #1A1729;
  --bg-elevated: #221E38;
  --bg-input: #1A1729;
  --bg-hover: #262042;

  --line-1: #2A2544;
  --line-2: #322C55;
  --line-3: #3E366A;
  --line-4: #524478;

  --fg: #EDE9FE;
  --fg-2: #C8BEE8;
  --fg-3: #A99DD3;
  --fg-4: #8B80B4;
  --fg-5: #6E6591;
  --fg-6: #574F73;

  --accent: #C4B5FD;
  --accent-strong: #A78BFA;
  --accent-fg: #0B0912;
  --accent-bg: rgba(196, 181, 253, 0.14);
  --accent-bg-hover: rgba(196, 181, 253, 0.22);

  --st-green: oklch(0.78 0.14 150);
  --st-amber: oklch(0.82 0.13 85);
  --st-red: oklch(0.68 0.16 25);

  --theme-color: #12101B;
}

body.theme-night {
  --bg-page: #060814;
  --bg-app: #0C0F22;
  --bg-surface: #131736;
  --bg-elevated: #1B2049;
  --bg-input: #131736;
  --bg-hover: #21275A;

  --line-1: #1E2450;
  --line-2: #262D62;
  --line-3: #313878;
  --line-4: #464E9C;

  --fg: #E0E7FF;
  --fg-2: #BBC5EF;
  --fg-3: #9AA4D4;
  --fg-4: #7B85B6;
  --fg-5: #616B98;
  --fg-6: #4C567A;

  --accent: #818CF8;
  --accent-strong: #6366F1;
  --accent-fg: #060814;
  --accent-bg: rgba(129, 140, 248, 0.14);
  --accent-bg-hover: rgba(129, 140, 248, 0.22);

  --theme-color: #0C0F22;
}

body.theme-warm {
  --bg-page: #100C05;
  --bg-app: #1A1608;
  --bg-surface: #1F1B0C;
  --bg-elevated: #2A240F;
  --bg-input: #1D190A;
  --bg-hover: #322A14;

  --line-1: #251F0D;
  --line-2: #2E260F;
  --line-3: #3B3216;
  --line-4: #5A4E24;

  --fg: #F5EFDC;
  --fg-2: #D4CBAF;
  --fg-3: #B4AA88;
  --fg-4: #948B6D;
  --fg-5: #766E56;
  --fg-6: #5A5443;

  --accent: #FBBF24;
  --accent-strong: #F59E0B;
  --accent-fg: #100C05;
  --accent-bg: rgba(251, 191, 36, 0.14);
  --accent-bg-hover: rgba(251, 191, 36, 0.22);

  --theme-color: #1A1608;
}

body.theme-graphite {
  --bg-page: #050505;
  --bg-app: #0A0A0A;
  --bg-surface: #131313;
  --bg-elevated: #1C1C1C;
  --bg-input: #131313;
  --bg-hover: #232323;

  --line-1: #1A1A1A;
  --line-2: #232323;
  --line-3: #2E2E2E;
  --line-4: #454545;

  --fg: #F5F5F5;
  --fg-2: #BFBFBF;
  --fg-3: #999999;
  --fg-4: #7A7A7A;
  --fg-5: #616161;
  --fg-6: #4A4A4A;

  --accent: #F5F5F5;
  --accent-strong: #FFFFFF;
  --accent-fg: #0A0A0A;
  --accent-bg: rgba(255, 255, 255, 0.08);
  --accent-bg-hover: rgba(255, 255, 255, 0.14);

  --theme-color: #0A0A0A;
}

:root {
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.3, 1.35, .4, 1);
}

/* ---------- RESET ---------- */

* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
html { background: var(--bg-page); }
body {
  background: var(--bg-page);
  color: var(--fg);
  font-family: "Helvetica Neue", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overscroll-behavior-y: none;
  -webkit-user-select: none; user-select: none;
}
input, textarea, .mono, .selectable { -webkit-user-select: text; user-select: text; }
a { color: var(--fg); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; background: transparent; border: none; outline: none; }
input::placeholder, textarea::placeholder { color: var(--fg-6); }
::-webkit-scrollbar { width: 0; height: 0; }
.mono { font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ---------- SHELL / LAYOUT ---------- */

.app-frame {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-app);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.app-header {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--line-1);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 600; letter-spacing: -0.01em; font-size: 15px; color: var(--fg); }

.header-right { display: flex; align-items: center; gap: 8px; }
.header-balance {
  font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--fg-3);
}
.pro-badge {
  font-size: 10px; letter-spacing: 0.06em; padding: 4px 9px;
  border-radius: 999px;
  color: var(--accent-fg);
  background: var(--accent);
  font-weight: 600;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 108px;
  display: flex; flex-direction: column; gap: 22px;
}

.tab-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 460px;
  height: 76px;
  background: color-mix(in oklab, var(--bg-app) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-1);
  display: flex; align-items: stretch;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-bar-inner {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px;
}

/* Плавно едущий "пузырь" под активной иконкой. Позицию/размер выставляет JS. */
.tab-indicator {
  position: absolute;
  top: 6px;
  height: 44px;
  width: 60px;
  border-radius: 16px;
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--accent) 22%, transparent) 0%,
      color-mix(in oklab, var(--accent) 10%, transparent) 100%);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  box-shadow:
    0 2px 10px color-mix(in oklab, var(--accent) 25%, transparent),
    inset 0 1px 0 color-mix(in oklab, var(--accent) 30%, transparent);
  transform: translateX(0);
  transition: transform .38s var(--ease-back),
              width      .38s var(--ease-back),
              opacity    .18s ease;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.tab-indicator.ready { opacity: 1; }

.tab-btn {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--fg-5);
  transition: color .22s ease, transform .28s var(--ease-back);
  padding: 4px 2px;
  border-radius: 12px;
}
.tab-btn .tab-icon-wrap {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  transition: transform .32s var(--ease-back);
}
.tab-btn .tab-label {
  font-size: 10.5px; letter-spacing: 0.01em; font-weight: 500;
  transition: font-weight .2s ease, letter-spacing .2s ease;
}
.tab-btn.active { color: var(--accent); }
.tab-btn.active .tab-icon-wrap { transform: translateY(-1px) scale(1.08); }
.tab-btn.active .tab-label { font-weight: 600; letter-spacing: 0.02em; }

/* ---------- TYPOGRAPHY ---------- */

.hero-h1 {
  font-size: 26px; line-height: 1.16; letter-spacing: -0.02em;
  font-weight: 700; color: var(--fg);
}
.hero-sub {
  font-size: 14px; line-height: 1.5; color: var(--fg-3);
  margin-top: 6px;
}
.section-title {
  font-size: 22px; letter-spacing: -0.015em; font-weight: 700; color: var(--fg);
}
.eyebrow {
  font-size: 12px; color: var(--fg-4); font-weight: 500;
}
.hint { font-size: 13px; color: var(--fg-3); line-height: 1.5; }

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 46px; padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-strong); }

.btn-soft {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: transparent;
}
.btn-soft:hover { background: var(--accent-bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-3);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--line-4); }

.btn-block { display: flex; width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 15px; border-radius: 16px; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-2);
  color: var(--fg-3);
  transition: all .18s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }

/* ---------- CARDS ---------- */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--line-1);
  border-radius: 18px;
  padding: 18px;
  transition: border-color .2s ease;
}
.card.compact { padding: 14px 16px; border-radius: 14px; }
.card.hoverable:hover { border-color: var(--line-3); }
.card.accent {
  background: linear-gradient(180deg, var(--accent-bg) 0%, transparent 100%),
              var(--bg-surface);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}

/* Иконка-квадратик внутри карточки (как в NetLoop) */
.icon-tile {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  flex: 0 0 auto;
}
.icon-tile.lg { width: 54px; height: 54px; border-radius: 14px; }

/* ---------- STAT TILES ---------- */

.stats-grid {
  display: grid;
  gap: 10px;
}
.stats-grid.g2 { grid-template-columns: 1fr 1fr; }
.stats-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }

.stat-tile {
  background: var(--bg-surface);
  border: 1px solid var(--line-1);
  border-radius: 16px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.stat-tile .head {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-3); font-size: 13px; font-weight: 500;
}
.stat-tile .head .icon-tile {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-hover); color: var(--fg-3);
}
.stat-tile .value {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px; font-weight: 600;
  color: var(--fg); line-height: 1;
  letter-spacing: -0.02em;
}
.stat-tile .value .unit { font-size: 15px; color: var(--fg-4); font-weight: 500; margin-left: 3px; }
.stat-tile .sub { font-size: 12px; color: var(--fg-4); }
.stat-tile.accent {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}
.stat-tile.accent .head, .stat-tile.accent .value, .stat-tile.accent .sub { color: var(--accent-fg); }
.stat-tile.accent .head .icon-tile { background: color-mix(in oklab, var(--accent-fg) 12%, transparent); color: var(--accent-fg); }

/* ---------- CHIPS ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--fg-2);
  font-weight: 500;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.selectable { cursor: pointer; transition: all .16s ease; }
.chip.selectable:hover { background: var(--bg-hover); }
.chip.accent { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

/* ---------- FORMS ---------- */

.field-label {
  display: block; font-size: 12.5px; color: var(--fg-3);
  font-weight: 500; margin-bottom: 8px;
}
.field-hint { font-size: 12px; color: var(--fg-4); margin-top: 6px; line-height: 1.5; }

.input-line {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--fg);
  font-size: 14px;
  transition: border-color .16s ease;
}
.input-line:focus, .input-line:focus-within { border-color: var(--accent); }
.textarea-box {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-input);
  color: var(--fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; line-height: 1.7;
  resize: vertical;
  transition: border-color .16s ease;
}
.textarea-box:focus { border-color: var(--accent); }

.dashed-card {
  border: 1.5px dashed var(--line-3);
  border-radius: 14px;
  padding: 14px 12px;
  background: var(--bg-surface);
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  text-align: left;
}
.dashed-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.dashed-card .head {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--fg-4);
}
.dashed-card .body { font-size: 12.5px; line-height: 1.4; color: var(--fg-2); }
.dashed-card .body span { color: var(--fg-4); }

/* ---------- TOGGLE ---------- */

.toggle {
  width: 46px; height: 28px; flex: 0 0 46px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; padding: 2px;
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle .knob {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  transform: translateX(0);
  box-shadow: 0 1px 3px rgba(0,0,0,.45);
  transition: transform .28s var(--ease-back);
}
.toggle.on .knob { transform: translateX(18px); }

/* ---------- SEGMENTED CONTROL ---------- */

.seg {
  position: relative;
  display: flex;
  height: 42px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--line-2);
}
.seg .seg-slider {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 8px;
  background: var(--accent-bg);
  transition: transform .3s var(--ease);
}
.seg .seg-item {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--fg-4); font-weight: 500;
  cursor: pointer;
  transition: color .2s ease;
}
.seg .seg-item.active { color: var(--accent); font-weight: 600; }

/* ---------- SLIDER (range) ---------- */

.slider-track {
  position: relative; height: 22px;
  display: flex; align-items: center;
  cursor: pointer; touch-action: none;
}
.slider-track .rail {
  position: absolute; left: 0; right: 0;
  height: 4px; border-radius: 2px;
  background: var(--bg-hover);
}
.slider-track .active {
  position: absolute; left: 8px; right: 8px; height: 4px;
}
.slider-track .fill {
  position: absolute; height: 4px;
  background: var(--accent);
  border-radius: 2px;
}
.slider-track .knob {
  position: absolute; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,.55), 0 0 0 4px var(--accent-bg);
}

.input-inline {
  background: transparent; border: none;
  border-bottom: 1px dashed var(--line-3);
  color: var(--fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; text-align: right;
  padding: 0 0 2px; outline: none;
}
.input-inline:focus { border-bottom-color: var(--accent); }

/* ---------- STATUS DOT ---------- */

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex: 0 0 7px;
}
.dot.pulse { animation: pulseDot 1.8s ease-in-out infinite; }
.dot.g { background: var(--st-green); }
.dot.a { background: var(--st-amber); }
.dot.r { background: var(--st-red); }
.dot.n { background: var(--fg-5); }

.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-elevated);
  color: var(--fg-2);
  font-weight: 500;
  white-space: nowrap;
}
.status-chip.g { color: var(--st-green); border-color: color-mix(in oklab, var(--st-green) 30%, transparent); }
.status-chip.a { color: var(--st-amber); border-color: color-mix(in oklab, var(--st-amber) 30%, transparent); }
.status-chip.r { color: var(--st-red); border-color: color-mix(in oklab, var(--st-red) 30%, transparent); }

/* ---------- PROGRESS ---------- */

.progress {
  height: 4px; background: var(--bg-hover);
  border-radius: 2px; overflow: hidden;
}
.progress > .bar {
  height: 4px; background: var(--accent);
  border-radius: 2px;
  transition: width .7s var(--ease);
}
.progress > .bar.g { background: var(--st-green); }
.progress > .bar.a { background: var(--st-amber); }
.progress > .bar.r { background: var(--st-red); }

/* ---------- ROW LISTS ---------- */

.row-list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-1);
}
.avatar-init {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 600;
}

/* Tab filter (Все/Живые/Слетели) */
.tab-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tab-filter .tab {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 500;
  color: var(--fg-3);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s ease;
}
.tab-filter .tab .cnt {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--fg-5); margin-left: 4px;
}
.tab-filter .tab.active { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.tab-filter .tab.active .cnt { color: var(--accent); }

/* ---------- BOTTOM SHEET ---------- */

.sheet-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* dvh — динамическая высота viewport'а: корректно на mobile и в Telegram
     WebApp, где 100vh/100% часто врут (адресная строка, safe-area, tg.expand). */
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn .22s ease both;
  z-index: 60;
}
.sheet {
  background: var(--bg-surface);
  border-top: 1px solid var(--line-2);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: sheetUp .34s var(--ease) both;
  width: 100%; max-width: 460px; margin: 0 auto;
  max-height: 100dvh;
}
.sheet.tall { height: 92dvh; }
.sheet.mid { max-height: 84dvh; }
.sheet-head {
  padding: 18px 20px 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line-1);
}
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line-1);
  display: flex; gap: 10px;
}

.step-bars {
  display: flex; gap: 5px;
  padding: 14px 20px 0;
}
.step-bars .b {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--bg-hover);
  transition: background .3s ease;
}
.step-bars .b.on { background: var(--accent); }

/* pick-row в wizard */
.pick-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 0 transparent;
}
.pick-row:hover { border-color: var(--line-3); }
.pick-row.picked {
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  background: var(--accent-bg);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent),
    0 4px 14px color-mix(in oklab, var(--accent) 15%, transparent);
}
.pick-radio {
  width: 22px; height: 22px; flex: 0 0 22px;
  border: 1.5px solid var(--line-3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s ease;
}
.pick-row.picked .pick-radio { border-color: var(--accent); }
.pick-radio .in {
  width: 11px; height: 11px; border-radius: 50%;
  background: transparent;
  transform: scale(0);
  transition: transform .24s var(--ease-back), background .18s ease;
}
.pick-row.picked .pick-radio .in { background: var(--accent); transform: scale(1); }

/* Мини-статус внутри pick-row (шаг 1 «Аккаунт») */
.status-inline {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--st-green) 12%, transparent);
  color: var(--st-green);
  font-weight: 500;
  border: 1px solid color-mix(in oklab, var(--st-green) 25%, transparent);
  white-space: nowrap;
}
.status-inline.a {
  background: color-mix(in oklab, var(--st-amber) 12%, transparent);
  color: var(--st-amber);
  border-color: color-mix(in oklab, var(--st-amber) 25%, transparent);
}
.status-inline.r {
  background: color-mix(in oklab, var(--st-red) 12%, transparent);
  color: var(--st-red);
  border-color: color-mix(in oklab, var(--st-red) 25%, transparent);
}
.status-inline .dot { width: 6px; height: 6px; flex: 0 0 6px; }

/* Чипы с SVG-иконками */
.chip svg { width: 12px; height: 12px; flex: 0 0 12px; color: var(--fg-4); }
.chip.st-green svg { color: var(--st-green); }
.chip.st-red   svg { color: var(--st-red); }
.chip.st-amber svg { color: var(--st-amber); }
.chip.st-accent svg { color: var(--accent); }

/* Preview-кружок цветной темы (заменяет 🟣🌙🟠⬛) */
.theme-swatch {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 8px;
  border: 1px solid var(--line-3);
  display: inline-block;
  box-shadow: inset 0 -6px 8px rgba(0,0,0,.35);
}
.theme-swatch.purple   { background: linear-gradient(135deg, #A78BFA 0%, #6D28D9 100%); }
.theme-swatch.night    { background: linear-gradient(135deg, #818CF8 0%, #1E1B4B 100%); }
.theme-swatch.warm     { background: linear-gradient(135deg, #FBBF24 0%, #7C2D12 100%); }
.theme-swatch.graphite { background: linear-gradient(135deg, #F5F5F5 0%, #0A0A0A 100%); }

/* Кнопка "Ввести в Telegram" */
.telegram-hint {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px dashed color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.telegram-hint:hover {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border-color: var(--accent);
}
.telegram-hint svg { flex: 0 0 18px; color: var(--accent); }
.telegram-hint .txt { flex: 1; font-size: 12.5px; color: var(--fg-2); line-height: 1.4; }
.telegram-hint .txt b { color: var(--fg); font-weight: 600; }

/* Улучшенный tab-filter (пункт 5): чётче активное состояние */
.tab-filter .tab {
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tab-filter .tab.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 15%, transparent);
}

/* ---------- WELCOME / EMPTY CARD ---------- */

.welcome-card {
  background: var(--bg-surface);
  border: 1px solid var(--line-1);
  border-radius: 20px;
  padding: 26px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.welcome-card .icon-tile.lg {
  background: var(--accent);
  color: var(--accent-fg);
}
.welcome-card .title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.welcome-card .sub {
  font-size: 13.5px; line-height: 1.5; color: var(--fg-3);
}
.welcome-card .btn-primary { width: 100%; }

/* ---------- ANIMATIONS ---------- */

@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.a-fadeUp { animation: fadeUp .32s var(--ease) both; }
.a-rowIn { animation: rowIn .34s var(--ease) both; }
.a-stepIn { animation: stepIn .28s var(--ease) both; }

/* HTMX */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request .htmx-hide { opacity: 0.4; pointer-events: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 92px; left: 50%; transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-3);
  border-radius: 999px;
  color: var(--fg); font-size: 13.5px; font-weight: 500;
  z-index: 100;
  animation: fadeUp .22s ease both;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.toast.err { border-color: color-mix(in oklab, var(--st-red) 45%, transparent); color: var(--st-red); }
.toast.ok  { border-color: color-mix(in oklab, var(--st-green) 45%, transparent); color: var(--st-green); }
