.mt-shell[hidden],
.mt-results[hidden],
.mt-empty[hidden],
.mt-table-wrap[hidden] {
  display: none !important;
}
@media (scripting: none) {
  .mt-shell {
    display: none !important;
  }
}

.mt-shell {
  margin-block: 2rem 3rem;
  min-width: 0;
  max-width: 100%;
}

.mt-shell > *,
.mt-controls > *,
.mt-results > *,
.mt-field,
.mt-table-wrap {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.mt-notice {
  background: var(--mist, #182746);
  border-top: 2px solid var(--slate, #111c35);
  padding: 1.1rem 1.35rem;
  margin-block: 1.5rem 2rem;
}

.mt-notice p {
  margin: 0;
  max-width: 72ch;
}

.mt-notice p + p {
  margin-top: .5rem;
}

.mt-controls {
  background: var(--sheet, #111c35);
  border: 1px solid var(--line, rgb(247 246 238 / .14));
  border-top: 3px solid var(--slate, #111c35);
  padding: clamp(1.1rem, 3vw, 1.85rem);
  display: grid;
  gap: 1.25rem;
}

.mt-period-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem 1.1rem;
  align-items: end;
}

.mt-field {
  display: grid;
  gap: .35rem;
  font-weight: 600;
  font-size: .95rem;
}

.mt-field input,
.mt-field select {
  min-height: 44px;
  padding: .48rem .7rem;
  border: 1px solid var(--edge-ink, #8191a5);
  border-radius: .25rem;
  background: var(--sheet, #111c35);
  color: var(--ink, #f7f6ee);
  font: inherit;
  font-variant-numeric: tabular-nums;
  width: 100%;
  box-sizing: border-box;
}

.mt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.mt-actions .buyer-cta,
.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .62rem 1.1rem;
  border-radius: .22rem;
  font: 550 .96rem/1.25 BuyerSans, Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.mt-btn {
  border: 1px solid var(--slate, #111c35);
  background: var(--slate, #111c35);
  color: var(--sheet, #111c35);
}

.mt-btn:hover {
  background: var(--ink, #f7f6ee);
}

.mt-btn-secondary {
  border: 1px solid var(--edge-ink, #8191a5);
  background: var(--sheet, #111c35);
  color: var(--ink, #f7f6ee);
}

.mt-btn-secondary:hover {
  background: var(--mist, #182746);
}

.mt-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mt-dropzone {
  border: 1.5px dashed var(--edge-ink, #8191a5);
  background: var(--paper, #0b1325);
  padding: 1.15rem 1.25rem;
  border-radius: .28rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.25rem;
}

.mt-dropzone.is-dragover {
  background: var(--mist, #182746);
  border-color: var(--ink, #f7f6ee);
}

.mt-dropzone-copy {
  display: grid;
  gap: .3rem;
}

.mt-dropzone-copy small {
  color: var(--muted, #b8c3d1);
  font-size: .9rem;
}

.mt-file-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .55rem 1rem;
  border: 1px solid var(--slate, #111c35);
  border-radius: .22rem;
  background: var(--sheet, #111c35);
  color: var(--ink, #f7f6ee);
  font-weight: 600;
  cursor: pointer;
}

.mt-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mt-status {
  margin: 1rem 0 0;
  padding: .75rem 1rem;
  background: var(--mist, #182746);
  border-left: 3px solid var(--slate, #111c35);
  font-weight: 550;
}

.mt-status[data-state="error"] {
  background: var(--sheet, #111c35);
  border: 1px solid var(--amber);
  border-left: 4px solid var(--amber);
  color: var(--amber);
}

.mt-results {
  margin-top: 2rem;
  display: grid;
  gap: 2rem;
}

.mt-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.mt-kpi {
  background: var(--sheet, #111c35);
  border: 1px solid var(--line, rgb(247 246 238 / .14));
  border-top: 2px solid var(--slate, #111c35);
  padding: 1rem 1.1rem;
}

.mt-kpi-label {
  display: block;
  font-size: .86rem;
  color: var(--muted, #b8c3d1);
  font-weight: 600;
}

.mt-kpi-value {
  display: block;
  margin-top: .3rem;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mt-box-panel {
  background: var(--mist, #182746);
  border: 1px solid var(--line, rgb(247 246 238 / .14));
  border-top: 3px solid var(--slate, #111c35);
  padding: clamp(1.05rem, 2.5vw, 1.5rem);
}

.mt-box-panel h2,
.mt-section-head h2 {
  margin: 0 0 .5rem;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.mt-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1.5rem;
  margin: 1rem 0 0;
}

.mt-box-grid div {
  background: var(--sheet, #111c35);
  border: 1px solid var(--line, rgb(247 246 238 / .14));
  padding: .85rem 1rem;
}

.mt-box-grid dt {
  margin: 0;
  font-size: .9rem;
  color: var(--muted, #b8c3d1);
  font-weight: 600;
}

.mt-box-grid dd {
  margin: .25rem 0 0;
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mt-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: .85rem;
}

.mt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.mt-filter-btn {
  min-height: 44px;
  padding: .45rem .85rem;
  border: 1px solid var(--edge-ink, #8191a5);
  border-radius: .22rem;
  background: var(--sheet, #111c35);
  color: var(--ink, #f7f6ee);
  font: 550 .9rem/1.2 BuyerSans, Arial, sans-serif;
  cursor: pointer;
}

.mt-filter-btn[aria-pressed="true"] {
  background: var(--slate, #111c35);
  color: var(--sheet, #111c35);
  border-color: var(--slate, #111c35);
}

.mt-badge {
  display: inline-block;
  padding: .18rem .52rem;
  border-radius: .18rem;
  font-family: var(--mono, monospace);
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}

.mt-badge-pass {
  background: var(--mist, #182746);
  color: var(--ink, #f7f6ee);
  border: 1px solid var(--slate, #111c35);
}

.mt-badge-error {
  background: var(--sheet, #111c35);
  color: var(--amber);
  border: 1px solid var(--amber);
}

.mt-table-wrap {
  border: 1px solid var(--line, rgb(247 246 238 / .14));
  background: var(--sheet, #111c35);
  overflow-x: auto;
  max-width: 100%;
}

.mt-table-wrap th {
  background: var(--paper, #0b1325);
  font-weight: 650;
  white-space: nowrap;
}

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

.mt-code {
  font-family: var(--mono, monospace);
  font-size: .82rem;
}

.mt-empty {
  padding: 1.15rem;
  margin: 0;
  background: var(--mist, #182746);
  border-left: 3px solid var(--slate, #111c35);
}

.mt-exports {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.mt-checks-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin-block: 1.5rem;
}

.mt-checks-list article {
  border-top: 1px solid var(--line, rgb(247 246 238 / .14));
  padding-top: 1rem;
}

@media (max-width: 820px) {
  .mt-period-grid,
  .mt-kpis,
  .mt-box-grid,
  .mt-checks-list {
    grid-template-columns: 1fr;
  }

  .mt-actions,
  .mt-exports {
    flex-direction: column;
    align-items: stretch;
  }
}
