/* Design tokens first; everything below uses them. Change the look here, not in components. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --border: #deded8;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* The social card (public/admin/roster-card.js). Not overridden for dark mode: the posted image
     mustn't depend on the machine that exported it. */
  --card-bg: #ffffff;
  --card-band: #0055ff;
  --card-band-text: #ffffff;
  --card-text: #000000;
  --card-muted: #4b5563;
  --card-accent: #0055ff;
  --card-rule: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1d;
    --text: #ececea;
    --muted: #a0a09a;
    --border: #34342f;
    --accent: #7c9cff;
    --accent-text: #0d0d0c;
    --danger: #ff8a80;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* `hidden` always hides. Without this, any rule that sets `display` (labels here are flex) beats the
   browser's own [hidden] rule, and a field meant to appear conditionally shows all the time. */
[hidden] {
  display: none !important;
}

/* Keyboard focus is always visible; mouse clicks don't draw it. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-3);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

h1 {
  font-size: 1.25rem;
  margin: 0;
}

h2 {
  font-size: 1rem;
  margin: 0;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--muted);
  font-size: 0.875rem;
}

input,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
}

.btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--accent-text);
  align-self: flex-start;
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.list-item p {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
  padding: var(--space-3) 0;
}

.muted {
  color: var(--muted);
}

.flash {
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
