.rdtp-editor-topic {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin-top: 2px;
}
.rdtp-editor-page .rdtp-topic-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  width: auto;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  margin-left: -6px;
  border: 0;
  border-radius: var(--control-radius, 8px);
  background: transparent;
  color: var(--text-muted, #66717d);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}
.rdtp-topic-trigger span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: start;
}
.rdtp-topic-trigger::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 120ms ease-out;
}
.rdtp-topic-trigger[aria-expanded=true]::after {
  transform: translateY(1px) rotate(225deg);
}
.rdtp-editor-page .rdtp-topic-trigger:is(:hover, :focus-visible, [aria-expanded=true]) {
  background: var(--surface-muted, #f2f4f6);
  color: var(--text-main, #252a30);
}
.rdtp-editor-topic .rdtp-topic-list {
  position: absolute;
  z-index: 120;
  top: calc(100% + 4px);
  inset-inline-start: -6px;
  width: min(320px, calc(100vw - 106px));
  max-height: min(380px, var(--topic-available-height, 50vh));
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: var(--space-1, 4px);
  list-style: none;
  background: var(--surface, #fff);
  color: var(--text-main, #252a30);
  border: 1px solid var(--line-subtle, #dde3e9);
  border-radius: var(--card-radius, 12px);
  box-shadow: var(--reading-header-shadow, 0 8px 26px rgb(25 40 55 / 13%));
  animation: rdtp-topic-open 120ms cubic-bezier(.2,.8,.2,1) both;
}
.rdtp-editor-topic .rdtp-topic-list.opens-up {
  --topic-offset: 4px;
  top: auto;
  bottom: calc(100% + 4px);
}
@keyframes rdtp-topic-open {
  from { opacity: 0; transform: translateY(var(--topic-offset, -4px)); }
  to { opacity: 1; transform: translateY(0); }
}
.rdtp-topic-list [role=option] {
  display: flex;
  align-items: center;
  padding: 8px var(--space-3, 12px);
  min-height: 36px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: var(--control-radius, 8px);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.rdtp-topic-list [aria-selected=true] { font-weight: 600; }
.rdtp-topic-list [aria-selected=true]::after { content: '✓'; margin-inline-start: auto; padding-inline-start: 10px; }
.rdtp-topic-list .is-active { background: var(--surface-muted, #f2f4f6); }
@media (hover: hover) {
  .rdtp-topic-list [role=option]:hover { background: var(--surface-muted, #f2f4f6); }
}
@media (pointer: coarse) {
  .rdtp-topic-list [role=option] { min-height: 44px; }
  .rdtp-editor-page .rdtp-topic-trigger { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .rdtp-editor-topic .rdtp-topic-list { animation: none; }
  .rdtp-topic-trigger::after { transition: none; }
}
