/* ============================================
   FACT CHECK SITE - Complete Stylesheet
   Dark mode default, light mode toggle
   Mobile-first responsive design
   ============================================ */

/* --- Fonts --- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* --- CSS Variables --- */
:root {
  --font-main: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 860px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s ease;

  /* Verdict colors (constant) */
  --color-false: #ef4444;
  --color-false-bg: rgba(239,68,68,0.12);
  --color-mostly-false: #f97316;
  --color-mostly-false-bg: rgba(249,115,22,0.12);
  --color-half-true: #eab308;
  --color-half-true-bg: rgba(234,179,8,0.12);
  --color-withhold: #6b7280;
  --color-withhold-bg: rgba(107,114,128,0.12);
  --color-true: #22c55e;
}

/* --- Dark Theme (default) --- */
[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e35;
  --bg-card-hover: #252544;
  --bg-elevated: #2a2a4a;
  --bg-input: #16162b;
  --border-color: #2a2a4a;
  --border-light: #1f1f3a;

  --text-primary: #f0f0f5;
  --text-secondary: #a0a8ba;
  --text-tertiary: #6b7280;
  --text-link: #60a5fa;

  --accent: #6366f1;
  --accent-hover: #818cf8;

  --header-bg: rgba(15,15,26,0.85);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.4);
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-elevated: #f0f1f3;
  --bg-input: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f0f1f3;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-link: #2563eb;

  --accent: #4f46e5;
  --accent-hover: #6366f1;

  --header-bg: rgba(248,249,251,0.9);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-elevated: 0 4px 16px rgba(0,0,0,0.1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-img {
  height: 28px;
  width: auto;
}

.logo-img.logo-dark {
  display: block;
}
.logo-img.logo-light {
  display: none;
}
[data-theme="light"] .logo-img.logo-dark {
  display: none;
}
[data-theme="light"] .logo-img.logo-light {
  display: block;
}

.logo-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.logo-check {
  display: none; /* replaced by SVG logo */
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-xs);
  font-size: 18px;
  font-weight: 700;
}

.logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


.header-quiz-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}

.header-quiz-btn:hover {
  opacity: 0.85;
}

.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
}

[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline; }

/* --- Focus Styles (a11y) --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Theme Transition --- */
html, body,
.site-header, .main-content, .site-footer,
.claim-card, .filters-bar, .search-bar,
.dashboard-card, .detail-view {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Main Content --- */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-count {
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tab.active .tab-count {
  background: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 32px 16px 24px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* --- Summary Bar --- */
.summary-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-width: 80px;
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 2px;
}

.summary-stat.total .stat-number { color: var(--accent); }
.summary-stat.false .stat-number { color: var(--color-false); }
.summary-stat.mostly-false .stat-number { color: var(--color-mostly-false); }
.summary-stat.half-true .stat-number { color: var(--color-half-true); }

/* --- Filters --- */
/* --- Search Bar --- */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  min-height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-main);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition);
}

.search-clear:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.filters-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-toggle-btn {
  display: none;
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  margin-bottom: 8px;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
}

.filter-toggle-btn:hover {
  border-color: var(--text-tertiary);
}

.filter-toggle-icon {
  transition: transform 0.2s ease;
  font-size: 12px;
}

.filter-toggle-btn.open .filter-toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .filter-toggle-btn {
    display: flex;
    margin-bottom: 12px;
  }
  .filters-bar {
    margin-bottom: 12px;
    display: none !important;
  }
  .filters-bar.expanded {
    display: flex !important;
    flex-direction: column;
  }
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 48px;
  flex-shrink: 0;
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 14px;
  min-height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .chip {
    padding: 8px 16px;
    min-height: 44px;
    font-size: 14px;
  }
}

.chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip.verdict-false.active {
  background: var(--color-false);
  border-color: var(--color-false);
}

.chip.verdict-mostly-false.active {
  background: var(--color-mostly-false);
  border-color: var(--color-mostly-false);
}

.chip.verdict-half-true.active {
  background: var(--color-half-true);
  border-color: var(--color-half-true);
}

.sort-select {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-main);
  cursor: pointer;
}

.filter-result-count {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  padding-left: 4px;
}

.btn-filter-reset {
  padding: 4px 12px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-filter-reset:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Claims List --- */
.claims-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Claim Card --- */
.claim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.claim-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.claim-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 36px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  flex: 1;
}

/* --- Verdict Badge --- */
.verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-false {
  background: var(--color-false-bg);
  color: var(--color-false);
  border: 1px solid rgba(239,68,68,0.25);
}

.badge-mostly-false {
  background: var(--color-mostly-false-bg);
  color: var(--color-mostly-false);
  border: 1px solid rgba(245,158,11,0.25);
}

.badge-half-true {
  background: var(--color-half-true-bg);
  color: var(--color-half-true);
  border: 1px solid rgba(234,179,8,0.25);
}

.badge-withhold {
  background: var(--color-withhold-bg);
  color: var(--color-withhold);
  border: 1px solid rgba(107,114,128,0.25);
}

/* --- Card Summary (bullet points) --- */
.card-summary {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-color);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.card-summary .summary-line {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.card-summary .summary-line:last-child {
  margin-bottom: 0;
}

.card-summary .summary-label {
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  min-width: 40px;
}

.card-summary .summary-value {
  color: var(--text-secondary);
}

.card-summary .summary-line.verdict .summary-value {
  color: var(--color-false);
}

.claim-card[data-verdict="대부분거짓"] .card-summary .summary-line.verdict .summary-value {
  color: var(--color-mostly-false);
}

.claim-card[data-verdict="절반사실"] .card-summary .summary-line.verdict .summary-value {
  color: var(--color-half-true);
}

/* Card border accent by verdict */
.claim-card[data-verdict="거짓"] {
  border-left: 3px solid var(--color-false);
}

.claim-card[data-verdict="대부분거짓"] {
  border-left: 3px solid var(--color-mostly-false);
}

.claim-card[data-verdict="절반사실"] {
  border-left: 3px solid var(--color-half-true);
}

/* --- Card Footer --- */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

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

.card-tag {
  padding: 3px 10px;
  background: var(--bg-elevated);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.card-speaker {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.card-share-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.card-share-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* --- Detail View --- */
.detail-view {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.detail-nav-arrows {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-share {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-share:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Detail Content --- */
.detail-header {
  margin-bottom: 28px;
}

.detail-claim-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.detail-claim-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.detail-verdict-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-verdict-badge {
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 800;
}

.detail-origin {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

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

.detail-origin-item a {
  color: var(--text-link);
  text-decoration: none;
}

.detail-origin-item a:hover {
  text-decoration: underline;
}

/* --- Summary Block (top of detail) --- */
.detail-summary-block {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.detail-summary-block h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.detail-summary-block .summary-line {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.6;
}

.detail-summary-block .summary-line:last-child {
  margin-bottom: 0;
}

.detail-summary-block .summary-label {
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.detail-summary-block .summary-value {
  color: var(--text-secondary);
}

/* --- Collapsible Sections --- */
.collapsible {
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--bg-card);
  transition: background var(--transition);
  user-select: none;
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
}

.collapsible-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.collapsible-icon {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.collapsible.open .collapsible-body {
  max-height: 5000px;
}

.collapsible-content {
  padding: 0 20px 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.collapsible-content p {
  margin-bottom: 12px;
}

.collapsible-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

.collapsible-content ul,
.collapsible-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.collapsible-content li {
  margin-bottom: 6px;
}

.collapsible-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--bg-primary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.collapsible-content a {
  color: var(--text-link);
  text-decoration: none;
}

.collapsible-content a:hover {
  text-decoration: underline;
}

/* --- Arguments Section (prominent Q&A style) --- */
.arguments-section {
  margin: 28px 0;
}

.arguments-section > h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.argument-card {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.argument-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.argument-header:hover {
  background: var(--bg-card-hover);
}

.argument-q {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}

.argument-verdict-mini {
  flex-shrink: 0;
}

.argument-header .collapsible-icon {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.argument-card.open .argument-header .collapsible-icon {
  transform: rotate(180deg);
}

.argument-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.argument-card.open .argument-body {
  max-height: 5000px;
  padding: 0 20px 20px;
}

.argument-body p {
  margin-bottom: 14px;
}

.argument-body p:last-child {
  margin-bottom: 0;
}

.argument-body strong {
  color: var(--text-primary);
}

/* --- Sources Section --- */
.sources-section {
  margin: 28px 0;
}

.sources-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--transition);
  text-decoration: none;
}

a.source-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
}

.source-type-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}

.source-type-badge.legal { color: #a78bfa; background: rgba(167,139,250,0.12); }
.source-type-badge.official { color: #60a5fa; background: rgba(96,165,250,0.12); }
.source-type-badge.research { color: #34d399; background: rgba(52,211,153,0.12); }
.source-type-badge.news { color: var(--text-tertiary); }

.citation-type {
  font-size: 12px;
  font-weight: 600;
  color: #60a5fa;
}

.source-title {
  flex: 1;
  line-height: 1.5;
}

.source-link-icon {
  flex-shrink: 0;
  color: var(--text-link);
}

/* --- Detail Share Button --- */
.detail-share-row {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
  align-items: center;
}

/* --- SNS Share Buttons --- */

/* --- Dashboard --- */
.dashboard {
  animation: fadeIn 0.2s ease;
}

.dashboard-hero {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.dashboard-hero h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-stat {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--text-primary);
}

.hero-number {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
}

.hero-number.false-color {
  color: var(--color-false);
}

.hero-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-false);
}

.hero-desc {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.dashboard-card.full-width {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.dashboard-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.chart-container {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.chart-container-wide {
  max-width: 100%;
  height: auto;
  max-height: 280px;
  display: block;
}

.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.criteria-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.criteria-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-elevated);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  width: 100%;
  text-align: left;
}

.share-option:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* Card News Modal */
.cardnews-modal {
  max-width: 520px;
}

.cardnews-modal-body {
  align-items: center;
}

#cardnews-preview {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 28px;
  color: #fff;
  width: 100%;
  font-family: var(--font-main);
}

.btn-save-cardnews {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  width: 100%;
  transition: opacity 0.2s;
}

.btn-save-cardnews:hover {
  opacity: 0.9;
}

.btn-save-cardnews:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Card list action buttons */
.card-actions {
  display: flex;
  gap: 4px;
}

/* Card News button style */
.btn-cardnews {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all var(--transition);
}

.btn-cardnews:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-elevated);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 300;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px;
  text-align: center;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-dot {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* --- Video Embed --- */
.video-embed {
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #000;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .main-content {
    padding: 0 16px 32px;
  }

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

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

  .claim-card {
    padding: 16px 18px;
  }

  .card-title {
    font-size: 15px;
  }

  .detail-claim-title {
    font-size: 19px;
  }

  .hero-number {
    font-size: 28px;
  }

  .hero-stat {
    font-size: 17px;
  }

  .filters-bar {
    padding: 12px 16px;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tabs {
    margin: 16px 0 12px;
  }

  .tab {
    padding: 10px 14px;
    font-size: 14px;
  }

  .summary-bar {
    gap: 8px;
  }

  .summary-stat {
    padding: 10px 12px;
    min-width: 60px;
  }

  .stat-number {
    font-size: 20px;
  }

  .collapsible-content {
    padding: 0 16px 16px;
    font-size: 14px;
  }

  .argument-body {
    padding: 0 16px;
    font-size: 14px;
  }

  .argument-card.open .argument-body {
    padding: 0 16px 16px;
  }

  .detail-nav-top {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .detail-nav-arrows {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .summary-bar {
    flex-wrap: wrap;
  }

  .summary-stat {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero {
    padding: 28px 16px;
  }
}

/* --- Scrollbar styling (webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* --- Search Highlight --- */
.search-highlight {
  background: rgba(234, 179, 8, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="light"] .search-highlight {
  background: rgba(234, 179, 8, 0.45);
}

/* --- Recent Claims --- */
.recent-claims {
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.recent-claims-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.recent-claims-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-claim-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.recent-claim-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
}

.recent-claim-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.recent-claim-title {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- No results --- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  font-size: 16px;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* --- Infinite Scroll Sentinel --- */
.btn-load-more {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-load-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card-hover);
}

/* --- Loading state --- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

/* --- Markdown rendered content --- */
.md-content h1, .md-content h2, .md-content h3, .md-content h4 {
  color: var(--text-primary);
  margin: 16px 0 8px;
  font-weight: 700;
}

.md-content h3 { font-size: 16px; }
.md-content h4 { font-size: 15px; }

.md-content p {
  margin-bottom: 10px;
  line-height: 1.8;
}

.md-content ul, .md-content ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.md-content li {
  margin-bottom: 4px;
  line-height: 1.7;
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}

.md-content th, .md-content td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.md-content th {
  background: var(--bg-elevated);
  font-weight: 700;
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.md-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--bg-primary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary);
}

.md-content code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* --- Scroll to Top Button --- */
.scroll-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background var(--transition), color var(--transition);
  z-index: 90;
}

.scroll-to-top.visible {
  opacity: 0.8;
  visibility: visible;
}

.scroll-to-top:hover {
  opacity: 1;
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 99;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.reading-progress.hidden {
  opacity: 0;
}

/* --- Chart Loading Spinner --- */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
}

/* --- Floating TOC (Desktop) --- */
.detail-toc {
  position: fixed;
  top: 80px;
  left: calc(50% + 448px);
  width: 160px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 12px 0;
  z-index: 50;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin: 0;
}

.toc-link {
  display: block;
  padding: 4px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.toc-link:hover {
  color: var(--text-secondary);
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1279px) {
  .detail-toc {
    display: none;
  }
}

/* --- Mobile TOC (Pills) --- */

/* --- Print Styles --- */
@media print {
  /* Hide non-content elements */
  .site-header,
  .site-footer,
  .tabs,
  .summary-bar,
  .search-bar,
  .filters-bar,
  .filter-result-count,
  .detail-share-row,
  .theme-toggle,
  .scroll-to-top,
  .reading-progress,
  .detail-nav-top,
  .video-embed,
  .card-actions,
  .card-share-btn,
  .detail-toc,
  .toast,
  .modal-overlay,
  .recent-claims,
  #card-news-container {
    display: none !important;
  }

  /* Reset backgrounds for printing */
  body,
  .main-content,
  .detail-view,
  .detail-content,
  .collapsible,
  .collapsible-header,
  .argument-card,
  .argument-header,
  .argument-body,
  .claim-card,
  .detail-summary-block,
  .detail-origin,
  .source-item,
  .dashboard-card,
  .dashboard-hero {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  /* Text colors for readability */
  .detail-claim-title,
  .collapsible-title,
  .argument-q,
  .card-title,
  .summary-label,
  .detail-summary-block .summary-label,
  .collapsible-content strong,
  .argument-body strong {
    color: #000 !important;
  }

  .collapsible-content,
  .argument-body,
  .summary-value,
  .detail-summary-block .summary-value,
  .source-title,
  .detail-origin {
    color: #333 !important;
  }

  .detail-claim-number,
  .card-number {
    color: #666 !important;
  }

  /* Full width layout */
  .main-content,
  .detail-view,
  .detail-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .detail-view {
    display: block !important;
  }

  /* Expand all collapsible sections */
  .collapsible-body {
    max-height: none !important;
    overflow: visible !important;
  }

  .argument-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 20px 20px !important;
  }

  /* Hide collapse icons */
  .collapsible-icon {
    display: none !important;
  }

  /* Avoid breaking inside cards */
  .argument-card,
  .collapsible {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .arguments-section,
  .sources-section {
    page-break-before: auto;
  }

  /* Verdict badge - preserve colors in print */
  .verdict-badge {
    border: 1px solid #999 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Print typography */
  body {
    font-size: 12pt !important;
    line-height: 1.6 !important;
  }

  /* Show URLs for source links */
  a.source-item[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
    word-break: break-all;
  }

  .source-link-icon {
    display: none !important;
  }

  @page {
    margin: 2cm;
  }
}
