/*
 * Element defaults. Uses tokens only — no literal colours, sizes or fonts.
 * Anything specific to one piece of the interface belongs in
 * `components/<name>.css`, not here.
 */

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

/* The shell fills the viewport and every scrollbar lives inside a column.
 *
 * Without this the window itself scrolled: one bar on the far right dragging
 * all three columns at once, so reading down the listings moved the map and the
 * searches with them. `overflow-x: hidden` alone was not enough — a single
 * non-visible axis makes the other compute to `auto`, and nothing bounded the
 * height, so the tallest column set the page's. */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  /* Explicit background: the page must not borrow the host's ground. */
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

a {
  color: var(--accent);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-sunken);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* A message about the last action, floating over the panels rather than in the
 * layout: the three columns are sized to fill the screen exactly, and a banner
 * inserted into that flow would push the bottom of the list out of view. */
.flash {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: min(32rem, calc(100vw - 2rem));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: var(--text-sm);
  color: var(--ink);
}

/* An alert is a refusal, not a failure of the machine — marked, not shouted. */
.flash--alert {
  border-color: var(--inferred, var(--line-strong));
}

.flash__close {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--text-lg);
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
}
