:root {
  color-scheme: light;
  --page: #ede9de;
  --sidebar: #f7f5ef;
  --surface: #fffdf8;
  --surface-soft: #faf8f1;
  --line: #e5dfd1;
  --line-strong: #d6cebc;
  --text: #2b2921;
  --muted: #6c6759;
  --subtle: #a39d8d;
  --accent: #416b52;
  --accent-ink: #315640;
  --accent-soft: #e8f0e9;
  --amber: #a47b35;
  --amber-soft: #f1e8d7;
  --danger: #9b4c37;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 6px 22px rgba(40, 55, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  width: 236px;
  height: 100vh;
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand-block {
  min-height: 82px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: #15140f;
}

.brand-subtitle {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9f9989;
  white-space: nowrap;
}

.collapse-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  color: #8b8576;
  cursor: default;
}

.side-nav {
  padding: 18px 14px;
}

.nav-label,
.eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
}

.side-nav-button {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #605c50;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.side-nav-button:hover {
  background: #efeade;
}

.side-nav-button.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
  background: #cbc5b5;
}

.side-nav-button.active .nav-dot {
  background: var(--accent);
}

.side-footer {
  margin-top: auto;
  padding: 18px 14px;
  border-top: 1px solid var(--line);
}

.data-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #7a7568;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.data-version {
  margin-top: 7px;
  color: #aaa393;
  font-family: var(--mono);
  font-size: 11.5px;
}

.workspace {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.view-panel {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 46px 48px 80px;
}

.batch-view {
  max-width: 1240px;
}

.hidden {
  display: none !important;
}

.view-header {
  margin-bottom: 34px;
}

.view-header h1 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 400;
  line-height: 1.04;
  color: #1c1b15;
}

.view-header p {
  max-width: 570px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9a9485;
  font-size: 13px;
  font-weight: 700;
}

.step span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8e2d4;
  color: #9a9485;
  font-size: 12px;
}

.step.active {
  color: #1c1b15;
}

.step.active span {
  background: var(--accent);
  color: #fff;
}

.step-line {
  flex: 1;
  height: 1px;
  background: #ddd7c9;
}

.capture-card,
.batch-upload-panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.capture-card {
  padding: 26px 30px;
}

.field {
  display: block;
}

.field + .field {
  margin-top: 18px;
}

.field > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #4a463c;
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: 10px;
}

.register-meta {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8d8675;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.register-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid #ddd6c6;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input[type="text"] {
  height: 46px;
  padding: 0 15px;
}

textarea {
  min-height: 148px;
  padding: 15px;
  line-height: 1.55;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(65, 107, 82, 0.12);
}

.primary-button,
.secondary-button,
.dark-download,
.secondary-download,
.file-label {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 20px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(51, 97, 74, 0.28);
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button.is-busy,
.secondary-button.is-busy {
  gap: 10px;
}

.primary-button.is-busy::before,
.secondary-button.is-busy::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: loader-spin 0.8s linear infinite;
}

.secondary-button,
.secondary-download,
.file-label {
  border: 1px solid #d7d0c0;
  background: #fff;
  color: #5b6d58;
  cursor: pointer;
}

.secondary-button:hover,
.secondary-download:hover,
.file-label:hover {
  background: #f3efe5;
}

.dark-download {
  border: 1px solid #1c1b15;
  background: #1c1b15;
  color: #f6f3ec;
}

.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.form-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6c6759;
  font-size: 13.5px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.action-row {
  display: flex;
  gap: 10px;
}

.status-line {
  min-height: 20px;
  margin: 18px 0 0;
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.4;
}

.status-line.error {
  color: var(--danger);
}

.results-section {
  margin-top: 40px;
}

.result-title-row {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.result-title-row h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  color: #1c1b15;
}

.selected-badge {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.selected-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.results-grid {
  display: grid;
  gap: 22px;
}

.empty-state {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.empty-state div {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--text);
}

.empty-state p {
  margin: 8px 0 0;
}

.result-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  border: 1px solid #cdd8cf;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-main {
  padding: 36px 40px;
}

.match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.match-badge {
  height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.match-row .hierarchy {
  max-width: 420px;
  overflow: hidden;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 18px;
}

.code {
  color: #1c1b15;
  font-family: var(--mono);
  font-size: 35px;
  font-weight: 600;
}

.label {
  color: #2a2820;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
}

.reason-copy {
  max-width: 560px;
  margin-top: 16px;
}

.reason-copy p,
.warning-list {
  margin: 0 0 8px;
  color: #54503f;
  font-size: 14.5px;
  line-height: 1.62;
}

.warning-list {
  color: var(--danger);
}

.terms {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.term {
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.selected-action {
  min-height: 52px;
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 26px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.selected-action.secondary {
  border: 1px solid #d7d0c0;
  background: #fff;
  color: var(--accent-ink);
}

.selected-action:disabled {
  opacity: 1;
  cursor: default;
}

.confidence-panel {
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #e2e8e2;
  background: #f8faf7;
}

.confidence-ring {
  width: 126px;
  height: 126px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--accent) var(--value), #e6ebe5 0);
}

.confidence-ring.mittel {
  background: conic-gradient(var(--amber) var(--value), #eee8d8 0);
}

.confidence-ring.niedrig {
  background: conic-gradient(var(--danger) var(--value), #f0e3dd 0);
}

.confidence-ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: inherit;
  background: #f5f8f5;
}

.confidence-ring span {
  position: relative;
  color: var(--accent-ink);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.confidence-ring small {
  font-size: 17px;
}

.confidence-panel strong {
  margin-top: 16px;
  color: var(--accent-ink);
  font-size: 13px;
}

.confidence-panel > span {
  margin-top: 4px;
  color: #8a8576;
  font-size: 11.5px;
}

.confidence-details {
  width: 100%;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #dde3dc;
}

.confidence-details div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  font-size: 12.5px;
}

.confidence-details dt {
  color: #8a8576;
}

.confidence-details dd {
  margin: 0;
  color: #333029;
  font-weight: 800;
  text-align: right;
}

.alternative-section {
  display: grid;
  gap: 10px;
}

.alternative-section > h3 {
  margin: 10px 0 0;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.alternative-list {
  display: grid;
  gap: 14px;
}

.alternative-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 190px 108px;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.alternative-card.selected {
  border-color: #bfd1c4;
  box-shadow: 0 0 0 3px rgba(65, 107, 82, 0.08);
}

.alternative-code {
  color: #1c1b15;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
}

.alternative-copy h3 {
  margin: 0 0 7px;
  color: #2f2c24;
  font-size: 16px;
  line-height: 1.25;
}

.alternative-copy p {
  max-width: 620px;
  margin: 0;
  color: #777061;
  font-size: 14px;
  line-height: 1.48;
}

.alternative-copy small {
  display: block;
  margin-top: 8px;
  color: #978f7b;
  font-size: 12px;
}

.alternative-confidence {
  min-width: 0;
}

.alternative-confidence > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alternative-confidence em {
  color: #938b7b;
  font-size: 12px;
  font-style: normal;
}

.alternative-confidence .confidence-bar {
  width: 120px;
  background: #e7e1d2;
  overflow: hidden;
}

.alternative-confidence .confidence-bar::before {
  content: "";
  display: block;
  width: var(--confidence-width);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.alternative-confidence .confidence-bar.mittel::before {
  background: var(--amber);
}

.alternative-confidence .confidence-bar.niedrig::before {
  background: var(--danger);
}

.choose-button {
  min-height: 46px;
  border: 1px solid #d7d0c0;
  border-radius: 12px;
  background: #fff;
  color: #4b5d4b;
  font-weight: 800;
  cursor: pointer;
}

.choose-button.selected {
  background: var(--accent);
  color: #fff;
}

.choose-button:disabled {
  cursor: default;
}

.manual-override {
  padding: 24px 28px;
  border: 1px dashed #cfc6b5;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.52);
}

.manual-override h3 {
  margin: 0 0 4px;
  color: #3f3b32;
  font-size: 16px;
}

.manual-override p {
  margin: 0 0 16px;
  color: #8b8576;
  font-size: 14px;
}

.manual-override input {
  width: min(640px, 100%);
  height: 52px;
  border: 1px solid #d4ccbc;
  border-radius: 12px;
  padding: 0 18px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.batch-upload-panel {
  padding: 22px 24px;
  margin-bottom: 26px;
}

.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.batch-controls,
.export-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.file-control {
  height: 50px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 18px;
  border: 1px dashed #c8c0ad;
  border-radius: 13px;
  background: var(--surface-soft);
}

.file-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #54503f;
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-label {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
}

.batch-progress {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.batch-progress progress {
  width: 180px;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8e2d4;
}

.batch-progress progress::-webkit-progress-bar {
  background: #e8e2d4;
}

.batch-progress progress::-webkit-progress-value {
  background: var(--accent);
}

.batch-progress.is-running progress {
  background:
    linear-gradient(90deg, rgba(65, 107, 82, 0), rgba(65, 107, 82, 0.2), rgba(65, 107, 82, 0)),
    #e8e2d4;
  background-size: 220% 100%;
  animation: loader-shimmer 1.2s linear infinite;
}

.batch-loader {
  margin-top: 16px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid #d8e3d8;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.loader-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 2px solid rgba(65, 107, 82, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loader-spin 0.9s linear infinite;
}

.loader-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0.18;
  animation: loader-pulse 1.1s ease-in-out infinite;
}

.loader-mark.compact {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.loader-mark.compact::after {
  inset: 7px;
}

.batch-loader-copy {
  display: grid;
  gap: 3px;
}

.batch-loader-copy strong {
  font-size: 13.5px;
}

.batch-loader-copy span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.batch-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 76px;
  padding: 15px 17px;
  border: 1px solid #ece6d6;
  border-radius: 13px;
  background: var(--surface-soft);
}

.stat-card span {
  display: block;
  color: #908a7b;
  font-size: 11.5px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  color: #1c1b15;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.stat-card.success strong {
  color: var(--accent-ink);
}

.stat-card.warning strong {
  color: #9b694c;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

#batchTable {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
}

#batchTable th {
  padding: 16px 18px;
  color: #a39d8d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

#batchTable td {
  padding: 18px;
  color: #595447;
  font-size: 13.5px;
  line-height: 1.38;
  vertical-align: top;
  border-bottom: 1px solid #eee8db;
}

#batchTable th:nth-child(1),
#batchTable td:nth-child(1) {
  width: 14%;
}

#batchTable th:nth-child(2),
#batchTable td:nth-child(2) {
  width: 110px;
  white-space: nowrap;
}

#batchTable th:nth-child(3),
#batchTable td:nth-child(3) {
  width: 39%;
}

#batchTable th:nth-child(4),
#batchTable td:nth-child(4) {
  width: 24%;
}

#batchTable th:nth-child(5),
#batchTable td:nth-child(5) {
  width: 150px;
}

#batchTable tbody tr:hover {
  background: #fbfaf5;
}

#batchTable tbody.is-loading tr:hover {
  background: transparent;
}

.row-company {
  display: block;
  color: #343127;
  font-weight: 800;
}

.row-court {
  display: block;
  margin-top: 5px;
  color: #8b8576;
  font-size: 11.5px;
}

.mono-cell {
  color: var(--accent-ink) !important;
  font-family: var(--mono);
  white-space: nowrap;
}

.wz-stack {
  display: grid;
  gap: 8px;
}

.wz-stack strong {
  color: #4b473b;
}

.wz-chip,
.wz-stack small span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.wz-stack small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wz-stack small span {
  background: #eee9dc;
  color: #8a8374;
  letter-spacing: 0;
  text-transform: none;
}

.confidence-text {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.confidence-text.hoch {
  color: var(--accent-ink);
}

.confidence-text.mittel {
  color: var(--amber);
}

.confidence-text.niedrig {
  color: var(--danger);
}

.confidence-bar {
  display: block;
  width: 132px;
  max-width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.confidence-bar.mittel {
  background: var(--amber);
}

.confidence-bar.niedrig {
  background: var(--danger);
}

.table-empty {
  padding: 36px !important;
  text-align: center !important;
  color: var(--muted) !important;
}

.skeleton-status-row td {
  padding: 18px 18px 8px !important;
  border-bottom: 0 !important;
}

.table-loader {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.skeleton-row td {
  padding-block: 16px !important;
}

.table-skeleton {
  display: block;
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 253, 248, 0.84), rgba(255, 255, 255, 0)),
    #e8e2d4;
  background-size: 280% 100%;
  animation: skeleton-shimmer 2.35s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.skeleton-company {
  width: min(160px, 88%);
  height: 16px;
}

.skeleton-court {
  width: min(118px, 70%);
  height: 10px;
  margin-top: 9px;
}

.skeleton-hr {
  width: 74px;
  height: 14px;
}

.skeleton-subject {
  width: 96%;
}

.skeleton-subject.short {
  width: 66%;
  margin-top: 9px;
}

.skeleton-wz {
  width: 70px;
  height: 22px;
  border-radius: 7px;
}

.skeleton-label {
  width: 76%;
  margin-top: 9px;
}

.skeleton-confidence {
  width: 62px;
  height: 13px;
}

.skeleton-bar {
  width: 112px;
  max-width: 100%;
  height: 5px;
  margin-top: 10px;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loader-pulse {
  0%,
  100% {
    transform: scale(0.75);
    opacity: 0.12;
  }

  50% {
    transform: scale(1);
    opacity: 0.28;
  }
}

@keyframes loader-shimmer {
  from {
    background-position: 220% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes skeleton-shimmer {
  from {
    background-position: 180% 0;
  }

  to {
    background-position: -80% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button.is-busy::before,
  .secondary-button.is-busy::before,
  .batch-progress.is-running progress,
  .table-skeleton,
  .loader-mark,
  .loader-mark::after {
    animation: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-basis: auto;
  }

  .brand-block {
    min-height: auto;
    padding: 18px;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 18px 18px;
  }

  .nav-label,
  .side-footer {
    display: none;
  }

  .side-nav-button {
    margin: 0;
  }

  .workspace {
    height: auto;
    overflow: visible;
  }

  .view-panel {
    padding: 32px 18px 56px;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .confidence-panel {
    border-top: 1px solid #e2e8e2;
    border-left: 0;
  }

  .alternative-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .alternative-confidence,
  .choose-button {
    grid-column: 2;
  }

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

@media (max-width: 680px) {
  .view-header h1 {
    font-size: 32px;
  }

  .stepper {
    align-items: flex-start;
  }

  .step-line,
  .step:nth-child(3) {
    display: none;
  }

  .capture-card,
  .batch-upload-panel {
    padding: 20px;
  }

  .input-row,
  .form-footer,
  .action-row,
  .batch-toolbar,
  .batch-controls,
  .export-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .dark-download,
  .secondary-download,
  .selected-action,
  .choose-button {
    width: 100%;
  }

  .result-main,
  .confidence-panel {
    padding: 24px 22px;
  }

  .code {
    font-size: 28px;
  }

  .label {
    font-size: 22px;
  }

  .alternative-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .alternative-confidence,
  .choose-button {
    grid-column: auto;
  }

  .file-control {
    min-width: 0;
    width: 100%;
  }

  .batch-stats {
    grid-template-columns: 1fr;
  }

  #batchTable {
    min-width: 840px;
  }
}
