/* What /cameo and /cameo/<target> share, on the folder look (static/folder.css). */
main { width: min(960px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 3rem; }
h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05; }
h2 { margin: 2.6rem 0 0.4rem; font-size: 1.2rem; font-weight: 500; letter-spacing: -0.02em; }
.fine, footer { color: var(--muted); font-size: 0.85rem; }
.lede { margin: 0.8rem 0 0; max-width: 40rem; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.attribution { margin-top: 2.2rem; }
.empty { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* How each target ranked against the other public servers (bands), and CAMEO's per-residue lDDT (the same colours). */
:root {
  --band-blue: light-dark(#2F6FED, #7FA6F5);
  --band-green: light-dark(#1F8A4C, #5CC48E);
  --band-yellow: light-dark(#B0830A, #E3C062);
  --band-orange: light-dark(#D06A20, #EE9A5E);
  --band-red: light-dark(#C44536, #E8826F);
}
.key { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; list-style: none; padding: 0; margin: 0; }
.key li { font-size: 0.8rem; color: var(--ink); }
.key li::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; background: var(--key, var(--line)); }
.band-blue { --key: var(--band-blue); }
.band-green { --key: var(--band-green); }
.band-yellow { --key: var(--band-yellow); }
.band-orange { --key: var(--band-orange); }
.band-red { --key: var(--band-red); }

/* Segmented buttons (view, layer). */
.seg { display: inline-flex; gap: 0; }
.seg button {
  padding: 0.4rem 0.75rem; border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
}
.seg button + button { border-left: 0; }
.seg button:first-child { border-radius: var(--corner) 0 0 var(--corner); }
.seg button:last-child { border-radius: 0 var(--corner) var(--corner) 0; }
.seg button[aria-pressed="true"] { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }

canvas { width: 100%; height: auto; display: block; background: var(--tile-ground); border-radius: var(--corner); touch-action: pan-y; cursor: grab; }
.overlay-key { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin: 0.55rem 0 0; padding: 0; list-style: none; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }
.overlay-key li { display: flex; align-items: center; gap: 0.3rem; }
.overlay-key li::before { content: ""; flex: none; width: 0.9rem; height: 0.18rem; border-radius: 1px; background: var(--key); }
.overlay-key li.wide::before { width: 5rem; height: 0.3rem; }  /* the lDDT gradient's scale */
.overlay-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* Every public server on a target. */
.scores { overflow-x: auto; }
.scores table { border-collapse: collapse; width: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.scores th, .scores td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.scores th:first-child, .scores td:first-child { white-space: normal; padding-left: 0; }
.scores th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
/* Our row is shaded, its name bold; teal marks the best value in each column, whoever has it. */
.scores td.none { color: var(--muted); cursor: help; }
.scores tr.ours td { background: color-mix(in srgb, var(--teal) 8%, transparent); }
.scores tr.ours td:first-child { font-weight: 600; padding-left: 0.4rem; }
.scores td.best { color: var(--teal-text); font-weight: 500; }
/* The table's headers sort it (static/cameo.js scoresTable). */
.scores th button { all: unset; cursor: pointer; color: var(--muted); }
.scores th button:hover, .scores th[aria-sort] button { color: var(--ink); }
.scores th button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.scores th[aria-sort="ascending"] button::after { content: " ↑"; }
.scores th[aria-sort="descending"] button::after { content: " ↓"; }


/* Figures in a row: label above, number below. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.9rem 1.25rem; margin: 0; }
.stats div { margin: 0; }
.stats dt { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0.2rem 0 0; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--muted); }

/* The hidden attribute always wins: a canvas or cartoon box swapped out must not stay on the page. */
canvas[hidden], .cartoon[hidden] { display: none !important; }
