:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #111827;
  color: #f9fafb;
}

body {
  margin: 0;
}

.shell {
  width: min(920px, calc(100vw - 40px));
  margin: 32px auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

p {
  margin: 6px 0 0;
  color: #9ca3af;
}

h2 {
  font-size: 18px;
}

a {
  color: #67e8f9;
}

/* .button gives an <a> the same look as the yellow <button>. Setting an explicit display here is
   what makes the [hidden] override below necessary: an author-stylesheet display rule always beats
   the user-agent's [hidden] { display: none }, regardless of selector specificity, so without the
   override a hidden .button would still take layout space and be clickable. */
.button {
  display: inline-block;
  justify-self: start;
  padding: 10px 14px;
  color: #111827;
  background: #fbbf24;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: #f59e0b;
}

[hidden] {
  display: none !important;
}

.panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 20px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
}

.grid-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.stats div {
  min-width: 0;
  padding: 12px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
}

dt {
  color: #9ca3af;
  font-size: 12px;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-row img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: #d1d5db;
  font-size: 14px;
}

input,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  color: #f9fafb;
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 6px;
  font: inherit;
}

.url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hint {
  margin: 0;
  color: #9ca3af;
  font-size: 13px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check input {
  width: auto;
}

button {
  justify-self: start;
  padding: 10px 14px;
  color: #111827;
  background: #fbbf24;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #f59e0b;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  color: #f9fafb;
  background: #374151;
}

button.secondary:hover {
  background: #4b5563;
}

button.secondary.is-active {
  background: #c41230;
  border-color: #e8153a;
}

select.authed-control:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.danger {
  color: #f9fafb;
  background: #b91c1c;
}

button.danger:hover {
  background: #991b1b;
}

.event-log {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px;
  max-height: 180px;
  overflow: auto;
  list-style: none;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 13px;
}

.event-log:empty::before {
  content: "Nothing sent yet.";
  color: #9ca3af;
}

#overlayPreview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #241018 0%, #050508 100%);
}

@media (max-width: 760px) {
  header,
  .grid-panel {
    grid-template-columns: 1fr;
  }

  header {
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    justify-content: flex-start;
  }
}
