@font-face {
  font-family: "LF Lab Atkinson";
  src: url('/assets/mineral/atkinson-hyperlegible-next-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --lab-shell-bg: #141417;
  --lab-shell-line: rgba(255, 255, 255, 0.14);
  --lab-shell-ink: #f6f3ec;
  --lab-shell-muted: #c1c1cb;
  --lab-shell-signal: #ff7839;
  --lab-shell-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Space the fixed Lab chrome occupies. Declared here, in a stylesheet each
     concept links from its head, so a scene can reserve room at first paint.
     The disclosure value is its resting height: it never changes, so nothing
     that depends on it moves when the notice shrinks. */
  --lab-shell-clearance: calc(max(14px, env(safe-area-inset-bottom)) + 70px);
  --lab-disclosure-clearance: calc(max(14px, env(safe-area-inset-top)) + 58px);
  --lab-disclosure-offset: 0px;
  --lab-hint-lift: 0px;
}

/* The maker's signature in a concept footer follows the Lab's 16px floor. */
html .lfc-embed {
  --lfc-size: 16px;
}

.lab-concept-shell,
.lab-concept-shell *,
.lab-concept-hint,
.lab-concept-status {
  box-sizing: border-box;
}

.lab-build-disclosure,
.lab-concept-status {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 2147482998;
  box-sizing: border-box;
  max-width: min(42rem, calc(100vw - 28px));
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--lab-shell-line);
  border-radius: 12px;
  background: var(--lab-shell-bg);
  color: var(--lab-shell-ink);
  font: 600 16px/1.35 "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
}

/* Enhanced notice: the full wording opens the page, then rests as a labelled
   control that reopens it. The wording never leaves the accessibility tree. */
.lab-build-disclosure.is-enhanced,
.lab-concept-status.is-enhanced {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0 4px;
  padding: 0 14px 0 0;
}

.lab-disclosure__toggle {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  font: 700 16px/1 "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lab-disclosure__toggle svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--lab-shell-signal);
}

.lab-disclosure__toggle:focus-visible {
  outline: 3px solid var(--lab-shell-signal);
  outline-offset: 2px;
}

.lab-disclosure__label {
  display: none;
}

.lab-disclosure__text {
  padding: 11px 0;
}

.is-enhanced.is-compact {
  padding-right: 0;
}

.is-compact > .lab-disclosure__toggle {
  padding-right: 14px;
}

.is-compact > .lab-disclosure__toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.is-compact .lab-disclosure__label {
  display: inline;
}

.is-compact > .lab-disclosure__text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lab-concept-shell {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  width: auto;
  max-width: 920px;
  margin-inline: auto;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px;
  border: 1px solid var(--lab-shell-line);
  border-radius: 999px;
  background: var(--lab-shell-bg);
  color: var(--lab-shell-ink);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.44);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-family: "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
}

.lab-concept-shell a,
.lab-concept-shell button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: inherit;
  font: 700 16px/1 "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  /* The shell is injected after page load. Transitioning its colors from the
     inherited defaults creates low-contrast intermediate frames, so only the
     physical press response animates. */
  transition: transform 180ms var(--lab-shell-ease);
}

.lab-concept-shell a:hover,
.lab-concept-shell button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lab-concept-shell a:active,
.lab-concept-shell button:active {
  transform: scale(0.96);
}

.lab-concept-shell a:focus-visible,
.lab-concept-shell button:focus-visible {
  outline: 3px solid var(--lab-shell-signal);
  outline-offset: 2px;
}

.lab-concept-shell__back {
  padding: 0 17px;
  background: var(--lab-shell-signal);
  color: #111217 !important;
  font-family: "LF Lab Atkinson", ui-sans-serif, sans-serif !important;
  font-size: 16px !important;
  letter-spacing: 0;
}

.lab-concept-shell__back:hover {
  background: #ff8533 !important;
}

.lab-concept-shell__identity {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.lab-concept-shell__identity strong,
.lab-concept-shell__identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-concept-shell__identity strong {
  font: 700 17px/1.15 "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.lab-concept-shell__identity span {
  color: var(--lab-shell-muted);
  font-size: 16px;
}

.lab-concept-shell__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lab-concept-shell__replay {
  padding: 0 15px;
  background: transparent;
  cursor: pointer;
}

.lab-concept-shell__build {
  padding: 0 16px;
  border: 1px solid rgba(96, 165, 250, 0.55) !important;
  color: #bfdbfe !important;
  background: rgba(59, 130, 246, 0.1);
}

.lab-concept-shell__build:hover,
.lab-concept-shell__build:focus-visible {
  border-color: rgba(249, 115, 22, 0.72) !important;
  color: var(--lab-shell-ink) !important;
  background: rgba(249, 115, 22, 0.12) !important;
}

.lab-concept-shell__nav {
  width: 44px;
  padding: 0;
  font-size: 26px !important;
}

.lab-concept-hint {
  position: fixed;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(var(--lab-shell-clearance) + 4px + var(--lab-hint-lift));
  z-index: 2147482999;
  width: auto;
  max-width: 640px;
  margin: 0 auto;
  padding: 13px 17px;
  border: 1px solid var(--lab-shell-line);
  border-radius: 16px;
  background: var(--lab-shell-bg);
  color: var(--lab-shell-ink);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font: 600 16px/1.35 "LF Lab Atkinson", ui-sans-serif, system-ui, sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  /* Keep the text either fully opaque or fully hidden. Fading live text
     through partial opacity creates a brief low-contrast state. */
  transition: transform 320ms var(--lab-shell-ease);
}

.lab-concept-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html.lab-concept-page body {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

html.lab-concept-embed .lab-concept-shell,
html.lab-concept-embed .lab-concept-hint,
html.lab-concept-embed .lab-concept-status {
  display: none !important;
}

html.lab-concept-embed body {
  padding-bottom: 0;
}

/* The embedded app owns this exit, so it stays reachable while its scene
   scrolls or captures gestures. The reader's separate X remains available. */
.lab-embed-exit {
  position: fixed;
  z-index: 2147483001;
  top: max(6px, env(safe-area-inset-top));
  left: max(6px, env(safe-area-inset-left));
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: calc(100% - 12px);
  padding: 8px 14px;
  border: 1px solid #ff7839;
  border-radius: 999px;
  background: #141417;
  color: #f6f3ec;
  font: 600 16px/1.2 "LF Lab Atkinson", system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.lab-embed-exit:hover { background: #2a2523; }
.lab-embed-exit:focus-visible { outline: 3px solid #f6f3ec; outline-offset: 2px; }
.lab-embed-exit:active { background: #3a2b23; }

html[data-lab-concept="cabinet-concept"] .lab-embed-exit,
html[data-lab-concept="house-explorer"] .lab-embed-exit {
  left: auto;
  right: max(8px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 28px;
}

@media (max-width: 620px) {
  .lab-concept-shell {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    min-height: 58px;
    gap: 8px;
    padding: 7px;
  }

  .lab-concept-shell__back {
    padding-inline: 13px;
  }

  .lab-concept-shell__identity span {
    display: none;
  }

  .lab-concept-shell__identity strong {
    font-size: 16px;
  }

  .lab-concept-shell__replay {
    display: none !important;
  }

  .lab-concept-shell__build {
    min-height: 44px !important;
    padding-inline: 12px;
    font-size: 16px !important;
  }

  .lab-concept-shell__actions {
    gap: 0;
  }

  .lab-concept-shell__nav {
    width: 44px;
    min-height: 44px !important;
  }

  :root {
    --lab-shell-clearance: calc(max(8px, env(safe-area-inset-bottom)) + 66px);
    --lab-disclosure-clearance: calc(max(8px, env(safe-area-inset-top)) + 56px);
  }

  .lab-concept-status,
  .lab-build-disclosure {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    max-width: min(31rem, calc(100vw - 16px));
  }
}

@media (max-width: 390px) {
  .lab-concept-shell__identity {
    display: none;
  }

  .lab-concept-shell {
    grid-template-columns: 1fr auto;
  }

  .lab-concept-shell__back {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-concept-shell *,
  .lab-concept-hint {
    transition-duration: 0.01ms !important;
  }
}
