:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-subtle: #eef2ff;
  --primary-ring: rgba(99, 102, 241, .25);
  --accent: #ec4899;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --radius: 12px;
  --radius-lg: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

@supports (font-variation-settings: normal) {
  :root { --font: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── layout ── */

.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-header {
  border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.page-nav a:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.page-nav a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.page-body {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.page-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}

.page-footer-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-tertiary);
}

.page-footer-links {
  display: flex;
  gap: 16px;
}

.page-footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color .15s;
}

.page-footer-links a:hover {
  color: var(--primary);
}

/* ── hero (index page) ── */

.hero {
  text-align: center;
  padding: 24px 0 12px;
}

.hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .25);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ── card (document/article) ── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow);
}

.card--index {
  max-width: 600px;
  margin: 0 auto;
}

/* ── typography inside cards ── */

.card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card h2 {
  margin: 36px 0 14px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--primary-hover);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.card h2:first-child { margin-top: 0; }

.card h3 {
  margin: 22px 0 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.card p {
  margin: 0 0 14px;
}

.card ul, .card ol {
  margin: 0 0 16px;
  padding-left: 20px;
}

.card li {
  margin: 0 0 8px;
}

.card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}

.card a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.card strong {
  font-weight: 600;
}

.meta {
  margin: 0 0 28px;
  color: var(--text-tertiary);
  font-size: 13.5px;
}

/* ── index nav ── */

.doc-nav {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.doc-nav li { margin: 0; }

.doc-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin: 2px 0;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}

.doc-nav a:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  text-decoration: none;
}

.doc-nav-arrow {
  color: var(--text-tertiary);
  font-size: 16px;
  transition: transform .15s;
}

.doc-nav a:hover .doc-nav-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ── back link (removed — now in header nav) ── */

.legal-back {
  display: none;
}

/* ── notice block ── */

.notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
}

.notice strong { color: #dc2626; }

/* ── contact highlight ── */

.contact-highlight {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-subtle);
  border-radius: 6px;
  font-weight: 600;
  color: var(--primary);
}

/* ── details list (legal page) ── */

.details-list {
  margin: 0;
  padding: 0;
}

.details-list dt {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  margin: 22px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.details-list dt:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.details-list dd {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.details-list dd strong { font-weight: 600; }

/* ── document footer ── */

.doc-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ── support form ── */

.support-intro {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.support-email-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--primary-subtle);
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.support-email-box svg {
  flex-shrink: 0;
}

.support-email-box a {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.support-form {
  margin-top: 8px;
}

.form-row {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.form-submit:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px var(--primary-ring);
}

.support-success {
  margin-top: 20px;
  padding: 18px 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  color: #166534;
  font-size: 14.5px;
  font-weight: 500;
}

.support-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.support-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.support-footer-links a {
  font-size: 13px;
}

.support-footer-copy {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ── QR download section ── */

.qr-section {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: 260px;
}

.qr-image {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
}

.qr-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
}

.qr-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color .15s;
}

.qr-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ── screenshots ── */

.screenshots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 32px auto 28px;
  max-width: 720px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}

.screenshots::-webkit-scrollbar { display: none; }

.screenshots img {
  height: 320px;
  width: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  transition: transform .2s;
}

.screenshots img:hover {
  transform: translateY(-4px);
}

.promo-link-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.promo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  text-decoration: none;
  border-radius: 100px;
  transition: box-shadow .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .3);
}

.promo-link:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, .4);
  transform: translateY(-1px);
}

.promo-link svg {
  transition: transform .15s;
}

.promo-link:hover svg {
  transform: translateX(3px);
}

.docs-heading {
  font-size: 16px !important;
  font-weight: 650 !important;
  color: var(--text-secondary) !important;
  margin: 0 0 4px !important;
  padding: 0 0 0 !important;
  border: none !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 13px !important;
}

/* ── responsive ── */

@media (max-width: 640px) {
  .page-header-inner { padding: 0 16px; }
  .page-nav a { padding: 6px 10px; font-size: 12.5px; }
  .page-body { padding: 20px 16px 48px; }
  .page-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .card { padding: 24px 20px; border-radius: 16px; }
  .card h1 { font-size: 20px; }
  .card h2 { font-size: 16px; }
  .hero h1 { font-size: 22px; }
  .doc-nav a { padding: 12px 14px; }
  .screenshots { gap: 12px; justify-content: flex-start; padding: 4px 8px; }
  .screenshots img { height: 240px; }
}

@media (max-width: 420px) {
  .page-nav a span { display: none; }
}
