.badge.rejected {
  color: var(--red);
  border-color: #d6a49c;
}

.main-tabs {
  display: flex;
  gap: .35rem;
  margin: 1.25rem 0 0;
  border-bottom: 1px solid var(--line);
}

.main-tab {
  background: transparent;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: .7rem .9rem .65rem;
  font-size: .78rem;
}

.main-tab:hover {
  background: #ffffff75;
  color: var(--ink);
  transform: none;
}

.main-tab.active {
  color: var(--ink);
  border-color: var(--amber);
}

.tz-view {
  margin-top: 1.4rem;
}

.tz-view-head,
.tz-section-head,
.match-group-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.tz-view-head {
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.tz-view-head h2,
.tz-section-head h3,
.tz-requirements h3,
.match-group-head h3 {
  margin: 0;
  font-family: Georgia, serif;
}

.tz-view-head h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.8rem);
  letter-spacing: -.035em;
}

.tz-view-head p,
.tz-section-head p,
.tz-requirements p,
.match-group-head p {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}

.tz-source-status {
  white-space: nowrap;
  color: var(--green);
  border: 1px solid #9ebbaa;
  padding: .45rem .6rem;
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tz-source-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.tz-source-card > div {
  padding: 1.1rem;
  border-right: 1px solid var(--line);
}

.tz-source-card > div:last-child {
  border-right: 0;
}

.tz-source-card span,
.tz-source-card strong,
.tz-source-card small {
  display: block;
}

.tz-source-card span,
.match-summary span,
.match-source span {
  color: var(--muted);
  font-size: .61rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
}

.tz-source-card strong {
  margin: .45rem 0 .3rem;
  font-size: .86rem;
}

.tz-source-card small {
  color: var(--muted);
  line-height: 1.45;
}

.tz-rule {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: .75rem 1.25rem;
  background: var(--graphite);
  color: #fff;
  padding: 1.15rem 1.25rem;
  border-left: 5px solid var(--amber);
}

.tz-rule span {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .62rem;
  font-weight: 900;
}

.tz-rule p,
.tz-rule small {
  margin: 0;
  line-height: 1.55;
}

.tz-rule p {
  font-size: .82rem;
}

.tz-rule small {
  grid-column: 2;
  color: #aeb0a9;
}

.tz-table-section {
  margin-top: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.tz-section-head {
  padding: 1.25rem;
}

.tz-section-head > span,
.match-group-head > span {
  min-width: 40px;
  text-align: center;
  padding: .38rem .5rem;
  background: var(--amber-soft);
  font-weight: 900;
  font-size: .7rem;
}

.tz-table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.tz-table {
  min-width: 980px;
}

.tz-table tbody tr {
  cursor: default;
}

.tz-table td:first-child strong,
.tz-table td:first-child small {
  display: block;
}

.tz-table td:first-child small {
  color: var(--muted);
  margin-top: .25rem;
}

.currency-chip,
.method-chip,
.activity-chip {
  display: inline-block;
  margin: .16rem .2rem .16rem 0;
  padding: .26rem .42rem;
  font-size: .65rem;
  border: 1px solid var(--line);
  background: #fff;
}

.currency-chip {
  background: var(--graphite);
  color: #fff;
  border-color: var(--graphite);
  font-weight: 900;
}

.activity-chip {
  background: var(--amber-soft);
  border-color: #e2c98d;
}

.tz-requirements {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) 1.35fr;
  gap: 2rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tz-requirements ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.tz-requirements li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .65rem;
  background: var(--paper);
  padding: .8rem;
  font-size: .72rem;
  line-height: 1.45;
}

.tz-requirements li span {
  color: var(--amber);
  font-size: .62rem;
  font-weight: 900;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: .35rem;
  margin: 1.35rem 0 1rem;
  padding: .3rem;
  background: #eae8df;
}

.drawer-tabs button {
  background: transparent;
  color: var(--muted);
  padding: .65rem .7rem;
  font-size: .72rem;
  border-radius: 0;
}

.drawer-tabs button:hover,
.drawer-tabs button.active {
  transform: none;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 10px #20211f0c;
}

.drawer-tabs button span {
  margin-left: .3rem;
  color: var(--green);
}

.match-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

.match-summary > div {
  background: #f4f2ea;
  padding: .95rem;
}

.match-summary > div:first-child {
  border-top: 4px solid #9a7940;
}

.match-summary.fit > div:first-child {
  border-color: var(--green);
}

.match-summary.non_fit > div:first-child {
  border-color: var(--red);
}

.match-summary strong,
.match-summary small {
  display: block;
}

.match-summary strong {
  margin: .45rem 0 .25rem;
  font-size: .82rem;
}

.match-summary small {
  color: var(--muted);
  font-size: .67rem;
  line-height: 1.4;
}

.match-group {
  margin-top: 1.5rem;
}

.match-group-head {
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}

.match-list {
  display: grid;
}

.match-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: .7rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.match-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  font-size: .76rem;
  font-weight: 900;
  color: #8a5a08;
  background: #fff8e7;
}

.match-item[data-match-state="matched"] .match-icon {
  color: var(--green);
  border-color: #9ebbaa;
  background: #eef6f1;
}

.match-item[data-match-state="missing"] .match-icon {
  color: var(--red);
  border-color: #d6a49c;
  background: #fbefed;
}

.match-title {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  align-items: baseline;
}

.match-title strong {
  font-size: .8rem;
}

.match-title span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .58rem;
  font-weight: 900;
}

.match-item p {
  margin: .35rem 0 .7rem;
  color: #555650;
  font-size: .75rem;
  line-height: 1.5;
}

.match-item dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin: 0;
}

.match-item dl div {
  padding: .65rem;
  background: #efede5;
}

.match-item dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .56rem;
  font-weight: 800;
}

.match-item dd {
  margin: .28rem 0 0;
  font-size: .69rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .tz-source-card,
  .tz-requirements,
  .match-summary {
    grid-template-columns: 1fr;
  }

  .tz-source-card > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tz-source-card > div:last-child {
    border-bottom: 0;
  }

  .tz-requirements {
    gap: 1rem;
  }

  .tz-requirements ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .main-tabs {
    margin-top: 1rem;
  }

  .main-tab {
    flex: 1;
  }

  .tz-view-head {
    display: block;
  }

  .tz-source-status {
    display: inline-block;
    margin-top: .9rem;
  }

  .tz-rule {
    grid-template-columns: 1fr;
  }

  .tz-rule small {
    grid-column: 1;
  }

  .drawer-tabs,
  .match-item dl {
    grid-template-columns: 1fr;
  }
}
