/* ==========================================================================
   THE TALK - PRIVACY POLICY & TRANSPARENCY CENTER
   Modern, Accessible, High-Performance Design System
   ========================================================================== */

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

:root {
  /* Color Scheme declaration following modern web guidance */
  color-scheme: light dark;

  /* Brand Colors */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --brand-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 50%, rgba(6, 182, 212, 0.08) 100%);
  --brand-accent: #10b981;
  --brand-accent-glow: rgba(16, 185, 129, 0.2);

  /* Light Theme Defaults */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-highlight: rgba(99, 102, 241, 0.08);
  --bg-badge: rgba(99, 102, 241, 0.1);
  --text-badge: #4338ca;
  --border-subtle: rgba(226, 232, 240, 0.9);
  --border-strong: #cbd5e1;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  --code-bg: #f1f5f9;
  --code-text: #0f172a;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #f1f5f9;

  --header-bg: rgba(248, 250, 252, 0.85);
  --sidebar-bg: rgba(255, 255, 255, 0.65);
  --hero-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
               radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
               radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);

  /* Font Families */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout dimensions */
  --header-height: 72px;
  --sidebar-width: 300px;
  --max-content-width: 860px;
  --max-page-width: 1320px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s ease;
}

/* Fallback & Dark Mode Styles via system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-app: #080c15;
    --bg-surface: #0e1526;
    --bg-surface-elevated: #151e34;
    --bg-card: rgba(14, 21, 38, 0.78);
    --bg-card-hover: rgba(21, 30, 52, 0.9);
    --bg-highlight: rgba(99, 102, 241, 0.16);
    --bg-badge: rgba(99, 102, 241, 0.22);
    --text-badge: #a5b4fc;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px -4px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.35);
    --code-bg: #151e34;
    --code-text: #e2e8f0;
    --scrollbar-thumb: #334155;
    --scrollbar-track: #0e1526;
    --header-bg: rgba(8, 12, 21, 0.85);
    --sidebar-bg: rgba(14, 21, 38, 0.5);
    --hero-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.25) 0px, transparent 50%),
                 radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.2) 0px, transparent 50%),
                 radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.18) 0px, transparent 50%);
  }
}

/* Explicit Override mapping as mandated by modern web guidance */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --bg-app: #080c15;
  --bg-surface: #0e1526;
  --bg-surface-elevated: #151e34;
  --bg-card: rgba(14, 21, 38, 0.78);
  --bg-card-hover: rgba(21, 30, 52, 0.9);
  --bg-highlight: rgba(99, 102, 241, 0.16);
  --bg-badge: rgba(99, 102, 241, 0.22);
  --text-badge: #a5b4fc;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.35);
  --code-bg: #151e34;
  --code-text: #e2e8f0;
  --scrollbar-thumb: #334155;
  --scrollbar-track: #0e1526;
  --header-bg: rgba(8, 12, 21, 0.85);
  --sidebar-bg: rgba(14, 21, 38, 0.5);
  --hero-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.25) 0px, transparent 50%),
               radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.2) 0px, transparent 50%),
               radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.18) 0px, transparent 50%);
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-highlight: rgba(99, 102, 241, 0.08);
  --bg-badge: rgba(99, 102, 241, 0.1);
  --text-badge: #4338ca;
  --border-subtle: rgba(226, 232, 240, 0.9);
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);
  --code-bg: #f1f5f9;
  --code-text: #0f172a;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #f1f5f9;
  --header-bg: rgba(248, 250, 252, 0.85);
  --sidebar-bg: rgba(255, 255, 255, 0.65);
  --hero-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
               radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
               radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
}

/* 2. Global Document Styles */
html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-app);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--bg-app);
  background-image: var(--hero-mesh);
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar Styling */
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
scrollbar-width: thin;

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
  }
}

/* 3. Reading Progress Bar */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1000;
}

#reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-gradient);
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
}

/* 4. Top Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-wrapper:hover .brand-logo-icon {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.55);
}

.brand-text-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header Center: Live Search Bar */
.search-container {
  flex: 1;
  max-width: 420px;
  position: relative;
  margin: 0 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 42px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-input::placeholder {
  color: var(--text-subtle);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-counter-badge {
  position: absolute;
  right: 40px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--bg-badge);
  padding: 2px 8px;
  border-radius: 12px;
  display: none;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(0);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--brand-gradient);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--brand-gradient);
  opacity: 0.95;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

/* Mobile Nav Toggle */
.mobile-toc-toggle {
  display: none;
}

/* 5. Main Page Layout */
.page-container {
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  gap: 40px;
  position: relative;
  flex: 1;
  width: 100%;
}

/* 6. Sticky Sidebar (Table of Contents) */
.toc-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 12px;
}

.toc-card {
  background: var(--sidebar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-read-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--bg-badge);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

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

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.toc-link-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  min-width: 18px;
}

.toc-link:hover {
  color: var(--brand-primary);
  background: var(--bg-highlight);
}

.toc-link.active {
  color: var(--brand-primary);
  font-weight: 700;
  background: var(--bg-highlight);
  border-left: 2px solid var(--brand-primary);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.1);
}

.toc-link.active .toc-link-number {
  color: var(--brand-primary);
}

/* Quick Rights / DPO Card in sidebar */
.sidebar-cta-card {
  margin-top: 16px;
  background: var(--brand-gradient-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-cta-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-cta-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 7. Main Policy Content Column */
.policy-main-content {
  flex: 1;
  max-width: var(--max-content-width);
  min-width: 0;
}

/* Hero Section */
.policy-hero {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.policy-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
}

.hero-meta-badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-badge);
  color: var(--text-badge);
}

.meta-badge.status-verified {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-main);
}

.hero-title span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* 8. Highlights / TL;DR Grid */
.highlights-section {
  margin-bottom: 40px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.highlight-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.highlight-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-highlight);
  color: var(--brand-primary);
  margin-bottom: 4px;
}

.highlight-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.highlight-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* 9. Policy Document Sections */
.policy-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.policy-section:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.section-header-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-heading-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-number-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--brand-gradient);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.section-heading {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.3;
}

.copy-link-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.copy-link-btn:hover {
  opacity: 1;
  color: var(--brand-primary);
  background: var(--bg-highlight);
}

.copy-link-btn svg {
  width: 18px;
  height: 18px;
}

/* Typography Inside Sections */
.policy-section p {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.policy-section p:last-child {
  margin-bottom: 0;
}

.policy-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-section ul, .policy-section ol {
  margin: 12px 0 20px 20px;
  color: var(--text-muted);
}

.policy-section li {
  margin-bottom: 10px;
  line-height: 1.6;
  padding-left: 4px;
}

.policy-section li strong {
  color: var(--text-main);
}

/* Highlighted Callout Boxes */
.callout-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
}

.callout-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-content {
  flex: 1;
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.callout-box.security {
  border-left-color: #10b981;
}
.callout-box.security .callout-icon {
  color: #10b981;
}

.callout-box.warning {
  border-left-color: #f59e0b;
}
.callout-box.warning .callout-icon {
  color: #f59e0b;
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

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

.policy-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-weight: 700;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.policy-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.5;
}

.policy-table tr:last-child td {
  border-bottom: none;
}

.policy-table tr:hover td {
  background: var(--bg-highlight);
}

/* Interactive Accordion / Expandables */
details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all var(--transition-fast);
  overflow: hidden;
}

details.faq-item[open] {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

summary.faq-question {
  padding: 16px 20px;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

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

summary.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-subtle);
  transition: transform var(--transition-fast);
}

details.faq-item[open] summary.faq-question::after {
  content: '−';
  color: var(--brand-primary);
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Search Highlighting */
mark.search-highlight {
  background: #fde047;
  color: #0f172a;
  padding: 2px 4px;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.5);
}

mark.search-highlight.current {
  background: #f97316;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.7);
}

/* 10. Native Modal Dialog */
dialog#privacy-modal {
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 540px;
  width: 90vw;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  outline: none;
}

dialog#privacy-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-highlight);
}

.modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Toast notification */
#toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-app);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 1000;
  pointer-events: none;
}

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

/* 11. Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 32px;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-page-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.footer-brand-info {
  max-width: 380px;
}

.footer-brand-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

.footer-links-grid {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-link-col h5 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 12px;
}

.footer-link-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link-col a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.825rem;
  color: var(--text-subtle);
}

.compliance-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.775rem;
  font-weight: 600;
}

.compliance-badge-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}

/* 12. Responsive Breakpoints */
@media (max-width: 1024px) {
  .page-container {
    flex-direction: column;
    padding: 24px 20px 60px;
  }

  .toc-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    margin-bottom: 24px;
    padding-right: 0;
  }

  .toc-card {
    border-radius: var(--radius-md);
  }

  .policy-main-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-container {
    padding: 0 16px;
  }

  .search-container {
    display: none; /* Hide top search on very small screens, or toggle with button */
  }

  .btn-text-hide {
    display: none;
  }

  .policy-hero {
    padding: 24px 20px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .policy-section {
    padding: 24px 20px;
  }

  .section-heading {
    font-size: 1.25rem;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .footer-links-grid {
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 13. High-Quality Print Stylesheet */
@media print {
  /* Print Optimization */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .site-header,
  #reading-progress-container,
  .toc-sidebar,
  .hero-actions-bar,
  .copy-link-btn,
  .site-footer,
  #toast-notification,
  details summary::after {
    display: none !important;
  }

  .page-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .policy-hero,
  .policy-section,
  .highlight-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 12pt 0 !important;
    page-break-inside: avoid;
  }

  .policy-section {
    border-bottom: 1px solid #ccc !important;
  }

  .hero-title span {
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline;
  }
}
