/* ==========================================================================
   Applications design system
   Minimalist black and white. Colour is reserved for status dots and notices.
   Every page uses these classes; inline styles are blocked by the CSP.
   ========================================================================== */

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/public-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/public-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- Tokens */

:root {
  --font: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Ink and surfaces */
  --ink: #000000;
  --ink-2: #2e2e2e;
  --muted: #5e5e5e;
  --disabled: #8a8a8a;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --fill: #f2f2f2;

  /* Primary actions. A tenant's brand colour replaces these (patch 0004). */
  --accent: #000000;
  --accent-ink: #ffffff;

  /* Notices: the only coloured text */
  --danger: #b42318;
  --danger-fill: #fef3f2;
  --success: #067647;
  --success-fill: #ecfdf3;
  --warning: #93370d;
  --warning-fill: #fffaeb;
  --info: #1f4e99;
  --info-fill: #eff4ff;

  /* Status dots: the 8 colours tenants choose from for their six statuses */
  --status-blue: #3b73d1;
  --status-amber: #d18a1b;
  --status-violet: #7c5cd6;
  --status-teal: #23998c;
  --status-green: #2e9150;
  --status-gray: #8a8a8a;
  --status-red: #d14343;
  --status-pink: #c2477f;

  --rating: #000000;
  --rating-off: #d4d4d4;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --control-height: 40px;
  --sidebar-width: 232px;
}

/* ---------------------------------------------------------------- Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.5rem;
  line-height: 2rem;
}

h2 {
  font-size: 1rem;
  line-height: 1.5rem;
}

h3 {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-underline-offset: 2px;
}

code {
  font-size: 0.8125rem;
  background: var(--fill);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.primary-link {
  font-weight: 600;
  text-decoration: none;
}

.primary-link:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8125rem;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

/* ---------------------------------------------------------------- Simple pages (/, 404, /dev) */

.simple {
  max-width: 44rem;
  margin: 10vh auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.simple.wide {
  max-width: 64rem;
  margin-top: 3rem;
}

.simple h2 {
  margin-top: 1.5rem;
}

.portal-home {
  align-items: flex-start;
  gap: 0.75rem;
}

.tenant-mark.tenant-mark-lg {
  flex-basis: 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-lg);
  font-size: 1.25rem;
}

/* ---------------------------------------------------------------- App shell */

.app {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  flex: 1 1 var(--sidebar-width);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.25rem 0.75rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.tenant {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 0.5rem;
  min-width: 0;
}

.tenant-mark {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
}

.tenant-name {
  font-weight: 600;
}

.tenant-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 2.25rem;
  padding: 0 0.625rem 0 1.625rem;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav a[aria-current='page'] {
  padding-left: 0.625rem;
  background: var(--fill);
  color: var(--ink);
  font-weight: 600;
}

.nav a[aria-current='page']::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}

.nav-label {
  flex: 1;
}

.nav-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid var(--line);
}

.main {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 2rem 2.5rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-header p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.breadcrumb {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb:hover {
  color: var(--ink);
  text-decoration: underline;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .sidebar {
    flex-basis: 100%;
    gap: 1rem;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav a,
  .nav a[aria-current='page'] {
    padding: 0 0.75rem;
    white-space: nowrap;
  }

  .sidebar-user {
    display: none;
  }

  .main {
    padding: 1.25rem 1rem 2rem;
  }
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--control-height);
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--ink);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-primary:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.12);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
}

.btn-quiet:hover {
  border-color: transparent;
  background: var(--fill);
}

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

.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger-fill);
}

.btn-sm {
  height: 2rem;
  padding: 0 0.625rem;
  font-size: 0.8125rem;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--disabled);
  box-shadow: none;
  cursor: not-allowed;
}

/* Segmented control (view switcher) */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--fill);
}

.segmented a {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 0.875rem;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-2);
  text-decoration: none;
}

.segmented a[aria-current='page'] {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------- Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-weight: 500;
}

.field-optional {
  font-weight: 400;
  color: var(--muted);
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.375rem;
}

.textarea {
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--muted);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}

.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--danger);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-2);
  color: var(--disabled);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-height: 2.5rem;
  padding-top: 0.625rem;
  cursor: pointer;
}

.choice input {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.0625rem 0 0;
  accent-color: var(--accent);
}

.choice + .field-hint {
  padding-left: 1.75rem;
}

.search {
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--control-height);
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.search:focus-within {
  outline: 2px solid var(--ink);
  border-color: var(--ink);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.search svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.error-summary {
  padding: 1rem 1.25rem;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  background: var(--surface);
}

.error-summary h2 {
  color: var(--danger);
}

.error-summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.error-summary a {
  color: var(--danger);
  font-weight: 500;
}

/* ---------------------------------------------------------------- Status, tags, avatars, ratings */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-gray);
}

.dot-lg {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.dot-blue { background: var(--status-blue); }
.dot-amber { background: var(--status-amber); }
.dot-violet { background: var(--status-violet); }
.dot-teal { background: var(--status-teal); }
.dot-green { background: var(--status-green); }
.dot-gray { background: var(--status-gray); }
.dot-red { background: var(--status-red); }
.dot-pink { background: var(--status-pink); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--fill);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.avatar-sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.6875rem;
}

.avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.125rem;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.stars {
  letter-spacing: 1px;
  color: var(--rating);
  white-space: nowrap;
}

.stars-off {
  color: var(--rating-off);
}

/* Status overview: one proportional bar (SVG) and a legend of filter buttons */
.status-overview {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.status-bar {
  display: block;
  width: 100%;
  height: 10px;
}

.status-bar rect.blue { fill: var(--status-blue); }
.status-bar rect.amber { fill: var(--status-amber); }
.status-bar rect.violet { fill: var(--status-violet); }
.status-bar rect.teal { fill: var(--status-teal); }
.status-bar rect.green { fill: var(--status-green); }
.status-bar rect.gray { fill: var(--status-gray); }
.status-bar rect.red { fill: var(--status-red); }
.status-bar rect.pink { fill: var(--status-pink); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.25rem;
}

.legend .btn {
  height: 2.25rem;
  padding: 0 0.75rem;
  border-color: transparent;
  font-weight: 400;
}

.legend .btn:hover,
.legend .btn[aria-pressed='true'] {
  border-color: var(--line-strong);
}

.legend strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- Panels */

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel-flush {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.details div {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.details dt {
  font-size: 0.75rem;
  color: var(--muted);
}

.details dd {
  margin: 0;
}

@media (max-width: 640px) {
  .details {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    padding: 1rem;
  }

  .panel-flush {
    padding: 0;
  }
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric-value {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
}

.columns > .col-main {
  flex: 2 1 520px;
  min-width: 0;
}

.columns > .col-side {
  flex: 1 1 320px;
  min-width: 0;
}

/* ---------------------------------------------------------------- Tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
  padding-left: 1.25rem;
}

.table th:last-child,
.table td:last-child {
  padding-right: 1.25rem;
}

.table .right {
  text-align: right;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.cell-stack {
  display: flex;
  flex-direction: column;
}

.cell-stack .muted {
  font-size: 0.8125rem;
}

.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
}

/* ---------------------------------------------------------------- Kanban */

.kanban-wrap {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: start;
  min-width: 1272px;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  background: var(--fill);
}

.kanban-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.kanban-head h3 {
  flex: 1;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-foot > * {
  white-space: nowrap;
}

.card-foot {
  align-items: flex-start;
}

.card-foot + .card-foot {
  align-items: center;
}

/* ---------------------------------------------------------------- Timeline */

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

.timeline li {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.375rem;
}

.timeline-rail .dot {
  width: 8px;
  height: 8px;
}

.timeline-rail::after {
  content: '';
  flex: 1;
  width: 1px;
  margin-top: 0.25rem;
  background: var(--line-strong);
}

.timeline li:last-child .timeline-rail::after {
  display: none;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-bottom: 1rem;
}

.timeline-title {
  font-weight: 500;
}

.dot-ink {
  background: var(--ink);
}

/* ---------------------------------------------------------------- Notices, toasts, empty states */

.notice {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.notice-title {
  font-weight: 600;
}

.notice-info { border-color: #c9d8f5; background: var(--info-fill); }
.notice-info .notice-title { color: var(--info); }
.notice-success { border-color: #b7e4c7; background: var(--success-fill); }
.notice-success .notice-title { color: var(--success); }
.notice-warning { border-color: #f5d9a8; background: var(--warning-fill); }
.notice-warning .notice-title { color: var(--warning); }
.notice-danger { border-color: #f4c7c3; background: var(--danger-fill); }
.notice-danger .notice-title { color: var(--danger); }

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.toast a {
  color: var(--surface);
  font-weight: 600;
}

.toast-region {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty p {
  max-width: 52ch;
  color: var(--muted);
}

.empty .btn {
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- Developer pages */

.check {
  display: inline-block;
  padding: 0 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.check-ok {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.check-problem {
  border-color: var(--danger);
  color: var(--danger);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.swatch svg {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.type-sample {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sg-section {
  scroll-margin-top: 1rem;
}

.sg-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- Staff sign-in and staff area (0008) */

.auth {
  max-width: 26rem;
  gap: 1rem;
}

.auth .row {
  flex-wrap: wrap;
}

.sidebar-user-text {
  flex: 1 1 auto;
  min-width: 0;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select.select-sm {
  height: 2rem;
  width: auto;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.875rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.steps li::before {
  content: counter(step);
  flex: 0 0 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.steps li.step-done::before {
  content: '✓';
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.steps p {
  margin: 0.125rem 0 0;
}

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

.settings-list li + li {
  border-top: 1px solid var(--line);
}

.settings-list a {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 1rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.settings-list a:hover {
  background: var(--surface-2);
}

.settings-name {
  font-weight: 600;
}

.copyable {
  word-break: break-all;
  user-select: all;
}

.outbox-text {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.875rem;
}

.people {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.person-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) 7.5rem minmax(0, 1.2fr) 7rem;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1.25rem;
}

.person-row + .person-row {
  border-top: 1px solid var(--line);
}

.person-row-actions {
  justify-self: end;
}

@media (max-width: 760px) {
  .person-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .person-row-who,
  .person-row-role {
    grid-column: 1 / -1;
  }

  .person-row-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .person-row-actions:empty {
    display: none;
  }
}

.simple .error-summary h2 {
  margin-top: 0;
}

/* On phones the signed-in person and Sign out stay visible above the menu. */
@media (max-width: 900px) {
  .sidebar-user {
    display: flex;
    margin-top: 0;
    padding: 0 0.5rem;
    border-top: 0;
  }

  .sidebar-user .avatar {
    display: none;
  }
}

/* ---------------------------------------------------------------- Platform console (0009) */

.business-row,
.business-staff-row,
.job-row {
  display: grid;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.875rem 1.25rem;
}

.business-row {
  grid-template-columns: minmax(0, 2.4fr) 7.5rem minmax(0, 1.4fr) minmax(0, 1.4fr);
}

.business-staff-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 7.5rem;
  padding-left: 0;
  padding-right: 0;
}

.job-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 0;
  padding-right: 0;
}

.business-row + .business-row,
.business-staff-row + .business-staff-row,
.job-row + .job-row {
  border-top: 1px solid var(--line);
}

.health-tools {
  margin-top: 1.25rem;
}

@media (max-width: 760px) {
  .business-row,
  .business-staff-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .business-row > :first-child,
  .business-staff-row > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------- Form builder (0010) */

.row-between {
  justify-content: space-between;
}

.field-section {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.field-section-head h2 {
  margin: 0;
}

.field-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.field-row,
.form-row {
  display: grid;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
}

.field-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--line);
}

.form-row {
  grid-template-columns: minmax(0, 2fr) 7.5rem minmax(0, 1fr) auto;
  padding: 0.875rem 1.25rem;
}

.form-row + .form-row {
  border-top: 1px solid var(--line);
}

.danger-zone {
  margin-top: 1.25rem;
}

.choice-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* The applicant's form: one calm column in the business's colours. */
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.625rem 1rem;
  background: var(--warning-fill);
  color: var(--warning);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.apply {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.apply-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.apply-head h1 {
  margin: 0;
}

.apply-head p {
  margin: 0;
}

.form-intro p {
  margin: 0 0 0.75rem;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.form-section h2 {
  margin: 0;
}

.form-section > .muted p {
  margin: 0;
}

@media (max-width: 760px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .form-row > :first-child {
    grid-column: 1 / -1;
  }
}

.choice-group legend {
  padding: 0;
  margin-bottom: 0.375rem;
}

/* ---------------------------------------------------------------- Public forms and applications (0011) */

.record-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.875rem 1.25rem;
}

.record-row + .record-row {
  border-top: 1px solid var(--line);
}

.answer {
  white-space: pre-wrap;
}

.apply-signed-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}

.apply-outline ul {
  margin: 0;
  padding-left: 1.25rem;
}

.apply-outline h2 {
  margin: 0;
}

.apply-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.apply-actions p {
  margin: 0;
}

@media (max-width: 760px) {
  .record-row {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .record-row > :nth-child(n + 3) {
    grid-column: 2;
  }
}

.open-forms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.details dd {
  overflow-wrap: anywhere;
}

/* Long answers (essays) take the full width of a details list. */
.details .details-wide {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- Records and statuses (0012) */

.input.input-sm {
  height: 2rem;
  font-size: 0.875rem;
  min-width: 0;
  flex: 1 1 10rem;
}

.details.details-single {
  grid-template-columns: minmax(0, 1fr);
}

.history-change {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.toolbar {
  margin: 1rem 0;
}

.toolbar .search {
  flex: 1 1 18rem;
}

.status-setting {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.status-setting-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .status-setting-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.status-overview {
  margin-top: 1rem;
}

/* Applications table on phones: applicant (with the APP number under it) and status only */
.table .narrow-only { display: none; }
@media (max-width: 640px) {
  .table .wide-only { display: none; }
  .table .narrow-only { display: block; }
  .table .cell-stack { overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------ People on forms (0013) */

/* A detail shown but not typed, like the applicant's email. */
.readonly-value {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--fill);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* One person in a group that allows several (Parent or guardian 1, 2). */
.person-group {
  margin: 0;
  padding: 1rem 1.125rem 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 6px);
}
.person-group > legend {
  padding: 0 0.375rem;
  font-weight: 600;
}

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

.person-line + .person-line {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* The form's order: each row says whether it asks questions or about people. */
.form-order {
  margin: 0;
  padding: 0;
  list-style: none;
}
.form-order > li:last-child {
  border-bottom: 0;
}
.kind-tag {
  display: inline-block;
  min-width: 5.25rem;
  margin-right: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

/* What a kind of person is asked: one row per contact field. */
.ask-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  .ask-row {
    grid-template-columns: minmax(0, 1fr) 9rem;
  }
  .kind-tag {
    display: block;
    min-width: 0;
  }
}

/* ------------------------------------------------------------ Board and cards (0014) */

.toolbar-split {
  justify-content: space-between;
}

.kanban-head h2 {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 3rem;
}

.kanban-col.can-drop {
  outline: 2px dashed var(--line-strong);
  outline-offset: -2px;
}
.kanban-col.is-over {
  outline: 2px solid var(--accent);
}
.kanban-col.no-drop {
  opacity: 0.55;
}

.record-card[draggable='true'] {
  cursor: grab;
}
.record-card.is-dragging {
  opacity: 0.5;
}
.record-card.is-saving {
  opacity: 0.7;
}

/* A card's chosen answers: label above value, small. */
.card-values {
  display: grid;
  gap: 0.375rem;
  margin: 0;
}
.card-values dt {
  color: var(--muted);
  font-size: 0.75rem;
}
.card-values dd {
  margin: 0;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.card-move summary,
.card-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8125rem;
}
.card-move[open] summary {
  margin-bottom: 0.5rem;
}
.card-move .inline-form {
  flex-wrap: wrap;
}
.card-settings {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card-settings[open] summary {
  margin-bottom: 0.75rem;
}

.board-hint,
.board-status {
  margin: 0;
}
.board-status:empty {
  display: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}

/* ------------------------------------------------------------ Home dashboard (0014) */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Six status counts: each a link to the filtered table. */
.status-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.status-counts li + li {
  border-left: 1px solid var(--line);
}
.status-counts a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  color: inherit;
  text-decoration: none;
}
.status-counts a:hover {
  background: var(--surface-2);
}
.status-counts .count {
  font-size: 1.75rem;
  line-height: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.status-counts .label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}
@media (max-width: 640px) {
  .status-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .status-counts li + li {
    border-left: 0;
  }
  .status-counts li:nth-child(even) {
    border-left: 1px solid var(--line);
  }
  .status-counts li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

.week-chart {
  display: block;
  width: 100%;
  height: auto;
}
.week-chart rect.bar {
  fill: var(--accent);
}
.week-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}
.week-chart text.value {
  fill: var(--ink-2);
  font-weight: 600;
}

.toolbar-split > form {
  flex: 1 1 30rem;
}
.card-values {
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  column-gap: 0.75rem;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: 0;
}
/* A table inside a padded panel: no outer padding on the first and last cells. */
.table-compact th:first-child,
.table-compact td:first-child {
  padding-left: 0;
}
.table-compact th:last-child,
.table-compact td:last-child {
  padding-right: 0;
}
.table-compact th {
  background: transparent;
}

/* ------------------------------------------------------------ Files and photos (0015) */

.file-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.file-list > li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.file-list > li > .cell-stack {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.file-thumb {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--fill);
}
.file-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.file-input {
  max-width: 100%;
  font: inherit;
  font-size: 0.875rem;
}
.file-input::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* ------------------------------------------------------------ File viewer (0016) */

.viewer {
  width: min(64rem, calc(100vw - 2rem));
  height: min(52rem, calc(100vh - 2rem));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}
.viewer[open] {
  display: flex;
  flex-direction: column;
}
.viewer::backdrop {
  background: rgb(0 0 0 / 0.6);
}
.viewer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.viewer-name {
  min-width: 0;
  flex: 1 1 12rem;
}
.viewer-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}
.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fill);
  overflow: auto;
}
.viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.viewer-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}
.viewer-none {
  max-width: 28rem;
  padding: 2rem;
  text-align: center;
}
.viewer-foot {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}
.viewer-foot:has(button:not([hidden])) {
  display: flex;
}
.viewer-foot:not(:has(button:not([hidden]))) {
  display: none;
}
@media (max-width: 640px) {
  .viewer {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}
.viewer [hidden] {
  display: none;
}

/* ------------------------------------------------------------ Rich text and calculations (0017) */

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2);
}
.rich-link {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  background: var(--surface-2);
}
.rich-link[hidden] {
  display: none;
}
.rich-link .input {
  flex: 1 1 14rem;
}
.rich-editor {
  min-height: 10rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.rich-editor:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.rich-editor > :first-child,
.rich-answer > :first-child {
  margin-top: 0;
}
.rich-editor > :last-child,
.rich-answer > :last-child {
  margin-bottom: 0;
}
.rich-editor p,
.rich-answer p {
  margin: 0 0 0.75rem;
}
.rich-editor h3,
.rich-answer h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.0625rem;
}
.rich-editor ul,
.rich-editor ol,
.rich-answer ul,
.rich-answer ol {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}
.rich-editor a,
.rich-answer a {
  text-decoration: underline;
}
.calc-field output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ------------------------------------------------------------ Field builder by type (0018) */

.type-setting[hidden] {
  display: none;
}
.settings-by-type .only-note {
  display: none;
}
.formula-check {
  margin: 0;
}
.formula-check:empty {
  display: none;
}
.formula-check.is-ok {
  color: var(--success);
}
.formula-check.is-problem {
  color: var(--danger);
}
.formula-ref {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.formula-ref > summary {
  padding: 0.625rem 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.formula-ref-body {
  padding: 0 0.875rem 0.875rem;
}
.formula-ref h3 {
  margin: 0;
  font-size: 0.875rem;
}
.ref-table td {
  vertical-align: top;
}
.ref-table th {
  background: transparent;
}
.code-chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.code-chip:hover {
  border-color: var(--ink-2);
}
.code-chip code {
  font-size: 0.8125rem;
}
/* On phones each code is a small card: the code, then what it means and an example. */
@media (max-width: 640px) {
  .ref-table thead {
    display: none;
  }
  .ref-table,
  .ref-table tbody,
  .ref-table tr,
  .ref-table td {
    display: block;
  }
  .ref-table tr {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--line);
  }
  .ref-table td {
    padding: 0.125rem 0;
    border: 0;
  }
  .code-chip {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
}

/* ------------------------------------------------------------ Withdrawals and bulk changes (0020) */

.status-with-mark {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}
.tag-withdrawn {
  border-color: var(--line-strong);
  color: var(--ink-2);
  font-weight: 600;
}
.withdrawn-note {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--fill);
}
.withdrawn-note p {
  margin: 0;
}
.withdrawn-note blockquote {
  margin: 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line-strong);
  white-space: pre-line;
}
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.bulk-count {
  flex: 1 1 12rem;
  color: var(--ink-2);
}
.bulk-count.bulk-warn {
  color: var(--danger);
}
.bulk-all {
  margin: 0;
}
.check-col {
  width: 2.5rem;
}
.table-bulk .check-col input {
  width: 1.125rem;
  height: 1.125rem;
}
.withdraw-panel {
  border-color: var(--line-strong);
}

/* Importing applications (0021) */
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.stack-sm p,
.stack-sm h3 {
  margin: 0;
}
.import-guide code {
  font-size: 0.8125rem;
  white-space: nowrap;
}
.import-guide .group-row th {
  background: var(--surface-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  color: var(--ink-2);
}
.import-upload {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.import-upload input[type='file'] {
  flex: 1 1 16rem;
  height: auto;
  padding: 0.375rem;
}
.import-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.import-counts div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
}
.import-counts dt {
  font-size: 0.8125rem;
  color: var(--muted);
}
.import-counts dd {
  margin: 0.125rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
}
.import-progress {
  width: 100%;
  height: 0.75rem;
  accent-color: var(--accent);
}
.email-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  font-size: 0.9375rem;
}
.email-preview p {
  margin: 0 0 0.5rem;
}
.email-preview p:last-child {
  margin-bottom: 0;
}
.email-preview .email-subject {
  font-weight: 600;
}
/* A row's second and later problems start at the Column cell (the Row cell spans them). */
.problems-table td:first-child:not([rowspan]) {
  padding-left: 1rem;
}
.stack-sm {
  align-items: flex-start;
}
.skip-list {
  padding: 0.75rem 1rem;
}
.skip-list .num {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--muted);
}
