.topic-nav {
  --topic-accent: #79510b;
  --topic-tint: #f8edc6;
  margin: 0 0 15px;
  color: var(--topic-accent);
}
.topic-heading { display: block; font-size: 12px; font-weight: 550; color: #596675; }
.topic-row, .topic-arrows { display: flex; align-items: center; gap: 8px; }
.topic-row h2 { margin: 0; min-width: 0; font-size: inherit; }
.topic-nav button {
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 9px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--topic-accent);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.topic-nav #topic-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 3px 6px 3px 0;
  text-align: left;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.topic-caret {
  width: 7px; height: 7px; flex: none;
  border-right: 1.7px solid; border-bottom: 1.7px solid;
  transform: translateY(-2px) rotate(45deg);
}
#topic-open[aria-expanded="true"] .topic-caret { transform: translateY(2px) rotate(225deg); }
.topic-arrows { flex: none; gap: 2px; }
.topic-arrows button {
  width: 44px;
  background: var(--topic-tint);
  font-size: 25px;
  line-height: 1;
}
.topic-nav button:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; }
#topic-menu:not([hidden]) {
  display: grid;
  width: min(100%, 440px);
  box-sizing: border-box;
  max-height: min(48vh, 370px);
  overflow: auto;
  margin: 4px 0 10px;
  padding: 4px;
  border: 1px solid #d7dfe6;
  border-radius: 12px;
  background: white;
}
#topic-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 12px;
  text-align: left;
  color: inherit;
  font-size: 15px;
  line-height: 1.35;
}
#topic-menu button:is(:hover, [aria-current="true"]) { background: var(--topic-tint); }
.topic-count { color: #536477; font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 480px) {
  .topic-nav { margin-bottom: 8px; }
  .topic-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .topic-nav #topic-open { font-size: 0.9375rem; }
}
