/* RupeeCase Factsheet — Shared Stylesheet
   Used by all per-strategy factsheet-preview.html files.
   Locked design tokens. Do not edit per-strategy files for color/typography. */
:root {
  --navy: #0D1F3C;
  --blue: #2463EB;
  --ink: #0D1F3C;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F8FAFC;
  --green: #047857;
  --red: #B91C1C;
  --amber: #B45309;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}
.page {
  width: 794px;
  min-height: 1123px;
  background: white;
  margin: 0 auto 32px;
  box-shadow: 0 4px 24px rgba(13,31,60,0.08);
  padding: 36px 44px;
  position: relative;
  page-break-after: always;
}
.header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--navy); padding-bottom: 14px; margin-bottom: 20px; }
.brand-stack { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: 1.5px; color: var(--navy); }
.brand-tagline { font-size: 9px; letter-spacing: 2px; color: var(--muted); font-weight: 500; }
.header-meta { text-align: right; font-size: 9px; color: var(--muted); line-height: 1.5; }
.header-meta strong { color: var(--navy); display: block; font-size: 10px; }
.title-block { margin: 18px 0 14px; }
.strategy-name { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; color: var(--navy); }
.strategy-tagline { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 500; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 18px; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.badge.risk-very-high { background: #FEE2E2; color: #991B1B; }
.badge.risk-high { background: #FEF3C7; color: #92400E; }
.badge.risk-mod-high { background: #FEF3C7; color: #92400E; }
.badge.risk-moderate { background: #DBEAFE; color: #1E40AF; }
.badge.universe { background: #EFF6FF; color: var(--blue); }
.badge.benchmark { background: #FEF3C7; color: #92400E; }
.badge.sleeves { background: var(--navy); color: white; }
.overview { font-size: 11px; line-height: 1.65; color: #1F2937; margin-bottom: 18px; padding-left: 12px; border-left: 3px solid var(--blue); }
.metric-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.metric-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px; background: white; }
.metric-label { font-size: 9px; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }
.metric-value { font-size: 24px; font-weight: 800; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value.up { color: var(--green); }
.metric-value.cost { color: var(--amber); }
.metric-sublabel { font-size: 9px; color: var(--muted); margin-top: 4px; }
.section-title { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
table.perf { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-bottom: 14px; }
table.perf th { text-align: left; padding: 6px 9px; background: #F1F5F9; color: var(--navy); font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid var(--line); }
table.perf th:nth-child(2), table.perf th:nth-child(3) { text-align: right; }
table.perf td { padding: 6px 9px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.perf td:nth-child(2), table.perf td:nth-child(3) { text-align: right; font-weight: 600; }
table.perf tr.subgroup td { background: #F8FAFC; font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--blue); font-weight: 700; padding: 5px 9px; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.config-item { border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; }
.config-label { font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.config-value { font-size: 12px; font-weight: 700; color: var(--navy); margin-top: 3px; }
.footer { position: absolute; bottom: 18px; left: 44px; right: 44px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; font-size: 8.5px; color: var(--muted); }
.footer .pagenum { font-weight: 700; color: var(--navy); }
.heatmap-table { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 9.5px; }
.heatmap-table th { font-size: 8px; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; padding: 4px 0; text-align: center; }
.heatmap-table th:first-child { text-align: left; padding-left: 4px; }
.heatmap-table th.ytd-col { color: var(--navy); font-weight: 700; }
.heatmap-table td { height: 24px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 3px; color: white; font-size: 9.5px; }
.heatmap-table td.year { background: white !important; color: var(--navy); font-weight: 700; font-size: 10px; text-align: left; padding-left: 4px; }
.heatmap-table td.empty { background: #F1F5F9 !important; color: var(--muted); }
.heatmap-table td.ytd { background: var(--navy) !important; color: white; font-weight: 800; }
.holdings-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.holdings-grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.holdings-grid-8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 12px; }
.holding-card { border: 1px solid var(--line); border-radius: 4px; padding: 6px 4px; text-align: center; }
.holding-symbol { font-weight: 800; color: var(--navy); font-size: 9px; letter-spacing: 0.2px; line-height: 1.2; }
.holding-alloc { color: var(--blue); font-weight: 700; font-size: 9px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.holding-card.sleeve-debt { background: #DBEAFE; }
.holding-card.sleeve-gold { background: #FEF3C7; }
table.dd { width: 100%; border-collapse: collapse; font-size: 10px; }
table.dd th, table.dd td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.dd th:first-child, table.dd td:first-child { text-align: left; }
table.dd th { background: #F1F5F9; color: var(--navy); font-weight: 700; font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; }
table.dd td.dd-depth { color: var(--red); font-weight: 700; }
.insight { border-left: 4px solid var(--blue); background: #EFF6FF; padding: 10px 12px; border-radius: 0 6px 6px 0; font-size: 10.5px; line-height: 1.6; color: #1F2937; margin: 10px 0; }
.disclaimer { font-size: 8px; line-height: 1.5; color: var(--muted); margin-top: 12px; padding: 9px 11px; background: #F8FAFC; border-radius: 4px; }
.disclaimer strong { color: var(--navy); }
.year-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.year-cell { text-align: center; padding: 8px 6px; border-radius: 6px; color: white; }
.year-cell .year-label { font-size: 9px; opacity: 0.85; letter-spacing: 0.5px; font-weight: 600; }
.year-cell .year-value { font-size: 14px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
/* Factsheet back-bar | injected by patch-factsheets-meta.js so visitors landing
   directly on a factsheet URL have a way back to the rich detail page. */
.factsheet-nav { max-width: 920px; margin: 16px auto 0; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; }
.factsheet-back { color: var(--navy); text-decoration: none; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; transition: background 0.2s, transform 0.2s; }
.factsheet-back:hover { background: var(--navy); color: white; transform: translateX(-2px); }
.factsheet-print-hint { color: var(--muted); font-size: 11px; }
.factsheet-print-hint kbd { background: #F1F5F9; border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--navy); }
@media (max-width: 600px) {
  .factsheet-nav { flex-direction: column; align-items: stretch; padding: 0 14px; gap: 8px; }
  .factsheet-print-hint { display: none; }
}
@media print {
  body { padding: 0; background: white; }
  .page { box-shadow: none; margin: 0; }
  .factsheet-nav { display: none !important; }
  a[href]:after { content: ""; }
  .badge, .metric-card, .config-grid > div { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid-page; page-break-after: avoid; }
  @page { size: A4 portrait; margin: 12mm; }
}

/* RC_PRINT_STYLES_INJECTED */
/* Print stylesheet | factsheet-friendly PDF/paper output.
   Investors who print factsheets for compliance / file backup get a
   cleaner page: hide nav/footer/back-pill/trust-strip/share-buttons,
   force black-on-white text, expand collapsibles, fit table widths,
   keep page-break sensibility around major sections. */
@media print {
  html, body {
    background: #ffffff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Hide chrome */
  .rc-nav, nav, .rc-cfooter, footer, header,
  .tk-back-pill, .rc-back-pill, .rc-skip-link,
  .breadcrumb, .rc-breadcrumb, .rc-toc,
  .floating-cta, .sticky-cta,
  .cookie-consent, .toast, .modal, .cert-modal, .factsheet-email-gate,
  .rc-share, .share-buttons, .rc-pt-trail, .rc-cfooter-news, button,
  .factsheet-cta, .rc-cta, .download-pdf-btn,
  [role="navigation"], [role="banner"], [role="contentinfo"] {
    display: none !important;
  }

  /* Force backgrounds + text colors to print */
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Borders read better in print as solid grey */
  table, table th, table td, .stat-card, .kpi-card, .holding-card {
    border-color: #999 !important;
  }

  /* Page-break hygiene */
  h1, h2, h3 { page-break-after: avoid; }
  table, .stat-row, .kpi-strip, .holdings-table { page-break-inside: avoid; }
  section, .factsheet-section { page-break-inside: avoid; }

  /* Links: show URL after link text on print, useful for paper */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555 !important;
  }
  /* But don't suffix internal anchors or mailto */
  a[href^="#"]::after, a[href^="mailto:"]::after { content: ""; }

  /* Tables span full width */
  table { width: 100% !important; }

  /* Add a subtle header to every printed page */
  @page {
    margin: 18mm 14mm 14mm 14mm;
    @top-left {
      content: "RupeeCase Factsheet";
      font-size: 9pt;
      color: #999;
    }
    @top-right {
      content: counter(page) " / " counter(pages);
      font-size: 9pt;
      color: #999;
    }
    @bottom-center {
      content: "rupeecase.com . Tanmay Kurtkoti, QC Alpha";
      font-size: 8pt;
      color: #999;
    }
  }
}

/* RC_FACTSHEET_DARK_MODE_INJECTED */
/* Dark-mode overrides for factsheet body content. The canonical-shell
   nav/footer already swap themed via html.dark; this block extends the
   same pattern to the strategy-specific blocks (.metric-card, heatmap,
   tables, body). Hard-coded whites become dark cards; navy text becomes
   light text; borders soften. */
html.dark body, html[data-theme="dark"] body {
  background: #060912 !important;
  color: #e5e7eb !important;
  background-image: radial-gradient(circle at 15% 0%, rgba(96,165,250,0.04) 0%, transparent 45%);
  background-attachment: fixed;
}
html.dark .metric-card, html[data-theme="dark"] .metric-card {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.10) !important;
}
html.dark .metric-value, html[data-theme="dark"] .metric-value {
  color: #f1f5f9 !important;
}
html.dark .metric-label, html[data-theme="dark"] .metric-label,
html.dark .metric-sublabel, html[data-theme="dark"] .metric-sublabel {
  color: #94a3b8 !important;
}
html.dark .strategy-name, html[data-theme="dark"] .strategy-name,
html.dark .brand-name, html[data-theme="dark"] .brand-name,
html.dark .header-meta strong, html[data-theme="dark"] .header-meta strong,
html.dark .section-title, html[data-theme="dark"] .section-title {
  color: #f1f5f9 !important;
}
html.dark .strategy-tagline, html[data-theme="dark"] .strategy-tagline,
html.dark .brand-tagline, html[data-theme="dark"] .brand-tagline,
html.dark .header-meta, html[data-theme="dark"] .header-meta {
  color: #94a3b8 !important;
}
html.dark .header, html[data-theme="dark"] .header {
  border-bottom-color: rgba(255,255,255,0.18) !important;
}
html.dark .section-title, html[data-theme="dark"] .section-title {
  border-bottom-color: rgba(255,255,255,0.10) !important;
}
html.dark .overview, html[data-theme="dark"] .overview {
  color: #cbd5e1 !important;
  border-left-color: rgba(96,165,250,0.6) !important;
}
html.dark .heatmap-table td.year, html[data-theme="dark"] .heatmap-table td.year {
  background: rgba(255,255,255,0.04) !important;
  color: #f1f5f9 !important;
}
html.dark table, html[data-theme="dark"] table,
html.dark th, html[data-theme="dark"] th,
html.dark td, html[data-theme="dark"] td {
  border-color: rgba(255,255,255,0.10) !important;
  color: inherit;
}
html.dark .badge.risk-very-high, html[data-theme="dark"] .badge.risk-very-high {
  background: rgba(220,38,38,0.18) !important;
  color: #fca5a5 !important;
}
html.dark .badge.risk-high, html[data-theme="dark"] .badge.risk-high,
html.dark .badge.risk-mod-high, html[data-theme="dark"] .badge.risk-mod-high {
  background: rgba(217,119,6,0.18) !important;
  color: #fcd34d !important;
}
html.dark .badge.risk-moderate, html[data-theme="dark"] .badge.risk-moderate {
  background: rgba(59,130,246,0.18) !important;
  color: #93c5fd !important;
}
html.dark .badge.universe, html[data-theme="dark"] .badge.universe {
  background: rgba(59,130,246,0.10) !important;
  color: #93c5fd !important;
}
html.dark .badge.benchmark, html[data-theme="dark"] .badge.benchmark {
  background: rgba(217,119,6,0.18) !important;
  color: #fcd34d !important;
}
html.dark .badge.sleeves, html[data-theme="dark"] .badge.sleeves {
  background: #f1f5f9 !important;
  color: #0D1F3C !important;
}
