/* Base elements, focus, skip link and helpers (docs/04 §6, docs/08 §6.2). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-bottom: calc(var(--sticky-bar) + var(--space-4));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-m);
  line-height: var(--leading);
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

/* Display headings in Unbounded with the mockup's tight tracking. */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--display-tracking);
}

h3 {
  font-weight: 700;
}

h1 {
  font-size: var(--text-xl);
}

h2 {
  font-size: var(--text-l);
}

p,
ul,
ol {
  margin: 0 0 var(--space-4);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--cta-dark);
  text-decoration-thickness: 2px;
}

/* Focus: a 3 px ink outline with offset, never removed (as in the design mockup). */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The skip link is the first focusable element and visible on focus. */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--surface);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target);
  min-width: var(--target);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--brand);
  border-radius: var(--pill);
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

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

.button-secondary:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* Status chips: the text is the status; colour only supports it. */
.chip {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid currentColor;
  border-radius: var(--pill);
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-alt);
}

.chip-success {
  color: var(--success);
  background: var(--success-bg);
}

.chip-warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.chip-danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.empty-state {
  padding: var(--space-6);
  border: 2px dashed var(--hairline);
  border-radius: var(--radius-l);
  background: var(--surface);
}

.skeleton-row {
  height: 3rem;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-m);
  background: var(--surface-alt);
}

.notice {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-s);
  background: var(--surface);
  margin-bottom: var(--space-4);
}

.notice-alert {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
