@font-face {
  font-family: "Linotte";
  src: url("/static/fonts/Linotte/LinotteLight.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Linotte";
  src: url("/static/fonts/Linotte/LinotteRegular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Linotte";
  src: url("/static/fonts/Linotte/LinotteSemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Linotte";
  src: url("/static/fonts/Linotte/LinotteBold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Linotte";
  src: url("/static/fonts/Linotte/LinotteHeavy.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #f5f7fa;
  --card: #fff;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ec;
  --navy: #173f73;
  --navy2: #245b9e;
  --green: #15803d;
  --greenbg: #ecfdf3;
  --danger: #b42318;
  --warn: #8a5a00;
  --warnbg: #fff8e7;
  --shadow: 0 8px 24px rgba(22, 39, 64, 0.055);
  --radius: 15px;
}

/* Mobile touch: keep normal scrolling/pinch while disabling double-tap zoom. */
@media (pointer: coarse) {
  html,
  body {
    touch-action: manipulation;
  }
}
.topbar {
  min-height: 66px;
  background: #102f55;
  color: #fff;
  border-bottom: 1px solid #0b2748;
}
.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-left form,
.topbar-actions form {
  margin: 0;
}
.nav-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  font: 700 23px/1 inherit;
  cursor: pointer;
}
.nav-icon:hover {
  background: #ffffff18;
}
.nav-user,
.nav-credit {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #ffffff0e;
}
.nav-user {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.nav-user small {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 2px;
}
.nav-user small.cycle-expired {
  color: #fcd34d;
}
.nav-credit {
  color: #dbeafe;
}
.plan-button {
  border: 1px solid #93c5fd;
  background: #dbeafe;
  color: #12375f;
  border-radius: 8px;
  padding: 7px 10px;
  font: 700 11px/1.2 inherit;
  cursor: pointer;
}
.plan-button:hover {
  background: #fff;
}
.text-muted {
  color: var(--muted);
  font-size: 12px;
}
.text-danger {
  color: var(--danger);
  font-size: 12px;
}
.page-main {
  padding: 26px 0 42px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eef2f7;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px #11284416;
  padding: 32px;
}
.login-card h1 {
  margin: 18px 0 4px;
  font-size: 26px;
}
.login-card > p {
  margin: 0 0 22px;
  color: var(--muted);
}
.login-mark {
  margin: 0 auto;
}
.login-form {
  display: grid;
  gap: 15px;
  margin-top: 18px;
}
.login-form .primary-btn {
  width: 100%;
  margin-top: 4px;
}
.data-table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: #f7f9fb;
  font-weight: 750;
  white-space: nowrap;
}
.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.table-actions form {
  margin: 0;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #cad4df;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font: 650 12px/1 inherit;
  text-decoration: none;
  cursor: pointer;
}
.mini-btn:hover {
  background: #f3f6fa;
}
.mini-btn.danger {
  color: var(--danger);
}
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: #eef1f5;
  color: #556070;
  white-space: nowrap;
}
.status-completed {
  background: var(--greenbg);
  color: var(--green);
}
.status-processing {
  background: #eef5fd;
  color: var(--navy2);
}
.status-error {
  background: #fff1f0;
  color: var(--danger);
}
.inline-edit {
  background: #f9fbfd;
}
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 10px;
  align-items: end;
}
.empty-state {
  padding: 38px;
  text-align: center;
  color: var(--muted);
}
.user-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  padding: 26px 0 42px;
}
.user-form-card h2 {
  margin: 4px 0 18px;
}
.stack-form {
  display: grid;
  gap: 13px;
}
.field select {
  width: 100%;
  border: 1px solid #cfd7df;
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  color: inherit;
  background: #fff;
  outline: none;
}
.sort-links {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  flex-wrap: wrap;
}
.sort-links span {
  color: var(--muted);
}
.sort-links a {
  padding: 5px 8px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--navy);
}
.sort-links a.active {
  background: #e9f0f8;
  font-weight: 750;
}
.admin-chip {
  font-size: 10px;
  border-radius: 999px;
  padding: 3px 6px;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 750;
}
.plan-note {
  margin-top: 18px;
  padding: 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
* {
  box-sizing: border-box;
}
html {
  font-family: "Linotte", "Segoe UI", "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
}
body {
  margin: 0;
  min-width: 0;
  line-height: 1.5;
}
.shell {
  width: min(1160px, calc(100% - 32px));
  margin: auto;
}
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.brand-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.app-header h1 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 5px;
  font-weight: 700;
}
.app-header p {
  margin: 0;
  color: var(--muted);
  max-width: 850px;
  line-height: 1.55;
}
.main-grid {
  display: grid;
  gap: 20px;
  padding: 26px 0 42px;
}
.card {
  background: var(--card);
  border: 1px solid #e5e9ef;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.section-heading h2,
.processing h2,
.modal h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--navy2);
  font-weight: 750;
}
.meta {
  font-size: 13px;
  color: var(--muted);
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.upload-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.image-note-field {
  display: grid;
  gap: 7px;
}
.image-note-field > span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  color: var(--ink);
  font-size: 13px;
}
.image-note-field > span small {
  color: var(--muted);
  font-weight: 500;
}
.image-note-field textarea {
  min-height: 76px;
  resize: vertical;
}
.admin-transcriptions {
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.admin-transcriptions-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-transcriptions-head h3 {
  margin: 0;
  font-size: 15px;
}
.admin-transcriptions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-transcriptions-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.admin-transcriptions-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.admin-transcriptions-grid pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}
@media (max-width: 820px) {
  .admin-transcriptions-grid {
    grid-template-columns: 1fr;
  }
}
.dropzone {
  position: relative;
  border: 1.5px dashed #bdc8d5;
  border-radius: 14px;
  min-height: 360px;
  padding: 18px;
  background: #fbfcfe;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
  outline: none;
}
.dropzone:hover,
.dropzone:focus,
.dropzone--active {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.1);
  background: #fff;
}
.dropzone.dragging {
  background: #f0f5fb;
  border-style: solid;
}
.zone-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.zone-letter {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #e9f0f8;
  color: var(--navy);
  font-weight: 800;
}
.zone-top strong {
  display: block;
  font-size: 14px;
}
.zone-top small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.empty-zone {
  height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.empty-zone[hidden],
.preview-zone[hidden],
.dropzone.has-image .empty-zone {
  display: none !important;
}
.empty-zone p {
  margin: 10px 0 5px;
  color: var(--ink);
  font-weight: 700;
}
.empty-zone span {
  font-size: 13px;
}
.upload-icon {
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 27px;
  color: var(--navy2);
  background: #fff;
}
.focus-hint {
  display: none;
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 11px;
  background: var(--navy);
  color: #fff;
  padding: 6px 9px;
  border-radius: 999px;
}
.dropzone--active .focus-hint {
  display: block;
}
.preview-zone {
  padding-top: 16px;
}
.preview-zone img {
  display: block;
  width: 100%;
  height: 270px;
  object-fit: contain;
  background: #f2f4f7;
  border-radius: 11px;
}
.image-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.image-actions button,
.icon-btn {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.image-actions .danger {
  color: var(--danger);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 8px;
}
.field-full {
  grid-column: 1/-1;
}
.field span {
  font-size: 14px;
  font-weight: 650;
}
.field b {
  color: var(--danger);
}
input,
textarea {
  width: 100%;
  border: 1px solid #cfd7df;
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  color: inherit;
  background: #fff;
  outline: none;
  resize: vertical;
}
input:focus,
textarea:focus {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.1);
}
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 16px;
}
.model-chip,
.status-pill {
  font-size: 12px;
  color: var(--muted);
  background: #f3f5f8;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
}
.status-success {
  color: var(--green);
  background: var(--greenbg);
  border-color: #b7e1c3;
}
.primary-btn,
.secondary-btn,
.ghost-btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.primary-btn {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
}
.primary-btn:hover {
  background: #10345f;
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.secondary-btn {
  border: 1px solid #bdc9d8;
  background: #fff;
  color: var(--navy);
}
.ghost-btn {
  border: 1px solid transparent;
  background: #eef3f8;
  color: var(--navy);
}
.notice {
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.45;
}
.notice-warning {
  background: var(--warnbg);
  border: 1px solid #edd79b;
  color: #6e4a08;
}
.processing {
  display: block;
}
.processing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.spinner {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid #dbe4ee;
  border-top-color: var(--navy);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.progress-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.progress-list li {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 12px 15px;
  background: #fff;
  border-bottom: 1px solid #edf0f4;
  color: #7a8491;
}
.progress-list li:last-child {
  border-bottom: 0;
}
.step-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #cfd7df;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}
.progress-list strong {
  display: block;
  font-size: 14px;
  color: inherit;
}
.progress-list small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}
.progress-list li.active {
  background: #f6f9fd;
  color: var(--navy);
  box-shadow: inset 3px 0 0 var(--navy2);
}
.progress-list li.active .step-icon {
  border-color: var(--navy2);
  color: var(--navy2);
  background: #eef5fd;
}
.progress-list li.done {
  color: var(--green);
}
.progress-list li.done .step-icon {
  border-color: var(--green);
  background: var(--greenbg);
  color: var(--green);
  font-size: 15px;
}
.annotated-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.annotated-grid figure {
  margin: 0;
}
.annotated-grid figcaption {
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 8px;
}
.annotated-grid img {
  width: 100%;
  height: 380px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
}
.match-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.match-row {
  display: grid;
  grid-template-columns: 54px 1fr 1fr 130px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.match-row .num {
  font-weight: 800;
  color: var(--navy);
  text-align: center;
}
.match-row img {
  width: 100%;
  height: 95px;
  object-fit: contain;
  background: #f5f7f9;
  border-radius: 8px;
}
.similarity {
  text-align: center;
  font-weight: 750;
}
.download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.inline-preview {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #f3f5f8;
}
.inline-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.inline-preview-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}
.inline-preview iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #e9edf2;
}
.modal,
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 30, 0.66);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden],
.image-modal[hidden] {
  display: none;
}
.modal-panel {
  width: min(1100px, 92vw);
  height: 90vh;
  background: #fff;
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  font-size: 24px;
  line-height: 1;
  width: 38px;
  height: 38px;
  padding: 0;
}
.modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef1f4;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.image-modal img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  background: #fff;
}
.image-modal button {
  position: absolute;
  right: 24px;
  top: 18px;
  border: 0;
  background: #fff;
  color: #111;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #172033;
  color: #fff;
  padding: 12px 15px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s;
  z-index: 80;
  max-width: 340px;
}
.toast.show {
  opacity: 1;
  transform: none;
}
footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 0 28px;
}
@media (max-width: 820px) {
  .upload-grid,
  .annotated-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field-full {
    grid-column: auto;
  }
  .dropzone {
    min-height: 330px;
  }
  .annotated-grid img {
    height: 310px;
  }
  .match-row {
    grid-template-columns: 42px 1fr 1fr;
  }
  .similarity {
    grid-column: 2/4;
  }
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }
  .primary-btn {
    width: 100%;
  }
  .inline-preview iframe {
    height: 600px;
  }
}
@media (max-width: 980px) {
  .user-admin-grid {
    grid-template-columns: 1fr;
  }
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .topbar .nav-user {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }
  .app-header {
    padding: 18px 0;
  }
  .app-header h1 {
    font-size: 20px;
  }
  .brand-mark {
    display: none;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .dropzone {
    padding: 13px;
    min-height: 310px;
  }
  .preview-zone img {
    height: 210px;
  }
  .download-row > * {
    width: 100%;
  }
  .match-row {
    grid-template-columns: 34px 1fr;
  }
  .match-row img:nth-of-type(2) {
    grid-column: 2;
  }
  .similarity {
    grid-column: 2;
  }
  .modal {
    padding: 0;
  }
  .modal-panel {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .modal-actions {
    flex-wrap: wrap;
  }
  .modal-actions > * {
    flex: 1;
  }
  .focus-hint {
    position: static;
    margin-top: 10px;
    width: max-content;
  }
}

.progress-list li {
  flex-wrap: wrap;
  align-items: flex-start;
}
.step-result {
  flex: 1 0 calc(100% - 42px);
  margin-left: 42px;
  margin-top: 8px;
  min-width: 0;
}
.step-text {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font:
    13px/1.5 Consolas,
    monospace;
}
.step-json {
  display: block;
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  font:
    13px/1.45 Consolas,
    monospace;
  resize: vertical;
}
.step-result {
  width: calc(100% - 42px);
  max-width: calc(100% - 42px);
}
.step-json {
  width: 100%;
  min-height: 0;
}
.matching-result-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
.matching-result-table th,
.matching-result-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.matching-result-table th {
  background: #f3f6fa;
  font-weight: 700;
}
.matching-result-table th:first-child,
.matching-result-table td:first-child {
  width: 64px;
  text-align: center;
}
.match-row {
  grid-template-columns: 54px 1fr 1fr;
}

.ai-process-btn {
  background: var(--navy2);
  border-color: var(--navy2);
}
.ai-process-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
}
.ai-process-btn:disabled {
  background: var(--navy2);
  border-color: var(--navy2);
}
.free-rebuild-btn {
  background: var(--navy2);
  border-color: var(--navy2);
}
.free-rebuild-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
}
.match-list {
  gap: 12px;
}
.match-row {
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid #98a2b3;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.match-row .num {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 126px;
  border-right: 1.5px solid #98a2b3;
  background: #f8fafc;
  font-size: 15px;
}
.pair-number {
  font-weight: 800;
  color: var(--navy);
}
.pair-delete-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #f0b4ae;
  border-radius: 6px;
  background: #fff;
  color: var(--danger);
  font: 700 16px/1 inherit;
  cursor: pointer;
}
.pair-delete-btn:hover {
  background: #fff1f0;
  border-color: #e28d84;
}
.crop-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  align-content: center;
  justify-content: center;
  min-width: 0;
  min-height: 126px;
  padding: 10px 12px;
  background: #fff;
}
.crop-group + .crop-group {
  border-left: 1.5px solid #98a2b3;
}
.crop-item {
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
  max-width: 100%;
}
.crop-group img {
  display: block;
  width: auto;
  max-width: min(100%, 240px);
  height: 104px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.crop-group img:hover {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.1);
}
.crop-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(180, 35, 24, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--danger);
  font:
    700 14px/17px "Segoe UI",
    sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  z-index: 2;
}
.crop-delete-btn:hover {
  background: #fff1f0;
  border-color: var(--danger);
  transform: scale(1.06);
}
@media (max-width: 560px) {
  .match-row {
    grid-template-columns: 38px 1fr;
  }
  .match-row .num {
    grid-row: 1/3;
    min-height: 100%;
    border-right: 1.5px solid #98a2b3;
  }
  .crop-group {
    grid-column: 2;
    min-height: 104px;
  }
  .crop-group + .crop-group {
    border-left: 0;
    border-top: 1.5px solid #98a2b3;
  }
  .crop-group img {
    height: 82px;
  }
}

.processing[hidden] {
  display: none !important;
}
.process-action-row {
  justify-content: flex-end;
}
.process-action-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}
.process-block-message {
  color: var(--warn);
  font-size: 12px;
}
.metadata-save-status {
  min-height: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}
.metadata-save-status.saving {
  color: var(--muted);
}
.metadata-save-status.error {
  color: var(--danger);
}
.progress-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  overflow-x: auto;
}
.progress-track li {
  position: relative;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #8a94a3;
  text-align: center;
  padding: 0 10px;
}
.progress-track li::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #d8e0e9;
  z-index: 0;
}
.progress-track li:first-child::before {
  display: none;
}
.progress-track .step-icon {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #ccd6e0;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}
.progress-track strong {
  font-size: 12px;
  line-height: 1.35;
  color: inherit;
}
.progress-track li.active {
  color: var(--navy);
}
.progress-track li.active .step-icon {
  border-color: var(--navy2);
  background: #eef5fd;
  color: var(--navy2);
  box-shadow: 0 0 0 4px rgba(36, 91, 158, 0.08);
}
.progress-track li.done {
  color: var(--green);
}
.progress-track li.done::before {
  background: var(--green);
}
.progress-track li.done .step-icon {
  border-color: var(--green);
  background: var(--greenbg);
  color: var(--green);
}
@media (max-width: 820px) {
  .process-action-row {
    align-items: flex-end;
    flex-direction: row;
  }
  .process-action-wrap {
    flex-direction: column;
    align-items: flex-end;
  }
  .process-action-wrap .primary-btn {
    width: auto;
  }
  .progress-track {
    grid-template-columns: repeat(6, 140px);
    padding-bottom: 8px;
  }
}
.result-heading {
  align-items: center;
}
.result-ai-note {
  margin: 6px 0 0;
  color: #6b7785;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.result-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e4eaf0;
}
.result-inline-action {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 40px;
  padding: 0 14px;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.result-inline-action[hidden] {
  display: none !important;
}
.result-inline-action-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.result-inline-download.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}
.result-inline-actions .result-inline-docx {
  border-color: #185abd !important;
  background: #185abd !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(24, 90, 189, .18);
}
.result-inline-actions .result-inline-docx:hover,
.result-inline-actions .result-inline-docx:focus-visible {
  border-color: #124a9c !important;
  background: #124a9c !important;
  color: #fff !important;
}
.result-inline-actions .result-inline-pdf {
  border-color: #d92d20 !important;
  background: #d92d20 !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(217, 45, 32, .16);
}
.result-inline-actions .result-inline-pdf:hover,
.result-inline-actions .result-inline-pdf:focus-visible {
  border-color: #b42318 !important;
  background: #b42318 !important;
  color: #fff !important;
}
.result-inline-actions .file-type-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  overflow: visible;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.result-inline-actions .file-type-icon .file-icon-sheet {
  stroke-width: 1.35;
}
.result-inline-actions .file-type-icon .file-icon-fold,
.result-inline-actions .file-type-icon .file-icon-line {
  fill: none;
  stroke-width: 1.35;
}
.result-inline-docx .file-type-icon .file-icon-sheet {
  fill: #fff;
  stroke: #8bb9e6;
}
.result-inline-docx .file-type-icon .file-icon-fold,
.result-inline-docx .file-type-icon .file-icon-line {
  stroke: #5d9bd3;
}
.result-inline-docx .file-type-icon .file-icon-badge {
  fill: #0f4f96;
  stroke: #fff;
  stroke-width: 1;
}
.result-inline-docx .file-icon-word-glyph {
  fill: #fff;
  stroke: none;
  font: 800 10.5px/1 Arial, sans-serif;
}
.result-inline-pdf .file-type-icon .file-icon-sheet {
  fill: #fff;
  stroke: #aebbc8;
}
.result-inline-pdf .file-type-icon .file-icon-fold,
.result-inline-pdf .file-type-icon .file-icon-line {
  stroke: #9aa9b7;
}
.result-inline-pdf .file-type-icon .file-icon-badge {
  fill: #d92d20;
  stroke: #fff;
  stroke-width: 1;
}
.result-inline-pdf .file-icon-pdf-glyph {
  fill: #fff;
  stroke: none;
  font: 800 6.8px/1 Arial, sans-serif;
  letter-spacing: .25px;
}
.annotated-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.annotated-head figcaption {
  margin: 0;
}
.annotated-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.result-color-control {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.result-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.result-color-picker input[type="color"] {
  width: 38px;
  height: 32px;
  border: 1px solid #cad4df;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.color-presets {
  display: flex;
  align-items: center;
  gap: 5px;
}
.color-preset {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px #cbd5e1;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.color-preset:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #94a3b8;
}
.color-preset.active {
  box-shadow:
    0 0 0 2px var(--action),
    0 0 0 4px #fff;
}
.color-preset.preset-red {
  background: #b22d2d;
}
.color-preset.preset-blue {
  background: #1d4ed8;
}
.color-preset.preset-black {
  background: #111;
}
.annotated-preview {
  position: relative;
  width: 100%;
  height: 380px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fb;
  overflow: hidden;
}
.annotated-preview .editable-annotated {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.annotation-overlay {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.annotation-box {
  position: absolute;
  border-style: solid;
  border-color: var(--box-color);
  border-width: 1px;
  border-radius: 25%;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
.annotation-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  box-sizing: border-box;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  color: var(--box-color);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}
.editable-annotated {
  transition: box-shadow 0.15s;
}
.annotated-preview:hover {
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.08);
}
.manual-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 17, 30, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.manual-editor-modal[hidden] {
  display: none;
}
.manual-editor-panel {
  width: min(1240px, 96vw);
  height: min(92vh, 920px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}
.manual-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.manual-editor-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
}
.manual-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.manual-editor-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.manual-editor-toolbar select {
  min-width: 84px;
  border: 1px solid #cad4df;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  font: inherit;
}
.color-picker-label input[type="color"] {
  width: 42px;
  height: 32px;
  border: 1px solid #cad4df;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.manual-zoom-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #d6dee8;
  border-radius: 7px;
  background: #fff;
  color: #41546b;
  font-size: 12px;
  font-weight: 700;
}
.manual-editor-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.manual-canvas-wrap {
  min-height: 0;
  overflow: auto;
  background: #dfe5ec;
  display: block;
  padding: 0;
  overscroll-behavior: contain;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
}
.manual-canvas-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}
.manual-canvas-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 12px #0002;
}
.manual-canvas-layer > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: fill;
  background: #fff;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.manual-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: transparent;
  touch-action: none;
  cursor: default;
}
.manual-canvas-wrap canvas:focus {
  outline: none;
}
.manual-canvas-wrap canvas.draw-mode {
  cursor: crosshair;
}
.manual-canvas-wrap canvas.pan-ready {
  cursor: grab !important;
}
.manual-canvas-wrap canvas.panning {
  cursor: grabbing !important;
}
.manual-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
#manualSaveStatus {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}
#manualSaveStatus.saving {
  color: var(--navy2);
}
#manualSaveStatus.error {
  color: var(--danger);
}
@media (max-width: 720px) {
  .manual-editor-modal {
    padding: 0;
  }
  .manual-editor-panel {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .manual-editor-hint {
    width: 100%;
    margin: 0;
  }
  .annotated-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .annotated-actions {
    justify-content: flex-start;
  }
  .result-heading-actions {
    justify-content: flex-start;
  }
}

.app-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.app-dialog::backdrop {
  background: rgba(8, 17, 30, 0.62);
}
.app-dialog-panel {
  overflow: hidden;
  border: 1px solid #d9e0e8;
  border-radius: 16px;
  background: #fff;
}
.app-dialog-head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.app-dialog-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.35;
}
.app-dialog-body {
  padding: 20px;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.6;
  color: #344054;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.dialog-confirm-danger {
  background: var(--danger);
  border-color: var(--danger);
}
.dialog-confirm-danger:hover {
  background: #8f1d14;
  border-color: #8f1d14;
}
@media (max-width: 560px) {
  .app-dialog-actions {
    flex-direction: column-reverse;
  }
  .app-dialog-actions .primary-btn,
  .app-dialog-actions .secondary-btn {
    width: 100%;
  }
}

/* Workspace redesign: professional evidence-comparison workflow */
:root {
  --workspace-bg: #f4f6f8;
  --surface: #fff;
  --surface-subtle: #f8fafc;
  --border-soft: #e3e8ef;
  --border-strong: #cbd5e1;
  --action: #1f5f9d;
  --action-hover: #184d80;
  --action-soft: #eef5fb;
  --focus-ring: rgba(31, 95, 157, 0.16);
  --workspace-shadow:
    0 2px 8px rgba(15, 35, 58, 0.035), 0 10px 28px rgba(15, 35, 58, 0.035);
}
body {
  background: var(--workspace-bg);
}
.workspace-shell {
  width: min(1480px, calc(100% - 48px));
}
.topbar .topbar-inner {
  width: min(1480px, calc(100% - 48px));
}
html,
body {
  max-width: 100%;
  overflow-x: auto;
}
.shell,
.workspace-shell,
.topbar .topbar-inner,
.workspace-card,
.section-heading,
.section-heading > div,
.image-data-card .upload-grid,
.image-data-card .dropzone,
.image-data-card .preview-zone,
.image-data-card .image-viewport {
  min-width: 0;
  max-width: 100%;
}
.main-grid > *,
.card,
#processing,
#results,
.annotated-grid,
.annotated-grid figure,
.annotated-head,
.annotated-actions,
.result-heading,
.result-heading-actions,
.result-color-control,
.match-list,
.download-row {
  min-width: 0;
  max-width: 100%;
}
.topbar-inner,
.topbar-left,
.topbar-actions {
  min-width: 0;
}
.topbar-left {
  flex: 1 1 auto;
  overflow: hidden;
}
.topbar-actions {
  flex: 0 0 auto;
}
.topbar .nav-user {
  min-width: 0;
  max-width: min(360px, 45vw);
}
.topbar .nav-user-name,
.topbar .nav-user small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-heading h2 {
  overflow-wrap: anywhere;
}
.image-data-card .upload-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.annotated-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.annotated-grid figure {
  min-width: 0;
  max-width: 100%;
}
.progress-track {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}
.result-heading-actions,
.annotated-actions,
.result-color-control {
  flex-wrap: wrap;
}
.app-header {
  padding: 16px 0;
  background: #fff;
  border-bottom-color: var(--border-soft);
}
.app-header .brand-row {
  gap: 13px;
}
.app-header .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--navy);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.page-heading-copy {
  min-width: 0;
}
.app-header .page-heading-copy h1 {
  margin: 0 0 3px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #14243a;
}
.app-header .page-heading-copy p {
  max-width: 900px;
  font-size: 13px;
  line-height: 1.5;
  color: #6b7788;
}
.topbar .nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar .nav-user-name,
.topbar .nav-credit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar .nav-user-name svg,
.topbar .nav-credit svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.main-grid.workspace-shell {
  gap: 22px;
  padding: 22px 0 44px;
}
.workspace-card {
  padding: 24px 26px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--workspace-shadow);
}
.workspace-card .section-heading {
  align-items: center;
  margin-bottom: 20px;
}
.workspace-card .section-heading h2 {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 680;
  color: #17263a;
  letter-spacing: -0.005em;
}
.workspace-card .eyebrow {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: var(--action);
  font-weight: 760;
}
.upload-limit {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f5f7fa;
  color: #687587;
  font-size: 12px;
  white-space: nowrap;
}
.image-data-card .upload-grid {
  gap: 20px;
}
.image-data-card .dropzone {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 500px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}
.image-data-card .dropzone:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 4px rgba(20, 45, 72, 0.05);
  background: #fff;
}
.image-data-card .dropzone:focus:not(:focus-visible) {
  box-shadow: none;
}
.image-data-card .dropzone:focus-visible {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.image-data-card .dropzone.dropzone--active {
  border-color: #7aa6cf;
  background: #fbfdff;
  box-shadow: 0 0 0 3px rgba(31, 95, 157, 0.09);
}
.image-data-card .dropzone.dragging {
  border-color: var(--action);
  background: var(--action-soft);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.image-data-card .zone-top {
  gap: 11px;
  min-height: 42px;
  padding-right: 150px;
}
.image-data-card .zone-letter {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  background: #edf3f8;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #dce7f0;
}
.image-data-card .zone-top strong {
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.055em;
  color: #20354d;
  font-weight: 760;
}
.image-data-card .zone-top small {
  margin-top: 2px;
  font-size: 12px;
  color: #788596;
}
.image-data-card .empty-zone {
  flex: 1;
  height: auto;
  min-height: 390px;
  margin-top: 16px;
  border: 1px dashed #d5dde6;
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 32px 20px;
}
.image-data-card .upload-icon {
  width: 48px;
  height: 48px;
  border: 1px solid #d8e2ec;
  border-radius: 12px;
  background: #fff;
  color: var(--action);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.image-data-card .upload-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.image-data-card .empty-zone p {
  margin: 14px 0 5px;
  font-size: 14px;
  font-weight: 680;
  color: #26384d;
}
.image-data-card .empty-zone .paste-hint {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  padding: 3px 8px;
  border: 1px solid #dbe3eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  color: #526276;
}
.image-data-card .empty-zone small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: #8994a3;
}
.image-data-card .preview-zone {
  padding-top: 16px;
}
.image-data-card .preview-zone:not([hidden]) {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.image-data-card .image-viewport {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #e2e7ed;
  border-radius: 10px;
  background: #f3f5f7;
}
.image-data-card .image-viewport img {
  display: block;
  width: 100%;
  height: 390px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
.zoom-affordance {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #56677a;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.image-viewport:hover .zoom-affordance {
  opacity: 1;
  transform: none;
}
.zoom-affordance svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.image-data-card .image-actions {
  justify-content: flex-start;
  gap: 6px;
  margin-top: 12px;
}
.image-data-card .image-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f6f8fa;
  color: #34465a;
  font: 650 12px/1 inherit;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.image-data-card .image-actions button:hover {
  background: #eef2f6;
  border-color: #dbe2ea;
  color: #21364e;
}
.image-data-card .image-actions button:active {
  background: #e6ebf1;
}
.image-data-card .image-actions button.danger {
  margin-left: auto;
  background: transparent;
  color: #a43b34;
}
.image-data-card .image-actions button.danger:hover {
  background: #fff4f3;
  border-color: #f1d1ce;
  color: var(--danger);
}
.image-data-card .image-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.image-data-card .focus-hint {
  right: 18px;
  top: 18px;
  padding: 5px 8px;
  border: 1px solid #cbdcec;
  border-radius: 7px;
  background: #edf5fc;
  color: #245a8d;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.01em;
  box-shadow: none;
}
.image-data-card .dropzone--active .focus-hint {
  display: block;
}
.case-info-card .form-grid {
  width: 100%;
  max-width: none;
  gap: 18px;
}
.case-info-card .field {
  gap: 7px;
}
.case-info-card .field > span {
  font-size: 13px;
  font-weight: 650;
  color: #32445a;
}
.case-info-card input,
.case-info-card textarea {
  border-color: #d4dce5;
  border-radius: 9px;
  background: #fff;
  color: #1f2f43;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.case-info-card input {
  height: 44px;
  padding: 0 13px;
}
.case-info-card textarea {
  min-height: 112px;
  padding: 11px 13px;
  line-height: 1.5;
}
.case-info-card input::placeholder,
.case-info-card textarea::placeholder {
  color: #98a2b3;
}
.case-info-card input:focus,
.case-info-card textarea:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.case-info-card .process-action-row {
  width: 100%;
  max-width: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #edf0f3;
}
.case-info-card .process-action-wrap {
  min-height: 44px;
}
.case-info-card .ai-process-btn {
  min-width: 152px;
  min-height: 44px;
  gap: 8px;
  padding: 0 17px;
  border-color: var(--action);
  border-radius: 9px;
  background: var(--action);
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 1px 2px rgba(19, 63, 105, 0.12);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}
.case-info-card .ai-process-btn:hover:not(:disabled) {
  background: var(--action-hover);
  border-color: var(--action-hover);
  box-shadow: 0 2px 5px rgba(19, 63, 105, 0.16);
}
.case-info-card .ai-process-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.case-info-card .ai-process-btn:disabled {
  background: var(--action);
  border-color: var(--action);
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}
.case-info-card .ai-process-btn.is-loading {
  opacity: 0.78;
}
.button-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.button-spinner[hidden],
.button-icon[hidden] {
  display: none;
}
.inline-action-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.free-rebuild-btn,
.manual-edit-btn,
.manual-editor-toolbar .mini-btn {
  gap: 6px;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}
.image-data-card .image-actions button:focus-visible,
.case-info-card .ai-process-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.annotation-box {
  border-radius: 0;
}
.crop-live-preview {
  position: relative;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  max-width: 240px;
  max-height: 104px;
  border: 1px solid #d0d5dd;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.crop-live-preview:hover {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(36, 91, 158, 0.1);
}
.crop-live-preview .crop-source-image {
  position: absolute;
  display: block;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: fill !important;
  background: transparent !important;
  pointer-events: none;
  cursor: inherit;
  box-shadow: none !important;
}
.comparison-add-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.add-comparison-btn {
  gap: 8px;
  min-width: 196px;
  background: #fff;
  border-style: dashed;
}
.add-comparison-btn:hover {
  border-color: var(--action);
  background: #f8fbff;
}
.crop-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 150px;
  min-height: 86px;
  padding: 12px;
  border: 1px dashed #b9c5d2;
  border-radius: 8px;
  background: #f8fafc;
  color: #526579;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    box-shadow 0.15s;
}
.crop-empty-state:hover {
  border-color: var(--action);
  background: #f3f7fc;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.crop-empty-state .inline-action-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  color: var(--action);
}

@media (max-width: 960px) {
  .workspace-shell {
    width: min(1480px, calc(100% - 32px));
  }
  .topbar .topbar-inner {
    width: min(1480px, calc(100% - 32px));
  }
  .image-data-card .upload-grid {
    grid-template-columns: 1fr;
  }
  .annotated-grid {
    grid-template-columns: 1fr;
  }
  .result-heading,
  .annotated-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .result-heading-actions,
  .annotated-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .result-color-control {
    justify-content: flex-start;
  }
  .result-heading-actions .primary-btn,
  .annotated-actions .mini-btn {
    max-width: 100%;
  }
  .image-data-card .dropzone {
    min-height: 470px;
  }
  .image-data-card .image-viewport,
  .image-data-card .empty-zone {
    min-height: 350px;
  }
  .image-data-card .image-viewport img {
    height: 350px;
  }
}
@media (max-width: 640px) {
  .workspace-shell {
    width: min(1480px, calc(100% - 20px));
  }
  .topbar .topbar-inner {
    width: min(1480px, calc(100% - 20px));
  }
  .topbar-inner {
    gap: 8px;
  }
  .topbar-left,
  .topbar-actions {
    gap: 5px;
  }
  .topbar .nav-user small {
    display: none;
  }
  .topbar .nav-user {
    max-width: 40vw;
  }
  .topbar .nav-credit {
    white-space: nowrap;
  }
  .app-header {
    padding: 14px 0;
  }
  .app-header .brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .app-header .page-heading-copy h1 {
    font-size: 19px;
  }
  .app-header .page-heading-copy p {
    font-size: 12px;
  }
  .main-grid.workspace-shell {
    gap: 16px;
    padding-top: 16px;
  }
  .workspace-card {
    padding: 18px 16px;
    border-radius: 12px;
  }
  .workspace-card .section-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .upload-limit {
    align-self: flex-start;
  }
  .image-data-card .dropzone {
    min-height: 400px;
    padding: 14px;
  }
  .image-data-card .zone-top {
    padding-right: 0;
  }
  .image-data-card .focus-hint {
    position: static;
    align-self: flex-start;
    order: -1;
    margin: 0 0 12px 49px;
  }
  .image-data-card .empty-zone {
    min-height: 300px;
    padding: 24px 14px;
  }
  .image-data-card .image-viewport {
    min-height: 300px;
  }
  .image-data-card .image-viewport img {
    height: 300px;
  }
  .image-data-card .image-actions {
    width: 100%;
  }
  .image-data-card .image-actions button {
    flex: 1;
    min-width: 96px;
  }
  .image-data-card .image-actions button.danger {
    margin-left: 0;
    flex: 0 0 auto;
  }
  .case-info-card .process-action-row {
    align-items: stretch;
    flex-direction: column;
  }
  .case-info-card .process-action-wrap {
    align-items: stretch;
  }
  .case-info-card .ai-process-btn {
    width: 100%;
  }
  .result-heading-actions .primary-btn {
    width: 100%;
  }
  .annotated-actions {
    align-items: flex-start;
  }
  .result-color-control {
    width: 100%;
  }
}

/* Larger working UI for better readability on desktop. */
.nav-user,
.nav-credit {
  font-size: 15px;
}
.nav-user small {
  font-size: 12px;
}
.plan-button {
  font-size: 13px;
}
.text-muted,
.text-danger {
  font-size: 14px;
}
.mini-btn {
  min-height: 36px;
  padding-inline: 11px;
  font-size: 14px;
}
.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  padding-inline: 18px;
  font-size: 15px;
}
.app-header .page-heading-copy h1 {
  font-size: 26px;
}
.app-header .page-heading-copy p {
  font-size: 15px;
}
.workspace-card .section-heading h2 {
  font-size: 23px;
}
.workspace-card .eyebrow {
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.upload-limit {
  padding: 6px 10px;
  font-size: 14px;
}
.image-data-card .zone-letter {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 15px;
}
.image-data-card .zone-top strong {
  font-size: 15px;
}
.image-data-card .zone-top small {
  font-size: 14px;
}
.image-data-card .upload-icon {
  width: 52px;
  height: 52px;
}
.image-data-card .upload-icon svg {
  width: 26px;
  height: 26px;
}
.image-data-card .empty-zone p {
  font-size: 16px;
}
.image-data-card .empty-zone .paste-hint {
  font-size: 14px;
  padding: 4px 9px;
}
.image-data-card .empty-zone small {
  font-size: 13px;
}
.zoom-affordance {
  width: 36px;
  height: 36px;
}
.zoom-affordance svg {
  width: 19px;
  height: 19px;
}
.image-data-card .image-actions button {
  min-height: 42px;
  padding-inline: 14px;
  font-size: 14px;
  gap: 8px;
}
.image-data-card .image-actions svg {
  width: 19px;
  height: 19px;
}
.image-data-card .focus-hint {
  font-size: 12px;
  padding: 6px 9px;
}
.case-info-card .field > span {
  font-size: 15px;
}
.case-info-card input,
.case-info-card textarea {
  font-size: 15px;
}
.case-info-card .ai-process-btn {
  min-width: 166px;
  min-height: 48px;
  padding-inline: 20px;
  font-size: 15px;
  gap: 9px;
}
.button-icon {
  width: 20px;
  height: 20px;
}
.button-spinner {
  width: 18px;
  height: 18px;
}
.inline-action-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
.progress-track .step-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 13px;
}
.progress-track strong {
  font-size: 14px;
}
.result-color-picker {
  font-size: 14px;
}
.annotated-head figcaption {
  font-size: 15px;
}
.manual-editor-head h2 {
  font-size: 22px;
}
.manual-editor-toolbar label {
  font-size: 13px;
}
.manual-editor-hint {
  font-size: 12px;
}

@media (max-width: 640px) {
  .app-header .page-heading-copy h1 {
    font-size: 23px;
  }
  .app-header .page-heading-copy p {
    font-size: 14px;
  }
  .workspace-card .section-heading h2 {
    font-size: 21px;
  }
  .workspace-card .eyebrow {
    font-size: 13px;
  }
  .image-data-card .zone-top strong {
    font-size: 14px;
  }
}

/* 2026-10 visual polish + responsive refinements */
:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --ink: #17263a;
  --muted: #697789;
  --line: #dde4ec;
  --navy: #123e6b;
  --navy2: #2267a7;
  --green: #168447;
  --greenbg: #edf9f1;
  --danger: #b93832;
  --shadow:
    0 1px 2px rgba(15, 35, 58, 0.04), 0 12px 34px rgba(23, 54, 86, 0.07);
  --radius: 16px;
  --workspace-bg: #f2f5f9;
  --surface-subtle: #f7f9fc;
  --border-soft: #dfe6ee;
  --border-strong: #bbc8d6;
  --action: #2267a7;
  --action-hover: #174f84;
  --action-soft: #eef5fc;
  --focus-ring: rgba(34, 103, 167, 0.17);
  --workspace-shadow:
    0 1px 2px rgba(15, 35, 58, 0.035), 0 12px 32px rgba(23, 54, 86, 0.065);
}
body {
  background: linear-gradient(180deg, #f7f9fc 0, #f2f5f9 240px, #f2f5f9 100%);
  color: var(--ink);
}
.has-fixed-topbar {
  padding-top: 66px;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(135deg, #0d2e50 0%, #123e6b 58%, #174d7e 100%);
  border-bottom: 1px solid rgba(6, 26, 45, 0.55);
  box-shadow: 0 2px 10px rgba(8, 30, 52, 0.12);
}
.topbar-inner {
  min-height: 64px;
}
.topbar .nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  transition:
    background-color 0.16s ease,
    transform 0.16s ease,
    color 0.16s ease;
}
.topbar .nav-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.topbar .nav-user {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.topbar .nav-credit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  max-width: min(390px, 48vw);
  padding: 2px 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #dce9f5;
  line-height: 1.2;
}
.topbar .nav-credit-main {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.topbar .nav-credit-main svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar .nav-credit-sep {
  color: #8eabc4;
  font-weight: 400;
}
.topbar .nav-credit small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9fb6ca;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.005em;
}
.topbar .nav-credit small.cycle-expired {
  color: #ffdf87;
}
.topbar .plan-button {
  min-height: 38px;
  border-color: rgba(191, 219, 254, 0.75);
  background: #e5f1fc;
  color: #153c62;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: 0.16s ease;
}
.topbar .plan-button:hover {
  background: #fff;
  transform: translateY(-1px);
}
.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(125%) blur(8px);
  border-bottom: 1px solid #e2e8ef;
}
.app-header .brand-mark,
.login-card .brand-mark {
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(18, 62, 107, 0.13));
}
.app-header .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 0;
}
.login-card .brand-mark {
  display: block;
  width: 66px;
  height: 66px;
  border-radius: 0;
}
.card,
.workspace-card {
  border: 1px solid rgba(210, 220, 231, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--workspace-shadow);
}
.workspace-card {
  padding: 26px 28px;
}
.workspace-card .section-heading {
  padding-bottom: 2px;
}
.workspace-card .section-heading h2 {
  color: #16283d;
  letter-spacing: -0.012em;
}
.workspace-card .eyebrow {
  color: #2166a4;
}
.upload-limit,
.model-chip,
.status-pill {
  border: 1px solid #e1e7ee;
  background: #f6f8fb;
  color: #657386;
}
.image-data-card .dropzone {
  border-color: #dce4ec;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}
.image-data-card .dropzone:hover {
  border-color: #b7c7d8;
  box-shadow: 0 8px 24px rgba(26, 63, 99, 0.07);
  transform: translateY(-1px);
}
.image-data-card .image-viewport {
  border-color: #e0e6ed;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc, #eef2f6);
}
.image-data-card .empty-zone {
  border-color: #ccd7e3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcff, #f6f9fc);
}
.image-data-card .upload-icon {
  border-color: #d2deea;
  background: #fff;
  color: #2166a4;
  box-shadow: 0 5px 15px rgba(31, 95, 157, 0.09);
}
input,
textarea,
.field select {
  border-color: #cfd9e4;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 35, 58, 0.025);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}
input:hover,
textarea:hover,
.field select:hover {
  border-color: #b9c8d8;
}
input:focus,
textarea:focus,
.field select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.primary-btn,
.secondary-btn,
.ghost-btn,
.mini-btn,
.image-actions button,
.add-comparison-btn {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.12s ease;
}
.primary-btn {
  border-color: #1c5d98;
  background: linear-gradient(180deg, #286fae, #1f5f9d);
  box-shadow:
    0 2px 5px rgba(24, 79, 128, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
}
.primary-btn:hover:not(:disabled) {
  border-color: #174f84;
  background: linear-gradient(180deg, #2267a7, #194f83);
  box-shadow: 0 5px 14px rgba(24, 79, 128, 0.2);
  transform: translateY(-1px);
}
.primary-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(24, 79, 128, 0.18);
}
.secondary-btn,
.mini-btn {
  border-color: #cbd6e1;
  background: #fff;
  color: #244b72;
  box-shadow: 0 1px 2px rgba(15, 35, 58, 0.035);
}
.secondary-btn:hover,
.mini-btn:hover {
  border-color: #aebfd0;
  background: #f7faff;
  color: #163f68;
  box-shadow: 0 3px 9px rgba(23, 61, 97, 0.08);
  transform: translateY(-1px);
}
.ghost-btn {
  border: 1px solid #dde5ed;
  background: #f2f6fa;
  color: #244b72;
}
.ghost-btn:hover {
  border-color: #c5d2df;
  background: #eaf1f7;
  transform: translateY(-1px);
}
.notice {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.progress-track {
  gap: 0;
  padding: 7px 4px 3px;
  overflow: visible;
}
.progress-track li {
  min-width: 0;
}
.progress-track .step-icon {
  border-color: #c7d3df;
  box-shadow: 0 2px 6px rgba(20, 53, 84, 0.05);
  transition: 0.18s ease;
}
.progress-track li.active .step-icon {
  box-shadow:
    0 0 0 5px rgba(34, 103, 167, 0.09),
    0 3px 9px rgba(34, 103, 167, 0.13);
}
.progress-track li.done .step-icon {
  box-shadow: 0 2px 8px rgba(22, 132, 71, 0.09);
}
.match-list {
  gap: 14px;
}
.match-row {
  grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d5dee8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 45, 73, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}
.match-row:hover {
  border-color: #bbc9d7;
  box-shadow: 0 6px 18px rgba(17, 45, 73, 0.07);
  transform: translateY(-1px);
}
.match-row .num {
  display: grid;
  grid-template-rows: 30px minmax(66px, 1fr) 30px;
  align-items: stretch;
  justify-items: stretch;
  gap: 0;
  padding: 0;
  border-right: 1px solid #dbe3eb;
  background: linear-gradient(180deg, #f9fbfd, #f2f6fa);
}
.pair-number {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border-radius: 8px;
  background: #e9f2fb;
  color: #174f84;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px #d4e4f2;
}
.pair-number-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 5px;
}
.pair-move-btn,
.pair-delete-btn {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  line-height: 1;
  cursor: pointer;
  transition: 0.14s ease;
}
.pair-move-btn {
  width: 100%;
  height: 30px;
  border: 0;
  color: #315a80;
  font-size: 14px;
  border-radius: 0;
}
.pair-move-up {
  border-bottom: 1px solid #dbe3eb;
}
.pair-move-down {
  border-top: 1px solid #dbe3eb;
}
.pair-move-btn:hover:not(:disabled) {
  background: #e8f2fb;
  color: #174f84;
}
.pair-move-btn:disabled {
  opacity: 0.28;
  cursor: default;
  background: transparent;
}
.pair-delete-btn {
  width: 30px;
  height: 26px;
  border: 1px solid #efc0bd;
  border-radius: 7px;
  background: #fff;
  color: #b93832;
  font-size: 16px;
}
.pair-delete-btn:hover {
  border-color: #df8f89;
  background: #fff1f0;
  color: #a12d28;
  transform: translateY(-1px);
}
.crop-group {
  background: #fff;
}
.crop-group + .crop-group {
  border-left-color: #dbe3eb;
}
.crop-live-preview,
.crop-group img {
  border-color: #cdd7e1;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(15, 35, 58, 0.04);
}
.crop-live-preview:hover,
.crop-group img:hover {
  border-color: #8fb0cf;
  box-shadow:
    0 0 0 3px rgba(34, 103, 167, 0.1),
    0 4px 12px rgba(15, 35, 58, 0.08);
}
.crop-delete-btn {
  display: grid;
  place-items: center;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(185, 56, 50, 0.32);
  background: rgba(255, 255, 255, 0.94);
  font:
    700 15px/1 "Segoe UI",
    sans-serif;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.16);
}
.crop-delete-btn:hover {
  background: #fff1f0;
  border-color: #c94e48;
  transform: scale(1.06);
}
.comparison-add-row {
  margin-top: 18px;
}
.add-comparison-btn {
  border-width: 1px;
  border-color: #b9c9d9;
  background: #f9fbfd;
  color: #235b90;
}
.add-comparison-btn:hover {
  background: #eef5fb;
  box-shadow: 0 4px 12px rgba(31, 95, 157, 0.08);
}
.download-row {
  padding-top: 4px;
}
.toast {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  box-shadow: 0 14px 38px rgba(15, 35, 58, 0.2);
}
.login-card {
  border-color: #d9e2eb;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(19, 49, 77, 0.12);
}

@media (max-width: 960px) {
  .progress-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    overflow: visible;
    padding: 0;
  }
  .progress-track li {
    min-width: 0;
    min-height: 60px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid #dfe6ee;
    border-radius: 11px;
    background: #f8fafc;
    text-align: left;
  }
  .progress-track li::before {
    display: none;
  }
  .progress-track li.active {
    border-color: #aac5df;
    background: #f1f7fd;
    box-shadow: 0 0 0 3px rgba(34, 103, 167, 0.07);
  }
  .progress-track li.done {
    border-color: #cfe5d6;
    background: #f4fbf6;
  }
  .progress-track .step-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }
  .progress-track strong {
    font-size: 13px;
  }
}
@media (max-width: 640px) {
  .topbar .nav-user {
    max-width: 30vw;
  }
  .topbar .nav-credit {
    max-width: 45vw;
    padding-inline: 2px;
  }
  .topbar .nav-credit-main {
    font-size: 11px;
  }
  .topbar .nav-credit small {
    font-size: 9px;
  }
  .app-header .brand-mark {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
  .workspace-card {
    padding: 18px 16px;
  }
  .progress-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .progress-track li {
    min-height: 56px;
    padding: 8px;
  }
  .match-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .match-row .num {
    grid-row: 1/3;
    grid-template-rows: 28px minmax(62px, 1fr) 28px;
    min-height: 100%;
    border-right: 1px solid #dbe3eb;
  }
  .crop-group {
    grid-column: 2;
    min-height: 104px;
  }
  .crop-group + .crop-group {
    border-left: 0;
    border-top: 1px solid #dbe3eb;
  }
  .pair-move-btn {
    height: 28px;
  }
  .pair-delete-btn {
    width: 28px;
    height: 24px;
  }
}
@media (max-width: 400px) {
  .progress-track {
    grid-template-columns: 1fr;
  }
  .topbar .nav-user {
    display: none;
  }
  .topbar .nav-credit {
    max-width: 58vw;
  }
}

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

/* 2026-10 compact navbar + comparison action polish */
.topbar .topbar-left > a.nav-icon:first-child svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
}
.topbar .nav-credit-main {
  gap: 5px;
}
.topbar .nav-credit-main svg {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
.pair-move-icon {
  display: block;
  width: 20px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pair-move-btn {
  display: grid;
  place-items: center;
}
.pair-delete-btn,
.crop-delete-btn {
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.25 4.25 11.75 11.75M11.75 4.25 4.25 11.75' fill='none' stroke='%23b93832' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 50% 50% !important;
  background-size: 11px 11px !important;
}
.pair-delete-btn::before,
.pair-delete-btn::after,
.crop-delete-btn::before,
.crop-delete-btn::after {
  content: none !important;
}
.download-row > * {
  min-width: 0;
}
.download-row a.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.18);
}
.annotated-download-btn {
  width: 100%;
  margin-top: 10px;
  min-height: 38px;
}
.annotated-download-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.18);
}

/* Floating result actions: compact circles that expand on hover/focus. */
.floating-result-actions {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.floating-result-actions .floating-action {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  min-height: 52px;
  max-width: none;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  border: 1px solid #1c5d98;
  border-radius: 999px;
  background: linear-gradient(180deg, #286fae, #1f5f9d);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(20, 64, 105, 0.24);
  font:
    700 13px/1 "Linotte",
    "Segoe UI",
    sans-serif;
  white-space: nowrap;
  transition:
    width 0.18s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
  cursor: pointer;
}
.floating-result-actions .floating-action:hover,
.floating-result-actions .floating-action:focus-visible {
  width: 196px;
  outline: none;
  box-shadow: 0 9px 24px rgba(20, 64, 105, 0.3);
}
.floating-result-actions .floating-action-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-result-actions .file-type-icon {
  width: 25px;
  height: 25px;
  flex-basis: 25px;
  overflow: visible;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-result-actions .file-type-icon .file-icon-sheet {
  stroke-width: 1.35;
}
.floating-result-actions .file-type-icon .file-icon-fold,
.floating-result-actions .file-type-icon .file-icon-line {
  fill: none;
  stroke-width: 1.35;
}
.floating-action-docx .file-type-icon .file-icon-sheet {
  fill: #fff;
  stroke: #d9eaff;
}
.floating-action-docx .file-type-icon .file-icon-fold,
.floating-action-docx .file-type-icon .file-icon-line {
  stroke: #7fb8ed;
}
.floating-action-docx .file-type-icon .file-icon-badge {
  fill: #0f4f96;
  stroke: #fff;
  stroke-width: 1;
}
.floating-action-docx .file-icon-word-glyph {
  fill: #fff;
  stroke: none;
  font:
    800 10.5px/1 Arial,
    sans-serif;
}
.floating-action-pdf .file-type-icon .file-icon-sheet {
  fill: #fff;
  stroke: #aebbc8;
}
.floating-action-pdf .file-type-icon .file-icon-fold,
.floating-action-pdf .file-type-icon .file-icon-line {
  stroke: #9aa9b7;
}
.floating-action-pdf .file-type-icon .file-icon-badge {
  fill: #d92d20;
  stroke: #fff;
  stroke-width: 1;
}
.floating-action-pdf .file-icon-pdf-glyph {
  fill: #fff;
  stroke: none;
  font:
    800 6.8px/1 Arial,
    sans-serif;
  letter-spacing: 0.25px;
}
.floating-result-actions .floating-action-label {
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-width 0.18s ease,
    margin-left 0.18s ease,
    opacity 0.12s ease;
}
.floating-result-actions .floating-action:hover .floating-action-label,
.floating-result-actions .floating-action:focus-visible .floating-action-label {
  max-width: 145px;
  margin-left: 10px;
  opacity: 1;
}
.floating-result-actions .floating-action-pdf {
  border-color: #c9d4df;
  background: #fff;
  color: var(--navy);
}
.floating-result-actions .floating-action-pdf:hover,
.floating-result-actions .floating-action-pdf:focus-visible {
  background: #f5f8fb;
  border-color: #9fb3c8;
}
.floating-result-actions .floating-action:disabled,
.floating-result-actions .floating-action.is-disabled {
  opacity: 0.46;
  cursor: not-allowed;
  filter: grayscale(0.16);
}
.floating-result-actions .floating-action:disabled:hover {
  width: 196px;
}
.floating-result-actions .floating-action-rebuild,
.floating-result-actions .floating-action-rebuild:hover,
.floating-result-actions .floating-action-rebuild:focus-visible,
.floating-result-actions .floating-action-rebuild:disabled:hover {
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 36px);
  height: auto;
  min-height: 52px;
  padding: 12px 18px;
  gap: 10px;
  overflow: visible;
}
.floating-result-actions .floating-action-rebuild .floating-action-label {
  max-width: none;
  margin-left: 0;
  overflow: visible;
  opacity: 1;
}
.floating-result-actions .floating-action[hidden] {
  display: none !important;
}

@media (min-width: 821px) {
  .floating-result-actions {
    gap: 14px;
  }
  .floating-result-actions .floating-action:not(.floating-action-rebuild) {
    width: 104px;
    height: 104px;
    min-height: 104px;
    padding: 0 27px;
  }
  .floating-result-actions .floating-action:not(.floating-action-rebuild):hover,
  .floating-result-actions .floating-action:not(.floating-action-rebuild):focus-visible {
    width: 260px;
  }
  .floating-result-actions .floating-action-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .floating-result-actions .file-type-icon {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
  .floating-result-actions .floating-action:not(.floating-action-rebuild) .floating-action-label {
    font-size: 14px;
  }
  .floating-result-actions .floating-action-rebuild {
    min-height: 0;
    padding: 14px 20px;
  }
}

@media (max-width: 820px) {
  .result-inline-actions {
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
  }
  .result-inline-action {
    width: 100% !important;
    justify-content: center;
    text-align: center;
  }
  .download-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }
  .download-row #annABtn,
  .download-row #annMBtn {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }
  .floating-result-actions {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .floating-result-actions .floating-action {
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding-inline: 13px;
  }
  .floating-result-actions .floating-action:hover,
  .floating-result-actions .floating-action:focus-visible,
  .floating-result-actions .floating-action:disabled:hover {
    width: 184px;
  }
  .floating-result-actions .floating-action-rebuild,
  .floating-result-actions .floating-action-rebuild:hover,
  .floating-result-actions .floating-action-rebuild:focus-visible,
  .floating-result-actions .floating-action-rebuild:disabled:hover {
    width: max-content;
    min-width: 0;
    max-width: calc(100vw - 24px);
    min-height: 48px;
    padding: 10px 15px;
  }
}

/* iOS zooms the viewport when focusing controls whose text is smaller than 16px. */
@media (pointer: coarse) and (max-width: 820px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Keep iPhone form focus at 1x and disable double-tap page zoom. */
@supports (-webkit-touch-callout: none) {
  html,
  body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
  }
  body * {
    touch-action: manipulation;
  }
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
  .manual-canvas-wrap,
  .manual-canvas-wrap canvas {
    touch-action: none;
  }
}

/* Toasts sit below the fixed title bar so they never cover result actions. */
.toast {
  left: 50%;
  right: auto;
  top: 80px;
  bottom: auto;
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  text-align: center;
  transform: translate(-50%, -10px);
}
.toast.show {
  transform: translate(-50%, 0);
}

/* Bootstrap-like tooltips without the browser's native title popup. */
.app-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: min(300px, calc(100vw - 24px));
  padding: 6px 9px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font:
    600 12px/1.35 "Linotte",
    "Segoe UI",
    sans-serif;
  text-align: center;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
  word-break: break-word;
}
.app-tooltip.show {
  opacity: 0.96;
  transform: none;
}
.app-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  transform: translateX(-50%);
}
.app-tooltip[data-placement="top"]::after {
  top: 100%;
  border-top-color: #111827;
}
.app-tooltip[data-placement="bottom"]::after {
  bottom: 100%;
  border-bottom-color: #111827;
}

/* Larger, clearer title-bar actions. */
.topbar .nav-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
}
.topbar .nav-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}
.topbar .topbar-left > a.nav-icon:first-child svg {
  width: 29px;
  height: 29px;
  stroke-width: 2;
}
.topbar .nav-icon:hover,
.topbar .nav-icon:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.topbar .topbar-actions {
  gap: 0;
}
.topbar .topbar-actions .nav-icon {
  width: 40px;
}
.topbar .topbar-actions > a.nav-icon + .nav-icon,
.topbar .topbar-actions > form {
  margin-left: -2px;
}
.topbar .nav-user-button {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.topbar .nav-user-button:hover,
.topbar .nav-user-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.topbar .nav-credit-button {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.topbar .nav-credit-button:hover,
.topbar .nav-credit-button:focus-visible {
  color: #fff;
  outline: none;
}

/* Signed-in user details. */
.user-detail-dialog {
  width: min(620px, calc(100vw - 32px));
}
.user-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.user-detail-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d5dde7;
  border-radius: 9px;
  background: #fff;
  color: #526173;
  font: 400 25px/1 inherit;
  cursor: pointer;
}
.user-detail-close:hover,
.user-detail-close:focus-visible {
  background: #f3f6fa;
  color: var(--navy);
  outline: none;
}
.user-detail-body {
  padding: 18px 20px 20px;
}
.user-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}
.user-detail-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e1e7ee;
  border-radius: 11px;
  background: #f8fafc;
}
.user-detail-grid .user-detail-wide {
  grid-column: 1/-1;
}
.user-detail-grid dt {
  margin: 0 0 4px;
  color: #7a8797;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}
.user-detail-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.password-change-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e1e7ee;
}
.password-change-title {
  margin-bottom: 11px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}
.password-change-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.password-change-form .field:first-child {
  grid-column: 1/-1;
}
.password-change-form .field span small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.password-change-form > .primary-btn {
  grid-column: 1/-1;
  justify-self: end;
  min-width: 150px;
}
.password-change-status {
  grid-column: 1/-1;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}
.password-change-status[data-kind="error"] {
  border: 1px solid #efc4c4;
  background: #fff4f4;
  color: #a52323;
}
.password-change-status[data-kind="success"] {
  border: 1px solid #b8dec7;
  background: #f0faf4;
  color: #17643a;
}
.credit-detail-dialog {
  width: min(650px, calc(100vw - 32px));
}
.credit-detail-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}
.bank-transfer-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #00743f;
  border-radius: 15px;
  background: linear-gradient(145deg, #006c3b 0%, #00894b 55%, #00a45a 100%);
  box-shadow: 0 10px 28px rgba(0, 108, 59, 0.2);
}
.bank-transfer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
}
.bank-transfer-title strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #d71920;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(117, 0, 6, 0.22);
}
.usage-detail-title {
  margin: 0 0 11px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}
.bank-transfer-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.bank-transfer-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}
.bank-transfer-qr-frame {
  width: 158px;
  height: 158px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 69, 38, 0.14);
}
.bank-transfer-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.bank-transfer-qr span {
  color: #006c3b;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}
.bank-transfer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.bank-transfer-grid > div {
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.62);
}
.bank-transfer-grid .bank-transfer-content {
  grid-column: 1/-1;
}
.bank-transfer-grid dt {
  margin: 0 0 3px;
  color: #597367;
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bank-transfer-grid dd {
  margin: 0;
  color: #123d2b;
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.bank-transfer-grid .bank-account-number {
  font-size: 20px;
  letter-spacing: 0.04em;
  color: #007c43;
}
.bank-transfer-content dd {
  color: #007c43;
  font-size: 16px;
}
.credit-conversion-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 54, 30, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 69, 38, 0.15);
}
.credit-conversion-note strong {
  font-weight: 850;
}
.usage-detail-section {
  padding-top: 2px;
}
@media (max-width: 560px) {
  .topbar .topbar-actions .nav-icon {
    width: 38px;
  }
  .user-detail-grid {
    grid-template-columns: 1fr;
  }
  .user-detail-grid .user-detail-wide {
    grid-column: auto;
  }
  .password-change-form {
    grid-template-columns: 1fr;
  }
  .password-change-form .field:first-child,
  .password-change-form > .primary-btn,
  .password-change-status {
    grid-column: auto;
  }
  .password-change-form > .primary-btn {
    width: 100%;
    justify-self: stretch;
  }
  .bank-transfer-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .bank-transfer-layout {
    grid-template-columns: 1fr;
  }
  .bank-transfer-grid {
    grid-template-columns: 1fr;
  }
  .bank-transfer-grid .bank-transfer-content {
    grid-column: auto;
  }
  .bank-transfer-qr {
    padding: 10px;
  }
  .bank-transfer-qr-frame {
    width: 170px;
    height: 170px;
  }
}

/* Main AI action. */
.case-info-card .ai-process-btn {
  background: #c92f2f;
  border-color: #c92f2f;
  box-shadow: 0 2px 5px rgba(148, 29, 29, 0.18);
}
.case-info-card .ai-process-btn:hover:not(:disabled) {
  background: #a92323;
  border-color: #a92323;
  box-shadow: 0 3px 8px rgba(148, 29, 29, 0.24);
}
.case-info-card .ai-process-btn:disabled {
  background: #c92f2f;
  border-color: #c92f2f;
}
.case-info-card .ai-process-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(201, 47, 47, 0.2);
}

/* Brand mark is intentionally more prominent in the page heading. */
.app-header .brand-mark {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
}
@media (max-width: 640px) {
  .app-header .brand-mark {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
  }
}

/* Distinguish questioned image A from comparison image M. */
.image-data-card .dropzone[data-side="A"] {
  border-color: #efc4c4;
  background: #fff8f8;
}
.image-data-card .dropzone[data-side="A"]:hover,
.image-data-card .dropzone[data-side="A"]:focus-visible,
.image-data-card .dropzone[data-side="A"].dropzone--active,
.image-data-card .dropzone[data-side="A"].dragging {
  border-color: #d84a4a;
  background: #fff4f4;
  box-shadow: 0 0 0 3px rgba(216, 74, 74, 0.1);
}
.image-data-card .dropzone[data-side="A"] .zone-letter {
  border-color: #f0bebe;
  background: #fde7e7;
  color: #a91f1f;
}
.image-data-card .dropzone[data-side="A"] .upload-icon {
  border-color: #efc8c8;
  color: #c62f2f;
  background: #fff;
}
.image-data-card .dropzone[data-side="A"] .empty-zone .paste-hint {
  border-color: #efcaca;
  color: #9f2929;
  background: #fffafa;
}
.image-data-card .dropzone[data-side="A"] .focus-hint {
  border-color: #efb6b6;
  background: #fde8e8;
  color: #9e2424;
}

.image-data-card .dropzone[data-side="M"] {
  border-color: #bfd4ea;
  background: #f7fbff;
}
.image-data-card .dropzone[data-side="M"]:hover,
.image-data-card .dropzone[data-side="M"]:focus-visible,
.image-data-card .dropzone[data-side="M"].dropzone--active,
.image-data-card .dropzone[data-side="M"].dragging {
  border-color: #4f8fc8;
  background: #f2f8fe;
  box-shadow: 0 0 0 3px rgba(79, 143, 200, 0.1);
}
.image-data-card .dropzone[data-side="M"] .zone-letter {
  border-color: #bdd3e8;
  background: #e6f0fa;
  color: #175b94;
}
.image-data-card .dropzone[data-side="M"] .upload-icon {
  border-color: #c7d9ea;
  color: #216ba8;
  background: #fff;
}
.image-data-card .dropzone[data-side="M"] .empty-zone .paste-hint {
  border-color: #c6d9ea;
  color: #245f91;
  background: #fafdff;
}
.image-data-card .dropzone[data-side="M"] .focus-hint {
  border-color: #bfd7ea;
  background: #eaf4fd;
  color: #245f91;
}

/* Result presentation: A is red, M is blue. */
.annotated-grid
  figure:has(.annotated-preview[data-preview-side="A"])
  figcaption {
  color: #a72525;
}
.annotated-grid
  figure:has(.annotated-preview[data-preview-side="M"])
  figcaption {
  color: #1d5f99;
}
.annotated-preview[data-preview-side="A"] {
  border-color: #e8aaa7;
  background: linear-gradient(180deg, #fff8f8, #fff2f2);
  box-shadow: inset 0 0 0 1px rgba(185, 48, 43, 0.035);
}
.annotated-preview[data-preview-side="A"]:hover {
  border-color: #d55a55;
  box-shadow: 0 0 0 3px rgba(201, 47, 47, 0.1);
}
.annotated-preview[data-preview-side="M"] {
  border-color: #9fc5e5;
  background: linear-gradient(180deg, #f7fbff, #eef6fd);
  box-shadow: inset 0 0 0 1px rgba(33, 102, 164, 0.035);
}
.annotated-preview[data-preview-side="M"]:hover {
  border-color: #4f8fc8;
  box-shadow: 0 0 0 3px rgba(33, 102, 164, 0.1);
}

.match-row .crop-group-a {
  background: linear-gradient(180deg, #fff9f9, #fff3f3);
  box-shadow: inset 3px 0 0 #d95b57;
}
.match-row .crop-group-m {
  border-left-color: #a9c9e4;
  background: linear-gradient(180deg, #f8fbff, #eef6fd);
  box-shadow: inset 3px 0 0 #4f8fc8;
}
.match-row .crop-group-a .crop-live-preview,
.match-row .crop-group-a img {
  border-color: #e4aaa7;
}
.match-row .crop-group-a .crop-live-preview:hover,
.match-row .crop-group-a img:hover {
  border-color: #cf514c;
  box-shadow:
    0 0 0 3px rgba(201, 47, 47, 0.1),
    0 4px 12px rgba(92, 26, 23, 0.08);
}
.match-row .crop-group-m .crop-live-preview,
.match-row .crop-group-m img {
  border-color: #9fc2df;
}
.match-row .crop-group-m .crop-live-preview:hover,
.match-row .crop-group-m img:hover {
  border-color: #4f8fc8;
  box-shadow:
    0 0 0 3px rgba(33, 102, 164, 0.1),
    0 4px 12px rgba(19, 67, 108, 0.08);
}
@media (max-width: 560px) {
  .match-row .crop-group-m {
    border-top-color: #a9c9e4;
  }
}

/* User administration edit dialog and table action alignment. */
.data-table td.table-actions {
  display: table-cell;
}
.table-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.table-action-group form {
  margin: 0;
}
.user-admin-page {
  display: block;
  padding: 26px 0 42px;
}
.user-admin-page > .card {
  width: 100%;
}
.user-admin-page .section-heading {
  align-items: center;
}
.user-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.user-admin-toolbar .sort-links {
  justify-content: flex-end;
}
.sort-direction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 7px;
  margin-left: 2px;
  border-left: 1px solid #d9e1ea;
}
.sort-direction a {
  white-space: nowrap;
}
.page-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 12px;
}
.list-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin: -2px 0 18px;
  padding: 4px;
  border: 1px solid #d9e2ec;
  border-radius: 11px;
  background: #f4f7fa;
  box-shadow: inset 0 1px 2px rgba(19, 50, 80, 0.03);
}
.list-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid transparent !important;
  border-radius: 8px;
  background: transparent;
  color: #52677d !important;
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.08s ease;
}
.list-tab:hover {
  background: #fff;
  color: var(--navy2) !important;
  text-decoration: none;
}
.list-tab.active {
  border-color: #1f6ea9 !important;
  background: linear-gradient(180deg, #287ab5 0%, #1f669c 100%);
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(24, 88, 137, 0.2);
}
.list-tab:active {
  transform: translateY(1px);
}
.list-tab-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #9aabba;
}
.list-tab.active .list-tab-dot {
  background: #dff2ff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.13);
}
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: nowrap;
  margin: 16px -1px -1px;
  padding: 12px 14px;
  border: 1px solid #e1e7ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #607286;
  font-size: 12px;
}
.page-size-form,
.page-size-form label,
.pagination-nav {
  display: flex;
  align-items: center;
}
.page-size-form {
  margin: 0;
}
.page-size-form label {
  gap: 8px;
  font-weight: 650;
  white-space: nowrap;
}
.page-size-form select {
  height: 34px;
  min-width: 64px;
  padding: 0 28px 0 10px;
  border: 1px solid #c8d3df;
  border-radius: 8px;
  background: #fff;
  color: #263b50;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 38, 60, 0.03);
}
.pagination-summary {
  margin-left: auto;
  white-space: nowrap;
  color: #738396;
}
.pagination-summary strong {
  color: #31475e;
  font-weight: 750;
}
.pagination-nav {
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid #e1e7ee;
}
.pagination-btn,
.pagination-current {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  white-space: nowrap;
}
.pagination-btn {
  min-width: 72px;
  padding: 0 11px;
  border: 1px solid #cbd6e1 !important;
  background: #fff;
  color: #31516e !important;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20, 47, 73, 0.04);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pagination-btn:hover {
  border-color: #9bb8d1 !important;
  background: #eef5fb;
  color: var(--navy2) !important;
  text-decoration: none;
}
.pagination-btn.disabled {
  border-color: #e0e6ec !important;
  color: #a4afbb !important;
  background: #f4f6f8;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.pagination-current {
  min-width: 86px;
  padding: 0 10px;
  border: 1px solid #d9e3ed;
  background: #fff;
  font-weight: 750;
  color: #31475e;
}
.list-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 12px;
}
.list-actions-top {
  margin-bottom: 14px;
}
.list-create-btn {
  width: auto;
  max-width: max-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}
.user-create-btn {
  width: auto;
}
.data-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.users-table {
  width: 1150px;
  min-width: 1150px;
  table-layout: fixed;
}
.users-table .users-col-name {
  width: 180px;
}
.users-table .users-col-username {
  width: 155px;
}
.users-table .users-col-unit {
  width: 150px;
}
.users-table .users-col-type {
  width: 100px;
}
.users-table .users-col-credit {
  width: 85px;
}
.users-table .users-col-cycle {
  width: 220px;
}
.users-table .users-col-total {
  width: 100px;
}
.users-table .users-col-actions {
  width: 160px;
}
.users-table th,
.users-table td {
  overflow-wrap: anywhere;
}
.users-table td.table-actions {
  white-space: normal;
}
.jobs-table {
  width: 1265px;
  min-width: 1265px;
  table-layout: fixed;
}
.jobs-table .jobs-col-title {
  width: 190px;
}
.jobs-table .jobs-col-description {
  width: 360px;
}
.jobs-table .jobs-col-user {
  width: 130px;
}
.jobs-table .jobs-col-status {
  width: 130px;
}
.jobs-table .jobs-col-time {
  width: 145px;
}
.jobs-table .jobs-col-actions {
  width: 310px;
}
.jobs-table .jobs-description-col {
  white-space: normal;
  overflow-wrap: anywhere;
}
.jobs-title-link {
  color: inherit;
  text-decoration: none;
}
.jobs-title-link:hover,
.jobs-title-link:focus-visible {
  color: var(--navy2);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}
.jobs-table td.jobs-actions-col {
  white-space: nowrap;
}
.jobs-table .jobs-actions-col .mini-btn {
  min-height: 30px;
  padding-inline: 7px;
}
.jobs-table .jobs-actions-col form {
  display: inline-block;
}
.user-edit-dialog {
  width: min(720px, calc(100vw - 32px));
}
.user-edit-form {
  margin: 0;
}
.user-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 20px 20px;
}
.user-edit-wide {
  grid-column: 1/-1;
}
.user-edit-grid .field > span small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
@media (max-width: 820px) {
  .user-admin-page .section-heading {
    align-items: flex-start;
  }
  .user-admin-toolbar {
    width: 100%;
    justify-content: space-between;
  }
  .user-admin-toolbar .sort-links {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .user-edit-grid {
    grid-template-columns: 1fr;
  }
  .user-edit-wide {
    grid-column: auto;
  }
  .user-admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .user-admin-toolbar .sort-links {
    width: 100%;
  }
  .sort-direction {
    width: 100%;
    padding-left: 0;
    margin-left: 0;
    padding-top: 5px;
    border-left: 0;
    border-top: 1px solid #e3e8ef;
  }
  .list-actions {
    margin-top: 0;
  }
  .list-create-btn,
  .user-create-btn {
    width: auto;
  }
  .list-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  .pagination-summary {
    margin-left: 0;
  }
  .pagination-nav {
    justify-content: space-between;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px solid #e1e7ee;
  }
  .list-tabs {
    display: flex;
    width: 100%;
  }
  .list-tab {
    flex: 1;
  }
}
.user-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.user-detail-actions > .primary-btn,
.user-detail-actions > .secondary-btn {
  width: 100%;
  min-width: 0;
}
