/* Shared UI components — news monitors, home widgets, finance, nav dropdown */

/* --- Page sub-navigation (under main nav) — compact, distinct from .site-nav pills --- */
#site-nav-root:has(~ .page-subnav) .site-nav {
  margin-bottom: 0.35em;
  border-radius: 10px;
}

.page-subnav {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  margin: 0 0 0.65em;
  padding: 0 0.15em;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.page-subnav-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35em 0.9em;
  align-items: center;
  min-width: min-content;
}

.page-subnav-link,
.page-subnav .tab,
.page-subnav .subcategory-btn {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.35em 0.15em 0.4em;
  margin: 0;
  font-size: 0.98em;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  border-radius: 0;
  border: none;
  background: none;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.page-subnav-link:hover,
.page-subnav .tab:hover,
.page-subnav .subcategory-btn:hover,
.page-subnav .subcategory-btn:focus {
  background: none;
  color: #1a2a4d;
  text-decoration: none;
}

.page-subnav-link.active,
.page-subnav .tab.active,
.page-subnav .subcategory-btn.active {
  background: none;
  color: #1a2a4d;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #3b82f6;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

.page-subnav-link + .page-subnav-link::before,
.page-subnav-inner > * + *::before {
  content: none;
}

.page-subnav[aria-label="Vietnam section"] {
  gap: 0.35em 1.35em;
  padding: 0.15em 0 0.6em;
  align-items: center;
}

.page-subnav[aria-label="Vietnam section"] .page-subnav-link {
  padding: 0.45em 0.55em 0.52em;
}

@media (max-width: 600px) {
  .page-subnav {
    padding: 0;
    margin-bottom: 0.55em;
  }

  .page-subnav-link,
  .page-subnav .tab,
  .page-subnav .subcategory-btn {
    font-size: 0.92em;
    padding: 0.3em 0.12em 0.35em;
  }

  .page-subnav[aria-label="Vietnam section"] .page-subnav-link {
    padding: 0.4em 0.5em 0.45em;
  }
}

.site-nav-dropdown:not(.open) .site-nav-dropdown-menu {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.feed-browser-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65em;
  margin: 0;
}

.feed-browser-page .feed-browser-layout.layout--sidebyside {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.feed-browser-page .feed-browser-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85em;
  min-width: 0;
  width: 100%;
  order: 1;
}

.feed-browser-page .feed-browser-layout .feed-browser-articles-panel {
  min-width: 0;
  width: 100%;
  order: 2;
}

.feed-browser-page .feed-browser-sources-panel {
  display: none !important;
}

.feed-browser-page .feed-browser-pickers {
  display: flex;
  flex-direction: column;
  gap: 0.65em;
  width: 100%;
  padding-bottom: 0.65em;
  border-bottom: 1px solid #e2e8f0;
}

.feed-browser-page .feed-browser-category-picker,
.feed-browser-page .feed-browser-source-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3em;
  width: 100%;
  min-width: 0;
}

.feed-browser-page .feed-browser-view-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65em;
  width: 100%;
}

.feed-browser-page .feed-browser-articles-panel .panel-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.45em;
  margin-bottom: 0.45em;
}

.feed-browser-page .feed-browser-articles-panel .panel-header .badge {
  margin-left: 0;
}

@media (min-width: 901px) {
  .feed-browser-page .feed-browser-layout.layout--sidebyside {
    display: grid;
    grid-template-columns: minmax(11rem, 18rem) 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  .feed-browser-page .feed-browser-sidebar {
    grid-column: 1;
    order: 0;
  }

  .feed-browser-page .feed-browser-layout .feed-browser-articles-panel {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    order: 0;
  }

  .feed-browser-page .feed-browser-sources-panel {
    display: block !important;
  }

  .feed-browser-page .feed-browser-source-picker {
    display: none !important;
  }

  .feed-browser-page .feed-browser-pickers {
    display: grid;
    grid-template-columns: minmax(0, 280px);
    gap: 0.55em 0.65em;
    padding-bottom: 0;
    border-bottom: none;
  }

  .feed-browser-page .feed-browser-view-row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .feed-browser-page .feed-browser-view-toggle {
    align-self: flex-start;
  }
}

.feed-browser-page .feed-browser-sidebar .feed-browser-toolbar {
  margin: 0;
}

.feed-browser-page .feed-browser-sidebar .feed-browser-pickers {
  width: 100%;
}

.feed-browser-photos-toggle,
.feed-photos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.9em;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
  margin: 0 0 0.35em;
}

.feedme-user-prefs-root {
  width: 100%;
}

.feedme-user-prefs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85em 1.25em;
  padding: 0.65em 0.75em;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.feedme-user-prefs__title {
  flex: 1 1 100%;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.feedme-user-prefs__field {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3em;
  min-width: 0;
}

.feedme-user-prefs__field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.45em;
  font-size: 0.9em;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.feedme-user-prefs__field--checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

.feedme-user-prefs__field--number {
  min-width: 7rem;
}

.feedme-user-prefs__label {
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.feedme-user-prefs__field--number input {
  width: 100%;
  padding: 0.48em 0.6em;
  font-size: 0.95em;
  font-weight: 500;
  color: #1a2a4d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.feedme-user-prefs__field--number input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.feed-browser-photos-toggle input,
.feed-photos-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
  cursor: pointer;
}

.feed-browser-page .entry-card--photos-on .entry-card__content,
.feed-item--photos-on .feed-item__content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.feed-browser-page .entry-card__thumb-slot,
.feed-item__thumb-slot {
  flex: 0 0 108px;
  width: 108px;
  height: 76px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.feed-item__thumb-slot {
  flex-basis: 96px;
  width: 96px;
  height: 68px;
}

.feed-browser-page .entry-card__thumb-slot .entry-card__thumb,
.feed-item__thumb-slot .feed-item__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  border-radius: 0;
  background: transparent;
}

.article-thumb-slot--empty {
  visibility: hidden;
}

.feed-browser-page .entry-card--photos-on .entry-card__thumb-slot,
.feed-item--photos-on .feed-item__thumb-slot {
  margin-top: 1.55rem;
}

.feed-browser-page .entry-card__body .entry-meta,
.feed-item__body .entry-meta {
  margin-bottom: 0.35rem;
}

.feed-browser-page .entry-card__body {
  display: flex;
  flex-direction: column;
}

.feed-browser-page .entry-card__body,
.feed-item--photos-on .feed-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.news-monitor-panel .feed-photos-toggle {
  margin-bottom: 0.75em;
}

.feed-item--photos-on .feed-item__content {
  gap: 0.75em;
}

.feed-item__body {
  flex: 1;
  min-width: 0;
}

.feed-browser-pickers {
  display: grid;
  grid-template-columns: minmax(0, 280px);
  gap: 0.55em 0.65em;
}

.feed-browser-category-picker,
.feed-browser-source-picker {
  display: none;
  flex-direction: column;
  gap: 0.3em;
  min-width: 0;
}

.feed-browser-view-row__label,
.feed-browser-source-picker__label {
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.feed-browser-source-picker__select {
  width: 100%;
  padding: 0.48em 0.6em;
  font-size: 0.95em;
  font-weight: 500;
  color: #1a2a4d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.feed-browser-source-picker__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.feed-browser-view--mix .feed-browser-source-picker {
  opacity: 0.55;
}

.feed-browser-view--mix .feed-browser-source-picker__select {
  cursor: not-allowed;
}

.feed-browser-category-bar {
  margin-bottom: 0.65em;
  padding-bottom: 0.65em;
  border-bottom: 1px solid #e2e8f0;
}

.feed-browser-category-picker {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  width: 100%;
}

.feed-browser-view-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.65em;
  min-width: 0;
}

.feed-browser-category-picker__label {
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.feed-browser-category-picker__select {
  width: 100%;
  padding: 0.48em 0.6em;
  font-size: 0.95em;
  font-weight: 500;
  color: #1a2a4d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.feed-browser-category-picker__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

@media (max-width: 900px) {
  .feed-browser-toolbar {
    justify-content: stretch;
  }

  .feed-browser-category-picker__select,
  .feed-browser-source-picker__select {
    font-size: 1em;
    padding: 0.6em 0.65em;
  }
}

/* --- Feed browser: left feed list (compact, matches page-subnav) --- */
.layout.layout--sidebyside #feedsPanel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  animation: none;
}

.layout.layout--sidebyside #feedsPanel .panel-header {
  margin-bottom: 0.3em;
  padding: 0 0.15em;
}

.layout.layout--sidebyside #feedsPanel .panel-header h2 {
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0;
}

.layout.layout--sidebyside #feedsPanel .badge {
  font-size: 0.68em;
  padding: 0.1em 0.45em;
}

.layout.layout--sidebyside #feedList.list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35em;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 14rem);
  padding: 0.25em 0;
  border-bottom: none;
}

.layout.layout--sidebyside #feedList .feed-list-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55em 0.75em;
  font-size: 0.93em;
  font-weight: 500;
  line-height: 1.4;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  margin: 0;
  box-shadow: none;
}

.layout.layout--sidebyside #feedList .feed-list-btn:hover,
.layout.layout--sidebyside #feedList .feed-list-btn:focus {
  color: #1a2a4d;
  background: #f1f5f9;
  border-color: #cbd5e1;
  text-decoration: none;
}

.layout.layout--sidebyside #feedList .feed-list-btn.active {
  color: #1a2a4d;
  font-weight: 600;
  background: #eff6ff;
  border-color: #93c5fd;
  text-decoration: none;
  box-shadow: inset 3px 0 0 #3b82f6;
}

/* --- News dropdown in main nav --- */
#site-nav-root {
  overflow: visible;
}

.site-nav-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.site-nav-dropdown-toggle {
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.site-nav-chevron {
  font-size: 0.75em;
  opacity: 0.85;
  transition: transform 0.2s;
  line-height: 1;
}

.site-nav-dropdown.open .site-nav-chevron {
  transform: rotate(180deg);
}

.site-nav-dropdown-menu {
  display: none;
  position: fixed;
  min-width: 11.5rem;
  background: #fff;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 42, 77, 0.15);
  padding: 0.35em 0;
  z-index: 1000;
  flex-direction: column;
  margin: 0;
}

.site-nav-dropdown.open .site-nav-dropdown-menu {
  display: flex;
}

.site-nav-dropdown-item {
  display: block;
  padding: 0.65em 1.15em;
  color: #1a2a4d;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98em;
  white-space: nowrap;
}

.site-nav-dropdown-item:hover {
  background: #f0f4ff;
}

.site-nav-dropdown-item.active {
  background: #e0e7ff;
  font-weight: 600;
}

/* --- News monitor (tabbed RSS pages) --- */
.news-monitor-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 1.2em;
}

.page-subnav--news {
  display: flex;
  align-items: center;
  gap: 0.65em 0.85em;
  flex-wrap: nowrap;
}

.page-subnav--news .page-subnav-inner.tab-bar {
  flex: 1 1 auto;
  min-width: 0;
}

.news-view-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}

.news-view-toggle__btn {
  padding: 0.32em 0.72em;
  font-size: 0.82em;
  font-weight: 500;
  line-height: 1.25;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.news-view-toggle__btn:hover {
  color: #1a2a4d;
}

.news-view-toggle__btn.active,
.news-view-toggle__btn[aria-pressed="true"] {
  background: #fff;
  color: #1a2a4d;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.news-view-toggle__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.news-monitor-view--mix .page-subnav-inner.tab-bar,
.news-monitor-view--mix .news-source-picker {
  opacity: 0.55;
  pointer-events: none;
}

/* --- Vietnam / grouped news: category bar matches main .site-nav pills --- */
.news-category-nav.site-nav {
  margin: 0 0 0.55em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.45em;
  padding: 0.55em 0.65em;
}

.news-category-nav.site-nav .site-nav-link {
  width: 100%;
  min-width: 0;
  padding: 0.55em 0.65em;
  font-size: 0.95em;
  text-align: center;
  box-sizing: border-box;
}

/* Desktop — normal nav sizing; category pills sized like site-nav, not stretched full width */
@media (min-width: 701px) {
  .page-subnav-link,
  .page-subnav .tab,
  .page-subnav .subcategory-btn {
    font-size: 1.02em;
    padding: 0.42em 0.22em 0.48em;
  }

  .page-subnav[aria-label="Vietnam section"] .page-subnav-link {
    font-size: 1.02em;
    padding: 0.48em 0.65em 0.55em;
  }

  .page-subnav-inner.tab-bar {
    gap: 0.35em 1.1em;
  }

  .news-category-nav.site-nav {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    grid-template-columns: unset;
  }

  .news-category-nav.site-nav .site-nav-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 6.5rem;
    padding: 0.7em 1.2em;
    font-size: 1.07em;
  }

  .news-view-toggle__btn {
    font-size: 0.85em;
    padding: 0.35em 0.75em;
  }
}

.page-subnav--grouped-sources {
  display: flex;
  align-items: center;
  gap: 0.65em 0.85em;
  flex-wrap: nowrap;
}

.page-subnav--grouped-sources .page-subnav-inner.tab-bar {
  flex: 1 1 auto;
  min-width: 0;
}

.feed-source {
  display: inline-block;
  margin-bottom: 0.35em;
  padding: 0.12em 0.45em;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
}

.site-nav-mobile {
  display: none;
  margin-bottom: 0.65em;
}

.site-nav-mobile__picker {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  width: 100%;
}

.site-nav-mobile__label {
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.site-nav-mobile__select {
  width: 100%;
  padding: 0.55em 0.65em;
  font-size: 0.95em;
  font-weight: 500;
  color: #1a2a4d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.site-nav-mobile__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.news-source-picker {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.news-source-picker__field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45em;
  width: 100%;
}

.news-source-picker__label {
  flex: 0 0 auto;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.news-source-picker__select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0.45em 0.55em;
  font-size: 0.92em;
  font-weight: 500;
  color: #1a2a4d;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.news-source-picker__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.news-source-picker-row {
  display: flex;
  flex: 1 1 auto;
  gap: 0.55em;
  min-width: 0;
}

.news-source-picker-row .news-source-picker {
  display: block;
  flex: 1 1 0;
  min-width: 0;
}

.page-subnav--grouped .page-subnav-inner.tab-bar {
  display: none;
}

.page-subnav--grouped {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45em 0.55em;
}

.page-subnav--grouped .news-source-picker-row {
  grid-column: 1;
  grid-row: 1;
}

.page-subnav--grouped .news-view-toggle {
  grid-column: 2;
  grid-row: 1;
  margin-left: 0;
  align-self: center;
}

@media (max-width: 700px) {
  .page-subnav--grouped .news-source-picker-row {
    flex-direction: column;
  }

  .page-subnav[aria-label="Vietnam section"] {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.45em;
    margin-bottom: 0.55em;
  }

  .page-subnav[aria-label="Vietnam section"] .page-subnav-link {
    flex: 0 0 auto;
  }

  .news-category-nav.site-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35em;
    padding: 0.45em 0.5em;
  }

  .news-category-nav.site-nav .site-nav-link {
    padding: 0.48em 0.35em;
    font-size: 0.86em;
  }

  .page-subnav--grouped {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45em;
  }

  .page-subnav--grouped .news-source-picker-row {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  .page-subnav--grouped .news-view-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-left: 0;
  }
}

/* Legacy: tab-bar inside panel (unused after subnav move) */
.tab-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 0.5em;
}

.tab {
  flex: 0 0 auto;
  padding: 0.9em 1.5em;
  cursor: pointer;
  background: #f5f5f5;
  border: none;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  transition: background 0.2s;
  font-size: 1em;
  min-width: 120px;
  color: #222;
}

.tab.active {
  background: #e0e7ff;
  color: #222;
}

.feed-list {
  margin-top: 1em;
}

.news-monitor-panel .feed-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
}

.news-monitor-panel .feed-item {
  width: 100%;
  max-width: 100%;
}

.feed-item {
  margin-bottom: 1em;
  background: #f6f8fc;
  border-radius: 8px;
  padding: 0.7em 1em;
  word-break: break-word;
  box-sizing: border-box;
}

.feed-title {
  font-size: 1.13em;
  font-weight: 500;
  margin-bottom: 0.1em;
  line-height: 1.3;
}

.feed-title a {
  color: #1a2a4d;
  text-decoration: none;
}

.feed-title a:hover {
  text-decoration: underline;
}

.entry-card h3 a {
  color: #1a2a4d;
  text-decoration: none;
  font-weight: inherit;
  display: inline;
  margin: 0;
}

.entry-card h3 a:hover {
  text-decoration: underline;
}

.entry-card__body h3 {
  margin: 0 0 0.15rem;
  line-height: 1.3;
}

.entry-card__body > p {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.feed-desc {
  color: #555;
  font-size: 0.97em;
  margin-top: 0;
  margin-bottom: 0.2em;
}

.feed-date {
  color: #888;
  font-size: 0.95em;
}

.news-monitor-loading,
.news-monitor-empty {
  color: #666;
  text-align: center;
  padding: 1.5em;
}

@media (max-width: 600px) {
  .tab-bar {
    margin-left: -0.5em;
    margin-right: -0.5em;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }

  .tab {
    font-size: 0.98em;
    min-width: 100px;
    padding: 0.8em 1em;
  }

  .feed-item {
    padding: 0.5em 0.75em;
    font-size: 0.97em;
  }
}

/* --- Home / today event links --- */
.event-title-link {
  color: #1a2a4d;
  font-weight: bold;
  text-decoration: none;
  transition: text-decoration 0.15s;
}

.event-title-link:hover {
  text-decoration: underline;
  cursor: pointer;
}

.entry-thumb-link {
  display: block;
  line-height: 0;
  grid-row: 1 / span 3;
  grid-column: 1;
}

.entry-thumb-link:hover .entry-thumb {
  opacity: 0.92;
}

.entry-thumb--placeholder {
  background: #eef2f7;
  border: 1px dashed #cbd5e1;
  box-sizing: border-box;
}

.event-actions {
  margin-top: 0.45em;
}

.event-wiki-primary {
  display: inline-block;
  font-size: 0.95em;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.event-wiki-primary:hover {
  text-decoration: underline;
}

.event-links-label {
  font-size: 0.88em;
  font-weight: 600;
  color: #64748b;
  margin-right: 0.15em;
}

/* --- Finance monitor --- */
.finance-section {
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 1.2em;
}

.stock-list {
  margin-top: 1em;
}

.stock-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5em 0;
  border-bottom: 1px solid #eee;
}

.news-list {
  margin-top: 2em;
}

.news-list .news-item {
  margin-bottom: 1em;
}

.news-list .news-item a {
  color: #1a2a4d;
  text-decoration: none;
}

.news-list .news-item a:hover {
  text-decoration: underline;
}

/* --- Home page widgets --- */
.wiki-random-item {
  margin-bottom: 1em;
}

.wiki-random-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 0.7em;
  vertical-align: middle;
}

.wiki-random-title {
  font-weight: 500;
}

.wiki-random-extract {
  color: #555;
  font-size: 0.97em;
}

.wiki-random-empty,
.history-empty {
  color: #888;
}

.history-event-card {
  display: flex;
  align-items: center;
  margin-bottom: 1em;
  background: #f6f8fc;
  border-radius: 8px;
  padding: 0.7em 1em;
}

.history-event-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 1em;
  vertical-align: middle;
  flex-shrink: 0;
}

.history-event-body {
  flex: 1;
}

/* =================================================================
   Responsive — phones & tablets
   ================================================================= */

@media (max-width: 900px) {
  .feed-browser-toolbar {
    margin-bottom: 0;
  }

  .feed-browser-page .feed-browser-view-toggle {
    flex: 0 0 auto;
    align-self: center;
  }

  .feed-browser-toolbar .controls,
  .feed-browser-toolbar .controls-left,
  .container > .controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    gap: 0.45em;
  }

  .feed-browser-toolbar .controls input[type="search"],
  .container > .controls input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 0.55em 0.65em;
  }

  .feed-browser-toolbar .controls button,
  .container > .controls button {
    margin-left: 0 !important;
    width: auto;
    flex: 0 0 auto;
    padding: 0.55em 0.85em;
    border-radius: 8px;
    white-space: nowrap;
  }

  .news-monitor-panel {
    padding: 0.75em 0.5em;
  }

  .news-view-toggle__btn {
    font-size: 0.78em;
    padding: 0.38em 0.62em;
  }

  .finance-section {
    padding: 0.85em 0.65em;
  }

  .layout.layout--sidebyside {
    gap: 0.85rem;
  }

  .panel {
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .site-nav.site-nav--desktop {
    display: none;
  }

  .site-nav-mobile {
    display: block;
  }

  .site-nav-dropdown-menu {
    position: static !important;
    width: 100%;
    margin-top: 0.35em;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  .page-subnav {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    padding: 0;
    margin-bottom: 0.65em;
    border-bottom: none;
  }

  .page-subnav[aria-label="Vietnam section"] {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.15em 0 0.45em;
    margin-bottom: 0.55em;
    scrollbar-width: thin;
  }

  .page-subnav[aria-label="Vietnam section"] .page-subnav-link {
    flex: 0 0 auto;
    text-align: left;
  }

  .page-subnav--today {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.15em 0 0.45em;
    margin-bottom: 0.55em;
    scrollbar-width: thin;
    max-width: 100%;
  }

  .page-subnav--today .page-subnav-inner.tab-bar {
    flex: 0 0 auto;
    min-width: min-content;
    padding-right: 0.35em;
  }

  .page-subnav--today .today-tab {
    flex: 0 0 auto;
  }

  .page-subnav--news {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45em 0.55em;
    overflow: visible;
  }

  .page-subnav--news .page-subnav-inner.tab-bar {
    display: none;
  }

  .page-subnav--news .news-source-picker {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }

  .page-subnav--news .news-view-toggle {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    align-self: center;
  }

  .feed-browser-page .site-nav-mobile {
    display: none;
  }

  .container {
    width: calc(100% - 0.6em);
    margin: 0.5em auto 1em;
    padding: 0.85em 0.75em 1em;
    border-radius: 12px;
  }

  .container h1,
  .home-header h1 {
    font-size: 1.55em;
  }

  .container h2 {
    font-size: 1.1em;
  }

  .site-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.35em 0.55em;
  }

  .site-top__main {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.35em 0.55em;
    min-width: 0;
  }

  .site-prefs__label {
    display: none;
  }

  .site-brand {
    font-size: 1.35em;
    flex-shrink: 0;
  }

  .site-page-title {
    font-size: 0.95em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .today-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35em;
  }

  .today-day-nav {
    margin-top: 0;
    margin-left: 0;
  }

  .today-date {
    font-size: 1.1em;
  }

  .entry {
    grid-template-columns: 1fr;
    padding: 0.65rem 0.75rem 0.5rem;
    gap: 0.5em;
  }

  .entry-thumb {
    grid-column: 1;
    grid-row: auto;
    width: 52px;
    height: 52px;
  }

  .entry-thumb--placeholder {
    display: none;
  }

  .entry-content {
    grid-column: 1;
    min-width: 0;
  }

  .stock-item {
    flex-wrap: wrap;
    gap: 0.2em 0.75em;
    font-size: 0.95em;
  }

  .news-list .news-item a {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .category-list {
    gap: 0.35em 0.55em;
  }

  .history-wiki-row {
    gap: 1.2em;
  }

  .history-event-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-event-thumb {
    margin-right: 0;
    margin-bottom: 0.5em;
  }

  .feed-item {
    padding: 0.55em 0.65em;
  }

  .feed-browser-page .entry-card--photos-on .entry-card__content,
  .feed-item--photos-on .feed-item__content {
    gap: 0.65rem;
  }

  .feed-browser-page .entry-card__thumb-slot,
  .feed-item__thumb-slot {
    flex: 0 0 88px;
    width: 88px;
    height: 62px;
  }

  .feed-title {
    font-size: 1.02em;
  }

  .event-links a {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  #goToFeedBrowser.nav-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5em;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .page-subnav-link,
  .page-subnav .tab,
  .page-subnav .subcategory-btn {
    font-size: 0.88em;
  }

  .layout.layout--sidebyside #feedList .feed-list-btn {
    font-size: 0.88em;
  }

  .jeopardy-page .jeopardy-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Home page alternative views --- */
.page-subnav--home {
  display: flex;
  justify-content: center;
  padding: 0.35em 0;
}

.home-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}

.home-view-toggle__btn {
  padding: 0.35em 0.85em;
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.25;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.home-view-toggle__btn:hover {
  color: #1a2a4d;
}

.home-view-toggle__btn.active,
.home-view-toggle__btn[aria-pressed="true"] {
  background: #fff;
  color: #1a2a4d;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.home-view {
  display: none;
  margin-bottom: 1em;
}

.home-view--active {
  display: block;
}

.home-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85em;
}

.home-dashboard-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-dashboard-card__body {
  flex: 1 1 auto;
  min-height: 4.5em;
}

.home-dashboard-previews .entry-card--compact {
  margin-bottom: 0.7em;
  padding-bottom: 0.7em;
  border-bottom: 1px solid #eef2f7;
}

.home-dashboard-previews .entry-card--compact:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.home-dashboard-previews .entry-card--compact h3,
.home-dashboard-previews .entry-card--compact h3 a {
  font-size: 1.05em;
  line-height: 1.35;
}

.home-dashboard-previews .entry-meta {
  font-size: 0.88em;
  margin-bottom: 0.2em;
}

.home-dashboard-card .home-ency-spotlight {
  margin-top: 0.15em;
}

.home-dashboard-desc {
  margin: 0;
  font-size: 1.05em;
  color: #475569;
  line-height: 1.45;
}

.home-dashboard-card__link {
  display: inline-block;
  margin-top: 0.65em;
  font-size: 0.98em;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}

.home-dashboard-card__link:hover {
  text-decoration: underline;
}

.home-dashboard-stat {
  font-size: 1.4em;
  font-weight: 600;
  margin: 0 0 0.25em;
  color: #1a2a4d;
}

.home-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-preview-item {
  margin-bottom: 0.55em;
  font-size: 0.92em;
  line-height: 1.35;
}

.home-preview-item a {
  color: #1a2a4d;
  text-decoration: none;
}

.home-preview-item a:hover {
  text-decoration: underline;
}

.home-preview-date {
  display: block;
  font-size: 0.82em;
  color: #64748b;
  margin-top: 0.15em;
}

.home-muted {
  color: #64748b;
  font-size: 0.92em;
  margin: 0;
}

.home-skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.home-skeleton-line {
  height: 0.85em;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: home-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes home-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.home-digest-header {
  margin: 0 0 0.75em;
  padding: 0;
  background: none;
}

.home-digest-date {
  margin: 0;
  font-size: 0.92em;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
}

.home-digest-block {
  margin-bottom: 0.75em;
  padding: 0.85em 1em;
}

.home-digest-block__title {
  margin: 0 0 0.5em;
  font-size: 0.82em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.home-digest-markets .home-stock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  margin-bottom: 0.65em;
}

.home-stock-chip {
  display: inline-block;
  padding: 0.25em 0.55em;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.88em;
}

.home-digest-history {
  margin: 0;
  line-height: 1.45;
}

.home-news-strips {
  display: flex;
  flex-direction: column;
  gap: 0.85em;
}

.home-news-strip {
  margin-bottom: 0;
}

.home-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}

.home-strip-header h2 {
  margin: 0;
}

.home-strip-link {
  font-size: 0.88em;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}

.home-strip-link:hover {
  text-decoration: underline;
}

.entry-card--compact h3 {
  font-size: 1em;
  margin: 0.25em 0 0;
}

.home-explore-spotlight,
.home-explore-context {
  margin-bottom: 0.85em;
}

.home-explore-context {
  margin-bottom: 0;
}

.home-ency-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.4em;
}

.home-ency-title {
  font-weight: 600;
  margin: 0 0 0.25em;
}

.home-ency-spotlight {
  display: flex;
  gap: 0.75em;
  align-items: flex-start;
}

.home-ency-spotlight-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.home-ency-spotlight-body h3 {
  margin: 0 0 0.4em;
  font-size: 1.28em;
  line-height: 1.25;
  color: #1a2a4d;
}

.home-ency-spotlight-body p {
  margin: 0;
  font-size: 1.05em;
  color: #475569;
  line-height: 1.5;
}

.home-ency-links a {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.98em;
}

.home-wiki-panel {
  margin-top: 0.5em;
}

.home-wiki-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}

.home-wiki-header h2 {
  margin: 0;
}

.home-wiki-col-title {
  margin: 0 0 0.65em;
  font-size: 0.95em;
  color: #334155;
}

.home-wiki-row .home-wiki-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.65em;
}

.home-wiki-row .wiki-random-item.home-wiki-card {
  list-style: none;
  margin-bottom: 0.75em;
}

.home-wiki-row .wiki-random-extract {
  display: block;
  margin-top: 0.2em;
}

@media (max-width: 900px) {
  .home-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .home-view-toggle__btn {
    padding: 0.32em 0.6em;
    font-size: 0.8em;
  }
}

@media (max-width: 700px) {
  .home-wiki-row {
    flex-direction: column;
    gap: 1.25em;
  }
}

/* --- Today in History tabs --- */
.page-subnav--today .page-subnav-inner.tab-bar {
  gap: 0.35em 1.1em;
}

.page-subnav--today .today-tab {
  font: inherit;
}

/* --- Encyclopedia (Browse / Discover) --- */
.page-subnav--encyclopedia {
  margin-bottom: 0.5em;
}

.discover-toolbar {
  margin-bottom: 1em;
  padding: 0.75em 1em;
}

.discover-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65em 1em;
}

.discover-toolbar__letter {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.95em;
  color: #334155;
}

.discover-toolbar__letter select {
  min-width: 9em;
  padding: 0.35em 0.5em;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.discover-root {
  min-height: 8em;
}

.discover-list {
  display: flex;
  flex-direction: column;
  gap: 0.65em;
}

.discover-list .discover-card.entry {
  margin-bottom: 0;
}

.discover-loading {
  color: #64748b;
  margin: 0.5em 0;
}

.discover-card .desc {
  margin-top: 0.35em;
  color: #475569;
  line-height: 1.45;
}

.discover-card .links {
  margin-top: 0.5em;
}

.discover-meta {
  margin-top: 0.75em;
  font-size: 0.88em;
}

/* --- Encyclopedia Topics --- */
.topics-root {
  min-height: 8em;
}

.topics-grid {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.topics-grid--cols2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1em;
  align-items: start;
}

.topics-grid--cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1em;
  align-items: start;
}

.topics-grid--list {
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

.topics-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  margin-bottom: 1em;
}

.topics-view-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.88em;
  padding: 0.35em 0.85em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topics-view-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.topics-view-btn--active {
  background: #2a4d7c;
  border-color: #2a4d7c;
  color: #fff;
}

.topics-view-btn:focus-visible {
  outline: 2px solid #2a4d7c;
  outline-offset: 2px;
}

.topics-topic--list {
  height: auto;
  min-height: 0;
}

.topics-topic__list {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.topics-list-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65em;
  padding: 0.55em 0.65em;
  border: 1px solid #e2e8f0;
  border-radius: 0.45em;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.topics-list-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.topics-list-row__thumb {
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 0.35em;
}

.topics-list-row__thumb--placeholder {
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.topics-list-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.topics-list-row__title {
  font-weight: 600;
  font-size: 0.95em;
  color: #1e293b;
  line-height: 1.3;
}

.topics-list-row__meta {
  font-size: 0.78em;
  color: #64748b;
}

.topics-list-row__desc {
  font-size: 0.86em;
  color: #475569;
  line-height: 1.4;
}

.desc--loading {
  color: #64748b;
  font-style: italic;
}

.topics-topic {
  display: flex;
  flex-direction: column;
  padding: 0.85em 1em 1em;
}

.topics-topic--card {
  height: auto;
  min-height: 0;
}

.topics-topic__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65em;
  flex-wrap: wrap;
  margin-bottom: 0.65em;
  flex-shrink: 0;
}

.topics-topic__header h2 {
  margin: 0;
  font-size: 1.05em;
  color: #2a4d7c;
}

.topics-topic__stage {
  display: flex;
  align-items: stretch;
  gap: 0.45em;
  flex: 0 0 auto;
}

.topics-topic__card {
  flex: 1;
  min-width: 0;
  display: flex;
}

.topics-topic__card .topics-hero-card {
  width: 100%;
}

.topics-topic__arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #2a4d7c;
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.topics-topic__arrow--spacer {
  visibility: hidden;
  pointer-events: none;
}

.topics-topic__arrow:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.topics-topic__arrow:focus-visible {
  outline: 2px solid #2a4d7c;
  outline-offset: 2px;
}

.topics-topic__counter {
  display: block;
  margin-top: 0.55em;
  text-align: center;
  font-size: 0.82em;
  color: #64748b;
  flex-shrink: 0;
}

.topics-hero-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.65em;
  background: #fff;
  width: 100%;
}

.topics-hero-card__media {
  aspect-ratio: 3 / 2;
  width: 100%;
  background: #f1f5f9;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topics-hero-card__media .entry-thumb {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

.topics-hero-card__media .entry-thumb--placeholder {
  width: 100%;
  height: 100%;
  margin: 0;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.topics-hero-card .entry-content {
  display: flex;
  flex-direction: column;
  padding: 0.75em 0.85em 0.85em;
}

.topics-hero-card .entry-title {
  font-size: 1.05em;
  line-height: 1.3;
  height: calc(1.05em * 1.3 * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.topics-item__meta {
  font-size: 0.82em;
  color: #64748b;
  margin-bottom: 0.25em;
  height: 1.2em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topics-item__meta--spacer {
  visibility: hidden;
}

.topics-hero-card .desc {
  margin-top: 0.4em;
  font-size: 0.92em;
  line-height: 1.45;
  height: calc(0.92em * 1.45 * 7);
  overflow: hidden;
}

.topics-hero-card .links {
  margin-top: 0.5em;
}

@media (max-width: 960px) {
  .topics-grid--cols3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topics-grid--cols2,
  .topics-grid--cols3 {
    grid-template-columns: 1fr;
  }
}

.topics-topic--pinned .topics-topic__header h2 {
  color: #1e3a5f;
}

.topics-category__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75em;
  flex-wrap: wrap;
  margin-bottom: 0.65em;
}

.topics-category__header h2 {
  margin: 0;
  font-size: 1.15em;
}

.topics-generated {
  margin: 0 0 1em;
  font-size: 0.88em;
}

.topics-category__desc {
  margin: 0 0 0.75em;
  font-size: 0.92em;
}

.topics-category__count {
  font-size: 0.82em;
  font-weight: 500;
  color: #64748b;
}

.topics-sample-card .desc {
  line-height: 1.45;
}

.topics-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.85em;
}

.topics-list-card {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  padding: 0.85em 1em;
  border: 1px solid #e2e8f0;
  border-radius: 0.55em;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 5.5rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.topics-list-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.topics-list-card--pinned {
  border-color: #94a3b8;
  background: #f8fafc;
}

.topics-list-card__title {
  font-weight: 600;
  font-size: 1em;
  line-height: 1.3;
  color: #2a4d7c;
}

.topics-list-card__desc {
  font-size: 0.86em;
  line-height: 1.4;
  color: #64748b;
}

.topics-list-card__count {
  margin-top: auto;
  padding-top: 0.35em;
  font-size: 0.82em;
  font-weight: 500;
  color: #64748b;
}

.topics-browse-header {
  margin-bottom: 0.75em;
}

.topics-browse-header h1 {
  margin: 0.35em 0 0;
  font-size: 1.45em;
}

.topics-pager {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin: 0.65em 0;
  flex-wrap: wrap;
}

.topics-pager__info {
  font-size: 0.92em;
  color: #64748b;
}

/* --- Unified Search --- */
.search-intro {
  margin: 0 0 0.65em;
}

.search-controls {
  margin-bottom: 1em;
  padding: 0.85em 1em;
}

.search-input-wrap {
  display: block;
  margin-bottom: 0.65em;
}

.search-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55em 0.75em;
  font: inherit;
  font-size: 1.05em;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.search-input:focus {
  outline: 2px solid #93c5fd;
  border-color: #3b82f6;
}

.search-status {
  margin: 0.55em 0 0;
  font-size: 0.88em;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.85em;
}

.search-group .search-group__list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.search-hit .entry-meta {
  margin-bottom: 0.2em;
}

.search-hit .meta-source {
  font-size: 0.88em;
  color: #64748b;
}

.search-hint {
  margin: 0.5em 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  .discover-toolbar__row {
    flex-direction: column;
    align-items: stretch;
  }

  .discover-toolbar__letter select {
    flex: 1;
    min-width: 0;
  }
}
