html {
  font-size: 15px;
  min-height: 100%;
}

body {
  background: #eef3f1;
  color: #1c2733;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
}

body > .container {
  flex: 1 0 auto;
}

.container {
  max-width: 1240px;
}

.navbar {
  background: #101417;
  border-bottom: 4px solid #ffc400;
  min-height: 66px;
}

.navbar-brand {
  color: #ffffff;
  font-weight: 700;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: #ffffff;
}

.app-brand-mini {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.app-brand-mini img {
  background: #ffc400;
  border-radius: 6px;
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.nav-link {
  color: #dfe7e3;
  font-weight: 650;
}

.nav-link:hover,
.nav-link:focus {
  color: #ffc400;
}

.nav-user {
  align-items: center;
  color: #ffc400;
  display: inline-flex;
  font-weight: 800;
  padding: 0 10px;
}

.review-shell {
  display: grid;
  gap: 14px;
  padding: 14px 0 26px;
}

.review-header,
.panel,
.status-bar,
.warning-panel {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
}

.review-header {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255, 196, 0, 0.18), rgba(10, 113, 68, 0.08)),
    #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 1fr) minmax(390px, 520px);
  padding: 14px 18px;
}

.brand-hero {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 64px 1fr;
}

.brand-hero img {
  background: #ffc400;
  border: 1px solid #d8a800;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(16, 20, 23, 0.12);
  height: 64px;
  object-fit: contain;
  padding: 4px;
  width: 64px;
}

.process-steps {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.process-steps span {
  background: rgba(10, 113, 68, 0.1);
  border: 1px solid rgba(10, 113, 68, 0.18);
  border-radius: 999px;
  color: #0a7144;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 8px;
}

.eyebrow {
  color: #0a7144;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 1.55rem;
  line-height: 1.2;
}

h2 {
  font-size: 0.98rem;
}

.muted,
.empty {
  color: #667483;
  margin: 6px 0 0;
}

.upload-strip {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.upload-strip .file-picker {
  flex: 1 1 240px;
}

.file-picker {
  display: grid;
  gap: 6px;
}

.file-picker span,
.label,
.amount-words span {
  color: #667483;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.file-picker input {
  background: #f8fafc;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px;
  width: 100%;
}

button {
  background: #0a7144;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button:hover,
button:focus {
  background: #075c38;
}

.run-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
}

.secondary-link {
  align-items: center;
  background: #eef3f1;
  border: 1px solid #cfdcd6;
  border-radius: 6px;
  color: #1c2733;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover,
.secondary-link:focus {
  background: #dde9e4;
  color: #101417;
}

.button-spinner {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: none;
  height: 16px;
  width: 16px;
}

body.is-loading .button-spinner {
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

body.is-loading .run-button {
  opacity: 0.82;
}

.loading-overlay {
  align-items: center;
  background: rgba(16, 20, 23, 0.58);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 20, 23, 0.28);
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 280px;
  padding: 26px;
  text-align: center;
}

.loading-card img {
  background: #ffc400;
  border-radius: 8px;
  height: 58px;
  object-fit: contain;
  width: 58px;
}

.loading-card span {
  color: #667483;
}

.loader-ring {
  animation: spin 0.85s linear infinite;
  border: 4px solid #e5ece8;
  border-top-color: #0a7144;
  border-radius: 50%;
  height: 42px;
  width: 42px;
}

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

.alert {
  background: #fff0f0;
  border: 1px solid #e5b0b0;
  border-radius: 7px;
  color: #842222;
  padding: 10px 12px;
}

.status-bar {
  display: grid;
  gap: 1px;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.6fr 0.8fr 1.3fr auto;
  overflow: hidden;
}

.status-bar > div {
  background: #ffffff;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.status-bar strong {
  overflow-wrap: anywhere;
}

.status-action {
  align-content: center;
}

.ok {
  color: #0b6b43;
}

.warn {
  color: #9a5b00;
}

.status-pill,
.confidence-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.88rem;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}

.status-pill {
  background: #101417;
  color: #ffc400;
}

.confidence-pill {
  background: #e8f5ee;
  color: #0a7144;
}

.party-grid,
.review-grid,
.debug-grid {
  display: grid;
  gap: 14px;
}

.party-grid {
  grid-template-columns: 1fr 1fr;
}

.review-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 304px;
}

.debug-grid {
  grid-template-columns: 1.05fr 0.9fr 1.05fr;
}

.panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.panel-title {
  align-items: center;
  border-bottom: 1px solid #e4e9ef;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.panel-title span {
  color: #667483;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.party-name {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.party-grid p {
  color: #526170;
  margin: 0;
  min-height: 18px;
}

.warning-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.warning-panel span {
  background: #fff8e5;
  border: 1px solid #e8c66e;
  border-radius: 999px;
  color: #604700;
  font-size: 0.86rem;
  padding: 5px 10px;
}

.items-panel {
  padding: 0;
}

.items-panel .panel-title {
  margin: 0 14px;
  padding-top: 14px;
}

.table-wrap {
  overflow: auto;
}

.items-table {
  border-collapse: collapse;
  font-size: 0.91rem;
  min-width: 820px;
  width: 100%;
}

.items-table th,
.items-table td {
  border-bottom: 1px solid #e5eaf0;
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.items-table th {
  background: #f4f7f5;
  color: #435160;
  font-size: 0.76rem;
  font-weight: 800;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.items-table tbody tr:hover {
  background: #f8fbfd;
}

.item-name {
  font-weight: 700;
  min-width: 260px;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  white-space: nowrap;
}

.strong {
  font-weight: 800;
}

.totals-panel {
  position: sticky;
  top: 12px;
}

.totals-list,
.file-meta {
  display: grid;
  gap: 0;
  margin: 0;
}

.totals-list {
  border: 1px solid #e4e9ef;
  border-radius: 7px;
  overflow: hidden;
}

.totals-list dt,
.totals-list dd,
.file-meta dt,
.file-meta dd {
  margin: 0;
  padding: 8px 10px;
}

.totals-list dt,
.file-meta dt {
  color: #5a6877;
  font-weight: 700;
}

.totals-list dd {
  border-bottom: 1px solid #e4e9ef;
  font-size: 1rem;
  font-weight: 800;
  text-align: right;
}

.totals-list dt {
  background: #f7f9fb;
}

.totals-list dt:last-of-type,
.totals-list dd:last-of-type {
  border-bottom: 0;
}

.amount-words {
  background: #f5faf9;
  border: 1px solid #cde3df;
  border-radius: 7px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.amount-words strong {
  line-height: 1.35;
}

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

.file-meta dd {
  color: #1c2733;
  font-weight: 700;
}

details.panel {
  align-content: start;
  max-height: 520px;
  overflow: auto;
}

summary {
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

pre {
  background: #111923;
  border-radius: 6px;
  color: #dce9f3;
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
  max-height: 430px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-rainbow {
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.06), rgba(10, 113, 68, 0.06)),
    #111923;
}

.json-key {
  color: #7dd3fc;
}

.json-string {
  color: #fde68a;
}

.json-number {
  color: #86efac;
}

.json-boolean {
  color: #f0abfc;
}

.json-null {
  color: #fb7185;
}

.debug-panel summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.debug-panel summary::after {
  background: #eef3f1;
  border: 1px solid #d3ded9;
  border-radius: 999px;
  color: #526170;
  content: "debug";
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  text-transform: uppercase;
}

.review-tabs {
  display: grid;
  gap: 14px;
}

.review-tabs > input {
  display: none;
}

.tab-list {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab-list label {
  align-items: center;
  border-radius: 8px;
  color: #435160;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
}

.tab-list label:hover {
  background: #f4f7f5;
}

.tab-icon {
  display: inline-block;
  font-weight: 900;
  margin-right: 6px;
  min-width: 22px;
}

#tab-overview:checked ~ .tab-list label[for="tab-overview"],
#tab-items:checked ~ .tab-list label[for="tab-items"],
#tab-mapped:checked ~ .tab-list label[for="tab-mapped"],
#tab-ocr:checked ~ .tab-list label[for="tab-ocr"],
#tab-raw:checked ~ .tab-list label[for="tab-raw"] {
  background: #101417;
  color: #ffc400;
}

.tab-panels {
  display: grid;
}

.tab-panel {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
  display: none;
  min-height: 560px;
  min-width: 0;
  padding: 14px;
}

#tab-overview:checked ~ .tab-panels .tab-panel:nth-child(1),
#tab-items:checked ~ .tab-panels .tab-panel:nth-child(2),
#tab-mapped:checked ~ .tab-panels .tab-panel:nth-child(3),
#tab-ocr:checked ~ .tab-panels .tab-panel:nth-child(4),
#tab-raw:checked ~ .tab-panels .tab-panel:nth-child(5) {
  display: grid;
}

.overview-panel {
  gap: 14px;
}

.overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 304px;
}

.seller-card,
.buyer-card {
  min-height: 126px;
}

.totals-panel {
  grid-row: span 2;
}

.metrics-card {
  align-items: stretch;
  grid-column: span 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics-card > div {
  background: #f7faf8;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 84px;
  padding: 12px;
}

.metrics-card strong {
  font-size: 1.05rem;
}

.item-preview {
  padding: 0;
}

.item-preview .panel-title {
  margin: 0 14px;
  padding-top: 14px;
}

.compact-table {
  min-width: 760px;
}

.full-table-panel,
.code-panel,
.ocr-panel {
  align-content: start;
  gap: 12px;
}

.panel-title-bar {
  border-bottom: 1px solid #dfe8e4;
  margin: 0;
  padding: 0 0 12px;
}

.full-table-wrap {
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  max-height: 68vh;
}

.full-items-table {
  min-width: 1080px;
}

.copy-button {
  background: #ffc400;
  color: #101417;
  min-height: 32px;
  padding: 0 12px;
}

.copy-button:hover,
.copy-button:focus {
  background: #e2ad00;
}

.secondary-button {
  background: #eef3f1;
  border: 1px solid #cfdcd6;
  color: #1c2733;
  min-height: 32px;
  padding: 0 12px;
}

.secondary-button:hover,
.secondary-button:focus {
  background: #dde9e4;
}

.panel-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel-actions span {
  white-space: nowrap;
}

.download-menu {
  position: relative;
}

.download-options {
  background: #ffffff;
  border: 1px solid #cfdcd6;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 20, 23, 0.14);
  display: none;
  min-width: 156px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.download-menu:hover .download-options,
.download-menu:focus-within .download-options {
  display: grid;
  gap: 4px;
}

.download-options button {
  background: transparent;
  border-radius: 6px;
  color: #1c2733;
  font-weight: 700;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  text-align: left;
}

.download-options button:hover,
.download-options button:focus {
  background: #eef3f1;
}

.close-focus,
.focus-panel .close-focus {
  display: none !important;
}

body.focus-active {
  overflow: hidden;
}

.focus-panel.is-focused {
  border-radius: 0;
  bottom: 0;
  display: grid !important;
  left: 0;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 40;
}

.focus-panel.is-focused .close-focus {
  display: inline-flex !important;
}

.focus-panel.is-focused .panel-title-bar {
  align-items: center;
}

.focus-panel.is-focused .code-view,
.focus-panel.is-focused .full-ocr-lines,
.focus-panel.is-focused .full-table-wrap {
  max-height: calc(100vh - 86px);
  min-height: calc(100vh - 86px);
}

.code-view {
  font-size: 0.92rem;
  line-height: 1.55;
  max-height: 72vh;
  min-height: 520px;
}

.full-ocr-lines {
  max-height: 72vh;
}

.full-ocr-lines div {
  grid-template-columns: minmax(0, 1fr) 86px;
  padding: 11px 12px;
}

.full-ocr-lines strong {
  font-size: 0.96rem;
}

.ocr-lines {
  border: 1px solid #e4e9ef;
  border-radius: 7px;
  display: grid;
  max-height: 430px;
  overflow: auto;
}

.ocr-lines div {
  align-items: start;
  border-bottom: 1px solid #edf1f5;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 58px;
  padding: 8px 10px;
}

.ocr-lines div:last-child {
  border-bottom: 0;
}

.ocr-lines strong {
  overflow-wrap: anywhere;
}

.ocr-lines span {
  color: #667483;
  font-size: 0.82rem;
  text-align: right;
}

.empty-state {
  min-height: 180px;
  place-content: center;
  text-align: center;
}

.metrics-card {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.success-metric {
  background: #ecfdf3 !important;
  border-color: #bfe9cd !important;
}

.icon-button {
  align-items: center;
  background: #eef3f1;
  border: 1px solid #cfdcd6;
  border-radius: 7px;
  color: #1c2733;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 900;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  width: 36px;
}

.icon-button:hover,
.icon-button:focus {
  background: #dde9e4;
}

.panel-search {
  border: 1px solid #cfdcd6;
  border-radius: 7px;
  min-height: 32px;
  min-width: 210px;
  padding: 0 10px;
}

.line-code {
  padding: 0;
}

.download-source {
  display: none;
}

.template-header {
  grid-template-columns: minmax(320px, 1fr) auto;
}

.template-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.template-summary-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.template-summary-grid,
.template-card,
.teach-panel {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
}

.template-summary-grid > div {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.template-summary-grid strong {
  font-size: 1.15rem;
}

.template-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.format-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.format-card {
  background: #f9fbfa;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.format-card-top {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.format-card h3 {
  font-size: 1.02rem;
  margin: 5px 0 0;
}

.format-card p {
  color: #4c5a66;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.format-card strong {
  background: #e9f7ef;
  border-radius: 999px;
  color: #087345;
  flex: 0 0 auto;
  font-size: 0.8rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-row span {
  background: #ffffff;
  border: 1px solid #dce8e2;
  border-radius: 999px;
  color: #344454;
  font-size: 0.74rem;
  font-weight: 850;
  padding: 5px 8px;
}

.template-teacher-page {
  display: grid;
  gap: 16px;
}

.teacher-hero {
  align-items: center;
  background: linear-gradient(90deg, #fff7d8, #f5fbf8 64%, #ffffff);
  border: 1px solid #d4e3dc;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 0.6fr) minmax(0, 1.4fr);
  padding: 20px;
}

.teacher-hero h1 {
  font-size: 1.65rem;
  margin: 4px 0 6px;
}

.teacher-hero-actions,
.teacher-form,
.teacher-basic-grid,
.teacher-field-grid,
.teacher-section,
.teacher-review-section,
.teacher-save-card {
  display: grid;
  gap: 12px;
}

.teacher-command-panel {
  align-items: center;
  background: #101719;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(250px, 0.75fr) minmax(320px, 1.2fr) minmax(190px, 0.45fr);
  padding: 14px;
}

.teacher-sample-summary,
.teacher-active-target {
  display: grid;
  gap: 3px;
}

.teacher-sample-summary span,
.teacher-active-target span {
  color: #ffc400;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-sample-summary strong,
.teacher-active-target strong {
  overflow-wrap: anywhere;
}

.teacher-sample-summary small {
  color: #bed0c7;
  font-weight: 700;
}

.teacher-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-step-chip {
  background: #223033;
  border: 1px solid #35494c;
  border-radius: 999px;
  color: #dbe8e2;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 8px 10px;
}

.teacher-step-chip.active {
  background: #ffc400;
  border-color: #ffc400;
  color: #101719;
}

.teacher-active-target {
  background: #332f10;
  border: 1px solid #8b7416;
  border-radius: 8px;
  padding: 10px 12px;
}

.teacher-workbench {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 0.92fr) minmax(440px, 1.08fr);
}

.teacher-sample-pane,
.teacher-mapping-pane,
.teacher-json-dock {
  background: #ffffff;
  border: 1px solid #d4e3dc;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
}

.teacher-sample-pane {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 150px);
  overflow: hidden;
  padding: 14px;
  position: sticky;
  top: 12px;
}

.teacher-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-filter {
  background: #f3f8f5;
  border: 1px solid #d8e5df;
  border-radius: 999px;
  color: #344454;
  cursor: pointer;
  font-weight: 900;
  min-height: 32px;
  padding: 0 12px;
}

.teacher-filter.active {
  background: #101719;
  border-color: #101719;
  color: #ffc400;
}

.teacher-selected-line {
  background: #fff8e5;
  border: 1px solid #ecd17a;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 11px;
}

.teacher-selected-line span,
.teacher-section-head span,
.teacher-field-card > span,
.teacher-basic-grid span,
.teacher-column-preview span,
.teacher-save-card strong {
  color: #667483;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-selected-line strong {
  overflow-wrap: anywhere;
}

.teacher-ocr-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 4px;
}

.teacher-ocr-line {
  align-items: center;
  background: #fbfdfc;
  border: 1px solid #e0eae5;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 70px minmax(0, 1fr) 56px;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
}

.teacher-ocr-line:hover,
.teacher-ocr-line.selected {
  background: #eef8f2;
  border-color: #1b9158;
}

.teacher-ocr-line strong {
  color: #071d2d;
  overflow-wrap: anywhere;
}

.teacher-ocr-line small {
  background: #e4f3ec;
  border-radius: 999px;
  color: #067344;
  font-weight: 900;
  justify-self: end;
  padding: 5px 8px;
}

.line-zone {
  background: #edf3f0;
  border-radius: 999px;
  color: #5e6e79;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 5px 8px;
  text-align: center;
  text-transform: uppercase;
}

.teacher-mapping-pane {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.teacher-section {
  border: 1px solid #dce8e2;
  border-radius: 8px;
  padding: 14px;
  scroll-margin-top: 16px;
}

.teacher-section-head {
  align-items: start;
  border-bottom: 1px solid #e3ece8;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 11px;
}

.teacher-section-head h2 {
  font-size: 1.1rem;
  margin: 3px 0 0;
}

.teacher-basic-grid,
.teacher-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-basic-grid label,
.advanced-mapper label {
  display: grid;
  gap: 7px;
}

.teacher-basic-grid input,
.teacher-basic-grid select,
.teacher-field-card input,
.advanced-mapper input,
.advanced-mapper textarea {
  background: #ffffff;
  border: 1px solid #cbd9d3;
  border-radius: 7px;
  color: #1b2833;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.teacher-hint-box,
.teacher-column-preview {
  background: #effaf4;
  border: 1px solid #c5ead6;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 11px;
}

.teacher-hint-box strong {
  color: #0b7849;
}

.teacher-hint-box span,
.teacher-save-card span {
  color: #44545f;
  font-weight: 700;
}

.teacher-field-card {
  border: 1px solid #d9e6e0;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.teacher-field-card.active {
  border-color: #ffc400;
  box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.16);
}

.teacher-field-card.is-filled {
  background: #f2fbf6;
  border-color: #9ed8b9;
}

.pick-button {
  background: #101719;
  border: 1px solid #101719;
  border-radius: 7px;
  color: #ffc400;
  cursor: pointer;
  font-weight: 900;
  min-height: 38px;
}

.pick-button.active {
  background: #ffc400;
  border-color: #ffc400;
  color: #101719;
}

.teacher-table-presets {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.teacher-preset-card {
  background: #fbfdfc;
  border: 1px solid #d8e5df;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 84px;
  padding: 13px;
  text-align: left;
}

.teacher-preset-card.selected,
.teacher-preset-card:hover {
  background: #fff8dd;
  border-color: #ffc400;
}

.teacher-preset-card span {
  color: #667483;
  font-weight: 800;
}

.teacher-save-card {
  background: #f8fbfa;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  padding: 14px;
}

.advanced-mapper {
  border-top: 1px solid #e1ebe6;
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.advanced-mapper summary,
.teacher-json-dock summary {
  cursor: pointer;
  font-weight: 900;
}

.teacher-json-dock {
  padding: 14px;
}

.teacher-empty-state {
  align-content: center;
  display: grid;
  gap: 12px;
  min-height: 280px;
}

.template-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.template-card-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.template-card h2 {
  font-size: 1.1rem;
  margin-top: 10px;
}

.template-facts {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
}

.template-facts div {
  background: #f7faf9;
  border: 1px solid #e2ebe7;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.template-facts dt {
  color: #667483;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.template-facts dd {
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.match-token-list,
.teach-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-token-list span,
.teach-flow span {
  background: #eef8f2;
  border: 1px solid #c9ead8;
  border-radius: 999px;
  color: #0a7144;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 9px;
}

.teach-panel {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  padding: 18px;
}

.compact-link {
  min-height: 30px;
  padding: 0 10px;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions form,
.template-actions form {
  margin: 0;
}

.danger-link {
  align-items: center;
  background: #fff3f0;
  border: 1px solid #f1b4aa;
  border-radius: 7px;
  color: #9f2417;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

.danger-link:hover {
  background: #ffe5df;
  color: #7d180f;
}

.empty-state-panel {
  align-content: center;
  border: 1px dashed #c9d9d2;
  border-radius: 8px;
  display: grid;
  justify-items: start;
  min-height: 260px;
  padding: 24px;
}

.unmapped-detail {
  display: grid;
  gap: 14px;
}

.detail-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.detail-grid > div {
  background: #f7faf9;
  border: 1px solid #e2ebe7;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.unmapped-lines {
  border: 1px solid #dbe5e0;
  border-radius: 7px;
  max-height: 440px;
  overflow: auto;
}

.unmapped-lines > div {
  align-items: center;
  border-bottom: 1px solid #e7efeb;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 92px;
  padding: 9px 10px;
}

.unmapped-lines > div:last-child {
  border-bottom: 0;
}

.unmapped-lines span {
  background: #e8f5ee;
  border-radius: 999px;
  color: #0a7144;
  font-weight: 900;
  padding: 5px 8px;
  text-align: center;
}

.unmapped-table td:first-child {
  font-weight: 800;
}

.login-shell {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  min-height: calc(100vh - 120px);
  padding: 26px 0;
}

.login-brand,
.login-card,
.admin-hero,
.admin-metrics article,
.admin-menu-grid a {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
}

.login-brand {
  align-content: center;
  background:
    linear-gradient(130deg, rgba(255, 196, 0, 0.22), rgba(10, 113, 68, 0.12)),
    #ffffff;
  display: grid;
  padding: 34px;
}

.login-brand img {
  background: #ffc400;
  border: 1px solid #d8a800;
  border-radius: 12px;
  height: 92px;
  margin-bottom: 18px;
  object-fit: contain;
  padding: 6px;
  width: 92px;
}

.login-brand h1 {
  font-size: 2rem;
}

.login-card {
  align-content: center;
  display: grid;
  gap: 16px;
  padding: 28px;
}

.login-card label {
  display: grid;
  gap: 6px;
}

.login-card label span {
  color: #667483;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-card input {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 10px;
}

.admin-page {
  display: grid;
  gap: 14px;
  padding: 14px 0 26px;
}

.admin-hero {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255, 196, 0, 0.18), rgba(10, 113, 68, 0.08)),
    #ffffff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.admin-metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}

.admin-metrics article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

.admin-metrics strong {
  color: #101417;
  font-size: 1.5rem;
}

.admin-metrics p {
  color: #667483;
  margin: 0;
}

.admin-menu-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-menu-grid a {
  color: #1c2733;
  display: grid;
  gap: 8px;
  padding: 16px;
  text-decoration: none;
}

.admin-menu-grid a:hover,
.admin-menu-grid a:focus {
  border-color: #ffc400;
  box-shadow: 0 10px 24px rgba(16, 20, 23, 0.1);
}

.admin-menu-grid span {
  color: #0a7144;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-menu-grid strong {
  font-size: 1rem;
}

.builder-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
}

.builder-document,
.builder-form,
.builder-preview {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.builder-document {
  align-content: start;
}

.builder-lines {
  max-height: 680px;
}

.builder-form label {
  display: grid;
  gap: 6px;
}

.builder-form label span {
  color: #667483;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.builder-form input,
.builder-form select,
.builder-form textarea {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.builder-form textarea,
.json-preview {
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

.builder-two,
.builder-three {
  display: grid;
  gap: 10px;
}

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

.builder-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-preview {
  grid-column: 1 / -1;
}

.json-preview {
  background: #10191b;
  border: 0;
  border-radius: 7px;
  color: #d9f6ff;
  min-height: 420px;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.mapper-page {
  gap: 16px;
}

.mapper-hero {
  align-items: center;
}

.mapper-workspace {
  display: grid;
  gap: 14px;
}

.mapper-steps {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(16, 20, 23, 0.06);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.mapper-step {
  align-items: center;
  background: #f8fbfa;
  color: #1c2733;
  display: grid;
  gap: 2px 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 72px;
  padding: 12px;
  text-decoration: none;
}

.mapper-step span {
  align-items: center;
  background: #e8f5ee;
  border: 1px solid #bde2cf;
  border-radius: 999px;
  color: #0a7144;
  display: inline-flex;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.mapper-step strong,
.mapper-step small {
  min-width: 0;
}

.mapper-step small {
  color: #667483;
  grid-column: 2;
}

.mapper-step.active {
  background: #101417;
  color: #ffc400;
}

.mapper-step.active span {
  background: #ffc400;
  border-color: #ffc400;
  color: #101417;
}

.mapper-step.active small {
  color: #d7dde2;
}

.mapper-start-panel {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255, 196, 0, 0.12), rgba(10, 113, 68, 0.07)),
    #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px;
}

.mapper-start-panel h2 {
  font-size: 1.18rem;
}

.mapper-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.mapper-document-panel,
.mapper-control-panel {
  align-content: start;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.mapper-detail-grid {
  grid-template-columns: repeat(2, 1fr);
}

.selected-ocr-bar {
  align-items: center;
  background: #fff8e5;
  border: 1px solid #edd47a;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.selected-ocr-bar span {
  color: #7d650f;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-ocr-bar strong {
  color: #101417;
  overflow-wrap: anywhere;
}

.mapper-lines {
  display: grid;
  gap: 0;
  max-height: 720px;
}

.ocr-line-button {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e7efeb;
  color: #051a2c;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 92px;
  min-height: 48px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.ocr-line-button:hover,
.ocr-line-button:focus {
  background: #f5fbf8;
  outline: 2px solid #bde2cf;
  outline-offset: -2px;
}

.ocr-line-button.selected {
  background: #fff4c7;
  outline: 2px solid #ffc400;
  outline-offset: -2px;
}

.ocr-line-button span {
  background: #e8f5ee;
  border-radius: 999px;
  color: #0a7144;
  font-weight: 900;
  padding: 5px 8px;
  text-align: center;
}

.friendly-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friendly-form-grid label,
.advanced-mapper label {
  display: grid;
  gap: 6px;
}

.friendly-form-grid label span,
.advanced-mapper label span {
  color: #667483;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.friendly-form-grid input,
.friendly-form-grid select,
.advanced-mapper input,
.advanced-mapper select,
.advanced-mapper textarea {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.mapper-section {
  border-top: 1px solid #e3ebe7;
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.mapper-section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.mapper-section-head h3 {
  font-size: 1.05rem;
}

.field-map-grid,
.preset-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-map-card,
.preset-card {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  color: #1c2733;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 12px;
  text-align: left;
}

.field-map-card:hover,
.field-map-card:focus,
.preset-card:hover,
.preset-card:focus {
  border-color: #ffc400;
  box-shadow: 0 8px 18px rgba(16, 20, 23, 0.08);
  outline: 0;
}

.field-map-card.mapped,
.preset-card.selected {
  background: #eef8f2;
  border-color: #0a7144;
}

.field-map-card span,
.preset-card span {
  color: #667483;
  font-size: 0.86rem;
  line-height: 1.35;
}

.mapping-summary {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.mapping-summary > div {
  background: #f7faf9;
  border: 1px solid #e2ebe7;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.mapping-summary span {
  color: #667483;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mapping-summary strong {
  overflow-wrap: anywhere;
}

.advanced-mapper {
  border-top: 1px solid #e3ebe7;
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.advanced-mapper summary {
  cursor: pointer;
  font-weight: 900;
}

.advanced-mapper[open] summary {
  margin-bottom: 12px;
}

.mapper-preview {
  display: grid;
  gap: 14px;
}

.form-mapper-workspace {
  display: grid;
  gap: 14px;
}

.form-mapper-help {
  align-items: center;
  background: #101417;
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 16px;
}

.not-invoice-panel {
  align-items: center;
  background: #fff7e8;
  border: 1px solid #e8c36a;
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px;
}

.not-invoice-panel.is-dismissed {
  display: none;
}

.not-invoice-panel h2 {
  font-size: 1.2rem;
}

.not-invoice-panel p {
  color: #6d5a20;
  margin: 4px 0 0;
}

.form-mapper-help > div:first-child {
  display: grid;
  gap: 4px;
}

.form-mapper-help span {
  color: #d7dde2;
}

.active-pick-box {
  background: rgba(255, 196, 0, 0.14);
  border: 1px solid rgba(255, 196, 0, 0.42);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-width: 210px;
  padding: 10px 12px;
}

.active-pick-box span {
  color: #ffc400;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.simple-step-tabs {
  background: #ffffff;
  border: 1px solid #d3ded9;
  border-radius: 8px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.simple-step-button {
  background: #f8fbfa;
  border: 0;
  border-right: 1px solid #e2ebe7;
  color: #1c2733;
  cursor: pointer;
  font-weight: 900;
  min-height: 48px;
  padding: 10px;
}

.simple-step-button:last-child {
  border-right: 0;
}

.simple-step-button.active {
  background: #ffc400;
  color: #101417;
}

.form-mapper-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
}

.form-mapper-source,
.form-mapper-fields,
.form-mapper-preview {
  align-content: start;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.form-ocr-lines {
  display: grid;
  max-height: 760px;
}

.form-basic-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-basic-grid label,
.invoice-field-row,
.advanced-mapper label {
  display: grid;
  gap: 6px;
}

.form-basic-grid label span,
.invoice-field-row > span,
.advanced-mapper label span {
  color: #667483;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form-basic-grid input,
.form-basic-grid select,
.invoice-field-row input {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.invoice-field-list {
  display: grid;
  gap: 10px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: grid;
}

.invoice-field-row {
  align-items: end;
  background: #f8fbfa;
  border: 1px solid #dfe9e4;
  border-radius: 8px;
  grid-template-columns: 132px minmax(0, 1fr) 78px;
  padding: 10px;
}

.pick-button {
  background: #ffffff;
  border: 1px solid #c9d9d2;
  border-radius: 7px;
  color: #101417;
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
  padding: 0 12px;
}

.pick-button:hover,
.pick-button:focus {
  border-color: #ffc400;
  outline: 0;
}

.pick-button.active {
  background: #ffc400;
  border-color: #ffc400;
  color: #101417;
}

.item-form-section {
  border-top: 1px solid #e3ebe7;
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.form-preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.item-column-preview {
  background: #eef8f2;
  border: 1px solid #c9ead8;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.item-column-preview span {
  color: #0a7144;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-action-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.json-preview-details {
  border-top: 1px solid #e3ebe7;
  padding-top: 10px;
}

.json-preview-details summary {
  cursor: pointer;
  font-weight: 900;
}

.json-preview-details .json-preview {
  margin-top: 12px;
}

.code-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  min-height: 22px;
}

.line-no {
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #7b8a99;
  padding: 0 10px;
  text-align: right;
  user-select: none;
}

.line-text {
  padding: 0 12px;
  white-space: pre-wrap;
}

.ocr-lines div {
  grid-template-columns: minmax(0, 1fr) 94px;
}

.ocr-lines div.is-hidden {
  display: none;
}

.confidence-badge {
  border-radius: 999px;
  font-weight: 800;
  padding: 3px 8px;
}

.confidence-badge.good {
  background: #e8f5ee;
  color: #0a7144;
}

.confidence-badge.medium {
  background: #fff8e5;
  color: #8a6200;
}

.confidence-badge.low {
  background: #fff0f0;
  color: #842222;
}

.writer-textarea {
  border: 1px solid #cbd5df;
  border-radius: 8px;
  min-height: 150px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.teacher-source-box {
  background: #f8fbfa;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  min-height: 220px;
  overflow: auto;
  padding: 10px;
}

.teacher-source-image {
  background: #fff;
  border: 1px solid #dbe5e0;
  border-radius: 6px;
  display: block;
  height: auto;
  max-height: 300px;
  max-width: 100%;
  width: 100%;
}

.teacher-source-frame {
  border: 1px solid #dbe5e0;
  border-radius: 6px;
  height: 320px;
  width: 100%;
}

.teacher-source-empty {
  align-items: center;
  color: #667483;
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 180px;
}

.teacher-line-stats {
  align-items: center;
  background: #eef3f1;
  border: 1px dashed #c3d3cb;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
}

.teacher-line-stats span {
  color: #667483;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.line-no {
  color: #394f5d;
  font-size: 0.72rem;
  font-weight: 900;
}

.teacher-net-settings {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.mapping-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mapping-summary-item {
  background: #f7faf9;
  border: 1px solid #dbe5e0;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.mapping-summary-item span {
  color: #667483;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mapping-summary-item strong {
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.teacher-step-chip {
  border-radius: 999px;
}

@media (max-width: 980px) {
  .review-header,
  .template-header,
  .party-grid,
  .review-grid,
  .debug-grid,
  .status-bar,
  .overview-grid,
  .metrics-card,
  .template-summary-grid,
  .teach-panel,
  .detail-grid,
  .login-shell,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .builder-grid,
  .builder-two,
  .builder-three,
  .mapper-grid,
  .form-mapper-grid,
  .teacher-hero,
  .teacher-command-panel,
  .teacher-workbench,
  .teacher-basic-grid,
  .teacher-field-grid,
  .form-basic-grid,
  .friendly-form-grid,
  .field-map-grid,
  .preset-grid,
  .form-preset-grid,
  .mapping-summary {
    grid-template-columns: 1fr;
  }

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

  .mapper-start-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-mapper-help {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-sample-pane {
    max-height: none;
    position: static;
  }

  .teacher-ocr-list {
    max-height: 460px;
  }

  .teacher-table-presets {
    grid-template-columns: 1fr;
  }

  .mapping-summary,
  .teacher-net-settings,
  .teacher-source-box {
    grid-template-columns: 1fr;
  }

  .not-invoice-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .simple-step-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-pick-box {
    width: 100%;
  }

  .totals-panel {
    position: static;
    grid-row: auto;
  }

  .metrics-card {
    grid-column: auto;
  }

  .template-actions {
    justify-content: flex-start;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-hero {
    grid-template-columns: 58px 1fr;
  }

  .brand-hero img {
    height: 58px;
    width: 58px;
  }
}

@media (max-width: 620px) {
  .upload-strip {
    grid-template-columns: 1fr;
  }

  .template-facts {
    grid-template-columns: 1fr;
  }

  .review-shell {
    padding-top: 10px;
  }

  .tab-list {
    grid-template-columns: 1fr 1fr;
    position: static;
  }

  .tab-list label {
    justify-content: flex-start;
  }

  .tab-panel {
    min-height: 420px;
  }

  .code-view {
    min-height: 360px;
  }

  .mapper-steps {
    grid-template-columns: 1fr;
  }

  .ocr-line-button {
    grid-template-columns: minmax(0, 1fr);
  }

  .ocr-line-button span {
    justify-self: start;
  }

  .invoice-field-row {
    grid-template-columns: 1fr;
  }

  .simple-step-tabs {
    grid-template-columns: 1fr;
  }

  .pick-button {
    justify-self: start;
    min-width: 110px;
  }

  .teacher-ocr-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .teacher-ocr-line small,
  .line-zone {
    justify-self: start;
  }
}
