/* ============================================================================
   Attachment Architect - Public user guide
   Minimal, premium, product-first design system.
   ============================================================================ */

/* ---------- Design tokens ---------- */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f7f5f0;
  --surface-tint: #f8fafc;

  /* Text */
  --text: #1f2937;
  --heading: #0b1220;
  --muted: #5b6473;
  --quiet: #8a93a4;

  /* Lines */
  --line: #e7e2d8;
  --line-soft: #f0ece3;

  /* Accents */
  --accent: #b86f4f;
  --accent-dark: #8a4d35;
  --accent-soft: #f6e0d1;

  /* Links */
  --link: #0c66e4;
  --link-dark: #0747a6;

  /* Functional */
  --green: #1f6b4e;
  --green-bg: #eaf6ee;
  --green-bd: #d2e9d8;
  --gold: #7b5610;
  --gold-bg: #fbf2dc;
  --gold-bd: #ecdcb1;

  /* Layout */
  --max: 1180px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow-md: 0 8px 24px -12px rgba(11, 18, 32, 0.16);
  --shadow-lg: 0 24px 48px -20px rgba(11, 18, 32, 0.18);
  --shadow-xl: 0 36px 72px -32px rgba(11, 18, 32, 0.24);

  /* Type */
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset and base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

figure {
  margin: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-dark);
}

code {
  padding: 0.06em 0.4em;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  color: var(--heading);
  font-family: var(--mono);
  font-size: 0.88em;
}

/* ---------- Layout container ---------- */

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

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: var(--r-pill);
  background: var(--heading);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 250, 247, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.4rem;
  align-items: center;
  min-height: 60px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--heading);
  text-decoration: none;
}

.app-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: var(--r-md);
  object-fit: contain;
}

.app-title {
  display: block;
  color: var(--heading);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.15;
}

.app-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.header-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.top-links a {
  color: var(--heading);
  text-decoration: none;
}

.top-links a:hover {
  color: var(--accent-dark);
}

/* ---------- Mobile section nav ---------- */

.mobile-section-nav {
  display: none;
}

/* ---------- Pills (shared label component) ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.4rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-user {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-bd);
}

.pill-admin {
  color: #334155;
  background: var(--surface-tint);
  border-color: #e2e8f0;
}

.pill-optional {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: var(--gold-bd);
}

.pill-review {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #e9c5ad;
}

/* ---------- Hero ---------- */

.hero {
  padding: 2.8rem 0 1.6rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2.6rem;
  align-items: center;
}

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

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.18;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 720;
  letter-spacing: -0.026em;
}

h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.012em;
}

.hero-lede {
  max-width: 580px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.3vw, 1.18rem);
  font-weight: 450;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--heading);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.button:hover {
  border-color: #c8b8a4;
  background: var(--surface-soft);
}

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

.button-primary:hover {
  border-color: #1c2741;
  background: #1c2741;
  color: #fff;
}

/* ---------- Screenshots ---------- */

.hero-shot,
.screenshot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-shot {
  box-shadow: var(--shadow-xl);
}

.hero-shot img,
.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot {
  margin-top: 1.4rem;
}

/* ---------- Privacy summary card (hero right side on privacy page) ---------- */

.privacy-summary {
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.privacy-summary-title {
  margin: 0 0 0.85rem;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.privacy-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.privacy-summary li {
  position: relative;
  padding-left: 1.1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.privacy-summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.privacy-summary li strong {
  color: var(--heading);
  font-weight: 650;
}

.screenshot figcaption {
  margin: 0;
  padding: 0.72rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Value section ---------- */

.value-section {
  padding: 1.4rem 0 3.2rem;
}

.value-section h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.4rem, 2.1vw, 1.85rem);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}

/* ---------- Grids: value, two-layers, steps ---------- */

.value-grid,
.two-layers,
.steps-grid {
  display: grid;
  gap: 0.9rem;
}

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

.two-layers,
.steps-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.3rem;
}

/* Generic card shell for value / two-layers / steps */
.value-grid article,
.two-layers article,
.steps-grid article {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.value-grid article p,
.two-layers article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.value-grid .pill,
.two-layers .pill,
.steps-grid .pill,
.note .pill {
  margin-bottom: 0.45rem;
}

.steps-grid article ol {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.steps-grid article li {
  margin: 0.32rem 0;
}

.steps-grid article li::marker {
  color: var(--accent);
  font-weight: 700;
}

.steps-grid article li strong {
  color: var(--heading);
  font-weight: 600;
}

/* ---------- Docs layout: TOC + content ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding: 1.8rem 0 5rem;
}

.toc {
  position: sticky;
  top: 78px;
  padding-top: 0.2rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.toc p {
  margin: 0 0 0.55rem;
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  margin-left: -0.7rem;
  padding: 0.24rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.toc a:hover {
  color: var(--heading);
  border-left-color: var(--accent);
}

/* ---------- Scroll-spy via view-timeline (CSS-only, no JS) ----------
   Each doc section advertises a named timeline based on its position
   in the viewport. The matching TOC link animates from muted to active
   as the section moves through the viewport. Browsers without support
   (very old) gracefully fall back to the default styling plus hover. */

/* User Guide sections */
#overview            { view-timeline-name: --t-overview; }
#quick-start         { view-timeline-name: --t-quick-start; }
#where-to-find       { view-timeline-name: --t-where; }
#attachment-explorer { view-timeline-name: --t-explorer; }
#issue-modules       { view-timeline-name: --t-issue; }
#file-preview        { view-timeline-name: --t-preview; }
#ocr                 { view-timeline-name: --t-ocr; }
#admin-console       { view-timeline-name: --t-admin; }
#scanning            { view-timeline-name: --t-scanning; }
#licensing           { view-timeline-name: --t-licensing; }
#permissions         { view-timeline-name: --t-permissions; }
#security            { view-timeline-name: --t-security; }
#limitations         { view-timeline-name: --t-limitations; }
#troubleshooting     { view-timeline-name: --t-troubleshooting; }
#file-categories     { view-timeline-name: --t-categories; }
#faq                 { view-timeline-name: --t-faq; }
#support             { view-timeline-name: --t-support; }

/* Privacy sections (in addition to shared #overview, #permissions, #security) */
#forge               { view-timeline-name: --t-forge; }
#what-we-process     { view-timeline-name: --t-process; }
#app-data            { view-timeline-name: --t-appdata; }
#not-stored          { view-timeline-name: --t-notstored; }
#content-access      { view-timeline-name: --t-content; }
#optional            { view-timeline-name: --t-optional; }
#third-parties       { view-timeline-name: --t-thirdparties; }
#retention           { view-timeline-name: --t-retention; }
#your-rights         { view-timeline-name: --t-rights; }
#changes             { view-timeline-name: --t-changes; }
#contact             { view-timeline-name: --t-contact; }

/* Lift named timelines so the TOC (sibling subtree) can reference them. */
.docs-layout {
  timeline-scope:
    --t-overview, --t-quick-start, --t-where, --t-explorer,
    --t-issue, --t-preview, --t-ocr, --t-admin,
    --t-scanning, --t-licensing, --t-permissions, --t-security,
    --t-limitations, --t-troubleshooting, --t-categories,
    --t-faq, --t-support,
    --t-forge, --t-process, --t-appdata, --t-notstored,
    --t-content, --t-optional, --t-thirdparties, --t-retention,
    --t-rights, --t-changes, --t-contact;
}

@keyframes toc-active {
  0%, 100% { color: var(--muted); border-left-color: transparent; }
  28%, 72% { color: var(--heading); border-left-color: var(--accent); }
}

.toc a[href="#overview"]            { animation: toc-active linear both; animation-timeline: --t-overview; }
.toc a[href="#quick-start"]         { animation: toc-active linear both; animation-timeline: --t-quick-start; }
.toc a[href="#where-to-find"]       { animation: toc-active linear both; animation-timeline: --t-where; }
.toc a[href="#attachment-explorer"] { animation: toc-active linear both; animation-timeline: --t-explorer; }
.toc a[href="#issue-modules"]       { animation: toc-active linear both; animation-timeline: --t-issue; }
.toc a[href="#file-preview"]        { animation: toc-active linear both; animation-timeline: --t-preview; }
.toc a[href="#ocr"]                 { animation: toc-active linear both; animation-timeline: --t-ocr; }
.toc a[href="#admin-console"]       { animation: toc-active linear both; animation-timeline: --t-admin; }
.toc a[href="#scanning"]            { animation: toc-active linear both; animation-timeline: --t-scanning; }
.toc a[href="#licensing"]           { animation: toc-active linear both; animation-timeline: --t-licensing; }
.toc a[href="#permissions"]         { animation: toc-active linear both; animation-timeline: --t-permissions; }
.toc a[href="#security"]            { animation: toc-active linear both; animation-timeline: --t-security; }
.toc a[href="#limitations"]         { animation: toc-active linear both; animation-timeline: --t-limitations; }
.toc a[href="#troubleshooting"]     { animation: toc-active linear both; animation-timeline: --t-troubleshooting; }
.toc a[href="#file-categories"]     { animation: toc-active linear both; animation-timeline: --t-categories; }
.toc a[href="#faq"]                 { animation: toc-active linear both; animation-timeline: --t-faq; }
.toc a[href="#support"]             { animation: toc-active linear both; animation-timeline: --t-support; }

/* Privacy page TOC links */
.toc a[href="#forge"]               { animation: toc-active linear both; animation-timeline: --t-forge; }
.toc a[href="#what-we-process"]     { animation: toc-active linear both; animation-timeline: --t-process; }
.toc a[href="#app-data"]            { animation: toc-active linear both; animation-timeline: --t-appdata; }
.toc a[href="#not-stored"]          { animation: toc-active linear both; animation-timeline: --t-notstored; }
.toc a[href="#content-access"]      { animation: toc-active linear both; animation-timeline: --t-content; }
.toc a[href="#optional"]            { animation: toc-active linear both; animation-timeline: --t-optional; }
.toc a[href="#third-parties"]       { animation: toc-active linear both; animation-timeline: --t-thirdparties; }
.toc a[href="#retention"]           { animation: toc-active linear both; animation-timeline: --t-retention; }
.toc a[href="#your-rights"]         { animation: toc-active linear both; animation-timeline: --t-rights; }
.toc a[href="#changes"]             { animation: toc-active linear both; animation-timeline: --t-changes; }
.toc a[href="#contact"]             { animation: toc-active linear both; animation-timeline: --t-contact; }

/* Hover always wins over the scrolled-into-view state. */
.toc a:hover {
  color: var(--heading);
  border-left-color: var(--accent);
}

.content {
  min-width: 0;
}

/* ---------- Doc sections ---------- */

.doc-section {
  padding: 3.4rem 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 88px;
}

.doc-section:first-child {
  padding-top: 0.6rem;
  border-top: 0;
}

.doc-section.compact {
  padding: 2.6rem 0;
}

.doc-section > p {
  max-width: 760px;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Generic lists ---------- */

ol,
.plain-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

li {
  margin: 0.3rem 0;
}

li::marker {
  color: var(--accent);
}

/* ---------- Feature rows (label-style cards) ---------- */

.feature-rows {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.feature-rows article {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
  padding: 1.05rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.feature-rows article h3 {
  margin: 0;
}

.feature-rows article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.feature-rows.admin article {
  grid-template-columns: 240px minmax(0, 1fr);
}

/* ---------- Tables ---------- */

.table-wrap {
  width: 100%;
  margin-top: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

td {
  color: var(--text);
}

th {
  background: var(--surface-soft);
  color: var(--heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- Notes and callouts ---------- */

.note,
.reassurance {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.note {
  margin-top: 1.2rem;
}

.note p,
.small-note,
.reassurance {
  margin: 0;
}

.note p {
  color: var(--muted);
  font-size: 0.95rem;
}

.small-note {
  margin-top: 1rem !important;
  color: var(--muted);
  font-size: 0.92rem;
}

.reassurance {
  margin-top: 1.2rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-soft);
  color: var(--heading);
  font-weight: 550;
}

/* ---------- Scope table (permissions) ---------- */

.scope-table {
  display: grid;
  gap: 0;
  margin-top: 1.3rem;
}

.scope-table div {
  padding: 0.95rem 0;
  border-top: 1px solid var(--line-soft);
}

.scope-table div:first-child {
  padding-top: 0;
  border-top: 0;
}

.scope-table code {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.12rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.scope-table p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* ---------- Details / FAQ / Troubleshooting ---------- */

.details-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.3rem;
}

details {
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.14s ease;
}

details[open] {
  border-color: #d8cebe;
}

summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 0 0.85rem 1.5rem;
  color: var(--heading);
  font-size: 0.96rem;
  font-weight: 650;
}

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

summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  color: var(--accent-dark);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

details[open] summary::before {
  content: "-";
}

details p {
  margin: 0 0 0.95rem;
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

details code {
  font-size: 0.86em;
}

/* ---------- File categories ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.4rem;
  margin-top: 1.3rem;
}

.category-grid span {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Link row (support) ---------- */

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.3rem;
}

.link-row a {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--heading);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.link-row a:hover {
  border-color: #c8b8a4;
  background: var(--surface-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--heading);
  color: #e8edf5;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.6rem;
  padding: 1.8rem 0;
}

.site-footer p {
  margin: 0;
  color: #cdd5e0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.88rem;
}

.site-footer a {
  color: #e8edf5;
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  color: #fff;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .toc a {
    animation: none !important;
  }
}

/* ---------- Responsive: tablet and below ---------- */

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    padding: 0.7rem 0;
  }

  .header-badges {
    display: none;
  }

  .app-subtitle {
    white-space: normal;
  }

  .mobile-section-nav {
    position: sticky;
    top: 60px;
    z-index: 25;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.55rem 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 250, 247, 0.96);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .mobile-section-nav a {
    flex: 0 0 auto;
    color: var(--muted);
    text-decoration: none;
  }

  .mobile-section-nav a:hover {
    color: var(--accent-dark);
  }

  .hero {
    padding-top: 2.2rem;
  }

  .hero-inner,
  .value-grid,
  .docs-layout,
  .two-layers,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .docs-layout {
    gap: 0;
  }

  .toc {
    display: none;
  }

  .feature-rows article,
  .feature-rows.admin article {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, var(--max));
  }

  .hero {
    padding: 1.9rem 0 1rem;
  }

  h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
  }

  .hero-lede {
    font-size: 1.04rem;
  }

  .button {
    flex: 1 1 auto;
  }

  .doc-section {
    padding: 2.6rem 0;
  }

  table {
    min-width: 580px;
  }

  .footer-inner,
  .site-footer nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-soft: #f7f7f7;
    --text: #000;
    --heading: #000;
    --muted: #333;
    --line: #c8c8c8;
    --line-soft: #dcdcdc;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header,
  .mobile-section-nav,
  .toc,
  .hero-actions,
  .hero-shot,
  .screenshot,
  .site-footer,
  .link-row {
    display: none !important;
  }

  .container,
  .docs-layout {
    width: 100%;
    max-width: none;
    display: block;
  }

  .hero,
  .doc-section {
    padding: 1rem 0;
  }

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

  details {
    break-inside: avoid;
  }

  details summary {
    padding-left: 0;
  }

  details summary::before {
    display: none;
  }

  details p {
    padding-left: 0;
  }
}
