/**
 * Tala Sanj v2.0.0 - component + responsive layer
 * Loaded after style.css, so it can override the old rules without touching them.
 * Mobile-first fixes: platform tables turn into cards, dual CTAs stack, every
 * tap target is at least 44px, and no column is hidden any more.
 */

/* ---------------- Breadcrumbs ---------------- */
.ts-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.ts-breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.ts-breadcrumbs a:hover { color: var(--gold-light); }
.ts-crumb-current { color: var(--text-primary); font-weight: 600; }
.ts-crumb-sep { color: var(--text-muted); }

/* ---------------- Buttons: buy vs review ---------------- */
.ts-cta-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ts-btn-buy,
.ts-btn-review {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
/* Primary: buy (gold, filled, larger) */
.ts-btn-buy {
  background: var(--gold-gradient, linear-gradient(135deg, #f59e0b, #fbbf24));
  color: #1a1206;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.7rem 1.15rem;
  min-height: 44px;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28);
}
.ts-btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.38);
  color: #1a1206;
}
.ts-btn-buy svg { flex: 0 0 auto; }
/* Secondary: expert review (outline, quieter) */
.ts-btn-review {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 0.9rem;
  min-height: 40px;
}
.ts-btn-review:hover {
  color: var(--gold-light);
  border-color: var(--gold-primary);
}
.ts-cta-hero .ts-btn-buy { font-size: 1rem; padding: 0.85rem 1.6rem; }

/* ---------------- Platform table ---------------- */
.ts-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
  background: var(--bg-card, #182234);
}
.ts-platform-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 0.9rem;
}
.ts-platform-table th {
  text-align: right;
  padding: 1rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary, #111827);
  border-bottom: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
  white-space: nowrap;
}
.ts-platform-table td {
  padding: 0.95rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  color: var(--text-secondary);
  vertical-align: middle;
}
.ts-platform-table tr:last-child td { border-bottom: none; }
.ts-platform-table tbody tr:hover td { background: var(--bg-card-hover, #1e2d44); }

.ts-name-cell { display: flex; align-items: center; gap: 0.65rem; }
.ts-rank {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full, 999px);
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 0.8rem;
}
.ts-name-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}
.ts-name-link:hover { color: var(--gold-light); }
.ts-name-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.ts-badge-license,
.ts-badge-type,
.ts-badge-partial,
.ts-status-stopped,
.ts-status-active {
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full, 999px);
  font-weight: 600;
  white-space: nowrap;
}
.ts-badge-license { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.ts-badge-type { background: rgba(56, 189, 248, 0.13); color: #7dd3fc; }
.ts-badge-partial { background: rgba(245, 158, 11, 0.14); color: var(--gold-light); }
.ts-status-stopped { background: rgba(244, 63, 94, 0.14); color: #fb7185; }
.ts-status-active { background: rgba(16, 185, 129, 0.14); color: #34d399; }

.ts-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
}
.ts-score-pill-high { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.ts-score-pill-mid { background: rgba(245, 158, 11, 0.16); color: var(--gold-light); }
.ts-score-pill-low { background: rgba(244, 63, 94, 0.16); color: #fb7185; }
.ts-verdict {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ---------------- Pagination + view all ---------------- */
.ts-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.75rem;
}
.ts-pagination a,
.ts-pagination span,
.ts-page-link {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.ts-pagination a:hover,
.ts-page-link:hover { border-color: var(--gold-primary); color: var(--gold-light); }
.ts-pagination .current,
.ts-page-current {
  background: var(--gold-gradient, linear-gradient(135deg, #f59e0b, #fbbf24));
  color: #1a1206;
  border-color: transparent;
}
.ts-view-all-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.ts-view-all-count { opacity: 0.8; font-weight: 700; }
.ts-empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border-card, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg);
}

/* ---------------- Filter chips ---------------- */
.ts-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.ts-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.ts-filter-chip:hover { border-color: var(--gold-primary); color: var(--gold-light); }
.ts-filter-chip.is-active {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}
.ts-chip-count { font-size: 0.72rem; opacity: 0.75; }

/* ---------------- Single platform ---------------- */
.ts-single-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}
.ts-single-title { font-size: 2rem; line-height: 1.35; margin: 0 0 0.75rem; }
.ts-single-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.ts-single-summary { color: var(--text-secondary); line-height: 1.9; margin-bottom: 1.25rem; }
.ts-notice-partial {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--gold-light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.ts-score-card {
  background: var(--bg-card, #182234);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
}
.ts-score-card-num {
  font-size: 2.5rem;
  font-weight: 900;
  border-radius: var(--radius-lg);
  padding: 0.5rem 0;
}
.ts-score-card-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.ts-score-card-verdict { font-weight: 700; color: var(--gold-light); margin-top: 0.35rem; }
.ts-mini-link { display: inline-block; margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-secondary); }

.ts-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}
.ts-fact {
  background: var(--bg-card, #182234);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
}
.ts-fact-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.ts-fact-value { display: block; font-weight: 700; color: #fff; font-size: 0.98rem; }

.ts-axes { margin-bottom: 2.25rem; }
.ts-axes h2,
.ts-methods-supported h2,
.ts-history h2,
.ts-single-cta h2,
.ts-tool-related h2,
.ts-archive-note h2,
.ts-explainer h2 { font-size: 1.35rem; margin-bottom: 0.75rem; }
.ts-section-lead { color: var(--text-muted); font-size: 0.9rem; line-height: 1.9; margin-bottom: 1.25rem; }
.ts-axes-list { display: grid; gap: 0.9rem; }
.ts-axis-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.ts-axis-name { color: var(--text-secondary); }
.ts-axis-num { color: var(--gold-light); font-weight: 700; }
.ts-axis-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.ts-axis-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold-gradient, linear-gradient(135deg, #f59e0b, #fbbf24));
}
.ts-method-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ts-history-table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 0.88rem; }
.ts-history-table th,
.ts-history-table td {
  padding: 0.75rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}
.ts-single-cta {
  margin-top: 2.5rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(15, 23, 42, 0.4));
  border: 1px solid rgba(245, 158, 11, 0.22);
}

/* ---------------- Tool pages ---------------- */
.ts-tool-copy { color: var(--text-secondary); line-height: 2; font-size: 0.98rem; }
.ts-tool-copy h2 { font-size: 1.4rem; color: #fff; margin: 2rem 0 0.75rem; }
.ts-tool-copy h3 { font-size: 1.12rem; color: var(--gold-light); margin: 1.5rem 0 0.5rem; }
.ts-tool-copy ul,
.ts-tool-copy ol { padding-inline-start: 1.25rem; margin: 0.75rem 0; }
.ts-tool-copy li { margin-bottom: 0.4rem; }
.ts-calc-card {
  background: var(--bg-card, #182234);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}
.ts-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.ts-calc-card .form-control { min-height: 46px; }
.calc-note { font-size: 0.8rem; color: var(--text-muted); line-height: 1.8; margin-top: 1rem; }
.calc-neg { color: #fb7185; font-weight: 700; }
.calc-strong { color: var(--gold-light); font-weight: 800; font-size: 1.05rem; }
.calc-footer-cta { margin-top: 1.25rem; }
.calc-footer-cta .btn { width: 100%; }
.ts-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.ts-tool-tile { display: flex; flex-direction: column; }
.ts-tool-tile-title { font-size: 1.1rem; margin: 0.75rem 0 0.5rem; }
.ts-tool-tile-desc { font-size: 0.9rem; color: var(--text-secondary); flex: 1 1 auto; }
.ts-tool-tile-btn { margin-top: 1.25rem; width: 100%; }
.ts-tool-related { margin-top: 2.5rem; }
.ts-tool-related-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ts-archive-note,
.ts-explainer {
  margin-top: 2.5rem;
  color: var(--text-secondary);
  line-height: 2;
  font-size: 0.93rem;
}

/* ---------------- Footer + misc ---------------- */
.footer-logo { margin-bottom: 1rem; }
.footer-about-text { font-size: 0.92rem; color: var(--text-muted); line-height: 1.9; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a { font-size: 0.85rem; color: var(--text-secondary); }
.footer-contact { margin-top: 1rem; }
.footer-disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.9;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-bottom-links a,
.footer-links a { min-height: 32px; display: inline-flex; align-items: center; }
.brand-logo-img { max-height: 45px; width: auto; height: auto; vertical-align: middle; }
.drawer-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
body.ts-no-scroll { overflow: hidden; }
.section-alt { background: var(--bg-input, #0f172a); }
.method-card { text-decoration: none; display: block; }
.method-card h2,
.method-card h3 { color: #fff; font-size: 1.1rem; margin: 0.75rem 0 0.5rem; }
.method-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.85; }
.method-meta { display: block; margin-top: 1rem; font-weight: 700; font-size: 0.85rem; color: var(--text-muted); }
.method-meta-good { color: var(--emerald-accent, #10b981); }
.method-meta-warn { color: #fb7185; }
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }

/* =====================================================================
 * Tablet
 * =================================================================== */
@media (max-width: 1024px) {
  .ts-single-head { grid-template-columns: 1fr; }
  .ts-score-card { max-width: 100%; }
  .ts-single-title { font-size: 1.7rem; }
}

/* =====================================================================
 * Mobile: turn the platform table into cards (no hidden columns)
 * =================================================================== */
@media (max-width: 768px) {
  .ts-table-scroll {
    overflow: visible;
    border: none;
    background: transparent;
    border-radius: 0;
  }
  .ts-platform-table {
    min-width: 0;
    width: 100%;
    display: block;
    font-size: 0.92rem;
  }
  .ts-platform-table thead { display: none; }
  .ts-platform-table tbody { display: block; }
  .ts-platform-table tr {
    display: block;
    background: var(--bg-card, #182234);
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
  }
  .ts-platform-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.07));
    text-align: left;
  }
  .ts-platform-table td:last-child { border-bottom: none; }
  .ts-platform-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    flex: 0 0 auto;
    text-align: right;
  }
  .ts-platform-table td.ts-col-name {
    display: block;
    border-bottom: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
    padding-bottom: 0.75rem;
    margin-bottom: 0.35rem;
  }
  .ts-platform-table td.ts-col-name::before { display: none; }
  .ts-platform-table td.ts-col-cta { display: block; padding-top: 0.85rem; }
  .ts-platform-table td.ts-col-cta::before { display: none; }
  .ts-cta-group { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .ts-btn-buy,
  .ts-btn-review { width: 100%; min-height: 48px; font-size: 0.95rem; }

  .ts-history-table { min-width: 0; display: block; }
  .ts-history-table thead { display: none; }
  .ts-history-table tbody,
  .ts-history-table tr,
  .ts-history-table td { display: block; width: 100%; }
  .ts-history-table tr {
    background: var(--bg-card, #182234);
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
  }
  .ts-history-table td { display: flex; justify-content: space-between; gap: 0.75rem; border: none; padding: 0.3rem 0; }
  .ts-history-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.78rem;
  }

  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .footer-bottom-links { justify-content: center; }
  .btn-group .btn,
  .ts-view-all-wrap .btn,
  .ts-tool-related-links .btn { width: 100%; }
  .ts-calc-grid { grid-template-columns: 1fr; }
  .ts-single-title { font-size: 1.5rem; }
  .ts-fact-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .ts-breadcrumbs { font-size: 0.8rem; }
  .ts-tool-copy { font-size: 0.95rem; line-height: 1.95; }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr; text-align: center; }
  .ts-fact-grid { grid-template-columns: 1fr; }
  .ts-name-link { font-size: 0.98rem; }
  .ts-score-card-num { font-size: 2.1rem; }
  .ts-filter-chip { font-size: 0.8rem; padding: 0 0.75rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ts-btn-buy,
  .ts-btn-review { transition: none; }
  .ts-btn-buy:hover { transform: none; }
}
