:root {
  --bg: #ededeb;
  --fg: #000;
  --border: #ddd;
  --muted: #888;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1b;
    --fg: #eee;
    --border: #3a3a3a;
    --muted: #999;
  }
}

html {
  color-scheme: light dark;
}

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  font-family: Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

header select {
  padding: 4px 6px;
}

header h1 {
  font-size: 16px;
  margin: 0;
}

#conference.hidden {
  display: none;
}

#status {
  color: var(--muted);
  font-size: 13px;
}

#generated {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

#cy {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

#legend {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 12px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 12px;
  max-height: 60px;
  overflow-y: auto;
  cursor: pointer;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item .swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 2px;
}

.legend-item.dimmed {
  opacity: 0.35;
}

@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  header h1 {
    font-size: 18px;
    width: 100%;
  }

  header select,
  header label,
  header #status {
    font-size: 14px;
  }

  header select {
    padding: 6px 6px;
  }

  header label {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
  }

  header label input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  #legend {
    max-height: 72px;
    font-size: 13px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
}
