/* Plain and neutral (D-019): system fonts, no framework, dark mode follows the system. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1d232b;
  --muted: #5b6672;
  --line: #d9dee4;
  --accent: #1f5fa8;
  --accent-btn: #1f5fa8;
  --danger-btn: #b3261e;
  --error: #b3261e;
  --header-bg: #f3f5f8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --fg: #e4e8ec;
    --muted: #9aa5b1;
    --line: #2c333b;
    --accent: #7fb2ec;
    --accent-btn: #2f6fb8;
    --danger-btn: #b3261e;
    --error: #f2948c;
    --header-bg: #1b2027;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Liberation Sans", sans-serif;
}
a { color: var(--accent); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.brand { flex-shrink: 0; font-weight: 600; font-size: 1.1rem; color: inherit; text-decoration: none; white-space: nowrap; }
.langs { display: flex; gap: .5rem; font-size: .9rem; }
.langs > * + * { border-left: 1px solid var(--line); padding-left: .5rem; }

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.wide { max-width: 64rem; } /* a page with a wide table */
h1 { font-size: 1.6rem; line-height: 1.25; margin: .5rem 0 1rem; }
.muted { color: var(--muted); }

/* On a phone the header's links wrap onto a second line, on the right. */
.right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .25rem 1rem;
  min-width: 0;
  font-size: .9rem;
}
.who { color: var(--muted); overflow-wrap: anywhere; }
.inline { display: inline; margin: 0; }
.error {
  color: var(--error);
  border-left: 3px solid var(--error);
  padding: .25rem 0 .25rem .75rem;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem .75rem;
}

/* Forms: one column, labels above the fields. */
.form { display: grid; gap: .35rem; max-width: 24rem; margin: 1rem 0; }
.form label { font-weight: 600; margin-top: .5rem; }
.form .hint { margin: 0; font-size: .9rem; }
input, button { font: inherit; }
input[type="email"], input[type="password"], input[type="text"] {
  padding: .45rem .6rem;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  justify-self: start;
  margin-top: .75rem;
  padding: .45rem 1.1rem;
  color: #fff;
  background: var(--accent-btn);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button.danger { background: var(--danger-btn); }

/* A choice of one, e.g. an upload's CRS: a radio button on each line. */
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 600; }
.form .choice { display: flex; gap: .5rem; align-items: baseline; margin-top: .35rem; font-weight: normal; }
button.link {
  margin: 0;
  padding: 0;
  color: var(--accent);
  background: none;
  text-decoration: underline;
}

/* Facts about an upload: labels left, values right. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 .5rem; }

/* A link to copy (a WMS link, a setup link): the whole URL in one field,
   easy to select and copy, with the copy button beside it. */
.copy-field { display: flex; gap: .5rem; align-items: stretch; }
.copy-field button { margin: 0; flex: none; }
input.copy-url { flex: 1; min-width: 0; font-family: ui-monospace, "Liberation Mono", monospace; font-size: .9rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.steps { margin: .25rem 0; padding-left: 1.5rem; }
.steps li + li { margin-top: .25rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* The preview map (D-032). OpenLayers' controls take the page's colours. */
.preview {
  position: relative;
  height: min(60vh, 32rem);
  min-height: 16rem;
  margin: .75rem 0 .25rem;
  border: 1px solid var(--line);
  background: var(--header-bg);
}
.preview:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.preview noscript p { margin: 1rem; }
.preview-hint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  font-size: 1.1rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  pointer-events: none;
}
.preview-hint[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .preview {
    --ol-background-color: #1b2027;
    --ol-accent-background-color: #2c333b;
    --ol-partial-background-color: rgba(20, 24, 29, .8);
    --ol-foreground-color: #e4e8ec;
    --ol-subtle-foreground-color: #c4ccd4;
  }
}

/* Tables: an upload's layers, and the list of uploads. Text on the left,
   counts on the right. A wide table scrolls on its own on a phone. */
.scroll { overflow-x: auto; }
.data { border-collapse: collapse; max-width: 100%; margin: .5rem 0 1rem; }
.data th, .data td {
  padding: .3rem 1.5rem .3rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data th { color: var(--muted); font-weight: 600; }
.data td:first-child { overflow-wrap: anywhere; } /* a long name wraps on a phone */
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data th:last-child, .data td:last-child { padding-right: 0; }
.data .nowrap, .data .num { white-space: nowrap; }

/* The admin page's list of users: each row's actions side by side. */
.data .actions { gap: .25rem 1rem; white-space: nowrap; }
