:root {
  color-scheme: dark;
  --gold: #d5a31f;
  --gold-bright: #ffd34d;
  --gold-soft: rgba(213, 163, 31, 0.14);
  --ink: #08090b;
  --navy: #091725;
  --navy-2: #0f2233;
  --surface: #111c27;
  --surface-raised: #172738;
  --border: rgba(213, 163, 31, 0.28);
  --border-soft: rgba(191, 211, 226, 0.14);
  --text: #f6f1e4;
  --muted: #a7b3bc;
  --danger: #ff735f;
  --success: #55d68a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(213, 163, 31, 0.12), transparent 30rem),
    linear-gradient(180deg, #08131e 0%, var(--ink) 48rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }

button, a, input, select { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  background: var(--gold-bright);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.75rem;
  padding: 0.8rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  background: rgba(8, 16, 24, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand img { border-radius: 0.65rem; }

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

.home-link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.home-link:hover, .home-link:focus-visible { color: var(--gold-bright); }

.language-field select {
  min-height: 2.75rem;
  max-width: 11rem;
  padding: 0 2.4rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

[dir="rtl"] .language-field select { padding: 0 0.85rem 0 2.4rem; }

.guide-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.guide-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.intro-copy {
  max-width: 48rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.intro-tools { display: grid; gap: 0.7rem; }

.search-field {
  display: flex;
  align-items: center;
  min-height: 3.35rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(17, 28, 39, 0.9);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset;
}

.search-field:focus-within { border-color: var(--gold-bright); box-shadow: 0 0 0 3px var(--gold-soft); }

.search-field svg, .icon-button svg, .important-note svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  flex: none;
}

.search-field svg { color: var(--gold); }

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0 0.8rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder { color: #768795; }

.quiet-button {
  justify-self: end;
  padding: 0.2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.quiet-button:hover, .quiet-button:focus-visible { color: var(--gold-bright); }

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.platform-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  min-height: 5.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  background: rgba(15, 34, 51, 0.72);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.platform-tab:hover { border-color: var(--border); transform: translateY(-1px); }

.platform-tab[aria-selected="true"] {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(213, 163, 31, 0.2), rgba(15, 34, 51, 0.92));
  box-shadow: 0 0 0 2px rgba(213, 163, 31, 0.1) inset;
}

.platform-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  background: rgba(0,0,0,0.34);
  color: var(--gold-bright);
  font-size: 1.25rem;
  font-weight: 900;
}

.platform-copy strong, .platform-copy span { display: block; }
.platform-copy strong { font-size: 1rem; }
.platform-copy span { margin-top: 0.1rem; color: var(--muted); font-size: 0.78rem; }

.workspace {
  display: grid;
  grid-template-columns: minmax(17rem, 23rem) minmax(0, 1fr);
  min-height: 42rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  background: rgba(8, 18, 28, 0.82);
  box-shadow: var(--shadow);
}

.topic-panel {
  min-width: 0;
  padding: 1.25rem;
  border-inline-end: 1px solid var(--border-soft);
  background: rgba(8, 20, 31, 0.9);
}

.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { margin: 0; font-size: 1.25rem; }
.topic-count { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

.topic-list { display: grid; gap: 0.45rem; margin-top: 1rem; }

.topic-button {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 3.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--muted);
  text-align: start;
  cursor: pointer;
}

.topic-button:hover { background: rgba(255,255,255,0.035); color: var(--text); }
.topic-button[aria-current="page"] { border-color: var(--border); background: var(--gold-soft); color: var(--text); }

.topic-number {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
}

.topic-button[aria-current="page"] .topic-number { border-color: var(--gold); color: var(--gold-bright); }
.topic-name { font-size: 0.93rem; font-weight: 750; }
.topic-check { color: var(--success); font-weight: 900; }

.empty-search { padding: 2rem 0.7rem; color: var(--muted); }
.empty-search strong { color: var(--text); }
.empty-search p { margin: 0.4rem 0 0; font-size: 0.88rem; }

.guide-card { min-width: 0; padding: clamp(1.25rem, 4vw, 3rem); outline: none; }

.guide-progress { display: flex; align-items: center; gap: 0.9rem; color: var(--muted); font-size: 0.82rem; }
.progress-track { flex: 1; height: 0.35rem; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.08); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 200ms ease; }

.article-header { margin-top: 1.5rem; }
.article-title-row { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.article-header h2 { max-width: 48rem; margin: 0.5rem 0 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; }
.article-header > p { max-width: 50rem; margin: 0.9rem 0 0; color: var(--muted); font-size: 1.03rem; }

.guide-screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  width: min(100%, 34rem);
  margin: 1.4rem 0 0;
}

/* Keep every existing one-image guide at its established readable width;
   the Team/GNSS pair gets room for both real-device captures. */
.guide-screenshot-gallery:has(> #guide-screenshot-secondary:not([hidden])) {
  width: min(100%, 70rem);
}

.guide-screenshot {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #04080d;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.guide-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  background: #04080d;
}

.guide-motion {
  width: min(100%, 34rem);
  margin: 1.4rem 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #04080d;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.guide-motion video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 44rem);
  background: #04080d;
}

.guide-motion figcaption {
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  font-size: 0.84rem;
}

[dir="rtl"] .guide-screenshot-gallery,
[dir="rtl"] .guide-motion { margin-inline-start: auto; }

.access-badge {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-actions { display: flex; gap: 0.45rem; }

.icon-button {
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover, .icon-button:focus-visible { border-color: var(--gold); color: var(--gold-bright); }

.important-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid rgba(255, 211, 77, 0.34);
  border-radius: 0.9rem;
  background: rgba(213, 163, 31, 0.1);
}

.important-note[hidden] { display: none; }
.important-note svg { margin-top: 0.1rem; color: var(--gold-bright); }
.important-note strong { color: var(--gold-bright); }
.important-note p { margin: 0.2rem 0 0; color: #d7d0bd; }

.guide-card h3 { margin: 2rem 0 0.9rem; font-size: 1.05rem; }

.step-list { display: grid; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }

.step-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  background: rgba(23, 39, 56, 0.72);
}

.step-item[data-complete="true"] { border-color: rgba(85, 214, 138, 0.36); background: rgba(85, 214, 138, 0.06); }

.step-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: var(--gold-bright);
  cursor: pointer;
  font-weight: 900;
}

.step-item[data-complete="true"] .step-toggle { border-color: var(--success); background: var(--success); color: #06140b; }
.step-copy h4 { margin: 0; font-size: 1rem; }
.step-copy p { margin: 0.3rem 0 0; color: var(--muted); }

.tips-section { margin-top: 2rem; padding-top: 0.1rem; border-top: 1px solid var(--border-soft); }
.tips-list { display: grid; gap: 0.65rem; }

.tip-item { border: 1px solid var(--border-soft); border-radius: 0.8rem; background: rgba(0,0,0,0.16); overflow: hidden; }
.tip-item summary { padding: 0.85rem 1rem; color: var(--text); cursor: pointer; font-weight: 750; }
.tip-item p { margin: 0; padding: 0 1rem 1rem; color: var(--muted); }

.article-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-soft); }

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.nav-button-primary { background: var(--gold); color: #090a0d; }
.nav-button:disabled { visibility: hidden; }

.toast {
  position: fixed;
  inset-inline-start: 50%;
  bottom: 1.5rem;
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #101e2b;
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
}

[dir="rtl"] .toast { transform: translateX(50%); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 3.5rem) 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer nav { display: flex; gap: 1rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold-bright); }

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

:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }

@media (max-width: 900px) {
  .guide-intro { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .quiet-button { justify-self: start; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .topic-panel { border-inline-end: 0; border-bottom: 1px solid var(--border-soft); }
  .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-header { min-height: 4.2rem; }
  .home-link { display: none; }
  .brand span { font-size: 1rem; }
  .language-field select { max-width: 8.5rem; }
  .guide-shell { padding: 1.25rem 0.8rem 2rem; }
  .platform-tabs { grid-template-columns: 1fr; }
  .platform-tab { min-height: 4.5rem; }
  .workspace { border-radius: 1rem; }
  .topic-list { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 0.3rem; }
  .topic-button { flex: 0 0 min(16rem, 78vw); scroll-snap-align: start; }
  .guide-card { padding: 1.25rem 1rem; }
  .article-title-row { align-items: center; }
  .article-header h2 { font-size: 1.8rem; }
  .article-actions { flex-direction: column; }
  .article-footer { flex-wrap: wrap; }
  .nav-button { flex: 1; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #111; }
  .site-header, .guide-intro, .platform-picker, .topic-panel, .article-actions, .article-footer, .site-footer, .toast { display: none !important; }
  .guide-shell { width: 100%; padding: 0; }
  .workspace { display: block; min-height: 0; border: 0; box-shadow: none; background: transparent; }
  .guide-card { padding: 0; }
  .access-badge, .important-note, .step-item, .tip-item { border-color: #aaa; background: transparent; color: #111; }
  .article-header > p, .step-copy p, .tip-item p, .guide-progress { color: #333; }
  .step-toggle { display: none; }
  .step-item { grid-template-columns: 1fr; break-inside: avoid; }
}
