/*
  taste-skill feature cards - the card, its inset panel and where a fragment sits on it.
  The rules and their reasons are in references/cards.md. Link after system.css (it refines .card
  and .panel there) or on its own with these tokens on a ground:
    --bg (page), --card (one step off the page), --ink, --muted, --accent, --accent-ink,
    --font-text, --font-mono
  Fragments in a panel take --fx-* from .stage (set below from the same tokens).
*/

/* ---------------------------------------------------------------- the card */
.card {
  --c-r: 20px;                      /* card radius */
  --c-pad: 28px;                    /* text padding = the panel's side inset */
  --c-gap: 8px;                     /* an inset panel's margin; its radius is --c-r minus this */
  --c-border: color-mix(in oklab, var(--ink) 8%, transparent);
  --c-text: color-mix(in oklab, var(--ink) 84%, var(--card));   /* card text: the ink, a touch softer than titles */
  --c-hi: oklch(from var(--card) 1 0 0 / clamp(0, calc(0.09 - l * 0.09), 0.07));
  --c-sh: oklch(from var(--card) 0 0 0 / calc(0.07 - l * 0.04));
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: var(--c-pad); border-radius: var(--c-r);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--c-border);
  box-shadow: inset 0 1px 0 var(--c-hi), 0 1px 2px var(--c-sh);
  overflow: clip;
  gap: 0;
}
@media (min-width: 1024px) { .card { --c-pad: 32px; } }
@media (max-width: 639px) { .card { --c-r: 18px; --c-pad: 20px; } }

.card > h3, .card__title {
  margin: 0; font-family: var(--font-text); font-size: 18px; line-height: 26px; font-weight: 560;
  letter-spacing: -0.012em; color: var(--ink); text-wrap: balance;
}
/* the two lines under a title: 16px in the ink (a touch softer than the title), never small grey text */
.card > p, .card__text {
  margin: 8px 0 0; font-size: 16px; line-height: 24px; color: var(--c-text);
  max-width: 46ch; text-wrap: pretty;
}
/* two muted lines keep one height in a row so the panels line up; only where cards sit side by side
   (below 1024px a row is one column, and the held line would be an empty gap) */
@media (min-width: 1024px) { .card--row > p { min-height: 2lh; } }
.card__link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; width: max-content;
  font-size: 15px; font-weight: 500; line-height: 22px; color: var(--ink); text-decoration: none;
}
.card__link svg { width: 14px; height: 14px; transition: transform 200ms cubic-bezier(.2,.7,.2,1); }
.card__link:hover svg { transform: translateX(2px); }

/* ---------------------------------------------------------------- the inset panel */
/* Default (x.ai): aligned with the text column and running off the card's bottom edge.
   The effect canvas mounts on the panel (data-fx) and sits under everything in it. */
.panel {
  --p-r: 12px;
  display: block; padding: 0;
  --p-h: clamp(264px, 22vw + 8px, 340px);
  position: relative; isolation: isolate; overflow: clip;
  min-height: var(--p-h); flex: 1 0 auto;
  border-radius: var(--p-r) var(--p-r) 0 0;
  background: color-mix(in oklab, var(--ink) 4%, var(--card));
}
/* a panel with no effect mounted stands on the page's lit ground (system.css --ground-*: sand, sky,
   sage, painting), never a grey a shade off the white UI on it: flat on kind other (cafes, shops,
   studios); on a tech page (site-kind tech, software or gaming) a soft mesh of the ground's own tones,
   the Figma tile, with no grain (grain or texture would be the page's one effect). A [data-fx] panel
   draws its effect instead. */
.panel:not([data-fx], .panel--device) { background: var(--ground-bg, #d9ccb7); }
:root:has(meta[name="site-kind"]:is([content="tech"], [content="software"], [content="gaming"])) .panel:not([data-fx], .panel--device) {
  background-color: var(--ground-bg, #d9ccb7);
  background-image:
    radial-gradient(70% 90% at 12% 0%, color-mix(in oklab, var(--ground-surface, #e9e0d2) 92%, white), transparent 70%),
    radial-gradient(60% 80% at 100% 100%, color-mix(in oklab, var(--ground-accent, #a8794a) 34%, var(--ground-bg, #d9ccb7)), transparent 72%),
    radial-gradient(50% 60% at 85% 10%, color-mix(in oklab, var(--ground-surface, #e9e0d2) 60%, transparent), transparent 70%);
}
.card > .panel { margin-top: 32px; margin-bottom: calc(-1 * var(--c-pad) - 1px); }
.card > .panel--device { margin-top: 24px; }
/* system.css spaces the text above a panel itself; here the panel carries the 32px */
.card > :has(+ .panel) { margin-bottom: 0; }
/* a crisp 1px edge over the ground and over any fragment it crops */
.panel::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 7%, transparent), inset 0 1px 0 color-mix(in oklab, var(--ink) 4%, transparent);
}
/* the vignette that calms the ground where the fragment sits (--vx, --vy: its centre) */
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; width: auto; padding: 0;
  background: radial-gradient(ellipse 70% 62% at var(--vx, 50%) var(--vy, 62%),
    color-mix(in oklab, var(--calm, var(--card)) var(--calm-k, 34%), transparent), transparent 72%);
}
/* inset on all sides by --c-gap; nested radius */
.card > .panel--inset {
  margin: 32px calc(var(--c-gap) - var(--c-pad)) calc(var(--c-gap) - var(--c-pad));
  border-radius: calc(var(--c-r) - var(--c-gap));
}
/* runs to the card's side and bottom edges (Figma's image band); the card's corners clip it */
.card > .panel--flush {
  margin: 32px calc(-1 * var(--c-pad) - 1px) calc(-1 * var(--c-pad) - 1px);
  border-radius: 0;
}
.panel--flush::after { box-shadow: inset 0 1px 0 color-mix(in oklab, var(--ink) 7%, transparent); }
/* the panel on top, the caption under it (tall cards) */
.card > .panel--top {
  order: -1; margin: calc(var(--c-gap) - var(--c-pad)) calc(var(--c-gap) - var(--c-pad)) 24px;
  border-radius: calc(var(--c-r) - var(--c-gap)); flex: none; min-height: 0; aspect-ratio: 1 / 1;
}
.panel--top.panel--wide { aspect-ratio: 4 / 3; }

/* a device (x.ai's "Computer" card): a status row, then the ground as its screen. The row sits on the
   card itself, not in a frame of its own, so the card stays two levels deep (card > picture > UI) */
.panel--device { display: flex; padding: 0; flex-direction: column; background: none; overflow: visible; isolation: auto; border-radius: 0; }
.panel--device::before, .panel--device::after { display: none; }
.panel__bar {
  display: flex; align-items: center; gap: 8px; height: 32px; margin-bottom: 12px; padding: 0; flex: none;
  font: 500 13px/20px var(--font-text); color: var(--ink);
}
.panel__bar .muted { color: var(--muted); font-weight: 400; }
.panel__bar .sp { flex: 1; }
/* the bar's status is quiet ink: the accent belongs to the one status inside the screen */
.panel__status {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font: 500 var(--t-label)/1 var(--font-text); color: var(--ink);
  background: color-mix(in oklab, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 8%, transparent);
}
.panel__bar .ui-agent { width: 20px; height: 20px; --u-ink: var(--ink); --u-bg: var(--card); }
/* a still dot: the bar's status never spins on its own (the moving part is the screen's one loop) */
.panel__status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.panel__screen {
  position: relative; isolation: isolate; overflow: clip; flex: 1;
  margin: 0; border-radius: var(--p-r) var(--p-r) 0 0;
  background: color-mix(in oklab, var(--ink) 4%, var(--card));
}
.panel__screen::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 7%, transparent);
}
.panel__screen::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 62% at var(--vx, 50%) var(--vy, 70%),
    color-mix(in oklab, var(--calm, #000) var(--calm-k, 30%), transparent), transparent 72%);
}

/* ---------------------------------------------------------------- where a fragment sits */
/* .stage holds the fragment(s) and gives them their palette: the fragment surface is one step
   lighter than the card on dark grounds and white on light ones */
.stage, .panel > .stage, .panel__screen > .stage {
  position: absolute; inset: 0; z-index: 1; max-width: none;
  --ui-font: var(--font-text); --ui-mono: var(--font-mono); --ui-radius: 12px;
  /* the fragment surface: white on a light card, one step lighter than a dark card (--frag overrides) */
  --fx-bg: var(--frag, oklch(from var(--card) clamp(calc(l + 0.05), calc((l - 0.5) * 1000), 1) calc(c * 0.5) h));
  --fx-surface: var(--card); --fx-ink: var(--ink); --fx-muted: var(--muted);
  --fx-accent: var(--accent); --fx-accent-ink: var(--accent-ink);
}
.stage > * { position: absolute; max-width: none; }
/* from 640px a fragment keeps its true width and is cropped by the panel, never squeezed to fit
   (on a phone it takes the panel's width instead: see the end of this block) */
@media (min-width: 640px) { .stage > :not(.at-center) > [data-ui] { max-width: none; } }
/* a fragment cut by the panel's edge dissolves into the ground over its last --fade-h (64px; 40px for a
   short panel) instead of being sliced through a line of text (edge-fade-dissolve, 14 of 41 sites).
   The fade only ever covers context: the fragment's point (the row that changes, the number, the
   button) sits above it. */
.stage { --fade-h: 64px; }
.stage--fade-b { -webkit-mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)); mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)); }
.stage--fade-r { -webkit-mask: linear-gradient(to right, #000 calc(100% - 72px), transparent calc(100% - 4px)); mask: linear-gradient(to right, #000 calc(100% - 72px), transparent calc(100% - 4px)); }
.stage--fade-br {
  -webkit-mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)), linear-gradient(to right, #000 calc(100% - 72px), transparent calc(100% - 4px));
  -webkit-mask-composite: source-in;
  mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)), linear-gradient(to right, #000 calc(100% - 72px), transparent calc(100% - 4px));
  mask-composite: intersect;
}
/* anchored at the top-left inset, cut by the right and bottom edges (19 of 41 sites) */
.at-corner { left: var(--ax, 32px); top: var(--ay, 32px); }
/* anchored at the top-right inset, cut by the bottom only: on a narrow panel it narrows to the panel
   minus both insets rather than run out of the left edge through its text */
.at-right { right: var(--ax, 32px); top: var(--ay, 32px); max-width: calc(100% - 2 * var(--ax, 32px)); }
.stage > .at-right > :is([data-ui], .ui) { max-width: 100%; }
/* rising out of the bottom edge (x.ai) */
.at-rise { left: var(--ax, 18%); top: var(--ay, 48px); }
/* .to-edge: the wrapper reaches --cut (72px) past the panel's bottom edge whatever the panel's height,
   so a fragment that fills its wrapper (stat with opts.fill, a long list) is always cut on purpose and
   never by a few accidental px */
.stage > .to-edge { bottom: calc(-1 * var(--cut, 72px)); }
.stage > .to-edge > :is([data-ui], .ui) { height: 100%; }
/* .fit: the fragment takes the panel's width minus --ax on both sides instead of its own, for a narrow
   panel where a few px of overhang would cut its text (contain it, or cut it by 48px or more).
   --fit-max (its true width, e.g. 400px for chat) keeps it at that width on a wide panel, centred
   between the insets (x.ai's window rising out of the bottom edge), so it only narrows where the
   panel is too small: never a 1-23px sliver, a cut at 1024, or uneven ground at the sides */
.stage > .fit { right: var(--ax, 32px); }
.stage > .fit > :is([data-ui], .ui) { width: 100%; max-width: var(--fit-max, 100%); margin-inline: auto; }
/* .wide: a fluid fragment (files, calendar) set wider than the panel (--w), so it is cut by the right
   edge like a window, not centred with even ground round it; pair with .stage--fade-br. Whatever the
   panel's width it runs at least 64px past the right edge */
.stage > .wide { width: max(var(--w, 680px), 100% - var(--ax, 32px) + 64px); }
.stage > .wide > :is([data-ui], .ui) { width: 100%; max-width: none; }
/* a small control in the calm middle of a focal ground (Figma's Texture tile): never a window or a
   dialog. It never runs past the panel: at most the panel less 24px a side */
.at-center { left: 50%; top: 50%; translate: -50% -50%; max-width: calc(100% - 48px); }
.stage > .at-center > :is([data-ui], .ui) { max-width: 100%; }
/* a second fragment laid over the first one's edge */
.at-over { right: var(--bx, 24px); bottom: var(--by, 24px); z-index: 2; }
.at-over-l { left: var(--bx, 24px); bottom: var(--by, 24px); z-index: 2; }
/* phone: a fragment takes the panel's width minus the inset on both sides (its own width stays the upper
   bound), so it is only ever cut at the bottom, never through a line of text at the side. The desktop
   --ax and --ay are ignored here; --ay-sm sets the top. */
@media (max-width: 639px) {
  .stage > :is(.at-corner, .at-right, .at-rise) { left: var(--ax-sm, 16px); right: var(--ax-sm, 16px); top: var(--ay-sm, 24px); max-width: none; }
  .stage > :is(.at-corner, .at-right, .at-rise) > :is([data-ui], .ui) { max-width: 100%; }
  .stage > .wide { width: auto; }
  .stage > .at-center { max-width: calc(100% - 2 * var(--ax-sm, 16px)); }
  /* a dialog over a window takes the panel's width less 12px a side, never running past it */
  .stage > :is(.at-over, .at-over-l) { left: 12px; right: 12px; bottom: 16px; }
  .stage > :is(.at-over, .at-over-l) > :is([data-ui], .ui) { width: auto; max-width: 100%; }
}

/* ---------------------------------------------------------------- variants */
/* text beside the panel */
.card--split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: stretch; }
.card--split > .card__body { display: flex; flex-direction: column; justify-content: center; padding: 16px 0; }
.card--split > .panel { margin: calc(var(--c-gap) - var(--c-pad)) calc(var(--c-gap) - var(--c-pad)) calc(var(--c-gap) - var(--c-pad)) 0; border-radius: calc(var(--c-r) - var(--c-gap)); min-height: 420px; }
@media (max-width: 899px) {
  .card--split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .card--split > .card__body { padding: 0; }
  .card--split > .panel { margin: 28px calc(var(--c-gap) - var(--c-pad)) calc(var(--c-gap) - var(--c-pad)); min-height: 360px; }
}
.card__points { display: grid; gap: 0; margin: 24px 0 0; padding: 0; list-style: none; }
.card__points li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-border); font-size: 16px; line-height: 24px; color: var(--c-text); }
.card__points li b { color: var(--ink); font-weight: 500; }
.card__points svg { width: 18px; height: 18px; margin-top: 3px; flex: none; color: var(--ink); }

/* the big number: filled with an effect through a blend knock-out (see cards.md) */
.knock { position: relative; isolation: isolate; display: inline-block; line-height: 0.92; }
.knock__text {
  position: relative; z-index: 1; display: block;
  font: 600 var(--knock-size, 128px)/0.92 var(--font-display, var(--font-text)); letter-spacing: -0.05em;
  background: var(--card); color: #fff; mix-blend-mode: darken; padding: 0.04em 0.06em 0.08em 0;
}
.knock--light .knock__text { color: #000; mix-blend-mode: lighten; }
/* a plain big number beside a knocked-out one: the same size and the same box, so the rows under both
   start level */
.stat__num {
  display: block; font: 600 var(--knock-size, 128px)/0.92 var(--font-display, var(--font-text)); letter-spacing: -0.05em;
  padding: 0.04em 0.06em 0.08em 0; color: var(--ink); white-space: nowrap;
}
.stat__unit { font-size: 0.32em; letter-spacing: -0.01em; color: var(--muted); font-weight: 500; margin-left: 0.2em; }
.stat__label { font-size: 16px; line-height: 24px; color: var(--c-text); }
.stat__label b { color: var(--ink); font-weight: 500; }

/* testimonial: the quote and who said it, beside one result told as a number and two bars */
.quote { margin: 0; font-family: var(--font-display, var(--font-text)); font-size: clamp(22px, 1.1vw + 12px, 28px); line-height: 1.32; letter-spacing: -0.02em; font-weight: 450; color: var(--ink); text-wrap: pretty; }
.person { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.person__logo { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; color: var(--ink); background: color-mix(in oklab, var(--ink) 5%, var(--card)); box-shadow: inset 0 0 0 1px var(--c-border); }
.person__logo svg { width: 22px; height: 22px; }
.person__name { display: block; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink); }
.person__role { display: block; font-size: 16px; line-height: 24px; color: var(--c-text); }
.result { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding-left: 40px; border-left: 1px solid var(--c-border); }
.result__fig { font: 600 clamp(64px, 3.4vw + 24px, 88px)/0.95 var(--font-display, var(--font-text)); letter-spacing: -0.05em; color: var(--ink); }
.result__cap { margin: 12px 0 0; max-width: 28ch; font-size: 16px; line-height: 24px; color: var(--c-text); }
.result__bars { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.result__bars li { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 16px; line-height: 24px; color: var(--c-text); }
.result__bars i { display: block; height: 8px; width: var(--w); border-radius: 4px; background: color-mix(in oklab, var(--ink) 16%, var(--card)); }
.result__bars li:last-child i { background: var(--accent); }
.result__bars b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) { .result { padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--c-border); } }

/* pricing */
.plan { gap: 0; }
/* every plan's name row is the badge's height, so prices, buttons and lists sit level across the row */
.plan__name { height: 24px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.plan__price { display: flex; align-items: baseline; gap: 6px; margin-top: 20px; font: 600 44px/1 var(--font-display, var(--font-text)); letter-spacing: -0.04em; }
.plan__price small { font: 400 14px/20px var(--font-text); letter-spacing: 0; color: var(--muted); }
.plan__for { margin-top: 12px; font-size: 16px; line-height: 24px; color: var(--c-text); min-height: 2lh; }
.plan__btn {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; margin-top: 24px; border-radius: 10px;
  font: 500 14px/1 var(--font-text); text-decoration: none; color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 16%, transparent);
}
.plan__btn--primary { background: var(--ink); color: var(--card); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--card) 18%, transparent); }
.plan__list { display: grid; gap: 10px; margin: 24px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid var(--c-border); font-size: 16px; line-height: 24px; color: var(--c-text); }
.plan__list li { display: flex; gap: 10px; }
.plan__list li::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; background: var(--ink); opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.4 2.8 2.8 6.2-6.4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.4 2.8 2.8 6.2-6.4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
/* the featured plan: the same --card fill as its neighbours and a quiet accent hairline, its one accent
   touch (so the badge is quiet ink). On hover or focus a light runs once round the edge: an edge-glow
   canvas (fill 1, wash 0) mounted for that lap only, which paints the same fill under a lit border and
   then fades. Never a light that runs because the plan scrolled into view, never a comet left on one edge */
.plan.is-featured { border-color: color-mix(in oklab, var(--accent) 48%, transparent); background: var(--card); }
.plan.is-featured.is-fading > .fx-canvas { opacity: 0 !important; transition: opacity 600ms ease !important; }
.plan.is-featured .plan__badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font: 500 var(--t-label)/1 var(--font-text); color: var(--ink); background: color-mix(in oklab, var(--ink) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 10%, transparent); }

/* on a phone a fragment fits the panel's width (see the placements), so it is only cut at the bottom:
   the side fades go, the bottom fade stays */
/* a phone: the card's link and the plan's button are 44px targets (the link keeps its look, its box grows round it) */
@media (max-width: 639px) { .card__link { min-height: 44px; margin-top: 5px; } .plan__btn { height: 44px; } }
@media (max-width: 639px) {
  .stage--fade-r { -webkit-mask: none; mask: none; }
  .stage--fade-b, .stage--fade-br {
    -webkit-mask: linear-gradient(to bottom, #000 calc(100% - min(56px, var(--fade-h))), transparent calc(100% - 4px));
    mask: linear-gradient(to bottom, #000 calc(100% - min(56px, var(--fade-h))), transparent calc(100% - 4px));
  }
}

@keyframes ui-spin { to { transform: rotate(360deg); } }

/*
  taste-skill icons/icon.css - how a real icon sits on the page: bare, in a tile, in a list row, in a chip,
  in an avatar stack, in an integration grid, on a file card. Link it after system.css. It reads the
  ground tokens (--bg --surface --card --ink --muted --accent --line) and the radius set, so the same
  markup is right on a light page, on .ground-surface and on .ground-inverse. Nothing here animates.

  Markup comes from `node scripts/icons.mjs fetch ... --out assets/icons`: a colour icon is an
  <img class="ic ic-24">, a glyph (ui:) or any --mono icon is an inline <svg class="ic ic-svg ic-24"> that
  takes the text colour (works from file:// too; --mask prints a <span class="ic-mask"> instead, which needs
  http). Sizes: ic-16 ic-20 ic-24 ic-28 ic-32 ic-36 ic-40 ic-48 ic-56.
*/

/* the only colours outside the ground tokens: a white plate for logos, and the connected dot */
:root { --ic-white: #fff; --ic-ok: var(--ok, #2f9e5b); }

/* ------------------------------------------------------------ the icon itself */
.ic { --ic-s: 24px; display: inline-block; flex: none; height: var(--ic-s); width: auto; max-width: none; vertical-align: middle; object-fit: contain; }
.ic-16 { --ic-s: 16px; } .ic-20 { --ic-s: 20px; } .ic-24 { --ic-s: 24px; } .ic-28 { --ic-s: 28px; } .ic-32 { --ic-s: 32px; }
.ic-36 { --ic-s: 36px; } .ic-40 { --ic-s: 40px; } .ic-48 { --ic-s: 48px; } .ic-56 { --ic-s: 56px; }
.ic-svg { width: var(--ic-s); }
.ic-mask { width: var(--ic-s); background-color: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.ic-muted { color: var(--muted); }
.ic-accent { color: var(--accent); }

/* a wordmark (aspect over 1.8, flagged ic-wide by the tool) is drawn smaller than a square mark of the same
   size, so a row of both has an even weight; inside a tile it is fitted by the tile rule below */
.ic-wide { height: calc(var(--ic-s) * 0.7); max-width: min(100%, calc(var(--ic-s) * 4.5)); }
.ic-svg.ic-wide { width: auto; }

/* One-tone marks. ic-ink is a black mark (GitHub, Apple, X): white on a dark ground. ic-paper is a white mark
   (Notion): it would vanish on a light ground, so it is shown black there, bare or in a light tile. A tile with
   a dark or brand fill keeps a white mark as drawn and turns a black one white (.ic-tile--ink, --brand). */
.ic-paper { filter: invert(1); }
:is(.ground-inverse, .ic-dark) .ic-ink { filter: invert(1); }
:is(.ground-inverse, .ic-dark) .ic-paper { filter: none; }
.ic-keep { filter: none !important; }

/* ------------------------------------------------------------ the tile behind a logo */
.ic-tile {
  --tile: 40px;
  --tile-bg: color-mix(in oklab, var(--ic-white) 72%, var(--bg));
  --tile-line: var(--line);
  display: inline-grid; place-items: center; flex: none;
  width: var(--tile); height: var(--tile); border-radius: calc(var(--tile) * 0.28);
  background: var(--tile-bg); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--tile-line), 0 1px 2px color-mix(in oklab, var(--ink) 7%, transparent);
}
.ic-tile > .ic { --ic-s: calc(var(--tile) * 0.6); }
/* a wordmark or an odd-shaped logo is fitted into the square box, never allowed to spill out of its tile */
.ic-tile > img.ic, .ic-file > img.ic, .ic-point > img.ic { width: var(--ic-s); object-fit: contain; }
/* a landscape mark (Salesforce, AWS, YouTube: ic-land) and a portrait one (Google Docs, Figma: ic-tall) are drawn on their long
   side a little larger than a square mark, so a row of marks has an even weight and none reads small in its tile */
.ic-tile > img.ic.ic-land, .ic-tile > .ic-svg.ic-land { width: calc(var(--tile) * 0.7); height: auto; max-height: 80%; }
.ic-tile > img.ic.ic-tall, .ic-tile > .ic-svg.ic-tall { height: calc(var(--tile) * 0.68); width: auto; max-width: 80%; }
.ic-tile--24 { --tile: 24px; } .ic-tile--32 { --tile: 32px; } .ic-tile--40 { --tile: 40px; }
.ic-tile--48 { --tile: 48px; } .ic-tile--56 { --tile: 56px; } .ic-tile--72 { --tile: 72px; }
.ic-tile--round { border-radius: 50%; }
/* a wordmark-only logo (Stripe, Visa): a wide tile, the mark enlarged to fill it (about 1.7 tiles wide, never
   taller than 58% of the tile), at its own proportions */
.ic-tile--wide { width: calc(var(--tile) * 2.4); }
.ic-tile.ic-tile--wide > .ic { width: calc(var(--tile) * 1.7); height: auto; max-width: 80%; max-height: 58%; object-fit: contain; }
.ic-tile--flat { box-shadow: inset 0 0 0 1px var(--tile-line); }
/* a glyph in a tile: the surface colour, ink strokes, or the accent */
.ic-tile--glyph { --tile-bg: color-mix(in oklab, var(--ink) 5%, var(--bg)); box-shadow: none; }
.ic-tile--accent { --tile-bg: color-mix(in oklab, var(--accent) 12%, var(--bg)); color: var(--accent); box-shadow: none; }
.ic-tile--ink { --tile-bg: var(--ink); color: var(--bg); box-shadow: none; }
/* on a dark ground --ink is light, so an ink tile is a dark plate (the ground lifted a little) instead (its black marks are
   inverted to white either way) */
:is(.ground-inverse, .ic-dark) .ic-tile--ink { --tile-bg: color-mix(in oklab, var(--ink) 10%, var(--bg)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
/* a tile in a brand colour (set --tile-bg inline): white marks stay white, black marks turn white */
.ic-tile--brand { --tile-bg: var(--accent); color: var(--ic-white); box-shadow: none; }
:is(.ic-tile--ink, .ic-tile--brand) .ic-paper { filter: none; }
:is(.ic-tile--ink, .ic-tile--brand) .ic-ink { filter: invert(1); }
/* dark grounds: a light tile, so every brand colour reads and black marks need no inversion */
:is(.ground-inverse, .ic-dark) .ic-tile:not(.ic-tile--glyph, .ic-tile--accent, .ic-tile--ink) {
  --tile-bg: color-mix(in oklab, var(--ink) 94%, var(--bg)); --tile-line: transparent; color: var(--bg);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--bg) 70%, transparent);
}
:is(.ground-inverse, .ic-dark) .ic-tile:not(.ic-tile--ink, .ic-tile--brand) .ic-ink { filter: none; }
:is(.ground-inverse, .ic-dark) .ic-tile:not(.ic-tile--ink, .ic-tile--brand) .ic-paper { filter: invert(1); }
:is(.ground-inverse, .ic-dark) .ic-tile--glyph { --tile-bg: color-mix(in oklab, var(--ink) 9%, var(--bg)); }
:is(.ground-inverse, .ic-dark) .ic-tile--accent { --tile-bg: color-mix(in oklab, var(--accent) 22%, var(--bg)); }
/* a tile of a dark-ground brand, glass: for one-colour marks only */
.ic-tile--ghost { --tile-bg: color-mix(in oklab, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------ chip: icon and a name */
.ic-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px;
  border-radius: 999px; background: var(--card, var(--surface)); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t-small, 14px); line-height: 1; white-space: nowrap;
}
.ic-chip > .ic { --ic-s: 18px; }
.ic-chip--lg { height: 40px; padding: 0 16px 0 10px; gap: 10px; font-size: var(--t-body, 16px); }
.ic-chip--lg > .ic { --ic-s: 22px; }
.ic-chip > .ic-wide { height: auto; width: calc(var(--ic-s) * 2.2); max-height: calc(var(--ic-s) * 0.9); }
/* on a dark ground a brand colour (Salesforce blue, Dropbox, Jira) or a dark file icon (InDesign) sits close to the
   ground: a bare mark in a chip or on a file card gets a small light plate, as a tile does */
:is(.ground-inverse, .ic-dark) :is(.ic-chip, .ic-file) > img.ic { box-sizing: content-box; padding: 3px; border-radius: 7px; background: color-mix(in oklab, var(--ink) 94%, var(--bg)); }
:is(.ground-inverse, .ic-dark) .ic-file > img.ic { padding: 4px; border-radius: 10px; }
:is(.ground-inverse, .ic-dark) :is(.ic-chip, .ic-file) > img.ic-ink { filter: none; }
:is(.ground-inverse, .ic-dark) :is(.ic-chip, .ic-file) > img.ic-paper { filter: invert(1); }
.ic-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
a.ic-chip:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ------------------------------------------------------------ list row: tile, text, a value at the end */
.ic-list { display: grid; }
.ic-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.ic-row:first-child { border-top: 0; }
.ic-row__main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ic-row__title { font-size: var(--t-body, 16px); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-row__meta { font-size: var(--t-small, 14px); color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-row__end { flex: none; font-size: var(--t-small, 14px); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.ic-row__end .ic { --ic-s: 16px; }
/* a connected / off state as a dot with its word */
.ic-state { display: inline-flex; align-items: center; gap: 6px; }
.ic-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.ic-state--on { color: var(--ink); }
.ic-state--on::before { background: var(--ic-ok); }

/* ------------------------------------------------------------ avatar stack: overlapping tiles */
.ic-stack { display: inline-flex; align-items: center; }
.ic-stack > * { margin-left: -10px; box-shadow: 0 0 0 2px var(--bg); }
.ic-stack > :first-child { margin-left: 0; }
.ic-stack > .ic-tile { box-shadow: inset 0 0 0 1px var(--tile-line), 0 0 0 2px var(--bg); }
.ic-stack__more {
  display: inline-grid; place-items: center; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 8%, var(--bg)); color: var(--muted); font-size: var(--t-label, 13px); font-weight: 500;
}
.ic-stack--sm > .ic-tile { --tile: 32px; } .ic-stack--sm .ic-stack__more { height: 32px; min-width: 32px; }

/* ------------------------------------------------------------ integration grid */
.ic-grid { display: grid; gap: var(--card-gap, 16px); grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.ic-cell {
  display: grid; align-content: start; gap: 14px; padding: 20px; border-radius: var(--r-md, 12px);
  background: var(--card, var(--surface)); box-shadow: inset 0 0 0 1px var(--line); min-width: 0;
}
.ic-cell__name { font-size: var(--t-body, 16px); font-weight: 500; line-height: 1.25; }
.ic-cell__meta { font-size: var(--t-small, 14px); color: var(--muted); line-height: 1.4; margin-top: 2px; }
a.ic-cell:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
/* the mosaic: one outline, cells divided by hairlines */
.ic-grid--mosaic { gap: 1px; background: var(--line); border-radius: var(--r-lg, 20px); overflow: hidden; border: 1px solid var(--line); }
.ic-grid--mosaic > .ic-cell { border-radius: 0; box-shadow: none; background: var(--bg); }
.ic-grid--mosaic > .ic-cell:hover { background: color-mix(in oklab, var(--ink) 3%, var(--bg)); }
/* a logo wall: tiles only, no names */
.ic-wall { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.ic-wall > .ic-tile { --tile: 64px; justify-self: start; }
.ic-wall > .ic-tile--wide { grid-column: span 2; }
.ic-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .ic-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ic-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .ic-grid--cols-3, .ic-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------ file card */
.ic-file {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-width: 0;
  border-radius: var(--r-md, 12px); background: var(--card, var(--surface)); box-shadow: inset 0 0 0 1px var(--line);
}
.ic-file > .ic { --ic-s: 36px; }
/* a wordmark on a file card (a YAML, a Visa) keeps its own proportions at a readable width, never a strip in a 36px square */
.ic-file > img.ic.ic-wide, .ic-file > .ic-svg.ic-wide { width: calc(var(--ic-s) * 1.9); height: auto; max-height: var(--ic-s); }
.ic-file > img.ic.ic-land, .ic-file > .ic-svg.ic-land { width: calc(var(--ic-s) * 1.15); height: auto; }
.ic-file > img.ic.ic-tall, .ic-file > .ic-svg.ic-tall { width: auto; height: var(--ic-s); }
.ic-file__main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ic-file__name { font-size: var(--t-body, 16px); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.ic-file__meta { font-size: var(--t-small, 14px); color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.ic-file__end { flex: none; color: var(--muted); font-size: var(--t-small, 14px); }
.ic-file-list { display: grid; gap: 10px; }
/* a file as a compact tile: icon on top, name under it */
.ic-file--tile { display: grid; justify-items: start; gap: 12px; padding: 18px; }
.ic-file--tile > .ic { --ic-s: 40px; }
.ic-file--tile > img.ic.ic-wide, .ic-file--tile > .ic-svg.ic-wide { width: calc(var(--ic-s) * 2.1); }
.ic-file--tile .ic-file__main { width: 100%; }

/* ------------------------------------------------------------ feature list with glyphs */
.ic-points { display: grid; gap: 16px; }
.ic-point { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.ic-point > .ic-tile { --tile: 36px; }
.ic-point > .ic-tile > .ic { --ic-s: 18px; }
.ic-point__title { font-weight: 500; line-height: 1.3; }
.ic-point__text { color: var(--muted); font-size: var(--t-small, 14px); line-height: 1.5; margin-top: 2px; }

/* ------------------------------------------------------------ a phone: names wrap, file tiles stack */
@media (max-width: 479px) {
  .ic-row__title, .ic-row__meta { white-space: normal; overflow: visible; text-overflow: clip; }
  .ic-grid--cols-2:has(> .ic-file--tile) { grid-template-columns: 1fr; }
  .ic-file--tile { grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
}

/*
  taste-skill UI fragment kit - shared base.
  Small pieces of real product UI, set on an effect ground inside a card's inset panel.
  The standard (references/cards.md): true product scale (13px text, 12px meta, never under 11px).
  A fragment is a picture of a product's screen, so the page's 13px floor (VI-05) does not apply
  inside .ui; every word the page itself says (titles, lines, labels, captions) keeps 13px or more.
  The rest:
  real-looking data, crisp 1px borders, radius 10-12, a soft layered shadow, one accent touch
  (the agent's mark is the ink, so the accent stays free for that one touch).

  Styled only by custom properties set by the page:
    --ui-font, --ui-mono, --ui-radius
    --fx-bg (the fragment's own surface), --fx-surface, --fx-ink, --fx-muted, --fx-accent, --fx-accent-ink
  Light or dark is read from --fx-bg itself (relative colour), so a fragment needs no theme class.
  Every size sits on a 4px grid. Loops stop under prefers-reduced-motion (the JS shows a still state).
*/
:where(.ui) {
  --u-bg: var(--fx-bg, #ffffff);
  --u-surface: var(--fx-surface, #f4f4f3);
  --u-ink: var(--fx-ink, #111111);
  --u-muted: var(--fx-muted, #6b6b6b);
  --u-accent: var(--fx-accent, #e8571f);
  --u-accent-ink: var(--fx-accent-ink, #ffffff);
  --u-r: var(--ui-radius, 12px);
  --u-r2: max(4px, calc(var(--u-r) - 4px));
  --u-r3: max(4px, calc(var(--u-r) - 6px));

  /* lines and fills, all mixed from the palette */
  --u-line: color-mix(in oklab, var(--u-ink) 9%, transparent);
  --u-line-2: color-mix(in oklab, var(--u-ink) 15%, transparent);
  --u-border: color-mix(in oklab, var(--u-ink) 12%, transparent);
  --u-fill: color-mix(in oklab, var(--u-ink) 3.5%, var(--u-bg));
  --u-fill-2: color-mix(in oklab, var(--u-ink) 7%, var(--u-bg));
  --u-fill-3: color-mix(in oklab, var(--u-ink) 11%, var(--u-bg));
  --u-text-2: color-mix(in oklab, var(--u-ink) 80%, var(--u-bg));
  --u-soft: color-mix(in oklab, var(--u-muted) 80%, var(--u-bg));
  --u-tint: color-mix(in oklab, var(--u-accent) 13%, var(--u-bg));
  --u-tint-2: color-mix(in oklab, var(--u-accent) 24%, var(--u-bg));
  --u-accent-text: color-mix(in oklab, var(--u-accent) 74%, var(--u-ink));
  --u-skel: color-mix(in oklab, var(--u-ink) 10%, var(--u-bg));
  /* a brand tile is light on every surface, so a logo keeps its own colours (references/icons.md) */
  --u-tile: #ffffff;
  --u-tile-edge: inset 0 0 0 1px rgb(0 0 0 / 0.09), 0 1px 2px rgb(0 0 0 / 0.12);

  /* depth: shadows grow and a top highlight appears as the fragment surface gets darker */
  --u-sh: rgb(0 0 0 / 0.14);
  --u-sh: oklch(from var(--u-bg) 0 0 0 / calc(0.5 - l * 0.38));
  --u-hi: transparent;
  --u-hi: oklch(from var(--u-bg) 1 0 0 / clamp(0, calc(0.11 - l * 0.11), 0.09));
  --u-shadow:
    inset 0 1px 0 var(--u-hi),
    0 1px 1px color-mix(in oklab, var(--u-sh) 40%, transparent),
    0 2px 4px -1px color-mix(in oklab, var(--u-sh) 45%, transparent),
    0 12px 24px -8px color-mix(in oklab, var(--u-sh) 80%, transparent),
    0 32px 64px -24px var(--u-sh);
  --u-shadow-sm:
    inset 0 1px 0 var(--u-hi),
    0 1px 2px color-mix(in oklab, var(--u-sh) 55%, transparent),
    0 6px 16px -6px color-mix(in oklab, var(--u-sh) 80%, transparent);
  --u-ease: var(--ease, cubic-bezier(.2, .8, .2, 1));   /* the page's one UI ease-out (system.css --ease) */
  /* the name is older than the rule: a strong ease-out that lands softly and never passes its mark (no overshoot, motion.md) */
  --u-spring: cubic-bezier(.22, 1, .36, 1);

  font-family: var(--ui-font, system-ui, -apple-system, "Segoe UI", sans-serif);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
  color: var(--u-ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
  text-align: left;
  letter-spacing: -0.003em;
  box-sizing: border-box;
}
:where(.ui) *, :where(.ui) *::before, :where(.ui) *::after { box-sizing: border-box; }
/* a fragment never runs out of its panel on its own: on a narrow panel it narrows; a placement that
   crops it on purpose (cards.css, from 640px: every placement but .at-center) lifts this */
[data-ui] { max-width: 100%; }
/* fragments use div and span for text so page rules like `.card p` cannot reach them */
.ui :where(ul, ol, li, figure, blockquote, article, aside, nav) { margin: 0; padding: 0; list-style: none; }
.ui :where(mark) { background: none; color: inherit; }
:where(.ui) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: default; }
:where(.ui) svg { display: block; flex: none; }

/* ---------------------------------------------------------------- the window every fragment sits in */
.ui-panel {
  position: relative;
  background: var(--u-bg);
  border: 1px solid var(--u-border);
  border-radius: var(--u-r);
  box-shadow: var(--u-shadow);
  max-width: 100%;
}
.ui-head {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--u-line);
}
.ui-title { font-size: 13px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.ui-meta { font-size: 13px; line-height: 16px; color: var(--u-muted); white-space: nowrap; }
.ui-spacer { flex: 1; }
.ui-sep { width: 1px; height: 16px; background: var(--u-line-2); flex: none; }

/* window chrome: three quiet dots and a centred title */
.ui-dots { display: flex; gap: 6px; flex: none; }
.ui-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--u-fill-3); box-shadow: inset 0 0 0 0.5px var(--u-line); }

/* ---------------------------------------------------------------- controls */
/* the primary button is the ink (as on figma.com and x.ai); the accent is kept for one touch */
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  height: 28px; padding: 0 10px; border-radius: max(6px, var(--u-r3));
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--u-ink); color: var(--u-bg);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--u-bg) 14%, transparent), 0 1px 2px color-mix(in oklab, var(--u-sh) 60%, transparent);
  transition: transform 160ms var(--u-ease), background-color 200ms var(--u-ease), color 200ms var(--u-ease);
}
.ui-btn--accent { background: var(--u-accent); color: var(--u-accent-ink); }
.ui-btn--ghost { background: var(--u-bg); color: var(--u-ink); box-shadow: inset 0 0 0 1px var(--u-line-2), 0 1px 2px color-mix(in oklab, var(--u-sh) 30%, transparent); }
.ui-btn--quiet { background: transparent; color: var(--u-muted); box-shadow: none; }
.ui-btn--sm { height: 24px; padding: 0 8px; font-size: 13px; }
.ui-btn .ui-icon { width: 14px; height: 14px; }
.ui-btn.is-pressed { transform: scale(0.96); }

/* status: a dot and a word; quiet by default, the accent only where something is happening */
.ui-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--u-fill); color: var(--u-muted); box-shadow: inset 0 0 0 1px var(--u-line);
}
.ui-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.55; flex: none; }
.ui-chip--plain::before { display: none; }
.ui-chip--accent { background: var(--u-tint); color: var(--u-accent-text); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--u-accent) 22%, transparent); }
.ui-chip--accent::before { background: var(--u-accent); opacity: 1; }
.ui-chip--ink { color: var(--u-ink); }
.ui-chip--ink::before { opacity: 1; }
.ui-chip--live::before { animation: ui-live 1.6s var(--u-ease) infinite; }
.ui-chip svg { width: 12px; height: 12px; margin: 0 -1px 0 -2px; }
.ui-chip:has(svg)::before { display: none; }
@keyframes ui-live { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ui-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--u-accent); flex: none; }
.ui-kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  font: 500 13px/1 var(--ui-font, inherit); color: var(--u-muted);
  background: var(--u-bg); box-shadow: inset 0 0 0 1px var(--u-line-2), inset 0 -1px 0 var(--u-line);
}
.ui-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* people: initials on a quiet tone, five tones that never reach violet */
.ui-avatar {
  --h: 60;
  display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: -0.02em;
  background: color-mix(in oklab, oklch(0.74 0.08 var(--h)) 34%, var(--u-bg));
  color: color-mix(in oklab, oklch(0.5 0.09 var(--h)) 70%, var(--u-ink));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, oklch(0.6 0.08 var(--h)) 22%, transparent);
}
.ui-avatar[data-tone="1"] { --h: 40; }
.ui-avatar[data-tone="2"] { --h: 85; }
.ui-avatar[data-tone="3"] { --h: 150; }
.ui-avatar[data-tone="4"] { --h: 220; }
.ui-avatar[data-tone="5"] { --h: 20; }
.ui-avatar--md { width: 32px; height: 32px; font-size: 13px; }
.ui-avatar--accent { background: var(--u-accent); color: var(--u-accent-ink); box-shadow: none; }

/* the product's own mark (an assistant, a bot): an ink disc with a four-point spark. It is the ink,
   not the accent, so a fragment's one accent touch stays free for its status */
.ui-agent {
  position: relative; display: block; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--u-ink);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--u-bg) 12%, transparent), inset 0 1px 0 color-mix(in oklab, #fff 16%, transparent);
}
.ui-agent::after {
  content: ""; position: absolute; inset: 26%; background: var(--u-bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 .8c.5 4.3 2.9 6.7 7.2 7.2-4.3.5-6.7 2.9-7.2 7.2C7.5 10.9 5.1 8.5.8 8 5.1 7.5 7.5 5.1 8 .8z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 .8c.5 4.3 2.9 6.7 7.2 7.2-4.3.5-6.7 2.9-7.2 7.2C7.5 10.9 5.1 8.5.8 8 5.1 7.5 7.5 5.1 8 .8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* skeleton lines for the parts of a window that are only context */
.ui-skel { display: block; height: 6px; border-radius: 3px; background: var(--u-skel); }

/* ---------------------------------------------------------------- brand marks */
/* Real brand icons are local files (icons/, written by scripts/icons.mjs fetch; icons-credits.json lists them): no page calls
   a CDN for an icon. A mark on a tile (.ui-logo, .ui-file__icon, .ui-field__tile, .ui-diff__tool, .ui-pipe__tool) is a colour
   file as <img src="icons/notion.svg" alt="">, the path as printed by fetch for the page that holds it. A small mark inline beside
   text stays in the ink: the one-colour inline <svg class="ui-brand" aria-hidden="true"> that fetch --mono prints. */
.ui-brand { display: block; flex: none; width: 18px; height: 18px; }
svg.ui-brand { fill: currentColor; color: var(--u-ink); }
.ui-brand--ink { color: var(--u-ink); }
/* a brand logo on a small tile: the tile is light on every surface and the logo in its own colours */
.ui-logo {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--u-r2);
  background: var(--u-tile); box-shadow: var(--u-tile-edge);
}
.ui-logo img, .ui-file__icon img, .ui-field__tile img, .ui-diff__tool img, .ui-pipe__tool img { display: block; flex: none; object-fit: contain; }
.ui-logo :is(svg, img, .ui-brand) { width: 20px; height: 20px; }
.ui-logo--sm { width: 32px; height: 32px; border-radius: max(6px, var(--u-r3)); }
.ui-logo--sm :is(svg, img, .ui-brand) { width: 16px; height: 16px; }
.ui-logo--lg { width: 56px; height: 56px; border-radius: var(--u-r); }
.ui-logo--lg :is(svg, img, .ui-brand) { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- the pointer */
.ui-pointer {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 20px; height: 20px; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.25)) drop-shadow(0 3px 6px rgb(0 0 0 / 0.2));
  will-change: transform;
}
.ui-pointer svg { width: 20px; height: 20px; }
/* a named pointer (a person or the agent working in the product) */
.ui-pointer__name {
  position: absolute; left: 14px; top: 18px; height: 20px; padding: 0 7px; border-radius: 6px 10px 10px 10px;
  font: 500 13px/20px var(--ui-font, inherit); white-space: nowrap;
  background: var(--u-accent); color: var(--u-accent-ink);
}
.ui-ring {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  border: 1.5px solid var(--u-accent); opacity: 0; pointer-events: none; z-index: 4;
}
.ui-ring.is-on { animation: ui-ring 520ms var(--u-ease) forwards; }
@keyframes ui-ring { from { opacity: 0.8; transform: var(--at) scale(0.4); } to { opacity: 0; transform: var(--at) scale(1.5); } }

@keyframes ui-spin { to { transform: rotate(360deg); } }
.ui-spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 1.5px solid color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor;
  animation: ui-spin 700ms linear infinite;
}

/* ---------------------------------------------------------------- held, paused */
/* a fragment held on its finished picture (data-ui-still, its cycles done) shows nothing that moves:
   no caret, spinner or pulse runs on in a still picture */
.is-ui-held, .is-ui-held *, .is-ui-held *::before, .is-ui-held *::after { animation: none !important; }
.is-ui-paused, .is-ui-paused *, .is-ui-paused *::before, .is-ui-paused *::after { animation-play-state: paused !important; }

/* the pause button ui.loop puts by a looping fragment (and an object from assets/objects, as
   .loop-pause): a solid disc in the page colours (never a see-through blur), 32px in a 44px hit area,
   the same as components' .cx-pause and system.css. In a card it sits beside the title (ui.js sets its
   top and right; the title keeps 44px clear), in a panel outside a card 12px in from the bottom-right
   corner, and with no panel under the fragment, in 44px kept free below it. */
button.ui-pause.ui-pause, button.loop-pause {
  position: absolute; right: 12px; bottom: 12px; z-index: 6; display: grid; place-items: center;
  width: 32px; height: 32px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--ink, #111) 16%, transparent);
  background: var(--bg, #fff); color: var(--ink, #111);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 4px 12px -4px rgb(0 0 0 / 0.28);
  opacity: 0.88; transition: opacity 200ms ease, border-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
button.ui-pause.ui-pause--title { bottom: auto; box-shadow: none; opacity: 1; }
button.ui-pause.ui-pause--below { right: 0; bottom: 6px; box-shadow: none; }
.ui-pause-beside { padding-right: 44px; }
button:is(.ui-pause, .loop-pause)::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
button:is(.ui-pause, .loop-pause):is(:hover, :focus-visible) { opacity: 1; border-color: color-mix(in oklab, var(--ink, #111) 32%, transparent); }
button:is(.ui-pause, .loop-pause):focus-visible { outline: 2px solid var(--ink, #111); outline-offset: 2px; }
button:is(.ui-pause, .loop-pause) svg { display: block; width: 14px; height: 14px; fill: currentColor; }
button:is(.ui-pause, .loop-pause).is-paused svg, button.loop-pause[aria-pressed="true"] svg { margin-left: 1px; }
@media (forced-colors: active) { button.ui-pause.ui-pause, button.loop-pause { border-color: ButtonText; } }

@media (prefers-reduced-motion: reduce) {
  :where(.ui) *, :where(.ui) *::before, :where(.ui) *::after { transition-duration: 0ms !important; animation: none !important; }
  button.ui-pause.ui-pause, button.loop-pause { display: none; }
}

/* window: a helpdesk queue (sidebar, list); the assistant works down the open rows */
.ui-win { width: 600px; overflow: hidden; }
.ui-win__bar { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--u-line); background: var(--u-fill); min-width: 0; }
/* the breadcrumb gives way first (an ellipsis), so the search box at the right is never pushed out or cut */
.ui-win__crumb { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; font-size: 13px; line-height: 16px; color: var(--u-muted); white-space: nowrap; }
.ui-win__crumb b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ui-win__crumb .ui-brand, .ui-win__crumb i { flex: none; }
.ui-win__crumb .ui-brand { width: 14px; height: 14px; }
.ui-win__crumb i { font-style: normal; color: var(--u-muted); }
.ui-win__crumb b { font-weight: 500; color: var(--u-ink); }
.ui-win__search { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 28px; width: 168px; padding: 0 4px 0 8px; border-radius: 7px; background: var(--u-bg); box-shadow: inset 0 0 0 1px var(--u-line-2); font-size: 13px; color: var(--u-soft); }
.ui-win__search .ui-icon { width: 14px; height: 14px; color: var(--u-muted); }
.ui-win__search .ui-kbd { margin-left: auto; min-width: 20px; height: 20px; font-size: 13px; }
.ui-win__body { display: grid; grid-template-columns: 152px 1fr; min-height: 312px; }
.ui-win__side { display: grid; align-content: start; gap: 1px; padding: 8px; border-right: 1px solid var(--u-line); }
.ui-win__nav {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px;
  font-size: 13px; line-height: 16px; color: var(--u-muted);
}
.ui-win__nav .ui-icon { width: 14px; height: 14px; }
.ui-win__nav em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--u-soft); }
.ui-win__nav.is-on { background: var(--u-fill-2); color: var(--u-ink); font-weight: 500; }
.ui-win__nav.is-on em { color: var(--u-muted); }
.ui-win__label { margin: 12px 8px 4px; font-size: 13px; line-height: 16px; color: var(--u-soft); }
.ui-win__hash { width: 14px; text-align: center; color: var(--u-soft); }
.ui-win__main { min-width: 0; }
.ui-win__cols, .ui-win__row { display: grid; grid-template-columns: 24px 92px minmax(0, 1fr) 96px 28px; align-items: center; gap: 0 12px; padding: 0 16px; }
.ui-win__cols { height: 32px; border-bottom: 1px solid var(--u-line); font-size: 13px; line-height: 16px; color: var(--u-soft); }
.ui-win__cols span:first-child { grid-column: 1 / 3; }
.ui-win__row { height: 44px; font-size: 13px; line-height: 16px; transition: background-color 260ms var(--u-ease); }
.ui-win__row + .ui-win__row { box-shadow: inset 0 1px 0 var(--u-line); }
.ui-win__row.is-sel { background: color-mix(in oklab, var(--u-ink) 4%, var(--u-bg)); }
.ui-win__row .ui-avatar { width: 24px; height: 24px; }
.ui-win__who { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-win__sub { color: var(--u-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-win__age { color: var(--u-soft); text-align: right; font-size: 13px; }
.ui-win__st {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--u-muted); box-shadow: inset 0 0 0 1px var(--u-line-2);
  transition: color 240ms var(--u-ease), background-color 240ms var(--u-ease), box-shadow 240ms var(--u-ease);
}
.ui-win__st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; flex: none; }
/* the row being worked on is the window's one accent touch */
.ui-win__st.is-work { color: var(--u-accent-text); background: var(--u-tint); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--u-accent) 22%, transparent); }
.ui-win__st.is-work::before { width: 8px; height: 8px; background: none; border: 1.5px solid color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor; opacity: 1; animation: ui-spin 800ms linear infinite; }
.ui-win__st.is-done { color: var(--u-soft); box-shadow: inset 0 0 0 1px var(--u-line); }
.ui-win__st.is-you { color: var(--u-ink); box-shadow: inset 0 0 0 1px var(--u-line-2); background: var(--u-fill-2); }
.ui-win__st.is-you::before { background: var(--u-ink); opacity: 1; }
/* compact (opts.compact): a narrower window whose rows stack name over subject, for a card panel
   where the whole width must show; the status stays in view */
.ui-win--compact { width: 456px; }
.ui-win--compact .ui-win__body { grid-template-columns: 128px 1fr; }
.ui-win--compact .ui-win__search { width: 112px; }
.ui-win--compact .ui-win__cols { display: none; }
.ui-win--compact .ui-win__row { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-rows: 18px 16px; align-content: center; height: 56px; row-gap: 1px; padding: 0 14px; }
.ui-win--compact .ui-win__row .ui-avatar { grid-row: 1 / 3; }
.ui-win--compact .ui-win__who { grid-column: 2; grid-row: 1; line-height: 18px; }
.ui-win--compact .ui-win__sub { grid-column: 2; grid-row: 2; font-size: 13px; }
.ui-win--compact .ui-win__st { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.ui-win--compact .ui-win__age { display: none; }
/* narrow: the window's own width decides its layout (a container query), so a .fit wrapper, a small
   card at 1024 or a phone panel never slices its columns:
   - under 540px the rows stack name over subject, the column heads and the age go (the compact rows);
   - under 420px the sidebar goes too and the search shrinks to its icon. */
.ui-win { container: ui-win / inline-size; }
@container ui-win (max-width: 539px) {
  .ui-win .ui-win__cols { display: none; }
  .ui-win .ui-win__row { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-rows: 18px 16px; align-content: center; height: 56px; row-gap: 1px; padding: 0 14px; }
  .ui-win .ui-win__row .ui-avatar { grid-row: 1 / 3; }
  .ui-win .ui-win__who { grid-column: 2; grid-row: 1; line-height: 18px; }
  .ui-win .ui-win__sub { grid-column: 2; grid-row: 2; font-size: 13px; }
  .ui-win .ui-win__st { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .ui-win .ui-win__age { display: none; }
  .ui-win .ui-win__body { grid-template-columns: 128px minmax(0, 1fr); }
  .ui-win .ui-win__search { width: 112px; }
}
@container ui-win (max-width: 419px) {
  .ui-win .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .ui-win .ui-win__side { display: none; }
  .ui-win .ui-win__search { width: 28px; padding: 0; justify-content: center; gap: 0; }
  .ui-win .ui-win__search :is(.ui-kbd, .ui-win__ph) { display: none; }
  .ui-win .ui-win__row { gap: 0 10px; padding: 0 12px; }
  .ui-win .ui-win__bar { gap: 10px; padding: 0 8px 0 12px; }
}
/* very narrow: the window dots go too, the crumb keeps its last word */
@container ui-win (max-width: 299px) {
  .ui-win .ui-dots { display: none; }
}
/* phone: the window takes the panel's width (cards.css); the queries above lay it out */
@media (max-width: 639px) {
  .ui-win, .ui-win--compact { width: 100%; }
}

/* files: file tiles with real app icons; each one is read in turn and gets a check.
   Every mark is one treatment: the app's colour icon (a local file in icons/) on a light tile, or a plain ink
   file glyph for a bare file type such as PDF. */
/* fluid: two columns at 300px, three from about 430px, four from about 590px (cards.css .wide sets it
   wider than its panel so the grid is cut by the right edge) */
.ui-files { width: 100%; min-width: 300px; max-width: 760px; display: grid; gap: 14px; justify-items: start; align-content: start; }
.ui-files__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; width: 100%; }
.ui-file {
  position: relative; display: grid; justify-items: center; align-content: start;
  height: 132px; padding: 26px 10px 0; border-radius: var(--u-r);
  background: var(--u-bg); border: 1px solid var(--u-border); box-shadow: var(--u-shadow-sm);
  transition: box-shadow 320ms var(--u-ease), border-color 320ms var(--u-ease);
}
/* the app's own mark in its colours on a light tile (the same on light and dark) */
.ui-file__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 11px; background: var(--u-tile); box-shadow: var(--u-tile-edge); }
.ui-file__icon :is(.ui-brand, img) { width: 24px; height: 24px; }
.ui-file__icon .ui-file__glyph { width: 26px; height: 26px; stroke: #d93025; }   /* a PDF, in the red of PDF icons */
.ui-file__glyph { width: 32px; height: 32px; fill: none; stroke: var(--u-ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.ui-file__name { max-width: 100%; font-size: 13px; font-weight: 500; line-height: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-file__kind { font-size: 13px; line-height: 16px; color: var(--u-muted); }
.ui-file__bar {
  position: absolute; left: 16px; right: 16px; bottom: 10px; height: 2px; border-radius: 2px;
  background: var(--u-line); overflow: hidden; opacity: 0; transition: opacity 200ms var(--u-ease);
}
.ui-file__bar i { position: absolute; inset: 0; background: var(--u-accent); transform: scaleX(0); transform-origin: left; }
.ui-file__check {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--u-ink); color: var(--u-bg);
  transform: scale(0.4); opacity: 0;
  transition: transform 360ms var(--u-spring), opacity 200ms var(--u-ease);
}
.ui-file__check svg { width: 12px; height: 12px; }
/* the tile being read is the fragment's one accent touch */
.ui-file.is-reading { border-color: color-mix(in oklab, var(--u-accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--u-accent) 14%, transparent), var(--u-shadow-sm); }
.ui-file.is-reading .ui-file__bar { opacity: 1; }
.ui-file.is-reading .ui-file__bar i { transform: scaleX(1); transition: transform 440ms cubic-bezier(0.4, 0, 0.2, 1); }
.ui-file.is-done .ui-file__check { transform: scale(1); opacity: 1; }
.ui-files.is-reset .ui-file__check { transition-duration: 240ms; }

.ui-files__status {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--u-bg); border: 1px solid var(--u-border); box-shadow: var(--u-shadow-sm); font-size: 13px; font-weight: 500; line-height: 16px;
}
.ui-files__status .ui-dot { width: 6px; height: 6px; background: var(--u-ink); }
/* narrow (a phone panel): two columns, and a long name wraps onto a second line instead of being cut */
@media (max-width: 639px) {
  .ui-files { min-width: 0; }
  .ui-files__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ui-file { height: 124px; padding: 18px 8px 0; }
  .ui-file__icon { margin-bottom: 10px; }
  .ui-file__name { white-space: normal; overflow: visible; text-wrap: balance; }
}
.ui-file :is(.ui-file__name, .ui-file__kind).is-cut { visibility: hidden; }
