:root {
  --green: #0abf53;
  --green-dark: #079a42;
  --green-light: #e6f8ee;
  --navy: #00112c;
  --grey: #5c687c;
  --grey-light: #f3f6f9;
  --border: #e3e8ee;
  --radius: 16px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--navy);
  background: #fff;
}

img { max-width: 100%; height: auto; }

p, li, dt, dd { overflow-wrap: anywhere; }

:lang(zh-CN), :lang(ja) { line-break: strict; }

a { color: var(--green-dark); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }

h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -0.01em; }

h3 { font-size: 1.15rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.faq { max-width: 760px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  z-index: 100;
}

.skip:focus { left: 16px; top: 16px; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 20px; }

.header-row .brand { margin-right: auto; flex-shrink: 0; }

.mobile-menu { display: none; }

.mobile-menu, .language-menu { flex-shrink: 0; }

/* Language menu: a native <details> dropdown, so the site needs no script. */
.language-menu { position: relative; }
.language-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 2px 3px 2px;
  border-right: 2px solid var(--grey);
  border-bottom: 2px solid var(--grey);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.language-menu[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.language-menu summary:hover, .language-menu[open] summary { background: var(--grey-light); border-color: var(--grey-light); }
.globe { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.language-menu ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 17, 44, 0.14);
}
.language-menu li a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--navy);
  text-decoration: none;
}
.language-menu li a:hover { background: var(--grey-light); color: var(--green-dark); }
.language-menu a[aria-current="page"] { font-weight: 700; }
.language-menu a[aria-current="page"]::after { content: "✓"; color: var(--green); font-weight: 800; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
}

.nav { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }

.nav a:not(.button) { color: var(--navy); text-decoration: none; font-weight: 500; }

.nav a:not(.button):hover { color: var(--green-dark); }

.mobile-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  white-space: nowrap;
}

.mobile-menu summary::-webkit-details-marker { display: none; }

.mobile-menu summary::before {
  content: "";
  width: 18px;
  height: 14px;
  background: linear-gradient(currentColor, currentColor) top / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) bottom / 100% 2px no-repeat;
}

.mobile-menu summary:hover, .mobile-menu[open] summary { background: var(--grey-light); }

.mobile-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 12px max(20px, calc((100% - var(--wrap)) / 2 + 24px)) 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 14px 30px rgba(0, 17, 44, 0.1);
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
}

.mobile-menu .nav { display: block; font-size: 1rem; }

.mobile-menu .nav a { display: block; min-height: 44px; padding: 10px 0; }

.mobile-languages { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }

.mobile-languages p { margin: 0 0 8px; color: var(--grey); font-size: 0.9rem; }

.mobile-languages ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }

.mobile-languages a {
  display: block;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
}

.mobile-languages a:hover { background: var(--grey-light); }

.mobile-languages a[aria-current="page"] { background: var(--green-light); border-color: var(--green); font-weight: 700; }

/* Buttons */

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--green);
  transition: background 0.15s, border-color 0.15s;
}

.button:hover { background: var(--green-dark); border-color: var(--green-dark); }

.button-ghost { background: transparent; color: var(--navy); border-color: var(--border); }

.button-ghost:hover { background: var(--grey-light); border-color: var(--grey-light); }

.button-small { padding: 8px 16px; }

a:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* Hero */

.hero {
  background: linear-gradient(180deg, var(--green-light) 0%, #fff 100%);
  padding: 72px 0 40px;
  overflow: hidden;
}

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--grey);
  font-size: 0.9rem;
  font-weight: 600;
}

.lead { font-size: 1.2rem; color: var(--grey); max-width: 36em; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--grey);
  font-size: 0.95rem;
}

.hero-points li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 6px; }

/* Original AMS1/S1F2-inspired payment terminal illustrations. The screenshot
   uses contain, never cover: demo captures retain their original aspect ratio. */
.hero-shots { position: relative; height: 565px; }
.hero-visual { min-width: 0; }
.terminal { position: relative; width: 100%; filter: drop-shadow(0 18px 20px rgba(0, 17, 44, 0.18)); }
.terminal-ams1 { aspect-ratio: 260 / 480; background: url("images/terminal-ams1.svg") center / 100% 100% no-repeat; }
.terminal-s1f2 { aspect-ratio: 300 / 600; background: url("images/terminal-s1f2.svg") center / 100% 100% no-repeat; }
.terminal img { position: absolute; display: block; object-fit: contain; background: white; }
.terminal-ams1 img { left: 7.6923%; top: 12.5%; width: 84.6154%; height: 76.25%; }
.terminal-s1f2 img { left: 10%; top: 20.3333%; width: 80%; height: 71.1111%; }
.hero-shots .terminal { position: absolute; width: 240px; }
.terminal-front { left: 0; top: 65px; z-index: 2; transform: rotate(-6deg); }
.terminal-back { right: 0; top: 0; transform: rotate(6deg); }

/* Sections */

.section { padding: 88px 0; }

.section-alt { background: var(--grey-light); }

.section-dark { background: var(--navy); color: #fff; }

.section-lead { font-size: 1.1rem; color: var(--grey); max-width: 44em; margin-bottom: 40px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.feature svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--green-light);
  fill: var(--green-dark);
}

.feature p { margin: 0; color: var(--grey); font-size: 0.97rem; }

.feature .feature-link { margin-top: 12px; }

.guide-start { padding: 24px 0 40px; }

.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.guide-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }

.guide-card h3 { font-size: 1.15rem; }

.guide-card p { margin: 0; color: var(--grey); }

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
}

.flow .terminal { max-width: 240px; margin: 0 auto 28px; }

.flow h3 { display: flex; align-items: center; gap: 10px; }

.flow h3 span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.9rem;
}

.flow li { min-width: 0; }

.flow p { margin: 0; color: var(--grey); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }

.checks { list-style: none; padding: 0; margin: 0; }

.checks li { position: relative; padding-left: 34px; margin-bottom: 16px; color: var(--grey); }

.checks li strong { color: var(--navy); }

.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.shot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

.shot-pair .terminal:last-child { margin-top: 48px; }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }

.step {
  min-width: 0;
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.step p, .step li { color: #c9d2de; }

.step a { color: var(--green); font-weight: 700; }

.step ol { padding-left: 1.2em; }

pre {
  margin: 16px 0 0;
  padding: 18px 20px;
  border-radius: 12px;
  background: #000a1b;
  color: #e6f8ee;
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-x: auto;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }

.faq details p { color: var(--grey); margin: 12px 0 0; }

/* Guide */

.nav a[aria-current="page"] { color: var(--green-dark); }

.guide-hero {
  background: linear-gradient(180deg, var(--green-light) 0%, #fff 100%);
  padding: 56px 0 24px;
}

.guide {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-bottom: 88px;
}

.toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.toc-title { margin: 0 0 8px; font-weight: 700; }

.toc ol, .toc ul { margin: 0; padding-left: 1.2em; }

.toc li { margin: 4px 0; }

.toc li ul { margin: 8px 0; }

.toc a { color: var(--navy); text-decoration: none; }

.toc a:hover { color: var(--green-dark); }

.toc a[aria-current="page"] { color: var(--green-dark); font-weight: 700; }

.mobile-contents { display: none; }

.mobile-contents summary { cursor: pointer; }

.mobile-contents[open] summary { margin-bottom: 12px; }

.back-to-contents { font-size: 0.9rem; }

.guide-body { max-width: 760px; min-width: 0; }

.guide-body section { padding-top: 24px; }

.guide-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }

.guide-body h3 { margin-top: 1.4em; }

.guide-shot { width: 100%; max-width: 240px; margin: 24px auto; text-align: center; }

.guide-shot figcaption { margin-top: 16px; }

.guide-body li { margin-bottom: 6px; }

.guide-body code { font-family: var(--mono); font-size: 0.9em; background: var(--grey-light); padding: 1px 5px; border-radius: 4px; }

.guide-body pre code { background: none; padding: 0; }

/* Guide callouts. Each states its kind in text, so the label is translated with the page; .callout-note keeps the
   base style. */
.note, .callout {
  padding: 14px 18px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--green-light);
}

.callout { margin: 20px 0; }

.callout > :first-child { margin-top: 0; }

.callout > :last-child { margin-bottom: 0; }

.callout ul, .callout ol { padding-left: 1.2em; }

.callout li { margin-bottom: 4px; }

.callout-title { margin: 0 0 6px; font-weight: 700; }

.callout-prereq { border-left-color: var(--navy); background: var(--grey-light); }

.callout-important { border-left-color: #2f6fdb; background: #eaf1fd; }

.callout-warning { border-left-color: #b86e00; background: #fff4e0; }

.settings-list dt { font-weight: 700; margin-top: 14px; }

.settings-list dd { margin: 4px 0 0; color: var(--grey); }

.settings-list dd ol { padding-left: 1.2em; }

/* Troubleshooting: what you see, why, and what to do. */
.fixes > div { padding: 14px 0; border-top: 1px solid var(--border); }

.fixes > div:first-child { border-top: 0; padding-top: 4px; }

.fixes dt { font-weight: 700; }

.fixes dd { margin: 6px 0 0; }

.fixes dd p { margin: 12px 0; }

.fixes dd ol, .fixes dd ul { margin: 4px 0; padding-left: 1.2em; }

.fix-label { display: block; margin-bottom: 4px; color: var(--navy); font-size: 1rem; font-weight: 700; line-height: 1.4; }

/* Quick start: each device setup is a card linking to its connection steps. */
.setup-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0 24px; }

.setup-choices > div { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); }

.setup-choices dt { margin-top: 0; font-size: 1.05rem; }

/* Each connection task leads with the recommended setup helper route; Manual is a collapsed alternative below it. */
.setup-route { margin: 20px 0 0; padding: 16px 20px; border: 1px solid var(--green); border-radius: 12px; background: var(--green-light); }

.setup-route dt { margin-top: 0; }

.setup-route dd { color: var(--navy); }

.manual-setup { margin: 12px 0 20px; border: 1px solid var(--border); border-radius: 12px; }

.manual-setup > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.manual-setup > summary::-webkit-details-marker { display: none; }

.manual-setup > summary::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--grey);
  border-bottom: 2px solid var(--grey);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.manual-setup[open] > summary::before { transform: rotate(45deg); }

.manual-setup > summary:hover { background: var(--grey-light); }

.manual-setup[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }

.manual-setup > ol { margin: 16px 20px 18px 0; }

.guide-body ol > li::marker { color: var(--green-dark); font-weight: 700; }

/* Footer */

.site-footer { padding: 40px 0; border-top: 1px solid var(--border); color: var(--grey); font-size: 0.95rem; }

.site-footer p { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.site-footer img { vertical-align: middle; }

.fine { font-size: 0.85rem; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0 0 20px; padding: 0; }

.footer-nav a[aria-current="page"] { font-weight: 700; }

/* Smaller screens */

@media (max-width: 900px) {
  .hero-grid, .split, .steps, .guide, .guide-cards { grid-template-columns: minmax(0, 1fr); }
  .guide { gap: 24px; }
  .toc { position: static; max-height: none; overflow-y: visible; }
  .desktop-contents { display: none; }
  .mobile-contents { display: block; }
  .hero { padding-top: 48px; }
  .hero-visual { max-width: 440px; margin: 0 auto; width: 100%; }
  .hero-shots { height: 480px; }
  .hero-shots .terminal { width: 220px; }
  .terminal-front { left: 15px; }
  .terminal-back { right: 15px; }
  .nav { gap: 16px; font-size: 0.9rem; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .shot-pair { max-width: 520px; }
}

/* Switch before translated navigation can crowd the brand or language menu. */
@media (max-width: 1100px) {
  .desktop-nav, .language-menu { display: none; }
  .mobile-menu { display: block; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .hero-shots { height: 370px; }
  .hero-shots .terminal { width: 165px; }
  .terminal-front { left: 4px; top: 55px; }
  .terminal-back { right: 4px; }
  .language-current { display: none; }
  .header-row { gap: 8px; }
  .header-row .brand { gap: 6px; font-size: 1rem; }
  .brand img { width: 28px; height: 28px; }
  .step { padding: 22px; }
  .flow { gap: 20px; }
  .setup-choices { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .hero-shots { height: 325px; }
  .hero-shots .terminal { width: 145px; }
}

/* Setup helper */

[hidden] { display: none !important; }

/* The form and its notes sit beside the sticky aside; the generated codes span both columns below them. */
.setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
  padding-bottom: 88px;
}

.setup-main { max-width: 680px; min-width: 0; }

.setup-main > .hint { margin-bottom: 24px; }

/* Each visible top-level group is a numbered step, like the app's Terminal setup. Hidden groups generate no box, so
   the numbers stay consecutive whichever destination, environment and mode are chosen. */
.setup-form { counter-reset: step; }

.setup-form fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

/* A floated legend is laid out inside its card, like a heading, instead of across the border. */
.setup-form legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
}

.setup-form legend + * { clear: left; }

.setup-form > fieldset > legend { position: relative; min-height: 28px; padding: 2px 0 0 40px; }

.setup-form > fieldset > legend::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.9rem;
}

/* Details revealed by an optional group's choice continue inside the same card. */
.setup-form fieldset fieldset { margin: 24px 0 0; padding: 24px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }

.setup-form fieldset fieldset > legend { font-size: 1rem; }

.setup-form label:not(.choice) { display: block; margin: 16px 0 6px; font-weight: 600; }

.setup-form input:not([type="radio"]), .setup-form select, .setup-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #858fa0;
  border-radius: 10px;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--navy);
  background: #fff;
  transition: border-color 0.15s;
}

/* Keys, IDs and addresses stay monospaced; text printed on receipts or shown to customers does not. */
.setup-form input:not([type="radio"]):not([spellcheck="false"]), .setup-form textarea:not([spellcheck="false"]) { font-family: var(--font); }

.setup-form input:not([type="radio"]):hover, .setup-form select:hover, .setup-form textarea:hover { border-color: var(--navy); }

.setup-form input:focus, .setup-form select:focus, .setup-form textarea:focus { border-color: var(--green-dark); }

.setup-form input:user-invalid, .setup-form select:user-invalid, .setup-form textarea:user-invalid { border-color: #c62828; }

.setup-form input:focus-visible, .setup-form select:focus-visible,
.setup-form textarea:focus-visible, .setup-form button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* Choices are whole-row targets that show which option is selected. */
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.choice:hover { border-color: var(--green); }

.choice:has(input:checked) { border-color: var(--green); background: var(--green-light); box-shadow: inset 0 0 0 1px var(--green); }

.choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }

.choice input { flex-shrink: 0; width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--green-dark); }

.hint { margin: 8px 0 0; color: var(--grey); font-size: 0.93rem; }

.choice + .hint { margin-top: 12px; }

.setup-form legend + .choice, .setup-form legend + .hint, .setup-form legend + label:not(.choice) { margin-top: 0; }

/* A destination's prerequisites between steps read like the guides' prerequisite callouts. */
.setup-form > .hint[data-only] { margin: 0 0 24px; padding: 14px 18px; border-left: 4px solid var(--navy); border-radius: 8px; background: var(--grey-light); color: var(--navy); }

button.button { font: inherit; font-weight: 700; cursor: pointer; }

.setup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.setup-codes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: start;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--grey-light);
}

.setup-codes > h2 { grid-column: 1 / -1; margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }

.setup-scan { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

.setup-qr svg { display: block; width: 100%; height: auto; }

.setup-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 12px; }

.setup-controls span { flex-basis: 100%; font-weight: 600; text-align: center; }

.setup-code-card {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-light);
}

.setup-code-card p { margin: 0; font-weight: 600; }

.setup-code { font-family: var(--mono); font-size: clamp(1.4rem, 5vw, 1.9rem); letter-spacing: 0.06em; }

.setup-next ol { margin: 0 0 16px; padding-left: 1.4em; }

.setup-next li { margin-bottom: 8px; }

.setup-next li::marker { color: var(--green-dark); font-weight: 700; }

.setup-next p { margin: 0 0 12px; }

.setup-next .setup-code-card p, .setup-next > :last-child { margin: 0; }

/* The aside fills the form's row and its content sticks within it, so it never scrolls over the generated codes. */
.setup-side { grid-column: 2; grid-row: 1; align-self: stretch; }

.setup-side > div {
  position: sticky;
  top: 88px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--grey-light);
  font-size: 0.95rem;
}

.setup-side h2 { font-size: 1.15rem; }

.setup-side ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--grey); }

.setup-side li { margin-bottom: 8px; }

.setup-side li strong { color: var(--navy); }

.setup-side li:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .setup { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .setup-side { grid-column: auto; grid-row: auto; }
  .setup-side > div { position: static; }
  .setup-codes { grid-template-columns: minmax(0, 1fr); }
  .setup-scan { max-width: 420px; }
}

@media (max-width: 600px) {
  .setup-form fieldset { padding: 16px; }
  .setup-form fieldset fieldset { padding: 16px 0 0; }
  .choice { padding: 12px; }
  .setup-actions .button { flex: 1 1 auto; text-align: center; }
  .setup-codes { padding: 16px; }
  .setup-scan { padding: 10px; }
}
