:root {
  --navy: #075b7b;
  --navy-dark: #06445c;
  --green: #477e69;
  --green-dark: #356250;
  --green-soft: #e8f1ed;
  --gold: #f7edc9;
  --gold-strong: #e7d184;
  --blue-soft: #edf4f7;
  --blue-mid: #d9e7ed;
  --ink: #17242b;
  --muted: #61717a;
  --line: #ccd9df;
  --line-strong: #aebfc7;
  --surface: #ffffff;
  --surface-alt: #f5f8f9;
  --danger: #a13d3d;
  --danger-soft: #f8e9e9;
  --focus: #1f78a5;
  --shadow: 0 12px 34px rgba(24, 45, 55, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #eef3f5;
  font-synthesis: none;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #eef3f5;
  font-size: 14px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f5;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  font-size: 20px;
}

.login-panel header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.login-panel label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.login-panel select,
.login-panel input {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.login-panel > button {
  width: 100%;
  margin-top: 20px;
}

.login-error {
  margin-top: 12px !important;
  color: var(--danger);
  text-align: center;
  font-size: 12px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
select,
input,
textarea {
  border-radius: 4px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

:focus-visible {
  outline: 3px solid rgba(31, 120, 165, 0.25);
  outline-offset: 1px;
}

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

.app-header {
  min-height: 66px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 750;
  font-size: 13px;
}

.brand-lockup div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-lockup strong {
  font-size: 16px;
  line-height: 20px;
}

.brand-lockup span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.view-switch,
.status-filter {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
}

.view-tab,
.status-filter button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.view-tab.is-active,
.status-filter button.is-active {
  background: var(--surface);
  color: var(--navy-dark);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(30, 52, 62, 0.12);
}

.session-area {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.compact-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.compact-field select {
  height: 34px;
  min-width: 110px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 28px 0 9px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
}

.user-badge > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 750;
}

.user-badge div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-badge strong,
.user-badge small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-logout {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.user-badge strong {
  font-size: 13px;
}

.user-badge small {
  color: var(--muted);
  font-size: 11px;
}

.view-heading {
  min-height: 76px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy);
  color: #fff;
}

.view-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
}

.view-heading p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.heading-actions,
.dialog-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 650;
  white-space: nowrap;
}

.primary-button {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--navy);
  color: var(--navy);
}

.view-heading .secondary-button {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.view-heading .secondary-button:hover {
  border-color: #fff;
}

.filter-bar {
  min-height: 62px;
  padding: 10px 24px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.filter-field,
.upload-meta-grid label,
.edit-meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-field > span,
.upload-meta-grid label > span,
.edit-meta-grid label > span,
.coefficient-preview > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.filter-field input,
.filter-field select,
.upload-meta-grid input,
.upload-meta-grid select,
.edit-meta-grid input,
.edit-meta-grid select,
.queue-row input,
.queue-row select {
  height: 36px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0 10px;
}

.filter-field input {
  width: 150px;
}

.filter-field select {
  min-width: 180px;
}

.status-filter {
  margin-left: 4px;
}

.result-count {
  margin-left: auto;
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.content-area {
  min-height: calc(100vh - 266px);
  background: var(--surface);
}

.loading-state,
.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.table-viewport {
  width: 100%;
  max-height: calc(100vh - 270px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
}

.summary-view {
  padding: 18px 24px 28px;
  background: #f5f8f9;
}

.summary-section + .summary-section {
  margin-top: 18px;
}

.summary-section-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  background: var(--navy);
  color: #fff;
}

.summary-section-heading h2 {
  margin: 0;
  padding: 0 14px;
  font-size: 15px;
  line-height: 20px;
}

.summary-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.summary-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.summary-table th,
.summary-table td {
  min-height: 34px;
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.summary-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #7fa0ad;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.summary-table th:last-child,
.summary-table td:last-child {
  width: 280px;
  border-right: 0;
}

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

.summary-table tbody tr:hover td {
  background: #f7fbfd;
}

.summary-table .summary-conclusion {
  font-weight: 700;
}

.score-table {
  width: 100%;
  min-width: 1840px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #25333a;
  font-size: 12px;
}

.score-table th,
.score-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px 7px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.score-table thead th {
  height: 40px;
  position: sticky;
  top: 0;
  z-index: 9;
  background: var(--green);
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.score-table tbody tr:first-child td {
  border-top: 0;
}

.score-table .record-start td {
  border-top: 2px solid #b6ccd6;
}

.score-table .meta-cell {
  background: #fff;
  line-height: 18px;
  text-align: center;
}

.inline-meta-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: center;
  text-align-last: center;
  font: inherit;
}

.inline-meta-select:hover,
.inline-meta-select:focus {
  border-color: var(--focus);
  background: #fff;
  outline: 0;
}

.score-table .muted-meta {
  color: var(--muted);
}

.score-table .coefficient-cell {
  background: #e6eef2;
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.score-table .image-cell {
  padding: 5px;
  text-align: center;
}

.review-thumbnail {
  width: 74px;
  height: 74px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  overflow: hidden;
}

.review-media {
  width: 82px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.inline-paste-zone {
  border-radius: 3px;
  cursor: text;
  outline: 1px dashed transparent;
  outline-offset: 2px;
}

.inline-paste-zone:hover,
.inline-paste-zone:focus {
  outline-color: var(--focus);
  background: #f7fbfd;
}

.inline-paste-zone.is-saving {
  opacity: 0.55;
  pointer-events: none;
}

.review-thumbnail > a {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--navy);
  cursor: pointer;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px 7px;
  font-size: 10px;
  line-height: 14px;
}

.media-actions a,
.media-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
}

.media-actions .delete-action {
  color: var(--danger);
  text-decoration: none;
  font-weight: 650;
}

.inline-content-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.inline-icon-action,
.media-actions .inline-icon-action {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.inline-icon-action:hover,
.inline-icon-action:focus {
  border-color: var(--focus);
  background: #f7fbfd;
}

.review-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-thumbnail span {
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
}

.score-table .party-cell {
  background: var(--gold);
  text-align: center;
  font-weight: 700;
}

.score-table .score-cell {
  background: #fff7dc;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.score-table .reason-cell {
  padding: 3px;
  background: var(--blue-soft);
}

.reason-button {
  width: 100%;
  min-height: 34px;
  padding: 4px 24px 4px 7px;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: #24353d;
  text-align: center;
  line-height: 16px;
}

.reason-button::after {
  content: "▾";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #687a83;
}

.reason-button:hover:not(:disabled) {
  border-color: var(--focus);
  background: #fff;
}

.reason-button.is-empty {
  color: #788991;
}

.reason-button:disabled::after {
  display: none;
}

.score-table .subtotal-cell,
.score-table .final-score-cell {
  background: #f1f6f8;
  text-align: center;
  font-weight: 750;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.score-table .final-score-cell {
  text-align: center;
  color: var(--navy-dark);
  font-size: 16px;
}

.score-table .feedback-party {
  background: var(--gold);
  text-align: center;
  font-weight: 700;
}

.score-table .feedback-reason {
  background: var(--blue-soft);
  line-height: 17px;
  text-align: center;
}

.score-table .empty-reason {
  color: #7b8b92;
}

.pagination-bar {
  min-height: 58px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.pagination-bar > div {
  display: flex;
  gap: 8px;
}

.mobile-list {
  display: none;
  padding: 12px;
  background: #eef3f5;
}

.review-card {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.review-card-header {
  padding: 10px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.review-card .review-thumbnail {
  width: 68px;
  height: 68px;
}

.review-card .review-media {
  width: 68px;
}

.script-reference {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.inline-script-text {
  width: 100%;
  min-height: 64px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 18px;
  text-align: center;
  resize: vertical;
}

.inline-script-text:hover,
.inline-script-text:focus {
  border-color: var(--focus);
  background: #fff;
  outline: none;
}

.script-thumbnail {
  width: 118px;
  height: 72px;
  display: block;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  object-fit: contain;
}

.script-copy {
  display: block;
}

.script-attachment-link {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.card-script .script-attachment-link {
  display: block;
  margin: 2px 0;
  font-size: 11px;
  line-height: 16px;
}

.card-script .script-reference {
  justify-items: start;
}

.card-script {
  min-width: 0;
}

.card-script strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  line-height: 18px;
}

.card-script span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.card-score {
  min-width: 52px;
  text-align: right;
  color: var(--navy-dark);
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.card-score span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.mobile-review-block {
  border-bottom: 1px solid var(--line);
}

.mobile-inline-metadata {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.mobile-meta-field {
  display: grid;
  gap: 4px;
}

.mobile-meta-field > span {
  color: var(--muted);
  font-size: 10px;
}

.mobile-meta-field .inline-meta-select {
  border-color: var(--line);
  background: #fff;
}

.mobile-review-block:last-child {
  border-bottom: 0;
}

.mobile-party {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gold);
  font-weight: 700;
}

.mobile-dimensions {
  display: grid;
  grid-template-columns: 1fr;
}

.mobile-dimension {
  min-height: 48px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-top: 1px solid #dce7eb;
  background: var(--blue-soft);
}

.mobile-dimension > span:first-child {
  color: var(--muted);
  font-size: 11px;
}

.mobile-dimension .reason-button {
  min-height: 34px;
  background: #fff;
  border-color: var(--line);
}

.mobile-feedback-value {
  line-height: 18px;
}

.upload-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.edit-dialog {
  width: min(820px, calc(100vw - 32px));
}

.upload-dialog::backdrop {
  background: rgba(14, 28, 35, 0.48);
}

.upload-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 34px);
}

.dialog-header,
.reason-popover > header {
  min-height: 62px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
  color: #fff;
}

.dialog-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

.dialog-header span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.close-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.upload-meta-grid {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr);
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.upload-meta-grid .batch-wide-field {
  grid-column: span 4;
}

.script-file-field input[type="file"] {
  padding: 5px 8px;
  font-size: 11px;
}

.edit-meta-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: var(--surface-alt);
}

.edit-meta-grid .full-field {
  grid-column: 1 / -1;
}

.script-attachment-editor {
  display: grid;
  gap: 7px;
}

.script-attachment-editor > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.script-attachment-editor > input[type="file"] {
  height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 11px;
}

.edit-meta-grid .remove-attachment {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.edit-meta-grid .remove-attachment input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.edit-meta-grid textarea {
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 9px 10px;
  line-height: 19px;
}

.edit-coefficient {
  grid-column: 1 / -1;
  min-height: 56px;
}

.coefficient-preview {
  min-height: 58px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #e6eef2;
}

.coefficient-preview strong {
  margin-top: 3px;
  font-size: 18px;
  color: var(--navy-dark);
  font-variant-numeric: tabular-nums;
}

.align-end {
  align-self: end;
}

.file-drop {
  min-height: 82px;
  margin: 14px 16px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed var(--green);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  cursor: pointer;
}

.file-drop.is-dragging {
  border-style: solid;
  background: #dcebe4;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop span {
  color: var(--muted);
  font-size: 11px;
}

.upload-queue {
  min-height: 180px;
  overflow: auto;
  margin: 0 16px 14px;
  border: 1px solid var(--line);
}

.queue-header,
.queue-row {
  min-width: 480px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 120px;
}

.queue-header {
  min-height: 34px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.queue-header span,
.queue-row > div {
  padding: 7px;
  border-right: 1px solid var(--line);
}

.queue-row {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.queue-row:last-child {
  border-bottom: 0;
}

.queue-more {
  min-width: 480px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.queue-file {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.queue-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.queue-file strong,
.queue-file span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-file strong {
  font-size: 11px;
}

.queue-file span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.queue-script input {
  width: 100%;
}

.queue-script {
  display: grid;
  align-content: center;
  gap: 6px;
}

.script-attachment-note {
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.queue-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.queue-rules select {
  width: 100%;
  font-size: 11px;
}

.queue-status {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.queue-status.is-success {
  color: var(--green-dark);
  font-weight: 700;
}

.queue-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.dialog-footer {
  min-height: 62px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.dialog-footer > span {
  color: var(--muted);
  font-size: 11px;
}

.reason-popover {
  width: min(760px, calc(100vw - 24px));
  max-height: min(660px, calc(100vh - 24px));
  position: fixed;
  z-index: 100;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reason-popover > header {
  min-height: 54px;
  padding: 9px 12px;
  background: var(--green);
}

.reason-popover > header div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reason-popover > header span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.reason-popover > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.reason-layout {
  min-height: 430px;
  max-height: calc(min(660px, 100vh - 24px) - 54px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.reason-options {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}

.reason-option {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.reason-option:hover,
.reason-option.is-selected,
.reason-option.is-focused {
  background: #fff;
}

.reason-option.is-selected {
  box-shadow: inset 3px 0 var(--green);
}

.reason-option strong {
  display: block;
  font-size: 12px;
}

.reason-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.reason-option span {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 4px;
  background: var(--gold);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.reason-detail {
  overflow: auto;
  padding: 16px;
}

.reason-detail > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 22px;
}

.reason-detail dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.reason-detail dl > div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.reason-detail dt {
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 750;
}

.reason-detail dd {
  margin: 0;
  color: #304048;
  line-height: 20px;
}

.reason-detail .select-reason {
  width: 100%;
  min-height: 38px;
  margin-top: 14px;
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 45, 55, 0.14);
  line-height: 19px;
}

.toast.is-error {
  border-left-color: var(--danger);
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(190px, 1fr) auto minmax(210px, 1fr);
    padding: 0 14px;
  }

  .upload-meta-grid {
    grid-template-columns: 150px minmax(220px, 1fr);
  }

  .upload-meta-grid .batch-wide-field {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .app-header {
    min-height: auto;
    padding: 10px 12px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "views views";
    gap: 9px 12px;
  }

  .brand-lockup {
    grid-area: brand;
  }

  .session-area {
    grid-area: user;
  }

  .user-badge {
    min-width: 0;
  }

  .user-badge div {
    display: none;
  }

  .compact-field > span {
    display: none;
  }

  .view-switch {
    grid-area: views;
    width: 100%;
  }

  .view-heading {
    min-height: 70px;
    padding: 12px;
  }

  .view-heading h1 {
    font-size: 18px;
    line-height: 24px;
  }

  .view-heading p {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .heading-actions .secondary-button {
    display: none;
  }

  .filter-bar {
    min-height: 0;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .filter-field input,
  .filter-field select {
    width: 100%;
    min-width: 0;
  }

  .status-filter {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }

  .status-filter button {
    padding: 0 9px;
  }

  .result-count {
    display: none;
  }

  .content-area {
    min-height: calc(100vh - 270px);
  }

  .summary-view {
    padding: 12px;
  }

  .summary-table {
    min-width: 1120px;
  }

  .table-viewport {
    display: none !important;
  }

  .mobile-list:not([hidden]) {
    display: block;
  }

  .pagination-bar {
    padding: 10px 12px;
  }

  .upload-dialog {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .upload-dialog form {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
  }

  .upload-meta-grid {
    grid-template-columns: 1fr 1fr;
    max-height: none;
    overflow: visible;
  }

  .upload-meta-grid .batch-wide-field {
    grid-column: span 2;
  }

  .dialog-header,
  .dialog-footer {
    position: sticky;
    z-index: 5;
    flex: 0 0 auto;
  }

  .dialog-header {
    top: 0;
  }

  .dialog-footer {
    bottom: 0;
  }

  .file-drop {
    min-height: 68px;
  }

  .upload-queue {
    flex: 0 0 auto;
    max-height: 44vh;
  }

  .dialog-footer > span {
    display: none;
  }

  .dialog-footer {
    justify-content: flex-end;
  }

  .reason-popover {
    width: 100vw;
    max-height: 88vh;
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 7px 7px 0 0;
  }

  .reason-layout {
    min-height: 0;
    max-height: calc(88vh - 54px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 36vh) minmax(220px, 1fr);
  }

  .reason-options {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .brand-mark {
    display: none;
  }

  .compact-field select {
    min-width: 90px;
  }

  .view-heading {
    gap: 10px;
  }

  .primary-button,
  .secondary-button {
    padding: 0 10px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .status-filter,
  .result-count {
    grid-column: 1;
  }

  .review-card-header {
    grid-template-columns: 60px minmax(0, 1fr) auto;
  }

  .review-card .review-thumbnail {
    width: 60px;
    height: 60px;
  }

  .upload-meta-grid {
    grid-template-columns: 1fr;
  }


  .upload-meta-grid .batch-wide-field,
  .edit-meta-grid .full-field,
  .edit-coefficient {
    grid-column: 1;
  }

  .edit-meta-grid {
    grid-template-columns: 1fr;
  }
}
