/**
 * One stylesheet, no framework.
 *
 * The look is deliberately plain: square corners, visible rules, flat panels.
 * This is a form people use at a desk to file an identity number, so it should
 * read like a well-set paper form rather than a product landing page.
 *
 * Light only, by instruction. The tokens stay - they are still how a colour is
 * named here - but there is no second palette behind a media query, so what is
 * written below is what every visitor sees. A dark palette was removed rather
 * than left unreferenced: a half-maintained second theme is worse than none,
 * because it looks finished until somebody's phone switches it on.
 */

:root {
  --bg: #eceef1;
  --card: #ffffff;
  --shell: #f6f7f9;
  --ink: #16191d;
  --muted: #646b76;
  --rule: #d4d8de;
  --rule-strong: #b9bfc8;
  --accent: #1e4fc4;
  --accent-ink: #ffffff;
  --danger: #a8231c;
  --warn: #8a5d00;
  --good: #14663a;

  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 3rem 16px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- brand -------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 auto 1.5rem;
}
/* Height-driven: the mark is taller than it is wide, so constraining width
   would size it by the wrong axis. */
.brand img {
  display: block;
  height: 34px;
  width: auto;
}
.brand span {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* --- panels ------------------------------------------------------------- */

.card {
  max-width: 30rem;
  margin: 0 auto;
  padding: 0;
  background: var(--card);
  /* Square. A radius here would soften exactly the thing that should read as
     a form field boundary. */
  border: 1px solid var(--rule-strong);
}
/* Eleven columns measure about 1400px. 92rem fits them on a wide monitor,
   which is the point of showing UAN and PF in the table at all - scrolled out
   of sight by default would be no better than leaving them in the spreadsheet.
   Anything narrower scrolls, with the actions pinned. */
.card.wide { max-width: 92rem; }

/* Each block inside a card is separated by a rule, not by whitespace alone;
   it is what makes the form scannable without decoration. */
.card > * {
  padding: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.card > *:last-child { border-bottom: 0; }
/* Deliberately NOT ".card > .table-wrap". Every table on this page sits inside
   a <section> inside the card, so a direct-child selector matches none of them.
   The rule that used to live here was written that way, matched nothing, and
   the table escaped its card as a result - and it looked correct at the one
   window width it was checked at, because the sticky column then pinned itself
   to the viewport instead. Measure the overflow, do not eyeball it. */
.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.table-wrap > table {
  width: 100%;
  /* width:100% alone lets a narrow card squash the table below the width its
     own cells need, and nowrap content then spills out of the cells and is
     clipped instead of scrolled. min-width stops the squash, so the wrapper
     gets something real to scroll. */
  min-width: max-content;
  margin: 0;
}
/* Every cell on one line. Wrapping was the browser's way of forcing the
   columns into the card, and it turned a two-word name into a three-line row.
   The wrapper scrolls instead, so columns can take the width they need. */
.table-wrap td,
.table-wrap th { white-space: nowrap; }

/* The submissions table carries all twenty-one stored fields, so it is wider
   than any window it will be opened in. The email is what identifies the row
   you are reading, and it was the first thing to scroll away - so it stays,
   the way the actions already do at the other end. */
#records td:first-child,
#records thead th:first-child {
  position: sticky;
  left: 0;
  background: var(--card);
  border-right: 1px solid var(--rule);
}
#records thead th:first-child { background: var(--shell); }
/* Pinning stops paying for itself once the pinned column is most of the
   window - 200px of a 308px scroller on a phone, where it hides more than it
   anchors. Narrow screens just scroll. Declared after the rule it overrides:
   a media query adds no specificity, so order is what decides this. */
@media (max-width: 60rem) {
  #records td:first-child,
  #records thead th:first-child { position: static; }
}

/* Reveal, Edit and Delete stay put while the rest scrolls under them. They are
   the reason anyone opens this table, and they sat in the one column that
   scrolls off first. The background is opaque so rows do not show through, and
   the left rule is what makes it read as pinned rather than as a rendering
   fault. */
.table-wrap td.act,
.table-wrap thead th:last-child {
  position: sticky;
  right: 0;
  background: var(--card);
  border-left: 1px solid var(--rule);
}
.table-wrap thead th:last-child { background: var(--card); }
/* The empty state already has its own padding; do not double it. */
.card > .empty { padding: 0; margin: 1.25rem 1.5rem; }

h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--shell);
}
header .actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-shrink: 0;
}

/* --- form --------------------------------------------------------------- */

form { margin: 0; }

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input,
select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: var(--shell);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  font: inherit;
}
input::placeholder { color: var(--muted); opacity: 0.65; }

/* A radio or a checkbox is a control, not a field.
 *
 * The rule above is written for the things people type into, and it makes
 * every input as wide as its container with padding and a border. Applied to a
 * radio that produces a full-width bordered box with the control adrift in the
 * middle of it and the label shoved off the edge - which is exactly what
 * happened to the intake chooser. Reset here rather than per-component, so the
 * next one somebody adds is right without them having to know this. */
/* Rendered, but not visible.
 *
 * For a file input that a button opens on its behalf. display:none - which is
 * what the hidden attribute gives you - makes Safari and older WebKit ignore
 * the programmatic .click() entirely, so the button silently does nothing.
 * Taking it out of the flow this way keeps it rendered and the click works
 * everywhere. */
.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}

input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: var(--card);
}

/* The browser's own [hidden] { display: none } is an ordinary author-level
   rule in the UA stylesheet, so ANY rule here that sets display beats it -
   .row below did exactly that, and a hidden row went on rendering. That is a
   nuisance in most pages and a correctness problem in this one: whether an
   element is hidden is how the form decides which intake's questions it is
   asking. Stated once, with !important, so nothing added later can undo it. */
[hidden] { display: none !important; }

.row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.field { flex: 1; min-width: 0; }
.field.narrow { flex: 0 0 13rem; }
/* Rows whose fields may differ in height align on their top edge rather than
   their baseline. Declared here, with the other .row rules, and deliberately
   not further down the file: it has to come BEFORE the stacking media query
   below, because a media query adds no specificity and the last matching rule
   of equal weight wins. Declared later, it beat the stacked layout and the
   fields came out ragged on a phone. */
.row.top { align-items: flex-start; }

/* ...but top-aligning the whole field is not enough, because a label that
 * wraps to two lines drags its own input down with it: "Middle name (if you
 * have one)" sat a line below First and Last, and so did the date of birth
 * next to Gender.
 *
 * Subgrid fixes it at the source. The row owns three tracks - label, control,
 * hint - and each field opts into the row's tracks instead of laying itself
 * out, so every label shares one track sized to the tallest of them and every
 * control starts at the same y however any single label wraps. */
.row.top {
  display: grid;
  grid-template-rows: auto auto auto;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.row.top > .field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}
/* Short labels sit at the top of the shared track rather than floating in the
   middle of the space a two-line neighbour asked for. */
.row.top > .field > label { align-items: flex-start; }

button[type="submit"],
#allowed-file-pick {
  flex-shrink: 0;
  padding: 0.55rem 1.1rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button[type="submit"]:hover,
#allowed-file-pick:hover { filter: brightness(1.08); }
button[type="submit"]:disabled,
#allowed-file-pick:disabled { opacity: 0.5; cursor: not-allowed; }

/* Stacked on a phone: three controls in a row is unusable at 400px.
   .row.top is named here too. It is the more specific selector, so without
   this it kept align-items:flex-start once the row turned into a column and
   the stacked fields came out ragged - 149px, 150px and 189px where all three
   should have been 308px. */
@media (max-width: 34rem) {
  .row, .row.top { display: flex; flex-direction: column; align-items: stretch; }
  .field.narrow { flex: 1; }
  button[type="submit"] { width: 100%; }
}

.link {
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link:hover { filter: brightness(1.15); }
.link:disabled { opacity: 0.5; cursor: not-allowed; }
.link.tiny {
  margin-left: 0.5rem;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.error {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.65rem;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-left: 3px solid var(--danger);
  font-size: 0.85rem;
}

/* --- PAN guidance ------------------------------------------------------- */

.hint {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  /* Reserved so the form does not jump as the message changes length. */
  min-height: 1.3em;
}
.hint code,
.generated,
.issued code {
  padding: 0.08rem 0.32rem;
  background: var(--shell);
  border: 1px solid var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}
.hint.bad  { color: var(--danger); }
.hint.warn { color: var(--warn); }
.hint.ok   { color: var(--good); }

#pan {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}

/* --- users -------------------------------------------------------------- */

#admin { background: var(--shell); }
#admin select { background: var(--card); }

/* A password on screen: monospaced, selectable, and obviously set apart,
   because it gets read aloud and typed by hand more than it gets copied. */
.issued {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--accent);
}
.issued p { margin: 0 0 0.5rem; font-size: 0.85rem; }
.issued .sub { margin: 0.6rem 0; }
.issued code,
.generated {
  display: inline-block;
  margin: 0.2rem 0.6rem 0.2rem 0;
  padding: 0.35rem 0.55rem;
  font-size: 1rem;
  user-select: all;
  word-break: break-all;
}
.generated { margin-top: 0.6rem; }

.tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  color: var(--muted);
  background: var(--shell);
  border: 1px solid var(--rule);
  font-size: 0.68rem;
  vertical-align: middle;
}

/* --- tables ------------------------------------------------------------- */

table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th {
  padding: 0.45rem 0.6rem;
  color: var(--muted);
  background: var(--shell);
  border: 1px solid var(--rule);
  font-size: 0.68rem;
  font-weight: 650;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
td {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--rule);
  vertical-align: middle;
}
.right { text-align: right; }

td.pan,
td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  /* A mask broken over three lines reads as three values. */
  white-space: nowrap;
}
/* The cue that a real number is on screen rather than a mask. This used to
   name td.pan only, while the cells are built with class "mono" - so the
   highlight never fired on the one state it exists for. */
td.pan.shown,
td.mono.shown { color: var(--danger); font-weight: 600; }

/* The second line in a cell: a beneficiary name that disagrees with the PAN
   name, or the IFSC under its bank. Present but subordinate. */
.alt-name {
  font-size: 0.82em;
  color: var(--muted);
}
td.when { color: var(--muted); white-space: nowrap; }
/* The one column that is prose rather than a field. Sealed it reads "3 lines
   - hidden" and fits anywhere; revealed it keeps the breaks it was typed with
   and is held to a column's worth of width so it cannot push the rest of the
   table off the screen. */
td.addr { max-width: 18rem; white-space: normal; }
td.addr.shown {
  white-space: pre-line;
  color: var(--danger);
  font-weight: 600;
}
td.act { white-space: nowrap; }

#staff td .link { margin-left: 0.9rem; }
#staff tr.off td { opacity: 0.55; }

.empty {
  margin: 1rem 0 0;
  padding: 1.25rem;
  color: var(--muted);
  background: var(--shell);
  border: 1px dashed var(--rule-strong);
  text-align: center;
  font-size: 0.88rem;
}

/* Wide tables scroll on their own rather than pushing the page sideways. */
@media (max-width: 40rem) {
  /* The narrow-screen fallback for tables that scroll on their own. */
  table { display: block; overflow-x: auto; }
  /* But not one already inside a .table-wrap. display:block stops it laying
     out as a table, which drops position:sticky off the action cells and nests
     a second scroller inside the wrapper's. Higher specificity, so it wins
     wherever it appears in the file. */
  .table-wrap > table { display: table; overflow-x: visible; }
}

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

/* Sign-in and the password screen stack their fields. Without explicit rhythm
   a label sits flush against the input above it and the whole column reads as
   one undifferentiated block. */
/* Sections.
   A rule carries the separation so the heading itself can stay quiet, and the
   fieldset is a real one: a screen reader announces the section name with each
   field inside it, which is most of the reason the form is grouped at all. */
.stack fieldset.group {
  margin: 0;
  padding: 0;
  border: 0;
  /* A fieldset is min-content wide by default, which collapses the rows
     inside it. */
  min-inline-size: 0;
}
.stack fieldset.group + fieldset.group { margin-top: 1.75rem; }

/* The rule and the space above it belong to the LEGEND, not to the fieldset.
   A legend is lifted out of normal flow and painted over the fieldset's top
   border, so a padding-top on the fieldset lands underneath it instead of
   above it - which put 28px of air between every heading and its first field
   while the first section, having no padding, sat tight. Measured, not
   guessed: the gap was 46px in five sections and 18px in the sixth. */
.stack legend {
  display: block;
  width: 100%;
  margin: 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.stack fieldset.group:first-of-type legend { padding-top: 0; border-top: 0; }
/* The number is the person's place in a form long enough to be put down and
   picked up again, not decoration. */
.stack legend .step {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.6rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: 0.05em;
}
.group-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* A label is the first child of its .field wrapper, so the rule below zeroes
   its top margin and the row as a whole has to carry the rhythm instead. */
.stack .row { margin-top: 1.1rem; }
.stack fieldset.group > .row:first-of-type { margin-top: 1.1rem; }
.stack .field .hint { margin-top: 0.4rem; }

.stack label { margin-top: 1.1rem; }
.stack label:first-child { margin-top: 0; }
.stack input { margin-bottom: 0; }
.stack button[type="submit"] { margin-top: 1.5rem; width: 100%; }
.stack .link { margin-top: 0.75rem; display: inline-block; }
.stack .error { margin-top: 1rem; }

/* The narrow cards do not need to be as wide as the record table. */
#signin, #newpass { max-width: 24rem; }

/* Six sections and twenty-one fields. Four rem of extra width is what lets the
   three-up and two-up rows hold their fields at a usable size instead of
   stacking on a laptop. */
#submit, #confirm { max-width: 34rem; }

/* The allowlist textarea is monospace because it holds a column of addresses
   being checked character by character. An address is prose; the same
   treatment would make it harder to read, not easier. */
textarea.plain {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.45;
}

/* Labels across a row must share a baseline. The PAN label carries an inline
   Show button, which makes it taller than its neighbours and drags its field
   down unless the height is pinned. */
.row label {
  display: flex;
  align-items: center;
  min-height: 1.25rem;
  margin-bottom: 0.4rem;
}

/* --- tabs --------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0;
  padding: 0 !important;
  background: var(--shell);
  /* The four labels come to 394px, which is four more than a 390px phone has,
     and those four pixels made the whole page scroll sideways. The bar carries
     its own overflow now. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.tab {
  /* Without this they shrink to fit and "Administrators" breaks over two
     lines instead of the bar scrolling. */
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.on {
  color: var(--ink);
  background: var(--card);
  border-bottom-color: var(--accent);
}

/* --- assorted ----------------------------------------------------------- */

textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: var(--shell);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--card); }

.row-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}
.row-end button[type="button"]:not(.link) { }

.note {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.65rem;
  color: var(--good);
  background: var(--shell);
  border-left: 3px solid var(--good);
  font-size: 0.85rem;
}
/* The same note when the upload was refused. Amber rather than red: the file
   is wrong, but nothing was broken and nothing was lost - it is work to redo,
   not damage to undo. */
.note.bad {
  color: var(--warn);
  border-left-color: var(--warn);
}

/* What is still wrong with the sheet, row by row. Narrow row and address
   columns so the reason - the only part that varies in length - gets the rest
   of the width; and it scrolls on its own so a long reason never pushes the
   page sideways. */
#allowed-result { overflow-x: auto; }
.problems {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}
.problems th:first-child, .problems td:first-child { width: 3.5rem; }
.problems td:nth-child(2) { white-space: nowrap; }
/* Two kinds of row. An error stopped the upload; a warning did not, and
   colouring them the same would make a routine re-upload look like a
   failure. */
.problems tr.is-error  td:last-child { color: var(--danger); }
.problems tr.is-warning td:last-child { color: var(--warn); }
.problems tr.is-warning td { opacity: 0.85; }

/* The confirmation list: the last look before a number is committed. */
/* --- what the invitation already filled in ------------------------------- */

/* A field the invitation filled in. It has to read as settled rather than as
   broken: the border stays where it was, the fill says "not yours to type in",
   and the cursor does not invite a click. */
input.locked {
  background: var(--shell);
  color: var(--muted);
  cursor: default;
}
/* Still focusable - it is read with a keyboard like any other field - but the
   ring is the quiet one, because landing here is not a prompt to type. */
input.locked:focus-visible { outline: 2px solid var(--rule-strong); }

.check {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
}
.check dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: center;
}
.check dd { margin: 0; font-size: 1.05rem; }

/* The optional rows are wrapped in a div so one can be hidden without hiding
   the other. Without this the wrapper becomes a single grid item and its
   dt/dd pile into the left column. The :not([hidden]) was once load-bearing,
   because an author rule beat the browser's own [hidden] whatever its
   specificity, and display:contents would otherwise make hidden do nothing. */
.check > div:not([hidden]) { display: contents; }

/* The review screen mirrors the form's sections, so the two can be read side
   by side and the person checking knows which part they are looking at. */
.check-head {
  margin: 1.75rem 0 0.8rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.check-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* First child of its own wrapper, so the :first-child reset above would strip
   the rule that separates it from the section before it. Put back. */
#c-pf-block > .check-head {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
/* Keeps the typed line breaks in an address. */
.check dd.lines { white-space: pre-line; line-height: 1.4; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }

#c-submit {
  padding: 0.55rem 1.1rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#c-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.link.danger { color: var(--danger); }
.ok-text { color: var(--good); }
/* An invitation the mail server refused. The reason is on the title
   attribute, because it is the server's own sentence and too long for a
   column. */
.bad-text { color: var(--danger); cursor: help; }
/* Never attempted, rather than refused. */
.warn-text { color: var(--warn); cursor: help; }

/* The heading on a pane whose form is now a single button. */
.pane-head {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 650;
}
td.act .link { margin-left: 0.9rem; }
tr.off td { opacity: 0.55; }

/* --- destructive actions ------------------------------------------------ */

/* Red, bordered and separated from everything else, so the purge never reads
   as just another button in a row. */
.danger-panel { border-color: var(--danger); }
.danger-panel label { margin-top: 0.9rem; }
.danger-panel input { max-width: 16rem; letter-spacing: 0.1em; }

.danger-button {
  padding: 0.55rem 1.1rem;
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.danger-button:disabled { opacity: 0.5; cursor: not-allowed; }

#data-actions { margin-bottom: 0.5rem; }
#download {
  padding: 0.45rem 0.9rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* --- inline help -------------------------------------------------------- */

.help {
  margin: 0.75rem 0 0;
  border: 1px solid var(--rule);
  background: var(--card);
}
.help summary {
  padding: 0.55rem 0.8rem;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.help summary:hover { filter: brightness(1.15); }
.help[open] summary { border-bottom: 1px solid var(--rule); }
.help-body { padding: 0.9rem 0.8rem; font-size: 0.85rem; }
.help-body p { margin: 0 0 0.75rem; }
.help-body code {
  padding: 0.05rem 0.28rem;
  background: var(--shell);
  border: 1px solid var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* A small mock of a spreadsheet, complete with row and column headings, so it
   is recognisable as one at a glance rather than read as a table of data. */
.example {
  width: auto;
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
}
.example th {
  padding: 0.3rem 0.55rem;
  text-align: center;
  font-size: 0.7rem;
}
.example tbody th {
  background: var(--shell);
  color: var(--muted);
  font-weight: 600;
}
.example td {
  padding: 0.3rem 0.6rem;
  background: var(--card);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
  margin: 0.9rem 0;
}
.facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.1rem;
}
.facts dd { margin: 0; }

@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .facts dd { margin-bottom: 0.5rem; }
}

/* A checkbox that changes what a button does needs to read as a sentence, not
   as a stray control floating beside one. */
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.check-line input { width: auto; margin: 0.15rem 0 0; accent-color: var(--danger); }
.danger-panel .hint { margin-top: 0.4rem; }

/* ===========================================================================
   Two intakes
   ---------------------------------------------------------------------------
   Everything below exists because the vault serves two kinds of hire. The
   chooser is deliberately heavy for a form control: picking the wrong one
   sends somebody a letter quoting the wrong employment terms, so it is sized
   to be read rather than clicked past.
   =========================================================================== */

.track-pick {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.track-pick legend {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.pick {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  background: var(--card);
}
.pick:hover { border-color: var(--rule-strong); }
.pick:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pick input { margin-top: 0.22rem; flex: none; }
.pick span { display: grid; gap: 0.15rem; }
.pick strong { font-size: 0.92rem; }
.pick em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.pick .pick-sends {
  font-family: inherit;
  font-size: 0.78rem;
}

/* Which intake a row belongs to. A chip rather than a word, so the column
   stays narrow in a table that is already wider than the window. */
.pill {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill.track-artist {
  background: #eef2fb;
  color: #1e3f8f;
  border-color: #cfdaf3;
}
.pill.track-qa {
  background: #eaf5ee;
  color: var(--good);
  border-color: #c8e2d2;
}

/* The optional marker beside a label, for the one name field that genuinely
   is optional. Quieter than the label it sits beside. */
.opt {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82em;
}

.example-head {
  margin: 0.9rem 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
}

/* ===========================================================================
   The generated edit form
   =========================================================================== */

.edit-head {
  margin: 1rem 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.edit-head:first-child { margin-top: 0; }

.edit-field {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 0.6rem;
}
.edit-field label {
  font-size: 0.8rem;
  color: var(--ink);
}

/* Two columns once there is room, so a thirty-field form is not a mile of
   scrolling. One column on a phone, where side-by-side inputs are unusable. */
@media (min-width: 46rem) {
  #edit-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
  }
  #edit-body .edit-head { grid-column: 1 / -1; }
}


/* ===========================================================================
   The submissions search, and the danger zone it displaced
   =========================================================================== */

.search-line {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.6rem;
}
.search-line input {
  flex: 1;
  min-width: 0;
  max-width: 24rem;
}
.search-line .hint { flex: none; margin: 0; }

/* Only for a label that exists for a screen reader. Not display:none, which
   would take it out of the accessibility tree along with everything else. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Set apart from the administrator list above it, because what is in here
   cannot be undone from the application. */
.danger-zone {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.danger-zone h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  color: var(--danger);
}
.danger-zone .sub { margin: 0 0 0.6rem; }


/* ===========================================================================
   The Users tab: order, email filter, and which upload
   =========================================================================== */

.people-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 0 0 0.6rem;
}
.people-tools .tool { display: flex; align-items: center; gap: 0.5rem; }
.people-tools label { margin: 0; white-space: nowrap; }
.people-tools select { width: auto; min-width: 11rem; max-width: 20rem; }
