/* Live preview of the Unisson Studio editor (studio-editeur.html): the .stage-bar, .aa, .seg, .frame.glow, .screen and
   .cap-note rules of the model, selectors moved into the shadow tree. The page's colours come from the --pack-* tokens;
   the screen's from the instance sheet (--pv-*), mapped here onto the --bythium-* tokens that the slotted sample and
   the catalog's components read, so the recolouring never leaves the screen. */
:host {
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: block;
  min-inline-size: 0;
  color: var(--pack-ink);
  font: 16px / 1.6 var(--sans);
  font-feature-settings: normal;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
:host([hidden]) {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
h2,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--pack-focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-block-end: 12px;
}
[part="heading"] {
  margin-inline-end: auto;
  font: 800 20px / 1.2 var(--sans);
  letter-spacing: -0.02em;
  scroll-margin-block-start: 96px;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.aa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 28px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--pack-c3);
  color: var(--pack-ink);
  font: 600 12px var(--mono);
}
.aa b {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--pack-c3);
  box-shadow: 0 0 10px var(--pack-c3);
}
/* The warning pink of the docs callout: c4 in dark, c4 a step darker in light. */
.aa.bad {
  --warn: light-dark(oklch(from var(--pack-c4) calc(l - 0.0717) calc(c - 0.0186) calc(h + 2.455)), var(--pack-c4));
  border: 1px dashed var(--warn);
}
.aa.bad b {
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
}
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--pack-line2);
  border-radius: 12px;
  background: var(--pack-panel2);
}
.seg label {
  position: relative;
  display: block;
  flex: 1;
  min-inline-size: 0;
  font-size: 16px;
}
.seg input {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg span {
  display: grid;
  place-items: center;
  min-block-size: 32px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--pack-mut);
  font: 600 12.5px var(--mono);
  white-space: nowrap;
}
.seg label:hover span {
  color: var(--pack-ink);
}
.seg input:checked + span {
  color: var(--pack-btnink);
  background: linear-gradient(in srgb 120deg, var(--pack-btn1), var(--pack-btn2));
  box-shadow: 0 0 18px -2px var(--pack-a2);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--pack-focus);
  outline-offset: 2px;
}

/* .frame.glow: the panel with its violet glow, hairline border, shadow and gradient ring. */
.frame {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: radial-gradient(ellipse at 80% 0%, var(--pack-a2), transparent 60%), var(--pack-panel);
  border: 1px solid var(--pack-line);
  box-shadow: var(--pack-shadow);
}
.frame::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--pack-c1), transparent 35%, transparent 65%, var(--pack-c2));
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(var(--pack-ink) 0 0) content-box,
    linear-gradient(var(--pack-ink) 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(var(--pack-ink) 0 0) content-box exclude,
    linear-gradient(var(--pack-ink) 0 0);
}

/* .screen: the previewed product. Its tokens are the editor's, never the page's. */
.screen {
  --bythium-brand-primary: var(--pv-accent);
  --bythium-brand-primary-hover: var(--pv-accent);
  --bythium-brand-primary-text: var(--pv-accent);
  --bythium-on-brand-primary: var(--pv-on);
  --bythium-link: var(--pv-accent);
  --bythium-surface-page: var(--pv-bg);
  --bythium-surface-base: var(--pv-bg);
  --bythium-surface-card: var(--pv-surface);
  --bythium-surface-raised: var(--pv-surface);
  --bythium-surface-overlay: var(--pv-surface);
  --bythium-border-subtle: var(--pv-border);
  --bythium-border-strong: var(--pv-muted);
  --bythium-text-primary: var(--pv-text);
  --bythium-text-secondary: var(--pv-muted);
  --bythium-text-muted: var(--pv-muted);
  --bythium-radius: var(--pv-radius);
  --bythium-density: var(--pv-density);
  --bythium-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  position: relative;
  container-type: inline-size;
  inline-size: 100%;
  max-inline-size: 100%;
  margin-inline: auto;
  overflow: hidden;
  color-scheme: dark;
  color: var(--pv-text);
  font: 13.5px / 1.45 var(--bythium-font);
  background: var(--pv-bg);
  border: 1px solid var(--pv-border);
  border-radius: calc(var(--pv-radius) + 6px);
  box-shadow: 0 0 70px -24px var(--pv-accent);
}
.screen[data-theme="light"] {
  color-scheme: light;
}
.screen[data-font="humanist"] {
  --bythium-font: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", sans-serif;
}
.screen[data-font="serif"] {
  --bythium-font: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
}
.screen[data-font="mono"] {
  --bythium-font: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
.frame.mob .screen {
  max-inline-size: 390px;
}
/* A catalog tag slotted directly and left out of the pack stays in place, greyed and outlined. */
::slotted([data-off]) {
  opacity: 0.3;
  filter: grayscale(1);
  outline: 1px dashed var(--pv-muted);
  outline-offset: 2px;
}
.cap-note {
  margin-block-start: 10px;
  color: var(--pack-mut);
  font: 500 12.5px / 1.5 var(--mono);
}
@media (max-width: 700px) {
  .frame {
    padding: 8px;
    border-radius: 16px;
  }
  .stage-bar fieldset {
    flex: 1 1 auto;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .screen {
    transition: max-inline-size 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}
@media (forced-colors: active) {
  .frame,
  .seg,
  .aa {
    border-color: CanvasText;
  }
  .frame::after {
    display: none;
  }
  .seg input:checked + span {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}
