:root {
  --bg: #000;
  --panel: #111;
  --panel-border: #2a2a2a;
  --text: #e6e6e6;
  --muted: #8a8a8a;
  --accent: #1d9bf0;
  --danger: #f35369;
  --brand-winner: #fca5a5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.site-header {
  padding-top: 16px;
  padding-bottom: 4px;
}

.user-bar {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 0 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.user-bar span {
  color: var(--muted);
  font-size: 13px;
}

.user-bar button {
  width: auto;
  min-width: 90px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #2f6fa1;
  border-radius: 999px;
  color: #9dd4ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  background: #0b2237;
}

.admin-link:hover {
  background: #143351;
}

.auth-gate {
  max-width: 560px;
  margin: 24px auto;
}

body.auth-page .auth-gate {
  margin: 12vh auto 0;
}

.auth-sent {
  margin-top: 8px;
  border: 1px solid #285a3a;
  background: linear-gradient(180deg, #112217, #0c1710);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}

.auth-sent h3 {
  margin: 8px 0;
  color: #b6f2c1;
  font-size: 28px;
  line-height: 1.1;
}

.auth-sent p {
  margin: 0;
  color: #d6f7dc;
  font-size: 15px;
}

.auth-sent-icon {
  font-size: 40px;
  color: #7be098;
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(123, 224, 152, 0.35));
  animation: authIconFloat 1.9s ease-in-out infinite;
}

@keyframes authIconFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
  100% {
    transform: translateY(0);
  }
}

.auth-gate p {
  color: var(--muted);
  margin-top: 0;
}

.marketing-link {
  width: auto;
  min-width: 140px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.marketing-link.secondary {
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
}

.hidden {
  display: none !important;
}

.integrations-panel {
  position: sticky;
  top: 18px;
  height: fit-content;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 18px;
}

.admin-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 980px;
}

.admin-intro p {
  margin: 0 0 8px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tab-btn {
  width: auto;
  min-width: 120px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: #151515;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.admin-tab-btn.active {
  border-color: #3a7db0;
  background: #0f2e49;
}

.admin-panel h3 {
  margin-bottom: 8px;
}

.admin-panel-heading {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 6px;
}

.admin-steps {
  margin: 0 0 12px;
  padding-left: 18px;
}

.admin-steps li {
  margin-bottom: 6px;
}

.admin-step-item {
  margin-bottom: 10px;
}

.admin-step-title {
  margin: 0 0 4px;
}

.admin-step-details {
  margin: 0 0 2px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #0d0d0d;
  padding: 6px 8px;
}

.admin-step-summary {
  cursor: pointer;
  font-size: 12px;
  color: #9dd4ff;
  font-weight: 700;
}

.admin-substeps {
  margin: 8px 0 2px;
  padding-left: 18px;
}

.admin-substeps li {
  margin-bottom: 4px;
  font-size: 13px;
}

.admin-env-list,
.admin-docs-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.admin-env-item {
  border-top: 1px solid var(--panel-border);
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-env-item:first-child {
  border-top: 0;
}

.admin-env-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
}

.admin-edit-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-edit-row {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid var(--panel-border);
}

.admin-edit-row:first-child {
  border-top: 0;
}

.admin-edit-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.admin-edit-input {
  width: 100%;
  height: 36px;
}

.admin-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.admin-save-btn,
.admin-clear-btn {
  width: auto;
  min-width: 84px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.admin-save-btn {
  background: #0f2e49;
  border-color: #3a7db0;
}

.admin-clear-btn {
  background: #2a161b;
  border-color: #6a2b35;
}

.admin-action-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.integrations-panel h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.brand {
  font-size: 44px;
  line-height: 1;
  font-family: 'Bungee', sans-serif;
  letter-spacing: 1px;
  color: transparent;
  -webkit-text-stroke: 1px var(--brand-winner);
  text-transform: uppercase;
}

.main-column {
  padding-top: 6px;
}

.hint {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand-mark {
  height: 42px;
  width: auto;
  display: inline-block;
}

.brand-mark-left {
  transform: scaleX(-1);
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px;
  margin: 12px;
}

h2,
h3 {
  margin: 0 0 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

textarea,
input,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: #0b0b0b;
  color: var(--text);
}

input,
button {
  height: 40px;
  padding: 0 10px;
}

input[type='file'] {
  height: auto;
  min-height: 42px;
  padding: 8px 10px;
  line-height: 1.2;
  display: block;
}

input[type='file']::file-selector-button {
  border: 1px solid var(--panel-border);
  background: #1e1e1e;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 600;
}

textarea {
  resize: vertical;
  min-height: 110px;
  padding: 10px;
}

.composer-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.composer-row button {
  max-width: 320px;
  background: var(--accent);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

#counter {
  color: var(--muted);
  font-size: 12px;
}

.counter-row {
  margin-top: 6px;
  margin-bottom: 12px;
}

.status {
  margin-top: 8px;
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.selection-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  border-top: 1px solid var(--panel-border);
  padding: 12px 0;
}

.feed-item:first-child {
  border-top: 0;
}

.feed-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.feed-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.feed-link:hover {
  text-decoration: underline;
}

.platform-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.platform-list li {
  border-top: 1px solid var(--panel-border);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.platform-list li:first-child {
  border-top: 0;
}

.platform-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-name {
  font-size: 15px;
}

.platform-right {
  padding-left: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 26px;
}

.platform-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #555;
}

.integration-check {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.badge {
  display: inline-block;
  width: 118px;
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
}

.badge.live {
  color: #88df9a;
  border-color: #2f5b3c;
}

.badge.coming-soon {
  color: #ffb347;
  border-color: #ffb347;
}

.platform-handle {
  font-size: 12px;
  color: var(--muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connect-btn {
  width: auto;
  min-width: 86px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #1a1a1a;
  color: #f1f1f1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 12px;
}

.connect-btn:hover {
  border-color: #585858;
  background: #222;
}

.connect-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  border-color: #2f2f2f;
  background: #151515;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: #101010;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 18px;
}

.modal-card p {
  margin: 10px 0;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-primary-btn,
.modal-secondary-btn {
  width: auto;
  height: 38px;
  border-radius: 9px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.modal-primary-btn {
  border: 0;
  background: #ff0000;
  color: #fff;
}

.modal-secondary-btn {
  border: 1px solid #3a3a3a;
  background: #171717;
  color: #fff;
}

.modal-note {
  font-size: 12px;
  min-height: 18px;
}

.modal-links {
  margin: 8px 0 0;
  padding-left: 16px;
}

.modal-links a {
  color: var(--accent);
  text-decoration: none;
}

.modal-links a:hover {
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid #1b1b1b;
  margin-top: 10px;
  padding: 20px 18px 26px;
  color: var(--muted);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 640px;
  }

  .integrations-panel {
    position: static;
  }

  .brand {
    font-size: 36px;
  }

  .brand-mark {
    height: 34px;
  }

  .footer-inner {
    flex-direction: column;
  }
}
