/* Section change service — design system.
   Brand colours carry over from the department's other pages; everything else
   is rebuilt around a single type scale, one elevation ramp and one radius
   ramp, so the whole service reads as one surface. */

:root {
  /* Type. A system stack renders natively on every device the department uses
     and costs no network request, which keeps the CSP at font-src 'self'. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Brand */
  --brand: #a6192e;
  --brand-dark: #7d1223;
  --brand-tint: #fdf2f4;
  --accent: #0b63b3;
  --accent-dark: #084a86;
  --accent-tint: #eff6fd;

  /* Neutrals */
  --ink: #16202c;
  --ink-2: #3d4a5c;
  --ink-3: #64738a;
  --ink-4: #8c99ad;
  --line: #e2e8f1;
  --line-strong: #cdd7e5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --canvas: #eef2f8;

  /* Status */
  --ok: #17703f;
  --ok-tint: #eaf7ef;
  --ok-line: #bfe3cc;
  --warn: #8a5a09;
  --warn-tint: #fff8e9;
  --warn-line: #f0dcae;
  --stop: #a3182c;
  --stop-tint: #fdeef0;
  --stop-line: #f3c7cd;

  /* Elevation — layered rather than one flat drop */
  --e1: 0 1px 2px rgba(16, 28, 44, .05), 0 1px 3px rgba(16, 28, 44, .04);
  --e2: 0 2px 4px rgba(16, 28, 44, .04), 0 8px 20px rgba(16, 28, 44, .07);
  --e3: 0 4px 8px rgba(16, 28, 44, .06), 0 24px 48px rgba(16, 28, 44, .14);
  --ring: 0 0 0 3px rgba(11, 99, 179, .18);

  /* Native form controls, scrollbars and autofill follow color-scheme, not the
     custom properties, so it has to move with the theme or a forced light page
     ends up with dark dropdowns. */
  color-scheme: light;

  --r-xs: 6px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --brand: #e8536b;
    --brand-dark: #f2798c;
    --brand-tint: #2a1519;
    --accent: #66b2f5;
    --accent-dark: #8ac6fa;
    --accent-tint: #12202e;

    --ink: #e8edf4;
    --ink-2: #b9c4d3;
    --ink-3: #8e9bad;
    --ink-4: #6d7a8c;
    --line: #26303d;
    --line-strong: #35424f;
    --surface: #161d26;
    --surface-2: #1b232e;
    --canvas: #0f151c;

    --ok: #67d295; --ok-tint: #10261a; --ok-line: #24503a;
    --warn: #e9bd6a; --warn-tint: #2a2112; --warn-line: #4d3d1c;
    --stop: #f2879a; --stop-tint: #2b141a; --stop-line: #542932;

    --e1: 0 1px 2px rgba(0, 0, 0, .4);
    --e2: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .35);
    --e3: 0 8px 20px rgba(0, 0, 0, .5), 0 32px 64px rgba(0, 0, 0, .45);
    --ring: 0 0 0 3px rgba(102, 178, 245, .25);
  }
}

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 380px at 8% -12%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%),
    radial-gradient(1000px 420px at 100% -8%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%),
    var(--canvas);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.22; letter-spacing: -.016em; color: var(--ink); font-weight: 650; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.06rem; }
h3 { font-size: .98rem; }
p { margin: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Small uppercase label that sits above a block. */
.eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ─── header ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topline { height: 3px; background: linear-gradient(90deg, var(--brand) 0%, #be2a43 45%, var(--accent) 100%); }
.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-wrap { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand-icon { width: 30px; height: 30px; border-radius: var(--r-sm); box-shadow: var(--e1); flex: 0 0 auto; }
.brand { font-weight: 660; font-size: .95rem; letter-spacing: -.01em; }
.brand-sub { color: var(--ink-4); font-size: .72rem; margin-top: .05rem; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .3rem .7rem;
  white-space: nowrap;
}
.user-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.inline-form { display: inline; margin: 0; }
.inline-form form, form.inline-form { display: inline; }

/* ─── layout ──────────────────────────────────────────────────────────── */
.container { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.stack > * + * { margin-top: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  padding: 1.25rem 1.35rem;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head p { color: var(--ink-3); font-size: .87rem; margin-top: .22rem; }
.card-title { display: flex; align-items: center; gap: .55rem; }

/* ─── status panel (replaces the old page title) ──────────────────────── */
.status {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e2);
  padding: 1.35rem 1.45rem;
}
.status::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.status-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.status-state { display: flex; align-items: center; gap: .6rem; font-weight: 640; font-size: 1.02rem; }
.status-lede { margin-top: .7rem; color: var(--ink-2); font-size: .91rem; max-width: 62ch; }
.status-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.6rem;
  margin-top: .95rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.fact { display: flex; flex-direction: column; gap: .12rem; }
.fact-value { font-weight: 620; font-size: .9rem; font-variant-numeric: tabular-nums; }

/* Pulsing dot that carries the open / closed state. */
.beacon { position: relative; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.beacon.is-open { background: var(--ok); }
.beacon.is-open::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: .45;
  animation: beacon 2.4s ease-out infinite;
}
.beacon.is-closed { background: var(--ink-4); }
@keyframes beacon {
  0% { transform: scale(.6); opacity: .5; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .beacon.is-open::after { animation: none; }
}

/* ─── badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .6rem;
  border-radius: var(--r-pill);
  font-size: .765rem;
  font-weight: 620;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-open { background: var(--ok-tint); color: var(--ok); border-color: var(--ok-line); }
.badge-closed { background: var(--stop-tint); color: var(--stop); border-color: var(--stop-line); }
.badge-info { background: var(--accent-tint); color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.badge-count { font-variant-numeric: tabular-nums; }

/* ─── buttons ─────────────────────────────────────────────────────────── */
.btn, button, input[type="submit"] {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-line: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 620;
  line-height: 1.2;
  padding: .55rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--e1);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease,
              transform .16s ease, color .16s ease;
}
.btn:hover, button:hover, input[type="submit"]:hover {
  --btn-bg: var(--brand-dark);
  --btn-line: var(--brand-dark);
  box-shadow: var(--e2);
  transform: translateY(-1px);
  color: #fff;
}
.btn:active, button:active { transform: translateY(0); box-shadow: var(--e1); }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn-secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-2);
  --btn-line: var(--line-strong);
}
.btn-secondary:hover {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  --btn-line: var(--ink-4);
}
.btn-quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink-3);
  --btn-line: transparent;
  box-shadow: none;
  padding: .4rem .6rem;
}
.btn-quiet:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); --btn-line: var(--line); box-shadow: none; }
.btn-sm { padding: .34rem .7rem; font-size: .8rem; }
.btn-danger {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-3);
  --btn-line: var(--line-strong);
}
.btn-danger:hover {
  --btn-bg: var(--stop-tint);
  --btn-fg: var(--stop);
  --btn-line: var(--stop-line);
}
.auth-link { --btn-bg: var(--surface); --btn-fg: var(--ink-2); --btn-line: var(--line-strong); font-size: .8rem; padding: .38rem .75rem; }
.auth-link:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); --btn-line: var(--ink-4); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.actions-end { justify-content: flex-end; }

/* ─── forms ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .32rem; }
/* Forms space their own children, so a field never depends on what precedes
   it -- inside .change-row a sibling margin would drop one column out of line. */
form { display: flex; flex-direction: column; gap: 1.05rem; }
form .toolbar, form .change-row { margin: 0; }
.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  font-size: .82rem;
  font-weight: 620;
  color: var(--ink-2);
}
.field-hint { font-size: .775rem; color: var(--ink-4); }

input[type="text"], input[type="password"], input[type="search"],
input[type="datetime-local"], textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: .58rem .7rem;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, textarea:hover, select:hover { border-color: var(--ink-4); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 128px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 2rem; background-image: none; }

input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: .84rem;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  padding: .65rem .7rem;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
input[type="file"]:hover { border-color: var(--accent); background: var(--accent-tint); }
input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: .8rem;
  font-weight: 620;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  padding: .3rem .65rem;
  margin-right: .7rem;
  cursor: pointer;
}

.counter {
  font-size: .73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .08rem .45rem;
}

/* The course / from / to trio, read as one statement.
   Each field hands its label, input and hint to the shared rows, so the three
   inputs line up whatever the labels and hints wrap to -- and the arrow can sit
   in the input row rather than being nudged there with a magic margin. */
.change-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: .32rem .75rem;
}
.change-row > .field {
  display: grid;
  grid-row: 1 / -1;
  grid-template-rows: subgrid;
  gap: 0;
}
.change-arrow {
  grid-row: 2;
  align-self: center;
  color: var(--ink-4);
  font-size: 1.05rem;
  line-height: 1;
  user-select: none;
}

/* Browsers without subgrid fall back to the old stacking; the arrow is then
   centred on a column of known height. */
@supports not (grid-template-rows: subgrid) {
  .change-row { align-items: start; gap: .75rem; }
  .change-row > .field { display: flex; }
  .change-arrow { grid-row: auto; margin-top: 1.9rem; align-self: start; }
}

.file-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .8rem;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: .35rem .6rem;
}
.file-list li span:last-child { color: var(--ink-4); font-variant-numeric: tabular-nums; }

.check-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--ink-2);
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  cursor: pointer;
}
.check-row + .check-row { margin-top: .35rem; }
.check-row:hover { border-color: var(--line-strong); }
.check-row input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.check-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-size { flex: 0 0 auto; font-size: .76rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.attach-size { color: var(--ink-4); font-size: .73rem; font-variant-numeric: tabular-nums; }

/* ─── toolbar ─────────────────────────────────────────────────────────── */
.toolbar { display: flex; flex-flow: row wrap; align-items: flex-end; gap: .7rem; }
.toolbar .field { flex: 1 1 190px; min-width: 0; }
.toolbar .field-actions { flex: 0 0 auto; display: flex; gap: .5rem; }

/* ─── messages ────────────────────────────────────────────────────────── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7rem .9rem;
  border-radius: var(--r-sm);
  border: 1px solid;
  font-size: .88rem;
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-2);
}
.msg.success { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.msg.error { background: var(--stop-tint); border-color: var(--stop-line); color: var(--stop); }
.msg.warning { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.msg.info { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent-dark); }
.msg svg { flex: 0 0 auto; margin-top: .1rem; }

/* ─── request cards (student view) ────────────────────────────────────── */
.req-list { display: flex; flex-direction: column; gap: .7rem; }
.req {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: .9rem 1rem;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.req:hover { border-color: var(--line-strong); box-shadow: var(--e1); }
.req-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.req-id { display: flex; align-items: center; gap: .6rem; }
.req-course {
  font-family: var(--font-num);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink);
}
.req-move {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--r-pill);
  padding: .16rem .6rem;
}
.req-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .55rem; font-size: .79rem; color: var(--ink-4); }
.req-body { margin-top: .6rem; }
.req-actions { display: flex; gap: .4rem; }

.reason {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .87rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-xs);
  padding: .55rem .7rem;
}

.attach-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.attach {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .79rem;
  font-weight: 560;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .2rem .65rem .2rem .5rem;
  text-decoration: none;
  max-width: 100%;
}
.attach:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-tint); }
.attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

details.reveal > summary {
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem 0;
}
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .16s ease;
}
details.reveal[open] > summary::before { transform: rotate(90deg); }
details.reveal > summary:hover { color: var(--accent-dark); }
details.reveal[open] > summary { margin-bottom: .45rem; }

/* ─── table (coordinator view) ────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.table-scroll { max-height: 66vh; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 780px; }
th, td { text-align: left; padding: .68rem .8rem; font-size: .855rem; vertical-align: top; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { border-bottom: 1px solid var(--line); color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .mono { font-family: var(--font-num); font-weight: 620; color: var(--ink); }

/* ─── stat strip ──────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .8rem .9rem;
  box-shadow: var(--e1);
}
.stat-value { font-size: 1.32rem; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.stat-value.is-ok { color: var(--ok); }
.stat-value.is-stop { color: var(--stop); }

/* ─── empty state ─────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--ink-3); }
.empty svg { color: var(--ink-4); opacity: .55; }
.empty-title { margin-top: .7rem; font-weight: 620; color: var(--ink-2); font-size: .92rem; }
.empty-text { margin-top: .25rem; font-size: .84rem; }

/* ─── login ───────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-inner { width: 100%; max-width: 404px; }
.login-head { text-align: center; margin-bottom: 1.35rem; }
.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  box-shadow: var(--e2);
  margin-bottom: .85rem;
}
.login-head h1 { font-size: 1.3rem; }
.login-head p { margin-top: .3rem; color: var(--ink-3); font-size: .88rem; }
.login-card { box-shadow: var(--e2); padding: 1.5rem; }
.login-card button[type="submit"] { width: 100%; padding: .65rem 1rem; }
.login-foot { margin-top: 1.1rem; text-align: center; font-size: .76rem; color: var(--ink-4); }

/* ─── dialog ──────────────────────────────────────────────────────────── */
dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: min(84vh, 720px);
  padding: 1.35rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e3);
  overflow: auto;
}
dialog::backdrop { background: rgba(10, 17, 26, .5); backdrop-filter: blur(3px); }
dialog[open] { animation: dialog-in .2s cubic-bezier(.2, .8, .3, 1); }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
.dialog-head { margin-bottom: .9rem; }
.dialog-head p { margin-top: .3rem; font-size: .85rem; color: var(--ink-3); }
.dialog-foot { display: flex; justify-content: flex-end; gap: .55rem; margin-top: 1.2rem; }

/* ─── error page ──────────────────────────────────────────────────────── */
.error-wrap { max-width: 480px; margin: 5rem auto; text-align: center; }
.error-wrap .card { padding: 2rem 1.6rem; }
.error-code { font-family: var(--font-num); font-size: .75rem; color: var(--ink-4); margin-top: .8rem; }

/* ─── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding: 1.1rem 1rem 2.5rem; }
  .brand-sub, .user-chip { display: none; }
  .change-row { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, auto); }
  .change-row > .field:first-child { grid-row: 1 / 4; grid-column: 1 / -1; }
  .change-row > .field:nth-of-type(2) { grid-row: 4 / 7; }
  .change-row > .field:nth-of-type(3) { grid-row: 4 / 7; }
  .change-arrow { display: none; }
  .status, .card { padding: 1.05rem 1.1rem; border-radius: var(--r); }
  .status-facts { gap: .3rem 1.1rem; }
  .card-head { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .toolbar .field { flex-basis: 100%; }
  .toolbar .field-actions { width: 100%; }
  .toolbar .field-actions .btn { flex: 1; }
  .req-top { align-items: flex-start; }
}

/* markup-specific spacing */
.status + .card, .stats + .card { margin-top: 1rem; }
[data-form-actions] { margin-top: .3rem; }
[data-download-note], [data-window-note] { margin-top: .7rem; }
.error-wrap h1 { margin-top: .9rem; font-size: 1.2rem; }
.error-wrap p { margin-top: .5rem; font-size: .9rem; }
[data-error-actions] { justify-content: center; margin-top: 1.3rem; }
.login-card form { gap: .95rem; }
.login-card form > .field:last-child { margin-top: .35rem; }
