/* =====================================================================
   gglias.github.io/toolkit — small design tools that run in the browser
   Same "Studio" look as the portfolio: a dark Figma canvas, UI3 toolbar,
   properties panels. Nothing typed or uploaded leaves the page.
   ===================================================================== */

/* ================= Tokens (same as the portfolio) ================= */
:root {
  --bg: #09090a;
  --bg-2: #0e0e10;
  --card: #121214;
  --card-2: #18181b;
  --line: rgb(255 255 255 / 0.07);
  --line-2: rgb(255 255 255 / 0.13);
  --text: #f3f3f1;
  --muted: #9b9ba1;
  --faint: #56565c;
  --dot: rgb(255 255 255 / 0.075);

  --select: #0d99ff;                  /* Figma selection blue */
  --cursor-color: #a259ff;            /* Figma multiplayer cursor */
  --accent: #ff5b1f;                  /* Ember */
  --accent-deep: #c4210b;
  --on-accent: #fff;

  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --cursor-arrow: url("assets/cursor.svg") 2 2, auto;
  --cursor-hand: url("assets/hand-glove.svg") 6 2, pointer;

  --radius: 22px;
  --radius-s: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html {
  cursor: var(--cursor-arrow);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color-scheme: dark;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Canvas dot grid; clears around the mouse (--mx / --my set in site.js) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, var(--dot) 1.1px, transparent 1.4px) 0 0 / 28px 28px;
  -webkit-mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), transparent 0, transparent 35%, #000 100%);
  mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), transparent 0, transparent 35%, #000 100%);
}

.glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.glow-a {
  width: 70vmax; height: 70vmax;
  left: -28vmax; bottom: -36vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 62%);
}
.glow-b {
  width: 50vmax; height: 50vmax;
  right: -20vmax; top: -24vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-deep) 34%, transparent), transparent 62%);
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1;
}
p { margin: 0; }
[hidden] { display: none !important; }   /* .check, .color etc. set display, which beat the attribute */
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

a, button, [role="button"], label, summary, select { cursor: var(--cursor-hand); }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font: 500 14px var(--f-body);
}
.skip:focus { top: 12px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 400 12px/1 var(--f-mono);
  letter-spacing: 0.02em;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.surface {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.015)), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05);
}

/* ================= Page shell + top bar ================= */
.shell {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: 20px clamp(16px, 3vw, 32px) 140px;   /* bottom: room for the toolbar */
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.015)), var(--card);
  border: 1px solid var(--line);
}
.top-home img { height: 24px; width: auto; }
.crumbs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  font: 400 12px/1 var(--f-mono);
  color: var(--muted);
  white-space: nowrap;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.top-link {
  flex: none;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.05);
  font: 500 13.5px/1 var(--f-body);
  text-decoration: none;
  transition: background 0.2s;
}
.top-link:hover { background: rgb(255 255 255 / 0.1); }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(80px, 10vw, 120px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font: 400 12px/1.5 var(--f-mono);
  color: var(--faint);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ================= Home ================= */
.home-hero {
  max-width: 860px;
  padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 6vw, 72px);
}
.home-title {
  margin-top: 22px;
  font-size: clamp(2.9rem, 7.4vw, 5.6rem);
  line-height: 0.98;
}
.home-title em {
  font-style: normal;
  color: var(--accent);
}
.home-lede {
  margin-top: 26px;
  max-width: 600px;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: var(--muted);
}
.home-lede a { color: var(--text); text-decoration-color: var(--faint); text-underline-offset: 3px; }

.promise {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding: 0;
  list-style: none;
}
.promise li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgb(255 255 255 / 0.03);
  font: 500 13px/1 var(--f-body);
  color: #d6d6da;
}
.promise svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tools as Figma frames: name above, the card is the frame */
.tools-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.tools-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.frame-count { font: 400 12px/1 var(--f-mono); color: var(--muted); }

.tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}
.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
}
.tool-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font: 400 11.5px/1 var(--f-mono);
  color: var(--muted);
  transition: color 0.2s;
}
.tool-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  outline: 1px solid transparent;
  outline-offset: 0;
  transition: outline-color 0.2s, transform 0.35s var(--ease);
}
.tool-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 11;
  margin: 10px 10px 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle, rgb(255 255 255 / 0.07) 1px, transparent 1.3px) 0 0 / 18px 18px,
    var(--bg-2);
}
.tool-body { padding: 20px 22px 22px; display: grid; gap: 10px; }
.tool-body h3 { font-size: 1.6rem; }
.tool-body p { color: var(--muted); font-size: 0.95rem; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tool-tags span {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.05);
  font: 400 11px/1 var(--f-mono);
  color: #c9c9cf;
}
a.tool:hover .tool-label { color: var(--select); }
a.tool:hover .tool-card { outline-color: var(--select); transform: translateY(-3px); }
.tool.is-soon { opacity: 0.55; }
.tool.is-soon .tool-art { filter: grayscale(1); }
.soon-pill {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: var(--muted);
  font: 500 10.5px/1 var(--f-mono);
}

/* Home QR preview inside the art area */
.art-qr {
  width: 46%;
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 40px -14px rgb(0 0 0 / 0.7);
  transform: none;
  transition: transform 0.5s var(--ease);
}
.art-qr svg { width: 100%; height: 100%; display: block; }
a.tool:hover .art-qr { transform: rotate(0deg) scale(1.04); }

/* Home colors preview: a palette strip and a contrast chip */
.art-pal { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); width: 80%; height: 44%; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 40px -14px rgb(0 0 0 / 0.7); transform: none; transition: transform 0.5s var(--ease); }
.art-pal span { background: var(--c); }
.art-pal b { position: absolute; right: 10px; bottom: -14px; display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #4f46e5; color: #fff; font: 600 18px/1 var(--f-body); box-shadow: 0 10px 20px -8px rgb(0 0 0 / 0.6); }
.art-pal b small { font: 400 11px/1 var(--f-mono); opacity: 0.85; }
a.tool:hover .art-pal { transform: rotate(0deg) scale(1.03); }

/* Home do-not-disturb preview: a little monitor with the sign */
.art-dnd { display: grid; justify-items: center; width: 70%; transform: none; transition: transform 0.5s var(--ease); }
.art-dnd-sign { display: grid; gap: 6px; width: 100%; aspect-ratio: 16 / 9; padding: 7% 8%; border: 5px solid #1d1d20; border-radius: 8px; background: #ff5b1f; color: #fff; box-shadow: 0 20px 40px -14px rgb(0 0 0 / 0.7); align-content: space-between; }
.art-dnd-sign b { font: 500 9px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.art-dnd-sign strong { font: 700 clamp(1.1rem, 2.2vw, 1.6rem)/1 var(--f-display); letter-spacing: -0.04em; }
.art-dnd-sign small { font: 400 9px/1 var(--f-mono); opacity: 0.85; }
.art-dnd-stand { width: 22%; height: 14px; background: #1d1d20; clip-path: polygon(30% 0, 70% 0, 85% 100%, 15% 100%); }
a.tool:hover .art-dnd { transform: rotate(0deg) scale(1.03); }

/* Home favicon preview: the app icon above a browser tab */
.art-fav { display: grid; justify-items: center; gap: 22px; width: 78%; }
.art-fav-icon {
  display: grid;
  place-items: center;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 22%;
  background: var(--accent);
  box-shadow: 0 20px 40px -14px rgb(0 0 0 / 0.7);
  transform: none;
  transition: transform 0.5s var(--ease);
}
.art-fav-icon img { width: 66%; height: auto; }
a.tool:hover .art-fav-icon { transform: rotate(0deg) scale(1.06); }
.art-fav .tab-strip { width: 100%; }
.art-fav-mini { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--accent); }
.art-fav-mini img { width: 12px; height: auto; }

.art-text {
  font: 400 clamp(1rem, 1.7vw, 1.3rem)/1.5 var(--f-mono);
  color: var(--muted);
  text-align: center;
}
.art-text b { color: var(--text); font-weight: 500; }
.art-text i { font-style: normal; color: var(--accent); }

/* ================= Tool page header ================= */
.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: clamp(36px, 5vw, 56px) 0 clamp(24px, 3vw, 32px);
}
.tool-hero h1 { margin-top: 16px; font-size: clamp(2.3rem, 5vw, 3.8rem); }
.tool-hero p { margin-top: 14px; max-width: 620px; color: var(--muted); }
.local-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgb(74 222 128 / 0.08);
  border: 1px solid rgb(74 222 128 / 0.2);
  font: 500 12.5px/1.2 var(--f-body);
  color: #bdf5cf;
}
.local-note svg { width: 15px; height: 15px; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= Tool layout: panel · canvas · panel ================= */
.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.panel {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 104px);   /* ends above the export bar */
  overflow: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.12) transparent;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font: 600 12.5px/1 var(--f-body);
}
.panel-head span { font: 400 11px/1 var(--f-mono); color: var(--muted); }
.sec {
  padding: 14px 16px 2px;
}
.sec + .sec { margin-top: 12px; border-top: 1px solid var(--line); }
.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font: 600 11.5px/1 var(--f-body);
  color: var(--text);
}
.sec-title small { font: 400 11px/1 var(--f-mono); color: var(--muted); }

/* ---- Figma-like controls ---- */
.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field > span,
.field-row > span {
  font: 400 11.5px/1.2 var(--f-mono);
  color: var(--muted);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgb(255 255 255 / 0.055);
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
}
/* Native pickers (time, color) draw their icons for a dark page */
.input, .select, .textarea { color-scheme: dark; }
.input::-webkit-calendar-picker-indicator { opacity: 0.75; cursor: var(--cursor-hand); }
.input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--select);
  background: rgb(255 255 255 / 0.07);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 92px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%239b9ba1' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
.select option { background: #1b1b1e; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 38px; }
.reveal {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.reveal:hover { background: rgb(255 255 255 / 0.08); color: var(--text); }
.reveal svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint {
  margin: -2px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.hint b { color: var(--text); font-weight: 500; }
.hint.is-note { color: #c7d7ff; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #d6d6da;
}
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--select); }

/* Segmented control */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 2px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.055);
}
.seg button {
  min-height: 28px;
  padding: 4px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--f-body);
  transition: background 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: #2c2c31;
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }

/* Content types: icon tiles */
.types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.types button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 2px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.035);
  color: var(--muted);
  font: 500 11.5px/1 var(--f-body);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.types button:hover { background: rgb(255 255 255 / 0.07); color: var(--text); }
.types button[aria-pressed="true"] {
  border-color: var(--select);
  background: rgb(13 153 255 / 0.12);
  color: #fff;
}
.types svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Style tiles with a tiny preview of the shape */
.styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.styles.is-4 { grid-template-columns: repeat(4, 1fr); }
.styles button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 9px 2px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.035);
  color: var(--muted);
  font: 500 10.5px/1.1 var(--f-body);
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.styles button:hover { background: rgb(255 255 255 / 0.07); color: var(--text); }
.styles button[aria-pressed="true"] {
  border-color: var(--select);
  background: rgb(13 153 255 / 0.12);
  color: #fff;
}
.styles svg { width: 26px; height: 26px; fill: currentColor; }

/* Presets */
.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.presets button {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 6px 2px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 500 10.5px/1 var(--f-body);
}
.presets button:hover { background: rgb(255 255 255 / 0.05); color: var(--text); }
.presets button[aria-pressed="true"] { color: #fff; }
.presets button[aria-pressed="true"] i { outline: 2px solid var(--select); outline-offset: 2px; }
.presets i {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--bg-c, #fff);
  position: relative;
  overflow: hidden;
}
.presets i::before,
.presets i::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: var(--r, 0);
  border: 4px solid var(--c-c, #000);
  width: 12px;
  height: 12px;
}
.presets i::after {
  inset: auto 9px 9px auto;
  border: 0;
  width: 10px;
  height: 10px;
  background: var(--fg-c, #000);
  border-radius: var(--r2, 0);
}

/* Color row: swatch + hex */
.color {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--swatch, #000);
}
.swatch input {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  opacity: 0;
  cursor: var(--cursor-hand);
}
.swatch.is-transparent {
  background:
    conic-gradient(#3a3a3e 25%, #26262a 0 50%, #3a3a3e 0 75%, #26262a 0) 0 0 / 10px 10px;
}
.color .input { font-family: var(--f-mono); font-size: 12.5px; text-transform: uppercase; }
.color .input:disabled { opacity: 0.45; }

/* Range */
.range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.range output { font: 400 12px/1 var(--f-mono); color: var(--muted); text-align: right; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--select) var(--p, 50%), rgb(255 255 255 / 0.12) var(--p, 50%));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgb(255 255 255 / 0.12); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--select); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
input[type="range"]:disabled { opacity: 0.4; }

/* Logo drop zone */
.drop {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  background: rgb(255 255 255 / 0.025);
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover,
.drop.is-over { border-color: var(--select); background: rgb(13 153 255 / 0.06); }
.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: var(--cursor-hand);
}
.drop-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.06);
  overflow: hidden;
}
.drop-thumb img { width: 100%; height: 100%; object-fit: contain; }
.drop-thumb svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop-text { display: grid; gap: 2px; font-size: 13px; }
.drop-text small { font-size: 11.5px; color: var(--muted); }
.drop.has-logo input[type="file"] { right: 70px; }
.drop.has-logo .drop-text { padding-right: 64px; }
.drop.has-logo .drop-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-remove {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: rgb(255 255 255 / 0.07);
  color: var(--text);
  font: 500 12px/1 var(--f-body);
}
.drop-remove:hover { background: rgb(248 113 113 / 0.18); color: #ffd1d1; }

/* Encoded data preview */
details.raw { margin: 4px 0 10px; }
details.raw summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 400 11.5px/1 var(--f-mono);
  color: var(--muted);
}
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary:hover { color: var(--text); }
details.raw summary::after { content: "+"; }
details.raw[open] summary::after { content: "−"; }
details.raw pre {
  margin: 8px 0 0;
  max-height: 160px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.35);
  font: 400 11.5px/1.5 var(--f-mono);
  color: #c9c9cf;
  white-space: pre-wrap;
  word-break: break-all;
}

details.tip {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgb(13 153 255 / 0.07);
  border: 1px solid rgb(13 153 255 / 0.18);
  font-size: 12.5px;
  line-height: 1.5;
  color: #c7d7ff;
}
details.tip summary { list-style: none; font-weight: 500; color: #e3ebff; }
details.tip summary::-webkit-details-marker { display: none; }
details.tip summary::after { content: " ↓"; color: var(--select); }
details.tip[open] summary::after { content: " ↑"; }
details.tip p { margin-top: 8px; }
details.tip code { font: 400 11.5px var(--f-mono); color: #fff; }

/* ================= Canvas (centre) ================= */
.stage {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 64px 24px 56px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgb(255 255 255 / 0.08) 1px, transparent 1.3px) 0 0 / 20px 20px,
    #0c0c0e;
  overflow: hidden;
}
.canvas-zoom {
  position: absolute;
  left: 14px;
  top: 12px;
  font: 400 11px/1 var(--f-mono);
  color: var(--faint);
}

/* The selected frame */
.qr-frame {
  position: relative;
  width: clamp(200px, 30cqi, 340px);
  aspect-ratio: 1;
  outline: 1px solid var(--select);
  transition: opacity 0.2s;
}
.qr-frame.is-sample { opacity: 0.35; }
.qr-frame.is-transparent {
  background: conic-gradient(#2a2a2e 25%, #1d1d21 0 50%, #2a2a2e 0 75%, #1d1d21 0) 0 0 / 16px 16px;
}
.qr-frame-name {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 8px);
  font: 500 11.5px/1 var(--f-body);
  color: var(--select);
  white-space: nowrap;
}
.qr-frame-size {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--select);
  color: #fff;
  font: 500 11px/1.2 var(--f-body);
  white-space: nowrap;
}
.qr-frame .h {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 1px solid var(--select);
  z-index: 2;
}
.h.tl { left: -4px; top: -4px; }
.h.tr { right: -4px; top: -4px; }
.h.bl { left: -4px; bottom: -4px; }
.h.br { right: -4px; bottom: -4px; }
.qr-out,
.qr-out svg,
.qr-out canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.sample-tag {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgb(18 18 20 / 0.92);
  border: 1px solid var(--line-2);
  font: 500 13px/1.3 var(--f-body);
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.qr-frame.is-sample + .sample-tag,
.canvas.is-sample .sample-tag { opacity: 1; }

/* Checks under the canvas */
.checks { padding: 6px 6px; }
.checks ul { margin: 0; padding: 0; list-style: none; }
.checks li {
  display: grid;
  grid-template-columns: 22px 130px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13.5px;
}
.checks li + li { border-top: 1px solid var(--line); border-radius: 0; }
.checks .ic {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.07);
  color: var(--muted);
}
.checks .ic svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.checks [data-state="ok"] .ic { background: rgb(74 222 128 / 0.15); color: var(--ok); }
.checks [data-state="warn"] .ic { background: rgb(251 191 36 / 0.15); color: var(--warn); }
.checks [data-state="bad"] .ic { background: rgb(248 113 113 / 0.15); color: var(--bad); }
.checks dt,
.checks .k { font: 400 12px/1.6 var(--f-mono); color: var(--muted); }
.checks .v { color: #e6e6e9; line-height: 1.5; }
.checks .v small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.checks .v .select {
  display: inline-block;
  width: auto;
  min-height: 28px;
  margin-left: 6px;
  padding: 3px 28px 3px 8px;
  font-size: 12.5px;
}

/* ================= Favicon: a board of small Figma frames ================= */
/* The board answers to the canvas' own width (it's narrow between two panels) */
.fav-canvas {
  display: block;
  min-height: 0;
  padding: 58px clamp(18px, 5cqi, 36px) 40px;
  container-type: inline-size;
}
.fav-board {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "main tabs" "main home" "sizes search";
  gap: 40px clamp(20px, 5cqi, 40px);
  align-items: start;
  transition: opacity 0.2s;
}
.canvas.is-sample .fav-board { opacity: 0.45; }
.fav-canvas .sample-tag { top: 14px; transform: translateX(-50%); }

.ff { position: relative; margin: 0; min-width: 0; }
.ff-name {
  margin-bottom: 10px;
  font: 500 11.5px/1 var(--f-body);
  color: var(--select);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-main { grid-area: main; justify-self: center; align-self: center; padding-bottom: 30px; }
.ff-tabs { grid-area: tabs; }
.ff-home { grid-area: home; }
.ff-sizes { grid-area: sizes; }
.ff-search { grid-area: search; }

/* The selected frame (same look as the QR one) */
.ff-big {
  position: relative;
  width: clamp(140px, 30cqi, 236px);
  aspect-ratio: 1;
  outline: 1px solid var(--select);
}
.ff-big.is-transparent { background: conic-gradient(#2a2a2e 25%, #1d1d21 0 50%, #2a2a2e 0 75%, #1d1d21 0) 0 0 / 16px 16px; }
.ff-big canvas { display: block; width: 100% !important; height: 100% !important; }
.ff-big .h {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 1px solid var(--select);
  z-index: 2;
}
.ff-main .qr-frame-size { top: auto; bottom: 0; }

/* Browser tabs, Chrome-like, light and dark */
.tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 7px 8px 0;
  border-radius: 10px 10px 0 0;
  background: #dee1e6;
  overflow: hidden;
}
.tab-strip + .tab-strip { margin-top: 10px; }
.tab-strip.is-dark { background: #202124; }
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 190px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px 8px 0 0;
  background: #fff;
  color: #1f1f1f;
  font: 400 12px/1 var(--f-body);
}
.tab canvas { flex: none; display: block; }
.tab-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab i { font-style: normal; font-size: 14px; color: #5f6368; }
.tab.is-back { background: transparent; color: #5f6368; flex-basis: 120px; }
.tab-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: rgb(0 0 0 / 0.12); }
.is-dark .tab { background: #35363a; color: #e8eaed; }
.is-dark .tab i { color: #9aa0a6; }
.is-dark .tab.is-back { background: transparent; color: #9aa0a6; }
.is-dark .tab-dot { background: rgb(255 255 255 / 0.14); }

/* Home screen */
.home-screen {
  display: flex;
  justify-content: center;
  gap: 34px;
  padding: 22px 16px 16px;
  border-radius: 14px;
  background: linear-gradient(150deg, #3b2a6b, #1b3b6f 55%, #0f5c63);
}
.app-ic { display: grid; justify-items: center; gap: 7px; width: 74px; }
.app-ic canvas { display: block; box-shadow: 0 6px 14px -6px rgb(0 0 0 / 0.5); }
.app-ic.is-ios canvas { border-radius: 22.5%; }
.app-ic.is-android canvas { border-radius: 50%; }
.app-ic small {
  max-width: 100%;
  font: 500 11px/1.2 var(--f-body);
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
}
.ff-note {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 8px;
  font: 400 11px/1 var(--f-mono);
  color: var(--faint);
}
.ff-note span { width: 74px; text-align: center; }

/* Search result */
.serp {
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: #fff;
  color: #202124;
  font-family: Arial, sans-serif;
}
.serp-site { display: flex; align-items: center; gap: 10px; }
.serp-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f3f4;
  border: 1px solid #dadce0;
}
.serp-ic canvas { display: block; }
.serp-site b { display: block; font-size: 14px; font-weight: 400; line-height: 1.3; }
.serp-site small { display: block; font-size: 12px; color: #4d5156; }
.serp-title { margin-top: 8px; font-size: 19px; line-height: 1.3; color: #1a0dab; }

/* Actual pixels */
.px-row {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  padding: 18px 20px 14px;
  border-radius: 12px;
  background: #fff;
}
.px-row span { display: grid; justify-items: center; gap: 8px; }
.px-row canvas { display: block; image-rendering: pixelated; }
.px-row small { font: 400 11px/1 var(--f-mono); color: #6b6b72; }

/* Code + file list in the right panel */
.hint code { font: 400 11.5px var(--f-mono); color: #fff; }
pre.code {
  margin: 0 0 10px;
  padding: 10px 11px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.35);
  border: 1px solid var(--line);
  font: 400 11px/1.6 var(--f-mono);
  color: #d6d6db;
  white-space: pre-wrap;
  word-break: break-all;
}
.files { margin: 0 0 10px; padding: 0; list-style: none; }
.files li {
  display: grid;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.files b { font: 500 12px/1.3 var(--f-mono); color: var(--text); }
.files span { color: var(--muted); }
.styles button:disabled { opacity: 0.35; cursor: not-allowed; }

/* Folding groups in a panel: closed by default, the header shows the current value */
details.acc { padding: 0 16px; }
.sec + details.acc,
details.acc + .sec { margin-top: 0; }
.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  list-style: none;
  font: 600 11.5px/1 var(--f-body);
  color: var(--text);
  user-select: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head > span:first-child { flex: none; }
.acc-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
  font: 400 11px/1.2 var(--f-mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-val i {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  background: var(--chip, transparent);
}
.acc-val i.is-circle { border-radius: 50%; }
.acc-val i.is-none { background: conic-gradient(#3a3a3e 25%, #26262a 0 50%, #3a3a3e 0 75%, #26262a 0) 0 0 / 6px 6px; }
.acc-chev {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease);
}
.acc-head:hover .acc-val,
.acc-head:hover .acc-chev { color: var(--text); stroke: var(--text); }
details.acc[open] .acc-chev { transform: rotate(180deg); }
details.acc[open] .acc-val { visibility: hidden; }   /* the controls below say it already */
.acc-body { padding: 2px 0 6px; }

@container (max-width: 460px) {
  .fav-board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "tabs" "home" "search" "sizes"; gap: 34px; }
  .ff-big { width: min(60cqi, 220px); }
}

/* ================= Colors: phones, palettes, contrast, code ================= */
.cl-canvas {
  display: block;
  min-height: 0;
  padding: 52px 20px 36px;
}
.cl-phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }

/* A tiny Material 3 app, painted only with the generated roles (set as --role vars) */
.ph {
  position: relative;
  width: 236px;
  height: 480px;
  padding: 0 12px;
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface);
  color: var(--onSurface);
  font: 400 12px/1.3 var(--f-body);
  box-shadow: 0 0 0 6px #1c1c1f, 0 0 0 7px rgb(255 255 255 / 0.12), 0 30px 60px -20px rgb(0 0 0 / 0.8);
}
.ph * { cursor: inherit; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 11px 8px 4px; font: 600 11px/1 var(--f-body); }
.ph-status span { width: 22px; height: 10px; border-radius: 3px; background: currentColor; opacity: 0.85; }
.ph-top { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 10px; }
.ph-title { font: 600 21px/1 var(--f-body); letter-spacing: -0.02em; }
.ph-me { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tertiaryContainer); color: var(--onTertiaryContainer); font-weight: 600; }
.ph-search { display: flex; align-items: center; height: 34px; padding: 0 14px; margin-bottom: 10px; border-radius: 999px; background: var(--surfaceContainerHigh); color: var(--onSurfaceVariant); }
.ph-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.ph-chips span { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--outline); color: var(--onSurfaceVariant); font: 500 11px/1.2 var(--f-body); }
.ph-chips .is-on { border-color: transparent; background: var(--secondaryContainer); color: var(--onSecondaryContainer); }
.ph-banner { display: flex; justify-content: space-between; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; background: var(--errorContainer); color: var(--onErrorContainer); font-weight: 500; }
.ph-banner b { font-weight: 700; }
.ph-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--outlineVariant); }
.ph-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primaryContainer); color: var(--onPrimaryContainer); font-weight: 600; }
.ph-av.is-t { background: var(--tertiaryContainer); color: var(--onTertiaryContainer); }
.ph-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ph-txt b { font-weight: 600; font-size: 12.5px; }
.ph-txt small { font-size: 11px; color: var(--onSurfaceVariant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-badge { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: var(--onPrimary); font: 600 10px/1 var(--f-body); }
.ph-card { display: grid; gap: 2px; margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surfaceContainerLow); }
.ph-card b { font-weight: 600; font-size: 13px; }
.ph-card small { font-size: 11px; color: var(--onSurfaceVariant); }
.ph-btns { display: flex; gap: 6px; margin-top: 10px; }
.ph-btn { padding: 7px 14px; border-radius: 999px; background: var(--primary); color: var(--onPrimary); font-weight: 600; }
.ph-tbtn { padding: 7px 8px; color: var(--primary); font-weight: 600; }
.ph-fab { position: absolute; right: 14px; bottom: 116px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--primaryContainer); color: var(--onPrimaryContainer); font: 300 26px/1 var(--f-body); box-shadow: 0 4px 10px rgb(0 0 0 / 0.25); }
.ph-snack { position: absolute; left: 12px; right: 12px; bottom: 70px; display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 8px; background: var(--inverseSurface); color: var(--onInverseSurface); }
.ph-snack b { color: var(--inversePrimary); font-weight: 600; }
.ph-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; height: 60px; background: var(--surfaceContainer); }
.ph-nav span { display: grid; justify-items: center; gap: 4px; font: 500 10px/1 var(--f-body); color: var(--onSurfaceVariant); }
.ph-nav i { position: relative; width: 44px; height: 24px; border-radius: 999px; }
.ph-nav i::after { content: ""; position: absolute; inset: 6px 16px; border-radius: 3px; background: currentColor; }
.ph-nav .is-on { color: var(--onSurface); }
.ph-nav .is-on i { background: var(--secondaryContainer); }
.ph-nav .is-on i::after { background: var(--onSecondaryContainer); }

/* Boxes under the preview */
.cl-box { container-type: inline-size; overflow: hidden; }
.cl-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font: 600 12.5px/1 var(--f-body);
}
.cl-box-head span { font: 400 11px/1.3 var(--f-mono); color: var(--muted); text-align: right; }

/* Palettes */
.ramps { padding: 12px 16px 8px; }
.ramp { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 8px; }
.ramp-name { font: 500 12px/1.2 var(--f-body); color: var(--muted); }
.ramp-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.sw {
  position: relative;
  display: grid;
  align-content: end;
  gap: 2px;
  height: 48px;
  min-width: 0;
  padding: 4px 5px;
  border: 0;
  border-radius: 7px;
  text-align: left;
  transition: transform 0.15s var(--ease);
}
.sw:hover { transform: translateY(-2px); }
.sw b { font: 600 10px/1 var(--f-mono); }
.sw small { font: 400 8.5px/1 var(--f-mono); opacity: 0.8; overflow: hidden; }
.sw.is-base::before { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@container (max-width: 600px) {
  .ramp { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sw small { display: none; }
}

/* Contrast table */
.ctable-wrap { overflow-x: auto; }
.ctable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ctable th, .ctable td { padding: 8px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ctable thead th { border-top: 0; font: 400 11px/1 var(--f-mono); color: var(--muted); }
.ctable tbody th b { display: block; font-weight: 500; }
.ctable tbody th small { font: 400 10.5px/1.4 var(--f-mono); color: var(--muted); }
.ctable td { white-space: nowrap; }
.aa { display: inline-grid; place-items: center; width: 34px; height: 26px; border-radius: 6px; font: 600 12px/1 var(--f-body); vertical-align: middle; }
.cr { display: inline-grid; gap: 2px; margin-left: 8px; vertical-align: middle; }
.cr b { font: 500 12.5px/1 var(--f-body); }
.cr small { font: 400 10px/1 var(--f-mono); color: var(--muted); }
.ctable td[data-state="bad"] .cr b { color: var(--bad); }
.ctable td[data-state="ok"] .cr b::after { content: " ✓"; color: var(--ok); }

/* Code viewer */
.code-tabs { display: flex; gap: 2px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tabs button {
  flex: none;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--f-body);
}
.code-tabs button:hover { color: var(--text); }
.code-tabs button[aria-selected="true"] { background: #2c2c31; color: var(--text); }
.code-view { position: relative; padding: 12px 16px 14px; }
.code-view pre.code { margin: 0; max-height: 380px; overflow: auto; white-space: pre; word-break: normal; }
.code-copy {
  position: absolute;
  top: 20px;
  right: 26px;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #232327;
  color: var(--text);
  font: 600 11.5px/1 var(--f-body);
}
.code-copy:hover { background: #2e2e33; }

/* ================= Do not disturb ================= */
.dnd-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.dnd-presets button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.035);
  color: var(--muted);
  font: 500 12px/1.2 var(--f-body);
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dnd-presets button span { flex: none; font-size: 15px; }
.dnd-presets button:hover { background: rgb(255 255 255 / 0.07); color: var(--text); }
.dnd-presets button[aria-pressed="true"] { border-color: var(--select); background: rgb(13 153 255 / 0.12); color: #fff; }

.dnd-themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.dnd-themes button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 2px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.035);
  color: var(--muted);
  font: 500 10.5px/1 var(--f-body);
}
.dnd-themes button:hover { color: var(--text); background: rgb(255 255 255 / 0.07); }
.dnd-themes button[aria-pressed="true"] { border-color: var(--select); background: rgb(13 153 255 / 0.12); color: #fff; }
.dnd-themes i { width: 26px; height: 18px; border-radius: 5px; border: 1px solid var(--line-2); }
.sw-ember { background: #ff5b1f; }
.sw-onair { background: #0c0c0d; box-shadow: inset 0 0 0 2px #ff2a2a; }
.sw-night { background: linear-gradient(135deg, #0b0b0c 55%, #a259ff); }
.sw-calm { background: #123c33; }
.sw-paper { background: #f3f1ea; }

/* A monitor on the canvas */
.dnd-canvas { display: grid; place-items: center; min-height: 0; padding: 56px 24px 44px; }
.monitor { display: grid; justify-items: center; width: min(100%, 620px); }
.monitor-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  container-type: size;
  border-radius: 12px;
  overflow: hidden;
  border: 8px solid #1d1d20;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 30px 60px -20px rgb(0 0 0 / 0.8);
}
.monitor-stand { width: 22%; height: 34px; background: linear-gradient(#1d1d20, #141416); clip-path: polygon(30% 0, 70% 0, 85% 100%, 15% 100%); }

/* The sign: sized by its screen (container units), five looks + "done" */
.sign {
  --bg: #ff5b1f; --fg: #fff; --soft: rgb(255 255 255 / 0.78); --accent: #fff; --track: rgb(255 255 255 / 0.25);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100%;
  padding: 5cqmin 6cqmin;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  transition: background 0.6s var(--ease), color 0.6s;
  overflow: hidden;
}
.sign[data-theme="onair"] { --bg: #0c0c0d; --fg: #fff; --soft: rgb(255 255 255 / 0.6); --accent: #ff2a2a; --track: rgb(255 255 255 / 0.12); box-shadow: inset 0 0 0 1.2cqmin #ff2a2a, inset 0 0 12cqmin rgb(255 42 42 / 0.25); }
.sign[data-theme="night"] { --bg: #0b0b0c; --fg: #f3f3f1; --soft: #9b9ba1; --accent: #a259ff; --track: rgb(255 255 255 / 0.1); }
.sign[data-theme="calm"] { --bg: #123c33; --fg: #e9fff6; --soft: rgb(233 255 246 / 0.7); --accent: #7ff0c3; --track: rgb(233 255 246 / 0.18); }
.sign[data-theme="paper"] { --bg: #f3f1ea; --fg: #141414; --soft: #6b6862; --accent: #ff5b1f; --track: rgb(0 0 0 / 0.08); }
.sign[data-theme="done"] { --bg: #0f7a4a; --fg: #fff; --soft: rgb(255 255 255 / 0.82); --accent: #b6ffd9; --track: transparent; }
.sign-top, .sign-foot { display: flex; justify-content: space-between; align-items: center; gap: 4cqmin; font: 500 3.4cqmin/1 var(--f-mono); color: var(--soft); }
.sign-kicker { display: inline-flex; align-items: center; gap: 1.6cqmin; text-transform: uppercase; letter-spacing: 0.08em; }
.sign-dot { width: 2cqmin; height: 2cqmin; border-radius: 50%; background: var(--accent); }
.sign[data-theme="onair"] .sign-dot { animation: dndBlink 1.4s ease-in-out infinite; box-shadow: 0 0 2cqmin #ff2a2a; }
@keyframes dndBlink { 50% { opacity: 0.25; } }
.sign-clock { font-variant-numeric: tabular-nums; }
.sign.no-clock .sign-clock { visibility: hidden; }
.sign-main { display: grid; align-content: center; justify-items: start; gap: 2.4cqmin; min-height: 0; }
.sign-emoji { font-size: 11cqmin; line-height: 1; }
.figma-mark { display: block; width: auto; height: 1em; }
/* On the sign it sits on a dark tile (like the Figma app icon), so every color shows on every theme */
.sign-emoji .figma-mark { box-sizing: content-box; height: 0.62em; padding: 0.19em 0.26em; border-radius: 0.22em; background: #1e1e1e; }
.dnd-presets .figma-mark { height: 15px; }
.sign-text {
  margin: 0;
  font: 700 calc(15cqmin * var(--fit, 1))/0.95 var(--f-display);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.sign-sub { margin: 0; font: 400 4.6cqmin/1.25 var(--f-body); color: var(--soft); }
.sign-foot span:last-child { font-variant-numeric: tabular-nums; color: var(--fg); }
.sign.no-timer .sign-foot { visibility: hidden; }
.sign-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 1.1cqmin; background: var(--track); }
.sign-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.sign[data-theme="ember"] .sign-bar i { background: rgb(255 255 255 / 0.9); }
.sign.no-bar .sign-bar { display: none; }
.sign.is-done .sign-text { animation: dndPop 0.7s var(--ease) both; }
@keyframes dndPop { from { transform: scale(0.92); opacity: 0; } }

/* Full screen */
.dnd-overlay { position: fixed; inset: 0; z-index: 150; background: #000; }
.dnd-overlay [data-live] { width: 100%; height: 100%; container-type: size; }
html.has-fig-cursor .dnd-overlay, html.has-fig-cursor .dnd-overlay * { cursor: auto !important; }
html.has-fig-cursor .dnd-overlay button { cursor: pointer !important; }
.dnd-overlay.is-idle, .dnd-overlay.is-idle * { cursor: none !important; }
html.dnd-on .fig-cursor { display: none; }
html.dnd-on body { overflow: hidden; }
.dnd-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: flex;
  gap: 6px;
  padding: 6px;
  transform: translateX(-50%);
  border-radius: 14px;
  background: rgb(20 20 22 / 0.85);
  border: 1px solid rgb(255 255 255 / 0.12);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.dnd-overlay.is-idle .dnd-controls { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.dnd-controls button { padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; color: #e6e6e9; font: 600 13px/1 var(--f-body); }
.dnd-controls button:hover { background: rgb(255 255 255 / 0.1); }
.dnd-controls kbd { margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: rgb(255 255 255 / 0.12); font: 400 11px/1 var(--f-mono); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.05);
  color: var(--text);
  font: 600 13px/1 var(--f-body);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: rgb(255 255 255 / 0.1); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.is-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 22px -10px var(--accent);
}
.btn.is-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.png-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px; margin-bottom: 8px; }
.png-row .select { min-height: 38px; }

/* ================= Toast ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.5);
  font: 500 13px/1.2 var(--f-body);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.toast.is-bad i { background: var(--bad); }

/* ================= Figma multiplayer cursor (desktop) ================= */
html.has-fig-cursor,
html.has-fig-cursor * { cursor: none !important; }
/* Text fields keep the real I-beam: you need it to place the caret */
html.has-fig-cursor .input,
html.has-fig-cursor .textarea { cursor: text !important; }

.fig-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 0.2s ease;
  will-change: transform;
}
html.has-fig-cursor .fig-cursor.is-visible { opacity: 1; }
html.has-fig-cursor .fig-cursor.is-text { opacity: 0; }
.fig-cursor svg {
  position: absolute;
  left: -4px;
  top: -3.5px;
  width: 24px;
  height: 24px;
  overflow: visible;
  transform-origin: 4px 3.5px;
  transition: transform 0.15s var(--ease);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.4));
}
.fig-cursor path {
  fill: var(--cursor-color);
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.fig-cursor-label {
  position: absolute;
  left: 15px;
  top: 17px;
  padding: 4px 8px;
  border-radius: 3px 10px 10px 10px;
  background: var(--cursor-color);
  color: #fff;
  font: 600 12px/1.25 var(--f-body);
  white-space: nowrap;
  box-shadow: 0 0 0 1.5px #fff, 0 2px 8px rgb(0 0 0 / 0.35);
  transition: transform 0.2s var(--ease);
}
.fig-cursor.is-action .fig-cursor-label { transform: scale(1.06); }
.fig-cursor.is-down svg { transform: scale(0.82); }

/* ================= Toolbar (Figma UI3) ================= */
.toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  transform: translateX(-50%);
  border-radius: 16px;
  background: rgb(30 30 33 / 0.8);
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow: 0 20px 40px -12px rgb(0 0 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  animation: toolbarIn 0.7s var(--ease) 0.4s both;
}
@keyframes toolbarIn {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toolbar a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: #c9c9cf;
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}
.toolbar a:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.toolbar a.is-active { background: var(--select); color: #fff; padding-right: 14px; }
.tb-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tb-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font: 600 13px/1 var(--f-body);
  white-space: nowrap;
}
.toolbar a.is-active .tb-label { max-width: 120px; opacity: 1; margin-left: 8px; }
.tb-sep {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgb(255 255 255 / 0.12);
}
.tb-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  padding: 6px 8px;
  border-radius: 6px;
  background: #1e1e1e;
  color: #fff;
  font: 500 11.5px/1 var(--f-body);
  white-space: nowrap;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.4);
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.toolbar a:hover .tb-tip,
.toolbar a:focus-visible .tb-tip { opacity: 1; transform: translate(-50%, 0); }
.toolbar a.is-active:hover .tb-tip { opacity: 0; }

/* ================= Export bar (same build as the portfolio's bottom nav) ================= */
/* Sticky to the bottom of the screen, centred in the tool area */
.export-bar {
  position: sticky;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: 20px auto 0;
  padding: 6px;
  border-radius: 16px;
  background: rgb(30 30 33 / 0.82);
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow: 0 20px 40px -12px rgb(0 0 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.xb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 13px 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c9c9cf;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.xb-btn b { font: 600 13px/1 var(--f-body); }
.xb-btn:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.xb-btn:active { transform: scale(0.97); }
.xb-btn.is-primary {
  padding-right: 16px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 22px -10px var(--accent);
}
.xb-btn.is-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.xb-btn:disabled { opacity: 0.4; pointer-events: none; }
.xb-btn:hover .tb-tip,
.xb-btn:focus-visible .tb-tip { opacity: 1; transform: translate(-50%, 0); }
.xb-select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  margin: 0 2px 0 4px;
  padding: 0 26px 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%239b9ba1' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 11px;
  color: #c9c9cf;
  font: 400 12px/1 var(--f-mono);
}
.xb-select:hover { border-color: var(--line-2); color: #fff; }
.xb-select option { background: #1b1b1e; }
/* Keep the bar within the canvas column: on mid widths the copy buttons go icon-only */
@container (max-width: 1300px) {
  .xb-btn[data-copy] { padding: 0 11px; }
  .xb-btn[data-copy] b { display: none; }
}

/* ================= App layout: sidebar + main ================= */
@view-transition { navigation: auto; }   /* page changes cross-fade; the sidebar stays put */

.layout {
  --sb-w: 268px;
  display: grid;
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  gap: 16px;
  min-height: 100dvh;
  padding: 12px;
  transition: grid-template-columns 0.35s var(--ease);
}
html.sb-mini .layout { --sb-w: 68px; }

.sidebar {
  position: sticky;
  top: 12px;
  height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  view-transition-name: sidebar;
}
.sb-svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 60px;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--line);
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}
.sb-brand img { flex: none; height: 24px; width: auto; }
.sb-brand .sb-name { font: 600 16px/1 var(--f-display); letter-spacing: -0.02em; }
.sb-toggle,
.sb-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.sb-toggle:hover,
.sb-close:hover { background: rgb(255 255 255 / 0.07); color: var(--text); }
.sb-close { display: none; }

.sb-nav {
  flex: 1;
  overflow: auto;
  padding: 10px 8px;
  scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar { display: none; }
.sb-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sb-group-title {
  height: 22px;
  padding: 0 10px;
  font: 500 10.5px/22px var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}

.sb-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-top: 2px;
  padding: 4px 8px 4px 5px;
  border-radius: 10px;
  color: #c9c9cf;
  font: 500 13.5px/1.2 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.sb-ic {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.sb-item:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.sb-item[aria-current="page"] {
  background: rgb(13 153 255 / 0.13);
  color: #fff;
}
.sb-item[aria-current="page"] .sb-ic {
  background: var(--select);
  border-color: var(--select);
  color: #fff;
}
/* Figma-style selection bar on the left edge */
.sb-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--select);
}
.sb-item.is-soon { color: var(--faint); }
.sb-item.is-soon .sb-ic { opacity: 0.6; }
.sb-badge {
  flex: none;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
  color: #ffab8a;
  font: 600 10px/1.1 var(--f-mono);
  letter-spacing: 0.02em;
}
.sb-badge.is-soon { background: rgb(255 255 255 / 0.07); box-shadow: none; color: var(--muted); font-weight: 500; }
.sb-ext { margin-left: auto; color: var(--faint); font-size: 12px; }

.sb-foot {
  padding: 10px 8px 10px;
  border-top: 1px solid var(--line);
}
.sb-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 2px 8px;
  padding: 10px 10px;
  border-radius: 10px;
  background: rgb(74 222 128 / 0.07);
  border: 1px solid rgb(74 222 128 / 0.16);
  font: 500 12px/1.4 var(--f-body);
  color: #bdf5cf;
}
.sb-note .sb-svg { flex: none; width: 15px; height: 15px; margin-top: 1px; stroke: var(--ok); stroke-width: 2; }
.sb-note .sb-name { white-space: normal; }

/* Collapsed: icons only (names show in the multiplayer cursor tag) */
html.sb-mini .sb-head { padding: 0; justify-content: center; }
html.sb-mini .sb-brand { display: none; }
html.sb-mini .sb-item { justify-content: center; padding: 4px; gap: 0; }
html.sb-mini .sb-item .sb-name,
html.sb-mini .sb-badge,
html.sb-mini .sb-ext { display: none; }
html.sb-mini .sb-group-title span { visibility: hidden; }
html.sb-mini .sb-group-title { height: 6px; }
html.sb-mini .sb-note { justify-content: center; padding: 9px 0; }
html.sb-mini .sb-note .sb-name { display: none; }
html.sb-mini .sb-item:has(.sb-badge:not(.is-soon)) .sb-ic::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--card);
}

/* Main column */
.main {
  min-width: 0;
  container-type: inline-size;
  padding: 0 clamp(0px, 1vw, 12px) 40px;
}
.main-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 10px 0 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.015)), var(--card);
  border: 1px solid var(--line);
}
.menu-btn {
  display: none;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  border: 0;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.05);
  color: var(--text);
}
.menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sb-backdrop { display: none; }

/* ================= Responsive ================= */
/* The tool area responds to its own width (the sidebar takes part of the screen) */
@container (max-width: 1080px) {
  .app { grid-template-columns: 268px minmax(0, 1fr) 268px; gap: 12px; }
}
@container (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage { grid-column: 1 / -1; order: -1; }
  .panel { position: static; max-height: none; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 640px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .stage { order: 0; }   /* phone: content → preview → design */
  .tools { grid-template-columns: minmax(0, 1fr); }
  .canvas { min-height: 0; padding: 56px 16px 52px; }
  .qr-frame { width: min(70vw, 300px); }
  .checks li { grid-template-columns: 22px minmax(0, 1fr); }
  .checks li .v { grid-column: 2; }
  .tool-hero { padding-top: 28px; }
  /* Export bar on a phone: copy buttons become icons */
  .export-bar { bottom: 12px; }
  .export-bar { padding: 5px; }
  .export-bar .tb-sep { margin: 0 2px; }
  .xb-btn { gap: 6px; padding: 0 9px; }
  .xb-btn.is-primary { padding: 0 12px 0 10px; }
  .xb-btn[data-copy] b { display: none; }
  .xb-select { margin: 0 2px; padding: 0 20px 0 8px; background-position: right 6px center; }
  .export-bar .tb-tip { display: none; }   /* no hover on phones; off-screen tips would widen the page */
}
@media (hover: none) {
  .tb-tip { display: none; }
}

/* Phone / small tablet: the sidebar becomes a drawer */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  html.sb-mini .layout { --sb-w: 268px; }
  .main { padding: 0; }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed;
    left: 10px;
    top: 10px;
    bottom: 10px;
    z-index: 80;
    width: min(300px, calc(100vw - 48px));
    height: auto;
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.35s var(--ease);
    box-shadow: 0 30px 60px rgb(0 0 0 / 0.6);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.015)), #121214;
  }
  html.sb-open .sidebar { transform: none; }
  .sb-toggle { display: none; }
  .sb-close { display: grid; }
  html.sb-mini .sb-brand { display: flex; }
  html.sb-mini .sb-head { padding: 0 10px 0 16px; justify-content: space-between; }
  html.sb-mini .sb-item { justify-content: flex-start; padding: 4px 8px 4px 5px; gap: 10px; }
  html.sb-mini .sb-item .sb-name,
  html.sb-mini .sb-badge,
  html.sb-mini .sb-ext,
  html.sb-mini .sb-note .sb-name { display: initial; }
  html.sb-mini .sb-group-title { height: 22px; }
  html.sb-mini .sb-group-title span { visibility: visible; }
  .sb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 79;
    background: rgb(0 0 0 / 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  html.sb-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  .main-top { padding: 0 8px 0 14px; }
  .top-link { padding: 8px 10px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ================= Phones & touch: lighter effects =================
   Huge blurs, a full-screen mask and backdrop blur are costly on phone GPUs
   and made scrolling stutter. On touch they add nothing (no mouse to follow). */
@media (hover: none), (max-width: 860px) {
  body::before { -webkit-mask-image: none; mask-image: none; }
  .glow span { filter: none; }
  .export-bar,
  .toolbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgb(30 30 33 / 0.96);
  }
}

/* iOS zooms into any field under 16px when you tap it (and the page then
   scrolls sideways). On touch screens every field is 16px. */
@media (hover: none), (max-width: 860px) {
  .input,
  .select,
  .textarea,
  .xb-select,
  .color .input,
  .checks .v .select { font-size: 16px; }
  .xb-select { font-family: var(--f-body); letter-spacing: -0.02em; padding: 0 18px 0 7px; background-position: right 5px center; }
}
