/* ==========================================================================
   this / that — Manual (1:1 Dot Manual Architecture & Clarity)
   Pure white reading canvas · Clean neutral sidebar · Nested collapsible tree
   ========================================================================== */

:root {
  --bg-page: #FFFFFF;
  --bg-sidebar: #FAFAFA;
  --bg-surface: #F4F4F5;
  --bg-surface-hover: #ECECEF;
  --bg-white: #FFFFFF;

  --ink-1: #111111;
  --ink-2: #52525B;
  --ink-3: #71717A;

  --border: #E4E4E7;
  --border-subtle: #F0F0F2;

  --accent: #DF6222;
  --accent-soft: #FEF2EC;
  --accent-dark: #B64322;

  --dot-ok: #16A34A;
  --dot-warn: #D97706;
  --dot-err: #DC2626;

  --shadow-layered:
    0 0 0 1px rgb(0 0 0 / 5%),
    0 1px 1px rgb(0 0 0 / 4%),
    0 3px 3px rgb(0 0 0 / 4%),
    0 6px 6px rgb(0 0 0 / 4%),
    0 12px 12px rgb(0 0 0 / 4%);
  --scrim: rgb(0 0 0 / 26%);

  --ease-smooth: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 120ms;
  --dur-panel: 220ms;

  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-w: 264px;
  --toc-w: 212px;
}

/* ── Dark Mode (Exact Dot Dark Aesthetic) ── */
[data-theme="dark"] {
  --bg-page: #0A0A0B;
  --bg-sidebar: #111113;
  --bg-surface: #18181B;
  --bg-surface-hover: #222226;
  --bg-white: #141417;

  --ink-1: #F4F4F5;
  --ink-2: #A1A1AA;
  --ink-3: #71717A;

  --border: #27272A;
  --border-subtle: #1F1F23;

  --shadow-layered:
    0 0 0 1px rgb(255 255 255 / 8%),
    0 4px 16px rgb(0 0 0 / 45%),
    0 12px 32px rgb(0 0 0 / 55%);
  --scrim: rgb(0 0 0 / 56%);
}

[data-theme="dark"] .mobile-bar {
  background: rgba(10, 10, 11, 0.92);
}

[data-theme="dark"] .pill-btn-dark {
  background: #F4F4F5;
  color: #111111;
  border-color: #F4F4F5;
}

[data-theme="dark"] .pill-btn-dark:hover {
  background: #E4E4E7;
  border-color: #E4E4E7;
}

[data-theme="dark"] .store-badge-btn {
  background: #F4F4F5;
  color: #111111;
}

[data-theme="dark"] .store-badge-btn:hover { background: #E4E4E7; }
[data-theme="dark"] .store-badge-small { color: rgba(17, 17, 17, 0.65); }

[data-theme="dark"] .brand-mark,
[data-theme="dark"] .doc-hero-mark {
  background: #27272A;
  border: 1px solid #3F3F46;
}

[data-theme="dark"] .step-num {
  background: #F4F4F5;
  color: #111111;
}

[data-theme="dark"] .nav-badge {
  background: rgba(22, 163, 74, 0.18);
  color: #4ADE80;
}

[data-theme="dark"] .view-card-img,
[data-theme="dark"] .media-hero-contain,
[data-theme="dark"] .fold-media-contain {
  background: #1E1E22;
}

[data-theme="dark"] .gesture-ring-center {
  background: var(--bg-page);
}

[data-theme="dark"] .fold-panel + .fold-panel {
  border-left-color: #3F3F46;
}

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

html {
  background: var(--bg-page);
  color: var(--ink-1);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* --------------------------------------------------------------------------
   Mobile Sticky Header
   -------------------------------------------------------------------------- */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow var(--dur-panel) var(--ease-smooth);
}

.mobile-bar.is-scrolled {
  box-shadow: 0 4px 12px rgb(0 0 0 / 5%);
}

.mobile-bar-left, .mobile-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-1);
}

.icon-btn:active { transform: scale(0.97); }

/* --------------------------------------------------------------------------
   3-Column Dot Manual Shell
   -------------------------------------------------------------------------- */
.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* Left Sidebar (Exact Dot Style) */
.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
}

.brand-mark-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}

.brand-title .slash { color: var(--accent); }

.brand-sub {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--ink-3);
  font-size: 13px;
  transition: border-color var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.search-trigger:hover {
  border-color: #C4C4CA;
  color: var(--ink-2);
}

.search-trigger:active { transform: scale(0.985); }

.search-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-sidebar);
  color: var(--ink-3);
  flex-shrink: 0;
}

.back-home-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background var(--dur-panel) var(--ease-smooth), color var(--dur-panel) var(--ease-smooth);
}

.back-home-link:hover {
  background: var(--bg-surface);
  color: var(--ink-1);
}

/* Tree Navigation (Exact Dot Nested Collapsible Tree) */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 4px;
}

.nav-group-header {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

.nav-group-list {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item-btn,
.nav-folder-btn {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  transition: background var(--dur-panel) var(--ease-smooth), color var(--dur-panel) var(--ease-smooth);
}

.nav-item-btn > span:first-child,
.nav-folder-btn > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-btn:hover,
.nav-folder-btn:hover {
  background: var(--bg-surface);
  color: var(--ink-1);
}

.nav-item-btn.is-active {
  background: var(--bg-surface);
  color: var(--ink-1);
  font-weight: 600;
}

.nav-item-btn.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--ink-1);
}

.nav-chevron {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: transform 180ms var(--ease-smooth);
}

.nav-folder.is-open > .nav-folder-btn .nav-chevron {
  transform: rotate(90deg);
}

.nav-sublist {
  list-style: none;
  margin: 2px 0 4px 12px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--border);
  display: none;
  flex-direction: column;
  gap: 1px;
}

.nav-folder.is-open > .nav-sublist {
  display: flex;
}

.nav-sublist .nav-item-btn {
  font-size: 13px;
  padding: 5px 10px;
}

.nav-badge {
  font-size: 10.5px;
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #15803D;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Center Reading Column (Dot Pure White Canvas)
   -------------------------------------------------------------------------- */
.docs-main {
  padding: 28px 48px 80px;
  min-width: 0;
  background: var(--bg-page);
}

.docs-container {
  max-width: 720px;
  margin: 0 auto;
}

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

.is-entering {
  animation: pageEnter var(--dur-panel) var(--ease-smooth) both;
}

.doc-breadcrumb {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 12px;
}

/* Dot Hero Banner Card (#F4F4F5, centered icon, bold clean sans H1) */
.doc-hero {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 16px;
}

.doc-hero-mark-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  margin: 0 auto 14px;
  display: block;
}

.doc-hero h1 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0 0 10px;
  color: var(--ink-1);
}

.doc-hero p {
  margin: 0 auto;
  max-width: 520px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.65;
  text-wrap: balance;
}

/* Dot High-Contrast Pill Action Bar */
.doc-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--ink-1);
  white-space: nowrap;
  transition: background var(--dur-panel) var(--ease-smooth), border-color var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.pill-btn:hover {
  background: var(--bg-surface);
  border-color: #D4D4D8;
}

.pill-btn:active { transform: scale(0.97); }
#btnCopyMd { min-width: 96px; }

/* Share Dropdown Popover (Exact Dot Popover) */
.share-wrap {
  position: relative;
}

.share-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  width: 224px;
  padding: 6px;
  border-radius: 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-layered);
  transform-origin: top left;
  opacity: 0;
  transform: scale(0.95) translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms var(--ease-smooth), transform 220ms var(--ease-smooth);
}

.share-popover.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.share-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-1);
  transition: background 120ms var(--ease-smooth);
}

.share-item:hover {
  background: var(--bg-surface);
}

.share-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-brand-img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

[data-theme="dark"] .share-brand-mono {
  filter: invert(1);
}

.share-ext {
  font-size: 11px;
  color: var(--ink-3);
}

.share-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* Home Guide Cards (Dot /docs Landing 2x2 Grid) */
.home-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 28px;
}

.home-guide-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color var(--dur-panel) var(--ease-smooth), background var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.home-guide-card:hover {
  border-color: var(--ink-3);
  background: var(--bg-surface-hover);
}

.home-guide-card:active { transform: scale(0.985); }

.home-guide-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-guide-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}

/* Dial Flow macOS UI Mockup (Faithful to local StudioMainView.swift) */
.mac-mock {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #F5F2EB;
  color: #1B1B1B;
  overflow: hidden;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-layered);
}

.mac-mock-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #EDE9DF;
  border-bottom: 1px solid #DCD7CC;
}

.mac-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mac-mock-appname {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #5C5954;
}

.mac-mock-body {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 280px;
}

.mac-mock-sidebar {
  background: #EFECE4;
  border-right: 1px solid #DCD7CC;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #5C5954;
}

.mac-mock-nav {
  padding: 6px 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mac-mock-nav.is-active {
  background: #E4DFD4;
  color: #1B1B1B;
  font-weight: 600;
}

.mac-mock-stage {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Signature Dark Dot-Matrix LCD Strip from StudioMainView.swift */
.mac-mock-lcd {
  background: #161614;
  color: #EAE7DF;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mac-lcd-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.mac-lcd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
}

.mac-lcd-meta {
  font-size: 11px;
  color: #A39F97;
}

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

.mac-metric-box {
  background: #FFFFFF;
  border: 1px solid #DCD7CC;
  border-radius: 10px;
  padding: 10px 12px;
}

.mac-metric-k {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #76726C;
}

.mac-metric-v {
  font-size: 15px;
  font-weight: 700;
  color: #1B1B1B;
  margin-top: 3px;
}

.mac-mock-hud {
  margin-top: auto;
  background: #1B1B1B;
  color: #F3F0E9;
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.mac-hud-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mac-hud-wave i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: #DF6222;
}

@media (max-width: 820px) {
  .home-guide-grid { grid-template-columns: 1fr; }
  .mac-mock-body { grid-template-columns: 1fr; }
  .mac-mock-sidebar { display: none; }
  .mac-mock-metrics { grid-template-columns: 1fr; }
}

.pill-btn-dark {
  background: var(--ink-1);
  color: #FFFFFF;
  border-color: var(--ink-1);
}

.pill-btn-dark:hover {
  background: #27272A;
  border-color: #27272A;
}

/* Clean Sans-Serif Body Copy (Exact Dot Typography) */
.doc-body h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink-1);
  margin: 36px 0 14px;
  scroll-margin-top: 24px;
}

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

.doc-body h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-1);
  margin: 22px 0 8px;
}

.doc-body p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.72;
}

.doc-body strong { color: var(--ink-1); font-weight: 600; }

.doc-body ul, .doc-body ol {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.doc-body li { margin-bottom: 6px; }

.path-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--ink-1);
  line-height: 1.5;
}

/* Real Hardware Media Frames + Click-to-Zoom HD Lightbox */
.media-hero {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  margin: 16px 0 22px;
  position: relative;
}

.media-hero img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
}

.media-hero img.zoomable {
  cursor: zoom-in;
  max-height: none;
}

.media-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-2);
}

.live-embed-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #E6E3D9;
  margin: 16px 0 22px;
}

.live-embed-frame {
  width: 100%;
  height: 540px;
  border: 0;
  display: block;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 12, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  cursor: zoom-out;
  transition: opacity 200ms var(--ease-smooth);
}

.lightbox-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  object-fit: contain;
}

.media-hero-contain {
  background: #FAFAFA;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-hero-contain img {
  max-height: 340px;
  width: auto;
  object-fit: contain;
}

.three-views {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.view-card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.view-card-img {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: #FFFFFF;
  border-radius: 8px;
}

.view-card-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.view-card-meta {
  padding-top: 10px;
}

.view-card-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.view-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-1);
  margin-top: 3px;
}

.view-card-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.5;
}

/* Dot Rounded Specification & Key-Value Tables */
.spec-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-white);
  margin: 16px 0 24px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.spec-table th {
  background: var(--bg-surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: baseline;
  color: var(--ink-2);
  line-height: 1.6;
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child { color: var(--ink-1); font-weight: 600; width: 26%; white-space: nowrap; }

.spec-table-kv td:first-child { width: auto; white-space: normal; }
.spec-table-kv th:last-child,
.spec-table-kv td:last-child {
  width: 96px;
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--ink-1);
}

.spec-table-3 td:first-child { width: 24%; white-space: normal; }
.spec-table-3 td:nth-child(2) { width: 34%; }

/* Dot Callout Box ("Notes") */
.callout-box {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0 24px;
  border-left: 3px solid var(--ink-1);
}

.callout-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-box ul { margin: 0; font-size: 13.5px; }

/* Dot Vertical Numbered Steps */
.step-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 24px;
}

.step-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 16px 18px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink-1);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.65;
}

/* App Download Cards (Dot Install App Pattern + Official App Store Badge) */
.app-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}

.app-download-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-white);
  flex-shrink: 0;
}

.app-icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.3;
}

.app-card-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.store-badge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: #111111;
  color: #FFFFFF;
  width: 100%;
  transition: background var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.store-badge-btn:hover { background: #27272A; }
.store-badge-btn:active { transform: scale(0.98); }

.store-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.store-badge-small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.02em;
}

.store-badge-main {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 820px) {
  .app-download-grid { grid-template-columns: 1fr; }
}

/* Status Dots */
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-dot-ok { background: var(--dot-ok); }
.status-dot-warn { background: var(--dot-warn); }
.status-dot-err { background: var(--dot-err); }

/* Cards & Grids */
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.info-card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 16px 18px;
}

.info-card-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.info-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 6px;
}

.info-card p { font-size: 13px; margin: 0; line-height: 1.6; }

.faq-pill-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-1);
  transition: background var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.faq-pill-card:hover { background: var(--bg-surface-hover); }
.faq-pill-card:active { transform: scale(0.985); }

/* Gesture Cross-Map (Real v013 ring) */
.gesture-map {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 24px 20px;
  margin: 16px 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.gesture-top, .gesture-bottom {
  grid-column: 1 / -1;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.gesture-side {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.gesture-side-left { text-align: right; }
.gesture-side-right { text-align: left; }

.gesture-ring-box {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.gesture-ring-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gesture-ring-center {
  position: relative;
  z-index: 2;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

/* Foldout Print Spread (100% Unified with Dot Monochrome System) */
.fold-spread {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-sidebar);
  margin: 12px 0 24px;
}

.fold-panel {
  padding: 18px 16px;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
}

.fold-panel + .fold-panel {
  border-left: 1px dashed #D4D4D8;
}

.fold-panel p,
.fold-panel ol {
  font-size: 12px;
  line-height: 1.58;
  color: var(--ink-2);
  margin: 0 0 8px;
}

.fold-panel ol {
  padding-left: 16px;
}

.fold-panel li {
  margin-bottom: 4px;
}

.fold-media {
  width: 100%;
  height: 96px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  overflow: hidden;
  margin: 8px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fold-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
}

.fold-media-contain img {
  object-fit: contain;
  padding: 4px;
}

.fold-mini-map {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  margin: 8px 0;
  font-size: 11px;
  line-height: 1.4;
}

.fold-mini-dir {
  color: var(--ink-1);
  font-weight: 600;
  white-space: nowrap;
}

.fold-mini-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 8px 0;
  font-size: 10.5px;
  color: var(--ink-2);
}

.fold-mini-ring {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fold-mini-ring img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fold-mini-ring span {
  position: relative;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.2;
}

.fold-foot {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

.fold-foot strong {
  color: var(--ink-1);
}

.fold-foot-mono {
  font-family: var(--font-mono);
  color: var(--ink-1);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer: Feedback + Community + Prev/Next (Exact Dot Pattern)
   -------------------------------------------------------------------------- */
.doc-footer-stack {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.community-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.community-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 12px;
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-1);
  transition: border-color var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.social-pill:hover { border-color: var(--ink-1); }
.social-pill:active { transform: scale(0.97); }
.social-soon { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

.prev-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pn-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  background: var(--bg-white);
  transition: border-color var(--dur-panel) var(--ease-smooth), background var(--dur-panel) var(--ease-smooth), transform var(--dur-press) var(--ease-smooth);
}

.pn-card:hover {
  border-color: #C4C4CA;
  background: var(--bg-sidebar);
}

.pn-card:active { transform: scale(0.985); }
.pn-card-next { text-align: right; }

.pn-label {
  font-size: 11.5px;
  color: var(--ink-3);
}

.pn-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   Right Sticky TOC ("Contents")
   -------------------------------------------------------------------------- */
.docs-toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 20px 32px 12px;
}

.toc-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-3);
  transition: color var(--dur-panel) var(--ease-smooth);
}

.toc-link:hover, .toc-link.is-active {
  color: var(--ink-1);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Search Modal (⌘K)
   -------------------------------------------------------------------------- */
.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-panel) var(--ease-smooth);
}

.search-backdrop.is-open { opacity: 1; pointer-events: auto; }

.search-dialog {
  width: 100%;
  max-width: 560px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-layered);
  overflow: hidden;
  transform: scale(0.96) translateY(-8px);
  transition: transform 240ms var(--ease-smooth);
}

.search-backdrop.is-open .search-dialog { transform: scale(1) translateY(0); }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink-1);
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-hit {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background var(--dur-press) var(--ease-smooth);
}

.search-hit:hover { background: var(--bg-surface); }
.search-hit-title { font-size: 13.5px; font-weight: 600; color: var(--ink-1); }
.search-hit-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Responsive & Print
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 820px) {
  .mobile-bar { display: flex; }
  .docs-shell { display: block; }
  .docs-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform var(--dur-panel) var(--ease-smooth);
    box-shadow: var(--shadow-layered);
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-main { padding: 20px 16px 56px; }
  .three-views, .card-grid-2, .card-grid-3, .prev-next-grid, .fold-spread { grid-template-columns: 1fr; }
  .gesture-map { grid-template-columns: 1fr; }
  .gesture-side-left, .gesture-side-right { text-align: center; }
  .fold-panel + .fold-panel { border-left: none; border-top: 1px dashed #B5B0A5; }
  .spec-table td:first-child { white-space: normal; }
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
}
.sidebar-scrim.is-open { display: block; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #FFFFFF !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .mobile-bar, .docs-sidebar, .docs-toc, .doc-action-bar, .doc-footer-stack, .search-backdrop, .sidebar-scrim { display: none !important; }
  .docs-shell { display: block !important; max-width: 100% !important; }
  .docs-main { padding: 0 !important; }
  .docs-container { max-width: 100% !important; }
  .fold-spread { grid-template-columns: repeat(3, 1fr) !important; break-inside: avoid; }
  .fold-panel { min-height: 82mm !important; padding: 12px 10px !important; }
  .spec-table-wrap, .step-card, .callout-box, .three-views, .gesture-map { break-inside: avoid; }
}
