.mtj-tool {
  --color-bg: #161F30;
  --color-header: #1C263A;
  --color-accent: #D2A054;
  --color-text: #ffffff;
  --color-muted: #546684;
  --color-match: #6ba96e;
  --color-error: #c45c4a;
  --font: cairo, "Noto Naskh Arabic", "Segoe UI", tahoma, sans-serif;
  box-sizing: border-box;
  overflow-x: clip;
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2.4rem;
  color: var(--color-text);
  font-family: var(--font);
  background:
    radial-gradient(1200px 420px at 100% 0%, rgba(210, 160, 84, 0.12), transparent 55%),
    linear-gradient(180deg, var(--color-header) 0%, var(--color-bg) 42%);
  border: 0;
}

.mtj-tool *,
.mtj-tool *::before,
.mtj-tool *::after {
  box-sizing: border-box;
}

.mtj-tool :focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.mtj-hero {
  margin-bottom: 1.5rem;
}

.mtj-brand {
  margin: 0 0 0.35rem;
  color: var(--color-accent);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.mtj-title {
  margin: 0 0 0.5rem;
  color: var(--color-text);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
}

.mtj-lead,
.mtj-message,
.mtj-hint,
.mtj-empty,
.mtj-notes {
  margin: 0;
  color: #c5cedd;
  font-size: 0.98rem;
  line-height: 1.7;
}

.mtj-message,
.mtj-status {
  margin-top: 0.75rem;
}

.mtj-form {
  display: grid;
  gap: 1.1rem;
}

.mtj-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.mtj-field label,
.mtj-glossaries legend,
.mtj-source legend {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--color-text);
  font-weight: 600;
}

.mtj-tool input[type="file"],
.mtj-tool select,
.mtj-tool textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  color: var(--color-text);
  background: #121a29;
  border: 1px solid #546684;
  font: inherit;
}

.mtj-tool textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.7;
}

.mtj-source label {
  margin-top: 0.85rem;
}

.mtj-source label:first-of-type {
  margin-top: 0;
}

.mtj-hint {
  margin-top: 0.4rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.mtj-glossary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.mtj-check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding-inline: 0.2rem;
  cursor: pointer;
}

.mtj-check input {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  accent-color: var(--color-accent);
}

.mtj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mtj-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.7rem 1.25rem;
  color: var(--color-bg);
  background: var(--color-accent);
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.mtj-button:hover,
.mtj-button:focus-visible {
  filter: brightness(1.06);
}

.mtj-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: none;
}

.mtj-button-secondary {
  color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-accent);
}

a.mtj-button:visited {
  color: var(--color-bg);
}

a.mtj-button-secondary:visited {
  color: var(--color-accent);
}

.mtj-status {
  min-height: 48px;
  margin-block: 1.1rem 1.35rem;
  padding: 0.85rem 0;
}

.mtj-quota {
  margin: 1rem 0 0;
  color: var(--color-accent);
  font-weight: 600;
}

.mtj-paywall {
  margin-top: 1rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(84, 102, 132, 0.45);
}

.mtj-paywall-text {
  margin: 0 0 0.9rem;
  color: #c5cedd;
  line-height: 1.7;
}

.mtj-paywall-actions,
.mtj-ad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mtj-ad {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(22, 31, 48, 0.82);
}

.mtj-ad[hidden] {
  display: none;
}

.mtj-ad-panel {
  width: min(32rem, 100%);
  padding: 1.5rem 1.25rem;
  background: #1c263a;
  border: 1px solid rgba(210, 160, 84, 0.35);
  text-align: center;
}

.mtj-ad-kicker {
  margin: 0 0 0.4rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.mtj-ad-brand {
  margin: 0 0 0.4rem;
  color: var(--color-accent);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
}

.mtj-ad-copy {
  margin: 0 0 1.1rem;
  color: #c5cedd;
  line-height: 1.7;
}

.mtj-ad-progress {
  height: 8px;
  margin-bottom: 0.75rem;
  background: #121a29;
  overflow: hidden;
}

.mtj-ad-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-accent);
}

.mtj-ad-progress span.is-playing {
  width: 100%;
  transition: width 10s linear;
}

.mtj-ad-timer {
  margin: 0 0 1rem;
  color: var(--color-accent);
  font-size: 1.2rem;
  font-weight: 700;
}

.mtj-status.is-error {
  color: #f0b4ab;
}

.mtj-status.is-success {
  color: var(--color-match);
}

.mtj-status.is-loading {
  color: var(--color-accent);
}

.mtj-report {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(84, 102, 132, 0.5);
}

.mtj-report-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.mtj-score {
  margin: 0 0 1.25rem;
  color: var(--color-accent);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
}

.mtj-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.mtj-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
}

.mtj-table th,
.mtj-table td {
  padding: 0.95rem 1rem;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid rgba(84, 102, 132, 0.45);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.mtj-table th {
  color: var(--color-accent);
  font-weight: 700;
  white-space: nowrap;
}

.mtj-col-status {
  width: 8.5rem;
  white-space: nowrap;
}

.mtj-badge {
  display: inline-block;
  font-weight: 700;
  white-space: nowrap;
}

.mtj-badge.is-match {
  color: var(--color-match);
}

.mtj-badge.is-inconsistent {
  color: var(--color-accent);
}

.mtj-badge.is-missing {
  color: #f0b4ab;
}

.mtj-notes {
  margin: 1rem 0;
}

.mtj-empty-row {
  color: #c5cedd;
}

@media (max-width: 767px) {
  .mtj-table {
    min-width: 0;
  }

  .mtj-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .mtj-table,
  .mtj-table tbody,
  .mtj-table tr,
  .mtj-table td {
    display: block;
    width: 100%;
  }

  .mtj-table tr {
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(84, 102, 132, 0.7);
  }

  .mtj-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 0;
    padding-inline: 0;
    white-space: normal;
  }

  .mtj-table td::before {
    content: attr(data-label);
    color: var(--color-accent);
    font-weight: 700;
    flex: 0 0 42%;
    white-space: nowrap;
  }

  .mtj-col-status {
    width: auto;
  }
}

@media (min-width: 768px) {
  .mtj-tool {
    padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.6rem;
  }
}
