/*
 * GameControllerTest.com
 * Production interface system — USA-inspired, globally usable, dependency-free.
 */

:root {
  color-scheme: light;
  --ink: #0a0d12;
  --ink-soft: #273241;
  --navy-950: #050e1b;
  --navy-900: #071426;
  --navy-850: #0b1f3a;
  --navy-800: #102b4e;
  --blue-700: #174ea6;
  --blue-600: #1f63c6;
  --blue-500: #2f76dc;
  --blue-100: #dceaff;
  --blue-050: #eef5ff;
  --red-700: #b51f31;
  --red-600: #d6293e;
  --red-500: #e33f52;
  --red-100: #ffe1e5;
  --green-700: #147447;
  --green-600: #198754;
  --green-100: #dff5e9;
  --amber-700: #8c5a00;
  --amber-500: #e49b16;
  --amber-100: #fff0cc;
  --white: #ffffff;
  --paper: #f8fafc;
  --paper-blue: #f2f6fb;
  --line: #dbe3ec;
  --line-strong: #bdc9d7;
  --muted: #5b6878;
  --muted-light: #9aabbd;
  --success: var(--green-600);
  --warning: var(--amber-500);
  --danger: var(--red-600);
  --info: var(--blue-600);
  --shadow-xs: 0 1px 2px rgb(5 14 27 / 6%);
  --shadow-sm: 0 7px 20px rgb(5 14 27 / 8%);
  --shadow-md: 0 18px 42px rgb(5 14 27 / 12%);
  --shadow-lg: 0 28px 70px rgb(5 14 27 / 18%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --container: 1180px;
  --container-narrow: 780px;
  --header-height: 70px;
  --mobile-dock-height: 72px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 18px);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0 0 auto;
  height: 380px;
  background:
    radial-gradient(circle at 9% -20%, rgb(47 118 220 / 11%), transparent 49%),
    radial-gradient(circle at 90% -10%, rgb(214 41 62 / 7%), transparent 42%);
  content: "";
  pointer-events: none;
}

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

button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

a {
  color: var(--blue-700);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--red-700);
}

p,
ul,
ol,
dl,
blockquote,
pre,
table {
  margin-block: 0 1.2rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 .7em;
  color: var(--navy-950);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5.5vw, 4.75rem);
  letter-spacing: -.05em;
}

h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.65rem);
}

h3 {
  font-size: clamp(1.18rem, 2vw, 1.45rem);
}

h4 {
  font-size: 1rem;
  letter-spacing: -.01em;
}

hr {
  height: 1px;
  margin: 2rem 0;
  border: 0;
  background: var(--line);
}

::selection {
  background: var(--blue-700);
  color: var(--white);
}

:focus-visible {
  outline: 3px solid #f5b83a;
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;
  padding: .7rem 1rem;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--navy-950);
  font-weight: 800;
}

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

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.container-narrow,
.narrow {
  width: min(calc(100% - 40px), var(--container-narrow));
  margin-inline: auto;
}

.site-main {
  min-height: 65vh;
}

/* Header and primary navigation */
.site-header {
  position: sticky;
  z-index: 900;
  top: 0;
  min-height: var(--header-height);
  border-bottom: 1px solid rgb(189 201 215 / 74%);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 70%);
  backdrop-filter: saturate(145%) blur(14px);
}

.site-header .container,
.nav {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
}

.nav {
  width: 100%;
  gap: clamp(.8rem, 2vw, 1.65rem);
}

.brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: .68rem;
  color: var(--navy-950);
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: -.025em;
  line-height: 1;
  text-decoration: none;
}

.brand:hover {
  color: var(--navy-950);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 36px;
  height: 30px;
  place-items: center;
  border: 2px solid var(--navy-850);
  border-radius: 11px 11px 13px 13px;
  background: var(--white);
  box-shadow: inset 0 -5px 0 var(--blue-100);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-600);
  content: "";
}

.brand-mark::before {
  right: 7px;
  top: 8px;
}

.brand-mark::after {
  right: 12px;
  top: 13px;
  background: var(--blue-700);
}

.nav-links {
  display: flex;
  margin: 0 auto;
  padding: 0;
  align-items: center;
  gap: .15rem;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  min-height: 42px;
  padding: .58rem .78rem;
  align-items: center;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: .91rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-links .is-active > a {
  background: var(--blue-050);
  color: var(--blue-700);
}

.nav-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: .55rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--navy-850);
}

/* Reusable controls */
.button {
  --button-bg: var(--white);
  --button-border: var(--line-strong);
  --button-color: var(--navy-850);
  display: inline-flex;
  min-height: 46px;
  padding: .72rem 1.05rem;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  border: 1px solid var(--button-border);
  border-radius: 11px;
  background: var(--button-bg);
  box-shadow: var(--shadow-xs);
  color: var(--button-color);
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease), border-color 150ms var(--ease);
  user-select: none;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--blue-500);
  box-shadow: var(--shadow-sm);
  color: var(--button-color);
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.button-primary {
  --button-bg: var(--blue-700);
  --button-border: var(--blue-700);
  --button-color: var(--white);
  box-shadow: 0 8px 22px rgb(23 78 166 / 24%);
}

.button-primary:hover {
  --button-bg: #0f3f8d;
  --button-border: #0f3f8d;
}

.button-secondary {
  --button-bg: var(--white);
  --button-border: #aebccb;
  --button-color: var(--navy-850);
}

.button-danger {
  --button-bg: var(--red-600);
  --button-border: var(--red-600);
  --button-color: var(--white);
}

.button-danger:hover {
  --button-bg: var(--red-700);
  --button-border: var(--red-700);
}

.button-quiet {
  --button-bg: transparent;
  --button-border: transparent;
  box-shadow: none;
}

.button-small {
  min-height: 38px;
  padding: .56rem .78rem;
  border-radius: 9px;
  font-size: .85rem;
}

.button-icon {
  width: 46px;
  padding-inline: 0;
}

.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  padding: .3rem .68rem;
  align-items: center;
  gap: .42rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-blue);
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .015em;
  line-height: 1.1;
}

.status-pill::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-light);
  box-shadow: 0 0 0 3px rgb(154 171 189 / 16%);
  content: "";
}

.status-pill.is-live,
.status-pill.success,
.status-pill[data-status="connected"] {
  border-color: #a8dec2;
  background: var(--green-100);
  color: var(--green-700);
}

.status-pill.is-live::before,
.status-pill.success::before,
.status-pill[data-status="connected"]::before {
  background: var(--green-600);
  box-shadow: 0 0 0 3px rgb(25 135 84 / 17%);
}

.status-pill.warning,
.status-pill[data-status="warning"] {
  border-color: #efd692;
  background: var(--amber-100);
  color: var(--amber-700);
}

.status-pill.warning::before,
.status-pill[data-status="warning"]::before {
  background: var(--amber-500);
}

.status-pill.danger,
.status-pill[data-status="error"] {
  border-color: #f1adb6;
  background: var(--red-100);
  color: var(--red-700);
}

.status-pill.danger::before,
.status-pill[data-status="error"]::before {
  background: var(--red-600);
}

/* Hero and page introductions */
.hero {
  position: relative;
  padding: clamp(3.4rem, 7vw, 6.25rem) 0 clamp(3rem, 6vw, 5.2rem);
  overflow: clip;
}

.hero::after {
  position: absolute;
  z-index: -1;
  right: -160px;
  bottom: 0;
  width: 500px;
  height: 500px;
  border: 1px solid rgb(23 78 166 / 10%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 70px rgb(23 78 166 / 2.5%), inset 0 0 0 140px rgb(214 41 62 / 2%);
  content: "";
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.8rem);
  grid-template-columns: minmax(0, 1.02fr) minmax(330px, .78fr);
}

.hero-copy {
  max-width: 700px;
}

.hero-copy h1 em,
.page-hero h1 em {
  color: var(--blue-700);
  font-style: normal;
}

.hero-copy > p,
.hero-lead,
.page-lead {
  max-width: 660px;
  margin-bottom: 1.65rem;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.65;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 1rem;
  align-items: center;
  gap: .55rem;
  color: var(--red-700);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 23px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue-700) 0 55%, var(--red-600) 55%);
  content: "";
}

.hero-trust {
  display: flex;
  margin-top: 1.3rem;
  flex-wrap: wrap;
  gap: .55rem 1.1rem;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.hero-trust span::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-600);
  content: "";
}

.hero-panel {
  position: relative;
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 7%, rgb(47 118 220 / 28%), transparent 32%),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.hero-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(var(--blue-500), var(--red-500));
  content: "";
}

.hero-panel h2,
.hero-panel h3,
.hero-panel h4 {
  color: var(--white);
}

.hero-panel p {
  color: #c6d3e0;
}

.page-hero {
  position: relative;
  padding: clamp(2.8rem, 6vw, 5.2rem) 0 clamp(2.2rem, 4vw, 3.6rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(238 245 255 / 78%), rgb(248 250 252 / 0%));
}

.page-hero h1 {
  max-width: 880px;
  font-size: clamp(2.15rem, 4.8vw, 4rem);
}

.page-hero .page-lead {
  margin-bottom: 0;
}

.breadcrumbs {
  display: flex;
  margin: 0 0 1.2rem;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.breadcrumbs li:not(:last-child)::after {
  color: var(--line-strong);
  content: "/";
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

/* Sections and card systems */
.section {
  padding: clamp(3.2rem, 7vw, 6rem) 0;
}

.section-compact {
  padding-block: clamp(2rem, 4vw, 3.3rem);
}

.section-muted {
  border-block: 1px solid var(--line);
  background: var(--paper-blue);
}

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

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--white);
}

.section-header {
  max-width: 720px;
  margin-bottom: clamp(1.6rem, 4vw, 2.8rem);
}

.section-header.centered {
  margin-inline: auto;
  text-align: center;
}

.section-header > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.content-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.report-card,
.metric-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.card {
  padding: clamp(1.15rem, 2.5vw, 1.55rem);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: #9cb6d6;
  box-shadow: var(--shadow-md);
  color: inherit;
}

.card h3,
.card h4 {
  margin-bottom: .45rem;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card p {
  color: var(--muted);
}

.card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-weight: 900;
}

.card-kicker {
  display: block;
  margin-bottom: .5rem;
  color: var(--blue-700);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--blue-700);
  font-size: .88rem;
  font-weight: 800;
}

.card-link::after {
  content: "->";
  transition: transform 150ms var(--ease);
}

.card:hover .card-link::after {
  transform: translateX(3px);
}

/* Controller diagnostics workspace */
.tester-shell {
  position: relative;
  isolation: isolate;
  width: min(calc(100% - 24px), 1320px);
  margin: clamp(1.5rem, 4vw, 3.5rem) auto;
  overflow: hidden;
  border: 1px solid #233d5d;
  border-radius: clamp(18px, 3vw, 28px);
  background:
    radial-gradient(circle at 8% 4%, rgb(47 118 220 / 22%), transparent 25%),
    radial-gradient(circle at 96% 0%, rgb(214 41 62 / 16%), transparent 21%),
    linear-gradient(150deg, #0b203a 0%, #06111f 64%, #040b14 100%);
  box-shadow: 0 28px 80px rgb(5 14 27 / 28%);
  color: #dce7f2;
}

.tester-shell::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 65%);
  pointer-events: none;
}

.tester-shell h2,
.tester-shell h3,
.tester-shell h4 {
  color: var(--white);
}

.tester-shell a {
  color: #91bcff;
}

.tester-toolbar {
  display: flex;
  min-height: 72px;
  padding: .85rem clamp(1rem, 2.4vw, 1.65rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  background: rgb(4 11 20 / 45%);
}

.tester-toolbar .toolbar-title,
.tester-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .72rem;
}

.tester-toolbar h2,
.tester-toolbar h3,
.tester-title h2,
.tester-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tester-toolbar .actions {
  flex-wrap: nowrap;
}

.tester-shell .button-secondary,
.tester-shell .button-quiet {
  --button-bg: rgb(255 255 255 / 7%);
  --button-border: rgb(255 255 255 / 17%);
  --button-color: var(--white);
  box-shadow: none;
}

.tester-shell .button-secondary:hover,
.tester-shell .button-quiet:hover {
  --button-bg: rgb(255 255 255 / 12%);
  --button-border: rgb(145 188 255 / 55%);
}

.tester-shell select,
.device-picker {
  min-height: 44px;
  max-width: min(100%, 340px);
  padding: .55rem 2.45rem .55rem .8rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 10px;
  background-color: #102b4e;
  color: var(--white);
  font-size: .88rem;
  font-weight: 700;
}

.tester-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(310px, .82fr) minmax(390px, 1.18fr);
}

.controller-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 510px;
  padding: clamp(1.3rem, 3vw, 2.4rem);
  align-content: center;
  justify-items: center;
  overflow: hidden;
  border-right: 1px solid rgb(255 255 255 / 10%);
}

.controller-stage::before {
  position: absolute;
  width: min(90%, 430px);
  aspect-ratio: 1;
  border: 1px solid rgb(145 188 255 / 11%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 58px rgb(145 188 255 / 2.5%), inset 0 0 0 116px rgb(214 41 62 / 1.6%);
  content: "";
  pointer-events: none;
}

.controller-stage-header {
  position: absolute;
  z-index: 3;
  top: 1.15rem;
  right: 1.15rem;
  left: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.controller-stage-header p {
  margin: 0;
  color: #9fb1c4;
  font-size: .78rem;
}

.controller-visual {
  position: relative;
  z-index: 2;
  width: min(88%, 400px);
  aspect-ratio: 1.55;
  filter: drop-shadow(0 25px 30px rgb(0 0 0 / 34%));
}

.controller-face,
.controller-body {
  position: absolute;
  z-index: 2;
  inset: 8% 7% 12%;
  border: 2px solid #60758f;
  border-radius: 43% 43% 34% 34% / 42% 42% 58% 58%;
  background:
    linear-gradient(155deg, rgb(255 255 255 / 15%), transparent 28%),
    linear-gradient(145deg, #34485f, #17283b 62%, #0e1b2b);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), inset 0 -16px 26px rgb(0 0 0 / 22%);
}

.controller-face::before,
.controller-body::before {
  position: absolute;
  top: 8%;
  right: 27%;
  left: 27%;
  height: 8%;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-pill);
  background: #0b1725;
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 46%);
  content: "";
}

.controller-grip {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: 31%;
  height: 59%;
  border: 2px solid #60758f;
  background: linear-gradient(160deg, #30465d, #101f30 68%);
  box-shadow: inset 0 -15px 24px rgb(0 0 0 / 20%);
}

.controller-grip.left,
.controller-grip.is-left {
  left: 7%;
  transform: rotate(16deg);
  border-radius: 52% 20% 68% 42%;
}

.controller-grip.right,
.controller-grip.is-right {
  right: 7%;
  transform: rotate(-16deg);
  border-radius: 20% 52% 42% 68%;
}

.shoulder-button {
  position: absolute;
  z-index: 1;
  top: 2%;
  width: 27%;
  height: 14%;
  border: 1px solid #657b93;
  background: linear-gradient(#415a73, #1a2c40);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%);
}

.shoulder-button.left {
  left: 12%;
  transform: rotate(-4deg);
  border-radius: 19px 10px 6px 10px;
}

.shoulder-button.right {
  right: 12%;
  transform: rotate(4deg);
  border-radius: 10px 19px 10px 6px;
}

.dpad {
  position: absolute;
  z-index: 4;
  top: 32%;
  left: 18%;
  width: 21%;
  aspect-ratio: 1;
}

.dpad::before,
.dpad::after {
  position: absolute;
  top: 35%;
  right: 0;
  bottom: 35%;
  left: 0;
  border: 1px solid #586b80;
  border-radius: 5px;
  background: #0b1521;
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 12%);
  content: "";
}

.dpad::after {
  top: 0;
  right: 35%;
  bottom: 0;
  left: 35%;
}

.dpad .pad-button {
  position: absolute;
  z-index: 2;
  width: 31%;
  height: 31%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: transparent;
}

.dpad .pad-button.up { top: 0; left: 34.5%; }
.dpad .pad-button.right { top: 34.5%; right: 0; }
.dpad .pad-button.down { bottom: 0; left: 34.5%; }
.dpad .pad-button.left { top: 34.5%; left: 0; }

.face-buttons {
  position: absolute;
  z-index: 4;
  top: 27%;
  right: 16%;
  width: 25%;
  aspect-ratio: 1;
}

.pad-button {
  display: grid;
  min-height: 44px;
  padding: .45rem;
  place-items: center;
  border: 1px solid #657b93;
  border-radius: 50%;
  background: linear-gradient(145deg, #30465b, #0d1927);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 15%), 0 4px 8px rgb(0 0 0 / 27%);
  color: #bfcddd;
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 70ms linear, background-color 70ms linear, box-shadow 70ms linear;
}

.face-buttons .pad-button {
  position: absolute;
  width: 35%;
  min-height: 0;
  aspect-ratio: 1;
}

.face-buttons .top,
.face-buttons .y,
.face-buttons [data-button="3"] { top: 0; left: 32.5%; }
.face-buttons .right,
.face-buttons .b,
.face-buttons [data-button="1"] { top: 32.5%; right: 0; }
.face-buttons .bottom,
.face-buttons .a,
.face-buttons [data-button="0"] { bottom: 0; left: 32.5%; }
.face-buttons .left,
.face-buttons .x,
.face-buttons [data-button="2"] { top: 32.5%; left: 0; }

.pad-button.is-active,
.pad-button.active,
.pad-button[aria-pressed="true"],
.pad-button[data-active="true"] {
  transform: scale(.9);
  border-color: #8fc1ff;
  background: var(--blue-600);
  box-shadow: 0 0 0 4px rgb(47 118 220 / 25%), 0 0 22px rgb(47 118 220 / 60%);
  color: var(--white);
}

.analog-stick,
.stick {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 17%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #50647a;
  border-radius: 50%;
  background: #07111c;
  box-shadow: inset 0 4px 12px rgb(0 0 0 / 72%), 0 0 0 5px rgb(255 255 255 / 3%);
}

.analog-stick::before,
.stick::before {
  width: 69%;
  aspect-ratio: 1;
  border: 1px solid #63768a;
  border-radius: 50%;
  background: radial-gradient(circle, #283c51 0 32%, #142537 33% 68%, #354b61 70%);
  box-shadow: inset 0 2px 5px rgb(255 255 255 / 10%);
  content: "";
  transform: translate(var(--stick-x, 0), var(--stick-y, 0));
  transition: transform 35ms linear;
}

.stick-left,
.analog-stick.left {
  bottom: 20%;
  left: 33%;
}

.stick-right,
.analog-stick.right {
  right: 31%;
  bottom: 18%;
}

.controller-center-buttons {
  position: absolute;
  z-index: 4;
  top: 33%;
  right: 43%;
  left: 43%;
  display: flex;
  justify-content: center;
  gap: 55%;
}

.controller-center-buttons .pad-button {
  min-width: 20px;
  min-height: 10px;
  padding: 0;
  border-radius: var(--radius-pill);
  color: transparent;
}

.controller-caption {
  position: relative;
  z-index: 3;
  max-width: 430px;
  margin-top: 1.25rem;
  color: #9fb1c4;
  font-size: .82rem;
  text-align: center;
}

.controller-caption strong {
  color: var(--white);
}

.tester-panels {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  background: rgb(4 11 20 / 22%);
}

.tester-tabs {
  display: flex;
  margin-bottom: 1rem;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tester-tabs button,
.tester-tab {
  min-height: 40px;
  padding: .55rem .8rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #a8b9ca;
  font-size: .82rem;
  font-weight: 800;
}

.tester-tabs button:hover,
.tester-tab:hover,
.tester-tabs [aria-selected="true"],
.tester-tab.is-active {
  border-color: rgb(145 188 255 / 22%);
  background: rgb(145 188 255 / 10%);
  color: var(--white);
}

.tester-panel[hidden] {
  display: none;
}

.live-grid {
  display: grid;
  gap: .72rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  min-height: 108px;
  padding: 1rem;
}

.tester-shell .metric-card {
  border-color: rgb(255 255 255 / 11%);
  background: rgb(255 255 255 / 5%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.metric-label {
  display: block;
  margin-bottom: .4rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .05em;
  line-height: 1.25;
  text-transform: uppercase;
}

.tester-shell .metric-label {
  color: #91a5ba;
}

.metric-value {
  display: block;
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-size: clamp(1.18rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tester-shell .metric-value {
  color: var(--white);
}

.metric-meta {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .75rem;
}

.tester-shell .metric-meta {
  color: #879caf;
}

.axis-grid,
.button-grid {
  display: grid;
  gap: .58rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.button-state {
  display: grid;
  min-height: 60px;
  padding: .52rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 10px;
  background: rgb(255 255 255 / 4%);
  color: #9fb1c4;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}

.button-state.is-active,
.button-state[data-active="true"] {
  border-color: #5b9df5;
  background: rgb(31 99 198 / 50%);
  box-shadow: 0 0 18px rgb(31 99 198 / 24%);
  color: var(--white);
}

.axis-row,
.trigger-row {
  min-width: 0;
  padding: .72rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  background: rgb(255 255 255 / 3%);
}

.axis-row header,
.trigger-row header,
.meter-header {
  display: flex;
  margin-bottom: .45rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #b6c5d4;
  font-size: .75rem;
  font-weight: 750;
}

.axis-value,
.trigger-value {
  color: var(--white);
  font-family: var(--font-mono);
}

.axis-meter,
.trigger-meter,
.meter-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: #02070d;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 62%);
}

.axis-meter::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgb(255 255 255 / 28%);
  content: "";
}

.meter-fill,
.axis-fill,
.trigger-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), #70aaff);
  transition: width 40ms linear;
}

.axis-fill {
  left: 50%;
  width: var(--axis-width, 0%);
  transform: translateX(var(--axis-shift, 0%));
}

.trigger-fill {
  background: linear-gradient(90deg, var(--blue-500), var(--red-500));
}

.canvas-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.canvas-panel {
  min-width: 0;
  padding: .8rem;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 12px;
  background: rgb(0 0 0 / 16%);
}

.canvas-panel header {
  display: flex;
  margin-bottom: .7rem;
  align-items: center;
  justify-content: space-between;
  color: #b5c4d4;
  font-size: .75rem;
  font-weight: 800;
}

.canvas-panel canvas {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 9px;
  background: #030a12;
}

.tester-message,
.connection-prompt {
  padding: 1rem;
  border: 1px solid rgb(145 188 255 / 22%);
  border-radius: 12px;
  background: rgb(23 78 166 / 15%);
  color: #dce8f5;
}

.tester-message p:last-child,
.connection-prompt p:last-child {
  margin-bottom: 0;
}

.raw-data,
.code-block {
  max-height: 360px;
  padding: 1rem;
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  background: #02070d;
  color: #b9d8ff;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.6;
  tab-size: 2;
}

.test-progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 9%);
}

.test-progress > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--red-500));
  transition: width 180ms var(--ease);
}

.diagnostic-result {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 12px;
  background: rgb(255 255 255 / 4%);
}

.diagnostic-result.is-good { border-color: rgb(58 190 121 / 40%); }
.diagnostic-result.is-warning { border-color: rgb(228 155 22 / 45%); }
.diagnostic-result.is-bad { border-color: rgb(227 63 82 / 48%); }

/* Reports and local lab */
.reports-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-card {
  padding: 1.15rem;
}

.report-card-header {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.report-card h3 {
  margin-bottom: .22rem;
  font-size: 1.05rem;
}

.report-card time,
.report-meta {
  color: var(--muted);
  font-size: .8rem;
}

.report-stats {
  display: grid;
  margin: 0 0 1rem;
  gap: .6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-stats div {
  padding: .65rem;
  border-radius: 9px;
  background: var(--paper-blue);
}

.report-stats dt {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.report-stats dd {
  margin: .2rem 0 0;
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
}

.report-score {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 4px solid var(--blue-100);
  border-top-color: var(--blue-700);
  border-radius: 50%;
  color: var(--blue-700);
  font-family: var(--font-mono);
  font-weight: 900;
}

.empty-state {
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--muted);
  text-align: center;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: .5rem;
}

.empty-state p {
  max-width: 520px;
  margin-inline: auto;
}

/* Editorial, guides and reference content */
.guide-layout {
  display: grid;
  align-items: start;
  gap: clamp(1.8rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) 270px;
}

.guide-main {
  min-width: 0;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 22px);
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.toc h2,
.toc h3 {
  margin: 0 0 .65rem;
  font-size: .82rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.toc ol,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li + li {
  margin-top: .18rem;
}

.toc a {
  display: block;
  padding: .42rem .55rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover,
.toc a[aria-current="true"] {
  background: var(--blue-050);
  color: var(--blue-700);
}

.prose {
  color: var(--ink-soft);
  font-size: 1.03rem;
}

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

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

.prose h2,
.prose h3,
.prose h4 {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.prose h2 {
  margin-top: 2.35em;
  padding-top: .2em;
}

.prose h3 {
  margin-top: 1.75em;
}

.prose a {
  font-weight: 650;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: .45rem;
  padding-left: .18rem;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: .9rem 1.1rem;
  border-left: 4px solid var(--blue-700);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--blue-050);
  color: var(--navy-850);
}

.prose code:not(pre code) {
  padding: .14rem .35rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-blue);
  color: var(--red-700);
  font-family: var(--font-mono);
  font-size: .88em;
}

.prose pre,
pre.code-block {
  padding: 1rem;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--navy-950);
  color: #d7e7f8;
  font-family: var(--font-mono);
  font-size: .86rem;
}

.notice,
.callout {
  position: relative;
  margin: 1.4rem 0;
  padding: 1rem 1rem 1rem 1.15rem;
  border: 1px solid #b8d2f4;
  border-left: 4px solid var(--blue-700);
  border-radius: var(--radius-md);
  background: var(--blue-050);
  color: var(--navy-850);
}

.notice.warning,
.callout.warning {
  border-color: #ebcf85;
  border-left-color: var(--amber-500);
  background: #fff8e8;
}

.notice.danger,
.callout.danger {
  border-color: #efb1b8;
  border-left-color: var(--red-600);
  background: #fff0f2;
}

.notice.success,
.callout.success {
  border-color: #aadbbf;
  border-left-color: var(--green-600);
  background: #edf9f2;
}

.notice strong:first-child,
.callout strong:first-child {
  color: var(--navy-950);
}

.notice p:last-child,
.callout p:last-child {
  margin-bottom: 0;
}

.comparison:not(table) {
  display: grid;
  margin: 1.5rem 0;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison:not(table) > * {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.table-wrap {
  width: 100%;
  margin: 1.4rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
table.comparison {
  display: table;
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: .91rem;
  text-align: left;
}

.table-wrap th,
.table-wrap td,
table.comparison th,
table.comparison td {
  min-width: 120px;
  padding: .82rem .9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-wrap th,
table.comparison th {
  background: var(--paper-blue);
  color: var(--navy-850);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.table-wrap tr:last-child td,
table.comparison tr:last-child td {
  border-bottom: 0;
}

.table-wrap tbody tr:hover {
  background: #fbfdff;
}

.faq {
  border-top: 1px solid var(--line);
}

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

.faq summary {
  position: relative;
  padding: 1.15rem 2.3rem 1.15rem 0;
  color: var(--navy-950);
  font-weight: 800;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  position: absolute;
  top: 50%;
  right: .25rem;
  color: var(--blue-700);
  font-size: 1.35rem;
  content: "+";
  transform: translateY(-50%);
}

.faq details[open] summary::after {
  content: "-";
}

.faq .answer,
.faq details > :not(summary) {
  max-width: 820px;
  padding: 0 2rem 1.15rem 0;
  color: var(--ink-soft);
}

/* Forms */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  min-width: 0;
}

.field.full,
.form-grid .full-width {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  display: block;
  margin-bottom: .38rem;
  color: var(--navy-850);
  font-size: .86rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 47px;
  padding: .7rem .82rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--white);
  box-shadow: inset 0 1px 2px rgb(5 14 27 / 4%);
  color: var(--ink);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgb(31 99 198 / 13%);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--red-600);
  box-shadow: 0 0 0 4px rgb(214 41 62 / 10%);
}

.field-help,
.field-error {
  display: block;
  margin-top: .34rem;
  color: var(--muted);
  font-size: .78rem;
}

.field-error {
  color: var(--red-700);
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.checkbox-row input {
  width: 19px;
  height: 19px;
  margin-top: .2rem;
  accent-color: var(--blue-700);
}

/* Ads are hidden when no approved markup is rendered. */
.ad-slot {
  position: relative;
  display: grid;
  width: min(100%, 970px);
  min-height: var(--ad-height, 250px);
  margin: clamp(2rem, 5vw, 3.8rem) auto;
  padding: 20px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f4f6f8;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

/* Final responsive safeguards: keep the primary action visible and the desktop
   header free of mobile-only controls after the shared icon rules apply. */
.home-page .hero {
  padding-top: clamp(3rem, 5vw, 4.5rem);
}

.home-page .hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.icon-button.nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  .icon-button.nav-toggle {
    display: grid;
  }
}

.ad-slot[data-enabled="false"] {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tester-shell + .ad-slot,
.ad-slot + .tester-shell {
  margin-top: clamp(3rem, 7vw, 5rem);
}

/* Cookie preference and transient messages */
.cookie-banner {
  position: fixed;
  z-index: 2000;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  width: min(calc(100% - 36px), 960px);
  margin-inline: auto;
  padding: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #324c69;
  border-radius: var(--radius-lg);
  background: rgb(7 20 38 / 97%);
  box-shadow: var(--shadow-lg);
  color: #dbe7f2;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  font-size: .86rem;
  line-height: 1.5;
}

.cookie-banner a {
  color: #9bc2ff;
}

.cookie-banner .actions {
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  z-index: 2100;
  right: 18px;
  bottom: 18px;
  max-width: min(calc(100% - 36px), 390px);
  padding: .85rem 1rem;
  border: 1px solid #324c69;
  border-radius: 12px;
  background: var(--navy-950);
  box-shadow: var(--shadow-lg);
  color: var(--white);
  font-size: .87rem;
  font-weight: 700;
  transform: translateY(0);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.toast[hidden],
.toast.is-hiding {
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

/* Footer and mobile dock */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: clamp(3.2rem, 7vw, 5.5rem) 0 1.35rem;
  overflow: hidden;
  background: var(--navy-950);
  color: #aebfd0;
}

.site-footer::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-600) 0 45%, var(--white) 45% 55%, var(--red-600) 55%);
  content: "";
  opacity: .86;
}

.footer-grid {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  grid-template-columns: minmax(240px, 1.25fr) repeat(3, minmax(140px, .75fr));
}

.site-footer .brand {
  margin-bottom: 1rem;
  color: var(--white);
}

.site-footer .brand-mark {
  border-color: #9db8d5;
  background: #102b4e;
}

.footer-about {
  max-width: 360px;
  font-size: .89rem;
}

.site-footer h2,
.site-footer h3,
.site-footer h4 {
  margin-bottom: .85rem;
  color: var(--white);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

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

.footer-links li + li {
  margin-top: .42rem;
}

.footer-links a {
  color: #b6c6d6;
  font-size: .86rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  margin-top: 2.8rem;
  padding-top: 1.2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: #8799aa;
  font-size: .76rem;
}

.footer-bottom p {
  margin: 0;
}

.mobile-dock {
  display: none;
}

/* Optional dark reading theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #07111d;
  --paper-blue: #0b1929;
  --white: #0d1d2e;
  --ink: #f3f7fb;
  --ink-soft: #d2deea;
  --muted: #a4b4c4;
  --line: #263c55;
  --line-strong: #3e5670;
  --blue-050: #102b4e;
  --blue-100: #1a3d67;
}

html[data-theme="dark"] .site-header {
  background: rgb(7 17 29 / 92%);
  border-bottom-color: #263c55;
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .brand {
  color: #e8f0f7;
}

html[data-theme="dark"] .page-hero {
  background: linear-gradient(180deg, rgb(16 43 78 / 52%), transparent);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .input {
  background: #091522;
}

/* Responsive behavior */
@media (max-width: 1080px) {
  .nav-links a {
    padding-inline: .55rem;
    font-size: .85rem;
  }

  .feature-grid.four-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.4fr repeat(2, 1fr);
  }

  .footer-grid > :last-child {
    grid-column: 2 / -1;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .container,
  .container-narrow,
  .narrow {
    width: min(calc(100% - 32px), var(--container));
  }

  .site-header .container,
  .nav {
    min-height: var(--header-height);
  }

  .nav-links,
  .nav-actions .button-secondary {
    display: none;
  }

  .nav-toggle {
    display: grid;
    margin-left: auto;
  }

  .nav-links.is-open {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: 16px;
    display: grid;
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-md);
  }

  .nav-links.is-open a {
    width: 100%;
    min-height: 44px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-panel {
    width: min(100%, 680px);
  }

  .content-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tester-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .controller-stage {
    min-height: 460px;
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
  }

  .controller-visual {
    width: min(75%, 420px);
  }

  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    grid-row: 1;
  }

  .toc ul,
  .toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: var(--mobile-dock-height);
    font-size: 15.5px;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3.25rem);
  }

  .site-header .nav-actions .button-primary {
    display: none;
  }

  .hero {
    padding-top: 2.7rem;
  }

  .hero::after {
    right: -310px;
  }

  .hero-panel {
    border-radius: var(--radius-lg);
  }

  .content-grid,
  .feature-grid,
  .feature-grid.four-up,
  .reports-grid,
  .form-grid,
  .comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .tester-shell {
    width: calc(100% - 16px);
    margin-block: 1rem 2.2rem;
    border-radius: 19px;
  }

  .tester-toolbar {
    min-height: auto;
    padding: .85rem;
    align-items: stretch;
    flex-direction: column;
  }

  .tester-toolbar .actions {
    width: 100%;
    overflow-x: auto;
  }

  .tester-shell select,
  .device-picker {
    max-width: 100%;
    width: 100%;
  }

  .controller-stage {
    min-height: 390px;
    padding: 4rem .65rem 1.4rem;
  }

  .controller-stage-header {
    top: .85rem;
    right: .85rem;
    left: .85rem;
  }

  .controller-visual {
    width: min(94%, 390px);
  }

  .tester-panels {
    padding: .8rem;
  }

  .button-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toc ul,
  .toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > :first-child,
  .footer-grid > :last-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-dock {
    position: fixed;
    z-index: 950;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: var(--mobile-dock-height);
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid rgb(189 201 215 / 78%);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -8px 26px rgb(5 14 27 / 10%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    backdrop-filter: saturate(150%) blur(14px);
  }

  .mobile-dock a {
    display: flex;
    min-width: 0;
    min-height: 56px;
    padding: .28rem .1rem;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: .64rem;
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
    text-decoration: none;
    flex-direction: column;
  }

  .mobile-dock a::before {
    display: block;
    color: currentcolor;
    font-size: 1.05rem;
    content: attr(data-icon);
  }

  .mobile-dock a:hover,
  .mobile-dock a[aria-current="page"],
  .mobile-dock a.is-active {
    background: var(--blue-050);
    color: var(--blue-700);
  }

  html[data-theme="dark"] .mobile-dock {
    border-color: #263c55;
    background: rgb(7 17 29 / 96%);
  }

  .cookie-banner {
    bottom: calc(var(--mobile-dock-height) + 10px);
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-banner .actions .button {
    flex: 1 1 auto;
  }

  .toast {
    bottom: calc(var(--mobile-dock-height) + 10px);
  }
}

@media (max-width: 480px) {
  .container,
  .container-narrow,
  .narrow {
    width: min(calc(100% - 24px), var(--container));
  }

  .brand {
    font-size: .92rem;
  }

  .brand-mark {
    width: 32px;
    height: 28px;
  }

  .button-row .button,
  .actions.stack-mobile .button {
    width: 100%;
  }

  .hero-trust {
    display: grid;
  }

  .controller-stage {
    min-height: 330px;
  }

  .live-grid,
  .axis-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-card-header {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .table-wrap th,
  .table-wrap td,
  table.comparison th,
  table.comparison td {
    padding: .68rem .7rem;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid > * {
    grid-column: auto !important;
  }

  .mobile-dock a {
    font-size: .6rem;
  }
}

/* Actual template integration layer */
[hidden] {
  display: none !important;
}

#main-content {
  min-height: 62vh;
}

.header-inner,
.footer-main,
.footer-bottom {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.7rem);
}

.brand-copy {
  display: flex;
  align-items: baseline;
  letter-spacing: -.025em;
}

.brand-copy strong {
  font-weight: 850;
}

.brand-copy small {
  color: var(--red-600);
  font-size: .74em;
  font-weight: 900;
}

.brand-mark > span {
  position: relative;
  z-index: 2;
  color: var(--navy-850);
  font-size: .7rem;
  font-weight: 950;
}

.brand-mark > i {
  position: absolute;
  bottom: 4px;
  left: 7px;
  width: 9px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--blue-700);
}

.nav-primary {
  display: flex;
  width: auto;
  min-height: var(--header-height);
  margin-left: auto;
  align-items: center;
  gap: .15rem;
}

.nav-primary a {
  display: inline-flex;
  min-height: 42px;
  padding: .56rem .75rem;
  align-items: center;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: .89rem;
  font-weight: 750;
  text-decoration: none;
}

.nav-primary a:hover,
.nav-primary a.is-active {
  background: var(--blue-050);
  color: var(--blue-700);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-lab-link span {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding-inline: .3rem;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--navy-850);
  color: var(--white);
  font-size: .7rem;
}

.button-ghost {
  --button-bg: transparent;
  --button-border: var(--line);
  --button-color: var(--navy-850);
  box-shadow: none;
}

.button-ghost:hover {
  --button-bg: var(--blue-050);
}

.button-ghost-light {
  --button-bg: rgb(255 255 255 / 6%);
  --button-border: rgb(255 255 255 / 18%);
  --button-color: var(--white);
  box-shadow: none;
}

.button-ghost-light:hover {
  --button-bg: rgb(255 255 255 / 12%);
  --button-border: rgb(145 188 255 / 52%);
}

.button-large {
  min-height: 52px;
  padding: .88rem 1.25rem;
  border-radius: 12px;
  font-size: .98rem;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--navy-850);
  font-size: 1.15rem;
}

.mobile-menu {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto 12px;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.mobile-menu a {
  display: flex;
  min-height: 44px;
  padding: .65rem .75rem;
  align-items: center;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 750;
  text-decoration: none;
}

.mobile-menu a:hover {
  background: var(--blue-050);
  color: var(--blue-700);
}

.breadcrumbs {
  display: block;
  width: min(calc(100% - 40px), var(--container));
  margin: 1rem auto 0;
}

.breadcrumbs ol {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.breadcrumbs li:not(:last-child)::after {
  color: var(--line-strong);
  content: "/";
}

.breadcrumbs li:last-child {
  color: var(--muted);
}

.hero-grid {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.hero-lede {
  max-width: 690px;
  margin-bottom: 1.55rem;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 1.8vw, 1.26rem);
  line-height: 1.62;
}

.hero-badge {
  display: inline-flex;
  min-height: 31px;
  margin-bottom: 1rem;
  padding: .35rem .72rem;
  align-items: center;
  gap: .42rem;
  border: 1px solid #b8d2f4;
  border-radius: var(--radius-pill);
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: .76rem;
  font-weight: 850;
}

.hero-badge span {
  color: var(--red-600);
  font-size: .7rem;
}

.hero-actions,
.action-cluster,
.editorial-actions,
.report-view-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
}

.trust-list {
  display: flex;
  margin: 1.25rem 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: .55rem 1.15rem;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
  list-style: none;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.trust-list li span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: .68rem;
  font-weight: 950;
}

.hero-preview {
  position: relative;
  min-width: 0;
  padding: clamp(1rem, 2.6vw, 1.55rem);
  overflow: hidden;
  border: 1px solid #294665;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 90% 2%, rgb(47 118 220 / 28%), transparent 33%),
    radial-gradient(circle at 6% 94%, rgb(214 41 62 / 14%), transparent 31%),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-lg);
  color: #d5e1ed;
}

.hero-preview::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(rgb(255 255 255 / 8%) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 65%);
  pointer-events: none;
}

.preview-top,
.preview-stats,
.hero-preview > p {
  position: relative;
  z-index: 3;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-top small {
  color: #8ea5bb;
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.status-pill i {
  display: none;
}

.status-connected {
  border-color: #a8dec2;
  background: var(--green-100);
  color: var(--green-700);
}

.status-connected::before {
  background: var(--green-600);
  box-shadow: 0 0 0 3px rgb(25 135 84 / 17%);
}

.hero-preview .status-connected,
.tester-shell .status-connected,
.tester-shell .status-pill[data-state="connected"],
.tester-shell .status-pill[data-state="ready"] {
  border-color: #62b98e;
  background: rgb(20 116 71 / 18%);
  color: #a7ebc7;
}

.hero-preview .status-connected::before,
.tester-shell .status-connected::before,
.tester-shell .status-pill[data-state="connected"]::before,
.tester-shell .status-pill[data-state="ready"]::before {
  background: #48cb88;
  box-shadow: 0 0 0 3px rgb(72 203 136 / 17%);
}

.status-waiting,
.status-pill[data-state="waiting"] {
  border-color: rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 6%);
  color: #c3d0dc;
}

.status-pill[data-state="testing"] {
  border-color: #7aaaf0;
  background: rgb(47 118 220 / 20%);
  color: #c8deff;
}

.status-pill[data-state="testing"]::before {
  background: #75adff;
  box-shadow: 0 0 0 3px rgb(117 173 255 / 18%);
}

.preview-controller {
  position: relative;
  z-index: 2;
  width: min(90%, 370px);
  aspect-ratio: 1.65;
  margin: clamp(1.4rem, 5vw, 2.8rem) auto 1.35rem;
  filter: drop-shadow(0 18px 25px rgb(0 0 0 / 35%));
}

.preview-body {
  position: absolute;
  z-index: 2;
  inset: 6% 7% 15%;
  border: 2px solid #6c8299;
  border-radius: 42% 42% 35% 35% / 42% 42% 58% 58%;
  background: linear-gradient(145deg, #3b5269, #142538 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -13px 22px rgb(0 0 0 / 24%);
}

.preview-grip {
  position: absolute;
  z-index: 1;
  bottom: 1%;
  width: 31%;
  height: 58%;
  border: 2px solid #60758f;
  background: linear-gradient(150deg, #334a61, #101d2c);
}

.preview-grip.left {
  left: 8%;
  transform: rotate(16deg);
  border-radius: 50% 20% 70% 40%;
}

.preview-grip.right {
  right: 8%;
  transform: rotate(-16deg);
  border-radius: 20% 50% 40% 70%;
}

.preview-dpad {
  position: absolute;
  top: 33%;
  left: 19%;
  display: grid;
  width: 18%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 5px;
  background: #0a1521;
  color: #91a4b7;
  font-size: clamp(1rem, 3vw, 1.55rem);
  font-style: normal;
  line-height: 1;
}

.preview-stick {
  position: absolute;
  bottom: 17%;
  width: 15%;
  aspect-ratio: 1;
  border: 4px solid #0b1622;
  border-radius: 50%;
  background: #324a62;
  box-shadow: 0 0 0 2px #5c7086;
}

.preview-stick.left { left: 36%; }
.preview-stick.right { right: 34%; }

.preview-buttons {
  position: absolute;
  top: 23%;
  right: 17%;
  width: 23%;
  aspect-ratio: 1;
  color: #e9b443;
  font-size: clamp(.7rem, 2vw, 1rem);
}

.preview-buttons > * {
  position: absolute;
  color: #69a4f7;
  font-style: normal;
}

.preview-buttons b { top: 34%; right: 0; color: #e75b6c; }
.preview-buttons em { bottom: 0; left: 38%; color: #63cd98; }
.preview-buttons strong { top: 34%; left: 0; color: #74a9f2; }

.preview-stats {
  display: grid;
  gap: .55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-stats > div {
  min-width: 0;
  padding: .75rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  background: rgb(255 255 255 / 5%);
}

.preview-stats span,
.preview-stats small {
  display: block;
  color: #92a6b9;
  font-size: .66rem;
}

.preview-stats strong {
  display: block;
  margin-block: .1rem;
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: .95rem;
  text-overflow: ellipsis;
}

.hero-preview > p {
  margin: .8rem 0 0;
  color: #8fa4b8;
  font-size: .71rem;
  text-align: center;
}

.compatibility-strip {
  display: flex;
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto clamp(1.8rem, 4vw, 3.4rem);
  padding: .88rem 1rem;
  align-items: center;
  gap: 1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.compatibility-strip > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.compatibility-strip > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .45rem 1rem;
}

.compatibility-strip b {
  color: var(--navy-850);
  font-size: .78rem;
  font-weight: 750;
}

.section {
  padding-inline: max(20px, calc((100vw - var(--container)) / 2));
}

.section > * {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.section-soft {
  border-block: 1px solid var(--line);
  background: var(--paper-blue);
}

.section-tester {
  background: linear-gradient(180deg, transparent, rgb(238 245 255 / 55%) 42%, transparent);
}

.section-heading {
  max-width: 760px;
  margin-bottom: clamp(1.6rem, 4vw, 2.7rem);
}

.section-heading > p,
.split-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-heading.centered,
.centered.section-heading {
  margin-inline: auto;
  text-align: center;
}

.section-heading.centered > p {
  max-width: 680px;
  margin-inline: auto;
}

.split-heading {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.split-heading > :first-child {
  max-width: 720px;
}

.split-heading > p,
.split-heading > .text-link {
  max-width: 430px;
}

.section-kicker {
  display: block;
  margin-bottom: .35rem;
  color: #8db8f3;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .085em;
  line-height: 1.25;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #9fc5ff;
}

.eyebrow-light::before {
  background: linear-gradient(90deg, #72a9f7 0 55%, #f06b7a 55%);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--blue-700);
  font-weight: 850;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link-light {
  color: #9bc3ff;
}

.steps-grid,
.directory-grid,
.related-grid,
.guide-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steps-grid article,
.directory-card,
.feature-card,
.guide-cards > a {
  position: relative;
  min-width: 0;
  padding: clamp(1.15rem, 2.5vw, 1.55rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.steps-grid article > span:first-child {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #a5b3c1;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 850;
}

.step-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 1.2rem;
  font-weight: 900;
}

.steps-grid p,
.directory-card p,
.feature-card p,
.guide-cards p {
  color: var(--muted);
}

.directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.controller-directory-grid,
.guide-directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-card,
.feature-card,
.guide-cards > a {
  display: flex;
  color: inherit;
  text-decoration: none;
  flex-direction: column;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.directory-card:hover,
.feature-card:hover,
.guide-cards > a:hover {
  transform: translateY(-3px);
  border-color: #91afd2;
  box-shadow: var(--shadow-md);
  color: inherit;
}

.directory-card small,
.feature-card small,
.guide-cards > a > span,
.related-grid .card > span {
  margin-bottom: .45rem;
  color: var(--blue-700);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.directory-card h2 {
  font-size: 1.22rem;
}

.directory-card b,
.feature-card b,
.guide-cards b,
.related-grid .card b {
  margin-top: auto;
  padding-top: .7rem;
  color: var(--blue-700);
  font-size: .83rem;
  font-weight: 850;
}

.feature-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card-primary {
  border-color: #8eb4e3;
  background: linear-gradient(150deg, var(--white), var(--blue-050));
  box-shadow: 0 12px 30px rgb(23 78 166 / 10%);
}

.editorial-grid {
  display: grid;
  align-items: center;
  gap: clamp(1.7rem, 5vw, 4.2rem);
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
}

.editorial-grid > div > p {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.accuracy-card,
.checklist-card,
.device-card,
.page-hero-card,
.form-card {
  min-width: 0;
  padding: clamp(1.15rem, 2.7vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.accuracy-card {
  border-color: #294868;
  background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
  color: #c6d4e1;
}

.accuracy-card h3 {
  color: var(--white);
}

.accuracy-seal {
  display: grid;
  width: 86px;
  height: 86px;
  margin-bottom: 1.1rem;
  place-items: center;
  align-content: center;
  border: 2px solid #77a9eb;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgb(119 169 235 / 12%);
  color: var(--white);
}

.accuracy-seal span {
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.accuracy-seal small {
  color: #95b9e8;
  font-size: .48rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.accuracy-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.accuracy-card li {
  padding: .68rem 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
  font-size: .84rem;
}

.accuracy-card li span {
  display: block;
  color: #8fbbf3;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.section-dark .guide-cards > a {
  border-color: rgb(255 255 255 / 12%);
  background: rgb(255 255 255 / 5%);
  color: var(--white);
}

.section-dark .guide-cards p {
  color: #aebfd0;
}

.section-dark .guide-cards b {
  color: #91bcff;
}

.faq-list {
  max-width: 900px;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 1.15rem 2.4rem 1.15rem 0;
  color: var(--navy-950);
  font-weight: 800;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 50%;
  right: .25rem;
  color: var(--blue-700);
  font-size: 1.3rem;
  content: "+";
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list details > div {
  max-width: 820px;
  padding: 0 2.2rem 1.1rem 0;
  color: var(--ink-soft);
}

.final-cta {
  display: flex;
  width: min(calc(100% - 40px), var(--container));
  margin: clamp(3rem, 7vw, 6rem) auto;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid #29496c;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 91% 0%, rgb(47 118 220 / 30%), transparent 35%),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-lg);
  color: #c3d2df;
}

.section.final-cta {
  width: min(calc(100% - 40px), var(--container));
  padding: clamp(1.6rem, 4vw, 2.6rem);
}

.section.final-cta > * {
  width: auto;
  max-width: none;
  margin-inline: 0;
}

.final-cta h2 {
  margin-bottom: .35rem;
  color: var(--white);
}

.final-cta p {
  margin: 0;
}

.page-hero {
  display: grid;
  min-height: 410px;
  padding-right: max(20px, calc((100vw - var(--container)) / 2));
  padding-left: max(20px, calc((100vw - var(--container)) / 2));
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, .72fr);
}

.page-hero > div {
  min-width: 0;
}

.page-hero > div > p {
  max-width: 780px;
  color: var(--ink-soft);
  font-size: clamp(1.04rem, 1.6vw, 1.18rem);
}

.page-hero-card,
.device-card {
  align-self: center;
}

.page-hero-card > strong,
.device-card > strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--navy-950);
  font-size: 1.05rem;
  line-height: 1.35;
}

.page-hero-card p,
.device-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
}

.device-card {
  border-color: #294969;
  background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
  color: #bacbdb;
}

.device-card > span {
  display: block;
  margin-bottom: .35rem;
  color: #8fbafa;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.device-card > strong {
  color: var(--white);
}

.device-card small {
  color: #a7b8c8;
}

.device-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  place-items: center;
  border: 1px solid rgb(145 188 255 / 28%);
  border-radius: 13px;
  background: rgb(145 188 255 / 10%);
  color: #9cc3ff;
  font-size: 1.25rem;
}

.article-meta {
  display: flex;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: .45rem .9rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.article-meta span:not(:last-child)::after {
  margin-left: .9rem;
  color: var(--line-strong);
  content: "|";
}

.guide-layout {
  grid-template-columns: 270px minmax(0, 1fr);
}

.guide-layout > .toc {
  grid-column: 1;
}

.guide-layout > .prose {
  grid-column: 2;
}

.toc {
  display: flex;
  gap: .15rem;
  flex-direction: column;
}

.toc > strong {
  margin-bottom: .45rem;
  color: var(--navy-850);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.toc > a {
  display: block;
  padding: .45rem .55rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.toc > a:hover {
  background: var(--blue-050);
  color: var(--blue-700);
}

.prose > section {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.prose > section + section {
  margin-top: clamp(2.8rem, 6vw, 4.8rem);
}

.checklist-card {
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.check-list {
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  padding: .65rem 0;
  align-items: flex-start;
  gap: .65rem;
  border-top: 1px solid var(--line);
}

.check-list li span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: .7rem;
  font-weight: 950;
}

.feature-check-list,
.policy-list {
  padding: .6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.numbered-steps {
  margin: 1.4rem 0;
  padding: 0;
  list-style: none;
}

.numbered-steps li {
  display: grid;
  padding: 1rem 0;
  align-items: start;
  gap: 1rem;
  border-top: 1px solid var(--line);
  grid-template-columns: 48px minmax(0, 1fr);
}

.numbered-steps li > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--navy-850);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 850;
}

.numbered-steps p {
  margin: .45rem 0 0;
}

.detailed-steps li {
  padding-block: 1.2rem;
}

.inline-tool-cta {
  display: flex;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  border: 1px solid #294969;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
  color: #b9cad9;
}

.inline-tool-cta h2 {
  margin-bottom: .35rem;
  color: var(--white);
}

.inline-tool-cta p {
  margin: 0;
}

.notice-info {
  border-color: #b8d2f4;
  border-left-color: var(--blue-700);
  background: var(--blue-050);
}

.notice-warning {
  border-color: #ebcf85;
  border-left-color: var(--amber-500);
  background: #fff8e8;
}

.notice-error {
  border-color: #efb1b8;
  border-left-color: var(--red-600);
  background: #fff0f2;
}

.notice-success {
  border-color: #aadbbf;
  border-left-color: var(--green-600);
  background: #edf9f2;
}

.notice h2,
.notice h3 {
  margin-bottom: .4rem;
  font-size: 1.05rem;
}

.ad-safe-zone {
  position: relative;
  isolation: isolate;
  width: min(calc(100% - 40px), 970px);
  margin: clamp(2.5rem, 6vw, 4.8rem) auto;
  text-align: center;
}

.ad-label {
  display: block;
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ad-safe-zone .ad-slot {
  margin: 0 auto;
  min-height: 250px;
}

.ad-safe-zone .ad-slot::before {
  display: none;
  content: none;
}

/* Keep approved ads clearly separate from controller actions. */
.tester-shell + .ad-safe-zone,
.ad-safe-zone + .tester-shell,
.section-tester + .ad-safe-zone,
.ad-safe-zone + .section-tester {
  margin-top: max(150px, 8rem);
}

.tester-shell .ad-safe-zone {
  display: none;
}

.inline-tool-cta + .ad-safe-zone {
  margin-top: max(150px, 8rem);
}

/* Exact tester dashboard markup */
.tester-toolbar > div:first-child {
  min-width: 0;
}

.tester-toolbar > div:first-child > p {
  max-width: 690px;
  margin: .35rem 0 0;
  color: #9db0c3;
  font-size: .86rem;
}

.connection-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}

.connection-controls .status-pill {
  min-width: max-content;
}

.tester-intro {
  display: flex;
  padding: .9rem clamp(1rem, 2.4vw, 1.65rem);
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: rgb(23 78 166 / 10%);
}

.tester-intro p {
  margin: 0;
  color: #b9c8d7;
  font-size: .82rem;
}

.tester-intro strong {
  color: var(--white);
}

.privacy-chip {
  display: inline-flex;
  min-width: max-content;
  padding: .35rem .65rem;
  align-items: center;
  gap: .4rem;
  border: 1px solid rgb(72 203 136 / 30%);
  border-radius: var(--radius-pill);
  background: rgb(20 116 71 / 15%);
  color: #9ee2bf;
  font-size: .69rem;
  font-weight: 850;
}

.tester-dashboard {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(330px, .82fr) minmax(390px, 1.18fr);
}

.tester-dashboard .controller-stage {
  min-height: 565px;
}

.device-readout {
  position: absolute;
  z-index: 5;
  top: 1.2rem;
  right: 1.2rem;
  left: 1.2rem;
  min-width: 0;
}

.device-readout > span,
.device-readout > small {
  display: block;
  color: #8fa4b8;
  font-size: .69rem;
}

.device-readout > span {
  margin-bottom: .2rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.device-readout > strong {
  display: block;
  max-width: 100%;
  margin-bottom: .12rem;
  overflow: hidden;
  color: var(--white);
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controller-grip.grip-left {
  left: 7%;
  transform: rotate(16deg);
  border-radius: 52% 20% 68% 42%;
}

.controller-grip.grip-right {
  right: 7%;
  transform: rotate(-16deg);
  border-radius: 20% 52% 42% 68%;
}

.shoulder {
  position: absolute;
  z-index: 5;
  top: -11%;
  display: grid;
  width: 28%;
  height: 17%;
  place-items: center;
  border: 1px solid #657b93;
  background: linear-gradient(#415a73, #17283a);
  color: #b7c6d4;
  font-size: .58rem;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 17%);
}

.shoulder-left {
  left: 8%;
  transform: rotate(-4deg);
  border-radius: 18px 9px 5px 9px;
}

.shoulder-right {
  right: 8%;
  transform: rotate(4deg);
  border-radius: 9px 18px 9px 5px;
}

.shoulder.is-active,
.shoulder[data-active="true"] {
  border-color: #8ebdff;
  background: var(--blue-600);
  color: var(--white);
}

.dpad-visual {
  position: absolute;
  z-index: 5;
  top: 31%;
  left: 17%;
  width: 22%;
  aspect-ratio: 1;
}

.dpad-key {
  position: absolute;
  display: grid;
  width: 34%;
  height: 34%;
  place-items: center;
  border: 1px solid #52667b;
  background: #09131e;
  color: #73879a;
  font-size: clamp(.48rem, 1vw, .7rem);
  line-height: 1;
}

.dpad-up { top: 0; left: 33%; border-radius: 5px 5px 0 0; border-bottom: 0; }
.dpad-right { top: 33%; right: 0; border-radius: 0 5px 5px 0; border-left: 0; }
.dpad-down { bottom: 0; left: 33%; border-radius: 0 0 5px 5px; border-top: 0; }
.dpad-left { top: 33%; left: 0; border-radius: 5px 0 0 5px; border-right: 0; }

.dpad-key.is-active,
.dpad-key[data-active="true"] {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 0 14px rgb(47 118 220 / 55%);
}

.center-controls {
  position: absolute;
  z-index: 5;
  top: 32%;
  right: 39%;
  left: 39%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
}

.center-controls span,
.center-controls i {
  display: grid;
  width: 19px;
  height: 12px;
  place-items: center;
  border: 1px solid #607388;
  border-radius: var(--radius-pill);
  background: #0a1521;
  color: #8497a9;
  font-size: .55rem;
  font-style: normal;
  font-weight: 800;
}

.center-controls i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue-600), #102238 65%);
}

.face-buttons .pad-y { top: 0; left: 32.5%; }
.face-buttons .pad-b { top: 32.5%; right: 0; }
.face-buttons .pad-a { bottom: 0; left: 32.5%; }
.face-buttons .pad-x { top: 32.5%; left: 0; }

.face-buttons .pad-y { color: #efbd4e; }
.face-buttons .pad-b { color: #f27786; }
.face-buttons .pad-a { color: #71d9a2; }
.face-buttons .pad-x { color: #7eb1f8; }

.stick-visual {
  position: absolute;
  z-index: 5;
  display: grid;
  width: 17%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #50647a;
  border-radius: 50%;
  background: #07111c;
  box-shadow: inset 0 4px 12px rgb(0 0 0 / 72%), 0 0 0 5px rgb(255 255 255 / 3%);
}

.stick-visual > i {
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid #63768a;
  border-radius: 50%;
  background: radial-gradient(circle, #283c51 0 32%, #142537 33% 68%, #354b61 70%);
  transform: translate(var(--stick-x, 0), var(--stick-y, 0));
}

.stick-visual > span {
  position: absolute;
  color: #718598;
  font-size: .45rem;
  font-weight: 850;
}

.quick-metrics {
  position: absolute;
  z-index: 6;
  right: clamp(.8rem, 2vw, 1.3rem);
  bottom: clamp(.8rem, 2vw, 1.3rem);
  left: clamp(.8rem, 2vw, 1.3rem);
  display: grid;
  gap: .45rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-metrics > div {
  min-width: 0;
  padding: .65rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 9px;
  background: rgb(3 9 16 / 70%);
  backdrop-filter: blur(8px);
}

.quick-metrics span,
.quick-metrics small,
.quick-metrics strong {
  display: block;
}

.quick-metrics span,
.quick-metrics small {
  overflow: hidden;
  color: #8297aa;
  font-size: .58rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-metrics strong {
  margin-block: .08rem;
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-panel {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 1.55rem);
  background: rgb(3 9 16 / 24%);
}

.panel-heading {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
}

.stick-monitors {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stick-monitors figure {
  min-width: 0;
  margin: 0;
  padding: .75rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  background: rgb(0 0 0 / 17%);
}

.stick-monitors canvas {
  width: 100%;
  min-height: 190px;
  aspect-ratio: 1.2;
  border-radius: 8px;
  background: #030a12;
}

.stick-monitors figcaption {
  display: flex;
  margin-top: .55rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #99acbe;
  font-size: .67rem;
}

.stick-monitors figcaption strong {
  color: #d7e2ec;
}

.stick-monitors figcaption span {
  font-family: var(--font-mono);
}

.trigger-monitors {
  display: grid;
  margin-top: .8rem;
  gap: .7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trigger-monitors small {
  display: block;
  margin-top: .45rem;
  color: var(--tester-muted, #b9c8db);
  font-size: .72rem;
  line-height: 1.35;
}

.vibration-confirmation {
  display: grid;
  gap: .65rem;
  width: 100%;
  margin-top: .65rem;
}

.vibration-confirmation > span {
  color: var(--tester-muted, #b9c8db);
  font-size: .8rem;
  font-weight: 700;
}

.trigger-monitors > div {
  min-width: 0;
}

.trigger-monitors > div > span {
  display: flex;
  margin-bottom: .38rem;
  align-items: center;
  justify-content: space-between;
  color: #a9bac9;
  font-size: .71rem;
  font-weight: 750;
}

.trigger-monitors strong {
  color: var(--white);
  font-family: var(--font-mono);
}

.meter,
.progress {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: #02070d;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 62%);
}

.meter > i,
.progress > i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--red-500));
  transition: width 70ms linear;
}

.test-modules {
  display: grid;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  gap: .8rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-module {
  display: grid;
  min-height: 0;
  padding: 1rem;
  align-items: start;
  gap: .85rem;
  grid-template-columns: auto minmax(0, 1fr);
}

.test-module[data-module="drift"],
.test-module[data-module="mapping"] {
  grid-column: 1 / -1;
}

.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgb(145 188 255 / 20%);
  border-radius: 11px;
  background: rgb(47 118 220 / 14%);
  color: #9bc2ff;
  font-size: 1.1rem;
}

.module-copy {
  min-width: 0;
}

.module-copy h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
}

.module-copy > p {
  margin: 0;
  color: #9aadc0;
  font-size: .78rem;
}

.metric-result {
  grid-column: 2;
  margin-top: .75rem;
  padding: .7rem .75rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 9px;
  background: rgb(0 0 0 / 15%);
  color: #b7c7d6;
  font-size: .74rem;
}

.metric-result[data-tone="ready"] {
  border-color: rgb(72 203 136 / 34%);
  background: rgb(20 116 71 / 12%);
}

.metric-result[data-tone="warning"] {
  border-color: rgb(228 155 22 / 38%);
  background: rgb(140 90 0 / 15%);
}

.metric-result .test-result__title {
  display: block;
  margin-bottom: .55rem;
  color: var(--white);
  font-size: .78rem;
}

.test-result__list {
  display: grid;
  margin: 0;
  gap: .38rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-result__row {
  min-width: 0;
  padding: .45rem;
  border-radius: 7px;
  background: rgb(255 255 255 / 4%);
}

.test-result__label,
.test-result__value {
  margin: 0;
}

.test-result__label {
  color: #8499ac;
  font-size: .62rem;
}

.test-result__value {
  margin-top: .12rem;
  color: #e2edf7;
  font-family: var(--font-mono);
  font-size: .69rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.test-result__note,
.test-result__empty {
  margin: .6rem 0 0;
  color: #95a9bb;
  font-size: .67rem;
}

.test-result__empty {
  margin-top: 0;
}

.module-copy .progress {
  margin-top: .6rem;
}

.module-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: .5rem;
}

.circularity-mini {
  width: min(100%, 170px);
  aspect-ratio: 1;
  grid-column: 2;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  background: #030a12;
}

.button-coverage,
.axes-grid {
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  gap: .45rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.axes-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-meter {
  min-width: 0;
  padding: .62rem;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 9px;
  background: rgb(0 0 0 / 14%);
  transition: border-color 90ms linear, background-color 90ms linear;
}

.input-meter.is-active {
  border-color: rgb(100 164 247 / 62%);
  background: rgb(31 99 198 / 20%);
}

.input-meter__label,
.input-meter__value {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-meter__label {
  color: #91a5b7;
  font-size: .61rem;
  font-weight: 750;
}

.input-meter__value {
  margin: .2rem 0 .35rem;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 800;
}

.input-meter__progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  appearance: none;
  background: #02070d;
}

.input-meter__progress::-webkit-progress-bar {
  border-radius: inherit;
  background: #02070d;
}

.input-meter__progress::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), #76adfa);
}

.input-meter__progress::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), #76adfa);
}

.raw-details {
  min-width: 0;
  grid-column: 1 / -1;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.raw-details summary {
  padding: .75rem 0;
  color: #9ec3f5;
  font-size: .73rem;
  font-weight: 800;
  cursor: pointer;
}

.raw-details .raw-data {
  margin: 0;
}

.gct-mode-drift [data-module="drift"],
.gct-mode-deadzone [data-module="drift"],
.gct-mode-circularity [data-module="circularity"],
.gct-mode-buttons [data-module="buttons"],
.gct-mode-dpad [data-module="buttons"],
.gct-mode-triggers .trigger-monitors,
.gct-mode-vibration [data-module="vibration"],
.gct-mode-update-rate .quick-metrics,
.gct-mode-mapping [data-module="mapping"] {
  border-color: rgb(117 173 255 / 55%);
  box-shadow: inset 0 0 0 1px rgb(117 173 255 / 12%), 0 0 25px rgb(31 99 198 / 10%);
}

.report-actions {
  display: flex;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
  background: rgb(255 255 255 / 3%);
}

.report-actions h3 {
  margin-bottom: .25rem;
}

.report-actions p {
  max-width: 650px;
  margin: 0;
  color: #96a9bb;
  font-size: .76rem;
}

.tester-shell .report-actions .button-secondary {
  --button-bg: rgb(255 255 255 / 7%);
  --button-border: rgb(255 255 255 / 17%);
  --button-color: var(--white);
}

.tester-disclaimer {
  margin: 0;
  padding: .8rem 1.2rem;
  border-top: 1px solid rgb(255 255 255 / 8%);
  color: #768b9f;
  font-size: .69rem;
  text-align: center;
}

.toast {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast[data-tone="success"] { border-color: #4ba778; }
.toast[data-tone="warning"] { border-color: #cf901a; }

/* Contact, lab, report, error, and offline screens */
.contact-grid {
  display: grid;
  align-items: start;
  gap: clamp(1.8rem, 5vw, 4rem);
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
}

.contact-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 22px);
}

.direct-contact {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.direct-contact h3 {
  margin-bottom: .35rem;
  font-size: .96rem;
}

.direct-contact p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.form-card {
  box-shadow: var(--shadow-md);
}

.field-full {
  grid-column: 1 / -1;
}

.field small {
  display: block;
  margin-top: .3rem;
  color: var(--muted);
}

.field-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.form-submit {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-submit p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
}

.lab-summary {
  display: grid;
  margin-bottom: 1rem;
  gap: .75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lab-summary article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.lab-summary span,
.lab-summary small,
.lab-summary strong {
  display: block;
}

.lab-summary span,
.lab-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: .69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-summary strong {
  margin-block: .2rem;
  overflow: hidden;
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-toolbar {
  display: flex;
  margin: 1.2rem 0;
  padding: 1rem;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.search-field {
  width: min(100%, 460px);
}

.comparison-panel {
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid #9ebce0;
  border-radius: var(--radius-lg);
  background: var(--blue-050);
}

.comparison-panel .comparison {
  margin: 0;
}

.comparison-column {
  min-width: 0;
}

.comparison-column h3 {
  overflow-wrap: anywhere;
}

.comparison-column > p {
  color: var(--muted);
  font-size: .76rem;
}

.comparison-column dl {
  margin: 0;
}

.comparison-column dl > div {
  display: flex;
  padding: .5rem 0;
  justify-content: space-between;
  gap: .75rem;
  border-top: 1px solid var(--line);
}

.comparison-column dt,
.comparison-column dd {
  margin: 0;
  font-size: .74rem;
}

.comparison-column dt {
  color: var(--muted);
}

.comparison-column dd {
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-weight: 800;
  text-align: right;
}

.lab-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-card-head {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.report-card-title {
  min-width: 0;
}

.report-card-title h2 {
  margin: .55rem 0 .2rem;
  overflow-wrap: anywhere;
  font-size: 1.04rem;
}

.report-card-title p {
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
}

.compare-check {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: .42rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 750;
}

.compare-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-700);
}

.report-metrics {
  display: grid;
  margin: 0 0 1rem;
  gap: .5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-metrics > div {
  min-width: 0;
  padding: .65rem;
  border-radius: 9px;
  background: var(--paper-blue);
}

.report-metrics dt,
.report-metrics dd {
  margin: 0;
}

.report-metrics dt {
  color: var(--muted);
  font-size: .65rem;
}

.report-metrics dd {
  margin-top: .15rem;
  overflow-wrap: anywhere;
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-size: .79rem;
  font-weight: 800;
}

.report-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.report-data {
  margin-top: 1rem;
}

.report-data pre,
.shared-report__details pre {
  max-height: 420px;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 10px;
  background: var(--navy-950);
  color: #cbe0f5;
  font-family: var(--font-mono);
  font-size: .7rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state > span:first-child {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 15px;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 1.35rem;
}

.report-view-section {
  min-height: 360px;
}

.shared-report {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.shared-report__title {
  margin-bottom: .35rem;
}

.shared-report__meta,
.shared-report__note {
  color: var(--muted);
}

.shared-report__summary {
  display: grid;
  margin: 1.2rem 0;
  gap: .7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shared-report__row {
  min-width: 0;
  padding: .8rem;
  border-radius: 10px;
  background: var(--paper-blue);
}

.shared-report__row dt,
.shared-report__row dd {
  margin: 0;
}

.shared-report__row dt {
  color: var(--muted);
  font-size: .66rem;
}

.shared-report__row dd {
  margin-top: .22rem;
  overflow-wrap: anywhere;
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 800;
}

.shared-report__details {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.shared-report__details summary {
  padding: .85rem 0;
  color: var(--blue-700);
  font-weight: 800;
  cursor: pointer;
}

.shared-report__empty {
  margin: 0;
  padding: clamp(2rem, 6vw, 4rem) 1rem;
  color: var(--muted);
  text-align: center;
}

.shared-report[data-state="invalid"] {
  border-style: dashed;
  box-shadow: none;
}

.report-view-actions {
  margin-top: 1rem;
}

.loading-state {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: var(--muted);
}

.loading-state span {
  width: 24px;
  height: 24px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-700);
  border-radius: 50%;
  animation: gct-spin .8s linear infinite;
}

.loading-state p {
  margin: 0;
}

@keyframes gct-spin {
  to { transform: rotate(1turn); }
}

.error-layout {
  display: grid;
  width: min(calc(100% - 40px), 980px);
  min-height: 620px;
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 7rem);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
}

.error-code {
  color: transparent;
  font-size: clamp(7rem, 19vw, 13rem);
  font-weight: 950;
  letter-spacing: -.1em;
  line-height: .8;
  -webkit-text-stroke: 2px var(--blue-700);
  text-shadow: 12px 12px 0 rgb(214 41 62 / 12%);
}

.error-layout h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.error-layout p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.error-links {
  display: flex;
  margin-top: 1.4rem;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-size: .85rem;
  font-weight: 750;
}

.offline-page {
  display: grid;
  min-height: 100vh;
  padding: 20px;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgb(47 118 220 / 14%), transparent 35%),
    var(--paper);
}

.offline-page .empty-state {
  width: min(100%, 620px);
  box-shadow: var(--shadow-md);
}

/* Footer template structure */
.brand-inverse,
.brand-inverse:hover {
  color: var(--white);
}

.footer-main {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(250px, .85fr) minmax(0, 1.65fr);
}

.footer-brand > p {
  max-width: 380px;
  font-size: .87rem;
}

.footer-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  color: #8ed8b2;
  font-size: .76rem !important;
}

.footer-links {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer-links > div {
  min-width: 0;
}

.footer-links a {
  display: block;
  margin-bottom: .45rem;
}

.footer-bottom {
  width: min(calc(100% - 40px), var(--container));
}

/* Integration responsive refinements */
@media (max-width: 1080px) {
  .nav-primary a {
    padding-inline: .5rem;
    font-size: .82rem;
  }

  .button-coverage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-main {
    grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr);
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header-inner,
  .footer-main,
  .footer-bottom,
  .breadcrumbs,
  .hero-grid,
  .compatibility-strip {
    width: min(calc(100% - 32px), var(--container));
  }

  .nav-primary {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .nav-toggle {
    display: grid;
  }

  .page-hero {
    min-height: 0;
    padding-right: 16px;
    padding-left: 16px;
    grid-template-columns: minmax(0, 1fr);
  }

  .page-hero > div,
  .page-hero > aside {
    width: min(100%, var(--container));
    margin-inline: auto;
  }

  .page-hero > aside {
    width: min(100%, 680px);
    margin-left: max(0px, calc((100vw - var(--container)) / 2));
  }

  .tester-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .tester-dashboard .controller-stage {
    min-height: 500px;
  }

  .live-panel {
    border-top: 1px solid rgb(255 255 255 / 10%);
  }

  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-layout > .toc,
  .guide-layout > .prose {
    grid-column: 1;
  }

  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc > strong {
    grid-column: 1 / -1;
  }

  .directory-grid,
  .controller-directory-grid,
  .guide-directory-grid,
  .feature-grid-3,
  .guide-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-cards > :last-child {
    grid-column: 1 / -1;
  }

  .lab-summary,
  .shared-report__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-sidebar {
    position: static;
  }

  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-brand > p {
    max-width: 600px;
  }
}

@media (max-width: 720px) {
  .section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .split-heading,
  .final-cta,
  .inline-tool-cta,
  .report-actions,
  .lab-toolbar,
  .form-submit {
    align-items: flex-start;
    flex-direction: column;
  }

  .section.final-cta,
  .final-cta {
    width: calc(100% - 24px);
  }

  .compatibility-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .compatibility-strip > div {
    justify-content: flex-start;
  }

  .tester-toolbar,
  .tester-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-controls select {
    max-width: none;
  }

  .tester-dashboard .controller-stage {
    min-height: 430px;
  }

  .device-readout {
    top: .9rem;
    right: .9rem;
    left: .9rem;
  }

  .quick-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stick-monitors,
  .trigger-monitors,
  .test-modules,
  .lab-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-module,
  .test-module[data-module="drift"],
  .test-module[data-module="mapping"] {
    grid-column: 1;
  }

  .button-coverage,
  .axes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-actions .action-cluster {
    width: 100%;
  }

  .directory-grid,
  .controller-directory-grid,
  .guide-directory-grid,
  .feature-grid-3,
  .guide-cards,
  .steps-grid,
  .editorial-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-cards > :last-child {
    grid-column: auto;
  }

  .page-hero {
    padding-top: 2.4rem;
    padding-bottom: 2.4rem;
  }

  .article-meta span::after {
    display: none;
  }

  .toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-full {
    grid-column: 1;
  }

  .lab-toolbar .search-field,
  .lab-toolbar .action-cluster {
    width: 100%;
  }

  .comparison:not(table) {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .error-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .error-code {
    font-size: 7rem;
  }

  .mobile-dock a:not([data-icon])::before {
    display: none;
  }

  .mobile-dock a > span {
    font-size: 1.05rem;
    line-height: 1;
  }

  .mobile-dock a > small {
    font-size: inherit;
    line-height: 1.08;
  }
}

@media (max-width: 480px) {
  .header-inner,
  .footer-main,
  .footer-bottom,
  .breadcrumbs,
  .hero-grid,
  .compatibility-strip {
    width: min(calc(100% - 24px), var(--container));
  }

  .header-lab-link {
    position: relative;
    min-width: 44px;
    width: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .header-lab-link span {
    position: absolute;
    color: var(--white);
  }

  .hero-actions .button,
  .final-cta .button,
  .inline-tool-cta .button,
  .report-view-actions .button {
    width: 100%;
  }

  .preview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-stats > :last-child {
    grid-column: 1 / -1;
  }

  .tester-dashboard .controller-stage {
    min-height: 370px;
  }

  .controller-visual {
    width: min(98%, 360px);
  }

  .test-module {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-icon,
  .module-copy,
  .metric-result,
  .module-actions,
  .circularity-mini,
  .button-coverage,
  .axes-grid {
    grid-column: 1;
  }

  .test-result__list,
  .button-coverage,
  .axes-grid,
  .lab-summary,
  .report-metrics,
  .shared-report__summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-card-head {
    flex-direction: column-reverse;
  }

  .report-card-actions .button,
  .lab-toolbar .action-cluster .button {
    flex: 1 1 auto;
  }

  .footer-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #8b98a8;
    --line-strong: #606d7b;
    --muted: #3d4957;
  }

  .button,
  .card,
  .metric-card,
  .report-card,
  .field input,
  .field select,
  .field textarea {
    border-width: 2px;
  }

  .tester-shell {
    border-color: #86b8fa;
  }
}

@media (forced-colors: active) {
  .button,
  .card,
  .metric-card,
  .report-card,
  .status-pill,
  .controller-face,
  .controller-body,
  .controller-grip,
  .pad-button,
  .mobile-dock a {
    border: 1px solid ButtonText;
    forced-color-adjust: auto;
  }

  .status-pill::before,
  .eyebrow::before,
  .meter-fill,
  .axis-fill,
  .trigger-fill,
  .test-progress > span {
    background: Highlight;
  }
}

/* Clean reports and reference pages when printed. */
@media print {
  :root {
    --ink: #000000;
    --ink-soft: #1e1e1e;
    --paper: #ffffff;
    --white: #ffffff;
    --line: #b8b8b8;
  }

  @page {
    margin: 16mm;
    size: auto;
  }

  body {
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  body::before,
  .site-header,
  .mobile-dock,
  .site-footer,
  .cookie-banner,
  .toast,
  .ad-slot,
  .skip-link,
  .nav,
  .toc,
  .tester-toolbar .actions,
  .no-print {
    display: none !important;
  }

  .container,
  .container-narrow,
  .narrow,
  .tester-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .page-hero,
  .hero,
  .section {
    padding: 1rem 0;
    background: none;
  }

  .page-hero {
    display: block;
    border-bottom: 2px solid #000000;
  }

  .page-hero > aside,
  .report-actions .action-cluster,
  .report-view-actions,
  .mobile-menu,
  .ad-safe-zone {
    display: none !important;
  }

  h1 {
    font-size: 28pt;
  }

  h2 {
    font-size: 20pt;
    break-after: avoid;
  }

  h3 {
    font-size: 14pt;
    break-after: avoid;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  .card,
  .report-card,
  .metric-card,
  .notice,
  .callout,
  .table-wrap {
    border: 1px solid #8b8b8b;
    box-shadow: none;
    break-inside: avoid;
  }

  .tester-shell {
    border: 1px solid #777777;
    background: #ffffff;
    box-shadow: none;
    color: #000000;
  }

  .tester-shell h2,
  .tester-shell h3,
  .tester-shell h4,
  .tester-shell .metric-value,
  .tester-shell .metric-label,
  .tester-shell .metric-meta {
    color: #000000;
  }

  .controller-stage,
  .controller-visual,
  .tester-tabs,
  .raw-data {
    display: none !important;
  }

  .tester-grid,
  .tester-dashboard,
  .test-modules,
  .guide-layout,
  .content-grid,
  .feature-grid,
  .reports-grid {
    display: block;
  }

  .card,
  .report-card,
  .metric-card {
    margin-bottom: .6rem;
  }

  table {
    break-inside: avoid;
  }
}
