html, body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f1115;
  color: #f3f4f6;
}

a {
  color: #8ab4ff;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #232833;
  background: #131722;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.9rem;
  color: #a8b0bf;
}

.nav {
  display: flex;
  gap: 1rem;
}

.content {
  padding: 1.5rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card, .index-card, .commands-card, .integrations-card, .overlays-card {
  padding: 1rem;
  border: 2px solid #b0b0b0 !important;
  border-radius: 0.7rem;
  background: #151b27;
}

.status-pill {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill--ok {
  background: #1c3a28;
  color: #7ff2a9;
}

.status-pill--error {
  background: #3f1e24;
  color: #ff9aa9;
}

.status-pill--warn {
  background: #3f371e;
  color: #ffd873;
}

.status-info {
  color: #b9c3d4;
}

.status-error {
  color: #ff9aa9;
}

.status-refresh-btn {
  margin-top: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid #2d3341;
  border-radius: 8px;
  background: #1b2230;
  color: #f3f4f6;
  cursor: pointer;
}

.status-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.status-input {
  min-width: 260px;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #2d3341;
  background: #101622;
  color: #f3f4f6;
}

.broadcaster-live-inline-label {
  margin-left: 0.6rem;
}

.card-divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid #232833;
}

.chat-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.chat-toggle-label {
  font-weight: 600;
}

.chat-switch-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.chat-switch-label {
  color: #a8b0bf;
  font-weight: 600;
}

.chat-switch-label-selected {
  color: #f3f4f6;
}

.chat-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.chat-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.chat-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #384052;
  border-radius: 999px;
  transition: 0.2s ease;
}

.chat-switch-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: #f3f4f6;
  border-radius: 50%;
  transition: 0.2s ease;
}

.chat-switch input:checked + .chat-switch-slider {
  background: #1f5e3a;
}

.chat-switch input:checked + .chat-switch-slider::before {
  transform: translateX(22px);
}

.chat-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.chat-account-card {
  border: 1px solid #232833;
  border-radius: 10px;
  padding: 0.8rem;
  background: #101622;
}

.twitch-chat-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 1.25fr);
  gap: 1rem;
  align-items: start;
}

.twitch-chat-right {
  min-width: 0;
}

.chat-panel {
  margin-top: 0;
}

.chat-log {
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  margin: 0.6rem 0;
  padding: 0.6rem;
  border: 1px solid #2d3341;
  border-radius: 8px;
  background: #0c111a;
}

@media (max-width: 1100px) {
  .twitch-chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    margin-top: 0.8rem;
  }
}

.chat-log-empty {
  margin: 0;
  color: #a8b0bf;
}

.chat-line {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

.chat-line-system {
  color: #9fc9ff;
}

.chat-time {
  color: #a8b0bf;
  margin-right: 0.4rem;
}

.chat-sender {
  color: #7ff2a9;
  margin-right: 0.35rem;
}

.oauth-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 18, 0.8);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.oauth-dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #151b27;
  border: 1px solid #2d3341;
  border-radius: 12px;
  padding: 1rem;
}

.oauth-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.oauth-close-btn {
  margin-top: 0;
}

.oauth-dialog-frame-wrap {
  border: 1px solid #2d3341;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.6rem;
}

.oauth-dialog-frame {
  width: 100%;
  min-height: 600px;
  border: 0;
  background: #101622;
}
