/* Content Desk — article theme (dark + light).
   SINGLE VISUAL SOURCE for rendered articles: linked by the public article pages
   (/a/{user}/...) and mirrored as the embedded ARTICLE_CSS literal in
   contentDeskExport.js (exports must stay self-contained). If you change one,
   change the other. */
:root{color-scheme:light dark}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.65;background:#fff;color:#1f2937}
.cd-doc{max-width:760px;margin:0 auto;padding:2.5rem 1.25rem 4rem;font-size:1.05rem}
h1{font-size:2.3rem;font-weight:800;line-height:1.14;letter-spacing:-0.015em;margin:0 0 1rem}
h2{font-size:1.6rem;font-weight:700;line-height:1.22;letter-spacing:-0.005em;margin:2.25rem 0 .65rem}
h3{font-size:1.2rem;font-weight:600;margin:1.4rem 0 .45rem}
p{margin:0 0 1.1rem}
ul,ol{margin:0 0 1.1rem 1.3rem}li{margin-bottom:.4rem}
.cd-doc a{color:#2563eb;text-decoration:none;border-bottom:1px solid rgba(37,99,235,.35)}
.cd-doc a:hover{border-bottom-color:#2563eb}
.cd-intro p:first-child{font-size:1.24rem;line-height:1.55;opacity:.92}
figure{margin:1.5rem 0}
.cd-hero{width:100%;max-height:360px;object-fit:cover;border-radius:.6rem;margin-bottom:1.5rem;display:block}
.cd-img{width:100%;height:auto;border-radius:.5rem;display:block}
.cd-byline{font-size:.9rem;opacity:.72;margin:0 0 1.6rem;display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.cd-byline-author{font-weight:600;opacity:1}.cd-byline-sep{opacity:.45}
.cd-author-box{border:1px solid #e5e7eb;border-radius:.7rem;padding:1.15rem 1.35rem;margin-top:2.5rem;background:#f9fafb}
.cd-author-head{display:flex;align-items:center;gap:.75rem}
.cd-author-avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;flex:0 0 auto}
.cd-author-initials{display:flex;align-items:center;justify-content:center;background:#2563eb;color:#fff;font-weight:700;font-size:1.4rem}
.cd-author-name{font-weight:700}.cd-author-title{font-size:.85rem;opacity:.75}
.cd-author-bio{margin:.7rem 0 0}.cd-author-links{margin-top:.5rem;display:flex;flex-wrap:wrap;gap:.85rem;font-size:.85rem}
.cd-figcap{font-size:.82rem;opacity:.7;margin-top:.4rem;text-align:center}
.cd-illustrative{font-style:italic;opacity:.8}
.cd-table-wrap{overflow-x:auto;border:1px solid #e5e7eb;border-radius:.5rem}
.cd-table{width:100%;border-collapse:collapse;font-size:.92rem}
.cd-table th,.cd-table td{padding:.6rem .75rem;text-align:left;border-bottom:1px solid #e5e7eb}
.cd-table thead th{background:#f3f4f6;font-weight:700;white-space:nowrap}
.cd-table tbody tr:last-child td{border-bottom:none}
.cd-chart-wrap{width:100%;overflow-x:auto}
.cd-chart{width:100%;height:auto;max-width:720px;display:block;margin:0 auto}
.cd-chart .cd-grid{stroke:#e5e7eb;opacity:.7}
.cd-chart .cd-axis{fill:currentColor;opacity:.7;font-size:12px}
.cd-chart .cd-barval{fill:currentColor;opacity:.85;font-size:11px;font-weight:600}
.cd-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.75rem;margin:1.5rem 0}
.cd-stat{border:1px solid #e5e7eb;border-radius:.6rem;padding:1rem;text-align:center;background:#f9fafb}
.cd-stat-value{font-size:2rem;font-weight:800;line-height:1;color:#2563eb}
.cd-stat-label{font-size:.88rem;margin-top:.35rem;font-weight:600}
.cd-stat-sub{font-size:.76rem;opacity:.7;margin-top:.15rem}
.cd-compare{display:grid;gap:.75rem;margin:1.5rem 0;grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.cd-compare-col{border:1px solid #e5e7eb;border-radius:.6rem;padding:1rem}
.cd-compare-title{font-weight:700;margin-bottom:.5rem;padding-bottom:.4rem;border-bottom:2px solid #2563eb}
.cd-compare-col ul{margin:0;padding-left:1.1rem}
.cd-callout{border-radius:.6rem;padding:1rem 1.15rem;margin:1.5rem 0;border-left:4px solid #6b7280;background:#f9fafb}
.cd-callout-title{font-weight:700;margin-bottom:.3rem}
.cd-callout-tip{border-left-color:#f59e0b;background:#fef9ec}
.cd-callout-info{border-left-color:#3b82f6;background:#eff6ff}
.cd-callout-warning{border-left-color:#ef4444;background:#fef2f2}
.cd-callout-success{border-left-color:#10b981;background:#ecfdf5}
.cd-pullquote{border-left:4px solid #2563eb;margin:1.75rem 0;padding:.35rem 0 .35rem 1.2rem;font-size:1.3rem;font-style:italic;line-height:1.4}
.cd-pullquote-cite{display:block;font-size:.85rem;font-style:normal;opacity:.7;margin-top:.5rem}
.cd-block-cta{border:1px solid #2563eb;border-radius:.6rem;padding:1.25rem;margin-top:2rem;background:#eff6ff}
.cd-block-cta h2{margin-top:0}
.cd-block-takeaways{border-left:3px solid #2563eb;padding-left:1rem}
.cd-accordion details{border:1px solid #e5e7eb;border-radius:.5rem;margin-bottom:.5rem;overflow:hidden}
.cd-accordion summary{cursor:pointer;padding:.7rem .9rem;font-weight:600;list-style:none;background:#f9fafb}
.cd-accordion summary::-webkit-details-marker{display:none}
.cd-accordion summary::after{content:'+';float:right;opacity:.6;font-weight:700}
.cd-accordion details[open] summary::after{content:'–'}
.cd-accordion .cd-acc-body{padding:.7rem .9rem}
.cd-tabs{margin:1.5rem 0}
.cd-tabs .cd-tab-radio{position:absolute;opacity:0;pointer-events:none}
.cd-tab-labels{display:flex;flex-wrap:wrap;gap:.25rem;border-bottom:2px solid #e5e7eb}
.cd-tab-label{cursor:pointer;padding:.45rem .85rem;border-radius:.4rem .4rem 0 0;font-weight:600;font-size:.9rem;opacity:.6}
.cd-tab-panels{padding-top:.9rem}.cd-tab-panel{display:none}
.cd-tabs .cd-tab-radio:nth-of-type(1):checked~.cd-tab-panels .cd-tab-panel[data-i="0"],.cd-tabs .cd-tab-radio:nth-of-type(2):checked~.cd-tab-panels .cd-tab-panel[data-i="1"],.cd-tabs .cd-tab-radio:nth-of-type(3):checked~.cd-tab-panels .cd-tab-panel[data-i="2"],.cd-tabs .cd-tab-radio:nth-of-type(4):checked~.cd-tab-panels .cd-tab-panel[data-i="3"],.cd-tabs .cd-tab-radio:nth-of-type(5):checked~.cd-tab-panels .cd-tab-panel[data-i="4"],.cd-tabs .cd-tab-radio:nth-of-type(6):checked~.cd-tab-panels .cd-tab-panel[data-i="5"]{display:block}
.cd-tabs .cd-tab-radio:nth-of-type(1):checked~.cd-tab-labels .cd-tab-label:nth-of-type(1),.cd-tabs .cd-tab-radio:nth-of-type(2):checked~.cd-tab-labels .cd-tab-label:nth-of-type(2),.cd-tabs .cd-tab-radio:nth-of-type(3):checked~.cd-tab-labels .cd-tab-label:nth-of-type(3),.cd-tabs .cd-tab-radio:nth-of-type(4):checked~.cd-tab-labels .cd-tab-label:nth-of-type(4),.cd-tabs .cd-tab-radio:nth-of-type(5):checked~.cd-tab-labels .cd-tab-label:nth-of-type(5),.cd-tabs .cd-tab-radio:nth-of-type(6):checked~.cd-tab-labels .cd-tab-label:nth-of-type(6){opacity:1;color:#2563eb;box-shadow:inset 0 -2px 0 #2563eb}
.cd-quiz{border:1px solid #e5e7eb;border-radius:.6rem;padding:1rem 1.15rem;margin:1.5rem 0;background:#f9fafb}
.cd-quiz-q{font-weight:700;margin-bottom:.6rem}
.cd-quiz-opt{display:flex;align-items:center;gap:.5rem;padding:.45rem .55rem;border:1px solid #e5e7eb;border-radius:.4rem;margin-bottom:.4rem;cursor:pointer}
.cd-quiz-opt input{margin:0}.cd-quiz-mark{margin-left:auto;font-weight:700}
.cd-quiz-opt.cd-correct input:checked~.cd-quiz-mark::after{content:'✓';color:#16a34a}
.cd-quiz-opt:not(.cd-correct) input:checked~.cd-quiz-mark::after{content:'✗';color:#dc2626}
.cd-quiz:has(input:checked) .cd-quiz-opt.cd-correct{border-color:#16a34a;background:rgba(22,163,74,.10)}
.cd-quiz-feedback{display:none;margin-top:.5rem;font-size:.9rem}
.cd-quiz:has(input:checked) .cd-quiz-feedback{display:block}
.cd-quiz-right,.cd-quiz-wrong{display:none;font-weight:700}
.cd-quiz:has(input:checked) .cd-quiz-wrong{display:inline;color:#dc2626}
.cd-quiz:has(.cd-correct input:checked) .cd-quiz-wrong{display:none}
.cd-quiz:has(.cd-correct input:checked) .cd-quiz-right{display:inline;color:#16a34a}
.cd-quiz-expl{margin-top:.4rem;opacity:.85;font-weight:400}
.cd-theme-toggle{position:fixed;top:1rem;right:1rem;border:1px solid #d1d5db;background:#fff;color:#374151;border-radius:2rem;padding:.35rem .8rem;cursor:pointer;font-size:.85rem}
/* FAQ — questions are real h3s so they stay crawlable and match the FAQPage schema */
.cd-faq-item{border-bottom:1px solid #e5e7eb;padding:.85rem 0}
.cd-faq-item:last-child{border-bottom:0}
.cd-faq-item h3{margin:0 0 .35rem;font-size:1.05rem;font-weight:650}
.cd-faq-a p:last-child{margin-bottom:0}
/* code / formula */
.cd-code-fig{margin:1.1rem 0}
.cd-code-label{font-size:.82rem;font-weight:700;margin-bottom:.3rem;opacity:.85}
.cd-code-block{margin:0;padding:.8rem 1rem;border-radius:.5rem;overflow-x:auto;background:#f3f4f6;border:1px solid #e5e7eb;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88rem;line-height:1.55;white-space:pre}
.cd-code-cap{font-size:.82rem;opacity:.72;margin-top:.35rem}
/* numbered steps */
ol.cd-steps{list-style:none;counter-reset:cdstep;margin:1.1rem 0;padding:0}
.cd-step{counter-increment:cdstep;position:relative;padding-left:2.6rem;margin-bottom:1rem}
.cd-step::before{content:counter(cdstep);position:absolute;left:0;top:0;width:1.85rem;height:1.85rem;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#0d6efd;color:#fff;font-weight:700;font-size:.9rem}
.cd-step-title{font-weight:650;margin-bottom:.2rem}
.cd-step-body p:last-child{margin-bottom:0}
/* checklist */
ul.cd-checklist{list-style:none;margin:1.1rem 0;padding:0}
.cd-check{display:flex;align-items:flex-start;gap:.6rem;margin-bottom:.5rem}
.cd-check-box{flex:0 0 auto;width:1.05rem;height:1.05rem;margin-top:.2rem;border-radius:.25rem;border:2px solid #0d6efd;position:relative}
.cd-check-box::after{content:'';position:absolute;left:.28rem;top:.04rem;width:.25rem;height:.55rem;border:solid #0d6efd;border-width:0 2px 2px 0;transform:rotate(45deg)}
/* gallery */
.cd-gallery{display:grid;gap:.75rem;margin:1.25rem 0}
.cd-gallery-2{grid-template-columns:repeat(2,1fr)}
.cd-gallery-3{grid-template-columns:repeat(3,1fr)}
.cd-gal-item{margin:0}
.cd-gal-item figcaption{font-size:.8rem;opacity:.72;margin-top:.35rem}

/* Downloads panel (article attachments — sample files that ride with the piece) */
.cd-downloads{border:1px solid #e5e7eb;border-radius:.7rem;padding:1.1rem 1.35rem;margin-top:2.2rem;background:#f9fafb}
.cd-downloads-title{font-size:1.05rem;margin:0 0 .7rem}
.cd-dl-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.cd-dl-item{margin:0}
.cd-doc a.cd-dl,.cd-dl{display:flex;align-items:center;gap:.7rem;border:1px solid #e5e7eb;border-radius:.55rem;padding:.55rem .75rem;background:#fff;text-decoration:none;color:inherit}
.cd-doc a.cd-dl:hover,.cd-dl:hover{border-color:#2563eb}
.cd-dl-ext{flex:0 0 auto;font-size:.68rem;font-weight:800;letter-spacing:.04em;border:1px solid #2563eb;color:#2563eb;border-radius:.4rem;padding:.2rem .4rem}
.cd-dl-main{display:flex;flex-direction:column;min-width:0}
.cd-dl-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-dl-file{font-size:.78rem;opacity:.65}
.cd-dl-get{margin-left:auto;font-weight:700;opacity:.6;font-size:1.05rem}
.cd-dl-desc{font-size:.85rem;opacity:.75;margin:.3rem 0 0 .2rem}

/* masonry collage (photo-heavy articles) — CSS columns; items keep source order top-down */
.cd-gallery-masonry{display:block;columns:3 240px;column-gap:.8rem}
.cd-gallery-masonry .cd-gal-item{break-inside:avoid;margin:0 0 .8rem;display:block}
.cd-gallery-masonry .cd-img{width:100%;height:auto;border-radius:.5rem;display:block}
/* video block: responsive 16:9 frame for YouTube embeds and uploaded files */
.cd-video{position:relative;width:100%;aspect-ratio:16/9;border-radius:.6rem;overflow:hidden;background:#000}
.cd-video iframe,.cd-video video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
@media (prefers-color-scheme:dark){
  body{background:#0f1420;color:#e5e7eb}
  .cd-table-wrap,.cd-stat,.cd-compare-col,.cd-callout{border-color:#374151}
  .cd-table th,.cd-table td{border-color:#374151}.cd-table thead th{background:#1f2937}
  .cd-stat,.cd-callout{background:#161c28}.cd-block-cta{background:#12233d}.cd-callout-tip{background:#2a230f}
  .cd-callout-info,.cd-block-cta{background:#12233d}.cd-callout-warning{background:#2a1515}.cd-callout-success{background:#0f241c}
  .cd-chart .cd-grid{stroke:#374151}
  .cd-accordion details,.cd-quiz-opt,.cd-quiz{border-color:#374151}.cd-accordion summary,.cd-quiz{background:#161c28}
  .cd-author-box{border-color:#374151;background:#161c28}
  .cd-downloads{border-color:#374151;background:#161c28}.cd-doc a.cd-dl,.cd-dl{border-color:#374151;background:#0f1420}
  .cd-tab-labels{border-color:#374151}
  .cd-faq-item{border-color:#374151}
  .cd-code-block{background:#161c28;border-color:#374151}
}
@media (max-width:600px){
  .cd-gallery-masonry{columns:2 140px}
  .cd-doc{padding:1.6rem 1rem 3rem;font-size:1rem}
  h1{font-size:1.85rem}h2{font-size:1.35rem}
  .cd-hero{max-height:240px}
  .cd-pullquote{font-size:1.12rem}
  .cd-intro p:first-child{font-size:1.1rem}
  .cd-gallery-2,.cd-gallery-3{grid-template-columns:1fr}
}
/* Explicit theme override: [data-theme] must win over the OS preference IN BOTH DIRECTIONS.
   The @media block above is only the OS-preference default — the public article pages (and
   the export's theme toggle) pin the theme via data-theme, and a dark-brand page viewed from
   a light-mode browser was rendering light tables/code/author-box on a dark card. */
:root[data-theme=dark] body{background:#0f1420;color:#e5e7eb}
:root[data-theme=dark] .cd-table-wrap,:root[data-theme=dark] .cd-stat,:root[data-theme=dark] .cd-compare-col,:root[data-theme=dark] .cd-callout{border-color:#374151}
:root[data-theme=dark] .cd-table th,:root[data-theme=dark] .cd-table td{border-color:#374151}:root[data-theme=dark] .cd-table thead th{background:#1f2937}
:root[data-theme=dark] .cd-stat,:root[data-theme=dark] .cd-callout{background:#161c28}:root[data-theme=dark] .cd-block-cta{background:#12233d}:root[data-theme=dark] .cd-callout-tip{background:#2a230f}
:root[data-theme=dark] .cd-callout-info,:root[data-theme=dark] .cd-block-cta{background:#12233d}:root[data-theme=dark] .cd-callout-warning{background:#2a1515}:root[data-theme=dark] .cd-callout-success{background:#0f241c}
:root[data-theme=dark] .cd-chart .cd-grid{stroke:#374151}
:root[data-theme=dark] .cd-accordion details,:root[data-theme=dark] .cd-quiz-opt,:root[data-theme=dark] .cd-quiz{border-color:#374151}:root[data-theme=dark] .cd-accordion summary,:root[data-theme=dark] .cd-quiz{background:#161c28}
:root[data-theme=dark] .cd-author-box{border-color:#374151;background:#161c28}
:root[data-theme=dark] .cd-downloads{border-color:#374151;background:#161c28}:root[data-theme=dark] .cd-doc a.cd-dl,:root[data-theme=dark] .cd-dl{border-color:#374151;background:#0f1420}
:root[data-theme=dark] .cd-tab-labels{border-color:#374151}
:root[data-theme=dark] .cd-faq-item{border-color:#374151}
:root[data-theme=dark] .cd-code-block{background:#161c28;border-color:#374151}
:root[data-theme=light] body{background:#fff;color:#1f2937}
:root[data-theme=light] .cd-table-wrap,:root[data-theme=light] .cd-stat,:root[data-theme=light] .cd-compare-col,:root[data-theme=light] .cd-callout{border-color:#e5e7eb}
:root[data-theme=light] .cd-table th,:root[data-theme=light] .cd-table td{border-color:#e5e7eb}:root[data-theme=light] .cd-table thead th{background:#f3f4f6}
:root[data-theme=light] .cd-stat,:root[data-theme=light] .cd-callout{background:#f9fafb}:root[data-theme=light] .cd-callout-tip{background:#fef9ec}
:root[data-theme=light] .cd-callout-info{background:#eff6ff}:root[data-theme=light] .cd-block-cta{background:#eff6ff}:root[data-theme=light] .cd-callout-warning{background:#fef2f2}:root[data-theme=light] .cd-callout-success{background:#ecfdf5}
:root[data-theme=light] .cd-chart .cd-grid{stroke:#e5e7eb}
:root[data-theme=light] .cd-accordion details,:root[data-theme=light] .cd-quiz-opt,:root[data-theme=light] .cd-quiz{border-color:#e5e7eb}:root[data-theme=light] .cd-accordion summary,:root[data-theme=light] .cd-quiz{background:#f9fafb}
:root[data-theme=light] .cd-author-box{border-color:#e5e7eb;background:#f9fafb}
:root[data-theme=light] .cd-downloads{border-color:#e5e7eb;background:#f9fafb}:root[data-theme=light] .cd-doc a.cd-dl,:root[data-theme=light] .cd-dl{border-color:#e5e7eb;background:#fff}
:root[data-theme=light] .cd-tab-labels{border-color:#e5e7eb}
:root[data-theme=light] .cd-faq-item{border-color:#e5e7eb}
:root[data-theme=light] .cd-code-block{background:#f3f4f6;border-color:#e5e7eb}

/* Photo styles — chosen per image block in the editor */
.cd-figure.cd-img-rounded .cd-img { border-radius: 14px; }
.cd-figure.cd-img-shadow .cd-img { box-shadow: 0 14px 34px rgba(0,0,0,.28); border-radius: 8px; }
.cd-figure.cd-img-border .cd-img { border: 1px solid rgba(128,128,128,.45); border-radius: 6px; padding: 4px; }
.cd-figure.cd-img-wide { margin-left: calc(-1 * clamp(0px, 4vw, 48px)); margin-right: calc(-1 * clamp(0px, 4vw, 48px)); }
.cd-figure.cd-img-wide .cd-img { width: 100%; border-radius: 4px; }
.cd-figure.cd-img-inset { max-width: 68%; margin-left: auto; margin-right: auto; }
