/* ==========================================================================
   UXAG Icons — playbook & download platform
   Colour comes from tokens/palette.css, generated from src/tokens/palette.json.
   ========================================================================== */

@import url('./tokens/palette.css');

:root {
  --page: #ffffff;
  --rail: var(--uxag-neutral-50);
  --surface: #ffffff;
  --sunken: var(--uxag-neutral-50);
  --line: var(--uxag-neutral-100);
  --line-strong: var(--uxag-neutral-200);
  --text: var(--uxag-neutral-900);
  --text-soft: var(--uxag-neutral-500);
  --text-mute: var(--uxag-neutral-400);
  --accent: var(--uxag-cyan-500);
  --accent-ink: var(--uxag-cyan-700);
  --accent-wash: var(--uxag-cyan-50);
  --radius: 14px;
  --radius-sm: 10px;
  --rail-w: 258px;
  --bar-h: 66px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme='dark'] {
  --page: #0a0b0d;
  --rail: #0f1114;
  --surface: #14161a;
  --sunken: #101216;
  --line: #23262b;
  --line-strong: #32363d;
  --text: var(--uxag-neutral-50);
  --text-soft: var(--uxag-neutral-400);
  --text-mute: var(--uxag-neutral-500);
  --accent-ink: var(--uxag-cyan-300);
  --accent-wash: #06272f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* An explicit `display` in author CSS beats the UA rule for [hidden], and the
   panel and canvases are laid out with grid — so make `hidden` authoritative. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* One language is revealed, the other stays in the markup. */
html[data-lang='pt'] [data-lang='en'],
html[data-lang='en'] [data-lang='pt'] {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 640;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.87em;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 5px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/*
 * Artwork on display: the studio can force an ink colour here. Stroke weight is
 * fixed at 1.5 in the files themselves and deliberately not adjustable — a
 * consistent weight is what makes the set read as one family.
 *
 * Icons used as UI chrome are excluded: they inherit `color` from the button or
 * nav item they sit in, which is the library's normal contract.
 */
.card__art .uxag-icon,
.stage .uxag-icon,
.scales .uxag-icon,
.role__art .uxag-icon,
.rule__art .uxag-icon {
  color: var(--uxag-preview-ink, var(--uxag-ink));
}

/* ── buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--sm {
  padding: 6px 11px;
  font-size: 13px;
}

.btn--icon {
  padding: 8px;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
}

.btn--ghost:hover {
  background: var(--sunken);
}

.btn--primary {
  background: var(--uxag-ink);
  border-color: var(--uxag-ink);
  color: #fff;
}

[data-theme='dark'] .btn--primary {
  background: var(--uxag-cyan-500);
  border-color: var(--uxag-cyan-500);
  color: #052a34;
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #052a34;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.seg button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed='true'] {
  background: var(--uxag-ink);
  color: #fff;
}

[data-theme='dark'] .seg button[aria-pressed='true'] {
  background: var(--uxag-neutral-50);
  color: var(--uxag-neutral-1000);
}

.seg--tight button {
  padding: 5px 8px;
  font-size: 11.5px;
}

/* Size: presets and a free-form px field read as one control. */
.seg--size {
  align-items: center;
}

.seg--size #sizes {
  display: inline-flex;
  gap: 2px;
}

/* The px suffix keeps the free-form value from reading as another preset. */
.seg__px {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  margin-left: 4px;
  padding-left: 7px;
  border-left: 1px solid var(--line-strong);
}

.seg__px i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
}

.seg--size input {
  width: 30px;
  padding: 5px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}

.seg--size input::-webkit-outer-spin-button,
.seg--size input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.seg--size input::placeholder {
  color: var(--text-mute);
}

.seg--size input:focus {
  outline: none;
  color: var(--accent-ink);
}

/* ── shell ────────────────────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ── sidebar ──────────────────────────────────────────────────────────────── */

/*
 * The rail itself never scrolls: brand, search, the download button and the
 * footer stay put. Only .side__nav scrolls, so the list can grow with the
 * library without carrying the chrome away with it.
 */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px 14px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.side__brand,
.side__search,
.side__grab,
.side__foot {
  flex: none;
}

.side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  text-decoration: none;
  color: var(--text);
}

.side__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--uxag-cyan-500);
  flex: none;
}

.side__name {
  display: flex;
  flex-direction: column;
  font-weight: 660;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.side__name em {
  font-style: normal;
  font-weight: 450;
  font-size: 12.5px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side__search {
  position: relative;
  margin-bottom: 14px;
}

.side__search input {
  width: 100%;
  padding: 9px 34px 9px 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.side__search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.side__searchicon {
  position: absolute;
  left: 9px;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-mute);
  pointer-events: none;
}

.side__search kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 4px;
  pointer-events: none;
}

.side__nav {
  flex: 1;
  /* Without min-height a flex child refuses to shrink below its content, and the
     overflow would escape to the rail again. */
  min-height: 0;
  overflow-y: auto;
  /* Reaching the end of the list must not start scrolling the gallery behind it. */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.side__nav::-webkit-scrollbar {
  width: 8px;
}

.side__nav::-webkit-scrollbar-track {
  background: transparent;
}

.side__nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
  border: 2px solid var(--rail);
}

.side__nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-mute);
}

.side__label {
  margin: 16px 8px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.side__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side__list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
}

.side__list a:hover {
  background: color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--text);
}

.side__list a[aria-current='page'] {
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-weight: 600;
}

.side__list b {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.side__list a[aria-current='page'] b {
  color: inherit;
}

.side__grab {
  margin: 14px 0 12px;
  justify-content: center;
}

.side__foot {
  display: flex;
  gap: 12px;
  padding: 12px 9px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-mute);
}

.side__foot a {
  color: var(--text-soft);
  text-decoration: none;
}

.side__foot span {
  margin-left: auto;
  font-family: var(--mono);
}

/* ── top bar ──────────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--bar-h);
  padding: 12px 28px;
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar__menu {
  display: none;
}

.bar__title {
  min-width: 0;
}

.bar__title h1 {
  font-size: 19px;
}

.bar__title p {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--text-mute);
}

.bar__tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── controls panel ───────────────────────────────────────────────────────── */

.panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  align-items: start;
  gap: 18px 26px;
  padding: 18px 28px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
}

.panel__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.panel__label {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.panel__label b {
  margin-left: auto;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
}

.panel__reset {
  align-self: end;
  justify-self: start;
}

/* One row, always: the picker is the last item and must stay reachable. */
.swatches {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

/*
 * The last item in each row opens the native colour picker. It carries a
 * spectrum rather than a flat swatch so it is obviously "any colour" and never
 * mistaken for one more preset.
 */
.swatches .swatch--custom {
  margin-left: 4px;
  background: conic-gradient(
    from 90deg,
    #ff3b30,
    #ffcc00,
    #34c759,
    #00c2f0,
    #5856d6,
    #ff2d94,
    #ff3b30
  );
}

.swatches .swatch--custom::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface);
}

.swatch {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgb(0 0 0 / 14%);
}

[data-theme='dark'] .swatch {
  border-color: rgb(255 255 255 / 20%);
}

.swatch[aria-pressed='true']::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--text);
  border-radius: 10px;
}

.swatch--custom {
  overflow: hidden;
  display: grid;
  place-items: center;
}

.swatch--custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
}

.checks input {
  accent-color: var(--uxag-cyan-500);
  width: 15px;
  height: 15px;
}

/* ── canvas ───────────────────────────────────────────────────────────────── */

.canvas {
  padding: 30px 28px 120px;
}

.group + .group {
  margin-top: 40px;
}

.group__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.group__head h2 {
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.group__head span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--accent) 70%, transparent);
  transform: translateY(-2px);
}

.card[data-selected='true'] {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.card__hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
}

.card__art {
  display: grid;
  place-items: center;
  min-height: 84px;
  pointer-events: none;
}

.card__name {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-soft);
  pointer-events: none;
  overflow-wrap: anywhere;
}

.card__pick {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 17px;
  height: 17px;
  margin: 0;
  opacity: 0;
  accent-color: var(--uxag-cyan-500);
  transition: opacity 0.14s;
  z-index: 2;
}

.card:hover .card__pick,
.card__pick:checked,
.card__pick:focus-visible {
  opacity: 1;
}

.empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-soft);
}

.empty strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  margin-bottom: 4px;
}

/* ── docs ─────────────────────────────────────────────────────────────────── */

.doc {
  max-width: 860px;
}

.doc h3 {
  font-size: 16px;
  margin: 40px 0 10px;
}

.doc p {
  color: var(--text-soft);
}

.lead {
  font-size: 16.5px;
  max-width: 66ch;
  margin: 0 0 26px;
}

.hint {
  font-size: 13.5px;
  margin: 0 0 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 14px;
}

.tile {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tile__icon {
  display: block;
  color: var(--accent-ink);
  margin-bottom: 12px;
}

.tile h3 {
  font-size: 15.5px;
  margin: 0 0 6px;
}

.tile p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-soft);
}

.tile pre,
.tile p + p {
  margin: 12px 0 0;
}

.tile pre {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
}

.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.role {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  padding-bottom: 16px;
}

.role__art {
  display: grid;
  place-items: center;
  height: 116px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.role > code,
.role > p {
  display: block;
  padding: 0 16px;
}

.role > code {
  color: var(--accent-ink);
  font-size: 12.5px;
  margin-bottom: 6px;
}

.role > p {
  margin: 0;
  font-size: 13.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs button {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-soft);
}

.tabs button[aria-selected='true'] {
  background: var(--uxag-ink);
  border-color: var(--uxag-ink);
  color: #fff;
}

[data-theme='dark'] .tabs button[aria-selected='true'] {
  background: var(--uxag-neutral-50);
  border-color: var(--uxag-neutral-50);
  color: var(--uxag-neutral-1000);
}

.code {
  position: relative;
}

.code pre {
  margin: 0;
  padding: 18px 92px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.code__copy {
  position: absolute;
  top: 10px;
  right: 10px;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.spec td {
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text-soft);
}

.spec td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  padding-right: 24px;
}

.brandrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.brandcard {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.brandcard:hover {
  border-color: var(--accent);
}

.brandcard__chip {
  display: block;
  height: 76px;
}

.brandcard__meta {
  display: block;
  padding: 11px 13px 13px;
}

.brandcard__name {
  display: block;
  font-weight: 620;
  font-size: 13.5px;
}

.brandcard__hex {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
}

.ramp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
  margin: 8px 0 20px;
}

.ramp button {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.ramp button:hover {
  border-color: var(--accent);
}

.ramp__chip {
  display: block;
  height: 44px;
}

.ramp__hex {
  display: block;
  padding: 5px 2px 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  text-align: center;
}

.rampname {
  margin: 0 0 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 14px;
}

.rule {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.rule__art {
  display: grid;
  place-items: center;
  height: 118px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
}

.rule__body {
  display: flex;
  gap: 9px;
  padding: 14px 16px 16px;
}

.rule__mark {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.rule--do .rule__mark {
  background: var(--uxag-success);
}

.rule--dont .rule__mark {
  background: var(--uxag-danger);
}

.rule__body p {
  margin: 0;
  font-size: 13.5px;
}

.rule__body strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

/* ── selection pill ───────────────────────────────────────────────────────── */

.pill {
  position: fixed;
  left: calc(50% + var(--rail-w) / 2);
  bottom: 24px;
  translate: -50% 0;
  z-index: 45;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: 0 16px 40px -14px rgb(0 0 0 / 30%);
}

.pill[data-active='true'] {
  display: flex;
}

/* ── drawer ───────────────────────────────────────────────────────────────── */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.drawer[data-open='true'] {
  display: block;
}

.drawer__scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgb(16 17 20 / 42%);
}

.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(456px, 100%);
  background: var(--page);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 22px 24px 48px;
  animation: slide 0.2s ease;
}

@keyframes slide {
  from {
    transform: translateX(16px);
    opacity: 0.5;
  }
}

.drawer__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer__head h2 {
  font-size: 20px;
}

.drawer__head code {
  font-size: 12.5px;
  color: var(--text-mute);
}

.drawer__close {
  margin-left: auto;
}

.stage {
  display: grid;
  place-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}

.scales {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
  padding: 16px 0 4px;
}

.scales figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.scales figcaption {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
}

.drawer__actions {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.drawer h4 {
  margin: 24px 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.snippet {
  position: relative;
}

.snippet pre {
  margin: 0;
  padding: 12px 78px 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
}

.snippet .code__copy {
  top: 7px;
  right: 7px;
}

/* ── toast ────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  z-index: 90;
  padding: 11px 18px;
  border-radius: 11px;
  background: var(--uxag-ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, translate 0.18s;
}

[data-theme='dark'] .toast {
  background: var(--uxag-neutral-50);
  color: var(--uxag-neutral-1000);
}

.toast[data-show='true'] {
  opacity: 1;
  translate: -50% -8px;
}

.pill[data-active='true'] ~ .toast {
  bottom: 88px;
}

/* ── responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: fixed;
    z-index: 50;
    width: var(--rail-w);
    height: 100dvh;
    translate: -100% 0;
    transition: translate 0.2s ease;
  }

  .side[data-open='true'] {
    translate: 0 0;
    box-shadow: 0 0 60px rgb(0 0 0 / 25%);
  }

  .bar__menu {
    display: inline-flex;
  }

  .bar,
  .panel,
  .canvas {
    padding-inline: 18px;
  }

  .pill {
    left: 50%;
  }
}

/* Below this the tools no longer fit beside the title, so give them their own
   row instead of letting them squeeze it. */
@media (max-width: 620px) {
  .bar {
    flex-wrap: wrap;
  }

  .bar__tools {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer__panel {
    animation: none;
  }

  .card:hover {
    transform: none;
  }

  .side {
    transition: none;
  }
}
