.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  white-space: nowrap;
}

.btn .ti {
  font-size: 1.05rem;
  line-height: 1;
}

.dropdown-item .ti {
  margin-right: .4rem;
  font-size: 1rem;
  line-height: 1;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #89a3f7;
  box-shadow: var(--tc-focus-ring);
}

.tc-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tc-page-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 760;
}

.tc-kicker {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--tc-brand);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tc-search-panel {
  border-color: var(--tc-line);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-page {
  display: grid;
  gap: 1rem;
}

.tc-page > *,
.tc-search-panel,
.tc-filter-panel,
.tc-result-list,
.tc-result-card,
.tc-browse-thread-list,
.tc-reading-list {
  min-width: 0;
}

.tc-filter-panel {
  overflow: hidden;
  border-color: var(--tc-line);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.tc-filter-summary::-webkit-details-marker {
  display: none;
}

.tc-filter-chevron {
  color: var(--tc-muted);
  transition: transform .15s ease;
}

.tc-filter-panel[open] .tc-filter-chevron {
  transform: rotate(180deg);
}

.tc-toolbar-form {
  display: flex;
  align-items: end;
  gap: .65rem;
}

.tc-toolbar-field {
  flex: 1 1 auto;
  min-width: min(24rem, 100%);
}

.tc-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: .5rem;
}

.tc-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: .18rem .48rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #344bb2;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.35;
}

.tc-status-success {
  background: #eaf8f1;
  color: var(--tc-success);
}

.tc-status-warning {
  background: #fff7e6;
  color: var(--tc-warning);
}

.tc-status-danger {
  background: #fff0f0;
  color: var(--tc-danger);
}

.tc-status-muted {
  background: #f1f4f8;
  color: var(--tc-muted);
}

.tc-status-info {
  background: #eef2ff;
  color: #344bb2;
}

.tc-status-deleted {
  background: #e7eaf0;
  color: var(--tc-muted);
}

.tc-author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .6rem;
}

.tc-author-menu {
  display: inline-flex;
  max-width: 100%;
}

.tc-author-menu .dropdown-menu {
  max-width: min(18rem, calc(100vw - 2rem));
}

.tc-author-menu-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 760;
  line-height: 1.45;
}

.tc-author-menu-toggle:hover,
.tc-author-menu-toggle:focus {
  color: var(--tc-brand);
  text-decoration: underline;
}

.tc-author-inline-status {
  margin-left: .25rem;
  padding: .08rem .34rem;
  font-size: .68rem;
  vertical-align: .08rem;
}

.tc-result-list {
  display: grid;
  gap: .85rem;
}

.tc-result-card {
  overflow: hidden;
  border-color: var(--tc-line);
  border-left: 4px solid var(--tc-brand);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-result-card-suspected-deleted {
  border-left-color: #98a2b3;
}

.tc-result-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .55rem;
}

.tc-result-card-title-row h2,
.tc-result-card-title-row h3,
.tc-result-card-title-row h5 {
  flex: 1 1 9rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 760;
  line-height: 1.35;
}

.tc-result-title-link {
  color: inherit;
  overflow-wrap: break-word;
  text-decoration: none;
}

.tc-result-title-link:hover,
.tc-result-title-link:focus {
  color: var(--tc-brand);
  text-decoration: underline;
}

.tc-content-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.72;
}

.tc-content-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.tc-result-meta {
  color: var(--tc-muted);
  font-size: .86rem;
  gap: .3rem .75rem !important;
  line-height: 1.35;
}

.tc-result-meta.mt-3 {
  margin-top: .65rem !important;
}

.tc-image-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .45rem;
}

.tc-image-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--tc-brand);
  font-weight: 700;
  text-decoration: none;
}

.tc-image-link:hover,
.tc-image-link:focus {
  color: var(--tc-brand-dark);
  text-decoration: underline;
}

.tc-parent-quote {
  margin-bottom: .65rem;
  padding: .55rem .7rem;
  border-left: 3px solid #b7bec8;
  border-radius: 0 var(--tc-radius-sm) var(--tc-radius-sm) 0;
  background: #f5f7fa;
  color: var(--tc-muted);
  font-size: .9rem;
}

.tc-comment-preview {
  margin-top: .85rem;
  padding: .75rem .85rem;
  border-radius: var(--tc-radius-sm);
  background: #f8fafc;
}

.tc-comment-preview-row + .tc-comment-preview-row {
  margin-top: .55rem;
}

.tc-comment-preview-all {
  color: var(--tc-brand);
  font-weight: 700;
  text-decoration: none;
}

.tc-comment-preview-all:hover,
.tc-comment-preview-all:focus {
  color: var(--tc-brand-dark);
  text-decoration: underline;
}

.tc-reading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .5rem;
}

.tc-reading-context-card {
  display: grid;
  gap: .55rem;
  margin-bottom: .85rem;
  padding: 1rem;
  border-color: var(--tc-line);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-reading-context-forum {
  color: var(--tc-brand);
  font-size: .9rem;
  font-weight: 760;
}

.tc-result-forum-line {
  margin-bottom: .25rem;
  color: var(--tc-brand);
  font-size: .9rem;
  font-weight: 760;
}

.tc-reading-context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.tc-reading-context-head .tc-author-row {
  margin-bottom: 0;
}

.tc-reading-context-title {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tc-reading-list {
  overflow: hidden;
  border-color: var(--tc-line);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-reading-item {
  padding: 1rem;
  background: var(--tc-surface);
}

.tc-reading-item + .tc-reading-item,
.tc-reading-empty-row {
  border-top: 1px solid var(--tc-line);
}

.tc-reading-item-suspected-deleted {
  color: var(--tc-muted);
}

.tc-reading-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}

.tc-reading-head .tc-author-row {
  margin-bottom: 0;
}

.tc-reading-tags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}

.tc-reading-body {
  font-size: 1rem;
}

.tc-reading-empty-row {
  padding: 1.2rem 1rem;
  background: #f8fafc;
  color: var(--tc-muted);
  text-align: center;
}

.tc-browse-thread-list .tc-result-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.tc-browse-thread-list .tc-result-card + .tc-result-card {
  border-top: 1px solid var(--tc-line);
}

.tc-browse-thread-list .card-body {
  padding: 1rem;
}

.tc-refresh-fab {
  display: grid;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1040;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: var(--tc-brand);
  color: #fff;
  box-shadow: 0 16px 32px rgba(37, 99, 235, .3);
  text-decoration: none;
}

.tc-refresh-fab .ti {
  font-size: 1.35rem;
}

.tc-refresh-fab:hover,
.tc-refresh-fab:focus {
  color: #fff;
  background: var(--tc-brand-dark);
  box-shadow: 0 18px 38px rgba(30, 64, 175, .34);
}

.tc-multiselect {
  position: relative;
}

.tc-multiselect-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.45rem;
  color: var(--tc-ink);
  text-align: left;
}

.tc-multiselect-toggle [data-multiselect-label] {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-multiselect-menu {
  width: 100%;
  max-height: min(22rem, 70vh);
  padding: .35rem;
  overflow: hidden;
  border-color: var(--tc-line);
  box-shadow: var(--tc-shadow-popover);
}

.tc-multiselect-options {
  max-height: 17rem;
  overflow-y: auto;
}

.tc-multiselect-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.1rem;
  margin: 0;
  padding: .42rem .45rem;
  border-radius: var(--tc-radius-sm);
  cursor: pointer;
}

.tc-multiselect-option:hover,
.tc-multiselect-option:focus-within {
  background: #f3f6fb;
}

.tc-multiselect-option .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.tc-multiselect-clear {
  width: 100%;
  margin-bottom: .25rem;
  padding: .45rem .55rem;
  border: 0;
  border-radius: var(--tc-radius-sm);
  background: #f8fafc;
  color: var(--tc-muted);
  font-weight: 700;
  text-align: left;
}

.tc-multiselect-clear:hover,
.tc-multiselect-clear:focus {
  background: #eef2f7;
  color: var(--tc-ink);
}

.tc-empty-state,
.tc-error-state {
  display: grid;
  justify-items: center;
  gap: .55rem;
  padding: 2.35rem 1rem;
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius);
  background: var(--tc-surface);
  color: var(--tc-muted);
  text-align: center;
  box-shadow: var(--tc-shadow);
}

.tc-empty-state .ti,
.tc-error-state .ti {
  color: var(--tc-brand);
  font-size: 1.65rem;
}

.tc-empty-state-title,
.tc-error-state-title {
  margin: 0;
  color: var(--tc-ink);
  font-weight: 760;
}

.tc-pagination {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.tc-pagination .pagination {
  align-items: center;
  gap: .4rem;
}

.tc-pagination .page-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: var(--tc-radius-sm);
}

.tc-pagination .tc-page-current {
  color: var(--tc-muted);
  white-space: nowrap;
}

.tc-toast-portal {
  z-index: 1080;
  top: max(.75rem, env(safe-area-inset-top)) !important;
  right: auto !important;
  left: 50% !important;
  display: grid;
  width: min(28rem, calc(100vw - 2rem));
  padding: 0 !important;
  gap: .5rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.tc-toast {
  position: relative;
  width: 100%;
  overflow: hidden;
  --tc-toast-bg: #1f4ed8;
  --tc-toast-bar: #3e65dd;
  border: 0;
  border-radius: .42rem;
  background: var(--tc-toast-bg);
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, .18);
  pointer-events: auto;
}

.tc-toast-success {
  --tc-toast-bg: var(--tc-success);
  --tc-toast-bar: #2c8b66;
}

.tc-toast-danger {
  --tc-toast-bg: var(--tc-danger);
  --tc-toast-bar: #c44b42;
}

.tc-toast-warning {
  --tc-toast-bg: #a16207;
  --tc-toast-bar: #b7791f;
}

.tc-toast-info {
  --tc-toast-bg: var(--tc-info);
  --tc-toast-bar: #2a8b83;
}

.tc-toast-body {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .72rem .85rem .82rem;
  font-weight: 720;
}

.tc-toast-icon {
  flex: 0 0 auto;
  color: inherit;
}

.tc-toast .btn-close {
  filter: invert(1) grayscale(100%) brightness(2);
  opacity: .72;
}

.tc-toast .btn-close:hover,
.tc-toast .btn-close:focus {
  opacity: 1;
}

.tc-toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: .2rem;
  background: var(--tc-toast-bar);
  transform-origin: left center;
  animation-name: tc-toast-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes tc-toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.tc-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.tc-download-list {
  overflow: hidden;
  border-color: var(--tc-line);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-download-progress-cell {
  min-width: 9rem;
}

.tc-download-progress {
  height: .45rem;
  min-width: 7rem;
  margin-bottom: .25rem;
}

.tc-danger-modal .modal-header {
  border-bottom-color: #fee2e2;
}

.tc-danger-modal .modal-title {
  color: var(--tc-danger);
}

@media (max-width: 991.98px) {
  .tc-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tc-toolbar-form,
  .tc-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .tc-toolbar-field,
  .tc-toolbar-actions > * {
    width: 100%;
  }

  .tc-pagination .pagination {
    width: 100%;
  }

  .tc-pagination .page-item {
    flex: 1 1 0;
  }

  .tc-pagination .page-link {
    justify-content: center;
    width: 100%;
  }

  .tc-filter-panel .card-body,
  .tc-browse-thread-list .card-body,
  .tc-reading-context-card,
  .tc-reading-item {
    padding: .85rem;
  }

  .tc-reading-head,
  .tc-reading-context-head {
    gap: .45rem;
  }

  .tc-reading-tags {
    max-width: 45%;
  }

  .tc-refresh-fab {
    right: .85rem;
    bottom: .85rem;
    width: 3rem;
    height: 3rem;
  }
}
