@import 'https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap';

/* ─── CSS Custom Properties ─── */
:root {
  --radius: 0.5rem;
  --brand-primary: 211 100% 50%;

  /* Backgrounds */
  --background-page: 0 0% 100%;
  --background-primary: 0 0% 96%;
  --background-secondary: 0 0% 85%;
  --background-elevated: 0 0% 95%;
  --background-button: 225 6% 88%;
  --sidebar-background: 0 0% 0%;

  /* Text */
  --text-primary: 0 0% 0%;
  --text-secondary: 0 0% 50%;
  --text-contrast: 0 0% 100%;
  --text-disabled: 0 0% 70%;
  --text-warning: 38 92% 50%;

  /* Borders */
  --border-primary: 0 0% 85%;
  --border-hover: 0 0% 75%;
  --border-selected: 0 0% 9%;
  --border-subtle: 206 35% 77%;

  /* Semantic */
  --warning: 38 92% 50%;
  --alert-error: 0 84% 60%;
  --primary: 211 100% 50%;

  /* Status-specific */
  --status-operational: 142 76% 36%;
  --status-degraded: 38 92% 50%;
  --status-down: 0 84% 60%;
  --status-unknown: 0 0% 50%;
  --status-maintenance: 211 100% 50%;
}

html.dark {
  --background-page: 0 0% 0%;
  --background-primary: 0 0% 9%;
  --background-secondary: 0 0% 20%;
  --background-elevated: 0 0% 5%;
  --background-button: 225 6% 12%;
  --sidebar-background: 0 0% 8%;
  --text-primary: 0 0% 100%;
  --text-secondary: 0 0% 50%;
  --text-contrast: 0 0% 0%;
  --text-disabled: 0 0% 30%;
  --border-primary: 0 0% 20%;
  --border-hover: 0 0% 30%;
  --border-selected: 0 0% 100%;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Geist, system-ui, sans-serif;
  background-color: hsl(var(--background-page));
  color: hsl(var(--text-primary));
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: 'Geist Mono', monospace;
}

/* ─── Typography ─── */
h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  color: hsl(var(--text-primary));
}

.text-secondary {
  color: hsl(var(--text-secondary));
}

.text-muted {
  color: hsl(var(--text-disabled));
  font-size: 0.8125rem;
}

/* ─── Layout Utility ─── */
.page-container {
  padding: 2rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .page-container {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (min-width: 1280px) {
  .page-container {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}

/* ─── Nav Bar ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: hsl(var(--background-page));
  border-bottom: 1px solid hsl(var(--border-primary));
  height: 56px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .nav-inner {
    padding: 0 2.5rem;
  }
}

@media (min-width: 1280px) {
  .nav-inner {
    padding: 0 6rem;
  }
}

.nav-brand {
  font-weight: 600;
  font-size: 0.9375rem;
  color: hsl(var(--brand-primary));
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  color: hsl(var(--text-secondary));
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  color: hsl(var(--text-primary));
  background-color: hsl(var(--background-primary));
  text-decoration: none;
}

.nav-link--active {
  color: hsl(var(--text-primary));
  font-weight: 500;
  background-color: hsl(var(--background-primary));
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid hsl(var(--border-primary));
  background-color: hsl(var(--background-button));
  color: hsl(var(--text-primary));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  background-color: hsl(var(--background-secondary));
  border-color: hsl(var(--border-hover));
}

/* ─── Status Banner ─── */
.status-banner {
  padding: 1.25rem 0;
  margin-bottom: 2rem;
}

.status-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid transparent;
}

@media (min-width: 640px) {
  .status-banner__inner {
    padding: 1.25rem 2.5rem;
  }
}

.status-banner--operational .status-banner__inner {
  background-color: hsl(142 76% 36% / 0.1);
  border-left-color: hsl(var(--status-operational));
}

.status-banner--degraded .status-banner__inner {
  background-color: hsl(38 92% 50% / 0.1);
  border-left-color: hsl(var(--status-degraded));
}

.status-banner--down .status-banner__inner {
  background-color: hsl(0 84% 60% / 0.1);
  border-left-color: hsl(var(--status-down));
}

.status-banner__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.status-banner--operational .status-banner__title {
  color: hsl(var(--status-operational));
}

.status-banner--degraded .status-banner__title {
  color: hsl(var(--status-degraded));
}

.status-banner--down .status-banner__title {
  color: hsl(var(--status-down));
}

.status-banner__subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--text-secondary));
}

/* ─── Service Group Card ─── */
.service-group {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.service-group__header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border-primary));
}

.service-group__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid hsl(var(--border-primary));
}

.service-row:first-of-type {
  border-top: none;
}

.service-row__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--text-primary));
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentcolor;
  opacity: 0.8;
}

.badge--operational {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(var(--status-operational));
}

.badge--degraded {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(var(--status-degraded));
}

.badge--down {
  background-color: hsl(0 84% 60% / 0.15);
  color: hsl(var(--status-down));
}

.badge--unknown {
  background-color: hsl(0 0% 50% / 0.15);
  color: hsl(var(--status-unknown));
}

.badge--maintenance {
  background-color: hsl(211 100% 50% / 0.15);
  color: hsl(var(--status-maintenance));
}

.badge--investigating {
  background-color: hsl(0 84% 60% / 0.15);
  color: hsl(var(--status-down));
}

.badge--identified {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(var(--status-degraded));
}

.badge--monitoring {
  background-color: hsl(211 100% 50% / 0.15);
  color: hsl(var(--status-maintenance));
}

.badge--resolved {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(var(--status-operational));
}

.badge--severity-p0 {
  background-color: hsl(0 84% 60% / 0.15);
  color: hsl(var(--alert-error));
}

.badge--severity-p1 {
  background-color: hsl(25 95% 53% / 0.15);
  color: hsl(25 95% 53%);
}

.badge--severity-p2 {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(var(--status-degraded));
}

.badge--type {
  background-color: hsl(var(--background-secondary));
  color: hsl(var(--text-secondary));
}

.badge--status-draft {
  background-color: hsl(var(--background-secondary));
  color: hsl(var(--text-secondary));
}

.badge--status-published {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(var(--status-operational));
}

.badge--action-open {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(var(--status-degraded));
}

.badge--action-done {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(var(--status-operational));
}

/* ─── Section Headers ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
}

/* ─── Incident Cards ─── */
.incident-card {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.incident-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}

.incident-card__header:hover {
  background-color: hsl(var(--background-elevated));
}

.incident-card__header-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.incident-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
}

.incident-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.incident-card__date {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
}

.incident-card__toggle {
  color: hsl(var(--text-secondary));
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: transform 0.2s;
}

.incident-card.is-open .incident-card__toggle {
  transform: rotate(180deg);
}

.incident-card__body {
  display: none;
  border-top: 1px solid hsl(var(--border-primary));
  padding: 1rem 1.25rem;
}

.incident-card.is-open .incident-card__body {
  display: block;
}

/* ─── Updates Timeline ─── */
.updates-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.update-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}

.update-item::before {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 1.5rem;
  bottom: -0.5rem;
  width: 1px;
  background-color: hsl(var(--border-primary));
}

.update-item:last-child::before {
  display: none;
}

.update-dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background-color: hsl(var(--border-hover));
  border: 2px solid hsl(var(--background-primary));
  flex-shrink: 0;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
}

.update-content {
  flex: 1;
  min-width: 0;
}

.update-message {
  font-size: 0.875rem;
  color: hsl(var(--text-primary));
  margin-bottom: 0.25rem;
}

.update-timestamp {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  font-family: 'Geist Mono', monospace;
}

/* ─── Post-Mortem Cards ─── */
.pm-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .pm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pm-card {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background-color 0.15s;
}

.pm-card:hover {
  border-color: hsl(var(--border-hover));
  background-color: hsl(var(--background-elevated));
  text-decoration: none;
}

.pm-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.pm-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  flex: 1;
}

.pm-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.pm-card__date,
.pm-card__duration {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
}

.pm-card__services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.service-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background-color: hsl(var(--background-secondary));
  color: hsl(var(--text-secondary));
  border-radius: 9999px;
  font-family: 'Geist Mono', monospace;
}

/* ─── Post-Mortem Detail ─── */
.pm-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--border-primary));
}

.pm-detail-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.pm-detail-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pm-detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--text-secondary));
}

.pm-detail-section {
  margin-bottom: 2rem;
}

.pm-detail-section__title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border-primary));
}

.pm-detail-section__content {
  font-size: 0.875rem;
  color: hsl(var(--text-primary));
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ─── Timeline List ─── */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1rem;
  border-left: 2px solid hsl(var(--border-primary));
}

.timeline li {
  position: relative;
  padding: 0 0 1rem 1.5rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -0.5625rem;
  top: 0.3125rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: hsl(var(--border-hover));
  border: 2px solid hsl(var(--background-page));
}

.timeline-time {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  font-family: 'Geist Mono', monospace;
  margin-bottom: 0.25rem;
}

.timeline-event {
  font-size: 0.875rem;
  color: hsl(var(--text-primary));
}

/* ─── Action Items Table ─── */
.action-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.action-items-table th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid hsl(var(--border-primary));
  background-color: hsl(var(--background-elevated));
}

.action-items-table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid hsl(var(--border-primary));
  color: hsl(var(--text-primary));
  vertical-align: top;
}

.action-items-table tr:last-child td {
  border-bottom: none;
}

.action-items-table-wrapper {
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  overflow: hidden;
}

/* ─── Admin Page ─── */
.admin-key-section {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-key-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-key-row label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  white-space: nowrap;
}

.admin-tab-bar {
  display: flex;
  border-bottom: 1px solid hsl(var(--border-primary));
  margin-bottom: 1.5rem;
  gap: 0;
}

.admin-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  color: hsl(var(--text-primary));
}

.admin-tab.is-active {
  color: hsl(var(--brand-primary));
  border-bottom-color: hsl(var(--brand-primary));
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: Geist, system-ui, sans-serif;
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  color: hsl(var(--text-primary));
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-input--password {
  font-family: monospace;
  letter-spacing: 0.1em;
}

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-inline .form-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.form-section {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border-primary));
}

.checkboxes-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  cursor: pointer;
  color: hsl(var(--text-primary));
  padding: 0.25rem 0.625rem;
  border: 1px solid hsl(var(--border-primary));
  border-radius: 9999px;
  transition: background-color 0.15s;
}

.checkbox-label:hover {
  background-color: hsl(var(--background-secondary));
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: hsl(var(--primary));
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: Geist, system-ui, sans-serif;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background-color: hsl(var(--primary));
  color: white;
}

.btn--primary:hover:not(:disabled) {
  background-color: hsl(211 100% 44%);
}

.btn--secondary {
  background-color: hsl(var(--background-button));
  color: hsl(var(--text-primary));
  border: 1px solid hsl(var(--border-primary));
}

.btn--secondary:hover:not(:disabled) {
  background-color: hsl(var(--background-secondary));
}

.btn--danger {
  background-color: hsl(var(--alert-error) / 0.15);
  color: hsl(var(--alert-error));
  border: 1px solid hsl(var(--alert-error) / 0.3);
}

.btn--danger:hover:not(:disabled) {
  background-color: hsl(var(--alert-error) / 0.25);
}

.btn--sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.btn--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
}

/* ─── Admin List Rows ─── */
.admin-list {
  background-color: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid hsl(var(--border-primary));
}

.admin-list-item:first-child {
  border-top: none;
}

.admin-list-item__info {
  flex: 1;
  min-width: 0;
}

.admin-list-item__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--text-primary));
  margin-bottom: 0.25rem;
}

.admin-list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-list-item__date {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  font-family: 'Geist Mono', monospace;
}

.admin-list-item__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ─── Edit Panel (inline) ─── */
.edit-panel {
  display: none;
  background-color: hsl(var(--background-elevated));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.edit-panel.is-open {
  display: block;
}

.edit-panel__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: hsl(var(--text-primary));
}

/* ─── Dynamic lists (timeline entries, action items) ─── */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.dynamic-list-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.dynamic-list-item .form-input,
.dynamic-list-item .form-select {
  flex: 1;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 320px;
  pointer-events: auto;
  animation: toast-in 0.2s ease;
  box-shadow: 0 4px 12px hsl(0 0% 0% / 0.15);
}

.toast--success {
  background-color: hsl(142 76% 36%);
  color: white;
}

.toast--error {
  background-color: hsl(var(--alert-error));
  color: white;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

/* ─── Inline alert ─── */
.inline-alert {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  display: none;
}

.inline-alert.is-visible {
  display: block;
}

.inline-alert--success {
  background-color: hsl(142 76% 36% / 0.15);
  color: hsl(var(--status-operational));
  border: 1px solid hsl(142 76% 36% / 0.3);
}

.inline-alert--error {
  background-color: hsl(0 84% 60% / 0.15);
  color: hsl(var(--alert-error));
  border: 1px solid hsl(0 84% 60% / 0.3);
}

/* ─── Authenticated chip ─── */
.auth-status {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ─── Empty state ─── */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: hsl(var(--text-secondary));
  font-size: 0.875rem;
}

/* ─── Page-level spacing helpers ─── */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* ─── 404 ─── */
.not-found {
  padding: 4rem 1.5rem;
  text-align: center;
}

.not-found h1 {
  font-size: 4rem;
  font-weight: 700;
  color: hsl(var(--text-disabled));
  margin-bottom: 1rem;
}

.not-found p {
  color: hsl(var(--text-secondary));
  margin-bottom: 1.5rem;
}

/* ─── Subscribe section ─── */
.subscribe-section {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: hsl(var(--background-primary));
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
}

.subscribe-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: hsl(var(--text-primary));
}

.subscribe-body {
  font-size: 0.875rem;
  color: hsl(var(--text-secondary));
  margin: 0 0 1rem;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subscribe-input {
  flex: 1;
  min-width: 220px;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border-primary));
  border-radius: var(--radius);
  background: hsl(var(--background-page));
  color: hsl(var(--text-primary));
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.subscribe-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
}

.subscribe-btn {
  padding: 0.5rem 1.25rem;
  background: hsl(var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.subscribe-btn:hover {
  opacity: 0.85;
}

.subscribe-success {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--status-operational));
}

.subscribe-error {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--alert-error));
}

/* ─── Unsubscribed page ─── */
.unsubscribed-card {
  max-width: 480px;
  margin: 6rem auto;
  text-align: center;
  padding: 2rem;
}

.unsubscribed-icon {
  font-size: 3rem;
  color: hsl(var(--status-operational));
  margin-bottom: 1rem;
}

.unsubscribed-body {
  color: hsl(var(--text-secondary));
  margin-bottom: 1.5rem;
}

.unsubscribed-link {
  color: hsl(var(--primary));
  text-decoration: none;
  font-size: 0.875rem;
}

.unsubscribed-link:hover {
  text-decoration: underline;
}
