:root {
  color-scheme: light;
}

[hidden] {
  display: none !important;
}

body {
  overflow-wrap: anywhere;
  word-break: normal;
}

button,
select,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[role="option"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--tiger-orange);
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.8rem 1.2rem;
  border-radius: var(--r-sm);
  background: var(--press-black);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar-collapse-control {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
}

.sidebar-collapse-control:hover {
  background: var(--gray-100);
}

.topbar {
  position: relative;
  z-index: 20;
}

.page {
  width: 100%;
}

.page-description {
  margin: 0.8rem 0 0;
  color: var(--gray-500);
  font-size: 1.4rem;
  font-weight: 500;
}

.page-heading-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
}

.sample-meta {
  color: var(--gray-500);
  font-family: var(--f-mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

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

.date-filter {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  padding: 0 0.8rem 0 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--gray-700);
}

.date-filter:hover {
  border-color: var(--gray-300);
}

.date-filter select {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
}

.date-filter select:focus-visible {
  outline-offset: 4px;
}

.tbl tbody tr:focus-within {
  background: var(--gray-50);
}

.tbl tbody tr:hover .row-actions,
.tbl tbody tr:focus-within .row-actions {
  opacity: 1;
}

.tbl td.title-cell {
  white-space: normal;
}

.title-cell a,
.title-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--press-black);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.title-cell a:hover,
.title-button:hover {
  color: #b64b0f;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.manuscript-version {
  display: none;
}

.status-dot--queued::before {
  background: #7c3aed;
}

.status-dot--queued {
  color: #5b21b6;
}

.page-indicator {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--press-black);
  color: var(--white);
  font-family: var(--f-mono);
  font-size: 1.2rem;
}

.empty:not([hidden]) {
  display: flex;
}

.topbar-panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  right: 4rem;
  width: min(320px, calc(100vw - 3.2rem));
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.14);
}

.panel-heading,
.account-summary {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--press-black);
  font-size: 1.3rem;
  font-weight: 700;
}

.panel-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  padding: 2.4rem;
  color: var(--gray-500);
  text-align: center;
}

.panel-empty i {
  color: var(--gray-400);
  font-size: 2.4rem;
}

.panel-empty strong {
  color: var(--press-black);
}

.panel-empty span {
  font-size: 1.25rem;
}

.account-menu {
  width: 230px;
}

.account-summary {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.account-summary span {
  color: var(--gray-500);
  font-size: 1.15rem;
  font-weight: 500;
}

.account-menu a,
.account-menu button {
  display: block;
  width: calc(100% - 0.8rem);
  margin: 0.4rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--press-black);
  font-size: 1.3rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--gray-50);
}

.row-menu {
  position: fixed;
  z-index: 120;
}

.row-menu:not([hidden]) {
  display: flex;
}

.row-menu button:focus-visible {
  outline-offset: -2px;
}

.app-dialog {
  width: min(620px, calc(100vw - 3.2rem));
  max-height: calc(100vh - 3.2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  background: var(--white);
  color: var(--press-black);
  box-shadow: 0 24px 80px rgba(17, 17, 17, 0.24);
}

.app-dialog::backdrop {
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: blur(2px);
}

.search-dialog {
  width: min(680px, calc(100vw - 3.2rem));
  margin-top: min(14vh, 120px);
}

.dialog-shell {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 2rem 2.4rem 1.6rem;
  border-bottom: 1px solid var(--gray-200);
}

.dialog-header h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.3;
}

.dialog-eyebrow {
  margin: 0 0 0.3rem;
  color: #b64b0f;
  font-family: var(--f-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dialog-subtitle {
  margin: 0.5rem 0 0;
  color: var(--gray-500);
  font-size: 1.3rem;
}

.dialog-body {
  padding: 2.4rem;
}

.dialog-body > :first-child {
  margin-top: 0;
}

.dialog-body > :last-child {
  margin-bottom: 0;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  padding: 1.6rem 2.4rem 2rem;
  border-top: 1px solid var(--gray-200);
}

.search-field {
  position: relative;
  margin: 2rem 2.4rem 0;
}

.search-field > i {
  position: absolute;
  top: 50%;
  left: 1.2rem;
  z-index: 1;
  color: var(--gray-500);
  transform: translateY(-50%);
}

.search-field .input {
  height: 46px;
  padding-left: 3.8rem;
}

.search-help {
  margin: 1rem 2.4rem;
  color: var(--gray-500);
  font-size: 1.25rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 100px;
  padding: 0 1.6rem 2rem;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  width: 100%;
  padding: 1rem 1.2rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--press-black);
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result[aria-selected="true"] {
  background: var(--gray-50);
}

.search-result__title {
  display: block;
  font-weight: 700;
}

.search-result__meta {
  color: var(--gray-500);
  font-size: 1.15rem;
}

.search-empty {
  padding: 2.4rem 1.2rem;
  color: var(--gray-500);
  text-align: center;
}

.upload-progress {
  position: relative;
  height: 3px;
  background: var(--gray-100);
}

.upload-progress__bar {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--tiger-orange);
  transition: width var(--d-med) var(--ease-out);
}

.upload-step-label {
  margin: 1.6rem 2.4rem 0;
  color: var(--gray-500);
  font-family: var(--f-mono);
  font-size: 1.1rem;
}

.upload-body {
  padding-top: 1.6rem;
}

.prototype-note {
  padding: 1rem 1.2rem;
  border: 1px solid #fed7aa;
  border-radius: var(--r-sm);
  background: #fff7ed;
  color: #7c2d12;
  font-size: 1.2rem;
}

.prototype-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: -0.8rem 0 2.4rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid #fed7aa;
  border-radius: var(--r-sm);
  background: #fff7ed;
  color: #7c2d12;
  font-size: 1.3rem;
  line-height: 1.55;
}
.prototype-banner strong { flex: 0 0 auto; }

@media (max-width: 640px) {
  .prototype-banner { flex-direction: column; }
}

.upload-dropzone {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.8rem;
  padding: 3.2rem;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--r-md);
  background: var(--gray-50);
  text-align: center;
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--tiger-orange);
  background: #fff7ed;
}

.upload-dropzone i {
  font-size: 3.2rem;
  color: var(--tiger-orange);
}

.upload-dropzone strong {
  font-size: 1.5rem;
}

.upload-dropzone span,
.upload-supporting-copy {
  color: var(--gray-500);
  font-size: 1.2rem;
}

.selected-file,
.credit-card,
.review-progress-list,
.report-groups {
  margin-top: 1.6rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  background: var(--white);
}

.selected-file,
.credit-card {
  padding: 1.4rem;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
}

.selected-file strong,
.selected-file span {
  display: block;
}

.selected-file span {
  color: var(--gray-500);
  font-size: 1.15rem;
}

.credit-card dt,
.credit-card dd {
  margin: 0;
}

.credit-card dt {
  color: var(--gray-500);
  font-size: 1.15rem;
}

.credit-card dd {
  margin-top: 0.3rem;
  font-weight: 700;
}

.review-progress-list,
.report-groups {
  padding: 0;
  list-style: none;
}

.review-progress-list li,
.report-groups li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--gray-200);
}

.review-progress-list li:last-child,
.report-groups li:last-child {
  border-bottom: 0;
}

.review-progress-list .is-current i {
  color: var(--tiger-orange);
}

.review-progress-list .is-complete i,
.report-groups i {
  color: #15803d;
}

.stage-progress {
  height: 8px;
  margin-top: 1.6rem;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--gray-100);
}

.stage-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tiger-orange);
}

.toast-region {
  position: fixed;
  right: 2.4rem;
  bottom: 2.4rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}

.toast {
  max-width: min(380px, calc(100vw - 3.2rem));
  padding: 1rem 1.4rem;
  border-radius: var(--r-sm);
  background: var(--press-black);
  color: var(--white);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.22);
  font-size: 1.3rem;
}

@media (max-width: 767px) {
  .sidebar-collapse-control {
    display: none;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(17, 17, 17, 0.44);
  }

  .mobile-drawer-backdrop:not([aria-hidden="true"]) {
    display: block;
  }

  .mobile-drawer-backdrop[aria-hidden="true"] {
    display: none;
  }

  .filter-row {
    align-items: flex-start;
    flex-direction: column;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .filter-chips {
    width: calc(100vw - 3.2rem);
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
    overflow-x: auto;
  }

  .date-filter {
    margin-left: 0;
  }

  .tbl tr[hidden] {
    display: none !important;
  }

  .tbl td[data-label] {
    position: static;
  }

  .tbl td[data-label]::before {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--gray-500);
    content: attr(data-label);
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .tbl td.title-cell {
    max-width: 100%;
  }

  .tbl td + td {
    margin-top: 1rem;
  }

  .tbl td:nth-child(3),
  .tbl td:nth-child(4) {
    display: block;
  }

  .tbl td:nth-child(3)::after {
    content: none;
  }

  .tbl td.right {
    padding-top: 1.2rem;
  }

  .row-actions .btn {
    width: 44px;
    height: 44px;
  }

  .topbar-panel {
    right: 1.6rem;
  }

  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-inline: 1.6rem;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-footer .btn {
    width: 100%;
  }

  .search-field {
    margin-inline: 1.6rem;
  }

  .search-help {
    margin-inline: 1.6rem;
  }

  .upload-step-label {
    margin-inline: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
