/* ============================================================
   Royalty Tool — Design System
   Namespace: .rt- (to avoid conflicts with WordPress themes)
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — Brand Orange Palette (chizai-media.com) */
  --rt-primary: #f2913e;
  --rt-primary-hover: #e07d2a;
  --rt-primary-light: #fff4ea;
  --rt-primary-bg: #fffbf5;

  /* Accent — Amber for CTA */
  --rt-amber: #f59e0b;
  --rt-amber-light: #fffbeb;
  --rt-amber-border: #d97706;
  --rt-amber-text: #92400e;

  /* Neutrals */
  --rt-gray-50: #f9fafb;
  --rt-gray-100: #f3f4f6;
  --rt-gray-200: #e5e7eb;
  --rt-gray-300: #d1d5db;
  --rt-gray-400: #9ca3af;
  --rt-gray-500: #6b7280;
  --rt-gray-600: #4b5563;
  --rt-gray-700: #374151;
  --rt-gray-800: #1f2937;
  --rt-gray-900: #111827;

  /* Data Source Badge Colors */
  --rt-badge-own: #7c3aed;
  --rt-badge-own-bg: #f5f3ff;
  --rt-badge-meti-survey: #059669;
  --rt-badge-meti-survey-bg: #ecfdf5;
  --rt-badge-meti-court: #dc2626;
  --rt-badge-meti-court-bg: #fef2f2;

  /* Chart Colors */

  /* Typography */
  --rt-font-primary: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --rt-font-mono: 'SF Mono', 'Consolas', monospace;

  /* Spacing */
  --rt-space-xs: 0.25rem;
  --rt-space-sm: 0.5rem;
  --rt-space-md: 1rem;
  --rt-space-lg: 1.5rem;
  --rt-space-xl: 2rem;
  --rt-space-2xl: 3rem;
  --rt-space-3xl: 4rem;

  /* Border Radius */
  --rt-radius-sm: 6px;
  --rt-radius-md: 10px;
  --rt-radius-lg: 16px;
  --rt-radius-full: 9999px;

  /* Shadows */
  --rt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --rt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --rt-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --rt-shadow-xl: 0 20px 50px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --rt-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset (scoped) ---------- */
.rt-wrapper {
  font-family: var(--rt-font-primary);
  color: var(--rt-gray-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.rt-wrapper *,
.rt-wrapper *::before,
.rt-wrapper *::after {
  box-sizing: inherit;
}

/* ---------- ZONE A: Hero + Search ---------- */
.rt-hero {
  background: linear-gradient(135deg, #c96a1f 0%, #f2913e 50%, #f8b46a 100%);
  color: #fff;
  padding: var(--rt-space-3xl) var(--rt-space-xl);
  text-align: center;
  border-radius: var(--rt-radius-lg);
  margin-bottom: var(--rt-space-2xl);
  position: relative;
  overflow: hidden;
}

.rt-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.rt-hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.rt-hero-content {
  position: relative;
  z-index: 1;
}

.rt-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-sm) 0;
  letter-spacing: 0.02em;
}

.rt-hero .rt-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0 0 var(--rt-space-xl) 0;
  font-weight: 400;
  line-height: 1.6;
}

.rt-hero .rt-last-updated {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: var(--rt-space-sm);
}

/* Search Form */
.rt-search-form {
  display: flex;
  gap: var(--rt-space-md);
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.rt-custom-period {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  animation: rtSlideDown 0.2s ease;
}

@keyframes rtSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rt-year-select {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--rt-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--rt-font);
  cursor: pointer;
}

.rt-year-select option {
  color: var(--rt-gray-800);
  background: #fff;
}

.rt-year-separator {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

.rt-search-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rt-space-xs);
}

.rt-search-field label {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.03em;
}

.rt-search-field select {
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.65rem 2.2rem 0.65rem 0.9rem;
  border-radius: var(--rt-radius-sm);
  font-size: 0.9rem;
  font-family: var(--rt-font-primary);
  cursor: pointer;
  transition: var(--rt-transition);
  width: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.rt-search-field select:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.rt-search-field select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.rt-search-field select option {
  color: var(--rt-gray-800);
  background: #fff;
}

/* Keyword Search Input */
.rt-search-field--keyword {
  flex-basis: 100%;
  max-width: 400px;
}

.rt-search-field--keyword input {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: var(--rt-radius-sm);
  font-size: 0.9rem;
  font-family: var(--rt-font-primary);
  transition: var(--rt-transition);
  width: 100%;
}

.rt-search-field--keyword input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.rt-search-field--keyword input:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.rt-search-field--keyword input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.2);
}

/* Range Slider Styles */
.rt-search-field--slider {
  min-width: 200px;
}

.rt-search-field--slider label {
  display: flex;
  gap: var(--rt-space-xs);
  align-items: baseline;
}

#rt-period-label {
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 1;
}

.rt-range-slider-wrap {
  position: relative;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
}

.rt-range-slider-wrap input[type="range"] {
  position: absolute;
  width: 100%;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  height: 36px;
  margin: 0;
  z-index: 2;
}

.rt-range-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 3;
}

.rt-range-slider-wrap input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.rt-range-slider-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.rt-range-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border-radius: 3px;
}

.rt-range-slider-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
  border-radius: 3px;
}

.rt-range-slider-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  z-index: 1;
}

.rt-range-slider-track::after {
  content: '';
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  left: var(--track-left, 0%);
  right: var(--track-right, 0%);
}

.rt-period-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 1px 6px;
  border-radius: var(--rt-radius-full);
  margin-left: 4px;
}

.rt-search-btn {
  align-self: flex-end;
  background: #fff;
  color: var(--rt-primary);
  border: none;
  padding: 0.65rem 1.8rem;
  border-radius: var(--rt-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--rt-font-primary);
  cursor: pointer;
  transition: var(--rt-transition);
  letter-spacing: 0.02em;
}

.rt-search-btn:hover {
  background: var(--rt-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--rt-shadow-md);
}

/* ---------- AIO Summary (hidden visually, available to crawlers) ---------- */
.rt-aio-summary {
  background: var(--rt-gray-50);
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg);
  margin-bottom: var(--rt-space-2xl);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--rt-gray-700);
}

.rt-aio-summary p {
  margin: 0;
}

/* ---- Enhanced Summary Report ---- */
.rt-aio-summary--report {
  padding: var(--rt-space-lg) var(--rt-space-xl);
}

.rt-report-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rt-gray-800);
  margin-bottom: var(--rt-space-md);
  display: flex;
  align-items: center;
  gap: var(--rt-space-sm);
  flex-wrap: wrap;
}

.rt-report-period {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--rt-gray-500);
  background: var(--rt-gray-100);
  padding: 2px 10px;
  border-radius: var(--rt-radius-full);
}

.rt-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--rt-space-sm);
  margin-bottom: var(--rt-space-lg);
}

.rt-stat-card {
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  padding: var(--rt-space-sm) var(--rt-space-md);
  text-align: center;
}

.rt-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rt-primary);
  font-feature-settings: 'tnum';
  line-height: 1.3;
}

.rt-stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--rt-gray-500);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Comparison bars */
.rt-comparison {
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  padding: var(--rt-space-md);
  margin-bottom: var(--rt-space-md);
}

.rt-comparison-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rt-gray-700);
  margin-bottom: var(--rt-space-sm);
}

.rt-comparison-row {
  display: flex;
  align-items: center;
  gap: var(--rt-space-sm);
  margin-bottom: 6px;
}

.rt-comp-label {
  font-size: 0.78rem;
  color: var(--rt-gray-600);
  min-width: 160px;
  white-space: nowrap;
}

.rt-comp-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--rt-space-sm);
  height: 22px;
}

.rt-comp-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 8px;
}

.rt-comp-survey {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.rt-comp-court {
  background: linear-gradient(90deg, #f97316, #ea580c);
}

.rt-comp-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rt-gray-700);
  white-space: nowrap;
  font-feature-settings: 'tnum';
}

.rt-comparison-note {
  font-size: 0.78rem;
  color: var(--rt-gray-500);
  margin-top: 4px;
  padding-left: 160px;
}

/* Notable cases */
.rt-notable {
  margin-bottom: var(--rt-space-sm);
}

.rt-notable-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rt-gray-700);
  margin-bottom: var(--rt-space-sm);
}

.rt-notable-item {
  display: flex;
  align-items: flex-start;
  gap: var(--rt-space-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--rt-gray-100);
}

.rt-notable-item:last-child {
  border-bottom: none;
}

.rt-notable-rate {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rt-primary);
  min-width: 55px;
  text-align: right;
  font-feature-settings: 'tnum';
}

.rt-notable-info {
  flex: 1;
}

.rt-notable-ip {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--rt-gray-700);
  line-height: 1.4;
}

.rt-notable-case {
  font-size: 0.72rem;
  color: var(--rt-gray-500);
}

.rt-report-seo {
  font-size: 0.82rem;
  color: var(--rt-gray-400);
  margin-top: var(--rt-space-sm);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .rt-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .rt-comp-label {
    min-width: 110px;
    font-size: 0.72rem;
  }

  .rt-comparison-note {
    padding-left: 0;
  }

  .rt-stat-value {
    font-size: 1.15rem;
  }
}

/* No Data Message */
.rt-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--rt-space-2xl);
  color: var(--rt-gray-400);
  font-size: 0.95rem;
}

.rt-no-data .rt-icon {
  font-size: 2rem;
  margin-bottom: var(--rt-space-sm);
}

/* ---------- ZONE C: Data Table ---------- */
/* ---------- Similar Cases Section ---------- */
.rt-similar-section {
  margin-bottom: var(--rt-space-xl);
}

.rt-similar-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rt-gray-800);
  margin: 0 0 var(--rt-space-md) 0;
}

.rt-similar-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--rt-space-md);
}

.rt-similar-card {
  background: #fff;
  border: 2px solid var(--rt-primary);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg);
  position: relative;
  box-shadow: var(--rt-shadow-md);
  transition: var(--rt-transition);
}

.rt-similar-card:hover {
  box-shadow: var(--rt-shadow-lg);
  transform: translateY(-2px);
}

.rt-similar-card-rank {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--rt-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--rt-radius-full);
}

.rt-similar-card-rate {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--rt-primary);
  margin: var(--rt-space-sm) 0 var(--rt-space-xs) 0;
}

.rt-similar-card-case {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rt-gray-700);
  margin: 0 0 var(--rt-space-xs) 0;
}

.rt-similar-card-meta {
  font-size: 0.78rem;
  color: var(--rt-gray-500);
  display: flex;
  gap: var(--rt-space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--rt-space-xs);
}

.rt-similar-card-reason {
  font-size: 0.78rem;
  color: var(--rt-gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Results Header ---------- */
.rt-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--rt-space-md);
  margin-bottom: var(--rt-space-md);
}

.rt-results-header h2 {
  margin: 0 0 var(--rt-space-xs) 0;
}

/* ---------- Download Button ---------- */
.rt-download-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-xs);
  background: var(--rt-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--rt-radius-sm);
  font-family: var(--rt-font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--rt-transition);
  box-shadow: var(--rt-shadow-sm);
}

.rt-download-btn:hover {
  background: var(--rt-primary-hover);
  box-shadow: var(--rt-shadow-md);
  transform: translateY(-1px);
}

.rt-download-btn:active {
  transform: translateY(0);
}

.rt-download-btn {
  flex-direction: column;
  text-align: center;
  line-height: 1.4;
}

.rt-download-desc {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
  letter-spacing: 0;
}

/* ---------- Section Panels ---------- */
.rt-section-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.rt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: #fafbfc;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}

.rt-section-header:hover {
  background: #f3f4f6;
}

.rt-section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #1f2937;
}

.rt-section-summary {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
}

.rt-section-toggle {
  font-size: 0.8rem;
  color: #9ca3af;
  transition: transform 0.3s;
}

.rt-section-toggle.collapsed {
  transform: rotate(-90deg);
}

.rt-section-body {
  padding: 0.5rem 1rem 1rem;
}

.rt-section-body.collapsed {
  display: none;
}

.rt-section-filters {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
  align-items: flex-end;
}

.rt-section-filters .rt-search-field {
  min-width: 150px;
}

.rt-section-filters .rt-search-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.rt-section-filters .rt-search-field select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.rt-download-section {
  margin-bottom: 1.5rem;
}

/* ---------- Table Section ---------- */
.rt-table-section {
  margin-bottom: var(--rt-space-2xl);
}

.rt-table-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 var(--rt-space-md) 0;
  color: var(--rt-gray-800);
}

.rt-result-count {
  font-size: 0.85rem;
  color: var(--rt-gray-500);
  margin-bottom: var(--rt-space-md);
}

/* Desktop Table */
.rt-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  box-shadow: var(--rt-shadow-sm);
}

.rt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rt-table thead {
  background: var(--rt-gray-50);
  border-bottom: 2px solid var(--rt-gray-200);
}

.rt-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--rt-gray-600);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Toggle button in table header */
.rt-toggle-header-btn {
  background: none;
  border: 1px solid var(--rt-gray-300);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rt-gray-500);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rt-toggle-header-btn:hover {
  background: var(--rt-gray-100);
  color: var(--rt-primary);
  border-color: var(--rt-primary);
}

.rt-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rt-gray-100);
  vertical-align: top;
}

.rt-case-num {
  white-space: nowrap;
}

.rt-case-page-link {
  color: var(--rt-gray-800);
  text-decoration: none;
  transition: var(--rt-transition);
}

.rt-case-page-link:hover {
  color: var(--rt-primary);
}

.rt-case-link-icon {
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--rt-primary);
}

.rt-case-page-link:hover .rt-case-link-icon {
  opacity: 1;
}

.rt-case-badges {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.rt-table tbody tr {
  transition: var(--rt-transition);
  cursor: pointer;
}

.rt-table tbody tr:hover {
  background: var(--rt-primary-bg);
}

.rt-table tbody tr.rt-survey-row {
  background: #f0f7ff;
  cursor: default;
}

.rt-table tbody tr.rt-survey-row:hover {
  background: #e0efff;
}

.rt-table tbody tr:last-child td {
  border-bottom: none;
}

/* Rate Cell */
.rt-rate {
  font-weight: 700;
  font-size: 1rem;
  color: var(--rt-primary);
  font-feature-settings: 'tnum';
}

/* Factor Tags */
.rt-factor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.rt-factor-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--rt-radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.4;
}

.rt-factor-up {
  color: #065f46;
  background: #d1fae5;
}

.rt-factor-down {
  color: #991b1b;
  background: #fee2e2;
}

.rt-factor-neutral {
  color: #4b5563;
  background: #f3f4f6;
}

/* Source Badge */
.rt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--rt-radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.rt-badge-own {
  color: var(--rt-badge-own);
  background: var(--rt-badge-own-bg);
}

.rt-badge-survey {
  color: var(--rt-badge-meti-survey);
  background: var(--rt-badge-meti-survey-bg);
}

.rt-badge-court {
  color: var(--rt-badge-meti-court);
  background: var(--rt-badge-meti-court-bg);
}

/* Judgment Link */
.rt-judgment-link {
  color: var(--rt-primary);
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: var(--rt-transition);
}

.rt-judgment-link:hover {
  text-decoration: underline;
  color: var(--rt-primary-hover);
}

/* Group header row (survey/court separation) */
.rt-group-header {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border-left: 4px solid var(--rt-orange);
}

.rt-group-header td {
  padding: 10px 16px;
  font-size: 0.95rem;
  color: var(--rt-gray-700);
}

/* Cross-Reference Banner */
#rt-cross-ref-banner {
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 8px 0;
  padding: 0;
}

.rt-xref-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  flex: 1;
  min-width: 260px;
  backdrop-filter: blur(8px);
  transition: var(--rt-transition);
}

.rt-xref-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.rt-xref-survey {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.rt-xref-court {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.rt-xref-icon {
  font-size: 1.1rem;
}

.rt-xref-label {
  color: var(--rt-gray-600);
  font-weight: 500;
}

.rt-xref-value {
  font-weight: 700;
  color: var(--rt-gray-800);
  font-size: 0.95rem;
}

.rt-xref-detail {
  color: var(--rt-gray-500);
  font-size: 0.82rem;
  padding-left: 4px;
  border-left: 1px solid var(--rt-gray-300);
}

/* Survey sample size badge */
.rt-sample-size {
  display: inline-block;
  font-size: 0.72rem;
  color: rgb(16, 185, 129);
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
}

/* Survey median hint */
.rt-median-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--rt-gray-500);
  font-weight: 400;
  margin-top: 2px;
}

/* Toggle All Details Button */
.rt-download-btn--toggle {
  background: #fff !important;
  color: var(--rt-gray-600) !important;
  border: 1px solid var(--rt-gray-300) !important;
  font-size: 0.82rem !important;
  padding: 0.5rem 1rem !important;
}

.rt-download-btn--toggle:hover {
  background: var(--rt-gray-50) !important;
  border-color: var(--rt-primary) !important;
  color: var(--rt-primary) !important;
}

/* Keyword Highlight */
.rt-keyword-highlight {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: inherit;
  padding: 1px 3px;
  border-radius: 3px;
  font-style: normal;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

/* Full-text search badge + snippet */
.rt-fulltext-badge {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #fef7ed, #fff7ed);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  border-left: 4px solid #e67e22;
}
.rt-fulltext-snippet {
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #374151;
  word-break: break-all;
}

/* Accordion (detail row) */
.rt-detail-row {
  display: none;
}

.rt-detail-row.rt-active {
  display: table-row;
}

.rt-detail-row td {
  padding: 0;
  border-bottom: 1px solid var(--rt-gray-200);
}

.rt-detail-content {
  padding: var(--rt-space-md) var(--rt-space-lg);
  background: var(--rt-gray-50);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--rt-gray-700);
  animation: rt-slideDown 0.3s ease;
}

@keyframes rt-slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }

  to {
    opacity: 1;
    max-height: 500px;
  }
}

.rt-detail-content .rt-detail-label {
  font-weight: 600;
  color: var(--rt-gray-600);
  margin-right: var(--rt-space-sm);
}

/* Markdown rendered summary */
.rt-detail-markdown {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rt-gray-200);
}

.rt-detail-markdown p {
  margin: 0.3rem 0;
  line-height: 1.7;
}

.rt-detail-markdown strong {
  color: var(--rt-gray-800);
}

.rt-detail-markdown ul {
  margin: 0.3rem 0;
  padding-left: 1.2rem;
}

.rt-detail-markdown li {
  margin: 0.2rem 0;
  line-height: 1.6;
}

.rt-detail-markdown h2,
.rt-detail-markdown h3 {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.25rem 0;
  color: var(--rt-gray-700);
}

/* Related case link in detail row */
.rt-related-case {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--rt-gray-700);
  cursor: pointer;
  transition: var(--rt-transition);
}

.rt-related-case:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.18));
  border-color: rgba(37, 99, 235, 0.35);
}

/* Appeal/Original tier badge */
.rt-tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  vertical-align: middle;
}

.rt-heigou-badge {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  cursor: help;
}

/* Expand indicator */
.rt-expand-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--rt-gray-100);
  text-align: center;
  line-height: 20px;
  font-size: 0.7rem;
  color: var(--rt-gray-500);
  transition: var(--rt-transition);
}

.rt-row-expanded .rt-expand-icon {
  background: var(--rt-primary-light);
  color: var(--rt-primary);
  transform: rotate(180deg);
}

/* Mobile Cards (hidden on desktop) */
.rt-cards {
  display: none;
}

.rt-card {
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg);
  margin-bottom: var(--rt-space-md);
  box-shadow: var(--rt-shadow-sm);
  transition: var(--rt-transition);
}

.rt-card:hover {
  box-shadow: var(--rt-shadow-md);
}

.rt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--rt-space-sm);
}

.rt-card-case {
  font-size: 0.82rem;
  color: var(--rt-gray-500);
}

.rt-card-ip {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--rt-gray-800);
  margin: var(--rt-space-xs) 0;
}

.rt-card-rate {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rt-primary);
}

.rt-card-meta {
  display: flex;
  gap: var(--rt-space-sm);
  flex-wrap: wrap;
  margin: var(--rt-space-sm) 0;
}

.rt-card-reason {
  display: none;
  margin-top: var(--rt-space-md);
  padding-top: var(--rt-space-md);
  border-top: 1px solid var(--rt-gray-100);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--rt-gray-600);
}

.rt-card-reason.rt-active {
  display: block;
  animation: rt-slideDown 0.3s ease;
}

.rt-card-toggle {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--rt-primary);
  cursor: pointer;
  margin-top: var(--rt-space-sm);
  transition: var(--rt-transition);
}

.rt-card-toggle:hover {
  color: var(--rt-primary-hover);
}

/* ---------- ZONE D: CTA ---------- */
.rt-cta-section {
  background: var(--rt-amber-light);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--rt-amber-border);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-xl) var(--rt-space-xl) var(--rt-space-xl) var(--rt-space-xl);
  margin-bottom: var(--rt-space-2xl);
}

.rt-cta-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rt-amber-text);
  margin: 0 0 var(--rt-space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--rt-space-sm);
}

.rt-cta-body {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--rt-gray-700);
  margin-bottom: var(--rt-space-lg);
}

.rt-cta-body p {
  margin: 0 0 var(--rt-space-sm) 0;
}

.rt-cta-buttons {
  display: flex;
  gap: var(--rt-space-md);
  flex-wrap: wrap;
  margin-bottom: var(--rt-space-md);
}

.rt-cta-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-sm);
  background: var(--rt-primary);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: var(--rt-radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--rt-font-primary);
  transition: var(--rt-transition);
  border: none;
  cursor: pointer;
}

.rt-cta-btn-primary:hover {
  background: var(--rt-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--rt-shadow-md);
  color: #fff;
  text-decoration: none;
}

.rt-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-sm);
  background: #fff;
  color: var(--rt-primary);
  padding: 0.7rem 1.5rem;
  border-radius: var(--rt-radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--rt-font-primary);
  border: 1px solid var(--rt-primary);
  transition: var(--rt-transition);
  cursor: pointer;
}

.rt-cta-btn-secondary:hover {
  background: var(--rt-primary-bg);
  transform: translateY(-1px);
  color: var(--rt-primary);
  text-decoration: none;
}

.rt-cta-disclaimer {
  font-size: 0.8rem;
  color: var(--rt-gray-500);
  margin: 0;
}

/* ---------- ZONE E: Whitepaper Link ---------- */
.rt-wp-section {
  margin-bottom: var(--rt-space-2xl);
}

.rt-wp-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 var(--rt-space-lg) 0;
  color: var(--rt-gray-800);
}

.rt-wp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rt-space-lg);
}

.rt-wp-card {
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg);
  box-shadow: var(--rt-shadow-sm);
  transition: var(--rt-transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.rt-wp-card:hover {
  box-shadow: var(--rt-shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.rt-wp-card-icon {
  font-size: 2rem;
  margin-bottom: var(--rt-space-sm);
}

.rt-wp-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 var(--rt-space-sm) 0;
  color: var(--rt-gray-800);
}

.rt-wp-card p {
  font-size: 0.85rem;
  color: var(--rt-gray-500);
  margin: 0 0 var(--rt-space-md) 0;
  line-height: 1.7;
}

.rt-wp-card .rt-dl-label {
  color: var(--rt-primary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- ZONE F: Related Articles ---------- */
.rt-related-section {
  margin-bottom: var(--rt-space-xl);
}

.rt-related-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 var(--rt-space-lg) 0;
  color: var(--rt-gray-800);
}

.rt-related-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rt-space-md);
}

.rt-related-link {
  display: flex;
  align-items: center;
  gap: var(--rt-space-sm);
  padding: var(--rt-space-md) var(--rt-space-lg);
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  text-decoration: none;
  color: var(--rt-gray-700);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--rt-transition);
}

.rt-related-link:hover {
  border-color: var(--rt-primary);
  color: var(--rt-primary);
  background: var(--rt-primary-bg);
  text-decoration: none;
}

.rt-related-link .rt-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-5px);
  transition: var(--rt-transition);
}

.rt-related-link:hover .rt-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Source Citation ---------- */
.rt-source-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--rt-gray-400);
  padding: var(--rt-space-lg) 0;
  border-top: 1px solid var(--rt-gray-100);
}

/* ---------- Table Row Hover ---------- */
.rt-table tbody tr {
  transition: background-color 0.15s ease;
}

.rt-table tbody tr:hover {
  background-color: rgba(234, 88, 12, 0.06);
}

/* ---------- Empty State ---------- */
.rt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rt-space-md);
  padding: var(--rt-space-2xl) var(--rt-space-lg);
  text-align: center;
  color: var(--rt-gray-500);
}

.rt-empty-state .rt-empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.rt-empty-state .rt-empty-message {
  font-size: 1rem;
  font-weight: 500;
  color: var(--rt-gray-600);
}

.rt-empty-state .rt-empty-hint {
  font-size: 0.85rem;
  color: var(--rt-gray-400);
}

.rt-empty-state .rt-empty-reset {
  background: var(--rt-primary);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--rt-font);
}

.rt-empty-state .rt-empty-reset:hover {
  background: var(--rt-primary-dark);
  transform: scale(1.05);
}

/* ---------- Loading Spinner ---------- */
.rt-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}

.rt-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--rt-gray-200);
  border-top-color: var(--rt-primary);
  border-radius: 50%;
  animation: rtSpin 0.8s linear infinite;
}

@keyframes rtSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Slider Tooltip ---------- */
.rt-range-slider-wrap {
  position: relative;
}

.rt-range-slider-wrap input[type="range"] {
  position: relative;
}

.rt-slider-tooltip {
  position: absolute;
  top: -28px;
  transform: translateX(-50%);
  background: var(--rt-gray-800);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.rt-slider-tooltip.rt-tooltip-visible {
  opacity: 1;
}

/* ---------- Responsive ---------- */

/* Tablet */
@media (max-width: 768px) {
  .rt-hero {
    padding: var(--rt-space-xl) var(--rt-space-md);
  }

  .rt-hero h1 {
    font-size: 1.3rem;
  }

  .rt-hero .rt-subtitle {
    font-size: 0.85rem;
  }

  .rt-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .rt-search-field {
    width: 100%;
  }

  .rt-search-field select {
    width: 100%;
  }

  .rt-search-row-secondary {
    flex-direction: row;
  }

  .rt-search-row-secondary select {
    width: 100%;
  }

  .rt-search-row-secondary .rt-search-field {
    flex: 1;
  }

  .rt-search-field--slider {
    min-width: unset;
    width: 100%;
  }

  .rt-search-btn {
    width: 100%;
  }

  .rt-viz-section {
    grid-template-columns: 1fr;
  }

  /* Switch table to cards on mobile */
  .rt-table-wrapper {
    display: none;
  }

  .rt-cards {
    display: block;
  }

  /* Similar cases: stack vertically */
  .rt-similar-wrapper {
    flex-direction: column;
  }

  .rt-similar-card {
    width: 100%;
  }

  /* CTA section */
  .rt-cta-buttons {
    flex-direction: column;
  }

  .rt-cta-btn-primary,
  .rt-cta-btn-secondary {
    justify-content: center;
    width: 100%;
  }

  /* Download buttons */
  .rt-download-group {
    flex-direction: column;
    width: 100%;
  }

  .rt-download-group .rt-download-btn,
  .rt-download-group .rt-download-btn--csv {
    width: 100%;
    justify-content: center;
  }

  .rt-result-header {
    flex-direction: column;
    gap: var(--rt-space-sm);
    align-items: stretch;
  }

  /* Whitepaper & related grids */
  .rt-wp-grid {
    grid-template-columns: 1fr;
  }

  .rt-related-list {
    grid-template-columns: 1fr;
  }

  /* Source note */
  .rt-source-note {
    padding: var(--rt-space-md);
  }

  .rt-source-note p {
    font-size: 0.75rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .rt-hero {
    padding: var(--rt-space-lg) var(--rt-space-sm);
  }

  .rt-hero h1 {
    font-size: 1.1rem;
  }

  .rt-hero .rt-subtitle {
    font-size: 0.78rem;
  }

  .rt-search-row-secondary {
    flex-direction: column;
  }

  .rt-range-stats {
    flex-direction: column;
    gap: var(--rt-space-sm);
  }

  .rt-dynamic-summary {
    font-size: 0.82rem;
    padding: var(--rt-space-md);
  }

  .rt-filter-chip {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .rt-active-filters {
    padding: 8px var(--rt-space-sm);
  }

  .rt-result-count {
    font-size: 0.85rem;
  }

  .rt-cta-section {
    padding: var(--rt-space-lg) var(--rt-space-sm);
  }
}

/* ---------- Sortable Table Headers ---------- */
.rt-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.rt-sortable:hover {
  background: var(--rt-primary-light);
}

.rt-sort-active {
  color: var(--rt-primary);
  font-weight: 700;
}

.rt-sort-icon {
  font-size: 0.75rem;
  margin-left: 2px;
  opacity: 0.5;
}

.rt-sort-active .rt-sort-icon {
  opacity: 1;
}

/* ---------- Filter Reset Button ---------- */
.rt-filter-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--rt-space-sm);
}

.rt-reset-btn {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: var(--rt-font);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.rt-reset-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* ---------- Active Filter Chips ---------- */
.rt-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px var(--rt-space-lg);
  justify-content: center;
  max-width: var(--rt-max-width);
  margin: 0 auto;
}

.rt-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rt-primary-light);
  color: var(--rt-primary);
  border: 1px solid var(--rt-primary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--rt-font);
  animation: chipIn 0.3s ease-out;
}

.rt-filter-chip-remove {
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.15s;
  line-height: 1;
}

.rt-filter-chip-remove:hover {
  opacity: 1;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Download Button Group ---------- */
.rt-download-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rt-download-btn--csv {
  background: #374151;
  border-color: #374151;
  color: #fff;
}

.rt-download-btn--csv:hover {
  background: #4b5563;
  border-color: #4b5563;
}

/* ---------- ZONE G: Source Citation & Legal ---------- */
.rt-source-note {
  background: var(--rt-gray-50);
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-xl) var(--rt-space-xl) var(--rt-space-lg);
  margin-top: var(--rt-space-2xl);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--rt-gray-600);
  text-align: left;
}

.rt-source-block {
  margin-bottom: var(--rt-space-lg);
  padding-bottom: var(--rt-space-lg);
  border-bottom: 1px solid var(--rt-gray-200);
}

.rt-source-block:last-of-type {
  border-bottom: none;
  margin-bottom: var(--rt-space-md);
  padding-bottom: 0;
}

.rt-source-block h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rt-gray-700);
  margin: 0 0 var(--rt-space-sm) 0;
}

.rt-source-block p {
  margin: 0 0 var(--rt-space-sm) 0;
}

.rt-source-block p:last-child {
  margin-bottom: 0;
}

.rt-source-detail {
  font-size: 0.83rem;
  color: var(--rt-gray-600);
}

.rt-source-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.rt-source-link a {
  color: var(--rt-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--rt-transition);
}

.rt-source-link a:hover {
  text-decoration: underline;
  color: var(--rt-primary-hover);
}

.rt-source-block small {
  display: block;
  margin-top: var(--rt-space-sm);
  font-size: 0.78rem;
  color: var(--rt-gray-500);
}

.rt-source-share {
  font-size: 0.82rem;
  color: var(--rt-gray-500);
  text-align: center;
  margin: var(--rt-space-md) 0 0 0;
  padding-top: var(--rt-space-md);
  border-top: 1px solid var(--rt-gray-200);
}

/* ---------- Contextual CTA Banner ---------- */
.rt-context-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  margin: 16px 0;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--rt-radius-md);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--rt-gray-700);
  animation: rtFadeIn 0.5s ease;
}

@keyframes rtFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rt-cta-badge {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  width: fit-content;
}

.rt-cta-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rt-gray-900);
  margin: 0;
}

.rt-cta-desc {
  font-size: 0.85rem;
  color: var(--rt-gray-600);
  margin: 0;
}

.rt-cta-features {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rt-gray-700);
}

.rt-cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.rt-cta-btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-hover));
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: var(--rt-radius-md);
  text-decoration: none;
  text-align: center;
  transition: var(--rt-transition);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.rt-cta-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.rt-cta-btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--rt-primary) !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  border: 1.5px solid var(--rt-primary);
  border-radius: var(--rt-radius-md);
  text-decoration: none;
  text-align: center;
  transition: var(--rt-transition);
}

.rt-cta-btn-secondary:hover {
  background: var(--rt-primary);
  color: #fff !important;
}

/* 5 Things Section */
.rt-five-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.rt-five-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--rt-radius-md);
  border: 1px solid var(--rt-gray-200);
  transition: var(--rt-transition);
}

.rt-five-item:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rt-five-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-hover));
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 50%;
}

.rt-five-item strong {
  font-size: 0.9rem;
  color: var(--rt-gray-900);
}

.rt-five-item p {
  font-size: 0.82rem;
  color: var(--rt-gray-600);
  margin: 2px 0 0 0;
}

.rt-cta-bottom {
  text-align: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rt-gray-200);
}

.rt-cta-bottom p {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.rt-cta-bottom .rt-cta-buttons {
  justify-content: center;
}

.rt-cta-bottom .rt-cta-btn-primary {
  display: inline-block;
}

/* ---------- Email Modal ---------- */
.rt-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: rtFadeIn 0.2s ease;
}

.rt-modal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.rt-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--rt-gray-400);
  cursor: pointer;
  transition: var(--rt-transition);
  line-height: 1;
}

.rt-modal-close:hover {
  color: var(--rt-gray-700);
}

.rt-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rt-gray-800);
  margin: 0 0 0.5rem 0;
}

.rt-modal-desc {
  font-size: 0.88rem;
  color: var(--rt-gray-600);
  line-height: 1.6;
  margin: 0 0 1.2rem 0;
}

.rt-modal-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  font-size: 0.95rem;
  font-family: var(--rt-font-primary);
  transition: var(--rt-transition);
  box-sizing: border-box;
}

.rt-modal-input:focus {
  outline: none;
  border-color: var(--rt-primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.rt-modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--rt-gray-600);
  margin: 0.8rem 0;
  cursor: pointer;
}

.rt-modal-checkbox input[type="checkbox"] {
  accent-color: var(--rt-primary);
}

.rt-modal-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--rt-primary);
  color: #fff;
  border: none;
  border-radius: var(--rt-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--rt-font-primary);
  cursor: pointer;
  transition: var(--rt-transition);
}

.rt-modal-submit:hover {
  background: var(--rt-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--rt-shadow-md);
}

.rt-modal-submit:disabled {
  background: var(--rt-gray-300);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.rt-modal-privacy {
  font-size: 0.72rem;
  color: var(--rt-gray-400);
  margin: 0.8rem 0 0 0;
  text-align: center;
}

/* ---- Pagination ---- */
.rt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.rt-page-btn {
  background: var(--rt-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--rt-transition);
}

.rt-page-btn:hover {
  background: var(--rt-primary-dark);
  transform: translateY(-1px);
}

.rt-page-info {
  font-size: 0.9rem;
  color: var(--rt-gray-600);
  font-weight: 500;
}

/* ---- Print Styles ---- */
@media print {

  /* Hide non-essential UI */
  .rt-hero,
  .rt-search-form,
  .rt-filter-actions,
  .rt-active-filters,
  .rt-viz-section,
  .rt-cta-section,
  .rt-download-section,
  .rt-similar-section,
  .rt-wp-section,
  .rt-related-section,
  .rt-source-note,
  .rt-pagination,
  .rt-cards,
  .rt-expand-icon,
  .rt-email-gate,
  footer,
  nav,
  .rt-reset-btn {
    display: none !important;
  }

  /* Show table always */
  .rt-table-wrapper {
    display: block !important;
    overflow: visible !important;
  }

  /* Show all rows */
  .rt-table tbody tr {
    display: table-row !important;
  }

  /* Clean table styling for print */
  .rt-table {
    font-size: 9pt;
    width: 100%;
    border-collapse: collapse;
  }

  .rt-table th,
  .rt-table td {
    border: 1px solid #ccc;
    padding: 4px 6px;
  }

  .rt-table thead {
    background: #f3f4f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Survey row tint for print */
  .rt-table tbody tr.rt-survey-row {
    background: #f0f7ff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Result header - show count */
  .rt-result-header {
    padding: 8px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 8px;
  }

  .rt-result-count {
    font-size: 11pt;
    font-weight: bold;
  }

  /* Page break control */
  .rt-table-section {
    page-break-inside: auto;
  }

  .rt-table tr {
    page-break-inside: avoid;
  }

  /* Links show URL */
  a[href]:after {
    content: none;
  }

  body {
    background: white;
    color: black;
  }
}

/* ============================================================
   Individual Case Pages (.rt-cp- namespace)
   ============================================================ */

.rt-cp-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* Breadcrumb */
.rt-cp-breadcrumb {
  font-size: 0.82rem;
  color: var(--rt-gray-500);
  margin-bottom: var(--rt-space-lg);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rt-cp-breadcrumb a {
  color: var(--rt-primary);
  text-decoration: none;
  font-weight: 500;
}

.rt-cp-breadcrumb a:hover {
  text-decoration: underline;
}

.rt-cp-breadcrumb-sep {
  color: var(--rt-gray-300);
}

/* Header */
.rt-cp-header {
  background: linear-gradient(135deg, #c96a1f 0%, #f2913e 50%, #f8b46a 100%);
  color: #fff;
  padding: var(--rt-space-xl) var(--rt-space-xl) var(--rt-space-lg);
  border-radius: var(--rt-radius-lg);
  margin-bottom: var(--rt-space-xl);
  position: relative;
  overflow: hidden;
}

.rt-cp-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.rt-cp-header-top {
  display: flex;
  gap: var(--rt-space-sm);
  align-items: center;
  margin-bottom: var(--rt-space-sm);
  position: relative;
  z-index: 1;
}

.rt-cp-industry {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  background: rgba(255,255,255,0.15);
  padding: 2px 10px;
  border-radius: var(--rt-radius-full);
}

.rt-cp-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-md) 0;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.rt-cp-rate-row {
  display: flex;
  align-items: baseline;
  gap: var(--rt-space-sm);
  position: relative;
  z-index: 1;
}

.rt-cp-rate {
  font-size: 2.8rem;
  font-weight: 800;
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
  line-height: 1;
}

.rt-cp-rate-label {
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 500;
}

.rt-cp-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--rt-space-md);
  position: relative;
  z-index: 1;
}

.rt-cp-factors .rt-factor-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Info Card */
.rt-cp-info-card {
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg);
  margin-bottom: var(--rt-space-xl);
  box-shadow: var(--rt-shadow-sm);
}

.rt-cp-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--rt-space-md);
}

.rt-cp-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rt-cp-info-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rt-gray-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rt-cp-info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rt-gray-800);
  word-break: break-all;
}

.rt-cp-info-amount {
  font-weight: 700;
  color: var(--rt-primary);
}

.rt-cp-related-case-link {
  display: inline-block;
  margin-top: var(--rt-space-md);
  padding: 6px 14px;
  background: var(--rt-gray-50);
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  color: var(--rt-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--rt-transition);
}

.rt-cp-related-case-link:hover {
  background: var(--rt-primary-light);
  border-color: var(--rt-primary);
}

/* Judgment Summary */
.rt-cp-summary {
  margin-bottom: var(--rt-space-xl);
}

.rt-cp-summary h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-md) 0;
  color: var(--rt-gray-800);
}

.rt-cp-summary-body {
  background: var(--rt-gray-50);
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-md);
  padding: var(--rt-space-lg) var(--rt-space-xl);
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--rt-gray-700);
}

.rt-cp-summary-body p {
  margin: 0 0 0.6rem 0;
}

.rt-cp-summary-body p:last-child {
  margin-bottom: 0;
}

.rt-cp-list {
  margin: 0.4rem 0;
  padding-left: 1.2rem;
  list-style: none;
}

.rt-cp-list li {
  position: relative;
  padding-left: 0.3rem;
  margin-bottom: 0.35rem;
}

.rt-cp-list li::before {
  content: '';
  position: absolute;
  left: -0.8rem;
  top: 0.65rem;
  width: 4px;
  height: 4px;
  background: var(--rt-primary);
  border-radius: 50%;
}

/* Source */
.rt-cp-source {
  margin-bottom: var(--rt-space-xl);
}

.rt-cp-source h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-sm) 0;
  color: var(--rt-gray-800);
}

.rt-cp-source-link {
  display: inline-block;
  padding: 10px 20px;
  background: var(--rt-primary);
  color: #fff !important;
  text-decoration: none;
  border-radius: var(--rt-radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--rt-transition);
  box-shadow: var(--rt-shadow-sm);
}

.rt-cp-source-link:hover {
  background: var(--rt-primary-hover);
  box-shadow: var(--rt-shadow-md);
  transform: translateY(-1px);
}

/* Related Cases */
.rt-cp-related {
  margin-bottom: var(--rt-space-xl);
}

.rt-cp-related h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-md) 0;
  color: var(--rt-gray-800);
}

.rt-cp-related-list {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-sm);
}

.rt-cp-related-item {
  display: flex;
  align-items: center;
  gap: var(--rt-space-md);
  padding: var(--rt-space-md) var(--rt-space-lg);
  background: #fff;
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: var(--rt-transition);
}

.rt-cp-related-item:hover {
  border-color: var(--rt-primary);
  box-shadow: var(--rt-shadow-md);
  transform: translateX(4px);
}

.rt-cp-related-rate {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rt-primary);
  min-width: 60px;
  text-align: right;
  font-feature-settings: 'tnum';
}

.rt-cp-related-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rt-cp-related-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rt-gray-800);
}

.rt-cp-related-meta {
  font-size: 0.75rem;
  color: var(--rt-gray-500);
}

/* CTA */
.rt-cp-cta {
  background: linear-gradient(135deg, #fffbf5 0%, #fff4ea 100%);
  border: 2px solid var(--rt-primary);
  border-radius: var(--rt-radius-lg);
  padding: var(--rt-space-xl);
  margin-bottom: var(--rt-space-xl);
  text-align: center;
}

.rt-cp-cta h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 var(--rt-space-sm) 0;
  color: var(--rt-gray-800);
}

.rt-cp-cta p {
  font-size: 0.9rem;
  color: var(--rt-gray-600);
  margin: 0 0 var(--rt-space-md) 0;
}

.rt-cp-cta-features {
  display: flex;
  justify-content: center;
  gap: var(--rt-space-lg);
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rt-gray-700);
  margin-bottom: var(--rt-space-lg);
}

.rt-cp-cta-buttons {
  display: flex;
  justify-content: center;
  gap: var(--rt-space-md);
  flex-wrap: wrap;
}

/* Disclaimer */
.rt-cp-disclaimer {
  background: var(--rt-gray-50);
  border: 1px solid var(--rt-gray-200);
  border-radius: var(--rt-radius-sm);
  padding: var(--rt-space-md) var(--rt-space-lg);
  margin-bottom: var(--rt-space-xl);
  font-size: 0.82rem;
  color: var(--rt-gray-500);
}

.rt-cp-disclaimer h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 var(--rt-space-xs) 0;
  color: var(--rt-gray-600);
}

.rt-cp-disclaimer p {
  margin: 0 0 0.3rem 0;
}

.rt-cp-disclaimer p:last-child {
  margin-bottom: 0;
}

/* Back Link */
.rt-cp-back {
  text-align: center;
  margin-bottom: var(--rt-space-xl);
}

.rt-cp-back-link {
  color: var(--rt-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--rt-transition);
}

.rt-cp-back-link:hover {
  text-decoration: underline;
}

/* Badge styling for case pages (reuse existing but ensure visibility) */
.rt-cp-header .rt-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--rt-radius-full);
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .rt-cp-wrapper {
    padding: 12px 14px 30px;
  }

  .rt-cp-header {
    padding: var(--rt-space-lg);
  }

  .rt-cp-header h1 {
    font-size: 1.15rem;
  }

  .rt-cp-rate {
    font-size: 2.2rem;
  }

  .rt-cp-info-grid {
    grid-template-columns: 1fr;
  }

  .rt-cp-summary-body {
    padding: var(--rt-space-md);
  }

  .rt-cp-cta-features {
    flex-direction: column;
    align-items: center;
    gap: var(--rt-space-xs);
  }

  .rt-cp-cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}