.profile > button {
  margin-left: 2px;
}

.auth-shell {
  padding-bottom: 76px;
}

.site-filing {
  position: absolute;
  z-index: 3;
  left: 20px;
  right: 20px;
  bottom: 24px;
  text-align: center;
  font-size: 12px;
}

.site-filing a {
  color: #7d8592;
  text-decoration: none;
  transition: color .18s ease;
}

.site-filing a:hover {
  color: #1473e6;
  text-decoration: underline;
}

.profile > button:first-of-type {
  margin-left: auto;
}

tbody tr.clickable {
  cursor: pointer;
}

.style-number {
  font-size: 13px;
}

.cost-link {
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.style-detail-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.style-detail-picker span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
}

.style-detail-picker select {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.style-module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.style-module-grid button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 17px;
  text-align: left;
}

.style-module-grid button:hover {
  border-color: #b9d9ff;
  background: #f5faff;
}

.style-module-grid button.file-shortcut {
  border-color: #cfe0f8;
  background: linear-gradient(145deg, #f8fbff, #eef6ff);
}

.style-module-grid b,
.style-module-grid span {
  display: block;
}

.style-module-grid span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.internal-reference {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  background: #f7f8fa;
  border-radius: 12px;
  padding: 13px 15px;
  margin: -4px 0 18px;
  font-size: 12px;
  color: #68707d;
}

.upload-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.upload-actions .file-picker {
  margin: 0;
}

.upload-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.upload-summary b {
  font-size: 21px;
}

.upload-summary span {
  color: var(--muted);
  font-size: 12px;
}

.upload-file-list {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  max-height: 310px;
  overflow: auto;
}

.upload-file {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.upload-file > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8ced8;
}

.upload-file > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.upload-file > small,
.upload-file > b {
  font-size: 11px;
  white-space: nowrap;
}

.upload-file > small {
  color: var(--muted);
}

.upload-file.uploading > i { background: var(--blue); box-shadow: 0 0 0 4px #1473e61c; }
.upload-file.success > i { background: var(--green); }
.upload-file.pending > i { background: var(--amber); }
.upload-file.duplicate > i { background: #7c69d8; }
.upload-file.failed > i { background: var(--red); }
.upload-file.success > b { color: var(--green); }
.upload-file.pending > b { color: #a35d00; }
.upload-file.duplicate > b { color: #6653c7; }
.upload-file.failed > b { color: var(--red); }

.module-search {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.35fr);
  gap: 18px 28px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 22px;
  border: 1px solid #dce8f6;
  border-radius: 18px;
  background: radial-gradient(circle at 92% 8%, #dcecff 0, transparent 34%), linear-gradient(145deg, #fff, #f6f9ff);
  box-shadow: 0 12px 35px rgba(39, 82, 132, .06);
}

.module-search-copy > b,
.module-search-copy > small {
  display: block;
}

.module-search-copy > b {
  margin: 5px 0 6px;
  font-size: 19px;
}

.module-search-copy > small {
  color: var(--muted);
  line-height: 1.55;
}

.module-search-box {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 6px 7px 6px 15px;
  gap: 10px;
  border: 1px solid #dce3ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 9px 26px rgba(45, 78, 119, .09);
}

.module-search-box > span {
  color: #8190a3;
  font-size: 18px;
}

.module-search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.module-search-box button {
  min-height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #151a23;
  color: #fff;
  font-weight: 750;
}

.module-search-output {
  grid-column: 1 / -1;
}

.module-search-output:empty {
  display: none;
}

.module-search-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.module-search-result-head span,
.module-search-more {
  color: var(--muted);
  font-size: 11px;
}

.module-search-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.module-search-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 13px;
  text-align: left;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
}

.module-search-results button:hover {
  border-color: #9bc5f4;
  background: #f2f8ff;
}

.module-search-results button span,
.module-search-results button b,
.module-search-results button small {
  display: block;
  min-width: 0;
}

.module-search-results button small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-search-results button em {
  flex: none;
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.module-search-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #f0d89f;
  border-radius: 12px;
  background: #fffaf0;
}

.module-search-empty p {
  margin: 4px 0 0;
  color: #6f7480;
  font-size: 12px;
}

.quick-style-picker {
  display: grid;
  gap: 4px;
}

.quick-style-picker small {
  color: var(--muted);
  font-size: 10px;
}

.workflow-search { margin-bottom: 14px; }

.workflow-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 2px 16px;
}

.workflow-legend > span:first-child {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.workflow-list { display: grid; gap: 12px; }

.workflow-contract {
  overflow: hidden;
  border: 1px solid #e0e7f0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(37, 58, 88, .04);
}

.workflow-contract-summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 18px 20px;
  border: 0;
  background: #fff;
  text-align: left;
}

.workflow-contract-summary:hover { background: #f8fbff; }
.workflow-contract-summary > span:nth-child(2) b,
.workflow-contract-summary > span:nth-child(2) small { display: block; }
.workflow-contract-summary > span:nth-child(2) b { font-size: 16px; }
.workflow-contract-summary > span:nth-child(2) small { margin-top: 4px; color: var(--muted); }
.workflow-contract-summary em { font-style: normal; }

.workflow-chevron {
  color: #6f7d90;
  font-size: 28px;
  line-height: 1;
  transition: transform .2s ease;
}

.workflow-contract.open .workflow-chevron { transform: rotate(90deg); }
.workflow-style-list { display: none; border-top: 1px solid #edf1f6; }
.workflow-contract.open .workflow-style-list { display: block; }

.workflow-style-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 20px 12px 56px;
  border-bottom: 1px solid #f0f3f7;
}

.workflow-style-row:last-child { border-bottom: 0; }
.workflow-style-row:hover { background: #fafcff; }
.workflow-style-row > div:first-child b,
.workflow-style-row > div:first-child small { display: block; }
.workflow-style-row > div:first-child small { margin-top: 5px; color: var(--muted); }
.workflow-style-row.bulk-row { grid-template-columns: minmax(190px, 1fr) auto auto auto; }
.workflow-style-row.data-row { grid-template-columns: minmax(220px, 1fr) auto auto; }

.workflow-batch-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 20px;
  background: #f7faff;
  border-bottom: 1px solid #e8eef6;
}

.workflow-batch-bar span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.workflow-badge.orange { color: #a34f00; background: #fff0dc; border: 1px solid #ffd6a2; }
.workflow-badge.yellow { color: #8c6800; background: #fff8cf; border: 1px solid #f2df75; }
.workflow-badge.blue { color: #075fc6; background: #e8f3ff; border: 1px solid #badbff; }
.workflow-badge.cyan { color: #087187; background: #e5f8fb; border: 1px solid #aee5ec; }
.workflow-badge.violet { color: #6542b8; background: #f0ebff; border: 1px solid #d6c9ff; }

.workflow-file-link,
.pending-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pending-link {
  padding: 2px 0;
  color: #b46500;
}

.compact { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.workflow-empty { display: grid; place-items: center; min-height: 190px; gap: 7px; color: var(--muted); }

.document-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.document-gallery article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.document-gallery img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #f3f5f8; }
.document-gallery article > div:not(.document-file-icon) { padding: 12px 14px; }
.document-gallery article b,
.document-gallery article small { display: block; }
.document-gallery article small { margin-top: 4px; color: var(--muted); }
.document-gallery article .shared-file-note { color: #1473e6; font-weight: 700; line-height: 1.5; }
.document-file-icon { display: grid; place-items: center; min-height: 160px; background: #f3f6fa; color: #6f7c8e; font-size: 24px; font-weight: 800; }

.empty-gallery { display: grid; place-items: center; min-height: 250px; gap: 8px; color: var(--muted); }
.target-upload-card { padding: 17px 18px; border-radius: 14px; background: #f4f8ff; }
.target-upload-card h3 { margin: 5px 0; }
.target-upload-card p { margin: 0; color: var(--muted); }
.missing-upload-zone { display: grid; place-items: center; gap: 8px; min-height: 210px; margin-top: 14px; border: 2px dashed #cbd9ea; border-radius: 16px; background: #fbfdff; }
.missing-upload-zone.dragging { border-color: var(--blue); background: #eff7ff; }
.missing-upload-zone > span { color: var(--muted); }
.missing-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 14px; }

.module-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.module-detail-head h3 { margin: 5px 0 0; font-size: 20px; }

.module-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.detail-back-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.style-status-notice { margin-bottom: 16px; }
.style-status-notice .workflow-badge { flex: 0 0 auto; }
.compact-detail-grid { margin-bottom: 20px; }

.batch-form { display: grid; gap: 18px; }
.batch-select-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.batch-select-head b,
.batch-select-head span { display: block; }
.batch-select-head span { margin-top: 4px; color: var(--muted); font-size: 11px; }

.batch-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 330px;
  overflow: auto;
}

.batch-style-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #e0e7f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.batch-style-grid label:has(input:checked) { border-color: #83baf5; background: #f1f7ff; }
.batch-style-grid input { width: 17px; height: 17px; accent-color: var(--blue); }
.batch-style-grid span,
.batch-style-grid b,
.batch-style-grid small { display: block; min-width: 0; }
.batch-style-grid small { margin-top: 4px; color: var(--muted); }
.batch-fields { padding: 16px; border-radius: 14px; background: #f7f9fc; }

.contract-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid #cfe2fb;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff, #eef6ff);
}

.contract-edit-bar b,
.contract-edit-bar span { display: block; }
.contract-edit-bar span { margin-top: 4px; color: var(--muted); font-size: 11px; }

.import-correction {
  padding: 18px;
  border: 1px solid #dfe8f4;
  border-radius: 16px;
  background: #f8fbff;
}

.import-correction textarea { min-height: 92px; }

.archive-search-group {
  flex: 1 1 560px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 320px;
}

.toolbar .archive-search-group .filter {
  flex: 1 1 auto;
  min-width: 220px;
}

.archive-search-button,
.archive-clear-button {
  flex: 0 0 auto;
  min-height: 42px;
}

.archive-search-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  color: #6d7583;
  font-size: 13px;
}

.archive-search-summary span {
  color: #1473e6;
  font-weight: 750;
}

.archive-search-summary b { color: #202632; }

.archive-no-results {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #8b93a1;
}

.archive-no-results b {
  color: #252b36;
  font-size: 16px;
}

@media (max-width: 700px) {
  .archive-search-group { flex-basis: 100%; min-width: 0; flex-wrap: wrap; }
  .toolbar .archive-search-group .filter { width: 100%; min-width: 0; }
  .archive-search-button { flex: 1; }
  .archive-clear-button { flex: 0 0 auto; }

  .module-search {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .module-search-output {
    grid-column: 1;
  }

  .module-search-results {
    grid-template-columns: 1fr;
  }

  .module-search-result-head,
  .module-search-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .style-detail-picker,
  .internal-reference {
    align-items: stretch;
    flex-direction: column;
  }

  .style-detail-picker select {
    min-width: 0;
    width: 100%;
  }

  .style-module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .upload-summary,
  .upload-file {
    align-items: flex-start;
  }

  .upload-file {
    grid-template-columns: 9px minmax(0, 1fr);
  }

  .upload-file > small,
  .upload-file > b {
    grid-column: 2;
  }

  .workflow-style-row,
  .workflow-style-row.bulk-row,
  .workflow-style-row.data-row {
    grid-template-columns: 1fr 1fr;
    padding: 14px 16px;
  }

  .workflow-style-row > div:first-child { grid-column: 1 / -1; }
  .document-gallery { grid-template-columns: 1fr; }
  .batch-style-grid { grid-template-columns: 1fr; }
  .batch-select-head,
  .module-detail-head,
  .contract-edit-bar { align-items: stretch; flex-direction: column; }
}
