:root {
  color-scheme: dark;
  --bg: #0c0f12;
  --bg-soft: #11161b;
  --panel: #151b21;
  --panel-soft: #10151a;
  --panel-raised: #1a2128;
  --line: #2b343d;
  --line-strong: #3a4650;
  --text: #f4f7f8;
  --muted: #99a4ad;
  --muted-strong: #c2c9ce;
  --accent: #36d399;
  --accent-strong: #72e4b6;
  --accent-ink: #07150f;
  --warn: #f6c766;
  --danger: #ff6b6b;
  --focus: rgba(54, 211, 153, 0.34);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #0d1013 0%, #0a0c0f 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(54, 211, 153, 0.06), transparent 34%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.marketing-shell,
.account-shell,
.login-shell {
  width: min(94vw, 1180px);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero-card {
  min-height: min(760px, calc(100vh - 4rem));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5.5rem) 0;
}

.account-card {
  min-width: 0;
}

.settings-stack {
  display: grid;
  gap: 1rem;
}

.login-card,
.section-card,
.feature-card,
.info-card,
.download-card,
.summary-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 33, 0.96);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(92vw, 520px);
  padding: clamp(1.4rem, 4vw, 2.1rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-card h1,
.login-card h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 12ch;
}

.login-card h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  max-width: none;
}

.lead {
  margin: 1.1rem 0 0;
  max-width: 44rem;
  color: var(--muted-strong);
  font-size: 1.03rem;
  line-height: 1.75;
}

.hero-actions,
.account-actions,
.login-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.76rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #1b232a;
  text-decoration: none;
  font-weight: 750;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #52606b;
  background: #222b33;
}

.btn:focus-visible,
.field input:focus,
.field textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--accent);
}

.btn.primary {
  color: var(--accent-ink);
  border-color: rgba(114, 228, 182, 0.7);
  background: var(--accent);
}

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

.btn.danger {
  color: #ffecec;
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(122, 31, 31, 0.62);
}

.btn.danger:hover {
  border-color: rgba(255, 107, 107, 0.72);
  background: rgba(153, 42, 42, 0.78);
}

.btn.disabled,
.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.feature-grid,
.info-grid,
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.account-card .download-grid {
  grid-template-columns: 1fr;
}

.feature-card,
.info-card,
.download-card,
.section-card {
  padding: 1.15rem;
}

.feature-card h2,
.info-card h2,
.download-card h2,
.section-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.feature-card p,
.info-card p,
.download-card p,
.section-card p,
.section-card li,
.footnote,
.meta-row {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-card {
  background: rgba(17, 22, 27, 0.92);
}

.footnote {
  margin-top: 1.25rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.1rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  margin-top: 0.15rem;
}

.account-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.section-card {
  margin-top: 1rem;
}

.section-card:first-child {
  margin-top: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.settings-form {
  margin-top: 1rem;
}

.compact-actions {
  margin-top: 1rem;
}

.form-divider {
  height: 1px;
  margin: 1.35rem 0;
  background: rgba(255, 255, 255, 0.08);
}

.compact-heading {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.field-help {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 650;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #0c1115;
}

.field input:disabled {
  color: #8e99a2;
  background: #10151a;
  cursor: not-allowed;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.meta-list {
  display: grid;
  gap: 0.68rem;
}

.meta-row strong {
  display: inline-block;
  min-width: 150px;
  color: var(--text);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #202830;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-chip.good {
  border-color: rgba(54, 211, 153, 0.5);
  background: rgba(54, 211, 153, 0.15);
  color: #d8ffef;
}

.status-chip.bad {
  border-color: rgba(255, 107, 107, 0.52);
  background: rgba(255, 107, 107, 0.13);
  color: #ffe3e3;
}

.status-chip.pending {
  border-color: rgba(246, 199, 102, 0.42);
  background: rgba(246, 199, 102, 0.12);
  color: #ffefc5;
}

.inline-form {
  margin: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.section-title-row .eyebrow {
  margin-bottom: 0.35rem;
}

.twitch-card {
  border-color: rgba(145, 71, 255, 0.34);
}

.twitch-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(145, 71, 255, 0.5);
  border-radius: 8px;
  background: rgba(145, 71, 255, 0.16);
  color: #d7c3ff;
}

.twitch-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fine-details {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fine-details summary {
  padding-top: 0.95rem;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 750;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #151b21;
}

.flash.success {
  border-color: rgba(54, 211, 153, 0.44);
  color: #d8ffef;
}

.flash.error {
  border-color: rgba(255, 107, 107, 0.46);
  color: #ffe3e3;
}

.flash.info {
  border-color: rgba(114, 228, 182, 0.34);
  color: #e6fff5;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card form {
  display: grid;
  gap: 1rem;
  margin-top: 1.35rem;
}

.remember-field {
  color: var(--muted);
}

.remember-field input,
.checkbox-field input {
  accent-color: var(--accent);
}

.helper-file {
  font-size: 0.96rem;
}

.obs-list {
  margin: 0;
  padding-left: 1.1rem;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-metric {
  padding: 1rem 1.1rem;
  background: var(--panel);
}

.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-metric strong {
  font-size: 1.35rem;
}

.user-list,
.user-directory {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.user-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.compact-meta {
  margin-top: 1rem;
}

.admin-user-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 650;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.card-actions-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.9rem;
}

.admin-note {
  color: var(--muted);
}

.user-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.user-link-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.admin-link-hint {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 900px) {
  .admin-grid,
  .account-grid,
  .feature-grid,
  .info-grid,
  .download-grid,
  .field-grid,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-actions,
  .login-actions,
  .hero-actions {
    width: 100%;
  }

  .account-actions .btn,
  .login-actions .btn,
  .hero-actions .btn {
    flex: 1 1 190px;
  }
}

@media (max-width: 560px) {
  .marketing-shell,
  .account-shell,
  .login-shell {
    width: min(92vw, 1180px);
    padding-top: 1rem;
  }

  .hero-card {
    min-height: auto;
    padding: 3.5rem 0 2rem;
  }

  .user-card-header {
    flex-direction: column;
  }

  .user-card-chips {
    justify-content: flex-start;
  }
}
