/* What the Perp Risk landing needs that the Figma "Design System 2026" does not draw, built from
   the file's own materials (its seven colours, two families, 6px button corner, forest tints as
   the Unavailable button uses) so each block can be drawn back into the file. No new hue: a risk
   level is green (low), forest (medium) or risk (high); none is ink at 45%.

   Needed by: Perp Risk landing (risk.rely.sh) and its Chrome extension. */

/* Levels. The colour a risk level takes on a light surface. */
.cambrian-level--low { color: var(--cambrian-main-cambrian-green); }
.cambrian-level--medium { color: var(--cambrian-main-forest-green); }
.cambrian-level--high { color: var(--cambrian-secondary-risk); }
.cambrian-level--none { color: rgba(28, 28, 28, 0.45); }

/* Hero metric. The Metric Tile's figure and label at hero size, on a dark band with no tile:
   the figure in Crimson Text Regular, as every figure in the file. */
.cambrian-metric-hero { display: flex; flex-direction: column; gap: 10px; color: var(--cambrian-main-beige); }
.cambrian-metric-hero__figure { font: 400 clamp(96px, 13vw, 168px) / 1 var(--cambrian-font-serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cambrian-metric-hero__label { font: 600 13px / 16px var(--cambrian-font-sans); letter-spacing: 0.08em; text-transform: uppercase; }

/* Table. On a white surface inside a forest hairline (the Coverage Card's frame). Header row in
   the eyebrow, cells in body-sm with tabular figures, rows parted by forest at 15%. The ranked
   column's header is a highlight bar: green with beige text. */
.cambrian-table-frame { background: var(--cambrian-main-white); border: 1px solid var(--cambrian-main-forest-green); overflow-x: auto; }
.cambrian-table { width: 100%; border-collapse: collapse; color: var(--cambrian-main-ink); font: 400 14px / 20px var(--cambrian-font-sans); font-variant-numeric: tabular-nums; }
.cambrian-table th { padding: 12px 12px; text-align: left; font: 600 13px / 16px var(--cambrian-font-sans); letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--cambrian-main-forest-green); white-space: nowrap; }
.cambrian-table td { padding: 12px 12px; border-bottom: 1px solid rgba(4, 64, 25, 0.15); white-space: nowrap; }
.cambrian-table tr:last-child td { border-bottom: 0; }
.cambrian-table th.r, .cambrian-table td.r { text-align: right; }
.cambrian-table th.cambrian-table__highlight { background: var(--cambrian-main-cambrian-green); color: var(--cambrian-main-beige); }
.cambrian-table td.cambrian-table__highlight { background: rgba(33, 137, 38, 0.06); }

/* Meter. A share of 100 as a number and a bar: the track forest at 15%, the fill in the level's colour. */
.cambrian-meter { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.cambrian-meter__value { min-width: 4.2em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cambrian-meter__track { display: block; position: relative; overflow: hidden; width: 100%; max-width: 120px; height: 6px; border-radius: 3px; background: rgba(4, 64, 25, 0.15); }
.cambrian-meter__track::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--cambrian-meter-value, 0%); background: currentColor; }

/* Field. A text input in the button's heights and corner: white, a forest hairline, green when focused. */
.cambrian-field { display: block; width: 100%; min-width: 0; height: var(--cambrian-size-button); padding: 0 14px; border: 1px solid var(--cambrian-main-forest-green); border-radius: var(--cambrian-radius-button); background: var(--cambrian-main-white); color: var(--cambrian-main-ink); font: 400 14px / 20px var(--cambrian-font-sans); font-variant-numeric: tabular-nums; }
.cambrian-field--lg { height: var(--cambrian-size-button-lg); font-size: 16px; }
.cambrian-field--sm { height: var(--cambrian-size-button-sm); padding: 0 10px; font-size: 13px; }
.cambrian-field::placeholder { color: rgba(28, 28, 28, 0.45); }
.cambrian-field:focus { outline: none; border-color: var(--cambrian-main-cambrian-green); box-shadow: 0 0 0 2px rgba(33, 137, 38, 0.25); }
.cambrian-field--invalid { border-color: var(--cambrian-secondary-risk); }

/* Chip. A small label in one of the button fills, at the small button's type. */
.cambrian-chip { display: inline-block; padding: 2px 8px; border-radius: var(--cambrian-radius-button); font: 600 13px / 18px var(--cambrian-font-sans); white-space: nowrap; }
.cambrian-chip--low { background: var(--cambrian-main-cambrian-green); color: var(--cambrian-main-beige); }
.cambrian-chip--medium { background: var(--cambrian-main-forest-green); color: var(--cambrian-main-beige); }
.cambrian-chip--high { background: var(--cambrian-secondary-risk); color: var(--cambrian-main-white); }

/* Live. The dot before a label that says the data is live. Risk colour, the colour of a recording light. */
.cambrian-live { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--cambrian-secondary-risk); vertical-align: 1px; animation: cambrian-live-pulse 2s infinite; }
@keyframes cambrian-live-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .cambrian-live { animation: none; } }
