:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --line: #d8dee6;
  --line-strong: #aeb8c6;
  --text: #192232;
  --muted: #667284;
  --green: #08a565;
  --green-dark: #087443;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --yellow: #a16207;
  --red: #d83933;
  --shadow: 0 12px 32px rgba(24, 32, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: #e8f7ef;
  border-color: #bfe8d3;
  color: var(--green-dark);
}

.badge.warn {
  background: #fff7df;
  border-color: #ead99d;
  color: var(--yellow);
}

.badge.danger {
  background: #fff0f0;
  border-color: #f0c5c2;
  color: var(--red);
}

.setup-grid {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.setup-panel {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 32, 43, 0.04);
}

.onboarding-panel {
  position: relative;
  margin: 0 0 22px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #b9dec9;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 165, 101, 0.08) 1px, transparent 1px) 0 0 / 22px 22px,
    #f7fcf9;
  box-shadow: 0 8px 22px rgba(8, 116, 67, 0.09);
}

.onboarding-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.onboarding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-left: 4px;
}

.onboarding-heading > div {
  min-width: 0;
}

.onboarding-eyebrow {
  display: block;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.onboarding-heading h2 {
  margin: 4px 0 0;
  font-size: 17px;
}

.onboarding-skip {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 7px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.onboarding-skip:hover {
  color: var(--text);
  border-bottom-color: var(--line-strong);
}

.onboarding-progress {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(8, 116, 67, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.onboarding-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.onboarding-progress-label strong {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.onboarding-progress ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.onboarding-progress li {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #8792a3;
  font-size: 9px;
  font-weight: 800;
}

.onboarding-progress li span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
}

.onboarding-progress li small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-progress li.complete,
.onboarding-progress li.current {
  color: var(--green-dark);
}

.onboarding-progress li.complete span {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.onboarding-progress li.current span {
  color: var(--green-dark);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 165, 101, 0.14);
}

.onboarding-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding-left: 4px;
}

.onboarding-step-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #173f2d;
  color: #fff;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.onboarding-copy > div:last-child {
  min-width: 0;
}

.onboarding-copy p {
  margin: 0;
}

.onboarding-copy #onboardingStepKicker {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.onboarding-copy h3 {
  margin: 4px 0 5px;
  font-size: 15px;
  line-height: 1.35;
}

.onboarding-copy #onboardingStepDetail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.onboarding-status {
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  padding: 5px 8px;
  border: 1px solid #ded4a8;
  border-radius: 4px;
  background: #fff9e6;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.onboarding-status.ok {
  color: var(--green-dark);
  background: #e8f7ef;
  border-color: #b9dec9;
}

.onboarding-status.danger {
  color: #a61b1b;
  background: #fff0f0;
  border-color: #efc2c2;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: minmax(86px, 0.65fr) minmax(0, 1.35fr);
  gap: 8px;
  margin-top: 14px;
  padding-left: 4px;
}

.onboarding-actions .button:only-child,
.onboarding-actions .button[hidden] + .button {
  grid-column: 1 / -1;
}

.step-kicker {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.step-kicker.second {
  margin-top: 24px;
}

.setup-panel h2 {
  margin: 6px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.mode-button,
.button,
.icon-button,
.guide-button,
.logout-button,
.small-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.mode-button,
.button {
  min-height: 38px;
  padding: 0 12px;
}

.mode-button:hover,
.button:hover,
.icon-button:hover,
.guide-button:hover,
.logout-button:hover,
.small-button:hover {
  border-color: var(--line-strong);
}

.mode-button.selected {
  border-color: #a7d8bf;
  background: #e8f7ef;
  color: var(--green-dark);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button.secondary {
  background: var(--surface-soft);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.guide-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--green-dark);
  background: #f2fbf6;
  border-color: #b9dec9;
  font-size: 12px;
}

.guide-button.active {
  color: #fff;
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.logout-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.config-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.config-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-form input,
.config-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.config-form input:focus,
.config-form select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 1px;
  border-color: var(--blue);
}

.runtime-options {
  min-width: 0;
  margin: 2px 0 0;
  padding: 4px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.runtime-options legend {
  padding: 0 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toggle-row {
  min-height: 44px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px !important;
  padding: 5px 0;
  color: var(--text) !important;
}

.toggle-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.toggle-row strong {
  font-size: 13px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: #cbd5e1;
  transition: background 140ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 140ms ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.group-mode-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.group-mode-row > strong {
  font-size: 13px;
}

.group-mode-help {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.segmented-control {
  width: min(190px, 62%);
  min-height: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control label {
  min-width: 0;
  position: relative;
  display: block;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}

.segmented-control span {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.segmented-control input:checked + span {
  color: #065f46;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.segmented-control input:focus-visible + span {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 1px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.info-strip {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  background: var(--surface-soft);
}

.status-strip {
  border-color: #cfe5d8;
  background: #f1faf5;
}

.status-strip.ok {
  border-color: #a7d8bf;
  background: #e8f7ef;
}

.status-strip.error {
  border-color: #efc2c2;
  background: #fff3f3;
}

.status-strip.error strong {
  color: #a61b1b;
}

.sdk-status-panel {
  --phase-color: #64748b;
  --phase-soft: #f5f7f9;
  margin: 18px -16px 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--phase-soft);
}

.sdk-status-panel[data-phase="active"] {
  --phase-color: var(--green-dark);
  --phase-soft: #edf9f2;
}

.sdk-status-panel[data-phase="starting"] {
  --phase-color: var(--blue-dark);
  --phase-soft: #eff5ff;
}

.sdk-status-panel[data-phase="unconfigured"],
.sdk-status-panel[data-phase="waiting_wechat"] {
  --phase-color: var(--yellow);
  --phase-soft: #fff9e9;
}

.sdk-status-panel[data-phase="authorization_error"],
.sdk-status-panel[data-phase="error"],
.sdk-status-panel[data-phase="offline"] {
  --phase-color: #a61b1b;
  --phase-soft: #fff4f3;
}

.sdk-status-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.sdk-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--phase-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--phase-color) 14%, transparent);
}

.sdk-status-heading > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sdk-status-heading > div > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sdk-status-heading strong {
  min-width: 0;
  color: var(--phase-color);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sdk-connection {
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--phase-color) 28%, var(--line));
  color: var(--phase-color);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sdk-status-panel > p {
  margin: 10px 0 14px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sdk-runtime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid color-mix(in srgb, var(--phase-color) 18%, var(--line));
}

.sdk-runtime-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 10px 4px 0;
}

.sdk-runtime-grid > div:nth-child(even) {
  padding-left: 12px;
  border-left: 1px solid color-mix(in srgb, var(--phase-color) 18%, var(--line));
}

.sdk-runtime-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.sdk-runtime-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.device-identity {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--phase-color) 18%, var(--line));
}

.device-identity-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.device-identity-heading strong {
  font-size: 12px;
}

.device-identity-heading span {
  color: var(--muted);
  font-size: 10px;
}

.identity-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
}

.identity-row > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.identity-row code {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--phase-color) 16%, var(--line));
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  user-select: text;
}

.copy-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--phase-color) 24%, var(--line));
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--phase-color);
  font-size: 16px;
  font-weight: 800;
}

.copy-button:hover:not(:disabled) {
  border-color: var(--phase-color);
  background: #fff;
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sdk-error {
  margin-top: 12px;
  padding: 8px 0 8px 10px;
  border-left: 3px solid var(--red);
  color: #8f1d18;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.diagnostics-details {
  min-width: 0;
  margin-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--phase-color) 18%, var(--line));
}

.diagnostics-details summary {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0 0;
  color: var(--phase-color);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

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

.diagnostics-details summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--phase-color) 24%, var(--line));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  line-height: 1;
}

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

.diagnostics-details summary small {
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.diagnostics-details summary::after {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.diagnostics-body {
  min-width: 0;
  padding-bottom: 2px;
}

.diagnostics-body .info-strip {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.diagnostics-body .device-identity {
  margin-top: 12px;
}

.info-strip span {
  color: var(--muted);
  font-size: 12px;
}

.info-strip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.desktop-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--shadow);
}

.desktop-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid #273244;
  color: #eef2f7;
  font-size: 13px;
  font-weight: 800;
}

.desktop-title > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-title > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.small-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #eef2f7;
  background: #1f2937;
  border-color: #344155;
  text-decoration: none;
  font-size: 12px;
}

.small-button:hover {
  background: #273244;
  border-color: #526173;
}

.desktop-shell iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #111827;
}

.desktop-overlay {
  position: absolute;
  inset: 44px 0 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: auto;
  padding: 12px;
  background: transparent;
}

.desktop-overlay.hidden {
  display: none;
}

.desktop-overlay > div {
  min-width: 168px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  text-align: left;
  box-shadow: var(--shadow);
}

.desktop-overlay strong {
  display: block;
  font-size: 13px;
}

.desktop-overlay span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  width: fit-content;
  min-width: 220px;
  max-width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .setup-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .setup-panel {
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  .desktop-shell {
    height: min(72vh, 720px);
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .setup-grid {
    gap: 10px;
    padding: 10px;
  }

  .setup-panel {
    padding: 12px;
  }

  .onboarding-panel {
    margin-bottom: 18px;
    padding: 12px 10px;
  }

  .onboarding-heading {
    padding-left: 3px;
  }

  .onboarding-copy {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding-left: 3px;
  }

  .onboarding-step-number {
    width: 36px;
    height: 36px;
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
    padding-left: 3px;
  }

  .onboarding-actions .button {
    min-height: 42px;
    grid-column: 1;
  }

  .mode-row,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .desktop-title {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 8px 10px;
  }

  .desktop-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .desktop-overlay {
    inset: 74px 0 0;
  }

  .sdk-runtime-grid {
    grid-template-columns: 1fr;
  }

  .sdk-runtime-grid > div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .device-identity-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .identity-row {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .identity-row > span {
    grid-column: 1 / -1;
  }

  .diagnostics-details summary {
    align-items: start;
  }
}

@media (max-width: 380px) {
  .onboarding-progress {
    padding-inline: 7px;
  }

  .onboarding-progress ol {
    gap: 2px;
  }

  .onboarding-progress li small {
    font-size: 8px;
  }
}
