:root {
  --primary-color: #df3434;
  --primary-hover: #c12c2c;
  --background: #161b23;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-solid: #1a222d;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #7b8494;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 0.5rem;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--background);
  background-image:
    linear-gradient(90deg, rgba(128, 128, 128, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(128, 128, 128, 0.05) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 25% 40%, rgba(151, 117, 250, 0.08), transparent 50%),
    radial-gradient(50% 50% at 85% 85%, rgba(34, 211, 238, 0.06), transparent 50%);
}

.container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-mark {
  color: var(--primary-color);
  display: inline-flex;
  line-height: 0;
}

.brand-text { letter-spacing: -0.02em; }

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: inherit;
}

.btn:hover { background: rgba(255, 255, 255, 0.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary-color);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--text-primary);
}
.btn-outline:hover { background: rgba(223, 52, 52, 0.12); }
.btn.wide { width: 100%; justify-content: center; margin-top: 14px; padding: 12px 16px; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(14px);
}

.stat-card { padding: 16px 18px; }
.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.stat-soft { color: var(--text-muted); font-weight: 600; font-size: 0.72em; }
.stat-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

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

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s ease;
}
.tab.active {
  background: var(--primary-color);
  border-color: transparent;
  color: #fff;
}
.tab:not(.active):hover { background: var(--surface); }

.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.avatar.ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.profile-name { font-size: 18px; font-weight: 700; }
.role { color: var(--text-muted); font-weight: 500; font-size: 0.9em; }
.profile-sub { color: var(--text-muted); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.badge.success {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.info-cell {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-height: 84px;
}
.info-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.info-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.block { margin-top: 8px; margin-bottom: 16px; }
.block-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.copy-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}
.copy-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 12px 14px;
  font: inherit;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.copy-btn {
  border-radius: 0;
  border: 0;
  border-left: 1px solid var(--border);
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.hint a { color: #fca5a5; }

.review-list { display: grid; gap: 8px; }
.review-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.16);
}
.review-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  align-items: center;
}
.review-item p {
  color: var(--text-secondary);
  font-size: 14px;
}
.pill {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.empty { color: var(--text-muted); font-size: 14px; }

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.plat {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s ease;
}
.plat.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(223, 52, 52, 0.35), 0 0 18px rgba(223, 52, 52, 0.18);
}

.source-cards {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.source-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.16);
  transition: 0.15s ease;
}
.source-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(223, 52, 52, 0.25);
}
.source-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.star { color: var(--primary-color); }
.source-status { font-size: 13px; color: var(--text-muted); }
.source-status.on { color: #6ee7b7; }
.source-status.off { color: var(--warning); }

.accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}
.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "▾";
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.accordion[open] summary::after { transform: rotate(180deg); }
.accordion-body {
  padding: 0 14px 14px;
  color: var(--text-secondary);
  font-size: 14px;
}
.accordion-body ul {
  margin: 8px 0 0 18px;
}
.accordion-body code,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #fecaca;
}

@media (max-width: 720px) {
  .stats-row,
  .info-grid { grid-template-columns: 1fr; }
  .logo { font-size: 20px; }
  .stat-value { font-size: 24px; }
}
