/* DS showcase blocks – all colours from --fx-* tokens */

.fx-block {
  border-radius: 24px;
  padding: 24px;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

/* Segmented switch */
.fx-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  margin-bottom: 24px;
  border: 1px solid var(--fx-core-border-secondary);
  border-radius: 999px;
}
.fx-switch button {
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.fx-switch button[aria-pressed="true"] {
  background: var(--fx-core-content-primary);
  color: var(--fx-core-background-primary);
}

/* Theme switch, as in the product dashboard (Figma vygkQb6aXMkUXEBkvQU8vt, node 2085:39998): icon segments,
   the active one is a raised pill. Used by the Colour tab and (via fx-screens.js) the screen player. */
.fx-theme-switch { display: inline-flex; gap: 4px; margin: 0; padding: 4px; border: 0; border-radius: 32px; background: var(--fx-core-background-secondary); }
.fx-theme-switch button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 32px; background: none; cursor: pointer; color: var(--fx-core-content-tertiary); transition: background-color .15s, color .15s; }
.fx-theme-switch button[aria-pressed="true"] { background: none; box-shadow: none; color: var(--fx-core-content-primary); }
/* Knob: one ::before slides under the pressed button (28px button + 4px gap = 32px step), like the dashboard tab pill */
.fx-theme-switch { position: relative; }
.fx-theme-switch button { position: relative; z-index: 1; }
.fx-theme-switch::before { content: ''; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 32px; background: var(--fx-core-background-primary); filter: drop-shadow(0 1px 3px rgba(17, 25, 40, .18)); transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), background-color 0.3s; }
.fx-theme-switch:has(> button:nth-child(2)[aria-pressed="true"])::before { transform: translateX(32px); }
@media (prefers-reduced-motion: reduce) { .fx-theme-switch::before { transition: none; } }
.fx-theme-switch button::before { content: ''; width: 16px; height: 16px; background: currentColor; -webkit-mask: center / 16px no-repeat; mask: center / 16px no-repeat; }
.fx-theme-switch [data-value="light"]::before { -webkit-mask-image: url(../assets/icons/theme-light.svg); mask-image: url(../assets/icons/theme-light.svg); }
.fx-theme-switch [data-value="dark"]::before { -webkit-mask-image: url(../assets/icons/theme-dark.svg); mask-image: url(../assets/icons/theme-dark.svg); }
.screen-player-opts > .fx-theme-switch:only-child { margin-left: auto; }
/* data-theme-float: theme switch as a floating system panel inside the screen window (bottom right, stays put while the screen scrolls) */
.screen-player-stage:has(> .fx-theme-float) { position: relative; }
.fx-theme-float { position: absolute; right: 16px; bottom: 16px; z-index: 2; background: rgba(255, 255, 255, 0.86) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(17, 25, 40, 0.16); }
.fx-theme-float button[aria-pressed="true"] { color: #111928; }
.fx-theme-float::before { background: #fff; }
.fx-theme-float button { color: #828a99; }
.screen-player-bar[hidden] { display: none; } /* theme switch alone keeps its place on the right */
.fx-theme-switch [data-value="desktop"]::before { -webkit-mask-image: url(../assets/icons/viewport-desktop.svg); mask-image: url(../assets/icons/viewport-desktop.svg); }
.fx-theme-switch [data-value="mobile"]::before { -webkit-mask-image: url(../assets/icons/viewport-mobile.svg); mask-image: url(../assets/icons/viewport-mobile.svg); }

/* Graph theming */
.fx-block .token-graph {
  --token-graph-fg: var(--fx-core-content-primary);
  --token-graph-bg: var(--fx-core-background-primary);
  --token-graph-muted: var(--fx-core-content-secondary);
  --token-graph-border: var(--fx-core-border-secondary);
  --token-graph-line: var(--fx-core-border-primary);
  --token-graph-accent: var(--fx-base-link);
}

/* Typography palettes: sample | specs, like the Figma docs */
/* Platform tabs: text tabs in place of the old "LG, XL screens" label */
.fx-type-bp { margin: 0 0 20px; }
.fx-type-tabs { display: flex; gap: 16px; }
.fx-type-tabs button { padding: 0; border: 0; background: none; font: 400 14px/20px 'Noto Sans', system-ui, sans-serif; color: var(--fx-core-content-tertiary); cursor: pointer; transition: color 0.15s; }
.fx-type-tabs button:hover { color: var(--fx-core-content-secondary); }
.fx-type-tabs button[aria-pressed="true"] { color: var(--fx-core-content-primary); font-weight: 600; } /* only the active tab is bold */
.fx-type-tabs button:focus-visible { outline: 2px solid var(--fx-base-link); outline-offset: 2px; border-radius: 4px; }
.fx-type-table { width: 100%; border-collapse: collapse; }
.fx-type-kind button { font-size: 12px; line-height: 16px; } /* table-head tabs: same tabs, head size */
.fx-type-bp[hidden] { display: none; }
.fx-type-table th { padding: 0 0 8px; border-bottom: 1px solid var(--fx-core-border-tertiary); text-align: left; font-size: 12px; line-height: 16px; font-weight: 400; }
.fx-type-table td { padding: 16px 0; border-bottom: 1px solid var(--fx-core-border-tertiary); vertical-align: middle; }
.fx-type-table tr:last-child td { border-bottom: 0; }
.fx-type-table th:last-child, .fx-type-table td:last-child { width: 140px; }
.fx-type-table td p { overflow-wrap: anywhere; }
.fx-type-spec { font-size: 11px; line-height: 14px; color: var(--fx-core-content-secondary); }

/* Narrow rules below are container queries on .case-bleed (container-type: inline-size in the page), so they follow the case column, not the window. 688 = the old 720px window minus gutters. */
/* Grid */
/* Grid styled like the Figma "Grid system" page: lavender columns, red margin and blue gutter badges, green content-area measure */
.fx-grid-frame { position: relative; display: grid; border: 1px solid var(--fx-core-border-tertiary); border-radius: 4px; font: 500 10px/16px 'Inter', system-ui, sans-serif; color: #fff; }
.fx-grid-cols, .fx-grid-content { grid-area: 1 / 1; }
/* Content sized for its tallest layout (XS: header + 3 stacked rows), so the block keeps one height on every stop.
   Bottom padding leaves room for the content-area measure (bottom 44) and the margin/gutter badges (bottom 8). */
.fx-grid-content { position: relative; min-height: 292px; box-sizing: border-box; padding-block: 16px 80px; align-content: start; row-gap: 12px; }
.fx-grid-content > div { grid-column: span 4; padding: 12px; border-radius: 8px; background: var(--fx-extension-background-neutral); color: var(--fx-extension-content-neutral); font: 400 12px/16px 'Noto Sans', system-ui, sans-serif; }
.fx-grid-content > div:first-child { grid-column: 1 / -1; }
.fx-grid-cols i { position: relative; background: #e9e9fc; font-style: normal; }
/* Badges fill what they measure: margin badges run from the frame edge to the first/last column, gutter badges fill the gap.
   z-index keeps a gutter badge above the next column (a later sibling would paint over it). */
.fx-grid-cols i::after, .fx-grid-frame::before, .fx-grid-frame::after { position: absolute; z-index: 1; bottom: 8px; min-width: 16px; box-sizing: border-box; border-radius: 2px; text-align: center; }
.fx-grid-cols i::after { content: var(--fx-grid-g-label); left: calc(100% + var(--fx-grid-gutter) / 2); width: var(--fx-grid-gutter); transform: translateX(-50%); background: #0d99ff; } /* centred, so a gap narrower than the 16px minimum overlaps both columns evenly */
.fx-grid-cols i:has(+ [hidden])::after, .fx-grid-cols i:last-child::after { content: none; }
.fx-grid-frame::before, .fx-grid-frame::after { width: var(--fx-grid-margin); background: #f24822; transition: width 0.35s; }
.fx-grid-frame::before { content: var(--fx-grid-m-label); left: 0; }
.fx-grid-frame::after { content: var(--fx-grid-m-label); right: 0; }
.fx-grid-measure { position: absolute; bottom: 44px; left: var(--fx-grid-margin); right: var(--fx-grid-margin); height: 0; border-top: 1px solid #14ae5c; transition: left 0.35s, right 0.35s; }
.fx-grid-measure::before, .fx-grid-measure::after { content: ''; position: absolute; top: -4px; width: 1px; height: 7px; background: #14ae5c; }
.fx-grid-measure::before { left: 0; } .fx-grid-measure::after { right: 0; }
.fx-grid-measure span { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 2px 6px; border-radius: 4px; background: #14ae5c; font-size: 11px; white-space: nowrap; }
.fx-grid-spec { margin: 0 0 12px; }
/* The frame has a fixed height, so the block keeps one height on every stop.
   Slider spans the grid frame; a stop sits 8px (half the thumb) in from each end, labels are centred under the stops */
.fx-grid-range { margin-top: 16px; }
.fx-grid-range input { display: block; width: 100%; height: 16px; margin: 0; -webkit-appearance: none; appearance: none; background: none; cursor: pointer; }
.fx-grid-range input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--fx-core-background-secondary); }
.fx-grid-range input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fx-core-background-secondary); }
.fx-grid-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--fx-base-link); }
.fx-grid-range input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--fx-base-link); }
.fx-grid-range input:focus-visible { outline: 2px solid var(--fx-base-link); outline-offset: 4px; border-radius: 8px; }
.fx-grid-ticks { position: relative; height: 26px; margin-top: 4px; }
.fx-grid-ticks button { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.fx-grid-ticks button:nth-child(1) { left: 8px; }
.fx-grid-ticks button:nth-child(2) { left: calc(8px + (100% - 16px) * 0.25); }
.fx-grid-ticks button:nth-child(3) { left: 50%; }
.fx-grid-ticks button:nth-child(4) { left: calc(8px + (100% - 16px) * 0.75); }
.fx-grid-ticks button:nth-child(5) { left: calc(100% - 8px); }
.fx-grid-ticks button::before { content: ''; display: block; width: 1px; height: 6px; margin: 0 auto 4px; background: var(--fx-core-border-primary); }
.fx-grid-ticks button[aria-pressed="true"]::before { background: var(--fx-base-link); }
.fx-grid-ticks button { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; line-height: 16px; color: var(--fx-core-content-tertiary); cursor: pointer; }
.fx-grid-ticks button[aria-pressed="true"] { color: var(--fx-core-content-primary); font-weight: 600; }

@container (max-width: 688px) {
  .fx-block { padding: 16px; }
  .fx-type-table th:last-child, .fx-type-table td:last-child { width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-block { transition: none; }
}

/* ─── Component labs (button / input playground, gallery) ─── */
.fx-lab-ctls { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 24px; }
.fx-lab-ctl { display: grid; gap: 6px; }
.fx-lab-ctl[hidden] { display: none; }
.fx-lab-ctl > span { font-size: 12px; line-height: 16px; color: var(--fx-core-content-secondary); }
.fx-lab-ctl .fx-switch { margin: 0; }
.fx-lab-variant { margin: 12px 0 16px; }
.fx-lab-tokens { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.fx-lab-tokens th, .fx-lab-tokens td { padding: 8px 12px 8px 0; text-align: left; vertical-align: middle; border-top: 1px solid var(--fx-core-border-tertiary); }
.fx-lab-tokens th { font-weight: 500; color: var(--fx-core-content-secondary); white-space: nowrap; width: 1%; }
.fx-lab-tokens code { font: 12px/16px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.fx-lab-tokens td:nth-child(3) { color: var(--fx-core-content-secondary); white-space: nowrap; }
.fx-lab-tokens td:last-child { white-space: nowrap; }
.fx-lab-tokens td i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--fx-core-border-secondary); }

.fx-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 24px; }
.fx-gallery-cell { display: grid; gap: 12px; align-content: start; }
.fx-gallery-cell--wide { grid-column: 1 / -1; }
.fx-gallery-cell--wide .fx-note { max-width: none; }
.fx-gallery-name { margin: 0; font-size: 12px; line-height: 16px; color: var(--fx-core-content-secondary); }
.fx-gallery-row { display: flex; flex-wrap: wrap; gap: 8px; }

@container (max-width: 688px) {
  .fx-lab-tokens td:nth-child(2) { display: none; }
  .fx-lab-tokens td:last-child { white-space: normal; }
  .fx-lab-ctl { min-width: 0; max-width: 100%; }
  .fx-lab-ctl .fx-switch { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}

/* ─── Component browser: one component at a time ─── */
.fx-cb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.fx-cb-bar .fx-switch { margin: 0; }
/* Component selector styled like Figma's instance dropdown: purple diamond, bold name, chevron, grey on hover */
.fx-cb-pick { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 8px; box-sizing: border-box; border: 1px solid #9747ff; border-radius: 6px; font: 600 14px/20px 'Inter', system-ui, sans-serif; color: var(--fx-core-content-primary); transition: background 0.15s; }
.fx-cb-pick:hover { background: var(--fx-core-background-secondary); }
.fx-cb-pick:focus-within { box-shadow: 0 0 0 1px #9747ff; }
.fx-cb-pick .fg-ic { width: 16px; height: 16px; color: #9747ff; flex: none; }
.fx-cb-pick select { appearance: none; field-sizing: content; height: 30px; padding: 0 20px 0 0; margin-right: -20px; border: 0; outline: 0; background: none; font: inherit; color: inherit; cursor: default; }
.fx-cb-pick select option { color: #000; font-weight: 400; }
.fx-cb-pick > svg:last-child { width: 16px; height: 16px; color: var(--fx-core-content-secondary); pointer-events: none; }
.fx-cb-panel[hidden] { display: none; }
.fx-cb-stage { display: grid; gap: 12px; align-content: center; justify-items: start; min-height: 280px; padding: 32px; border-radius: 16px; background: var(--fx-core-background-secondary); }
.fx-cb-stage > .fx-note, .fx-cb-stage > .fx-accordion, .fx-cb-stage > .fx-field { width: 100%; max-width: 480px; justify-self: center; }
.fx-cb-stage > .fx-tooltip { justify-self: center; }
.fx-cb-stage > .fx-gallery-row { justify-self: center; justify-content: center; }
.fx-cb-stage > .fx-check { justify-self: center; min-width: 220px; }
.fx-cb-stage .fx-accordion { background: var(--fx-core-background-primary); }

@container (max-width: 688px) {
  .fx-cb-stage { padding: 24px 16px; min-height: 220px; }
}

/* ─── Figma imitation for Button / Input (UI3: Inter 11/16, rows 32, controls 24 r5, sections 16px) ─── */
.fg {
  --fg-bg: #ffffff; --fg-canvas: #f5f5f5; --fg-line: #e6e6e6; --fg-text: rgba(0, 0, 0, 0.9); --fg-muted: rgba(0, 0, 0, 0.5);
  --fg-input: #f5f5f5; --fg-hover: #e6e6e6; --fg-blue: #0d99ff; --fg-purple: #9747ff;
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; overflow: hidden;
  border: 1px solid var(--fg-line); border-radius: 8px; background: var(--fg-bg);
  font: 400 11px/16px 'Inter', system-ui, sans-serif; letter-spacing: 0.005em; color: var(--fg-text);
}
[data-fx-theme="dark"] .fg {
  --fg-bg: #2c2c2c; --fg-canvas: #1e1e1e; --fg-line: #444444; --fg-text: rgba(255, 255, 255, 0.9); --fg-muted: rgba(255, 255, 255, 0.5);
  --fg-input: #383838; --fg-hover: #4a4a4a;
}
.fg-canvas { display: grid; place-items: center; min-height: 320px; padding: 48px 24px; background: var(--fx-core-background-primary); } /* canvas = the product's own surface for the current mode (white / snorlax-90), not Figma grey */
.fg-sel { position: relative; display: inline-grid; outline: 1px solid var(--fg-purple); }
.fg-sel .fx-field { width: 320px; max-width: 100%; }
.fg-sel .fg-note { width: 360px; max-width: 100%; }
.fg-tag { position: absolute; left: -1px; bottom: calc(100% + 4px); color: var(--fg-purple); font-weight: 500; white-space: nowrap; }
.fg-h { position: absolute; width: 6px; height: 6px; box-sizing: border-box; border: 1px solid var(--fg-purple); background: #fff; }
.fg-h--tl { left: -4px; top: -4px; } .fg-h--tr { right: -4px; top: -4px; } .fg-h--bl { left: -4px; bottom: -4px; } .fg-h--br { right: -4px; bottom: -4px; }
.fg-dim { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); padding: 0 4px; border-radius: 2px; background: var(--fg-purple); color: #fff; font-weight: 500; white-space: nowrap; }

.fg-panel { border-left: 1px solid var(--fg-line); background: var(--fg-bg); }
.fg-sec { padding: 8px 0; border-bottom: 1px solid var(--fg-line); }
.fg-sec:last-child { border-bottom: 0; }
.fg-sec-head, .fg-sec-title { display: flex; align-items: center; min-height: 32px; padding: 0 8px 0 16px; font-weight: 600; }
.fg-head-name { display: inline-flex; align-items: center; gap: 4px; }
.fg-ic { width: 16px; height: 16px; color: var(--fg-purple); flex: none; }
.fg-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; padding: 0 16px; }
.fg-row > label, .fg-row > span:first-child { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fg-select { position: relative; display: flex; align-items: center; height: 24px; border-radius: 5px; background: var(--fg-input); box-shadow: inset 0 0 0 1px transparent; }
.fg-select:hover { box-shadow: inset 0 0 0 1px var(--fg-hover); }
.fg-select:focus-within { box-shadow: inset 0 0 0 1px var(--fg-blue); }
.fg-select select { appearance: none; width: 100%; height: 24px; padding: 0 24px 0 8px; border: 0; outline: 0; background: none; font: inherit; color: inherit; cursor: default; }
.fg-select select option { color: #000; }
.fg-select > svg:last-child { position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; color: var(--fg-muted); pointer-events: none; }
.fg-select--head { flex: 1; margin-left: -8px; background: none; padding-left: 8px; gap: 4px; }
.fg-select--head select { padding-left: 0; font-weight: 600; }

.fg-text { display: flex; align-items: center; gap: 2px; height: 24px; padding-left: 4px; border-radius: 5px; background: var(--fg-input); }
.fg-text:focus-within { box-shadow: inset 0 0 0 1px var(--fg-blue); }
.fg-text svg { width: 16px; height: 16px; color: var(--fg-muted); flex: none; }
.fg-text input { flex: 1; min-width: 0; height: 24px; padding: 0 8px 0 0; border: 0; outline: 0; background: none; font: inherit; color: inherit; }

.fg-toggle { position: relative; width: 24px; height: 14px; padding: 0; border: 0; border-radius: 7px; background: var(--fg-hover); cursor: default; justify-self: start; transition: background 0.15s; }
.fg-toggle::after { content: ''; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.fg-toggle[aria-checked="true"] { background: var(--fg-blue); }
.fg-toggle[aria-checked="true"]::after { transform: translateX(10px); }
.fg-toggle:focus-visible, .fg-select select:focus-visible { outline: 2px solid var(--fg-blue); outline-offset: 1px; }

.fx-lab-variant .fg-live { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--fx-extension-background-neutral); color: var(--fx-extension-content-neutral); font-weight: 600; }

@container (max-width: 688px) {
  .fg { grid-template-columns: minmax(0, 1fr); }
  .fg-panel { border-left: 0; border-top: 1px solid var(--fg-line); }
  .fg-canvas { min-height: 240px; padding: 40px 16px; }
  .fg-sel .fx-field { width: 260px; }
}
@media (prefers-reduced-motion: reduce) { .fg-toggle, .fg-toggle::after { transition: none; } }

/* ─── In-block heading (what the block is) ─── */
.fx-block-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.fx-block-title { margin: 0; font: 600 14px/20px 'Geist', system-ui, sans-serif; color: var(--fx-core-content-primary); }
.fx-block-desc { margin: 4px 0 0; max-width: 560px; font: 400 14px/20px 'Geist', system-ui, sans-serif; color: var(--fx-core-content-secondary); }
.fx-block-head .fx-switch, .fx-block-head .token-graph-modes { flex: none; margin: 0; }
.screen-player > .fx-block-head { margin-bottom: 16px; }
@container (max-width: 688px) {
  .fx-block-head { flex-direction: column; gap: 12px; margin-bottom: 16px; }
}
/* The graph theme toggle lives in the heading now, outside .token-graph – give it the graph variables */
.fx-block-head .token-graph-modes { --token-graph-fg: var(--fx-core-content-primary); --token-graph-bg: var(--fx-core-background-primary); --token-graph-border: var(--fx-core-border-secondary); color: var(--fx-core-content-primary); font-size: 12px; }

/* ─── Semantic token index (replaces the line graph) ─── */
.fx-tk { position: relative; display: grid; gap: 20px; }
/* Thread from the picked token to its detail panel, routed through the column gap (drawn in fx-showcase.js) */
.fx-tk-thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke: var(--fx-base-link); stroke-width: 1; }
.fx-tk-thread circle { fill: var(--fx-base-link); stroke: none; }
.fx-tk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 12px; }
.fx-tk-group { min-width: 0; display: grid; align-content: start; gap: 2px; }
.fx-tk-group--base { grid-row: span 2; }
.fx-tk-group-title { margin: 0 0 4px 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--fx-core-content-secondary); }
.fx-tk-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; width: 100%; padding: 5px 6px; border: 1px solid transparent; border-radius: 8px; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.fx-tk-item > i { width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; }
.fx-tk-item b { display: block; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tk-item small { display: block; font-size: 11px; line-height: 14px; color: var(--fx-core-content-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tk-item:hover { background: var(--fx-core-background-secondary); }
.fx-tk-item.is-related { border-color: var(--fx-core-border-primary); border-style: dashed; }
.fx-tk-item[aria-pressed="true"] { border-color: var(--fx-base-link); border-style: solid; background: var(--fx-extension-background-neutral); }
.fx-tk-item:focus-visible { outline: 2px solid var(--fx-base-link); outline-offset: 1px; }

.fx-tk-detail { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--fx-core-border-secondary); border-radius: 16px; font-size: 12px; line-height: 16px; }
.fx-tk-detail[hidden] { display: none; }
.fx-tk-detail p { margin: 0 0 8px; color: var(--fx-core-content-secondary); }
.fx-tk-sel { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.fx-tk-sel > i { width: 40px; height: 40px; border-radius: 10px; }
.fx-tk-sel b { display: block; margin-bottom: 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.fx-tk-sel em { display: flex; align-items: center; gap: 6px; min-width: 0; font-style: normal; color: var(--fx-core-content-secondary); overflow-wrap: anywhere; }
.fx-tk-sel em i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.fx-tk-ramp > div { display: flex; gap: 2px; }
.fx-tk-ramp > div > i { position: relative; flex: 1; height: 28px; border-radius: 4px; }
.fx-tk-ramp > div > i b { display: none; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 3px; font-size: 10px; line-height: 12px; font-weight: 600; color: var(--fx-core-content-primary); }
.fx-tk-ramp > div > i.is-on { outline: 2px solid var(--fx-base-link); outline-offset: 2px; }
.fx-tk-ramp > div > i.is-on b { display: block; }
.fx-tk-ramp > div { margin-bottom: 14px; }
.fx-tk-shared > div { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-tk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border: 1px solid var(--fx-core-border-secondary); border-radius: 999px; background: var(--fx-core-background-primary); font: inherit; font-size: 11px; line-height: 16px; color: inherit; cursor: pointer; }
.fx-tk-chip i { width: 14px; height: 14px; border-radius: 4px; }
.fx-tk-chip--comp { cursor: default; color: var(--fx-core-content-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.fx-tk-none { color: var(--fx-core-content-tertiary); }
.fx-tk i.fx-tk-white { box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
[data-fx-theme="dark"] .fx-tk i.fx-tk-white { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1); }

@container (max-width: 688px) {
  .fx-tk-grid { grid-template-columns: 1fr 1fr; }
  .fx-tk-group--base { grid-row: auto; }
}

/* ─── Figma-doc style tables (space scale, breakpoints) ─── */
.fx-table-wrap { overflow-x: auto; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; border: 1px solid var(--fx-core-border-tertiary); }
.fx-table th, .fx-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--fx-core-border-tertiary); }
.fx-table th { font-size: 12px; font-weight: 600; background: var(--fx-core-background-secondary); color: var(--fx-core-content-primary); }
.fx-table tr:last-child td { border-bottom: 0; }
.fx-table td b { font-weight: 600; }
.fx-table td small { display: block; font-size: 12px; line-height: 16px; color: var(--fx-core-content-secondary); }
.fx-table code { font: 12px/20px ui-monospace, SFMono-Regular, Menlo, monospace; }
.fx-table--space th:nth-child(-n+4), .fx-table--space td:nth-child(-n+4) { width: 1%; white-space: nowrap; }
.fx-table--space td { padding-top: 4px; padding-bottom: 4px; }
.fx-table td.fx-table-bar { padding-left: 24px; vertical-align: middle; } /* beats .fx-table td { vertical-align: top } */
.fx-table-bar i { display: block; height: 12px; max-width: 320px; border-radius: 2px; background: var(--fx-base-link);
  transform-origin: left center; transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1) calc(var(--i) * 30ms); }
.fx-table--space:not(.is-in) .fx-table-bar i { transform: scaleX(0); }
.fx-tk-item { transition: background 0.15s, border-color 0.15s, opacity 0.4s ease calc(var(--i, 0) * 15ms), transform 0.5s cubic-bezier(0.2, 0, 0, 1) calc(var(--i, 0) * 15ms); }
.fx-tk:not(.is-in) .fx-tk-item { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: reduce) { .fx-table-bar i, .fx-tk-item { transition: none; } }

/* ─── Radius cards ─── */
.fx-radii { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px 16px; }
.fx-rad { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.fx-rad-tile { display: grid; place-items: center; height: 76px; }
/* Shape + the measured corner: an arc on the top-left, clamped to half the shape height as the browser clamps the radius */
.fx-rad-tile > i { position: relative; display: flex; align-items: center; width: 100%; height: 52px; padding-left: 12px; box-sizing: border-box; border-radius: var(--r); background: color-mix(in srgb, var(--fx-base-link) 12%, transparent); color: var(--fx-base-link); }
.fx-rad-tile > i::before { content: ''; position: absolute; left: 0; top: 0; width: clamp(12px, var(--r), 26px); height: clamp(12px, var(--r), 26px); box-sizing: border-box; border: solid var(--fx-base-link); border-width: 1px 0 0 1px; border-top-left-radius: var(--r); }
.fx-rad--full .fx-rad-tile > i { width: 76px; height: 76px; padding: 0; justify-content: center; border: 1px solid var(--fx-base-link); }
.fx-rad--full .fx-rad-tile > i::before { content: none; }
.fx-rad-tile b { font-style: normal; font-size: 11px; line-height: 14px; font-weight: 600; }
.fx-rad span b { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.fx-rad span small { display: block; font-size: 14px; line-height: 20px; color: var(--fx-core-content-tertiary); }
@container (max-width: 688px) { .fx-radii { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .fx-rad { grid-template-columns: 1fr; gap: 8px; } }
