:root {
  --ink: #111216;
  --ink-soft: #2f3239;
  --paper: #ffffff;
  --wash: #f3f4f6;
  --wash-strong: #e8eaf0;
  --line: #cfd2da;
  --line-dark: #353943;
  --yellow: #f2c500;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body:
    "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --content: 1240px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --z-sticky: 30;
}

.portal-body {
  margin: 0;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.portal-body [hidden] {
  display: none !important;
}

.portal-body h1,
.portal-body h2,
.portal-body h3,
.portal-body summary {
  text-transform: none;
  letter-spacing: normal;
}

.portal-body button,
.portal-body input,
.portal-body textarea,
.portal-body select {
  font: inherit;
}

.portal-body .btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border: 2px solid currentColor;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-body .btn:hover {
  transform: translateY(-2px);
}

.portal-body .primary {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.portal-body .primary:hover {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
}

.portal-body .ghost {
  border-color: currentColor;
  color: var(--ink);
  background: transparent;
}

.portal-body .ghost:hover {
  color: var(--ink);
  background: var(--wash);
}

.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--font-body);
  font-size: 16px;
}

.portal-header {
  position: sticky;
  top: 4px;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.portal-header-inner {
  width: min(100% - 40px, var(--content));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.portal-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.portal-brand-mark,
.portal-brand-mark svg {
  width: 38px;
  height: 38px;
  display: block;
}

.portal-brand > span:last-child {
  display: grid;
  line-height: 1;
}

.portal-brand strong {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.04em;
}

.portal-brand small {
  margin-top: 3px;
  color: #555a65;
  font-size: 12px;
  font-weight: 600;
}

.portal-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.portal-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #454952;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.portal-nav a:hover {
  color: var(--ink);
  background: var(--wash);
}

.portal-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--wash-strong);
}

.portal-shell {
  flex: 1 0 auto;
  width: min(100% - 40px, var(--content));
  margin-inline: auto;
  padding: 46px 0 64px;
}

.portal-shell > .notice,
.portal-shell > .error {
  margin-bottom: 22px;
}

.portal-page-heading {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.portal-page-heading > div,
.portal-section-heading > div {
  min-width: 0;
}

.portal-page-heading h1,
.portal-page-heading p,
.portal-section-heading h2,
.portal-section-heading p,
.auth-brand h1,
.auth-brand p,
.welcome-intro h1,
.welcome-intro p {
  margin-block: 0;
}

.portal-page-heading h1 {
  margin-top: 3px;
  font-family: var(--font-body);
  font-size: clamp(1.9rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-transform: none;
}

.portal-page-heading > div > p:last-child {
  max-width: 68ch;
  margin-top: 8px;
  color: #4d515a;
  font-size: 16px;
}

.portal-kicker {
  color: #545963;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.admin-workspace .portal-section-heading .portal-kicker,
.accounts-section .portal-section-heading .portal-kicker {
  display: none;
}

.account-chip,
.count-badge,
.status-badge,
.role-badge {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-chip {
  padding: 8px 12px;
}

.count-badge,
.status-badge,
.role-badge {
  padding: 5px 9px;
}

.count-badge {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-badge.is-active {
  border-color: #9bcdb3;
  color: #075f36;
  background: #e9f7ef;
}

.status-badge.is-new {
  border-color: #d9bd42;
  color: #5f4b00;
  background: #fff8d7;
}

.status-badge.is-reviewed {
  border-color: #9bcdb3;
  color: #075f36;
  background: #e9f7ef;
}

.job-status {
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.job-status > span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.job-status.is-backlog {
  border-color: #9297a1;
  color: #3f444d;
  background: #f0f1f4;
}

.job-status.is-received {
  border-color: #8da9c2;
  color: #244965;
  background: #edf5fb;
}

.job-status.is-printing {
  border-color: #6eb8c7;
  color: #075468;
  background: #edf8fa;
}

.job-status.is-post-processing {
  border-color: #d9bd42;
  color: #5f4b00;
  background: #fff8d7;
}

.job-status.is-blocked {
  border-color: #d7a3aa;
  color: #821725;
  background: #fff0f2;
}

.job-status.is-complete {
  border-color: #9bcdb3;
  color: #075f36;
  background: #e9f7ef;
}

.portal-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
  align-items: start;
}

.portal-layout > *,
.admin-workspace > *,
.job-specs-grid > *,
.account-action-grid > * {
  min-width: 0;
}

.portal-section,
.portal-card,
.auth-card {
  min-width: 0;
  margin: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: none;
}

.portal-section h1,
.portal-section h2,
.portal-section h3,
.portal-card h1,
.portal-card h2,
.portal-card h3,
.auth-card h1,
.auth-card h2,
.auth-card h3 {
  font-family: var(--font-body);
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-transform: none;
}

.portal-section h1,
.portal-card h1 {
  font-size: 2rem;
}

.portal-section h2,
.portal-card h2 {
  font-size: 1.35rem;
}

.portal-section h3,
.portal-card h3,
.auth-card h3 {
  font-size: 1.02rem;
}

.portal-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.portal-section-heading h2 {
  margin: 3px 0 0;
}

.portal-section-heading p:last-child {
  max-width: 68ch;
  margin-top: 6px;
  color: #555a65;
}

.portal-form {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.portal-form label,
.table-search,
.account-search {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.portal-form input,
.portal-form textarea,
.portal-form select,
.table-search input,
.account-search input {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #747985;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.45;
}

.portal-form textarea {
  min-height: 116px;
  resize: vertical;
}

.portal-form input::placeholder,
.portal-form textarea::placeholder,
.table-search input::placeholder,
.account-search input::placeholder {
  color: #5c616c;
  opacity: 1;
}

.portal-form input:focus,
.portal-form textarea:focus,
.portal-form select:focus,
.table-search input:focus,
.account-search input:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-color: var(--ink);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 76px;
}

.password-control button {
  position: absolute;
  inset: 5px 5px 5px auto;
  min-width: 62px;
  padding: 5px 9px;
  border: 1px solid #777c86;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--wash);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.password-control button:hover {
  background: var(--wash-strong);
}

.form-help,
.label-note {
  color: #555a65;
  font-size: 13px;
  font-weight: 500;
}

.portal-fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 22px 0 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.portal-fieldset:first-of-type {
  padding-top: 0;
}

.portal-fieldset legend {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  font-weight: 700;
}

.portal-fieldset legend span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 13px;
}

.job-specs-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.job-specs-grid .span-all {
  grid-column: 1 / -1;
}

.file-picker input[type="file"] {
  min-height: 98px;
  padding: 25px 14px;
  border: 2px dashed #646a75;
  background: #f8f8fa;
  cursor: pointer;
}

.file-picker input[type="file"]:hover {
  border-color: var(--ink);
  background: var(--wash);
}

.file-summary {
  display: grid;
  gap: 0;
  margin: 13px 0 0;
  padding: 0;
  color: #4d515a;
  font-size: 14px;
}

.file-summary li {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.file-summary li > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-summary li.file-total {
  justify-content: flex-start;
  border-bottom: 0;
  color: var(--ink);
}

.file-remove {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #858a94;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.file-remove:hover {
  border-color: var(--ink);
  background: var(--wash);
}

.optional-details,
.account-actions {
  padding: 0;
}

.optional-details {
  margin-top: 2px;
  border-bottom: 1px solid var(--line);
}

.optional-details summary,
.account-actions summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.optional-details summary::after,
.account-actions summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1;
}

.optional-details[open] summary::after,
.account-actions[open] summary::after {
  content: "−";
}

.optional-details[open] > .job-specs-grid {
  padding: 8px 0 22px;
}

.form-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-actions {
  margin-top: 4px;
}

.portal-actions {
  margin-top: 20px;
}

.upload-status {
  flex-basis: 100%;
  padding: 11px 13px;
  border: 1px solid #9bcfd9;
  border-radius: var(--radius-sm);
  color: #28313a;
  background: #edf8fa;
  font-weight: 600;
}

.upload-status.is-error {
  border-color: #d7a3aa;
  color: #821725;
  background: #fff0f2;
}

.upload-spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgb(255 255 255 / 45%);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: portal-spin 800ms linear infinite;
}

@keyframes portal-spin {
  to {
    transform: rotate(1turn);
  }
}

.portal-help {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #dfca67;
  border-radius: var(--radius-sm);
  color: #333740;
  background: #fffbea;
}

.portal-help a {
  width: fit-content;
  margin-top: 4px;
  font-weight: 700;
}

.notice,
.error {
  padding: 14px 16px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.notice {
  color: #075f36;
  background: #e6f8ee;
}

.error {
  color: #8a1725;
  background: #fff0f2;
}

.muted {
  color: #555a65;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.portal-stats.compact-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-stats > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.portal-stats > div:last-child {
  border-right: 0;
}

.portal-stats dt {
  color: #555a65;
  font-size: 13px;
  font-weight: 700;
}

.portal-stats dd {
  margin: 4px 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.portal-stats span {
  display: block;
  margin-top: 5px;
  color: #656a74;
  font-size: 13px;
}

.admin-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: start;
}

.table-search,
.account-search {
  margin-bottom: 14px;
}

.filter-count {
  min-height: 18px;
  color: #555a65;
  font-size: 13px;
  font-weight: 500;
}

.table-search input,
.account-search input {
  max-width: 460px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.table-scroll:focus-visible {
  outline-offset: 3px;
}

.portal-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

.portal-table th,
.portal-table td {
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

.portal-table th {
  color: #3f444d;
  background: #f0f1f4;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.portal-table td:first-child {
  width: 30%;
}

.customer-history-table {
  min-width: 780px;
}

.customer-history-table .job-status-cell {
  width: 150px;
}

/* Admin uploads table: fix the column widths so the Files column (download
   links + "Download all") always fits its container instead of being pushed
   off-screen into horizontal scroll by a wide Request column. */
#staff-uploads {
  table-layout: fixed;
  min-width: 0;
}

#staff-uploads th:nth-child(1),
#staff-uploads td:nth-child(1) {
  width: 26%;
}

#staff-uploads th:nth-child(2),
#staff-uploads td:nth-child(2) {
  width: 42%;
}

#staff-uploads th:nth-child(3),
#staff-uploads td:nth-child(3) {
  width: 32%;
}

#staff-uploads td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-file-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.portal-file-list li {
  min-width: 0;
  display: grid;
  gap: 1px;
  list-style: none;
}

.portal-file-list a {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.portal-file-list span {
  color: #656a74;
  font-size: 12px;
}

.file-zip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f0f1f4;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-zip-link::before {
  content: "\2193"; /* downwards arrow */
  font-weight: 700;
}

.file-more {
  margin-top: 8px;
}

.file-more > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #3f444d;
  list-style: none;
}

.file-more > summary::-webkit-details-marker {
  display: none;
}

.file-more[open] > summary {
  margin-bottom: 8px;
}

.change-request-note {
  margin: 16px 0 0;
  color: #555a65;
  font-size: 13px;
}

.change-request-note a {
  color: var(--ink);
  font-weight: 700;
}

.empty-state,
.filter-empty {
  padding: 28px;
  border: 1px dashed #959aa4;
  border-radius: var(--radius-sm);
  text-align: center;
  background: #fafafb;
}

.empty-state h3,
.empty-state p,
.filter-empty {
  margin-block: 0;
}

.empty-state p {
  max-width: 54ch;
  margin: 7px auto 0;
  color: #555a65;
}

.empty-state .btn {
  margin-top: 17px;
}

.configured-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f9f9fa;
}

.configured-account h2,
.configured-account p {
  margin-block: 0;
}

.configured-account h2 {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 1.12rem;
}

.configured-account > p {
  color: #555a65;
  font-size: 14px;
}

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

.account-item {
  border-bottom: 1px solid var(--line);
}

.account-summary {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.account-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-identity a {
  overflow-wrap: anywhere;
}

.account-identity span {
  color: #656a74;
  font-size: 13px;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.account-actions {
  margin-top: -4px;
}

.account-actions > summary {
  width: fit-content;
  min-width: 156px;
  color: #3f444d;
  font-size: 14px;
}

.account-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 2px 0 20px;
  border: 1px solid var(--line);
  background: var(--line);
}

.account-action {
  align-content: start;
  padding: 20px;
  background: #f9f9fa;
}

.account-action h3,
.account-action p {
  margin-block: 0;
}

.account-action p {
  color: #555a65;
  font-size: 14px;
}

.portal-form label.confirmation {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.confirmation input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.tool-notes {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tools-section {
  max-width: 840px;
}

.tools-section .portal-section-heading p {
  max-width: 72ch;
}

.tool-notes ul {
  margin-bottom: 0;
  padding-left: 22px;
}

.portal-welcome {
  flex: 1 0 auto;
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
  padding: 72px 0 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: clamp(44px, 8vw, 90px);
  align-items: center;
}

.welcome-intro h1,
.auth-brand h1 {
  margin-top: 7px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: none;
}

.welcome-intro h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.02;
}

.welcome-intro > p:not(.portal-kicker) {
  max-width: 60ch;
  margin-top: 18px;
  color: #4b5059;
  font-size: 18px;
}

.support-note {
  font-size: 15px !important;
}

.support-note a {
  color: var(--ink);
  font-weight: 700;
}

.access-steps {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.access-steps h2 {
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 1.25rem;
}

.access-steps ol {
  margin: 0;
  padding: 0;
  counter-reset: portal-step;
}

.access-steps li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 22px 45px;
  list-style: none;
  counter-increment: portal-step;
}

.access-steps li:last-child {
  padding-bottom: 0;
}

.access-steps li::before {
  content: counter(portal-step);
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.access-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 31px;
  bottom: 3px;
  left: 13px;
  border-left: 1px solid var(--line);
}

.access-steps span {
  color: #555a65;
}

.auth-page {
  flex: 1 0 auto;
  min-height: calc(100vh - 142px);
  padding: 54px 20px 68px;
  display: grid;
  place-items: start center;
}

.auth-panel {
  width: min(100%, 510px);
}

.auth-brand {
  margin-bottom: 22px;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.auth-mark,
.auth-mark svg {
  width: 52px;
  height: 52px;
  display: block;
}

.auth-brand h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.05;
}

.auth-brand p {
  max-width: 58ch;
  color: #4d515a;
}

.auth-card .notice,
.auth-card .error {
  margin-bottom: 18px;
}

.auth-footer {
  margin-top: 18px;
  color: #555a65;
  line-height: 1.8;
}

.auth-footer a,
.auth-links a {
  color: var(--ink);
  font-weight: 700;
}

.auth-help {
  margin-top: 7px;
}

.portal-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.portal-footer > div {
  width: min(100% - 40px, var(--content));
  min-height: 64px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #555a65;
  font-size: 14px;
}

.portal-footer a {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 980px) {
  .portal-layout,
  .admin-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .uploaded-files-section {
    order: 2;
  }

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

@media (max-width: 760px) {
  .portal-header-inner {
    min-height: 64px;
    gap: 14px;
  }

  .portal-brand > span:last-child,
  .portal-nav a[href="tel:17708893298"] {
    display: none;
  }

  .portal-nav {
    gap: 0;
    overflow-x: auto;
  }

  .portal-nav a {
    min-height: 42px;
    padding-inline: 9px;
    white-space: nowrap;
  }

  .portal-shell {
    padding-top: 34px;
  }

  .portal-page-heading {
    align-items: start;
    flex-direction: column;
    gap: 16px;
  }

  .portal-page-heading .btn {
    width: auto;
  }

  .portal-stats,
  .portal-stats.compact-stats {
    grid-template-columns: 1fr;
  }

  .portal-stats > div,
  .portal-stats > div:last-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .portal-stats > div:last-child {
    border-bottom: 0;
  }

  .portal-stats dd {
    grid-row: 1 / 3;
    grid-column: 2;
  }

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

  .portal-welcome {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    padding-block: 50px 64px;
  }
}

@media (max-width: 560px) {
  .portal-header-inner,
  .portal-shell,
  .portal-footer > div,
  .portal-welcome {
    width: min(100% - 28px, var(--content));
  }

  .portal-header-inner {
    align-items: center;
  }

  .portal-brand-mark,
  .portal-brand-mark svg {
    width: 34px;
    height: 34px;
  }

  .portal-nav a {
    padding-inline: 8px;
    font-size: 13px;
  }

  .portal-section,
  .portal-card,
  .auth-card,
  .access-steps {
    padding: 20px;
  }

  .portal-page-heading h1 {
    font-size: 2rem;
  }

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

  .job-specs-grid .span-all {
    grid-column: auto;
  }

  .form-actions .btn,
  .portal-actions .btn,
  .account-action .btn {
    width: 100%;
  }

  .account-summary {
    flex-direction: column;
    gap: 10px;
  }

  .account-badges {
    justify-content: start;
  }

  .portal-footer > div {
    min-height: 78px;
    padding-block: 14px;
  }
}

@media (max-width: 340px) {
  .portal-header-inner {
    gap: 8px;
  }

  .portal-nav a {
    padding-inline: 6px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .upload-spinner {
    animation-duration: 1.8s;
  }
}

/* Sub-contractor share workflow (Generate link) */
.share-link-btn {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.share-workflow .portal-section {
  margin-bottom: 20px;
}

.share-pick-list,
.share-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.share-pick label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  cursor: pointer;
}

.share-pick input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex: none;
}

.new-contact-row {
  margin-bottom: 12px;
}

.share-result {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
}

.share-copy {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-copy input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.share-copy .btn.is-copied {
  border-color: #1f7a3d;
  color: #1f7a3d;
}

.referral-credits {
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #f9f9fa;
}

.referral-credits h3 {
  margin: 0 0 6px;
}

.referral-credits .share-list {
  margin-top: 10px;
}

@media (min-width: 720px) {
  .share-result {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
  }
}
