/* CGPA to Percentage Converter only (Chief of Design, 2026-11-20). Shared pieces live in tools.css; this file owns the
   example badges, the one-row result actions, and the phone layouts of the tables (cards instead of columns). */

/* The example badges: shown while the figures on screen are the example, hidden once the reader types their own. */
.cg-ex { justify-self: start; border-style: dashed; color: var(--gold-text); border-color: var(--gold-text); background: transparent; }
.cg-ex[hidden] { display: none; }

/* Result actions: Copy line, Copy link and the resume CTA in one row. */
.cg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cg-actions .btn { white-space: normal; text-align: center; }

/* The every-university table: a closed list on phones (JS opens it on desktop), so 30 rows do not stack up. */
.cg-all > summary { display: none; }
.cg-all > summary:focus-visible { outline: 3px solid var(--gold-text); outline-offset: 2px; }

@media (max-width: 640px) {
  .cg-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cg-actions .btn-primary { grid-column: 1 / -1; }

  .cg-all > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--border-hi); border-radius: 10px; background: var(--surface); color: var(--text); font: 600 .9rem/1.3 "Plus Jakarta Sans", sans-serif; }
  .cg-all > summary::-webkit-details-marker { display: none; }
  .cg-all > summary::after { content: "▾"; margin-left: auto; padding-left: 10px; color: var(--gold-text); }
  .cg-all[open] > summary::after { content: "▴"; }

  /* Tables as stacked cards: each row a card, each cell with its label above it. */
  .t-table.cg-stack thead { display: none; }
  .t-table.cg-stack, .t-table.cg-stack tbody { display: block; width: 100%; }
  .t-table.cg-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px; border-bottom: 1px solid var(--border); }
  .t-table.cg-stack tr:last-child { border-bottom: 0; }
  .t-table.cg-stack td { display: grid; gap: 4px; min-width: 0; padding: 0; border: 0; font-size: .86rem; overflow-wrap: anywhere; }
  .t-table.cg-stack td[data-label]::before { content: attr(data-label); font: 600 .64rem/1.2 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .t-table.cg-stack td.n { text-align: left; white-space: normal; }
  .t-table.cg-stack td.cg-rm { justify-self: end; align-self: end; width: auto; }

  /* Candidates: name and university full width, CGPA and remove on the row below. */
  #cmp tr { grid-template-columns: minmax(0, 1fr) auto; }
  #cmp td { width: auto; }
  #cmp td:nth-child(1), #cmp td:nth-child(2) { grid-column: 1 / -1; }
  #cmp .t-input, #cmp .t-select { width: 100%; max-width: none; }

  /* Comparison results: name and sources full width, the two figures side by side. */
  #cmp-out tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #cmp-out td:nth-child(1), #cmp-out td:nth-child(4) { grid-column: 1 / -1; }

  /* Every university: name with its figure on one line, the formula under it. */
  #all tr { grid-template-columns: minmax(0, 1fr) auto; }
  #all td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #all td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; font-size: .95rem; }
  #all td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--text-mid); font-size: .8rem; }
  #all .t-hint { display: block; }
}


/* Source notes: links are underlined so they read as links, not as text. */
.t-src a { text-decoration: underline; text-underline-offset: 2px; }
/* Visually hidden text for screen readers (the site-wide .sr-only is not loaded on the tool pages). */
.cg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
