/* Shared styles for docs.dtwhk.com */
:root {
  --primary: #6406D4;
  --bg: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --accent: #6406D4;
  --accent-light: #f3eaff;
  --accent-hover: #5305b0;
  --card-bg: #ffffff;
  --muted: #57606a;
  --warning-bg: #fff8c5;
  --warning-border: #d4a72c;
  --info-bg: #f3eaff;
  --info-border: #6406D4;
  --code-bg: #1b1f23;
  --code-text: #e6edf3;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Header (auto-generated by lang.js) */
.header {
  background: linear-gradient(135deg, #1a0a3e 0%, #0d0620 100%);
  color: white;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-home {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.header-home:hover { opacity: 0.75; }

/* Page title with breadcrumb (guide pages) */
.page-title {
  margin-bottom: 1.5rem;
}
.page-title .breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.page-title .breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.page-title .breadcrumb a:hover {
  color: var(--accent);
}
.page-title .breadcrumb .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}
.page-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Language globe dropdown */
.lang-globe {
  position: relative;
  flex-shrink: 0;
}
.lang-globe-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lang-globe-btn:hover { background: rgba(255,255,255,0.2); }
.lang-globe-btn svg { width: 18px; height: 18px; }
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a0a3e;
  border: 1px solid #3d1a6e;
  border-radius: 8px;
  padding: 0.35rem 0;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.lang-globe.open .lang-dropdown { display: block; }
.lang-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #adbac7;
  padding: 0.45rem 1rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.lang-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.lang-btn.active { color: var(--accent); font-weight: 600; }

/* Step cards */
.step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 1rem;
}
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
.step-body {
  padding: 0 1.5rem 1.5rem;
}
.step-body p { margin-bottom: 0.75rem; }
.step-body p:last-child { margin-bottom: 0; }

/* Warning box */
.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.warning strong { color: #9a6700; }
.warning .icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 1px;
}

/* Info box */
.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.info strong { color: var(--accent); }

/* Illustration */
.illustration {
  margin: 1rem 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8f9fc;
}
.illustration svg {
  width: 100%;
  height: auto;
  display: block;
}
.illustration-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.5rem 0 0;
  font-style: italic;
}

/* URL block */
.url-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #eff1f3;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  word-break: break-all;
  margin: 0.5rem 0;
}
.url-block a { color: inherit; text-decoration: none; }
.url-block a:hover { text-decoration: underline; }

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
pre .prompt { color: #c4a5ff; user-select: none; }
pre .comment { color: #8b949e; }
pre .output { color: #9ca3af; }
code {
  background: #eff1f3;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* Done section */
.done {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.done .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.done .check svg { width: 28px; height: 28px; color: var(--accent); }
.done h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.done p { color: var(--muted); font-size: 0.95rem; }
.done a { color: var(--accent); }

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  padding: 0.7rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #57606a;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
}
.tab-btn:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-num {
  background: #d0d7de;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tab-btn.active .tab-num { background: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Step inside tab (attached to tab bar) */
.tab-content .step {
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

/* Nav buttons (prev/next inside tabs) */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: 0 1.5rem 1.5rem;
}
.nav-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.nav-btn:hover { background: var(--accent-hover); }
.nav-btn:disabled { background: #d0d7de; cursor: not-allowed; }
.nav-btn.prev { background: #6e7781; }
.nav-btn.prev:hover { background: #57606a; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Section titles (index/home view) */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

/* Guide cards (index/home view) */
.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.guide-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.guide-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.guide-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.guide-info { flex: 1; min-width: 0; }
.guide-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  line-height: 1.4;
}
.guide-info p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}
.guide-arrow {
  flex-shrink: 0;
  color: #d0d7de;
  transition: color 0.2s;
  margin-top: 2px;
}
.guide-card:hover .guide-arrow { color: var(--accent); }

/* ===== SPA 2-column layout ===== */
.app-layout {
  display: flex;
  min-height: calc(100vh - 45px);
}

/* Header right-side controls group */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Platform switcher dropdown (header) */
.platform-globe {
  position: relative;
  flex-shrink: 0;
}
.platform-globe-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.platform-globe-btn:hover { background: rgba(255,255,255,0.2); }
.platform-globe-btn svg { width: 18px; height: 18px; }
.platform-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a0a3e;
  border: 1px solid #3d1a6e;
  border-radius: 8px;
  padding: 0.35rem 0;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.platform-globe.open .platform-dropdown { display: block; }
.plat-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #adbac7;
  padding: 0.45rem 1rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.plat-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.plat-btn.active { color: var(--accent); font-weight: 600; }

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 45px;
  height: calc(100vh - 45px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--card-bg);
  scrollbar-width: thin;
}
.sidebar-nav {
  padding: 0.5rem 0;
}

/* Sidebar category accordion */
.sidebar-category {
  border-bottom: 1px solid var(--border);
}
.sidebar-category:last-child { border-bottom: none; }
.sidebar-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-category-btn:hover { background: rgba(0,0,0,0.03); }
.sidebar-category-btn .chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}
.sidebar-category.open .sidebar-category-btn .chevron {
  transform: rotate(90deg);
}
.sidebar-guides {
  display: none;
  padding-bottom: 0.25rem;
}
.sidebar-category.open .sidebar-guides {
  display: block;
}

/* Sidebar guide links */
.sidebar-guide-link {
  display: block;
  padding: 0.45rem 1rem 0.45rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}
.sidebar-guide-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.sidebar-guide-link.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
}
.sidebar-guide-link.hidden-by-platform {
  display: none;
}

/* Content area */
.content-area {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  padding: 2rem 2.5rem;
}
.content-area .container {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* Sidebar mobile toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 299;
}

/* Onboarding home view */
.onboard {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0;
}
.onboard h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.onboard-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.onboard-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.onboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.onboard-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboard-icon-svg { width: 22px; height: 22px; }
.onboard-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.onboard-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Loading indicator */
.guide-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Responsive — standalone guide pages */
@media (max-width: 600px) {
  .header { padding: 0.5rem 1rem; }
  .page-title h1 { font-size: 1.25rem; }
  .container { padding: 1.5rem 1rem; }
  .step-body { padding: 0 1rem 1rem; }
  .step-header { padding: 1rem 1rem 0; }
  .tab-btn { padding: 0.6rem 0.7rem; font-size: 0.8rem; }
}

/* Responsive — SPA layout */
@media (max-width: 768px) {
  .app-layout { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .sidebar-toggle { display: flex; }
  .content-area { padding: 1.5rem 1rem; }
  .guide-list { grid-template-columns: 1fr; }
  .guide-card { padding: 1rem 1.15rem; }
}
