/*
 * Dave's HQ theme.
 * All screens (login, Routing Forms, placeholders, onboarding) inherit these
 * tokens. Do not invent page-local colors, radii, or shadows.
 *
 * HARD RULE: Routing Form sections stay stacked full-width.
 * NEVER put sections side-by-side.
 */
:root {
  --navy: #001a4d;
  --navy-2: #002866;
  --blue: #000088;
  --blue-soft: #b8c4e8;
  --sky: #e8eef8;
  --page: #f2f5fb;
  --paper: #ffffff;
  --ink: #12141c;
  --muted: #4e5a6e;
  --label: #7a8494;
  --line: #cdd6e6;
  --control-line: #c5d0e0;
  --ok: #1f6b3a;
  --ok-bg: #e6f4ea;
  --warn: #3d4f80;
  --warn-bg: #e8eef8;
  --bad: #8a1f1f;
  --bad-bg: #fde8e8;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.15rem;
  --space-6: 1.5rem;
  --gutter: 1rem;
  --section-gap: 1rem;
  --col-gap: 0.75rem;

  --content-max: 1280px;
  --content-login: 28rem;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --shadow: 0 8px 28px rgba(0, 26, 77, 0.12);
  --card-pad: 1.15rem;
  --control-pad: 0.75rem 0.9rem;
  --tap: 56px;
  --focus: 3px solid var(--blue-soft);

  /*
   * Standing rule: size fields to their content.
   * date — a little wider than mm/dd/yyyy, plus the picker icon.
   * number-short — a little wider than 9,999.9.
   * currency — a little wider than $9,999.99.
   */
  --field-w-date: calc(11ch + 3.4rem);
  --field-w-number-short: calc(8ch + 3.2rem);
  --field-w-currency: calc(9ch + 2.6rem);
  --field-w-name: 16rem;
  --field-w-text: 22rem;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* Tall enough for a wrapped label at 390px. Clearance keeps the last
     control above the bar, not flush against it. */
  --nav-h: 6.5rem;
  /* Extra room so the last control, including an upload and a Send
     button, sits clear of the pinned bar at 1024 and 390. */
  --nav-clear: calc(var(--nav-h) + 4.5rem);

  /* One press for every button. Do not restyle :active on a single screen.
     Pale controls use a navy tint. Filled controls override --btn-press-bg
     with a darker mix of their own fill (about brightness 0.85). */
  --btn-press-duration: 100ms;
  --btn-press-scale: 0.97;
  --btn-shadow: 0 2px 5px rgba(0, 26, 77, 0.16);
  --btn-shadow-pressed: 0 1px 1px rgba(0, 26, 77, 0.14);
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-top: 4.75rem;
  scroll-padding-bottom: calc(var(--nav-clear) + var(--safe-b));
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  overflow: visible;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-top: var(--safe-t);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.boot {
  text-align: center;
  padding: 4rem var(--gutter);
  color: var(--muted);
}

#app {
  min-height: 100%;
  min-height: 100dvh;
}

.app-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell.no-nav {
  padding-bottom: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.45rem;
  padding-inline: max(1.15rem, env(safe-area-inset-left, 0px)) max(1.15rem, env(safe-area-inset-right, 0px));
  background: var(--navy);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-home {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-home:hover .brand-title,
.brand-home:focus-visible .brand-title {
  text-decoration: underline;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  margin: 0;
  overflow: hidden;
  font-size: 1.05rem;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-user {
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem;
  color: #d7deea;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  box-sizing: border-box;
  width: max-content;
  min-width: 0;
  max-width: min(188px, calc(100vw - 9.5rem));
  height: 52px;
  padding: 5px 10px;
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 26, 77, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.22);
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.login-logo {
  display: block;
  height: 118px;
  width: auto;
  max-width: min(92vw, 440px);
  margin: 0 auto;
  object-fit: contain;
  background: transparent;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.brand p,
.brand-user {
  margin: 0;
  font-size: 0.78rem;
  color: #d7deea;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}

.page-head .page-title {
  margin: 0;
}

.page-gear {
  margin-left: auto;
  flex: 0 0 auto;
}

.ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  min-height: 44px;
  padding: 0 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  --btn-press-bg: rgba(255, 255, 255, 0.22);
}

/*
 * Shared press, hover, and keyboard focus.
 * <button> covers primary, quiet, ok, danger, icon, ghost, eye toggles,
 * row-menu triggers and items, modal close, filter buttons, and swatches.
 * Anchors below are the button-like links: .btn, row-menu items, bottom nav.
 */
button,
a.btn,
a.row-menu-item,
.nav a {
  transition:
    transform var(--btn-press-duration) ease,
    filter var(--btn-press-duration) ease,
    box-shadow var(--btn-press-duration) ease,
    background-color var(--btn-press-duration) ease;
  box-shadow: var(--btn-shadow);
}

button:not(:disabled):hover,
a.btn:hover,
a.row-menu-item:hover,
.nav a:hover {
  filter: brightness(0.97);
}

button:not(:disabled):active,
a.btn:active,
a.row-menu-item:active,
.nav a.on:active,
.nav a:active {
  /* Land on the press frame. A 100ms ease never finishes during a click. */
  transition-duration: 0s;
  filter: none;
  background-color: var(--btn-press-bg);
  transform: scale(var(--btn-press-scale));
  box-shadow: var(--btn-shadow-pressed);
}

button:focus,
a.btn:focus,
a.row-menu-item:focus,
.nav a:focus {
  outline: none;
}

button:focus-visible,
a.btn:focus-visible,
a.row-menu-item:focus-visible,
.nav a:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active,
  a.btn:active,
  a.row-menu-item:active,
  .nav a.on:active,
  .nav a:active {
    transform: none;
  }
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-avatar-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  --btn-press-bg: rgba(255, 255, 255, 0.22);
}

.account-avatar-btn:hover,
.account-menu.is-open .account-avatar-btn {
  background: rgba(255, 255, 255, 0.12);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  background-color: var(--avatar-bg, #2563eb);
  box-shadow: 0 0 0 2px #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: #fff;
}

.account-avatar-initials {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.account-avatar-img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.account-menu-pop[hidden],
.avatar-colors[hidden] {
  display: none !important;
}

.avatar-colors {
  display: grid;
  grid-template-columns: repeat(6, 1.35rem);
  gap: 0.4rem;
  padding: 0.15rem 0.55rem 0.45rem;
}

.avatar-swatch {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.avatar-swatch.is-on,
.avatar-swatch:focus-visible {
  box-shadow: 0 0 0 2px var(--navy);
}

/*
 * Staff content grows with the window up to --content-max (1280px).
 * Login stays on --content-login so the sign-in card does not stretch.
 * --gutter (1rem) is the only unused strip at the edges.
 */
main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  padding: 1.1rem var(--gutter) var(--space-6);
}

.app-shell:not(.no-nav) main {
  padding-bottom: calc(var(--nav-clear) + var(--safe-b));
  scroll-padding-bottom: calc(var(--nav-clear) + var(--safe-b));
}

.app-shell.no-nav main {
  width: min(var(--content-login), 100%);
  padding-bottom: calc(var(--space-6) + var(--safe-b));
}

/* Shared surface language: cards, tiles, checklist columns. */
.card,
.tile,
.checklist-columns,
.checklist-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: var(--card-pad);
  margin-bottom: var(--section-gap);
}

.form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.form-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.form-head-menu {
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.form-head .page-title {
  margin-bottom: 0.2rem;
}

.form-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.45rem;
}

.form-meta .help {
  margin: 0;
}

.origin-meta {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress.slim {
  margin: 0;
  height: 8px;
}

.block-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.details-card,
.banking-card,
.checklist-col {
  padding: 0.9rem var(--gutter);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
  width: 100%;
}

.form-layout > .card,
.form-layout form[data-save-fields] .card {
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
}

.form-layout form[data-save-fields] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
  min-width: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0.55rem 0.7rem;
}

.info-grid .field {
  margin-bottom: 0;
  gap: var(--space-1);
}

.info-grid .field label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
}

.info-grid .field input,
.info-grid .field select,
.info-grid .field textarea {
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
}

.info-grid .field textarea {
  min-height: 72px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-street {
  grid-column: 1 / -1;
}

.field-unit {
  grid-column: auto;
}

.info-kicker,
.check-group {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}

.info-kicker:first-child,
.check-group:first-child {
  margin-top: 0;
}

.check-group {
  margin: 0 0 0.15rem;
}

.card h2,
.page-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--navy);
}

.lede,
.help {
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.tile-progress {
  margin: 0.45rem 0 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-4);
}

.field label {
  font-weight: 700;
  color: var(--label);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: var(--tap);
  padding: var(--control-pad);
  border: 2px solid var(--control-line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field textarea.field-long,
textarea.field-long {
  min-height: var(--tap);
  field-sizing: content;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
  line-height: 1.35;
}

.employer-readout {
  margin: 0;
  font-weight: 700;
}

.employer-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.employer-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.55rem 0.7rem;
  min-width: 0;
}

.employer-pair .field input {
  margin-top: auto;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: var(--focus);
  border-color: var(--blue);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.55rem 0.85rem;
  grid-column: 1 / -1;
}

.field-row .field {
  margin-bottom: 0;
}

.field-date,
.field-number-short,
.field-currency,
.field-name {
  width: max-content;
  max-width: 100%;
}

.field-date input {
  width: var(--field-w-date);
  max-width: 100%;
}

.field-number-short input {
  width: var(--field-w-number-short);
  max-width: 100%;
}

.field-currency input {
  width: var(--field-w-currency);
  max-width: 100%;
}

.field-name input,
.field-name select {
  width: var(--field-w-name);
  max-width: 100%;
}

.field-text {
  flex: 1 1 var(--field-w-text);
  width: var(--field-w-text);
  max-width: 100%;
  min-width: min(100%, 12rem);
}

.field-text input {
  width: 100%;
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled,
.rf-section.is-locked input,
.rf-section.is-locked textarea,
.rf-section.is-locked select {
  background: var(--sky);
  border-color: #d5deea;
  color: var(--muted);
  box-shadow: none;
  cursor: default;
}

.field input:disabled:focus,
.field textarea:disabled:focus,
.field select:disabled:focus,
.field input:disabled:focus-visible,
.field textarea:disabled:focus-visible,
.field select:disabled:focus-visible,
.rf-section.is-locked input:focus,
.rf-section.is-locked textarea:focus,
.rf-section.is-locked select:focus,
.rf-section.is-locked input:focus-visible,
.rf-section.is-locked textarea:focus-visible,
.rf-section.is-locked select:focus-visible {
  outline: none;
  border-color: #d5deea;
  box-shadow: none;
}

/*
 * Every locked control, including ones the generic .field rule misses:
 * I-9 Section 2 mirrors (first day), typed signatures, and date inputs.
 * Deeper than --sky so a disabled box does not read as an empty white field.
 */
.rf-section.is-locked input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="file"]),
.rf-section.is-locked textarea,
.rf-section.is-locked select,
.rf-section.is-locked .mirror-value,
.field.is-locked input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="file"]),
.field.is-locked textarea,
.field.is-locked select,
.field.is-locked .mirror-value,
.sign-wrap.is-locked input,
input[type="date"]:disabled,
textarea:disabled,
select:disabled {
  background-color: #dce5f2;
  border-color: #c9d4e6;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
  box-shadow: none;
  cursor: default;
}

.rf-section.is-locked input:not([type="radio"]):not([type="checkbox"]):focus,
.rf-section.is-locked textarea:focus,
.rf-section.is-locked select:focus,
.field.is-locked input:focus,
.field.is-locked textarea:focus,
.field.is-locked select:focus,
.sign-wrap.is-locked input:focus,
input[type="date"]:disabled:focus,
textarea:disabled:focus,
select:disabled:focus {
  outline: none;
  border-color: #c9d4e6;
  box-shadow: none;
}

.rf-section.is-locked .sign-ack {
  color: var(--muted);
}

input[type="date"]:disabled::-webkit-calendar-picker-indicator {
  opacity: 0.45;
}

.field select.is-placeholder,
.field select:has(option[value=""]:checked) {
  color: var(--muted);
}

.field select option {
  color: var(--ink);
}

.field select option[value=""] {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 7.5rem;
  max-width: 100%;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  --btn-press-bg: color-mix(in srgb, var(--blue) 85%, #000);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.btn-save {
  margin-top: 0;
  justify-self: start;
}

/* Sign-in card is already narrow; fill that card only. */
[data-login] .btn {
  width: 100%;
}

.field[hidden],
.info-grid .field[hidden],
.field.is-hidden,
.info-kicker.is-hidden,
.i9-note.is-hidden {
  display: none !important;
}

.mirror-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
}

.mirror-value {
  margin: 0;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f4f7fb;
  font-weight: 650;
  color: var(--ink);
}

.i9-note {
  margin: 0;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.info-grid .field label.choice-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.info-grid .field .choice-option input,
.choice-option input {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin-top: 0.2rem;
  padding: 0;
  border-radius: 50%;
  accent-color: var(--navy);
  flex: 0 0 auto;
}

.field.is-incomplete input,
.field.is-incomplete select,
.field.is-incomplete textarea {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.field.is-incomplete label {
  color: var(--bad);
}

.title-prompt {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sky);
}

.title-prompt label {
  font-size: 0.92rem;
  font-weight: 700;
}

.title-prompt .btn {
  justify-self: start;
}

.field-error {
  margin: 0.35rem 0 0;
  color: var(--bad);
  font-size: 0.92rem;
}

.load-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.load-error-actions .btn {
  margin-top: 0;
}

/* One clamp for any text that should stop after three lines. */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.check-wrap.is-incomplete,
.file-wrap.is-incomplete {
  background: var(--bad-bg);
  border-radius: var(--radius-sm);
  box-shadow: inset 3px 0 0 var(--bad);
  padding-left: 0.45rem;
}

.check-wrap.is-incomplete h3,
.file-wrap.is-incomplete h3 {
  color: var(--bad);
}

.btn-ok {
  background: var(--ok);
  --btn-press-bg: color-mix(in srgb, var(--ok) 85%, #000);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.chip {
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.chip.on {
  border-color: var(--navy);
  background: var(--sky);
}

.banner {
  border-radius: var(--radius-md);
  padding: 0.85rem var(--space-4);
  margin-bottom: var(--space-4);
}

.banner.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.banner.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.banner.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.missing-list {
  margin: var(--space-2) 0 0;
  padding-left: 1.2rem;
}

.progress {
  height: 12px;
  background: #dce4f2;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0 var(--space-1);
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--blue);
}

/*
 * Mixed section bodies (HR finish Job Offer / I-9 / Payroll / Notes, and
 * similar): never sit in one skinny column with empty right space.
 * One column → full usable width. If items wrap, they grow to fill the
 * columns that wrap implied.
 */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.15rem 0.9rem;
  width: 100%;
  grid-column: 1 / -1;
}

.check-list > .check-wrap {
  flex: 1 1 16rem;
  min-width: min(16rem, 100%);
}

.check-item,
.file-item {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.55rem 0.1rem;
  border: 0;
  background: transparent;
  min-height: 44px;
}

label.check-item {
  cursor: pointer;
}

.box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--navy);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-top: 2px;
  font-weight: 800;
  font-size: 0.8rem;
}

.check-input,
.packed-check-input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--ok);
}

.packed-check dd {
  display: flex;
  align-items: center;
  min-height: 1.4rem;
}

.check-item.done .box,
.file-item.done .box {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.check-item h3,
.file-item h3,
.rule h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
}

.check-item p,
.file-item p,
.rule p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.rule {
  padding: 0.4rem 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-4);
}

.rule:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem var(--space-2);
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  margin-bottom: 0.4rem;
}

.tag.done {
  background: var(--ok-bg);
  color: var(--ok);
}

.hours-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.hours-list strong {
  display: block;
}

.hours-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.15rem;
  padding: 0.4rem 0.35rem calc(0.45rem + var(--safe-b));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 750;
  border-radius: 12px;
  text-align: center;
  line-height: 1.15;
  padding: 0.2rem 0.15rem;
  white-space: normal;
  overflow-wrap: normal;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

@media (max-width: 430px) {
  .nav {
    gap: 0.05rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .nav a {
    font-size: 0.6rem;
    padding: 0.15rem 0.02rem;
  }
}

.settings-stack {
  display: grid;
  gap: var(--section-gap);
}

.list-heading {
  margin: 1.25rem 0 0.55rem;
  font-size: 0.95rem;
  color: var(--navy);
}

.check-wrap {
  border-bottom: 1px solid var(--line);
}

.check-wrap:last-child {
  border-bottom: 0;
}

.check-list > .file-wrap {
  flex: 1 1 100%;
}

@media (min-width: 640px) {
  .check-list > .check-wrap:not(.file-wrap) {
    border-bottom: 0;
  }
}

.nav a.on {
  color: var(--navy);
  background: var(--sky);
}

.nav .dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  line-height: 1;
  margin-bottom: 0.05rem;
}

.nav .dot .icon {
  width: 20px;
  height: 20px;
}

.icon {
  display: block;
  flex: 0 0 auto;
}

.nav .nav-icon-svg,
.nav-icon-svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
}

.section-icon {
  display: inline-block;
  vertical-align: -4px;
  margin-right: 0.25rem;
}

.rf-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.rf-section-head .block-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.section-status {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.section-status.is-complete {
  color: var(--ok);
}

.section-lock-note {
  flex-basis: 100%;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--navy);
}

.handoff-panel {
  margin-bottom: var(--space-4);
}

.handoff-panel .help {
  margin-top: 0;
}

.rf-section.is-current {
  border-color: var(--blue-soft);
}

.rf-section.is-collapsed {
  padding-bottom: 0.75rem;
}

.section-summary {
  margin: 0;
}

.section-summary div {
  display: grid;
  gap: 0.1rem;
}

.section-summary dt {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
}

.section-summary dd {
  margin: 0;
  font-weight: 650;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.section-actions.field {
  flex-direction: row;
  margin-bottom: 0;
}

.section-actions .field-error {
  margin: 0;
}

.section-actions .btn {
  gap: 0.4rem;
}

.sign-ack {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--ink);
}

.doc-block {
  display: grid;
  gap: 0.55rem 1.25rem;
  width: 100%;
  justify-items: stretch;
}

.doc-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
}

/* Typed signatures use a sentence, not a short uppercase caption. */
.info-grid .sign-wrap .doc-label,
.doc-block-sign .doc-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.doc-open-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0;
  min-height: 36px;
  color: var(--ink);
  font-weight: 500;
}

.doc-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  min-height: 36px;
}

.doc-open:hover,
.doc-inline:hover {
  text-decoration: underline;
}

a.doc-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 750;
  white-space: nowrap;
}

.doc-help,
.help.doc-help {
  margin: 0;
  font-size: 0.88rem;
}

.doc-wrap,
.sign-wrap {
  align-items: start;
  grid-column: 1 / -1;
}

.doc-block .doc-open {
  justify-self: start;
}

@media (min-width: 640px) {
  .doc-wrap .doc-block {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .doc-wrap .doc-help {
    grid-column: 1 / -1;
  }

  .doc-block-sign {
    grid-template-columns: minmax(11rem, auto) minmax(0, 1fr);
    align-items: center;
  }

  .doc-block-sign .doc-label,
  .doc-block-sign .sign-ack,
  .doc-block-sign .doc-open-line,
  .doc-block-sign [data-sign-name],
  .doc-block-sign input[type="text"],
  .doc-block-sign .stamp {
    grid-column: 1 / -1;
  }
}

.info-grid.is-packed,
.section-summary {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.55rem 1.15rem;
  margin: 0;
}

.info-grid.is-packed .field-wide,
.info-grid.is-packed .packed-item.field-wide {
  grid-column: 1 / -1;
}

.info-grid.is-packed > .field,
.section-summary > .field {
  margin-bottom: 0;
}

.packed-item {
  margin: 0;
  min-width: 0;
}

.packed-item dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
}

.packed-item dd {
  margin: 0;
  font-weight: 650;
}

.i9-admin-card .block-title,
.i9-admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.i9-admin-card .help {
  margin-bottom: 0.75rem;
}

.sign-wrap.is-incomplete,
.field.sign-wrap.is-incomplete {
  background: var(--bad-bg);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
}

.invite-card p,
.invite-modal-card .invite-copy {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-weight: 550;
}

.invite-staging-notice,
.invite-not-delivered {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
}

.invite-staging-notice {
  background: var(--warn-bg);
  color: var(--warn);
}

.invite-not-delivered {
  background: var(--bad-bg);
  color: var(--bad);
}

.invite-staging-notice .icon,
.invite-not-delivered .icon {
  flex: none;
  margin-top: 0.1rem;
}

[data-invite-not-delivered] .row-menu-note {
  color: var(--bad);
}

.hq-modal-card.invite-modal-card {
  width: min(36rem, 100%);
}

.invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.invite-url {
  flex: 1 1 16rem;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border: 2px solid var(--control-line);
  border-radius: var(--radius-sm);
  font: inherit;
}

.invite-row .btn {
  gap: 0.35rem;
}

.login-hero {
  text-align: center;
  padding: var(--space-2) 0 1.25rem;
}

.login-hero h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0.6rem 0 0.3rem;
  color: var(--navy);
}

.home-actions {
  display: grid;
  gap: 0.7rem;
}

.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.05rem 1.1rem;
  min-height: 88px;
}

.tile h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.tile p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 0.45rem + var(--safe-b));
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: min(16.5rem, calc(100vw - 2rem));
  background: rgba(18, 20, 28, 0.88);
  color: #fff;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0, 26, 77, 0.16);
  pointer-events: none;
}

.toast[hidden] {
  display: none;
}

.small {
  font-size: 0.92rem;
  color: var(--muted);
}

.chooser {
  width: min(var(--content-login), 100%);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) calc(var(--space-6) + var(--safe-b));
}

.door {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem;
  min-height: 96px;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.door h3 {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
  color: var(--navy);
}

.door p {
  margin: 0;
  color: var(--muted);
}

.template-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  color: var(--navy);
}

.start-form {
  margin-top: 0.85rem;
}

.employee-subject {
  margin: 0;
  font-weight: 650;
  color: var(--navy);
}

.btn-row.cats {
  display: flex;
  flex-wrap: wrap;
  max-width: none;
  grid-template-columns: none;
}

.btn-row.cats .chip {
  flex: 1 1 30%;
}

.pay-card h3 {
  margin: 0.15rem 0 0.4rem;
}

.pay {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.pay strong {
  font-size: 1.7rem;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.crumb {
  margin: 0 0 var(--space-2);
  font-size: 0.92rem;
  font-weight: 700;
}

.crumb a {
  text-decoration: none;
}

.stamp {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ok);
}

.file-link a {
  font-weight: 650;
}

.file-drop-hint {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.file-wrap.is-drop-target .file-item {
  outline: 2px dashed var(--blue);
  outline-offset: 4px;
  background: var(--sky);
  border-radius: var(--radius-sm);
}

.file-wrap.is-uploading {
  opacity: 0.7;
}

.file-pick {
  display: inline-flex;
  margin-top: var(--space-2);
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sky);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.complete-panel {
  width: 100%;
}

.complete-panel .btn,
.form-layout .btn-ok {
  justify-self: start;
}

.checklist-block {
  min-width: 0;
  width: 100%;
}

.checklist-head {
  min-width: 0;
}

.checklist-head .block-title {
  margin-bottom: var(--space-2);
}

/*
 * Checklist columns:
 *   Narrow — one fused card (.checklist-columns carries the surface).
 *   900px+ — wrapper surface turns off; each .checklist-col is its own
 *            rounded, bordered, shadowed card. gap is page background.
 * NEVER fuse columns into one flat grid. NEVER sit beside Details.
 */
.checklist-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: var(--card-pad);
  width: 100%;
}

.checklist-col {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  min-width: 0;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: grid;
  gap: 0.7rem;
}

.field-heading {
  margin: var(--space-4) 0 0.35rem;
  font-family: var(--font-display);
  color: var(--navy);
}

.yes-no-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.yes-no-row h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.check-item:disabled,
.check-item:has(input:disabled),
.rf-section.is-locked .check-item {
  opacity: 0.92;
  cursor: default;
}

.related-box .btn {
  margin-top: 0.4rem;
}

.stamp-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stamp-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.stamp-list li:last-child {
  border-bottom: 0;
}

.stamp-list strong {
  display: block;
}

.stamp-list .small {
  display: block;
  margin-top: 0.15rem;
}

.start-card {
  margin-bottom: var(--section-gap);
}

.start-bar {
  display: grid;
  align-items: start;
  gap: var(--space-3);
}

.start-bar .field {
  margin-bottom: 0;
}

.start-bar .btn {
  justify-self: start;
  align-self: start;
}

.forms-table-wrap {
  overflow: visible;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-4);
}

.forms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.forms-table th,
.forms-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.forms-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
  background: var(--sky);
}

.forms-table tr:last-child td {
  border-bottom: 0;
}

.forms-table tbody tr.forms-row {
  cursor: pointer;
}

.forms-table tbody tr.forms-row:hover,
.forms-table tbody tr.forms-row:focus-within {
  background: var(--sky);
}

.forms-table a,
.forms-table .forms-row-link {
  font-weight: 650;
  text-decoration: none;
}

.btn.btn-save.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hq-spinner-inline {
  width: 1em;
  height: 1em;
  margin: 0;
  border-width: 2px;
  flex: 0 0 auto;
}

.table-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.table-sub.is-stamp {
  color: var(--ok);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn.btn-quiet {
  background: var(--paper);
  color: var(--navy);
  border: 2px solid var(--line);
  min-width: 0;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.btn.btn-icon {
  gap: 0.35rem;
}

.btn.btn-icon .icon {
  width: 16px;
  height: 16px;
}

.btn.btn-danger {
  color: var(--bad);
  border-color: #e4b4b4;
}

.btn.btn-bad {
  background: var(--bad);
  color: #fff;
  --btn-press-bg: color-mix(in srgb, var(--bad) 85%, #000);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  position: relative;
  z-index: 1;
  padding-right: 2.85rem;
}

.password-wrap input::-ms-reveal,
.password-wrap input::-ms-clear {
  display: none;
}

.password-toggle {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7383;
  cursor: pointer;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--navy);
}

.password-toggle .icon {
  width: 20px;
  height: 20px;
}

.field-help {
  margin: 0;
  font-size: 0.82rem;
}

.impersonate-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.55rem var(--gutter);
  background: #fff6d8;
  color: #5c4a12;
  border-bottom: 1px solid #e6d59a;
}

.impersonate-bar p {
  margin: 0;
  font-size: 0.92rem;
}

.impersonate-bar .btn {
  flex: 0 0 auto;
}

.list-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.list-heading-row .list-heading {
  margin-bottom: 0.35rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0 0 0.65rem;
}

.filter-bar[hidden],
.filter-empty[hidden],
.forms-table-wrap[hidden] {
  display: none !important;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--sky);
  border: 1px solid var(--blue-soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.2rem 0.35rem 0.2rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-chip-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  padding: 0.1rem;
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
}

.filter-chip-x .icon {
  width: 12px;
  height: 12px;
}

.filter-clear {
  appearance: none;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  min-height: 0;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.filter-empty {
  margin: 0 0 var(--space-4);
  color: var(--muted);
}

.col-head {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.col-filter-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.col-filter-btn .icon {
  width: 15px;
  height: 15px;
}

.col-filter-btn.is-on,
.col-filter-btn[aria-expanded="true"] {
  background: var(--navy);
  color: #fff;
}

.col-filter-pop {
  position: fixed;
  z-index: 25;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.85rem;
  min-width: 12rem;
}

.col-filter-pop[hidden] {
  display: none;
}

.col-filter-title {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.col-filter-options {
  display: grid;
  gap: 0.3rem;
}

.col-filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
}

.col-filter-option input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--navy);
}

.col-filter-pop .filter-clear {
  margin-top: 0.55rem;
}

.user-create-grid {
  display: grid;
  align-items: start;
  gap: var(--space-3);
}

.user-create-grid .field {
  margin-bottom: 0;
}

/* One-line labels keep every create-user input on one baseline. */
.user-create-grid .field > label {
  white-space: nowrap;
}

.user-create-grid .btn {
  justify-self: start;
  align-self: start;
}

.users-table-wrap {
  overflow: visible;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-4);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.users-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--label);
  background: var(--sky);
}

.users-table tr:last-child td {
  border-bottom: 0;
}

.users-table tr.is-inactive td {
  color: var(--muted);
}

.show-archived {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--muted);
}

.form-admin-actions {
  margin: 0.75rem 0 0;
}

.forms-table .forms-actions,
.users-table .row-actions,
.forms-table .row-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.row-menu-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.row-menu-btn:hover,
.row-menu.is-open .row-menu-btn {
  background: var(--sky);
}

.row-menu-pop[hidden] {
  display: none !important;
}

.row-menu-pop,
.account-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  min-width: 11rem;
  width: max-content;
  max-width: min(24rem, calc(100vw - 1.25rem));
  padding: 0.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.row-menu-item,
.account-menu-pop .row-menu-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.25;
  white-space: nowrap;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.row-menu-item:hover {
  background: var(--sky);
}

a.row-menu-item {
  color: var(--ink);
}

.row-menu-item.is-danger {
  color: var(--bad);
}

.btn-row.user-modal-actions {
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.hq-modal-card .btn-row .btn {
  margin-top: 0;
}

.hq-upload-veil,
.hq-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(0, 26, 77, 0.42);
}

.hq-upload-veil:not([hidden]),
.hq-modal:not([hidden]) {
  display: grid !important;
}

.hq-upload-veil[hidden],
.hq-modal[hidden] {
  display: none;
}

.hq-modal {
  z-index: 40;
}

.hq-upload-card,
.hq-modal-card {
  width: min(26rem, 100%);
  /* A tall sheet (Users edit with the app checklist) scrolls inside the card. */
  max-height: calc(100vh - 2 * var(--gutter));
  max-height: calc(100dvh - 2 * var(--gutter));
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
}

.hq-modal-card .btn {
  margin-top: var(--space-4);
}

.hq-modal-card.is-wide {
  width: min(56rem, 100%);
  max-height: min(88vh, 46rem);
  overflow: auto;
}

.hq-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hq-modal-head .block-title {
  margin: 0;
}

.modal-close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  --btn-press-bg: rgba(0, 26, 77, 0.16);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--sky);
  color: var(--navy);
}

.users-table th.num,
.users-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.i9-editor-card {
  width: min(52rem, 100%);
  max-height: min(90vh, 48rem);
  overflow: auto;
}

.i9-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.i9-save-status {
  min-width: 4.5rem;
  margin: 0;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ok);
}

.i9-pdf-link {
  margin: 0 0 0.65rem;
}

.i9-find {
  width: 100%;
  min-height: 40px;
  margin: 0 0 0.65rem;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--control-line);
  border-radius: var(--radius-sm);
  font: inherit;
}

.i9-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.55rem 0.8rem;
}

.i9-field,
.i9-check {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--label);
}

.i9-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
  color: var(--ink);
}

.i9-field input,
.i9-field select {
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--control-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  background: var(--paper);
}

.i9-field[hidden],
.i9-check[hidden] {
  display: none !important;
}

.hq-upload-card p,
.hq-modal-card p {
  margin: 0;
  font-weight: 650;
  color: var(--navy);
}

@keyframes hq-spin {
  to {
    transform: rotate(360deg);
  }
}

.hq-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.65rem;
  display: block;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: hq-spin 0.8s linear infinite;
}

/*
 * Breakpoints (mobile-first).
 * HARD RULE: Routing Form sections are NEVER side-by-side.
 *   Default  stacked full-width section cards; phone single-column fields
 *   640px    two-column field grid inside a section
 *   900px    three-column field grid; checklist groups can split into cards
 *   1200px   checklist 3 separate cards when width allows
 *   Max content width: --content-max (1280px)
 */
@media (min-width: 640px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-street,
  .packed-item.field-street {
    grid-column: span 2;
  }

  .start-bar {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: start;
  }

  .start-bar .btn,
  .mileage-rate-form .btn {
    margin-top: calc(1.45em + 0.4rem);
  }

  .user-create-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(12rem, 0.9fr) auto;
    align-items: start;
  }

  .employer-block {
    grid-column: span 2;
  }

  .employer-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-street,
  .packed-item.field-street {
    grid-column: span 2;
  }

  .field-unit,
  .packed-item.field-unit {
    grid-column: span 1;
  }

  .checklist-head {
    grid-column: 1 / -1;
  }

  .checklist-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--col-gap);
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .checklist-col {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.9rem var(--gutter);
  }
}

@media (min-width: 1200px) {
  .checklist-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mileage reimbursement */
.mileage-rate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: start;
}

.mileage-rate-form .field {
  margin-bottom: 0;
}

.mileage-filters {
  margin: 0 0 var(--space-4);
}

.mileage-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.mileage-form-head .block-title {
  margin: 0;
}

.mileage-filled-trip + .mileage-filled-trip {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.mileage-history-table tbody tr[data-submission-row],
.mileage-history-table tbody tr[data-open-trip] {
  cursor: pointer;
}

.mileage-history-table tbody tr[data-submission-row]:hover,
.mileage-history-table tbody tr[data-open-trip]:hover,
.mileage-history-table tbody tr.is-selected {
  background: var(--sky);
}

.mileage-calc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.15rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.mileage-calc strong {
  color: var(--ink);
  font-weight: 650;
}

.mileage-trip-actions .mileage-calc {
  margin: 0;
  flex: 1 1 auto;
}

.mileage-trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.mileage-trip-actions .btn,
.mileage-form-head .btn {
  flex: 0 0 auto;
}

.mileage-modal-who {
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.mileage-modal-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.mileage-modal-total {
  margin: 0.75rem 0 0.35rem;
  color: var(--ink);
}

.mileage-modal-pdf {
  margin: 0 0 0.85rem;
}

.mileage-modal-pdf .btn {
  margin-top: 0;
}

.mileage-modal-table {
  table-layout: fixed;
}

.mileage-modal-table .mileage-trip-facts td {
  vertical-align: top;
}

.mileage-modal-table .mileage-trip-facts td.place {
  overflow-wrap: anywhere;
}

.entered-by {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

@media (max-width: 520px) {
  .mileage-modal-card {
    padding: 0.9rem 0.7rem;
  }

  .mileage-modal-table {
    font-size: 0.8rem;
  }

  .mileage-modal-table th,
  .mileage-modal-table td {
    padding: 0.4rem 0.28rem;
  }
}

.mileage-trip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mileage-trip-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.mileage-trip-item:last-child {
  border-bottom: 0;
}

.mileage-trip-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.mileage-trip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 600;
}

.btn.btn-tiny {
  min-width: 0;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.mileage-table-card {
  padding: 0;
  overflow: hidden;
}

.mileage-table-intro {
  padding: var(--card-pad) var(--card-pad) 0.85rem;
}

.mileage-table-intro .help {
  margin: 0;
}

.mileage-table-wrap {
  overflow: hidden;
  border-radius: var(--radius);
}

.mileage-history-table {
  border-collapse: separate;
  border-spacing: 0;
}

.mileage-history-table thead th:first-child {
  border-top-left-radius: var(--radius);
}

.mileage-history-table thead th:last-child {
  border-top-right-radius: var(--radius);
}

.mileage-check {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--navy);
}

.mileage-detail-total {
  margin: 0.75rem 0;
}

.mileage-owner-check {
  grid-column: 1 / -1;
}

.check-item[hidden] {
  display: none;
}

.check-item-help {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.optional {
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .brand-badge {
    height: 44px;
    max-width: min(150px, calc(100vw - 8.25rem));
    padding: 4px 8px;
    border-radius: 10px;
  }

  .login-logo {
    height: 96px;
  }

  .mileage-history-table .row-actions {
    white-space: nowrap;
  }
}

/* Two-step sign-in (Your profile and the sign-in code step). Phone first. */
.two-step-card { margin-top: 16px; }
.two-step-steps { margin: 0 0 12px; padding-left: 1.25rem; }
.two-step-steps li + li { margin-top: 4px; }
.two-step-qr {
  width: min(240px, 100%);
  margin: 8px 0 12px;
  background: #fff;
  border-radius: 8px;
}
.two-step-qr svg { display: block; width: 100%; height: auto; }
.two-step-secret code,
.recovery-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 6px 16px;
  margin: 8px 0 12px;
  padding-left: 1.5rem;
}
.two-step-links { margin-top: 8px; justify-content: space-between; }
/* The set-password screen names the login; long addresses wrap at 390px. */
.set-password-email { overflow-wrap: anywhere; }
/* A lone link button (Back to sign in) spans the 3-column btn-row and sizes to its text. */
.two-step-links .btn:only-child { white-space: nowrap; grid-column: 1 / -1; justify-self: start; }
.two-step-card .btn-row { flex-wrap: wrap; }

/* Row menu: disabled item stays visible with its reason (e.g. Reset two-step sign-in). */
.row-menu-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row-menu-note {
  font-size: 0.72rem;
  color: var(--muted, #5b6474);
}
.row-menu-item.is-disabled,
.row-menu-item.is-disabled:hover {
  cursor: not-allowed;
  opacity: 0.6;
  background: transparent;
  transform: none;
  box-shadow: none;
}
.two-step-card[data-state="error"] .field-error {
  margin: 0 0 0.6rem;
}

/* Mileage trip row: the shared Round trip check-item (same as Roster's owner box) sits on the input line; Total miles is read-only. */
.field-row > .mileage-round-trip {
  align-self: flex-end;
  flex: 0 0 auto;
}

.mileage-round-trip .check-item {
  width: auto;
  white-space: nowrap;
  align-items: center;
}

.field[data-mileage-total-field][hidden] {
  display: none;
}

.field[data-mileage-total-field] input[readonly] {
  width: var(--field-w-number-short, 7rem);
  background: var(--surface-muted, #f3f5f8);
  color: inherit;
  cursor: default;
}

.mileage-trip-actions .mileage-save-field {
  margin: 0 0 0 auto;
  flex: 0 1 auto;
  text-align: right;
}

.mileage-trip-actions .mileage-save-field .btn {
  align-self: flex-end;
}

.mileage-trip-actions .mileage-save-field .field-error {
  max-width: 28rem;
  margin-left: auto;
}

/* The app's PDF page (#/pdf/<kind>/<id>, src/js/pdf/pdf-page.js). */
.pdf-page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.pdf-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pdf-page-actions .btn {
  text-decoration: none;
}

.pdf-page-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 13rem);
  min-height: 24rem;
  border: 1px solid var(--line, #d6dbe3);
  border-radius: 10px;
  background: #fff;
}

/* Users: per-user app checklist (register: "App access"). */
.app-access {
  border: 0;
  padding: 0;
  margin: 14px 0 4px;
  min-width: 0;
}
.app-access legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 4px;
}
.app-access-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 2px 12px;
}
.app-access-item.is-locked {
  opacity: 0.75;
}

/* Core pages: not found (unknown path or hidden app) and "no apps yet". */
.not-found {
  max-width: 560px;
}
