/* ==========================================================================
   Bankai: Anime Discover - Legal & Documentation Stylesheet
   Modern, accessible, responsive design system.
   Palette:
     - Accent & Buttons: #FF7700 (0xFFFF7700)
     - Surfaces & Cards: #FFFFFF (0xFFFFFFFF)
     - Background:       #F3F5F8 (0xFFF3F5F8)
   ========================================================================== */

:root {
  /* Brand Color Tokens */
  --bg-body: #F3F5F8;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-surface-alt: #F3F5F8;
  --bg-surface-glass: rgba(255, 255, 255, 0.92);

  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-accent: rgba(255, 119, 0, 0.35);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #808EA3;
  --text-inverse: #FFFFFF;

  --accent-primary: #FF7700;
  --accent-hover: #E66A00;
  --accent-active: #CC5E00;
  --accent-glow: rgba(255, 119, 0, 0.18);
  --accent-subtle: rgba(255, 119, 0, 0.08);

  --badge-bg: rgba(255, 119, 0, 0.1);
  --badge-text: #D96500;
  --badge-border: rgba(255, 119, 0, 0.25);

  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 12px 30px -4px rgba(255, 119, 0, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);

  --callout-info-bg: rgba(14, 165, 233, 0.07);
  --callout-info-border: rgba(14, 165, 233, 0.25);
  --callout-info-text: #0284C7;

  --callout-warn-bg: rgba(255, 119, 0, 0.07);
  --callout-warn-border: rgba(255, 119, 0, 0.3);
  --callout-warn-text: #D96500;

  --table-header-bg: #F8FAFC;
  --table-row-even: #FAFBFC;
  --table-row-hover: rgba(255, 119, 0, 0.04);

  /* Typography & Layout Tokens */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-height: 72px;
  --container-max-width: 1200px;
  --toc-width: 290px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

/* Custom Scrollbar UI */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  background-clip: content-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(255, 119, 0, 0.6);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
  color: #0F172A;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  line-height: 1.35;
  word-break: break-word;
}

h2 .section-num {
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.9em;
  margin-right: 0.35rem;
  display: inline;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul,
ol {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

/* Custom anchor link buttons on headings */
.heading-anchor {
  opacity: 0;
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85em;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.logo-group:hover .logo-icon {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
}

.nav-item a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.nav-item a:hover {
  color: var(--text-primary);
  background: var(--bg-surface-alt);
}

.nav-item.active a {
  color: var(--accent-primary);
  background: var(--badge-bg);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  border-color: var(--border-strong);
}

/* ==========================================================================
   Hero / Page Header Banner
   ========================================================================== */
.doc-header-hero {
  padding: 3rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.doc-header-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 220px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.doc-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.doc-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.doc-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #FFFFFF !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-alt);
  border-color: var(--border-strong);
  color: var(--text-primary);
  text-decoration: none;
}

/* ==========================================================================
   Documentation Grid Layout
   ========================================================================== */
.main-wrapper {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.doc-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-width);
  gap: 3rem;
  align-items: start;
}

/* Main Content Area */
.doc-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--card-shadow);
}

.doc-section {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

/* Table of Contents (TOC) Sticky Sidebar */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 213, 225, 0.7) transparent;
}

.toc-sidebar::-webkit-scrollbar {
  width: 5px;
}

.toc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(203, 213, 225, 0.6);
  border-radius: 9999px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-title {
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin-bottom: 0.35rem;
}

.toc-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.toc-link:hover {
  color: var(--accent-primary);
  background: var(--bg-surface-alt);
  text-decoration: none;
}

.toc-link.active {
  color: var(--accent-primary);
  background: var(--badge-bg);
  border-left-color: var(--accent-primary);
  font-weight: 600;
}

/* ==========================================================================
   Cards, Callouts & Data Tables
   ========================================================================== */
.callout {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border: 1px solid;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.callout-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.callout-info {
  background: var(--callout-info-bg);
  border-color: var(--callout-info-border);
}

.callout-info .callout-icon {
  color: var(--callout-info-text);
}

.callout-warning {
  background: var(--callout-warn-bg);
  border-color: var(--callout-warn-border);
}

.callout-warning .callout-icon {
  color: var(--callout-warn-text);
}

.callout-content p:last-child {
  margin-bottom: 0;
}

/* Legal Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.legal-table th {
  background: var(--table-header-bg);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.legal-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.legal-table tbody tr:nth-child(even) {
  background: var(--table-row-even);
}

.legal-table tbody tr:hover {
  background: var(--table-row-hover);
}

/* Contact Card Box */
.contact-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-row .icon {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ==========================================================================
   Landing Hub Specific Styles (index.html)
   ========================================================================== */
.hub-hero {
  text-align: center;
  padding: 4.5rem 1rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.hub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hub-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin: 2rem 0 4rem;
}

.hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--card-shadow-hover);
}

.hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.hub-card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--badge-bg);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-card-features {
  list-style: none;
  margin: 1.25rem 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-card-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.hub-card-features svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.hub-card-footer {
  margin-top: auto;
}

/* Quick Summary Box */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

.summary-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-card h4 svg {
  color: var(--accent-primary);
}

.summary-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 3.5rem 0 2.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-copy {
  width: 100%;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Back to top floating button
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   Mobile Navigation & Drawer Components
   ========================================================================== */
.mobile-toc-trigger {
  display: none;
}

.floating-toc-btn {
  display: none;
}

.toc-drag-handle {
  display: none;
}

.toc-close-btn {
  display: none;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.toc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  touch-action: none;
  overscroll-behavior: none;
}

.toc-backdrop.visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Modal / Drawer Open - Lock Background Scroll */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100% !important;
  overscroll-behavior: none;
}

body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  :root {
    --nav-height: 64px;
  }

  .site-header {
    height: var(--nav-height);
    position: sticky;
  }

  .nav-container {
    padding: 0 1.25rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: 1rem 1.25rem;
    z-index: 1000;
  }

  .site-header.mobile-nav-active .site-nav {
    display: block;
    animation: mobileNavDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes mobileNavDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
  }

  .nav-item a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }

  .nav-item.active a {
    background: var(--badge-bg);
    color: var(--accent-primary);
  }

  .doc-layout-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .doc-content {
    padding: 2.25rem 1.75rem;
  }

  /* Table of Contents Mobile Bottom Sheet */
  .mobile-toc-trigger {
    display: inline-flex;
  }

  .toc-close-btn {
    display: flex;
  }

  .toc-drag-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #CBD5E1;
    margin: 0 auto 1.15rem;
  }

  .floating-toc-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 18px rgba(255, 119, 0, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 950;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
  }

  .floating-toc-btn.visible {
    opacity: 1;
    transform: translateY(0);
  }

  .floating-toc-btn:hover,
  .floating-toc-btn:active {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 119, 0, 0.55);
  }

  .toc-sidebar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--border-subtle);
    border-bottom: none;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18);
    z-index: 2000;
    padding: 1.25rem 1.5rem 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF;
  }

  .toc-sidebar.mobile-open {
    display: block;
    animation: slideUpMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  .toc-link {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
  }

  .doc-section {
    scroll-margin-top: calc(var(--nav-height) + 16px);
  }
}

@media (max-width: 640px) {
  .main-wrapper {
    padding: 0 1rem 3rem;
  }

  .doc-header-hero {
    padding: 1.75rem 0 1.25rem;
  }

  .doc-header-hero::before {
    width: 100%;
    max-width: 300px;
  }

  h1 {
    font-size: 1.85rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  h2 {
    display: block;
    font-size: 1.35rem;
    margin-top: 2rem;
    line-height: 1.35;
  }

  h2 .section-num {
    display: inline;
    margin-right: 0.25rem;
  }

  h3 {
    font-size: 1.15rem;
    margin-top: 1.35rem;
  }

  p,
  ul,
  ol {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  ul,
  ol {
    margin-left: 1.25rem;
    margin-bottom: 1.25rem;
  }

  li {
    margin-bottom: 0.4rem;
  }

  .heading-anchor {
    display: inline-block;
    opacity: 0.6;
    margin-left: 0.35rem;
  }

  .doc-content {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-md);
  }

  .doc-action-bar {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
    margin-top: 1.25rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
  }

  .doc-meta-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .doc-meta-strip .meta-dot {
    display: none;
  }

  .callout {
    padding: 1.15rem 1rem;
    margin: 1.25rem 0;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .contact-box {
    padding: 1.25rem 1rem;
  }

  .contact-row {
    font-size: 0.88rem;
    flex-wrap: wrap;
    word-break: break-word;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
  }

  .floating-toc-btn {
    bottom: 18px;
    right: 16px;
    height: 42px;
    padding: 0 15px;
    font-size: 0.84rem;
  }

  .back-to-top {
    bottom: 18px;
    left: 16px;
    width: 42px;
    height: 42px;
  }

  .hub-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hub-card {
    padding: 1.75rem 1.25rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 380px) {
  .brand-subtitle {
    display: none;
  }

  .doc-content {
    padding: 1.25rem 0.85rem;
  }

  h1 {
    font-size: 1.55rem;
  }

  .floating-toc-btn {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .floating-toc-btn span {
    display: none;
  }
/* ==========================================================================
   Account Deletion Simple Page Layout
   ========================================================================== */
.deletion-container {
  max-width: 780px;
  margin: 2.5rem auto 4rem;
}

.deletion-container .doc-content {
  padding: 3rem;
}

.deletion-container h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.deletion-container h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.deletion-container p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.deletion-container ul {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.deletion-container li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .deletion-container {
    margin: 1.5rem auto 3rem;
  }
  .deletion-container .doc-content {
    padding: 1.75rem 1.25rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #111827 !important;
  }

  .site-header,
  .toc-sidebar,
  .doc-action-bar,
  .site-footer,
  .back-to-top,
  #reading-progress,
  #toast {
    display: none !important;
  }

  .main-wrapper {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .doc-layout-grid {
    grid-template-columns: 1fr !important;
  }

  .doc-content {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  h2 {
    page-break-after: avoid;
    border-bottom: 1px solid #E5E7EB !important;
  }

  a {
    color: #111827 !important;
    text-decoration: none !important;
  }

  .badge {
    border: 1px solid #D1D5DB !important;
    color: #374151 !important;
    background: #F3F4F6 !important;
  }
}