/* ==========================================================================
   Grey Sky Capital: performance card (performance-card.html)
   --------------------------------------------------------------------------
   Technical Summary
   - One card on paper: a slate-900 header (logo, "as of" date) and footer
     (registration numbers, the SEBI note) around a single table.
   - Strategy columns carry their brand mark above the name. Index columns
     sit on paper-200 behind an ink rule, under one label ("Indices, for
     comparison"), with no mark above the name.
   - Figures are mono and right-aligned; gains are moss, losses ember-ink,
     both AA on paper, and always carry their sign. The last row is the
     figure that matters most, so it is the only one in a filled pill.
   - Figures to one decimal; rows and heads tightened for reading (UAT, 3 Dec 2026).
   - Phones (under 621px): the wide table gives way to a compact one (perf-card.js):
     a row per strategy and index, a column per period, so nothing scrolls
     sideways, names wrap in a narrow first column, and the card
     reads as a 3:4 portrait. Between 621px and 1060px the wide table scrolls.
   - Print: the tools above the card are hidden and the card fills the sheet.
   - Colour and type come from tokens.css only. No motion.
   ========================================================================== */

.pc { max-width: 1240px; margin: 0 auto; padding: clamp(8px, 1.2vw, 16px) var(--gutter) clamp(24px, 4vw, 56px); background: var(--paper-100); }
.pc__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin: 0 0 8px; }
.pc-img { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-left: auto; }   /* Copy as image, Download image (perf-card-image.js) */
.pc-img__msg { flex-basis: 100%; margin: 0; color: var(--ink-muted); text-align: right; }
.pc-img__msg:empty { display: none; }
.pc-img button[disabled] { opacity: .6; cursor: progress; }
.pc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The same card as a pop-up on the homepage */
.pc-dialog { width: min(1240px, calc(100vw - 24px)); max-width: none; max-height: calc(100svh - 24px); margin: auto; padding: 0; border: 0; background: transparent; color: inherit; overflow: auto; }
.pc-dialog::backdrop { background: color-mix(in srgb, var(--slate-900) 72%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pc--pop { max-width: none; padding: clamp(12px, 2vw, 20px); }
.pc--pop .pc__tools { margin-bottom: 12px; }
.pc-card__title h2 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; color: var(--ink-head); }

.pc-card { border: 1px solid var(--ink-head); background: var(--paper-100); }
.pc-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px clamp(16px, 2.6vw, 28px); background: var(--slate-900); border-bottom: 3px solid var(--lime); }
.pc-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--grey-100); font-size: 16px; letter-spacing: .06em; }
.pc-brand img { width: 38px; height: auto; }
.pc-brand b { font-weight: 700; }
.pc-brand span { color: var(--grey-400); }
.pc-brand span b { color: var(--grey-100); }
.pc-brand:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
.pc-card__asof { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-100); text-align: right; }

.pc-card__body { padding: 14px clamp(16px, 2.6vw, 28px) 12px; display: grid; gap: 8px; }
.pc-card__title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.pc-card__title h1 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; color: var(--ink-head); }
.pc-card__title p { margin: 0; color: var(--ink-muted); }

.pc-scroll { position: relative; overflow-x: auto; border-top: 1px solid var(--ink-head); }   /* relative: the hidden screen-reader labels inside stay inside it, not stretching the page on phones */
.pc-scroll:focus-visible { outline: 3px solid var(--rust); outline-offset: 2px; }
.pc-table { width: 100%; min-width: 900px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.pc-table th, .pc-table td { padding: 5px 12px 5px 2px;   /* room on the right for a hanging footnote mark; headers sit over the figures */
  border-bottom: 1px solid var(--paper-300); text-align: right; vertical-align: middle; background: var(--paper-100); }
.pc-table tbody th { position: sticky; left: 0; z-index: 1; text-align: left; font-size: 13.5px; line-height: 1.25; font-weight: 600; color: var(--ink-head); width: 150px; padding-left: 0; }
.pc-corner { position: sticky; left: 0; z-index: 1; text-align: left; padding-left: 0; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); vertical-align: bottom; padding-bottom: 12px; width: 150px; }

/* column heads: every column is the same width and built the same way, top to bottom:
   a square (the strategy's accent, grey for an index), the name on a two-line block
   set against its foot, then two lines of mono detail. So squares, names and details
   each sit on one line across the row. */
.pc-col { vertical-align: top; line-height: 1.2; }
/* the head row: the mark (and, for Smart Core, the Flagship badge beside it), right-aligned over the figures */
.pc-col__top { display: flex; align-items: center; justify-content: flex-end; gap: 6px; height: 20px; margin: 0 0 4px; }
.pc-col i { display: block; margin: 0; }   /* the strategy's mark (main.css, Strategy key) */
/* one label over the index columns, said once */
.pc-table .pc-group td { padding: 0 8px 8px; border-bottom: 0; background: var(--paper-100); }
.pc-table .pc-group .pc-group__ours { padding: 6px 8px 0; text-align: left; vertical-align: bottom; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.pc-table .pc-group .pc-group__idx { padding: 6px 14px 0; text-align: left; vertical-align: bottom; background: var(--paper-200); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.pc-col b { display: flex; align-items: flex-end; justify-content: flex-end; height: 2.5em;   /* two lines; names share a bottom edge */
   font-size: 12.5px; line-height: 1.2; font-weight: 700; color: var(--ink-head); }
.pc-col--index b { letter-spacing: -.01em; }   /* CRISIL Composite Bond on two lines */
.pc-col span { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 9.5px; line-height: 1.3; font-weight: 400; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-muted); }
.pc-col b + span { margin-top: 5px; }

/* the three indices: a quieter ground behind an ink rule */
.pc-table .pc-col--index, .pc-table .pc-index { background: var(--paper-200); }
.pc-table .pc-c--lab { width: 150px; }
.pc-table .pc-c--idx { width: 96px; }   /* index columns hold a figure each: no wider than they need, so they read as one block */
.pc-table .pc-edge { border-left: 1px solid var(--ink-head); }
.pc-table tr > :last-child { padding-right: 14px; }

.pc-num { position: relative; font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; color: var(--ink-head); white-space: nowrap; }
.pc-num.is-up { color: var(--moss); }
.pc-num.is-down { color: var(--ember-ink); }
.pc-num sup, .pc-marks sup { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); margin-left: 2px; }
.pc-num sup { position: absolute; top: 6px; margin-left: 1px; }   /* the mark hangs past the figure, so figures stay aligned down the column */
.is-none { color: var(--ink-muted); font-family: var(--font-mono); }
.pc-bench { font-size: 11.5px; line-height: 1.25; color: var(--ink-body); }
.pc-na { background: var(--paper-200); }   /* an index has no benchmark: left empty, not dashed */
.pc-row--bench th, .pc-row--bench td { border-top: 1px solid var(--ink-head); }
.pc-row--alpha th, .pc-row--alpha td { border-bottom: 1px solid var(--ink-head); padding-top: 6px; padding-bottom: 6px; }
.pc-pill { display: inline-block; min-width: 7ch; padding: 3px 8px; text-align: right; background: var(--paper-300); color: var(--ink-head); font-weight: 700; }   /* one width, so the row reads as a band */
.pc-pill.is-up { background: var(--lime); }
.pc-pill.is-down { background: var(--flare); }

.pc-hint { display: none; margin: 0; color: var(--ink-muted); }
.pc-marks { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 22px; font-size: 11px; line-height: 1.5; color: var(--ink-muted); }   /* the notes flow side by side */
.pc-marks sup { margin: 0 2px 0 0; }

.pc-card__foot { padding: 11px clamp(16px, 2.6vw, 28px) 12px; background: var(--slate-900); display: grid; gap: 6px; }
.pc-reg { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--lime); }
.pc-reg span:nth-child(2) { color: var(--grey-100); }
.pc-disc summary { display: none; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; list-style: none;   /* wide screens: the disclaimer simply shows */
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-300); }
.pc-disc summary::-webkit-details-marker { display: none; }
.pc-disc summary::after { content: '+'; color: var(--lime); }
.pc-disc[open] summary::after { content: '\2212'; }
.pc-disc summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.pc-card__foot .t-legal { margin: 0; font-size: 10.5px; line-height: 1.5; letter-spacing: -.01em; color: var(--grey-300); max-width: none; }

/* Short screens: the whole card still fits at 100% zoom. The image export follows the same rule. */
@media (min-width: 1061px) and (max-height: 820px) { .pc-card { zoom: .9; } }
@media (min-width: 1061px) and (max-height: 700px) { .pc-card { zoom: .8; } }

@media (max-width: 1060px) {
  .pc-hint { display: block; }
  .pc-table tbody th, .pc-corner { box-shadow: 1px 0 0 var(--paper-300); padding-right: 12px; }
  .pc-table tbody th { white-space: normal; min-width: 104px; max-width: 132px; }
}
/* Phones: the compact table (perf-card.js) in place of the wide one; the card reads as a 3:4 portrait */
.pc-mob { display: none; }
.pc-mtable { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pc-mtable th, .pc-mtable td { padding: 3px 1px; border-bottom: 1px solid var(--paper-300); text-align: center;   /* figures centred in their columns */
  vertical-align: middle; white-space: nowrap; }
.pc-mtable thead th { padding: 4px 1px 3px; border-bottom: 1px solid var(--ink-head); font-family: var(--font-mono); font-size: 8px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.pc-mtable abbr { text-decoration: none; }
.pc-mtable .pc-m__corner { width: 30%; padding-left: 0; text-align: left; }
.pc-mtable .pc-m__vs { width: 16%; }
.pc-mtable tbody th { padding-left: 0; text-align: left; white-space: normal; font-size: 9.5px; line-height: 1.1; font-weight: 600; color: var(--ink-head); }   /* a narrow column: names wrap over two or three lines */
.pc-m__name { display: flex; align-items: flex-start; gap: 4px; }
.pc-m__name i { flex: none; width: 13px; height: 9px; margin-top: 1px; background: var(--mark) center / contain no-repeat; }
.pc-m__name > span { max-width: 6.6em; }   /* one width on every phone: two-word names longer than "Smart Core" always wrap the same way */
.pc-m__name sup { font-family: var(--font-mono); font-size: 7px; color: var(--ink-muted); margin-left: 1px; }
.pc-mtable .flagship { margin: 1px 0 0 17px; padding: 2px 4px 2px 3px; gap: 2px; font-size: 6px; letter-spacing: .06em; vertical-align: 0; }
.pc-mtable .flagship::before { width: 5px; height: 5px; }
.pc-mtable .pc-num, .pc-mtable .is-none { font-size: 10px; line-height: 1.3; letter-spacing: 0; }
.pc-mtable .pc-pill { min-width: 0; width: 100%; padding: 1px 4px; line-height: 1.35; font-size: 10px; letter-spacing: 0; text-align: center; }
.pc-m__group td { padding: 4px 0 0; text-align: left; border-bottom: 1px solid var(--paper-300); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.pc-m__idx th { font-weight: 500; color: var(--ink-body); }   /* indices: the same row, a quieter name, an empty last column */
.pc-mtable .pc-m__idx th { padding-left: 17px; }   /* lines up with the strategy names */
/* the same two grounds as the desktop card: strategies on paper-100, the indices (and their label) on paper-200 */
.pc-mtable .pc-m__idx, .pc-mtable .pc-m__group--idx { background: var(--paper-200); }   /* painted on the row: one solid block, no seams between cells */
.pc-mtable .pc-m__idx > *, .pc-mtable .pc-m__group--idx td { background: none; }
.pc-mtable .pc-m__group--idx td { padding-left: 4px; }
.pc-mtable tbody tr:last-child > * { border-bottom: 1px solid var(--ink-head); }
@media (max-width: 620px) {
  .pc-scroll, .pc-hint { display: none; }
  .pc-dialog { width: calc(100vw - 16px); }   /* the pop-up card keeps the page card's 343px width, so it stays 3:4 */
  .pc--pop { padding: 8px; }
  .pc-mob { display: block; border-top: 1px solid var(--ink-head); }
  /* the pop-up's three actions on one line */
  .pc__tools { gap: 8px; }
  .pc--pop .pc__tools { flex-wrap: nowrap; }
  .pc__tools .link { font-size: 14px; white-space: nowrap; }
  .pc-img { gap: 6px; }
  .pc__tools .btn--sm { min-height: 34px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
  .pc--pop .pc-img { position: relative; flex-wrap: nowrap; }
  .pc--pop .pc-img__msg { position: absolute; top: 100%; right: 0; width: 100%; padding-top: 4px; font-size: 11px; }   /* a note under the buttons, never pushing them apart */
  .pc:not(.pc--pop) .pc__tools > .link { flex-basis: 100%; }   /* the page: the back link, then its three buttons on one line */
  .pc:not(.pc--pop) .pc-img { margin-left: 0; }
  .pc-card__head { padding: 7px 12px; gap: 8px; border-bottom-width: 2px; }
  .pc-brand { font-size: 11px; gap: 6px; white-space: nowrap; }
  .pc-brand img { width: 24px; height: auto; }
  .pc-card__asof { font-size: 8px; letter-spacing: .08em; white-space: nowrap; }
  .pc-card__body { padding: 8px 12px 6px; gap: 4px; }
  .pc-card__title { gap: 2px; }
  .pc-card__title h1, .pc-card__title h2 { font-size: 17px; }
  .pc-card__title p { font-size: 7.4px; letter-spacing: -.02em; line-height: 1.35; }   /* one line */
  .pc-marks { font-size: 7.5px; line-height: 1.35; gap: 0 10px; margin: 0; }
  .pc-card__foot { padding: 6px 12px 7px; gap: 3px; }
  .pc-reg { font-size: 7.5px; gap: 0 10px; letter-spacing: 0; }
  .pc-card__foot .t-legal { font-size: 7px; line-height: 1.35; padding-top: 3px; }
  /* the disclaimer folds away: a mono "Disclaimer +" line, as the live section's */
  .pc-disc summary { display: inline-flex; }
  /* The indices and the notes under them: one dark-grey block from edge to edge of the card. The table and
     the notes reach the card's sides; the 12px the body keeps round its text moves into the outer cells. */
  .pc-card__body { padding-bottom: 0; }
  .pc-mob { margin: 0 -12px; }
  .pc-mtable tr > :first-child { padding-left: 12px; }
  .pc-mtable tr > :last-child { padding-right: 12px; }
  .pc-mtable .pc-m__idx th { padding-left: 29px; }   /* still level with the strategy names */
  .pc-mtable .pc-m__group td { padding-left: 12px; }
  .pc-mtable tbody tr:last-child > * { border-bottom: 0; }
  .pc-marks { margin: -4px -12px 0; padding: 6px 12px 8px; background: var(--paper-200); border-top: 1px solid var(--ink-head); }
}

@media (max-width: 380px) {   /* the narrowest phones: the three actions still fit one line */
  .pc__tools { gap: 6px; }
  .pc__tools .link { font-size: 13px; }
  .pc__tools .btn--sm { padding: 0 6px; font-size: 11.5px; }
}
@media print {
  .pc { max-width: none; padding: 0; }
  .pc__tools, .pc-hint, .skip, .pc-disc summary { display: none; }
  .pc-scroll { overflow: visible; }
  .pc-table { min-width: 0; }
  .pc-card, .pc-card__head, .pc-card__foot, .pc-pill, .pc-col i, .pc-table .pc-col--index, .pc-table .pc-index { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 10mm; }
}
