:root {
  color-scheme: light;
  --brand: #ff385c;
  --brand-dark: #e31c5f;
  --brand-soft: #fff0f3;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f7f7f7;
  --text: #222222;
  --text-secondary: #717171;
  --text-light: #b0b0b0;
  --border: #dddddd;
  --border-strong: #222222;
  --career: #222222;
  --career-soft: #f7f7f7;
  --env: #008a05;
  --env-soft: #eef8ee;
  --ai: #5b54e5;
  --ai-dark: #4338ca;
  --ai-soft: #f4f3ff;
  --ai-border: #c7c2ff;
  --ai-glow: rgba(91, 84, 229, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
  --shadow-search: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-search-hover: 0 2px 4px rgba(0, 0, 0, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-height: 168px;
  font-family: "Noto Sans JP", "Circular", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.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;
}

.app {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 16px 24px 12px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-home {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.brand-home:hover .brand-title {
  color: var(--brand-dark);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.search-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}

body.detail-view .search-stack {
  display: none;
}

.site-header {
  transition:
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

body.detail-view {
  --detail-header-offset: 168px;
}

@media (max-width: 743px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translate3d(0, 0, 0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  body.list-view .search-shell,
  body.list-view #hide-empty-wrap,
  body.list-view #result-count,
  body.list-view #active-filters {
    overflow: hidden;
    max-height: 320px;
    opacity: 1;
    transition:
      max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.22s ease,
      margin-top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.list-view.header-collapsed .search-shell,
  body.list-view.header-collapsed #hide-empty-wrap,
  body.list-view.header-collapsed #result-count,
  body.list-view.header-collapsed #active-filters:not(.hidden) {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }

  body.detail-view .header-top {
    overflow: hidden;
    max-height: 120px;
    opacity: 1;
    transition:
      max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.22s ease;
  }

  body.detail-view.header-collapsed .header-top {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }
}

.detail-header-nav {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

.detail-header-nav.hidden {
  display: none !important;
}

.detail-header-nav-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(760px, 100%);
  gap: 0;
}

.detail-header-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.detail-header-identity {
  min-width: 0;
  text-align: center;
}

.detail-header-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header-subtitle {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header-subtitle span {
  color: var(--env);
  font-weight: 600;
}

.detail-header-nav-inner .detail-pager {
  justify-self: end;
}

.detail-header-nav-inner .detail-section-nav {
  margin: 10px 0 0;
  width: 100%;
}

.mode-tabs {
  display: inline-flex;
  gap: 28px;
  padding: 0 8px 12px;
  background: transparent;
  border-radius: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-tabs::-webkit-scrollbar {
  display: none;
}

.mode-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 0;
  padding: 8px 2px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  box-shadow: none;
}

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.active {
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.mode-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.search-shell {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0;
}

.search-pill {
  display: flex;
  align-items: stretch;
  width: min(760px, 100%);
  min-height: 66px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-search);
  transition: box-shadow 0.2s ease;
}

.search-pill:focus-within,
.search-pill:hover {
  box-shadow: var(--shadow-search-hover);
}

.search-segment {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px 24px;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: text;
}

.search-segment-grow {
  flex: 1 1 auto;
}

.search-segment-button {
  cursor: pointer;
  min-width: 140px;
}

.search-segment-button:hover,
.search-segment-button:focus-visible {
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
}

.search-segment-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.search-segment-input {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
}

.search-segment-input::placeholder {
  color: var(--text-light);
}

.search-segment-value {
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-divider {
  width: 1px;
  align-self: center;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

.search-submit {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: auto 8px auto 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.search-submit svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.search-submit:hover {
  background: var(--brand-dark);
  transform: scale(1.04);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.filter-checkbox input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--text);
}

.filter-chip-remove {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
}

.result-count {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.main-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 8px 24px 80px;
}

@media (max-width: 743px) {
  .main-content {
    transition: padding-top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.section-block {
  margin-top: 32px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px 16px;
}

.profile-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-card:hover {
  border-color: #b0b0b0;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.profile-card-head {
  display: grid;
  gap: 4px;
}

.profile-card-head-env {
  gap: 6px;
}

.profile-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.profile-card-meta {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.4;
}

.profile-card-summary {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card-kicker {
  margin: 10px 0 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.profile-card-summary-placeholder {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.profile-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-card-env-empty {
  opacity: 0.82;
  border-style: dashed;
}

.profile-card-env-empty .profile-card-summary {
  color: var(--text-secondary);
}

.profile-card-note-empty {
  color: var(--text-secondary);
}

.profile-card-env-nested {
  margin-left: 12px;
  border-left: 3px solid var(--env-soft);
}

.industry-group {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.industry-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.industry-group-summary::-webkit-details-marker {
  display: none;
}

.industry-group-summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--env);
  transition: transform 0.15s ease;
}

.industry-group[open] > .industry-group-summary::before {
  transform: rotate(90deg);
}

.industry-group-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.industry-group-meta {
  color: var(--text-secondary);
  font-size: 0.84rem;
  white-space: nowrap;
}

.industry-group-grid {
  padding: 0 16px 16px;
  margin-bottom: 0;
}

.detail-parent {
  margin: -8px 0 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.detail-parent span {
  color: var(--env);
  font-weight: 600;
}

.profile-card-note {
  margin: 0;
  font-size: 0.8rem;
  color: #9a3412;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.tag-career {
  background: var(--career-soft);
  color: var(--text);
}

.tag-env {
  background: var(--env-soft);
  color: var(--env);
}

.tag-facet {
  background: #fff;
  border: 1px solid var(--border);
}

.detail-panel {
  width: min(760px, 100%);
  max-width: 760px;
  margin: 0 auto;
}

.detail-panel-enter {
  opacity: 0;
  transform: translateX(var(--detail-enter-offset, 0));
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.detail-panel-enter.from-left {
  --detail-enter-offset: -28px;
}

.detail-panel-enter.from-right {
  --detail-enter-offset: 28px;
}

.detail-panel-enter-active {
  opacity: 1;
  transform: translateX(0);
}

.detail-pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-pager-position {
  min-width: 4.8em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.detail-pager-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.detail-pager-button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text);
}

.detail-pager-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-button,
.back-link {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

.back-link {
  width: auto;
  min-width: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
}

.detail-heading {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

body.detail-view .detail-heading {
  display: none;
}

.detail-section-nav {
  display: flex;
  gap: 0;
  margin: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav-link {
  flex: 0 0 auto;
  padding: 11px 14px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.section-nav-link:hover {
  color: var(--text);
}

.section-nav-link.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand-dark);
  font-weight: 600;
}

.section-note {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.summary-section {
  border-top: none;
  padding-top: 0;
}

.summary-section .section-note {
  display: none;
}

.ai-summary-panel {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 14px;
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 243, 255, 0.92)),
    var(--ai-soft);
  box-shadow:
    0 1px 2px rgba(67, 56, 202, 0.06),
    0 8px 24px var(--ai-glow);
}

.ai-summary-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #8b83ff, var(--ai-dark));
}

.ai-summary-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-left: 6px;
}

.ai-summary-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ai-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(91, 84, 229, 0.12);
  color: var(--ai-dark);
  font-size: 0.95rem;
  line-height: 1;
}

.ai-summary-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.ai-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(91, 84, 229, 0.12);
  color: var(--ai-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ai-summary-badge.pending {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

.ai-summary-panel.pending .summary-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.ai-summary-confidence {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ai-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ai-dark);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ai-summary-body {
  padding: 0 6px 12px 6px;
}

.ai-summary-panel .summary-text {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.75;
  color: var(--text);
}

.ai-summary-footnote {
  margin: 0 6px 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ai-border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.55;
}

.ai-summary-panel .evidence-toggle {
  margin-top: 2px;
  margin-left: 6px;
  margin-right: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.ai-summary-panel .evidence-toggle-leading {
  color: var(--ai-dark);
}

.ai-summary-panel.expanded {
  border-color: var(--ai-dark);
  box-shadow:
    0 1px 2px rgba(67, 56, 202, 0.08),
    0 10px 28px rgba(91, 84, 229, 0.16);
}

.ai-summary-panel .evidence-panel {
  margin: 8px 6px 0;
}

.summary-section .summary-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
}

.detail-section {
  scroll-margin-top: 120px;
}

body.detail-view .detail-section {
  scroll-margin-top: var(--detail-header-offset);
}

.detail-lead {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.section h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.profile-attr-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.profile-attr-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.profile-attr-value {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.profile-attr-row-extra .profile-attr-label {
  color: var(--text);
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.item-card:last-child {
  border-bottom: 1px solid var(--border);
}

.item-category {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: none;
}

.item-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.item-statement {
  margin: 0;
}

.item-meta {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.category-block {
  margin-top: 24px;
}

.category-block h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--env);
}

.episode-card.expandable-item {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.episode-card.expandable-item .item-card-body p {
  margin: 0 0 8px;
}

.episode-foot {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.speaker-link {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.material-note {
  background: var(--env-soft);
  border: 1px solid #b8e0b8;
  color: #0f5f12;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.expandable-item.has-evidence {
  transition: background 0.15s ease, border-color 0.15s ease;
}

.expandable-item.expanded {
  border-color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 56, 92, 0.12);
  background: var(--surface);
}

.evidence-panel-heading {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.evidence-toggle {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}

.evidence-toggle:hover {
  border-color: var(--text);
  color: var(--text);
}

.evidence-toggle-leading {
  color: var(--brand);
}

.evidence-toggle-text {
  flex: 1;
  text-align: left;
  font-size: 0.82rem;
}

.evidence-toggle-chevron {
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.expandable-item.expanded .evidence-toggle-chevron {
  transform: rotate(180deg);
}

.evidence-panel[hidden] {
  display: none !important;
}

.evidence-panel:not([hidden]) {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.evidence-quote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.evidence-meta {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.evidence-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.88rem;
}

.ai-summary-card .evidence-toggle {
  background: var(--brand-soft);
}

.episode-card.expandable-item.expanded {
  border-color: #b8e0b8;
}

.episode-card .evidence-quote {
  border-left-color: var(--env);
  background: var(--env-soft);
}

.episode-card .evidence-toggle-leading {
  color: var(--env);
}

.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
}

.filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.filter-modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.filter-modal-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.filter-modal-header h2 {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  justify-self: end;
}

.filter-modal-body {
  overflow: auto;
  padding: 8px 20px 20px;
}

.filter-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.filter-section:last-child {
  border-bottom: 0;
}

.filter-section h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

.filter-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-options-scroll {
  max-height: 180px;
  overflow: auto;
}

.filter-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-option:hover {
  border-color: var(--text);
}

.filter-option.selected {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.filter-option-count {
  color: var(--text-light);
  font-size: 0.82rem;
}

.filter-option.selected .filter-option-count {
  color: rgba(255, 255, 255, 0.72);
}

.filter-modal-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  background: linear-gradient(to right, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.03);
}

@media (min-width: 744px) {
  .filter-modal {
    place-items: center;
    padding: 24px;
  }

  .filter-modal-panel {
    border-radius: 24px;
    max-height: min(80vh, 720px);
  }
}

@media (max-width: 743px) {
  .header-inner {
    padding: 12px 16px 10px;
  }

  .header-top {
    align-items: flex-start;
  }

  .search-stack {
    align-items: stretch;
  }

  .mode-tabs {
    align-self: center;
  }

  .search-pill {
    min-height: auto;
    flex-wrap: wrap;
    border-radius: 32px;
    padding: 8px;
  }

  .search-segment {
    width: 100%;
    padding: 12px 16px;
  }

  .search-divider {
    display: none;
  }

  .search-segment-button {
    width: calc(100% - 56px);
  }

  .search-submit {
    margin: 8px;
  }

  .main-content {
    padding-inline: 16px;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .detail-header-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .detail-header-nav-inner .detail-section-nav {
    margin-top: 8px;
  }
}
