/* Design Lab by Beyond Digital Labs: the shared design system for every page.
   Tokens live on :root and resolve for light and dark through light-dark(); the theme
   follows the system unless the visitor picks one (data-theme on <html>, see theme.js).
   Beyond interface rules: text actions are shadowed pills, icon-only actions are circles,
   and there are no rectangular brick controls. */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-roman.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Ground and surfaces: warm lab paper by day, graphite by night. */
  --ground: light-dark(#f2efe7, #0f0f11);
  --ground-2: light-dark(#e8e4d9, #16161a);
  --surface: light-dark(#fbfaf6, #19191d);
  --surface-2: light-dark(#ffffff, #222227);
  --surface-sunken: light-dark(#ece8de, #121215);
  --ink: light-dark(#141416, #f3f0e8);
  --ink-2: light-dark(#45433d, #cdc9bf);
  --ink-3: light-dark(#666259, #9d998f);
  --line: light-dark(rgba(20, 20, 22, 0.12), rgba(243, 240, 232, 0.12));
  --line-2: light-dark(rgba(20, 20, 22, 0.24), rgba(243, 240, 232, 0.26));

  /* Beyond Digital Labs gold: text-safe in both themes; fills use the badge tan. */
  --accent: light-dark(#7a6440, #d9b893);
  --accent-fill: #d3ae89;
  --accent-fill-2: #a98e5d;
  --accent-ink: #141416;

  --focus: light-dark(#1f4fd1, #9dbbff);
  --focus-halo: light-dark(rgba(31, 79, 209, 0.22), rgba(157, 187, 255, 0.28));

  --danger: light-dark(#a4231a, #ff9b91);
  --danger-surface: light-dark(#fbe9e6, #3a1714);
  --success: light-dark(#17643f, #86e0b0);
  --success-surface: light-dark(#e3f2e9, #10291d);
  --warning: light-dark(#734d00, #f5c66b);
  --warning-surface: light-dark(#fcf0d4, #33260a);
  --info: light-dark(#244e8f, #a9c4ff);
  --info-surface: light-dark(#e7eefa, #142035);

  --shadow-color: light-dark(rgba(36, 30, 20, 0.2), rgba(0, 0, 0, 0.6));
  --shadow-soft: light-dark(rgba(36, 30, 20, 0.08), rgba(0, 0, 0, 0.35));
  --pill-highlight: light-dark(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08));
  --shadow-pill: inset 0 1px 0 var(--pill-highlight), 0 1px 2px var(--shadow-soft), 0 8px 18px -8px var(--shadow-color);
  --shadow-pill-hover: inset 0 1px 0 var(--pill-highlight), 0 2px 4px var(--shadow-soft), 0 14px 26px -10px var(--shadow-color);
  --shadow-panel: 0 1px 0 var(--pill-highlight) inset, 0 30px 70px -40px var(--shadow-color), 0 2px 8px -2px var(--shadow-soft);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;

  --step-hero: clamp(3.4rem, 7.6vw + 1rem, 9rem);
  --step-1: clamp(2.3rem, 3.4vw + 1.1rem, 4.4rem);
  --step-2: clamp(1.7rem, 1.4vw + 1.15rem, 2.6rem);
  --step-3: clamp(1.25rem, 0.5vw + 1.05rem, 1.5rem);

  --gutter: clamp(16px, 4vw, 44px);
  --wrap: 1320px;
  --radius-panel: 30px;
  --radius-card: 24px;
  --radius-soft: 16px;
  --header-height: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Non-color theme values (light-dark() takes colors only); dark values below. */
  --grain-opacity: 0.55;
  --grain-blend: multiply;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grain-opacity: 0.32;
    --grain-blend: screen;
  }
}

:root[data-theme="dark"] {
  --grain-opacity: 0.32;
  --grain-blend: screen;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Paper grain under the page content: one tiled SVG, rasterized once by the browser. It
   sits behind every element (z-index -1 in the root stacking context) and above the page
   ground, so it never dims live canvases or dialogs. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../img/grain.svg");
  background-size: 240px 240px;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
}

img,
svg,
canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 420;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

::selection { background: color-mix(in srgb, var(--accent-fill) 55%, transparent); color: var(--ink); }

[hidden] { display: none !important; }

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

.wrap {
  width: min(var(--wrap), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.stack { display: grid; gap: var(--stack-gap, 16px); align-content: start; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, 12px); }

/* Specimen labels: the lab's mono captions (plate numbers, states, metadata). */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.eyebrow--plain::before { display: none; }

.display-italic { font-style: italic; font-weight: 340; }
.lede { font-size: clamp(1.05rem, 0.3vw + 1rem, 1.25rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: 0.02em; }

/* ----- Icons ----- */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----- Pill buttons (text actions) ----- */
.pill {
  --pill-bg: var(--surface-2);
  --pill-ink: var(--ink);
  --pill-border: var(--line-2);
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-pill-hover); text-decoration: none; }
.pill:active { transform: translateY(1px) scale(0.985); box-shadow: var(--shadow-pill); }
.pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 999px; }

.pill--primary {
  --pill-bg: var(--ink);
  --pill-ink: var(--ground);
  --pill-border: transparent;
}

.pill--accent {
  --pill-bg: linear-gradient(135deg, #ecd2ad 0%, var(--accent-fill) 48%, var(--accent-fill-2) 100%);
  --pill-ink: var(--accent-ink);
  --pill-border: rgba(122, 100, 64, 0.35);
  background: var(--pill-bg);
}

.pill--ghost {
  --pill-bg: transparent;
  --pill-border: var(--line-2);
  box-shadow: inset 0 1px 0 var(--pill-highlight), 0 6px 14px -10px var(--shadow-color);
}

.pill--ghost:hover { --pill-bg: color-mix(in srgb, var(--surface-2) 70%, transparent); }

.pill--danger {
  --pill-bg: var(--danger);
  --pill-ink: light-dark(#ffffff, #1a0907);
  --pill-border: transparent;
}

.pill--sm { min-height: 40px; padding: 0 18px; font-size: 0.88rem; }
.pill--lg { min-height: 56px; padding: 0 30px; font-size: 1.02rem; }
.pill--block { width: 100%; }

.pill[disabled],
.pill[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.pill .icon { width: 18px; height: 18px; }

.pill[aria-busy="true"] { color: transparent; pointer-events: none; }
.pill[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--pill-ink);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* ----- Circle buttons (icon-only actions) ----- */
.orb {
  appearance: none;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.orb:hover { transform: translateY(-1px); box-shadow: var(--shadow-pill-hover); }
.orb:active { transform: scale(0.94); }
.orb:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 50%; }
.orb--sm { width: 36px; height: 36px; }
.orb--sm .icon { width: 17px; height: 17px; }
.orb--flat { box-shadow: none; border-color: transparent; background: transparent; }
.orb--flat:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Forms ----- */
.form { display: grid; gap: 20px; }

.field { display: grid; gap: 8px; }

.field__label {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}

.field__label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__label-row a { font-size: 0.86rem; color: var(--ink-2); }

.field__hint { font-size: 0.85rem; color: var(--ink-3); }

.field__error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--danger);
}

.field__error .icon { width: 17px; height: 17px; margin-top: 1px; }

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px var(--shadow-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder { color: var(--ink-3); opacity: 0.8; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--focus-halo); border-radius: 999px; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 25%, transparent); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }

select.input {
  appearance: none;
  padding-right: 48px;
  background-image: url("../img/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px 16px;
  cursor: pointer;
}

.password { position: relative; }
.password .input { padding-right: 62px; }

.password__toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  translate: 0 -50%;
}

.password__toggle:hover { transform: none; }
.password__toggle:active { transform: scale(0.94); }

.strength { display: grid; gap: 8px; }

.strength__meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.strength__meter span {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.3s;
}

.strength[data-level="1"] .strength__meter span:nth-child(-n + 1) { background: var(--danger); }
.strength[data-level="2"] .strength__meter span:nth-child(-n + 2) { background: #d9822b; }
.strength[data-level="3"] .strength__meter span:nth-child(-n + 3) { background: #6aa84f; }
.strength[data-level="4"] .strength__meter span { background: var(--success); }

.strength__label { font-size: 0.85rem; font-weight: 650; color: var(--ink-2); }

.strength__rules {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--ink-3);
}

.strength__rules li { display: flex; gap: 8px; align-items: center; }
.strength__rules li .icon { width: 16px; height: 16px; }
.strength__rules li[data-met="true"] { color: var(--success); }
.strength__rules li[data-met="false"] .icon-check { display: none; }
.strength__rules li[data-met="true"] .icon-dot { display: none; }

/* ----- Notices (status, errors, confirmations) ----- */
.notice {
  --notice-ink: var(--info);
  --notice-bg: var(--info-surface);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: start;
  padding: 16px 20px;
  border-radius: 22px;
  background: var(--notice-bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--notice-ink) 22%, transparent);
}

.notice > .icon { color: var(--notice-ink); margin-top: 2px; grid-row: span 3; }
.notice__title { font-weight: 750; color: var(--notice-ink); }
.notice__body { color: var(--ink-2); font-size: 0.94rem; }
.notice__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.notice--success { --notice-ink: var(--success); --notice-bg: var(--success-surface); }
.notice--warning { --notice-ink: var(--warning); --notice-bg: var(--warning-surface); }
.notice--danger { --notice-ink: var(--danger); --notice-bg: var(--danger-surface); }
.notice:focus { outline: none; }
.notice:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor;
  animation: spin 0.9s linear infinite;
}

/* ----- Header and footer chrome ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__end { display: flex; align-items: center; gap: 10px; }
.company-links { display: flex; align-items: center; gap: 18px; }
.company-link { width: 60px; height: 60px; display: block; border-radius: 50%; transform: perspective(400px) rotateY(var(--logo-turn, 0deg)) rotateX(var(--logo-lift, 0deg)); transition: transform 0.25s, filter 0.25s; }
.company-link:hover, .company-link:focus-visible { filter: drop-shadow(0 0 10px #c8b37e77); }
.company-link img { width: 100%; height: 100%; object-fit: contain; animation: company-logo-breathe 6s ease-in-out infinite alternate; }
.company-link:nth-child(2) img { animation-delay: -3s; }
@keyframes company-logo-breathe { to { transform: translateY(-2px) rotate(-5deg) scale(1.03); } }
@media (max-width: 700px) {
  :root { --header-height: 120px; }
  .topbar { height: 120px; }
  .topbar__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; }
  .company-links { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 22px; }
  .company-link { width: 42px; height: 42px; }
  .topbar__end { grid-column: 2; grid-row: 1; }
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  min-width: 0;
}

.lockup:hover { text-decoration: none; }
.lockup__mark { width: 40px; height: 40px; flex: none; transition: transform 0.6s var(--ease-spring); }
.lockup:hover .lockup__mark { transform: rotate(-12deg) scale(1.06); }
.lockup__text { display: grid; line-height: 1; min-width: 0; }
.lockup__name { font-family: var(--font-display); font-size: 1.32rem; font-weight: 480; letter-spacing: -0.01em; white-space: nowrap; }
.lockup__name em { font-weight: 360; }
.lockup__by { margin-top: 4px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }

.foot {
  margin-top: 96px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.9rem;
}

.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; align-items: center; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot__links a { color: var(--ink-2); }

/* ----- Menus (user menu, brand switcher) ----- */
.menu-host { position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 260px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 8px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
  transform-origin: top right;
  animation: menu-in 0.22s var(--ease-out);
}

.menu--start { right: auto; left: 0; transform-origin: top left; }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.menu__head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu__name { font-weight: 750; overflow-wrap: anywhere; }
.menu__email { font-size: 0.86rem; color: var(--ink-3); overflow-wrap: anywhere; }

.menu__item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu__item:hover,
.menu__item:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); text-decoration: none; outline: none; }
.menu__item[aria-current="page"] { background: color-mix(in srgb, var(--accent-fill) 22%, transparent); }
.menu__item .icon { color: var(--ink-3); }
.menu__sep { height: 1px; margin: 6px 8px; background: var(--line); }
.menu__label { padding: 8px 14px 4px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: linear-gradient(140deg, #ecd2ad, var(--accent-fill) 55%, var(--accent-fill-2));
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  padding: 0;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.avatar:hover { transform: translateY(-1px); box-shadow: var(--shadow-pill-hover); }
.avatar:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 50%; }

/* ----- Dialog sheets ----- */
.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-panel);
}

.sheet::backdrop { background: rgba(10, 10, 12, 0.48); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet__inner { display: grid; gap: 20px; padding: 28px; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sheet__title { font-size: var(--step-3); }
.sheet__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* ----- Framed windows with registration marks (the lab's specimen frames) ----- */
.frame {
  position: relative;
  border-radius: var(--radius-panel);
  isolation: isolate;
}

.reg-marks {
  position: absolute;
  inset: -16px;
  pointer-events: none;
}

.reg-marks span {
  position: absolute;
  width: 13px;
  height: 13px;
  color: var(--ink-3);
}

.reg-marks span::before,
.reg-marks span::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.reg-marks span::before { left: 6px; top: 0; width: 1px; height: 13px; }
.reg-marks span::after { top: 6px; left: 0; height: 1px; width: 13px; }
.reg-marks span:nth-child(1) { left: 0; top: 0; }
.reg-marks span:nth-child(2) { right: 0; top: 0; }
.reg-marks span:nth-child(3) { left: 0; bottom: 0; }
.reg-marks span:nth-child(4) { right: 0; bottom: 0; }

/* ----- Panels and tags ----- */
.panel {
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.tag--accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.tag--warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--warning); background: var(--warning-surface); }
.tag--success { border-color: color-mix(in srgb, var(--success) 45%, transparent); color: var(--success); background: var(--success-surface); }
.tag--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); background: var(--danger-surface); }

/* ----- Segmented controls (pill groups) ----- */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
}

.segmented button,
.segmented a {
  appearance: none;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.segmented [aria-selected="true"],
.segmented [aria-pressed="true"],
.segmented [aria-current="true"] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}

.segmented :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 999px; }

/* ----- Design Lab components inside product pages ----- */
/* The runtime's showcase and background controls take this theme and follow the Beyond
   interface rules here: icon buttons are circles, switches and chips are shadowed pills.
   The runtime can inject its stylesheet after this one; host specificity keeps its
   dark defaults from overriding the product's current light or dark theme. */
body .dl-showcase,
body .dl-bg-controls {
  --dl-surface: var(--surface-2);
  --dl-surface-strong: var(--surface-2);
  --dl-line: var(--line-2);
  --dl-text: var(--ink);
  --dl-muted: var(--ink-3);
  --dl-label: var(--accent);
  font-family: var(--font-text);
}

.dl-showcase .dl-icon-button {
  border-radius: 50%;
  box-shadow: var(--shadow-pill);
}

.dl-showcase .dl-icon-button:hover { box-shadow: var(--shadow-pill-hover); }
.dl-showcase .dl-icon-button:focus-visible { border-radius: 50%; }

.dl-showcase .dl-toggle {
  border-radius: 999px;
  padding: 0 18px 0 12px;
  box-shadow: var(--shadow-pill);
}

.dl-showcase .dl-toggle:focus-visible { border-radius: 999px; }

.dl-showcase .dl-stage { box-shadow: var(--shadow-panel), inset 0 0 0 1px var(--line); }
.dl-showcase .dl-variant { border-radius: 18px; }
.dl-showcase .dl-variant-number { font-family: var(--font-mono); color: var(--dl-label); }
.dl-showcase .dl-variant-tech { color: var(--dl-muted); opacity: 1; }
.dl-showcase .dl-info { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-panel); }
.dl-showcase .dl-info-title { font-family: var(--font-display); font-weight: 450; }
.dl-showcase .dl-info-list dt { font-family: var(--font-mono); color: var(--dl-label); }
.dl-showcase .dl-range { font-family: var(--font-mono); }
.dl-showcase .dl-tab[aria-selected="true"] { color: var(--ink); background: var(--surface-2); }
.dl-showcase .dl-toggle-track { background: var(--line-2); }
.dl-showcase .dl-icon-button:focus-visible,
.dl-showcase .dl-toggle:focus-visible,
.dl-showcase .dl-tab:focus-visible,
.dl-showcase .dl-variant:focus-visible,
.dl-showcase .dl-range-input:focus-visible { outline-color: var(--focus); }
.dl-showcase .dl-stage:not([data-tone="light"]):not([data-state="error"]) .dl-stage-status { color: rgba(243, 241, 236, 0.8); }

.dl-bg-controls .dl-bg-chip,
.dl-bg-controls .dl-bg-palette {
  box-shadow: var(--shadow-pill);
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}

.dl-bg-controls .dl-bg-chip:hover { color: var(--ink); border-color: var(--ink-3); }

.dl-bg-controls .dl-bg-chip[aria-pressed="true"],
.dl-bg-controls .dl-bg-palette[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
  border-color: transparent;
}

.dl-bg-controls .dl-bg-palettes { background: var(--surface-sunken); border-color: var(--line); gap: 4px; }
.dl-bg-controls .dl-bg-intensity { color: var(--ink-3); font-family: var(--font-mono); }
.dl-bg-controls .dl-bg-description { color: var(--ink-2); }

/* ----- Toasts ----- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  grid-template-columns: auto 1fr auto;
  box-shadow: var(--shadow-panel);
  animation: menu-in 0.25s var(--ease-out);
}

.toast > .icon { grid-row: span 2; }
.toast__close { grid-column: 3; grid-row: 1 / span 2; align-self: start; margin: -6px -10px 0 0; }

/* ----- Live brand art (cards, previews) ----- */
.brand-art {
  --gx: 50%;
  --gy: 42%;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: 900px;
  background:
    radial-gradient(circle at var(--gx) var(--gy), color-mix(in srgb, var(--art-glow) 34%, transparent) 0%, transparent 56%),
    radial-gradient(120% 95% at 50% 28%, var(--art-paper) 0%, color-mix(in srgb, var(--art-paper) 82%, var(--art-accent)) 100%);
}

.brand-art__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 40% at var(--gx) var(--gy), color-mix(in srgb, var(--art-glow) 40%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.brand-art[data-hover] .brand-art__glow { opacity: 1; }

.brand-art__tilt {
  --rx: 0deg;
  --ry: 0deg;
  position: absolute;
  inset: 10%;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--art-scale, 1));
  transition: transform 0.6s var(--ease-out);
  animation: art-float 6.5s ease-in-out infinite;
}

.brand-art[data-hover] .brand-art__tilt { --art-scale: 1.05; transition-duration: 0.25s; }

.brand-art__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.22));
}

.brand-art__mark {
  animation: art-breathe 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.brand-art[data-hover] .brand-art__mark { filter: brightness(1.12) saturate(1.1); }
.brand-art[data-paused="true"] .brand-art__tilt,
.brand-art[data-paused="true"] .brand-art__mark { animation-play-state: paused; }

@keyframes art-float {
  0%, 100% { translate: 0 -1.6%; }
  50% { translate: 0 1.6%; }
}

@keyframes art-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.035; }
}

/* ----- Motion preferences ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 600px) {
  :root { --header-height: 120px; }
  .lockup__mark { width: 36px; height: 36px; }
  .lockup__name { font-size: 1.16rem; }
  .pill { padding: 0 20px; }
  .sheet__inner { padding: 22px; }
}
