@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/InterVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --psg-orange: #ef5025;
  --psg-teal: #20bdb3;
  --psg-purple: #36266b;
  --psg-green: #44b749;
  --psg-gray: #818285;
  --psg-light-gray: #bdbec0;
  --color-text: #2f2f2f;
  --color-text-muted: #5f5f5f;
  --color-border: #e5e7eb;
  --color-surface: #ffffff;
  --color-table-header: #f0f1ef;
  --color-table-header-border: #d4d6d3;
  --color-page: #f8f7f3;
  --color-table-stripe: color-mix(in srgb, var(--panel) 75%, var(--bg));
  --color-primary: var(--psg-orange);
  --color-primary-hover: #d9471f;
  --color-focus: #a83a1c;
  --radius-sm: 6px;
  --radius-md: 8px;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: var(--color-page);
  --panel: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --accent: var(--color-primary);
  --accent-dark: var(--color-primary-hover);
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
}

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

.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.app-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.auth-shell {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-panel {
  width: min(100%, 26rem);
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.auth-brand {
  margin-bottom: 1.75rem;
}

.auth-logo {
  display: block;
  width: min(100%, 20rem);
  height: auto;
  margin-bottom: 1.5rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 2px solid var(--psg-orange);
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.625rem;
  color: #3a3a3a;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: #3a3a3a;
}

.topbar-staging {
  --environment-background: #f4e5bd;
  --environment-text: #634710;
  --environment-accent: #b28a35;
}

.topbar-development {
  --environment-background: #e0edf7;
  --environment-text: #234e70;
  --environment-accent: #638eaf;
}

.topbar-staging,
.topbar-development {
  border-bottom-color: var(--environment-accent);
}

.topbar-staging .brand,
.topbar-development .brand {
  max-width: 100%;
  flex-wrap: wrap;
  row-gap: 0.375rem;
}

.environment-badge {
  flex: none;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--environment-background);
  color: var(--environment-text);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.brand-monogram {
  width: 3.25rem;
  height: 2rem;
  object-fit: cover;
}

.brand-separator {
  width: 1px;
  height: 1.5rem;
  background: #c9c9c9;
}

.brand-product {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.brand-lock {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--psg-orange);
  stroke-width: 1.8;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border: 1px solid #cfcfd1;
  border-radius: 50%;
  background: var(--psg-purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: default;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: block;
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 14rem;
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.user-menu-name {
  margin: 0;
  padding: 0.55rem 0.65rem 0.7rem;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 600;
}

.user-menu-panel form {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}

.user-menu-action {
  display: flex;
  align-items: center;
  text-decoration: none;
  width: 100%;
  min-height: 2.25rem;
  justify-content: flex-start;
  border: 0;
  padding-inline: 0.65rem;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.user-menu-action:hover {
  color: var(--text);
  background: #f4f4f3;
}

.content {
  width: min(100%, 90rem);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-heading {
  margin-bottom: 1.75rem;
}

/* One scale for staff/admin headings; semantic levels retain their meaning. */
.content h2,
.panel > fieldset > legend {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}
.content h3,
.client-form legend {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}
.content h2,
.content h3,
.content h4 {
  margin: 1.5rem 0 0.75rem;
}
.content .muted {
  font-size: 0.9rem;
}

form {
  display: grid;
  gap: 1rem;
}

/* Routine actions keep their natural width; compact sign-in forms fill theirs. */
form > button {
  justify-self: start;
}

.auth-panel form > button {
  justify-self: stretch;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}

.filters > label {
  flex: 0 1 16rem;
  min-width: 0;
}

.filters > label:first-child {
  flex: 1 1 20rem;
  max-width: 40rem;
}

.filters > .filter-archived {
  flex: 0 0 auto;
  align-self: end;
  min-height: 2.4rem;
}

.filter-archived input[type="checkbox"] {
  width: auto;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1rem;
}

/* Reserve the link's space so editing filters does not move the controls. */
.filter-actions [data-filter-clear][hidden] {
  display: inline;
  visibility: hidden;
}

.batch-download {
  display: block;
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}

.batch-actions .muted {
  margin: 0;
}

.batch-actions [data-batch-submit],
.batch-actions [data-batch-archive] {
  min-width: 15rem;
}

.batch-actions [data-batch-submit]:disabled,
.batch-actions [data-batch-archive]:disabled {
  opacity: 1;
  background: var(--bg);
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

/* Reserve each control's natural space, including wrapped help on small screens.
   Hidden controls stay out of keyboard navigation and the accessibility tree. */
.batch-actions [data-batch-compress][hidden] {
  display: inline-flex;
  visibility: hidden;
}

.batch-actions [data-batch-help][hidden] {
  display: block;
  visibility: hidden;
}

.batch-actions > p {
  flex-basis: 100%;
}

.file-download {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.checkbox-label input[type="checkbox"],
.batch-download input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

.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;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  color: var(--text);
  background: #fff;
  font: inherit;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--psg-light-gray);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

a {
  color: #a83a1c;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-dark);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #fff;
  border-color: var(--psg-light-gray);
  color: var(--text);
}

.secondary:hover {
  background: #f4f4f3;
  border-color: var(--psg-gray);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

th {
  background: var(--color-table-header);
  border-bottom: 1px solid var(--color-table-header-border);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* Ordinary lists use the same subtle alternating shade as file groups. */
table:not(.file-table) > tbody > tr:nth-child(even) {
  background: var(--color-table-stripe);
}

table:not(.file-table) > tbody > tr:hover,
table:not(.file-table) > tbody > tr:focus-within {
  background: var(--bg);
}

.number {
  text-align: right;
}

/* Precision is an overlay: revealing it must never move the date trigger.
   The description stays accessible and needs no JavaScript to open. */
.list-date { position: relative; display: inline-block; }
.list-date time { white-space: nowrap; cursor: help; text-decoration: underline dotted; text-underline-offset: 0.2em; }
.list-date time:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.list-date-exact {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
}
.list-date:hover .list-date-exact,
.list-date:focus-within .list-date-exact { opacity: 1; }
.list-date-exact.list-date-floating { position: fixed; z-index: 20; }
.list-date[data-date-dismissed] .list-date-exact { opacity: 0; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.admin-content { max-width: 72rem; }
.client-list-filters { margin-bottom: 1rem; }
.client-list-filter-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.35rem; }
.client-status-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 0 auto; }
.client-status-filter .checkbox-label { white-space: nowrap; }
.client-status-filter input[type="checkbox"] { width: auto; margin: 0; padding: 0; }
[data-client-list-filter][hidden], [data-client-list-label][hidden], .client-status-filter button[hidden] { display: none; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1.5rem; }
/* A heading band separates the section title from forms, values, and tables. */
.panel > h2,
.panel > .section-heading,
.panel > fieldset > legend {
  margin: 0 0 1rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
}
.panel > fieldset > legend { width: 100%; }
.panel p { margin-bottom: 1rem; }
.panel > fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.panel > fieldset > legend { color: var(--text); }
.client-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.client-form fieldset { display: grid; gap: 0.85rem; min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); }
.client-form legend { padding: 0 0.3rem; }
.client-form > p, .client-form > button { grid-column: 1 / -1; }
.client-form fieldset > .muted, .client-user-form > .muted { margin: 0; }
.client-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 0.75rem; font-size: 0.9rem; }
.client-user-form { display: grid; gap: 0.85rem; }
.client-user-form, .form-content { max-width: 38rem; }
.client-user-form input:not([type="checkbox"]) { width: 100%; }
.warning { padding: 0.75rem 1rem; background: #fff8e6; border: 1px solid #e4b95c; border-radius: var(--radius-sm); }
.checkbox { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.checkbox input { width: auto; }
.access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.7rem 1rem; }
.info-icon { color: #245c85; margin-right: 0.3rem; font-weight: 650; }
.notice { padding: 0.75rem 1rem; background: #f1f8f2; border: 1px solid #b9ddbd; border-radius: var(--radius-sm); }
.notice-info { background: #eef5fa; border-color: #bed3e3; }

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .user-menu {
    margin-left: auto;
  }

  .client-form { grid-template-columns: 1fr; }

  table {
    display: block;
    overflow-x: auto;
  }
}

.legacy-folder { white-space: pre-wrap; overflow-wrap: anywhere; }
.migration-name { grid-template-columns: minmax(12rem, 1fr) auto; align-items: end; }
.migration-activation { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
@media (max-width: 720px) {
  .migration-name { grid-template-columns: 1fr; }
}

/* Keep the current destination visible, including its selected section on detail pages. */
.header-actions > a { padding: 0.35rem 0.6rem; border-radius: var(--radius-sm); }
.header-actions > a[aria-current] { font-weight: 650; background: #fff0e9; box-shadow: inset 0 -2px 0 var(--psg-orange); text-decoration: none; }

.header-actions > a.nav-migration { margin-inline-end: 1rem; }

.migration-review-actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.migration-review-actions h3 { margin: 0 0 0.75rem; }

.migration-section { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); }
.migration-section > h3 { margin: 0 0 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.migration-section > :last-child { margin-bottom: 0; }
.section-shaded { background: var(--bg); }
.migration-section h4 { margin: 1.25rem 0 0.5rem; }

.status-pill { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; }
.client-access-enabled { color: #28603a; background: #edf5ee; }

.user-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.status-neutral { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.status-pending { color: var(--muted); background: var(--panel); border-color: var(--line); font-weight: 400; }
a.status-pending { text-decoration: underline; text-underline-offset: 0.15em; }
a.status-pending:hover { color: var(--text); border-color: var(--psg-gray); }
.status-inactive { color: var(--danger); background: #fff8f7; border-color: #e7cbc8; }
.account-access-action { margin-top: 1rem; max-width: 38rem; }
.account-access-action form { margin-bottom: 0.5rem; }
.account-setup-actions { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 1rem; max-width: 48rem; margin-top: 1rem; }
.account-setup-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: start;
  gap: 0.5rem 1rem;
}
.account-setup-row + .account-setup-row {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.account-setup-row form,
.account-setup-row p { margin: 0; }
.account-setup-row p { font-size: 0.9rem; overflow-wrap: anywhere; }
.account-setup-row .email-action:has(.email-policy-warning) { grid-column: 1 / -1; }
.account-setup-row .email-action-status { flex-basis: 100%; }
.account-setup-row .email-action-status:empty { display: none; }
@media (max-width: 640px) {
  .account-setup-actions { grid-template-columns: minmax(0, 1fr); }
}
.danger-zone { border-color: #e7cbc8; background: #fff8f7; }
.danger-action + .danger-action { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger-action h3 { margin: 0 0 0.5rem; }
.secondary.danger { color: var(--danger); border-color: var(--danger); }
.secondary.danger:hover { background: #fff3f1; }

textarea { resize: vertical; }
.client-upload-form { gap: 1.5rem; }
.upload-file-field { min-width: 0; padding: 1.25rem; background: color-mix(in srgb, var(--panel) 98%, var(--accent)); border: 1px solid var(--line); border-radius: var(--radius-md); }
.upload-file-field > label:first-child { margin-bottom: 0.75rem; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.upload-picker { position: relative; }
.upload-picker .button { font-weight: 600; }
.upload-picker [data-upload-picker-label][hidden] { display: none; }
.upload-picker-enhanced { width: fit-content; }
.upload-picker-enhanced input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.upload-picker-enhanced:focus-within { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.upload-picker-enhanced:hover .button { background: #f4f4f3; border-color: var(--psg-gray); }
.upload-selection { margin-top: 1.25rem; padding: 0.85rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.upload-selection > p { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.upload-selection > ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.upload-selection > ul:empty { margin: 0; }
.upload-selection li { display: flex; align-items: baseline; gap: 1rem; padding: 0.75rem; background: var(--panel); border: 1px solid color-mix(in srgb, var(--line) 65%, var(--panel)); border-radius: var(--radius-sm); }
.upload-selection-name { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.upload-selection-size { flex-shrink: 0; margin-left: auto; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.client-upload-form > label { color: var(--text); font-weight: 500; }
.client-upload-form > label > span { color: var(--muted); font-weight: 400; }
.upload-actions { padding-top: 1rem; border-top: 1px solid var(--line); }
@media (max-width: 480px) {
  .upload-file-field { padding: 1rem; }
  .upload-selection { padding: 0.65rem; }
  .upload-selection li { display: grid; gap: 0.2rem; }
  .upload-selection-size { margin-left: 0; }
}

.file-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Upload annotations share their file's separator, without a row border between them. */
.upload-with-note > td { border-bottom: 0; padding-bottom: 0.35rem; }
/* The annotation starts at the filename column; its text shares the cell's inset. */
.upload-note > td { padding: 0 0.75rem 0.75rem 0; }
.upload-note > .upload-note-spacer { padding: 0; }
.file-table > .file-group > tr:not(.upload-note) > td { vertical-align: middle; }
.upload-note-band { display: flex; align-items: baseline; gap: 0.75rem; margin: 0; padding: 0.5rem 0.75rem; font-size: 0.9rem; }
.upload-note-label { flex-shrink: 0; font-size: 0.85rem; }
.upload-note-text { color: var(--text); min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Keep client filenames readable and desktop date help outside the table. */
.file-table { overflow: visible; }
.file-table td:first-child { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .file-table { overflow-x: auto; }
}
/* Stripe file groups so annotations never advance the alternating pattern. */
.file-table > .file-group { background: var(--panel); }
.file-table > .file-group:nth-of-type(even) { background: var(--color-table-stripe); }
.file-table > tbody > tr:hover { background: transparent; }
.file-table > .file-group:hover,
.file-table > .file-group:focus-within { background: var(--bg); }
.file-table > .file-group:has(input[name="file"]:checked) { background: color-mix(in srgb, var(--panel) 93%, var(--accent)); }
.file-table > .file-group > tr:last-child > td { border-bottom: 1px solid var(--line); }
.file-table > .file-group:last-child > tr:last-child > td { border-bottom: 0; }

/* Read-only values share the simple edit form's label and field geometry. */
.entity-details {
  display: grid;
  gap: 0.35rem;
  max-width: 38rem;
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}
.entity-details dt { color: var(--muted); }
.entity-details dt:not(:first-child) { margin-top: 0.5rem; }
.entity-details dd,
.entity-toggle-field {
  margin: 0;
  width: 100%;
  min-height: calc(1.35rem + 1.2rem + 2px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  color: var(--text);
  font: inherit;
}
.entity-details dd {
  background: #eeefec;
  border-color: #e3e5e0;
  overflow-wrap: anywhere;
}
.entity-details-form input:not([type="checkbox"]) {
  min-height: calc(1.35rem + 1.2rem + 2px);
  line-height: 1.5;
}
.entity-toggle-field {
  display: flex;
  align-items: center;
  background: var(--panel);
}
.entity-toggle-field input[type="checkbox"] { width: auto; margin: 0; }
.section-operational { background: #f1f2f0; }

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

/* Keep section actions beside their title, wrapping together on narrow screens. */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1rem;
}
.section-heading h2,
.section-heading h3 { margin: 0; }
.section-heading .button,
.section-heading button {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}
.inline-child-form { margin-bottom: 1.25rem; }

/* Child lists use the same full-width table structure as other admin lists. */
.client-user-table td {
  font-size: 0.9rem;
  vertical-align: middle;
  overflow-wrap: break-word;
}
.client-user-table td:nth-child(2),
.client-user-table .status-pill { white-space: nowrap; }

/* Optional tours and concise, text-only help. */
/* Keep the contextual action beside, and separate from, the heading copy. */
.page-heading-with-tour {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.page-heading-copy { min-width: 0; }
.tour-launch {
  flex-shrink: 0;
  margin-top: .5rem;
  font-size: .875rem;
  white-space: nowrap;
}
.tour-launch[hidden] { display: none; }
.tour-heading-accent { color: var(--psg-purple); margin-inline-end: 0.35rem; font-size: 0.85em; font-weight: 400; }
.help-content { max-width: 52rem; }
.help-content li + li { margin-top: .75rem; }

.email-action { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.copy-link-status,
.email-action-status { font-size: 0.9rem; line-height: 1.5; }
.copy-link-success,
.email-action-success { color: #286335; font-weight: 650; }
.email-policy-warning { flex-basis: 100%; font-weight: 600; }
.email-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #e7f3e9;
  color: #286335;
  font-weight: 650;
}
[data-email-action] button:disabled { opacity: 0.65; cursor: default; }

.client-access-picker h3 { margin-top: 1.5rem; }
.client-picker-list { max-height: 18rem; overflow-y: auto; margin: 0.75rem 0; }
.client-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.client-picker-row[hidden] { display: none; }
.client-picker-row span { overflow-wrap: anywhere; min-width: 0; }
.client-picker-row button { flex-shrink: 0; }
.client-access-picker input[type="search"] { width: 100%; }

.client-access-picker [data-client-save] { margin-top: 1rem; }
.client-access-picker [data-client-save]:disabled { cursor: default; opacity: 0.65; }

/* Native details keeps state help available to keyboard and touch without JS. */
.user-state { display: inline-flex; align-items: center; gap: 0.4rem; }
.state-help { display: inline-block; position: relative; vertical-align: middle; font-size: 0.85rem; font-weight: 400; }
.state-help summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.state-help summary::-webkit-details-marker { display: none; }
.client-user-table { overflow: visible; }
.state-help-content {
  position: absolute;
  z-index: 2;
  right: 0;
  width: min(19rem, 75vw);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 3px 12px #0002;
  white-space: normal;
}
.state-help-content p { margin: 0 0 0.5rem; }

.user-heading .state-help-content { right: auto; left: 0; }
@media (max-width: 640px) {
  .user-state { flex-wrap: wrap; }
  .state-help { position: static; }
  .state-help-content,
  .user-heading .state-help-content {
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* Copy is progressively enhanced; keep its inert control out of no-JS pages. */
[data-copy-link][hidden] { display: none; }

.migration-bulk-actions { margin-bottom: 1rem; }
.migration-queue-table td { vertical-align: middle; }
.migration-queue-table .checkbox-label { margin: 0; }
.migration-queue-table tr:target { background: var(--bg); outline: 2px solid var(--accent); outline-offset: -2px; }
.migration-navigation { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--color-table-header); border: 1px solid var(--line); border-radius: var(--radius-md); }
.migration-progress { font-weight: 600; }

[data-recipient-trigger][hidden],
[data-upload-recipient-form][hidden],
[data-recipient-fields][hidden],
[data-recipient-type-apply][hidden] { display: none; }

/* Match the admin form rhythm while keeping recipient controls grouped. */
[data-upload-recipient-form] .recipient-field:not([hidden]) { display: grid; gap: 0.35rem; }
[data-recipient-trigger] { margin-top: 1rem; }
[data-upload-recipient-form] { margin-top: 1.25rem; margin-bottom: 0; }
[data-upload-recipient-form] > h3 { margin: 0 0 1rem; }
[data-recipient-type-form] { margin-bottom: 0.85rem; }
[data-recipient-type-form],
[data-recipient-add-form] { gap: 0.85rem; }

[data-recipient-removal] button { min-height: 2rem; padding: 0.3rem 0.65rem; font-size: 0.85rem; }
[data-recipient-remove-confirmation] > p { margin: 0 0 0.75rem; }
[data-recipient-remove-fallback][hidden],
[data-recipient-remove-trigger][hidden],
[data-recipient-remove-confirmation][hidden] { display: none; }

/* Keep upload feedback beside its action and correction controls compact. */
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.client-upload-form button:disabled { opacity: 0.65; cursor: default; }
.client-upload-form .upload-actions button:disabled {
  opacity: 1;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, var(--accent));
  border-color: var(--line);
  color: var(--muted);
}
.client-upload-form .upload-remove:disabled { background: #fff; border-color: var(--psg-light-gray); }
.panel > .upload-status { margin: 0; color: var(--muted); }
.panel > .upload-status:not(:empty) { margin-top: 0.75rem; }
.upload-selection .upload-remove { flex-shrink: 0; padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.upload-selection [data-upload-validation] { margin-top: 0.75rem; color: var(--text); }
.upload-history-scroll { overflow: visible; }
@media (max-width: 720px) {
  .upload-history-scroll { overflow-x: auto; }
}
.upload-history { display: table; min-width: 38rem; width: 100%; table-layout: fixed; }
.upload-history th:first-child { width: 45%; }
.upload-history th:nth-child(2) { width: 20%; }
.upload-history th:nth-child(3) { width: 20%; }
.upload-history th:last-child { width: 15%; }
.upload-history td { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .upload-selection .upload-remove { justify-self: start; }
}

/* Selection capacity is distinct from transmission status. */
.upload-limits, .upload-replacement { margin: 0.5rem 0 0; font-size: 0.8rem; font-weight: 400; }
.upload-size-bar { height: 0.3rem; margin: 0.65rem 0; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.upload-size-bar > span { display: block; height: 100%; background: var(--psg-gray); }
.upload-review-toggle { margin-top: 0.75rem; font-size: 0.85rem; }
.upload-selection li[hidden] { display: none; }

.upload-review-toggle[hidden], .upload-size-bar[hidden], .upload-replacement[hidden] { display: none; }

.auth-panel .auth-text-action {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  text-decoration: underline;
}

/* Keep code entry a single native input for paste and browser autofill. */
.auth-panel .sign-in-code {
  text-align: center;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
}
.auth-panel .code-secondary-actions {
  gap: 0.25rem;
}

.auth-panel .code-recovery-action {
  min-height: 2rem;
  padding: 0.25rem 0.15rem;
}
.auth-panel .code-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.15rem 0.75rem;
  margin-top: 1rem;
}
.auth-panel .code-password-action { margin-top: 0.5rem; }

/* Anchor the invitation's no-JavaScript tooltip within its paragraph on mobile. */
[data-invitation-history] { position: relative; }
[data-invitation-history] .list-date { position: static; }
[data-invitation-history] .list-date-exact:not(.list-date-floating) { max-width: 100%; }

.account-password-actions { grid-column: 1 / -1; margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.account-password-actions h3 { margin: 0; font-size: 1rem; }
.account-password-actions .section-heading > .muted { margin: 0; }
.account-password-actions > p { margin: 0.5rem 0 0.75rem; font-size: 0.9rem; }
.account-password-actions .email-action-status { flex-basis: 100%; }
.account-password-actions .email-action-status:empty { display: none; }

/* Staff CLI instructions keep long checksums and Windows commands contained. */
.cli-guide code { overflow-wrap: anywhere; }
.cli-guide pre { max-width: 100%; overflow-x: auto; padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); }
