:root {
  --bg: #f7f4ee;
  --bg-spot: #efe4cf;
  --surface: #fffdf8;
  --ink: #1f2937;
  --muted: #596273;
  --accent: #0f766e;
  --border: #d8d5cf;
  --danger: #b91c1c;
  --status-ok: #596273;
  --status-error: #b91c1c;
}

html[data-theme="dark"] {
  --bg: #111827;
  --bg-spot: #1f2937;
  --surface: #1b2432;
  --ink: #e5e7eb;
  --muted: #94a3b8;
  --accent: #14b8a6;
  --border: #334155;
  --danger: #ef4444;
  --status-ok: #94a3b8;
  --status-error: #f87171;
}

* {
  box-sizing: border-box;
}

html.theme-animating *,
html.theme-animating *::before,
html.theme-animating *::after {
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html.theme-animating *,
  html.theme-animating *::before,
  html.theme-animating *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, var(--bg-spot) 0%, var(--bg) 45%);
  color: var(--ink);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

header h1 {
  margin-bottom: 4px;
}

header {
  display: grid;
  justify-items: end;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  font-size: 32px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

#podium-card.podium-active-self {
  border-color: #0ea5a0;
  box-shadow: 0 0 0 2px rgba(14, 165, 160, 0.28), 0 0 26px rgba(14, 165, 160, 0.3);
}

#display-podium-card {
  border-color: #0ea5a0;
  box-shadow: 0 0 0 2px rgba(14, 165, 160, 0.2), 0 0 22px rgba(14, 165, 160, 0.22);
}

#display-podium-name {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin: 6px 0;
}

#display-queue li {
  font-size: 22px;
  padding: 12px;
}

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

.hidden {
  display: none !important;
}

form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.actions input {
  min-width: 220px;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

button.danger {
  background: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

li,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  display: grid;
  gap: 8px;
}

li {
  list-style-position: inside;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.participant-row .actions {
  margin: 0;
  flex-wrap: nowrap;
}

.participant-main {
  min-width: 0;
  flex: 1;
}

.participant-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.meeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.meeting-row strong {
  display: block;
}

.meeting-row .role {
  margin-top: 2px;
}

.role {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.display-header {
  margin: 0 0 12px;
}

.display-header h2 {
  margin: 0 0 2px;
}

#status {
  min-height: 1.2em;
  color: var(--status-ok);
}

@media (max-width: 620px) {
  #meeting-view > .card > .actions {
    flex-direction: column;
    align-items: stretch;
  }

  #meeting-view > .card > .actions button,
  #meeting-view > .card > .actions input {
    width: 100%;
  }

  #meeting-view > .card > .actions button {
    white-space: nowrap;
  }

  .brand-link {
    font-size: 28px;
  }

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

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

  .participant-row .actions {
    width: 100%;
    justify-content: flex-end;
  }

  .meeting-row {
    flex-direction: column;
    align-items: stretch;
  }

  .meeting-row .actions {
    justify-content: flex-end;
  }

  .actions input {
    min-width: 0;
    flex: 1;
  }

  button {
    min-height: 40px;
  }

  .app {
    padding: 16px 12px 28px;
  }
}
