.md-typeset .grid.cards > ul > li {
  border-radius: 8px;
}

.md-typeset code {
  border-radius: 5px;
}

.md-typeset pre,
.md-typeset pre > code {
  overflow-x: visible;
  white-space: pre-wrap;
  word-break: break-word;
}

.md-typeset div.highlight {
  overflow-x: visible;
  border: 1px solid var(--tda-line);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(23, 32, 51, .045);
}

.md-typeset div.highlight pre {
  margin: 0;
}

.md-typeset .md-typeset__table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.md-typeset table:not([class]) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  white-space: normal;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.md-typeset table:not([class]) th {
  background: #f6f8fb;
  color: #172033;
  font-weight: 700;
}

.md-typeset table:not([class]) td {
  line-height: 1.55;
}

.md-typeset hr {
  border-bottom: 1px solid var(--tda-line);
}

@media screen and (max-width: 720px) {
  .tda-authority-panel {
    padding: 18px;
  }

  .tda-authority-rule {
    flex-direction: column;
    align-items: flex-start;
  }

  .tda-authority-levels {
    grid-template-columns: 1fr;
  }

  .tda-hero {
    padding: 26px 22px;
  }

  .tda-card {
    min-height: auto;
  }
}

.tda-diagram {
  display: grid;
  gap: 8px;
  margin: 18px 0 24px;
  padding: 16px;
  border: 1px solid var(--tda-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  box-shadow: 0 8px 22px rgba(23, 32, 51, .05);
}

/* Simple, stable process block used where Mermaid would be excessive. */
.tda-flow {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin: 18px 0 24px;
  padding: 16px;
  border: 1px solid var(--tda-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  box-shadow: 0 8px 22px rgba(23, 32, 51, .045);
}

.tda-flow-step {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d7ea;
  border-radius: 8px;
  padding: 8px 12px;
  background: #eef5ff;
  color: #1d3550;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.tda-flow-arrow {
  color: var(--tda-teal);
  font-size: .9rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.tda-diagram-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.tda-diagram-node {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d7ea;
  border-radius: 8px;
  padding: 8px 12px;
  background: #eef5ff;
  color: #1d3550;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.tda-diagram-arrow {
  min-width: 34px;
  color: var(--tda-teal);
  font-weight: 800;
  text-align: center;
}

.tda-diagram-arrow span {
  display: block;
  max-width: 140px;
  margin-bottom: 2px;
  color: var(--tda-muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.25;
}

.tda-diagram-plain {
  color: var(--tda-muted);
  font-family: var(--md-code-font-family);
  font-size: .76rem;
  white-space: pre-wrap;
}

@media screen and (max-width: 720px) {
  .tda-diagram-row {
    grid-template-columns: 1fr;
  }

  .tda-diagram-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

