:root {
  --bg: #0d0911;
  --bg-2: #150e19;
  --panel: rgba(25, 18, 30, .82);
  --panel-strong: rgba(31, 22, 37, .96);
  --line: rgba(242, 166, 90, .14);
  --line-strong: rgba(232, 93, 117, .28);
  --text: #fbf7f2;
  --muted: #b4a7b7;
  --muted-2: #7c6d83;
  --copper: #f2a65a;
  --rose: #e85d75;
  --violet: #9b6bff;
  --plum: #2b1830;
  --danger: #ff4d6d;
  --radius: 8px;
  --shadow: 0 28px 90px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 8%, rgba(155,107,255,.22), transparent 28rem),
    radial-gradient(circle at 18% 20%, rgba(232,93,117,.18), transparent 26rem),
    linear-gradient(145deg, #0d0911 0%, #120c18 52%, #0a0810 100%);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "ss01" 1, "cv01" 1;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 16px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 9, 17, .78);
  backdrop-filter: blur(18px);
}

.site-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-brand img,
.brand img {
  width: 42px;
  height: 42px;
}

.site-brand span,
.brand strong {
  font-family: "Space Grotesk", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-nav nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav nav a:hover { color: var(--text); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(42px, 7vw, 92px) clamp(18px, 5vw, 72px);
}

.hero-copy-block {
  max-width: 740px;
}

.hero-art {
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line-strong);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-family: "Space Grotesk", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(42px, 6.6vw, 78px);
  line-height: .98;
  letter-spacing: 0;
}
h2 {
  margin-bottom: 14px;
  font-family: "Space Grotesk", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.04;
}
p {
  color: var(--muted);
  line-height: 1.62;
}

.hero-copy {
  max-width: 650px;
  font-size: 18px;
}

.hero-actions,
.top-actions,
.check-row,
.tweet-actions,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--text);
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.primary-btn {
  color: #150a0f;
  font-weight: 850;
  background: linear-gradient(135deg, var(--copper), var(--rose));
  box-shadow: 0 16px 36px rgba(232,93,117,.2);
}

.ghost-btn {
  background: rgba(255,255,255,.055);
  border-color: var(--line);
}

.danger-btn {
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.32);
  color: #ffb0bf;
}

.ghost-btn:hover,
.danger-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.09);
}

.site-section {
  padding: clamp(56px, 8vw, 100px) clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 34px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: rgba(10, 7, 13, .72);
}

.site-footer .site-brand {
  margin-bottom: 10px;
}

.site-footer p {
  max-width: 520px;
  margin-bottom: 0;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer small {
  grid-column: 1 / -1;
  color: var(--muted-2);
}

.image-split {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.image-split.reverse {
  grid-template-columns: minmax(320px, 1fr) minmax(0, .9fr);
}

.image-split > img {
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.section-copy {
  max-width: 760px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.feature-list span,
.feature-grid article,
.workflow-list,
.panel,
.metric,
.empty-state,
.group-panel,
.system-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

.feature-list span {
  padding: 12px 14px;
}

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

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

.feature-grid article {
  padding: 16px;
}

.feature-grid strong {
  display: block;
  margin-bottom: 8px;
}

.feature-grid p {
  margin-bottom: 0;
  font-size: 14px;
}

.workflow-list {
  margin: 20px 0 0;
  padding: 22px 22px 22px 42px;
  color: var(--muted);
  line-height: 1.9;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 330px;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
}

.admin-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar,
.inspector {
  background: rgba(13, 9, 17, .76);
  backdrop-filter: blur(22px);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.inspector {
  border-left: 1px solid var(--line);
  padding: 24px 18px;
}

.app-footer {
  grid-column: 2 / -1;
  border-top: 1px solid var(--line);
  padding: 14px 26px;
  color: var(--muted-2);
  background: rgba(13, 9, 17, .62);
}

.brand {
  margin-bottom: 32px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.nav-item.active,
.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--line);
}

.system-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px;
}
.system-card small,
.muted { color: var(--muted); }

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 8px rgba(232,93,117,.11), 0 0 24px rgba(232,93,117,.34);
}
.muted-pulse {
  background: var(--muted-2);
  box-shadow: 0 0 0 8px rgba(124,109,131,.12);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar h1 {
  font-family: "Space Grotesk", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 32px;
  line-height: 1.1;
  margin-bottom: 0;
}

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

.metric { padding: 16px; }
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.metric strong { font-size: 26px; }

.view { display: none; }
.view.active { display: block; }

.section-head {
  justify-content: space-between;
  margin: 20px 0 14px;
}
.section-head p {
  margin-bottom: 0;
  max-width: 680px;
}

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  min-width: 0;
  padding: 18px;
}
.panel form,
form.panel,
.admin-login-card {
  display: grid;
  gap: 14px;
}
.panel h2,
.modal-card h2 {
  overflow-wrap: anywhere;
}
.panel p,
.modal-card p {
  max-width: 100%;
}
.admin-login-card {
  width: min(520px, 100%);
  margin-top: 22px;
}
.admin-shell .grid.two {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: start;
}
.admin-shell .main {
  padding: clamp(20px, 3vw, 34px);
}
.admin-shell .panel {
  padding: clamp(18px, 2.2vw, 24px);
}
.admin-shell .panel h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}
.admin-shell .panel p {
  margin-bottom: 18px;
}
.panel.dark {
  margin-bottom: 16px;
  background: rgba(15, 10, 19, .84);
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.055);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(242,166,90,.72);
  box-shadow: 0 0 0 3px rgba(242,166,90,.14);
}
textarea { min-height: 104px; resize: vertical; }
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.trigger-groups,
.tweet-list {
  display: grid;
  gap: 14px;
}

.group-panel { overflow: hidden; }
.group-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.group-header > *,
.tweet-head > *,
.list-row > *,
.metric > *,
.system-card > *,
.note-grid span {
  min-width: 0;
}
.group-header span {
  color: var(--muted);
  font-size: 13px;
}

.tweet-card {
  border-bottom: 1px solid var(--line);
  padding: 16px;
}
.tweet-card:last-child { border-bottom: 0; }
.tweet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.tweet-head strong {
  color: var(--text);
  overflow-wrap: anywhere;
}
.tweet-text {
  margin: 12px 0;
  color: #fbf3ea;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.suggestion {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  color: #ffd8b7;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.stack-list,
.pill-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.list-row,
.pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.052);
  padding: 10px 12px;
}
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}
.list-row strong,
.list-row .muted,
.pill,
.empty-state,
.form-message,
.notice {
  overflow-wrap: anywhere;
}
.admin-shell .list-row {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
}
.admin-shell .list-row > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.license-actions .ghost-btn,
.license-actions .danger-btn {
  min-height: 36px;
  padding: 8px 11px;
}
.license-key {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  color: var(--copper);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
}
.pill { color: #ffd8b7; }

.status-pill {
  align-self: flex-start;
  border-radius: 99px;
  border: 1px solid rgba(242,166,90,.3);
  background: rgba(242,166,90,.09);
  color: #ffd8a6;
  padding: 4px 8px;
  font-size: 12px;
}
.status-pill.revoked,
.status-pill.banned {
  color: #ffbac7;
  border-color: rgba(255,77,109,.3);
  background: rgba(255,77,109,.1);
}

.empty-state {
  padding: 34px;
  text-align: center;
}
.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}
.empty-state p {
  max-width: 560px;
  margin: 0 auto;
}

.timeline {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}
.note-grid { display: grid; gap: 12px; }
.note-grid div {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.note-grid div:last-child { border-bottom: 0; padding-bottom: 0; }
.note-grid span { color: var(--muted); }

.switch-line,
.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.switch-line input,
.check-row input {
  width: auto;
  flex: 0 0 auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(12px);
}
.modal-card {
  width: min(430px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 12px;
}

.form-message {
  min-height: 20px;
  margin: 2px 0 0;
  color: #ff8aa0;
  font-size: 13px;
}

.form-message.success {
  color: #ff9a77;
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(255,77,109,.34);
  border-radius: var(--radius);
  background: rgba(31, 12, 20, .96);
  color: #ff8aa0;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.notice.success {
  color: #ff9a77;
  border-color: rgba(242,166,90,.38);
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 240px 1fr; }
  .admin-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .inspector { display: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-height: 520px; width: 100%; object-fit: cover; }
  .admin-shell .grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .site-nav nav { display: none; }
  .site-nav { min-height: 68px; }
  .site-footer {
    grid-template-columns: 1fr;
  }
  .site-footer nav {
    flex-wrap: wrap;
  }
  .hero {
    min-height: auto;
    padding-top: 42px;
  }
  .image-split,
  .image-split.reverse,
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .app-footer {
    grid-column: 1;
  }
  .topbar,
  .grid.two,
  .metrics-grid,
  .feature-grid,
  .feature-grid.compact,
  .feature-list {
    grid-template-columns: 1fr;
    display: grid;
  }
  .top-actions,
  .tweet-actions,
  .hero-actions {
    width: 100%;
  }
  .top-actions > *,
  .tweet-actions > *,
  .hero-actions > * {
    flex: 1 1 150px;
  }
  .list-row {
    grid-template-columns: 1fr;
  }
  .license-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .site-nav {
    gap: 12px;
  }
  .site-brand span,
  .brand strong {
    font-size: 15px;
  }
  .site-brand img,
  .brand img {
    width: 36px;
    height: 36px;
  }
  .main,
  .sidebar,
  .inspector {
    padding: 18px 14px;
  }
  .panel,
  .modal-card,
  .empty-state {
    padding: 16px;
  }
  .primary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
    white-space: normal;
  }
  .site-nav .primary-btn,
  .site-nav .ghost-btn,
  .site-nav .danger-btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .admin-shell .list-row > div:last-child,
  .license-actions {
    width: 100%;
  }
  .license-actions > * {
    flex: 1 1 120px;
  }
  .tweet-head,
  .group-header {
    display: grid;
  }
}
