/* WattSwap legal / long-form document pages (privacy, terms, cookies, policies, disclaimers, warranty).
   Content is verbatim from the legacy pages; this file only supplies the reading experience. */
body.lg[data-nav='solid'] .wp-nav { background: rgba(5, 8, 15, 0.92); }

.lg-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 84px)) 0 clamp(36px, 5vw, 64px);
  background: radial-gradient(70% 90% at 50% 0%, rgba(0, 102, 255, 0.26), transparent 70%), radial-gradient(50% 70% at 85% 30%, rgba(52, 211, 153, 0.14), transparent 70%), #010308;
  color: #f5f7fa;
}
.lg-hero-inner { max-width: 1040px; margin-inline: auto; }
.lg-hero .eyebrow { margin: 0 0 14px; }
.lg-hero h1 { margin: 0 0 14px; font-size: clamp(36px, 5.6vw, 60px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.lg-hero .lg-meta { margin: 0; font-size: 16px; color: rgba(245, 247, 250, 0.62); }

.lg-main { padding: clamp(28px, 4vw, 56px) 0 clamp(64px, 8vw, 110px); background: var(--bg); color: var(--t1); }
.lg-wrap {
  max-width: 1040px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 32px);
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start;
}

.lg-toc { position: sticky; top: calc(var(--nav-h, 64px) + 24px); max-height: calc(100vh - var(--nav-h, 64px) - 48px); overflow: auto; font-size: 14px; }
.lg-toc-title { list-style: none; cursor: default; margin: 0 0 12px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t3); }
.lg-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.lg-toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--t2); line-height: 1.35; transition: color 0.2s, border-color 0.2s; }
.lg-toc a:hover { color: var(--t1); }
.lg-toc a.is-active { color: var(--t1); font-weight: 600; border-left-color: var(--blue, #0066ff); }

.lg-doc {
  padding: clamp(22px, 3.4vw, 48px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg, 28px);
  box-shadow: var(--shadow-card); font-size: 17px; line-height: 1.7; color: var(--t2);
}
.lg-doc > p:first-child, .lg-doc > p:first-child + p { margin-bottom: 4px; font-size: 14.5px; color: var(--t3); }
.lg-doc section { margin: 0; }
.lg-doc section + section { margin-top: clamp(28px, 3.4vw, 44px); padding-top: clamp(28px, 3.4vw, 44px); border-top: 1px solid var(--line); }
.lg-doc h2 { margin: 0 0 14px; font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; color: var(--t1); scroll-margin-top: calc(var(--nav-h, 64px) + 24px); }
.lg-doc h3 { margin: 24px 0 8px; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; color: var(--t1); }
.lg-doc p { margin: 0 0 14px; }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 8px; }
.lg-doc li::marker { color: var(--t3); }
.lg-doc strong { color: var(--t1); font-weight: 650; }
.lg-doc a { color: var(--blue, #0066ff); text-decoration: underline; text-decoration-color: rgba(0, 102, 255, 0.3); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.lg-doc a:hover { text-decoration-color: currentColor; }
.lg-doc code { padding: 2px 6px; border-radius: 6px; font-size: 0.9em; background: var(--card-2); color: var(--t1); }
.lg-doc table { display: block; max-width: 100%; overflow-x: auto; margin: 0 0 18px; border-collapse: collapse; font-size: 15px; }
.lg-doc th, .lg-doc td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 120px; }
.lg-doc th { font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3); background: var(--card-2); }
.lg-doc blockquote { margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--line-2); color: var(--t2); }
.lg-doc .lg-loading { color: var(--t3); }

@media (max-width: 900px) {
  .lg-wrap { grid-template-columns: minmax(0, 1fr); }
  .lg-toc { position: static; max-height: none; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
  .lg-toc ol { border-left: 0; grid-template-columns: 1fr; }
  .lg-toc a { padding: 5px 0; border-left: 0; }
  .lg-doc { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .lg-toc a { transition: none; } }

/* ---------- Disclaimers (accordion + lazily loaded markdown) ---------- */
.dc-wrap { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.dc .hidden { display: none !important; }
.dc-list { display: grid; gap: 14px; }
.accordion-item { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-card); overflow: hidden; transition: border-color 0.25s; }
.accordion-item.open { border-color: var(--line-2); }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: clamp(16px, 2.4vw, 24px);
  border: 0; background: transparent; text-align: left; font: inherit; color: var(--t1); cursor: pointer;
}
.accordion-header:focus-visible { outline: 3px solid rgba(0, 102, 255, 0.5); outline-offset: -3px; border-radius: 22px; }
.disclaimer-header-content { display: flex; align-items: center; gap: 16px; min-width: 0; }
.disclaimer-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--card-2); font-size: 22px; }
.disclaimer-title-section { display: grid; gap: 4px; min-width: 0; }
.disclaimer-title { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.disclaimer-description { font-size: 14.5px; line-height: 1.5; color: var(--t3); }
.accordion-icon { flex: none; width: 10px; height: 10px; margin-right: 6px; border-right: 2px solid var(--t3); border-bottom: 2px solid var(--t3); transform: rotate(45deg); transition: transform 0.3s var(--ease); }
.accordion-header.active .accordion-icon { transform: rotate(225deg); }
.accordion-content { display: none; padding: 0 clamp(16px, 2.4vw, 24px); border-top: 1px solid transparent; }
.accordion-content.open { display: block; padding-bottom: clamp(18px, 2.6vw, 28px); border-top-color: var(--line); }
.markdown-content { padding-top: 20px; font-size: 16.5px; line-height: 1.7; color: var(--t2); }
.markdown-content h1, .markdown-content h2 { margin: 26px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--t1); }
.markdown-content h1:first-child, .markdown-content h2:first-child { margin-top: 0; }
.markdown-content h3, .markdown-content h4 { margin: 20px 0 8px; font-size: 17px; font-weight: 650; color: var(--t1); }
.markdown-content p { margin: 0 0 14px; }
.markdown-content ul, .markdown-content ol { margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 6px; }
.markdown-content strong { color: var(--t1); font-weight: 650; }
.markdown-content a { color: var(--blue, #0066ff); text-decoration: underline; text-underline-offset: 3px; }
.markdown-content hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.markdown-content code { padding: 2px 6px; border-radius: 6px; font-size: 0.9em; background: var(--card-2); color: var(--t1); }
.markdown-content table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; margin: 0 0 16px; }
.markdown-content th, .markdown-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.loading-spinner { width: 28px; height: 28px; margin: 24px auto; border: 3px solid var(--line); border-top-color: var(--blue, #0066ff); border-radius: 50%; animation: dc-spin 0.8s linear infinite; }
@keyframes dc-spin { to { transform: rotate(360deg); } }
.dc-error { text-align: center; padding: 24px 0 8px; }
.dc-error h3 { margin: 0 0 8px; font-size: 18px; color: var(--t1); }
.dc-error p { margin: 0 0 14px; color: var(--t3); }
.read-mode-button { position: fixed; top: calc(var(--nav-h, 64px) + 14px); right: 16px; z-index: 40; background: var(--card); box-shadow: var(--shadow-card); color: var(--t1) !important; }
body.read-mode .wp-nav, body.read-mode nav, body.read-mode footer, body.read-mode #ws-mobile-menu, body.read-mode .read-mode-button, body.read-mode .lg-hero { display: none !important; }
body.read-mode .lg-main { padding-top: 24px; min-height: 100vh; }
@media (max-width: 640px) { .disclaimer-icon { width: 40px; height: 40px; font-size: 18px; } .disclaimer-header-content { gap: 12px; } .read-mode-button { top: auto; bottom: 16px; } }
.lg-doc h2:not(:first-child) { margin-top: 32px; }
.lg-doc section h2:not(:first-child) { margin-top: 0; }

.lg-toc-title::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .lg-toc-title { cursor: pointer; margin: 0; display: flex; justify-content: space-between; align-items: center; }
  .lg-toc-title::after { content: ''; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--t3); border-bottom: 2px solid var(--t3); transform: rotate(45deg); transition: transform 0.25s; }
  .lg-toc[open] .lg-toc-title::after { transform: rotate(225deg); }
  .lg-toc[open] .lg-toc-title { margin-bottom: 10px; }
}
@media (min-width: 901px) { .lg-toc-title { pointer-events: none; } }

/* ---------- Error pages (404 / 500) ---------- */
.er-main {
  min-height: 100svh; display: grid; align-items: center; text-align: center;
  padding: calc(var(--nav-h, 64px) + 40px) 0 80px; color: #f5f7fa;
  background: radial-gradient(60% 60% at 50% 0%, rgba(0, 102, 255, 0.28), transparent 70%), radial-gradient(40% 50% at 85% 70%, rgba(52, 211, 153, 0.14), transparent 70%), #010308;
}
.er-500 .er-main { background: radial-gradient(60% 60% at 50% 0%, rgba(255, 90, 60, 0.26), transparent 70%), radial-gradient(40% 50% at 15% 75%, rgba(255, 170, 40, 0.12), transparent 70%), #010308; }
.er-inner { max-width: 720px; margin-inline: auto; }
.er-code { margin: 0; font-size: clamp(96px, 20vw, 190px); font-weight: 800; letter-spacing: -0.06em; line-height: 0.95; background: var(--iri, linear-gradient(90deg, #00f5a0, #00b4ff, #8b5cf6)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.er-500 .er-code { background: linear-gradient(90deg, #ff6a3d, #ffb340); -webkit-background-clip: text; background-clip: text; }
.er-title { margin: 8px 0 14px; font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; }
.er-lede { margin: 0 auto; max-width: 52ch; font-size: clamp(17px, 1.6vw, 20px); color: rgba(245, 247, 250, 0.7); }
.er-panel { margin: 36px auto 0; padding: clamp(20px, 3vw, 32px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.er-panel-title { margin: 0 0 16px; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: #f5f7fa; }
.er-note { margin: 0 0 18px; font-size: 15px; color: rgba(245, 247, 250, 0.6); }
.er-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.er-links .btn-ghost { color: #f5f7fa !important; border-color: rgba(255, 255, 255, 0.24); }
.er-links .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }
.er-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.6); animation: er-pulse 1.8s infinite; }
@keyframes er-pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 90, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0); } }
.er-fact { margin: 28px auto 0; max-width: 56ch; font-size: 15px; color: rgba(245, 247, 250, 0.6); }
.er-fact strong { color: #f5f7fa; font-weight: 600; }
.er-fact a { color: #7ee7c4; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .er-dot { animation: none; } }
.er-panel-title { justify-content: center; text-align: center; }
