/* Remote Support Portal — calm, professional static theme */

:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #1e3a5f;
  --color-primary-hover: #163049;
  --color-accent: #3b82f6;
  --color-accent-soft: #eff6ff;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --max-width: 720px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand__text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
  line-height: 1.3;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--color-accent-soft);
  text-decoration: none;
}

/* Trust notice — dismissible side panel */

.trust-notice {
  position: fixed;
  z-index: 200;
  right: 1.25rem;
  top: 5.5rem;
  width: min(320px, calc(100vw - 2.5rem));
  pointer-events: none;
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.trust-notice.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.trust-notice.is-hidden {
  display: none;
}

.trust-notice__card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trust-notice__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.trust-notice__close:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.trust-notice__close svg {
  width: 16px;
  height: 16px;
}

.trust-notice__header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding-right: 1.5rem;
  margin-bottom: 0.65rem;
}

.trust-notice__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #2563eb;
}

.trust-notice__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

.trust-notice__text {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.trust-notice__text:last-child {
  margin-bottom: 0;
}

.trust-notice__text strong {
  color: var(--color-text);
  font-weight: 600;
}

.trust-notice__text em {
  font-style: normal;
  font-weight: 600;
  color: var(--color-text);
}

.trust-notice__text--muted {
  font-size: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.trust-notice a {
  color: var(--color-accent);
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .trust-notice {
    top: auto;
    inset: auto max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
    width: auto;
    max-width: none;
    transform: translateY(1rem);
  }

  .trust-notice.is-visible {
    transform: translateY(0);
  }

  .trust-notice__card {
    padding: 1rem 2.25rem 0.95rem 1rem;
  }

  .trust-notice__text,
  .trust-notice__title {
    overflow-wrap: anywhere;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-accent-soft);
  border-color: #bfdbfe;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-left, 0px)) 4rem;
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  width: 100%;
  min-width: 0;
}

/* Hero */

.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero__lead {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 32rem;
  margin: 0 auto 1.75rem;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero__trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero__trust svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
}

.download-primary {
  display: flex;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.download-primary.is-hidden {
  display: none;
}

.download-primary__btn {
  width: auto;
  max-width: 100%;
}

/* Sections */

.section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow-wrap: anywhere;
}

.section__header {
  margin-bottom: 1.25rem;
}

.section__header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.35rem;
}

.section__header p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.section__intro-line {
  display: block;
  margin-top: 0.35rem;
}

#download .section__header {
  text-align: center;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-accent-soft);
  border-color: #bfdbfe;
  color: var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
  font-size: 0.875rem;
  min-height: 44px;
}

.btn--ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn--block {
  width: 100%;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-group--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.btn-group--row .btn {
  flex: 1;
  min-width: 140px;
}

/* Download cards */

.download-grid {
  display: grid;
  gap: 0.75rem;
}

.download-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.download-card[hidden] {
  display: none !important;
}

#download-windows {
  order: 1;
}

#download-windows.download-card--mac-slot {
  order: 2;
}

#download-macos-arm {
  order: 2;
}

#download-macos-intel {
  order: 3;
}

#download-linux-deb {
  order: 4;
}

#download-linux-more {
  order: 5;
}

#download-android {
  order: 6;
}

#download-ios {
  order: 7;
}

.download-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.download-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}

.download-card__icon svg {
  width: 22px;
  height: 22px;
}

.download-card__body {
  flex: 1;
  min-width: 0;
}

.download-card__title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 0.15rem;
  color: var(--color-text);
}

.download-card__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.download-card__arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.download-disclaimer {
  margin: 1rem 0 0;
  padding: 0 0.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  text-align: center;
  color: var(--color-text-muted);
}

.download-disclaimer__line {
  display: block;
  margin-top: 0.35rem;
}

.download-disclaimer a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.download-disclaimer a:hover {
  color: var(--color-primary);
}

/* Setup steps */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 0.85rem;
  row-gap: 0.2rem;
  align-items: start;
}

.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.steps li strong {
  grid-column: 2;
  display: block;
  margin: 0.1rem 0 0;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.steps li span {
  grid-column: 2;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.steps--guided {
  gap: 0.65rem;
}

.steps--guided li {
  grid-template-columns: 2rem 1fr;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  padding: 0.85rem 0.9rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.steps--guided li::before {
  width: 2rem;
  height: 2rem;
  margin-top: 0.05rem;
  font-size: 0.8125rem;
  grid-row: 1 / span 2;
}

.steps--guided li strong {
  font-size: 0.875rem;
  margin: 0;
}

.steps__detail {
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.config-panel-intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.scan-followup {
  margin-top: 1rem;
}

.scan-followup__title {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.scan-followup__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.scan-followup__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem;
}

.scan-followup__list strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text);
}

.scan-followup__list span {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.scan-followup__list em {
  font-style: normal;
  font-weight: 600;
  color: var(--color-text);
}

[data-theme="dark"] .steps--guided li {
  background: #0f172a;
}

[data-theme="dark"] .steps li::before {
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15);
}

/* Config area */

.config-tabs {
  margin-bottom: 0;
}

.config-tabs__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.config-tabs__heading {
  flex: 1;
  min-width: 0;
}

.config-tabs__heading h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.35rem;
}

.config-tabs__heading p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.config-tabs__list {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0.2rem;
  padding: 0.2rem;
  margin: 0.15rem 0 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.config-tabs__tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.config-tabs__tab:hover {
  color: var(--color-text);
}

.config-tabs__tab[aria-selected="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.config-tabs__tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.config-tabs__pair {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.config-tabs__sep {
  flex-shrink: 0;
  padding: 0 0.1rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 0.55;
}

.config-tabs__icon {
  width: 0.8125rem;
  height: 0.8125rem;
  flex-shrink: 0;
}

.config-tabs__label {
  flex-shrink: 0;
}

.config-tabs__panel {
  display: none;
}

.config-tabs__panel.is-active {
  display: block;
  animation: configPanelIn 0.25s ease;
}

@keyframes configPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .config-tabs__panel.is-active {
    animation: none;
  }
}

.config-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  background: var(--color-accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.config-callout p {
  margin: 0;
}

.config-callout strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.config-callout__icon {
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
  color: var(--color-accent);
}

.btn--sm {
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

.config-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.toast {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-success-bg);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  color: var(--color-success);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
}

.toast.is-visible {
  display: flex;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: calc(100vw - 2rem);
}

.config-actions .toast {
  width: auto;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.config-warning {
  padding: 0.85rem 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  color: #92400e;
  margin-bottom: 1rem;
}

.manual-fields {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.manual-fields h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.manual-fields > p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.rustdesk-panel {
  background: #2a2a2a;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: visible;
}

.rustdesk-panel__title {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f3f4f6;
}

.rustdesk-field {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
  overflow: visible;
}

.rustdesk-field:last-child {
  margin-bottom: 0;
}

.rustdesk-field label {
  flex: 0 0 6.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #d1d5db;
}

.rustdesk-field__control {
  display: flex;
  flex: 1;
  min-width: 0;
  position: relative;
  background: #1f1f1f;
  border: 1px solid #4b5563;
  border-radius: 6px;
}

.rustdesk-field__control:has(.rustdesk-field__value:hover)::before,
.rustdesk-field__control:has(.rustdesk-field__value:focus-visible)::before {
  content: "Klik om te kopiëren";
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0.75rem;
  z-index: 6;
  padding: 0.4rem 0.7rem;
  background: #111827;
  color: #f9fafb;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid #374151;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: rustdesk-hint-in 0.16s ease-out;
}

.rustdesk-field__control:has(.rustdesk-field__value:hover)::after,
.rustdesk-field__control:has(.rustdesk-field__value:focus-visible)::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 1.35rem;
  z-index: 6;
  border: 6px solid transparent;
  border-top-color: #111827;
  pointer-events: none;
  animation: rustdesk-hint-in 0.16s ease-out;
}

.rustdesk-field__value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: inherit;
  color: #f9fafb;
  cursor: pointer;
  text-align: left;
  border-radius: 6px 0 0 6px;
  transition: background 0.15s ease;
}

.rustdesk-field__value-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.8125rem;
}

.rustdesk-field__value:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rustdesk-field__value:focus {
  outline: none;
}

.rustdesk-field__value:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.45);
}

@keyframes rustdesk-hint-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rustdesk-field__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.7rem;
  min-height: 2.35rem;
  border: 0;
  border-left: 1px solid #4b5563;
  background: #333;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.rustdesk-field__copy::before {
  content: "Naar klembord";
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0.35rem;
  z-index: 6;
  padding: 0.4rem 0.7rem;
  background: #111827;
  color: #f9fafb;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid #374151;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.rustdesk-field__copy::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  right: 1.1rem;
  z-index: 6;
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.rustdesk-field__copy:hover::before,
.rustdesk-field__copy:focus-visible::before,
.rustdesk-field__copy:hover::after,
.rustdesk-field__copy:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rustdesk-field__copy.is-copied::before,
.rustdesk-field__copy.is-copied::after {
  opacity: 0;
  visibility: hidden;
}

.rustdesk-field__copy svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.rustdesk-field__copy:hover {
  background: #404040;
  color: #fff;
}

.rustdesk-field__copy:active {
  background: #4a4a4a;
}

.rustdesk-field__copy.is-copied {
  background: #14532d;
  color: #bbf7d0;
  border-left-color: #166534;
}

.rustdesk-field__copy.is-copied svg {
  stroke: #bbf7d0;
}

@media (max-width: 520px) {
  .rustdesk-field {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .rustdesk-field label {
    flex: none;
  }

  .rustdesk-field__copy span {
    display: none;
  }

  .rustdesk-field__copy {
    padding: 0 0.55rem;
  }
}

/* QR */

.mobile-config-block[hidden] {
  display: none !important;
}

.qr-section {
  flex-shrink: 0;
  text-align: center;
  margin: 1.25rem 0 0;
  padding: 1.25rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.qr-section__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.qr-section__hint {
  max-width: 16rem;
  margin: 0.625rem auto 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.qr-section[hidden] {
  display: none;
}

#qrcode {
  display: inline-flex;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

#qrcode canvas,
#qrcode img {
  display: block;
}

/* FAQ / info */

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

.info-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-list li > strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.info-list span {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.info-list__answer {
  color: var(--color-text);
  font-weight: 600;
}

.info-list span em {
  font-style: normal;
  font-weight: 500;
  color: var(--color-text);
}

/* Setup page */

.page-title {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.page-title h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.page-title p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 1rem;
}

.setup-block {
  margin-bottom: 1.25rem;
}

.setup-block h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.75rem;
}

.setup-block p,
.setup-block ol {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.setup-block ol {
  padding-left: 1.25rem;
}

.setup-block ol li {
  margin-bottom: 0.5rem;
}

.setup-block ol li strong {
  color: var(--color-text);
}

.tip-box {
  background: var(--color-accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 1rem 0;
}

.tip-box strong {
  color: var(--color-text);
}

.android-install-note {
  margin-top: 1rem;
}

.android-install-note[hidden] {
  display: none;
}

.android-install-note p {
  margin: 0 0 0.65rem;
}

.android-install-note p:last-of-type {
  margin-bottom: 0;
}

.android-install-note__steps-title {
  margin: 0.75rem 0 0.35rem !important;
}

.android-install-note ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.android-install-note ol li {
  margin-bottom: 0.35rem;
}

.android-install-note ol li:last-child {
  margin-bottom: 0;
}

.setup-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.25rem 0 0.5rem;
}

.app-preview {
  margin: 1.25rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.app-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
}

.app-preview figcaption {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.app-preview figcaption em {
  font-style: italic;
}

.setup-toc {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.setup-toc__label {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.setup-toc__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.setup-toc__list li {
  margin-bottom: 0.35rem;
}

.setup-toc__list a {
  color: var(--color-primary);
  text-decoration: none;
}

.setup-toc__list a:hover {
  text-decoration: underline;
}

.app-preview--phone {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.guide-step-figures {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

@media (min-width: 540px) {
  .guide-step-figures {
    grid-template-columns: 1fr 1fr;
  }

  .guide-step-figures--triple {
    grid-template-columns: repeat(3, 1fr);
  }
}

.guide-step-figures .app-preview--phone {
  max-width: 100%;
}

.setup-guide {
  margin-bottom: 0.5rem;
}

.setup-device-picker {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.setup-device-picker__header {
  margin-bottom: 0.85rem;
}

.setup-device-picker__label {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.setup-device-picker__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.setup-device-picker__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.setup-device-picker__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.setup-device-picker__tab:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}

.setup-device-picker__tab[aria-selected="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.setup-device-picker__tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.setup-device-picker__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

[data-setup-panel] {
  display: none;
}

html[data-setup-device="computer"] [data-setup-panel~="computer"] {
  display: block;
}

html[data-setup-device="android"] [data-setup-panel~="android"] {
  display: block;
}

html[data-setup-device="ios"] [data-setup-panel~="ios"] {
  display: block;
}

.guide-platform {
  margin-top: 1.5rem;
}

.guide-device-tabs {
  margin-top: 1rem;
}

.guide-device-tabs__list,
.guide-platform-tabs__list {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.guide-device-tabs__tab,
.guide-platform-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.guide-device-tabs__tab:hover,
.guide-platform-tabs__tab:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.guide-device-tabs__tab[aria-selected="true"],
.guide-platform-tabs__tab[aria-selected="true"] {
  background: var(--color-primary);
  color: #fff;
}

.guide-device-tabs__tab:focus-visible,
.guide-platform-tabs__tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.guide-device-tabs__icon,
.guide-platform-tabs__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.guide-device-tabs__panel {
  display: none;
  margin-top: 1.25rem;
}

.guide-device-tabs__panel.is-active {
  display: block;
}

.guide-platform-tabs {
  margin-top: 1rem;
}

.guide-platform-tabs__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.guide-platform-tabs__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  width: 100%;
}

@media (min-width: 480px) {
  .guide-platform-tabs__label {
    width: auto;
    margin-right: 0.25rem;
  }
}

.guide-platform-tabs__panel {
  display: none;
}

.guide-platform-tabs__panel.is-active {
  display: block;
}

.guide-platform-tabs .guide-slideshow-intro {
  margin: 0;
  flex: 1;
  min-width: 12rem;
}

.mobile-next-step {
  margin-top: 1rem;
}

.mobile-next-step p {
  margin: 0.35rem 0 0.75rem;
}

.mobile-next-step .btn {
  margin-top: 0.25rem;
}

.ios-guide-placeholder p {
  margin: 0.35rem 0 0;
}

.guide-slideshow-intro {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.guide-slideshow {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}

.guide-slideshow__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.guide-slideshow__counter {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.guide-slideshow__counter [data-slide-current] {
  color: var(--color-primary);
}

.guide-slideshow__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.guide-slideshow__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.guide-slideshow__dot:hover {
  background: var(--color-text-muted);
}

.guide-slideshow__dot.is-active {
  background: var(--color-primary);
  transform: scale(1.15);
}

.guide-slideshow__viewport {
  overflow: hidden;
}

.guide-slideshow__track {
  position: relative;
}

.guide-slideshow__slide {
  padding: 1.15rem 1rem 1rem;
}

.guide-slideshow__slide[hidden] {
  display: none;
}

.guide-slideshow__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.guide-slideshow__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.guide-slideshow__text strong {
  color: var(--color-text);
}

.guide-slideshow__tip {
  margin: 1rem 0 0;
}

.guide-slideshow__tip p {
  margin: 0.35rem 0 0;
}

.guide-slideshow__slide .app-preview--phone {
  margin-bottom: 0;
}

.guide-slideshow__slide .guide-step-figures {
  margin: 0;
}

.guide-slideshow__nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.guide-slideshow__nav .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.guide-slideshow__nav [data-slide-next] {
  margin-left: auto;
}

@media (max-width: 480px) {
  .guide-slideshow__slide .guide-step-figures {
    grid-template-columns: 1fr;
  }
}

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.site-footer a {
  color: var(--color-text-muted);
}

.site-footer__company {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.site-footer__company:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.site-footer p {
  margin: 0.35rem 0;
}

/* Responsive */

@media (min-width: 769px) and (max-width: 900px) {
  .config-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 540px) {
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }

  .download-grid .download-card--wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 769px) {
  .config-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .config-actions .btn--block {
    width: auto;
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    padding: 0.75rem max(0.75rem, env(safe-area-inset-right, 0px)) 0.75rem max(0.75rem, env(safe-area-inset-left, 0px));
    gap: 0.5rem;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand__text {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-nav a {
    font-size: 0.75rem;
    padding: 0.35rem 0.4rem;
  }

  main {
    padding-bottom: max(6rem, calc(4rem + env(safe-area-inset-bottom, 0px)));
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .hero__lead {
    font-size: 1rem;
  }

  .section {
    padding: 1.25rem 1rem;
  }

  .config-tabs__top {
    flex-direction: column;
    gap: 0.85rem;
  }

  .config-tabs__list {
    align-self: flex-end;
    max-width: 100%;
  }

  .config-tabs__tab {
    padding: 0.35rem 0.5rem;
  }

  .config-actions {
    flex-direction: column;
  }

  .config-actions .btn {
    width: 100%;
  }

  .download-primary__btn {
    width: 100%;
  }

  .rustdesk-panel {
    padding: 0.85rem 0.75rem;
  }

  .rustdesk-field__control:has(.rustdesk-field__value:hover)::before,
  .rustdesk-field__control:has(.rustdesk-field__value:hover)::after,
  .rustdesk-field__control:has(.rustdesk-field__value:focus-visible)::before,
  .rustdesk-field__control:has(.rustdesk-field__value:focus-visible)::after,
  .rustdesk-field__copy::before,
  .rustdesk-field__copy::after {
    display: none;
  }

  .toast.is-visible {
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    transform: none;
    width: auto;
    max-width: none;
  }

  .site-footer {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(3rem, calc(2rem + env(safe-area-inset-bottom, 0px)));
  }
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-primary: #7dd3fc;
  --color-primary-hover: #bae6fd;
  --color-accent: #60a5fa;
  --color-accent-soft: #1e3a5f;
  --color-success-bg: #064e3b;
}

[data-theme="dark"] .download-card {
  background: #0f172a;
}

[data-theme="dark"] .config-warning {
  background: #422006;
  border-color: #92400e;
  color: #fde68a;
}

[data-theme="dark"] .config-tabs__list {
  background: #0f172a;
}

[data-theme="dark"] .config-tabs__tab[aria-selected="true"] {
  background: var(--color-surface);
}

[data-theme="dark"] .setup-device-picker {
  background: var(--color-surface);
}

[data-theme="dark"] .setup-device-picker__tab {
  background: #0f172a;
}

[data-theme="dark"] .setup-device-picker__tab[aria-selected="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .guide-platform-tabs__list {
  background: #0f172a;
}

[data-theme="dark"] .guide-device-tabs__list {
  background: #0f172a;
}

[data-theme="dark"] .guide-platform-tabs__tab[aria-selected="true"],
[data-theme="dark"] .guide-device-tabs__tab[aria-selected="true"] {
  background: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .config-callout {
  border-color: #1e40af;
}

[data-theme="dark"] .qr-section {
  background: #0f172a;
}

[data-theme="dark"] .btn--primary {
  color: #0f172a;
}

[data-theme="dark"] .trust-notice__card {
  background: var(--color-surface);
  border-color: #334155;
}

[data-theme="dark"] .trust-notice__icon {
  color: #7dd3fc;
}

[data-theme="dark"] #qrcode {
  background: #fff;
}
