/*
 * XTok LP v2: shared styles for /, /install/, /support/, /privacy.html.
 * Mirrors the ShiroPicks web design system (web/DESIGN.md, web/src/styles/tokens.css):
 * pitch-black tonal surfaces, 1px hairlines, one red accent, pill buttons, no shadows/gradients/blobs.
 */
:root {
  --bg-canvas: #060607;
  --bg-surface: #0e0e10;
  --bg-elevated: #161619;
  --bg-hover: #1f1f24;
  --border-hairline: #242429;
  --border-strong: #34343c;
  --text-primary: #ffffff;
  --text-body: #d4d4d8;
  --text-secondary: #9499a3;
  --text-muted: #6b707a;
  --accent: #e5395a;
  --accent-hover: #f04a6a;
  --accent-subtle: rgba(229, 57, 90, 0.14);
  --semantic-ok: #2cc978;
  --semantic-warn: #f5a623;
  --font-sans: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 9999px;
  --container-max: 1120px;
}

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

html {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-canvas);
  color: var(--text-body);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: transparent;
  border: none;
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

.container-narrow {
  max-width: 760px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

.m-hide {
  display: none;
}

@media (min-width: 541px) {
  .m-hide {
    display: inline;
  }
}

/* ── Header (ShiroPicks .site-header) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 6, 7, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  object-fit: cover;
}

.brand-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-link.active {
  color: var(--text-primary);
}

@media (max-width: 639px) {
  .main-nav .nav-optional {
    display: none;
  }
}

/* ── Buttons & pills (ShiroPicks .btn-primary / .btn-secondary / .pill-tab) ── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-primary);
  border: 1px solid var(--accent);
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-sm {
  font-size: 13px;
  padding: 8px 14px;
}

.btn-block {
  width: 100%;
}

.pill-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pill-tabs::-webkit-scrollbar {
  display: none;
}

.pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.pill-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.pill-tab.active {
  color: var(--text-primary);
  background: var(--accent);
  border-color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.chip-accent {
  color: var(--text-primary);
  background: var(--accent-subtle);
  border-color: rgba(229, 57, 90, 0.45);
}

/* ── Typography ── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.display {
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.display em {
  font-style: normal;
  color: var(--accent);
}

@media (min-width: 900px) {
  .display {
    font-size: 44px;
  }
}

.page-title {
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .page-title {
    font-size: 32px;
  }
}

.lead {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.sec-title {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

@media (min-width: 768px) {
  .sec-title {
    font-size: 24px;
  }
}

.sec-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ── Sections & cards ── */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--border-hairline);
}

@media (min-width: 768px) {
  .section {
    padding: 64px 0;
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px 16px;
}

@media (min-width: 640px) {
  .card {
    padding: 24px 22px;
  }
}

.card-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ── Hero ── */
.hero {
  padding: 28px 0 40px;
}

.hero-inner {
  display: grid;
  gap: 28px;
  align-items: center;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hero .lead {
  margin: 14px 0 22px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
  width: 100%;
}

@media (min-width: 520px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: auto;
  }
}

.stat-row {
  display: flex;
  margin-top: 24px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  max-width: 420px;
}

.stat {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat + .stat {
  border-left: 1px solid var(--border-hairline);
}

.stat-val {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.stat-lbl {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-video {
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 540 / 1100;
  border-radius: 44px;
  background: var(--bg-canvas);
  object-fit: contain;
}

@media (min-width: 900px) {
  .hero {
    padding: 56px 0 64px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 56px;
  }

  .hero-video {
    max-width: 320px;
    border-radius: 56px;
  }
}

/* ── Features ── */
.feat-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feat-num {
  flex-shrink: 0;
  min-width: 28px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: rgba(6, 6, 7, 0.82);
  border: 1px solid var(--border-hairline);
  margin-top: 1px;
}

.feat-num.top {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Steps ── */
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--accent);
}

.step-head .card-title {
  margin: 0;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ── Download cards ── */
.dl-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dl-card.featured {
  border-color: var(--accent);
}

.dl-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-card .card-title {
  font-size: 18px;
  margin: 0;
}

.or {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.url-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-body);
}

.copy-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--bg-hover);
}

.copy-btn.copied {
  color: var(--semantic-ok);
}

.req-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.req-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.req-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* ── FAQ (<details>) ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s;
}

.faq-item[open] .faq-q::after {
  transform: rotate(-135deg) translateY(-2px);
}

.faq-a {
  padding: 0 16px 16px;
  color: var(--text-body);
  font-size: 13.5px;
  line-height: 1.75;
}

/* ── Community / X ── */
.x-card {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.x-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

/* ── Footer (ShiroPicks .site-footer) ── */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  padding: 22px 0 28px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 24px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

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

.footer-links a {
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.15s;
}

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

.footer-copy {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 11.5px;
}

/* ── Sub pages ── */
.page-head {
  padding: 28px 0 20px;
}

.page-head .lead {
  margin-top: 8px;
}

.notice {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-body);
}

/* install: steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.step-body p + p,
.step-body .step-media,
.step-body .step-actions,
.step-body .url-box,
.step-body .gallery-grid {
  margin-top: 12px;
}

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.step-media {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  cursor: zoom-in;
  overflow: hidden;
  background: var(--bg-canvas);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

/* lightbox */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 7, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
}

.lb-overlay.active {
  display: flex;
}

.lb-img {
  max-width: min(92vw, 480px);
  max-height: 84vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.lb-btn,
.lb-close {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-close {
  top: 16px;
  right: 16px;
  font-size: 16px;
}

.lb-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* support form */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.field {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 16px; /* >=16px: no iOS zoom on focus */
  color: var(--text-primary);
  transition: border-color 0.15s;
}

.field::placeholder {
  color: var(--text-muted);
}

.field:focus {
  outline: none;
  border-color: var(--border-strong);
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

textarea.field {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.form-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.success {
  text-align: center;
  padding: 24px 8px;
}

.success-ico {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--semantic-ok);
  color: var(--semantic-ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

/* privacy / legal */
.legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal h2 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.legal p + p,
.legal p + ul,
.legal ul + p {
  margin-top: 8px;
}

.legal ul {
  padding-left: 1.2em;
}

.legal li {
  margin: 2px 0;
}

.legal a,
.text-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.legal a:hover,
.text-link:hover {
  text-decoration-color: var(--accent);
}

.tag-no,
.tag-yes {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-hairline);
  margin-top: 4px;
}

.tag-no {
  color: var(--semantic-ok);
}

.tag-yes {
  color: var(--semantic-warn);
}

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