@font-face {
  font-family: "Tesly Web";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/tesly-web-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Tesly Web";
  font-weight: 700;
  font-display: swap;
  src: url("/assets/tesly-web-bold.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  font: 100%/1.55 "Tesly Web", system-ui, sans-serif;
  --canvas: #f5f5f5;
  --surface: #fff;
  --text: #172019;
  --secondary: #525b55;
  --line: #dce2dd;
  --forest: #113b2b;
  --on-forest: #fff;
  --on-forest-secondary: #d2dad5;
  --forest-line: #426356;
  --step: #e5f5e5;
  --on-step: #113b2b;
  --accent: #55c259;
  --action-text: #0b1c0d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101315;
    --surface: #191d20;
    --text: #fff;
    --secondary: #b8c0bb;
    --line: #353c39;
    --forest: #172c23;
    --on-forest-secondary: #d7ddd9;
    --forest-line: #456050;
    --step: #354337;
    --on-step: #e5f5e5;
    --accent: #70d875;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
p, h1, h2, ol { margin: 0; }
.frame { width: min(100% - 48px, 1080px); margin-inline: auto; }
.top {
  min-height: 80px;
  padding-block: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.brand img { display: block; }
.wordmark { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.04em; }
.surface { border-left: 1px solid var(--line); padding-left: 12px; margin-left: 3px; }
.parked, .surface { color: var(--secondary); }
.parked { text-align: right; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding-block: 36px;
}
.setup {
  border-radius: 16px;
  padding: clamp(22px, 3vw, 36px);
  background: var(--forest);
  color: var(--on-forest);
}
h1 { font-size: 2.4rem; line-height: 1.18; letter-spacing: -0.035em; }
.lead { color: var(--on-forest-secondary); font-size: 1.13rem; margin-top: 12px; }
.steps { list-style: none; padding: 0; margin-block: 26px; }
.steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "number title" "number description";
  gap: 6px 14px;
  align-items: start;
  padding-block: 16px;
  border-top: 1px solid var(--forest-line);
}
.steps li:last-child { padding-bottom: 0; }
.step-no {
  grid-area: number;
  display: grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 8px;
  color: var(--on-step);
  background: var(--step);
  font-weight: 700;
}
.steps h2 { grid-area: title; font-size: 1.25rem; line-height: 1.35; align-self: center; }
.steps p { grid-area: description; color: var(--on-forest-secondary); font-size: 1.07rem; }
.steps strong { color: var(--on-forest); }
.keep { white-space: nowrap; }
:lang(en) .keep { white-space: normal; }
.language-choice { position: relative; justify-self: end; }
.language-choice[hidden] { display: none; }
.language-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: .9rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}
.language-trigger::-webkit-details-marker { display: none; }
.language-trigger svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.language-globe { width: 19px; height: 19px; }
.language-chevron { width: 14px; height: 14px; }
.language-choice[open] .language-chevron { transform: rotate(180deg); }
.language-options {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 6px);
  min-inline-size: 100%;
  inline-size: max-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 4px 16px #0002;
}
.language-options button {
  display: block;
  inline-size: 100%;
  min-height: 44px;
  padding: 6px 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.language-options button:hover { background: var(--canvas); }
.language-options button[aria-pressed="true"] {
  background: var(--step);
  color: var(--on-step);
  font-weight: 700;
}
.language-trigger:focus-visible, .language-options button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.check {
  min-height: 52px;
  padding: 12px 18px;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  color: var(--action-text);
  background: var(--accent);
  border-radius: 10px;
  font: inherit;
  font-size: 1.13rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.check[hidden] { display: none; }
.check[aria-disabled="true"] { opacity: .8; cursor: wait; }
.status { color: var(--on-forest-secondary); }
.status:not(:empty) { margin-top: 12px; }
#bookmark-offer { grid-column: 1 / -1; width: min(100%, 40rem); justify-self: center; }
#bookmark-offer p { margin-block: 12px 16px; }
#bookmark-fallback { margin-top: 16px; }
#bookmark-new {
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  color: var(--action-text);
  background: var(--accent);
  cursor: pointer;
}
#bookmark-fallback a { color: inherit; }
.help { padding-top: 4px; }
.help > h2 { font-size: 1.35rem; margin-bottom: 14px; letter-spacing: -0.025em; }
.help-group { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
details + details { border-top: 1px solid var(--line); }
summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 15px 16px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  list-style: none;
  border-radius: 14px;
}
summary::-webkit-details-marker { display: none; }
svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topic, .arrow { color: var(--secondary); }
details[open] .arrow { transform: rotate(180deg); }
.answer { padding: 0 16px 18px; color: var(--secondary); }
.answer strong { color: var(--text); }
.answer p + p, .answer ol { margin-top: 10px; }
.answer ol { padding-left: 1.4em; }
.answer li + li { margin-top: 7px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.check:focus-visible { outline-color: var(--on-forest); }
summary:focus-visible { outline-offset: -3px; }

#projection:not([hidden]) {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  overflow: hidden;
}
#screen {
  display: block;
  width: min(100vw, calc(100vh * 16 / 9));
  max-width: 100vw;
  max-height: 100vh;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
}
/* Match the standalone player: fit the image inside the AA padding, not the coded raster. */
#projectionCanvas.aa-cropped {
  position: relative;
  display: block;
  flex: none;
  overflow: hidden;
  width: min(100vw, calc(100vh * var(--aa-active-width) / var(--aa-active-height)));
  aspect-ratio: var(--aa-active-width) / var(--aa-active-height);
}
#projectionCanvas.aa-cropped > #screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% * 1280 / var(--aa-active-width));
  height: calc(100% * 720 / var(--aa-active-height));
  max-width: none;
  max-height: none;
  border-radius: 0;
}
#prodStatusPanel {
  position: absolute;
  inset: auto 24px 28px;
  width: fit-content;
  max-width: calc(100% - 48px);
  margin-inline: auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #191d20;
  text-align: center;
  pointer-events: none;
}
#prodStatus { white-space: pre-line; }
.rendering #prodStatusPanel { display: none; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-block: 24px; }
  .top { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 10px; }
  .parked { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .language-choice { grid-column: 2; grid-row: 1; }
}
@media (max-width: 480px) {
  .frame { width: calc(100% - 32px); }
  .surface { border-left: 0; padding-left: 0; }
  h1 { font-size: 1.95rem; }
  .steps li { grid-template-areas: "number title" "description description"; }
  .check { width: 100%; justify-content: center; }
}
