/* SMMate — красно-бело-чёрная тема */

:root {
  --black: #08080a;
  --black-1: #101014;
  --black-2: #17171d;
  --black-3: #1f1f27;
  --line: #2a2a34;
  --red: #e01b24;
  --red-hi: #ff2d3a;
  --red-deep: #a30f16;
  --white: #ffffff;
  --text: #f2f2f5;
  --muted: #8b8b98;
  --green: #2ecc71;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--black);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
}

body { padding-bottom: 96px; }

svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 99;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--black);
}
.boot-mark {
  width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(145deg, var(--red-hi), var(--red-deep));
  color: #fff; font-size: 34px; font-weight: 900;
  display: grid; place-items: center;
  box-shadow: 0 0 40px rgba(224, 27, 36, .45);
  animation: pop .5s ease;
}
.boot-text {
  font-size: 12px; font-weight: 800; letter-spacing: .35em;
  color: var(--white); opacity: .75;
}
.boot-bar {
  width: 120px; height: 3px; border-radius: 99px;
  background: var(--black-3); overflow: hidden;
}
.boot-bar i {
  display: block; width: 45%; height: 100%; border-radius: 99px;
  background: var(--red); animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(8, 8, 10, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(145deg, var(--red-hi), var(--red-deep));
  color: #fff; font-weight: 900; font-size: 20px;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(224, 27, 36, .35);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .01em; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--black-2);
  color: var(--text); display: grid; place-items: center;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.spinning svg { animation: spin .9s linear infinite; color: var(--red); }

/* ---------- layout ---------- */
main { padding: 14px 14px 8px; max-width: 660px; margin: 0 auto; }
.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }

.card {
  background: var(--black-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 15px; }
h2 { font-size: 19px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
p { margin: 8px 0; }

/* ---------- hero ---------- */
.hero {
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(224, 27, 36, .35) 0%, transparent 55%),
    linear-gradient(160deg, #1a1a21 0%, #0d0d11 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hero-account { font-size: 18px; font-weight: 800; margin-top: 2px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.metric-value { font-size: 25px; font-weight: 900; letter-spacing: -.03em; }
.metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pill {
  font-size: 10.5px; padding: 5px 11px; border-radius: 99px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  background: rgba(46, 204, 113, .14); color: var(--green);
}
.pill.off { background: rgba(224, 27, 36, .18); color: var(--red-hi); }

/* ---------- connect ---------- */
.connect { text-align: center; padding: 28px 18px; }
.connect-badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red-hi);
  border: 1px solid var(--red); border-radius: 99px; padding: 5px 14px;
  margin-bottom: 14px;
}
.connect p { color: var(--muted); font-size: 13.5px; }
.hint { font-size: 12px !important; opacity: .75; margin-top: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; width: 100%; padding: 14px 16px; margin-top: 12px;
  border: 0; border-radius: 13px; font-size: 15px; font-weight: 800;
  background: var(--black-3); color: var(--text); text-align: center;
  text-decoration: none; cursor: pointer; letter-spacing: .01em;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--red-hi), var(--red-deep));
  color: #fff;
  box-shadow: 0 6px 22px rgba(224, 27, 36, .38);
}
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip {
  border: 1px solid var(--line); background: var(--black-2); color: var(--muted);
  font-size: 11.5px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.chip:active { transform: scale(.95); color: var(--red-hi); }

/* ---------- chart ---------- */
canvas { width: 100%; height: auto; display: block; }

/* ---------- posts ---------- */
.posts { display: flex; flex-direction: column; gap: 10px; }
.post {
  display: flex; gap: 11px; align-items: center;
  padding: 10px; border-radius: 13px;
  background: var(--black-2); border: 1px solid transparent;
  text-decoration: none; color: inherit;
}
.post:active { border-color: var(--red); }
.post-thumb {
  width: 54px; height: 54px; border-radius: 11px; object-fit: cover;
  background: var(--black-3); flex: 0 0 auto;
}
.post-body { min-width: 0; flex: 1; }
.post-cap {
  font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.post-meta {
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
  display: flex; gap: 9px; flex-wrap: wrap;
}
.post-er { font-size: 12.5px; font-weight: 900; color: var(--red-hi); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: block; padding: 11px 12px; border-radius: 12px;
  background: var(--black-2); text-decoration: none; color: inherit;
  border-left: 3px solid var(--black-3);
}
.row:active { border-left-color: var(--red); background: var(--black-3); }
.row-title { font-size: 13.5px; font-weight: 600; }
.row-meta {
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.view-count { color: var(--red-hi); font-weight: 800; }

/* ---------- keyword cloud ---------- */
.cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.kw {
  padding: 7px 12px; border-radius: 99px; font-size: 12.5px;
  background: var(--black-2); border: 1px solid var(--line); color: var(--text);
}
.kw.hot {
  background: linear-gradient(135deg, rgba(224,27,36,.24), rgba(163,15,22,.12));
  border-color: var(--red); color: #fff; font-weight: 800;
}

/* ---------- command list ---------- */
.cmd-group { margin-bottom: 14px; }
.cmd-group-title {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red-hi);
  margin: 4px 2px 8px;
}
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left;
  padding: 13px 14px; margin-bottom: 7px;
  border-radius: 13px; border: 1px solid var(--line);
  background: var(--black-1); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
}
.cmd:active { border-color: var(--red); background: var(--black-2); }
.cmd-code {
  font-size: 11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--red-hi); font-weight: 700;
}
.cmd.needs-topic::after {
  content: "→"; font-size: 15px; color: var(--muted); font-weight: 400;
}
.intro { padding: 14px 16px; }

/* ---------- generator ---------- */
.tabs {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px;
  margin: 12px 0; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.tab.active {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 4px 16px rgba(224, 27, 36, .35);
}
.input {
  width: 100%; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--black-2);
  color: var(--text); font-size: 15px; font-family: inherit;
}
.input::placeholder { color: #5c5c68; }
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 27, 36, .14); }

/* ---------- ideas ---------- */
.idea { border-left: 3px solid var(--red); }
.idea h4 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.idea .hook { color: #ff8b93; font-style: italic; margin: 7px 0; }
.idea dl { margin: 8px 0 0; font-size: 13px; }
.idea dt {
  color: var(--muted); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; margin-top: 8px; font-weight: 800;
}
.idea dd { margin: 2px 0 0; }
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  padding: 4px 9px; border-radius: 7px; letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(224, 27, 36, .16); color: var(--red-hi);
  margin-bottom: 8px;
}

/* ---------- output ---------- */
.output {
  white-space: pre-wrap; word-wrap: break-word;
  font-size: 14px; line-height: 1.55;
}
.copy-row { display: flex; gap: 8px; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(8, 8, 10, .94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 700; padding: 7px 2px; border-radius: 11px;
  font-family: inherit;
}
.tabbar-item svg { width: 21px; height: 21px; }
.tabbar-item.active { color: var(--red-hi); }
.tabbar-item.active svg { filter: drop-shadow(0 0 8px rgba(224, 27, 36, .55)); }

/* ---------- states ---------- */
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 6px; }
.skeleton {
  height: 58px; border-radius: 12px; margin-bottom: 8px;
  background: linear-gradient(90deg, var(--black-2) 25%, var(--black-3) 50%, var(--black-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.toast {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%);
  background: var(--black-3); border: 1px solid var(--red);
  color: var(--text); padding: 11px 17px; border-radius: 13px;
  font-size: 13px; font-weight: 600; z-index: 60;
  box-shadow: var(--shadow); animation: fade .2s ease;
}
