:root {
  --bg: #050505;
  --bg-soft: #101112;
  --card: linear-gradient(180deg, rgba(29, 30, 32, 0.96), rgba(13, 13, 14, 0.96));
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f7f8;
  --muted: #a5a9b4;
  --red: #ef4444;
  --red-dark: #b91c1c;
  --gold: #ffb84d;
  --green: #16a34a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 184, 77, 0.1), transparent 22%),
    linear-gradient(180deg, #080808 0%, #040404 100%);
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea {
  color: var(--text);
}

.shell {
  width: min(1280px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero,
.grid {
  display: grid;
  gap: 16px;
}

.hero {
  padding: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-card,
.posts-card,
.composer-card,
.apk-card {
  grid-column: span 2;
}

.card:not(.hero) {
  padding: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ff8a8a;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.lede,
.muted,
.post-meta,
.post-results {
  color: var(--muted);
  line-height: 1.55;
}

.hero-note,
.card-intro {
  margin-bottom: 0;
}

.hero-actions,
.section-head,
.status-stack,
.platform-picks,
.post-actions,
.post-topline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head,
.post-topline {
  justify-content: space-between;
  align-items: flex-start;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
}

.button.accent {
  background: linear-gradient(135deg, var(--gold), #ff8a00);
  color: #251402;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.badge.on {
  color: #d8ffe2;
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.18);
}

.badge.off {
  color: #ffd5d5;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.16);
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.stat-card,
.connect-jump,
.post-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 1.8rem;
}

.connect-strip {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connect-jump {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
}

.connect-jump span {
  color: var(--muted);
}

.login-card {
  align-self: start;
}

.badge.subtle {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  resize: vertical;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.post-list {
  display: grid;
  gap: 12px;
}

.apk-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.post-card {
  padding: 16px;
}

.post-card p {
  margin-bottom: 0;
}

.post-status {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.08);
}

.post-status.queued {
  color: #ffd98a;
}

.post-status.publishing {
  color: #b7d9ff;
}

.post-status.published {
  color: #b9ffd0;
}

.post-status.failed,
.post-status.canceled {
  color: #ffb7b7;
}

.post-meta {
  margin-top: 8px;
  font-size: 0.92rem;
}

.post-results {
  margin-top: 12px;
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(400px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(12, 13, 15, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

@media (max-width: 960px) {
  .shell {
    width: min(100vw, calc(100vw - 16px));
  }

  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .overview-card,
  .posts-card,
  .composer-card {
    grid-column: span 1;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connect-strip {
    grid-template-columns: 1fr;
  }

  .apk-card {
    flex-direction: column;
    align-items: stretch;
  }
}
