/* DRN Console stylesheet.
 *
 * PLACEHOLDER PALETTE. The design desk's palette replaces this block and the
 * :root values below, wholesale. Nothing here is a design decision; it is the
 * minimum needed to read the pages while the real palette is drafted.
 *
 * One accent, used only for links, focus rings and buttons. Never body text.
 * Every text-on-surface pair below is checked by tests/test_contrast.py,
 * which parses the JSON between the two markers. Keep the markers.
 *
 * CONTRAST-PAIRS-JSON-START
 * {
 *   "ink on surface":     ["#1F2A33", "#FFFFFF"],
 *   "ink on ground":      ["#1F2A33", "#F3F4F6"],
 *   "muted on surface":   ["#4A5A66", "#FFFFFF"],
 *   "muted on ground":    ["#4A5A66", "#F3F4F6"],
 *   "accent on surface":  ["#2F6F8F", "#FFFFFF"],
 *   "accent on ground":   ["#2F6F8F", "#F3F4F6"],
 *   "surface on accent":  ["#FFFFFF", "#2F6F8F"]
 * }
 * CONTRAST-PAIRS-JSON-END
 */

:root {
  --ink: #1F2A33;
  --muted: #4A5A66;
  --surface: #FFFFFF;
  --ground: #F3F4F6;
  --accent: #2F6F8F;
  --line: #D9DDE1;
  --rail-wide: 208px;
  --rail-narrow: 64px;
  --gap: 20px;
  --measure: 78ch;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

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

/* --- shell and rail ------------------------------------------------------ */

.rail-toggle { position: absolute; left: -9999px; }

.shell { display: flex; min-height: 100vh; align-items: stretch; }

.rail {
  width: var(--rail-wide);
  flex: 0 0 var(--rail-wide);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: var(--gap) 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
}

.rail-link:hover { background: var(--ground); }
.rail-link.is-here { background: var(--ground); font-weight: 600; }

.rail-mark {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.rail-out { margin-top: auto; }
.rail-drawer-button, .scrim { display: none; }

.link-button {
  background: none;
  border: 0;
  padding: 10px 12px;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.main {
  flex: 1 1 auto;
  padding: var(--gap) clamp(16px, 4vw, 40px) 64px;
  min-width: 0;
}

/* --- type and cards ------------------------------------------------------ */

.page-title { font-size: 26px; margin: 8px 0 var(--gap); }
.zone { margin-bottom: 28px; }
.zone-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.card-narrow { max-width: 460px; }
.card-row { display: flex; flex-wrap: wrap; gap: var(--gap); }
.card-row .card { flex: 1 1 165px; }

.stat-number { font-size: 34px; font-weight: 600; margin: 0; }
.stat-ask { margin: 2px 0 0; color: var(--muted); }

.lede { margin: 0 0 12px; max-width: var(--measure); }
.muted { color: var(--muted); }
.accent { color: var(--accent); font-weight: 600; }

/* The clerk's queue, above the page. Signal, not decoration. */
.queue-line {
  margin: -4px 0 var(--gap);
  color: var(--muted);
  font-size: 15px;
}

.rotate { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; }

.pairs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; }
.pairs dt { color: var(--muted); }
.pairs dd { margin: 0; }

.preview { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }

/* --- forms --------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.field-grow { flex: 1 1 240px; width: auto; }
.field-label { font-size: 14px; color: var(--muted); }

input, select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  width: 100%;
}

.button {
  font: inherit;
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
}

.notice { border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
.notice-bad { background: var(--ground); border: 1px solid var(--line); }

/* --- under 1000px: the rail keeps its place, words drop to marks --------- */

@media (max-width: 999px) {
  .rail { width: var(--rail-narrow); flex: 0 0 var(--rail-narrow); padding: var(--gap) 8px; }
  .rail-word { display: none; }
  .rail-link { justify-content: center; padding: 10px 0; }
  .link-button { padding: 10px 0; font-size: 13px; }
}

/* --- under 700px: the rail becomes a drawer, CSS only ------------------- */

@media (max-width: 699px) {
  .shell { display: block; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 2;
    width: var(--rail-wide);
    flex: none;
    padding: var(--gap) 12px;
    transform: translateX(-100%);
    transition: transform 0.15s ease-out;
  }
  .rail-word { display: inline; }
  .rail-link { justify-content: flex-start; padding: 10px 12px; }
  .rail-drawer-button {
    display: inline-block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 3;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--accent);
    cursor: pointer;
  }
  .main { padding-top: 60px; }
  .rail-toggle:checked ~ .shell .rail { transform: translateX(0); }
  .rail-toggle:checked ~ .shell .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(31, 42, 51, 0.45);
  }
}
