:root {
  color-scheme: light dark;
  --border: #d0d0d8;
  --muted: #666;
  --accent: #2f6feb;
  --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar a { text-decoration: none; color: inherit; }
.topbar .brand { font-weight: 600; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

form.stacked { display: flex; flex-direction: column; gap: 0.75rem; max-width: 640px; }
form.stacked label { font-weight: 600; }
form.stacked textarea, form.stacked input { padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
form.stacked textarea { min-height: 6rem; resize: vertical; }

button, .btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
}

button.secondary, .btn.secondary { background: transparent; color: var(--accent); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

.theme-card, .outline-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.notification-item.unread { font-weight: 600; }
.muted { color: var(--muted); }

.spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.4em;
  vertical-align: -0.15em;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.waiting-icon {
  display: inline-block;
  margin-right: 0.4em;
  vertical-align: -0.1em;
  font-size: 0.95em;
}

.stepper {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-done:not(:last-child)::after { background: var(--accent); }

.step-circle {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: Canvas;
  font-size: 0.8em;
  margin-bottom: 0.35rem;
}

.step-done .step-circle { border-color: var(--accent); background: var(--accent); color: white; }
.step-current .step-circle { border-color: var(--accent); }
.step-failed .step-circle { border-color: var(--danger); background: var(--danger); color: white; }

.step-label { font-size: 0.8em; color: var(--muted); }
.step-current .step-label, .step-done .step-label { color: inherit; }
.step-failed .step-label { color: var(--danger); }

.step-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.step-link:hover .step-circle { box-shadow: 0 0 0 3px var(--border); }
.step-viewing .step-circle { box-shadow: 0 0 0 3px var(--accent); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-header h1 { margin: 0; }

.btn-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-fab:hover {
  background: #2559c7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn-fab:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-card {
  display: inline-flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8em; color: var(--muted); }
