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

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: inherit; }

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #1a1a1a;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.brand small {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-link {
  text-decoration: none;
  font-size: 0.85rem;
  color: #888;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* Landing page */
.landing {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.landing h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.landing p {
  color: #666;
  font-size: 0.95rem;
  max-width: 40ch;
  line-height: 1.5;
}

/* Buttons */
.button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 14px 32px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.button:hover { opacity: 0.85; }
.button:disabled { cursor: not-allowed; opacity: 0.4; }

.button-primary {
  background: #fff;
  color: #0a0a0a;
}

.button-big {
  padding: 18px 48px;
  font-size: 1.1rem;
  border-radius: 10px;
  margin-top: 8px;
}

.button-secondary {
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #2a2a2a;
}

.button-ghost {
  background: transparent;
  color: #666;
  border: 1px solid #222;
}

/* Dashboard */
.dash-header {
  text-align: center;
  margin-bottom: 32px;
}

.dash-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.dash-header .sub {
  color: #555;
  font-size: 0.85rem;
  margin-top: 4px;
}

.status-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #222;
}

.pill-live {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

/* Cards */
.grid {
  display: grid;
  gap: 16px;
  width: 100%;
}

.two-up {
  grid-template-columns: 1fr 1fr;
}

.card {
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 20px;
}

.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.muted {
  color: #555;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

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

.account-row strong {
  font-size: 0.9rem;
  color: #ccc;
}

/* Facts */
.facts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.facts div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid #1a1a1a;
  font-size: 0.85rem;
}

.facts dt { color: #555; }
.facts dd { margin: 0; color: #aaa; text-align: right; word-break: break-all; }

/* Forms */
.stack-form {
  display: grid;
  gap: 12px;
}

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

.stack-form span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #222;
  background: #0a0a0a;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.9rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #333;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.checkbox-row input { width: auto; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.action-row-tight {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row-tight form { margin: 0; }

/* Personal Spotify app setup */
.spotify-app-card {
  width: 100%;
  margin: 16px 0;
}

.spotify-app-card summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  list-style-position: inside;
}

.spotify-app-card summary small {
  color: #22c55e;
  font-size: 0.72rem;
  font-weight: 600;
}

.spotify-app-body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1a1a1a;
}

.setup-intro {
  margin-bottom: 0;
  line-height: 1.5;
}

.setup-steps {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  color: #aaa;
  font-size: 0.85rem;
  line-height: 1.5;
}

.setup-steps a {
  color: #e0e0e0;
}

.copy-field {
  display: grid;
  gap: 4px;
}

.copy-field span {
  color: #888;
  font-size: 0.82rem;
  font-weight: 600;
}

.copy-field input {
  color: #aaa;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.field-help {
  color: #666;
  font-size: 0.78rem;
  line-height: 1.45;
}

.hosted-app-form {
  margin-top: -4px;
}

.switch-warning {
  padding-top: 8px;
  border-top: 1px solid #1a1a1a;
}

/* Optional current-song chat commands */
.song-command-card {
  width: 100%;
  margin: 0 0 16px;
}

.song-command-card .account-row {
  align-items: flex-start;
}

.song-command-card h2 {
  margin-bottom: 6px;
}

.song-command-card .muted {
  max-width: 54ch;
  line-height: 1.5;
  margin-bottom: 0;
}

.song-command-card code {
  color: #bbb;
  font-family: Consolas, "Courier New", monospace;
}

/* Flash messages */
.flash {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid #1a1a1a;
  background: #111;
}

.flash-success { border-color: rgba(34, 197, 94, 0.3); color: #22c55e; }
.flash-error { border-color: rgba(239, 68, 68, 0.3); color: #ef4444; }
.flash-info { border-color: rgba(59, 130, 246, 0.3); color: #3b82f6; }

.inline-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #1a1a1a;
  color: #888;
}

.inline-note.warn {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

@media (max-width: 640px) {
  .two-up { grid-template-columns: 1fr; }
  .account-row { flex-direction: column; align-items: flex-start; }
}
