/* Portfolio site styles. System fonts only: nothing is downloaded, so pages render fast. */
:root {
  --bg: #ffffff;
  --surface: #f4f6f7;
  --text: #14181f;
  --muted: #566170;
  --line: #dde2e6;
  --accent: #0d6b5c;
  --accent-strong: #08493f;
  --accent-soft: #e4f2ef;
  --on-accent: #ffffff;
  --hero-bg: #0c3d36;
  --hero-card: #135348;
  --danger: #a32a2a;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #0f1316;
    --surface: #171c20;
    --text: #e8ecef;
    --muted: #9ba6b2;
    --line: #272e34;
    --accent: #4fc3a8;
    --accent-strong: #7fd8c2;
    --accent-soft: #14282a;
    --on-accent: #08201b;
    --danger: #ff8f8f;
  }
}
:root[data-mode="dark"] {
    --bg: #0f1316;
    --surface: #171c20;
    --text: #e8ecef;
    --muted: #9ba6b2;
    --line: #272e34;
    --accent: #4fc3a8;
    --accent-strong: #7fd8c2;
    --accent-soft: #14282a;
    --on-accent: #08201b;
    --danger: #ff8f8f;
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.8rem); }
h3, .h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
code, pre, kbd { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); padding: 10px 20px; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: transparent; }
.btn-small { padding: 6px 14px; font-size: .92rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 10px; color: var(--muted); text-decoration: none; border-radius: 6px; font-weight: 500; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav-toggle { display: none; margin-left: auto; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; }
@media (max-width: 1100px) {
  .nav-ready .nav-toggle { display: inline-block; }
  .nav-ready .site-nav { display: none; order: 3; width: 100%; margin: 0 0 12px; }
  .nav-ready .site-nav.open { display: block; }
  .nav-ready .site-nav ul { flex-direction: column; }
  .header-cta { display: none; }
  .site-nav { order: 3; width: 100%; margin: 0 0 8px; }
}

/* Hero */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent-strong); padding: 5px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; margin-bottom: 20px; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hero h1 { margin-bottom: .2em; }
.hero-headline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--accent-strong); font-weight: 600; margin-bottom: 1em; }
.hero-intro { font-size: 1.1rem; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 16px; }
.hero-photo img { width: 100%; max-width: 360px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); margin-left: auto; }
.monogram { width: 100%; max-width: 300px; aspect-ratio: 1; margin-left: auto; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; font-size: 5rem; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line); }
.monogram.small { max-width: 200px; font-size: 3.4rem; margin: 0 0 20px; }
@media (max-width: 800px) {
  .hero { padding: 36px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; }
  .hero-photo img, .monogram { margin: 0; max-width: 160px; font-size: 3rem; }
}

/* Stats */
.stats { border-block: 1px solid var(--line); background: var(--surface); }
.stat-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; margin: 0; padding: 28px 0; }
.stat-grid li { display: flex; flex-direction: column; }
.stat-grid strong { font-size: 2rem; line-height: 1.1; color: var(--accent-strong); letter-spacing: -0.02em; }
.stat-grid span { color: var(--muted); font-size: .95rem; margin-top: 4px; }

/* Sections */
.block { padding: 56px 0; }
.block.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; }
.page-head { padding: 48px 0 8px; }
.page-head h1 { margin-bottom: .3em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 65ch; }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.block.alt .card { background: var(--bg); }
.card:hover { border-color: var(--accent); }
.card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: .4em; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-body p { color: var(--muted); }
.card-link { margin: auto 0 0; padding-top: 6px; font-weight: 600; }
.meta { font-size: .9rem; color: var(--muted); margin-bottom: .5em !important; }
.tag-type { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--accent-strong); margin-right: 6px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 1em; }
.chips li { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 3px 12px; font-size: .86rem; font-weight: 500; }
.chips a { color: inherit; text-decoration: none; }
.skill-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg); }
.skill-box h2, .skill-box h3 { margin-bottom: .6em; }
.cert-list { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cert-list li { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; font-weight: 500; }
.cert-detail { list-style: none; padding: 0; }
.cert-detail li { padding: 12px 0; border-bottom: 1px solid var(--line); }

/* CTA */
.cta { padding: 64px 0; text-align: center; }
.cta p { color: var(--muted); max-width: 52ch; margin-inline: auto; }

/* Two column */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 32px; } }
.side { border-top: 1px solid var(--line); padding-top: 20px; }
@media (min-width: 861px) { .side { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 28px; } }
.side h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 1.4em; }
.side h3:first-child { margin-top: 0; }
.side-photo img { width: 100%; max-width: 240px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px; }
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: .4em; }

/* Prose (about, posts, case studies) */
.prose { max-width: 70ch; font-size: 1.05rem; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; border: 1px solid var(--line); }
.prose pre { background: #0f1720; color: #e6edf3; padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; font-size: .88rem; }
.prose :not(pre) > code { background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface); }
.cover { width: 100%; border-radius: var(--radius); margin-bottom: 1.5em; border: 1px solid var(--line); }

/* Experience timeline */
.timeline { list-style: none; padding: 0; margin: 0 0 32px; border-left: 2px solid var(--line); }
.job { position: relative; padding: 0 0 40px 28px; }
.job::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.job-period { font-size: .9rem; color: var(--muted); font-weight: 600; margin-bottom: .2em; }
.job h2 { font-size: 1.35rem; margin-bottom: .2em; }
.job-company { margin-bottom: .8em; }
.bullets li { margin-bottom: .5em; }

/* Breadcrumbs, TOC, author, pager */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 28px; }
.toc-title { font-weight: 700; margin-bottom: .4em; }
.toc ol { margin: 0; }
.author-box { margin-top: 40px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.author-box p { margin-bottom: .3em; }
.tags { margin-top: 28px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 36px; }

/* Forms */
.form p { margin-bottom: 1.1em; }
.form label { display: block; font-weight: 600; margin-bottom: 4px; }
.form input:not([type=checkbox]), .form textarea, .form select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.form textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.notice { padding: 12px 16px; border-radius: 6px; border: 1px solid var(--line); }
.notice.error { border-color: var(--danger); color: var(--danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 0; padding: 36px 0 24px; background: var(--surface); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-name { font-weight: 700; margin-bottom: .2em; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }

@media print {
  .site-header, .site-footer, .hero-actions, .cta, .nav-toggle, .mode-toggle,
  .back-to-top, .read-bar, .code-copy, .crumbs, .search-pop, .status,
  .sidebar, .side-browse, .hp, .form-actions, .flow-end, .exp-brief-block,
  .contact-cv, .topic-list, .side-box { display: none !important; }

  body { color: #111 !important; background: #fff !important; font-size: 10pt !important; line-height: 1.45 !important; }

  /* CRITICAL: Reveal all animated elements that haven't scrolled into the viewport */
  .reveal { opacity: 1 !important; transform: none !important; visibility: visible !important; transition: none !important; }

  /* CRITICAL: Un-grid layout so multi-page printing doesn't produce blank pages in Chromium/WebKit */
  .with-side, .side-main, .flow, .timeline, .prose, .block, .flow-part { display: block !important; width: 100% !important; max-width: 100% !important; }
  .with-side { grid-template-columns: 1fr !important; }
  .side-main { width: 100% !important; max-width: 100% !important; }
  .wrap { max-width: 100% !important; padding: 0 !important; width: 100% !important; }

  /* Timeline and career roles pagination */
  .timeline { border-left: 2px solid #ccc !important; margin-left: 4px !important; }
  .flow-part { margin-bottom: 24px !important; padding-bottom: 20px !important; border-bottom: 1px solid #ddd !important; }
  .job { position: relative !important; padding: 0 0 20px 24px !important; break-inside: avoid !important; page-break-inside: avoid !important; }
  .card, .project-card, .ach-grid li, pre { break-inside: avoid !important; page-break-inside: avoid !important; }

  a { color: #111 !important; text-decoration: none !important; }
  .chips li { border: 1px solid #bbb !important; color: #333 !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Anchor links land below the sticky header */
[id] { scroll-margin-top: 84px; }

/* ---- Home page for recruiters: profile card, experience summary ---- */
.hero { padding: 48px 0 36px; }
.hero-grid { align-items: start; }
.profile-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px; }
.pc-photo img { width: 104px; height: 104px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 14px; }
.pc-photo .monogram { width: 88px; height: 88px; max-width: none; margin: 0 0 14px; font-size: 2rem; border-radius: 12px; }
.pc-role { font-weight: 700; margin: 0 0 14px; }
.facts { margin: 0 0 16px; }
.facts div { padding: 9px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.contact-list { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.contact-list li { margin-bottom: .35em; word-break: break-word; }
.glance { list-style: none; margin: 0; padding: 0; }
.glance li { display: grid; grid-template-columns: 230px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.glance li:first-child { border-top: 1px solid var(--line); }
.g-period { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .glance li { grid-template-columns: 1fr; gap: 2px; } }
@media (max-width: 800px) { .hero-grid { gap: 24px; } }

/* ---- Achievements ---- */
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.ach-grid li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.ach-metric { font-size: 1.9rem; line-height: 1.1; color: var(--accent-strong); letter-spacing: -0.02em; }
.ach-title { font-weight: 600; }
.ach-detail { color: var(--muted); font-size: .95rem; margin-top: 4px; }

/* Blog and article sidebar */
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.side-main { min-width: 0; }
.with-side .grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.side-box { background: var(--bg-alt, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0; }
.side-title { font-weight: 700; margin: 0 0 10px; display: block; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.topic-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.topic-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.topic-list li:last-child { border-bottom: 0; }
.topic-list a[aria-current] { font-weight: 700; }
.topic-list .count { color: var(--muted); font-size: .9rem; }
.recent-list li { padding: 6px 0; line-height: 1.35; }
.side-links { font-size: .92rem; color: var(--muted); margin: 0; }
.search-note { margin: 0 0 18px; color: var(--muted); }
@media (max-width: 900px) { .with-side { grid-template-columns: minmax(0, 1fr); } .sidebar { position: static; } }

/* Site search */
.search-big { margin-bottom: 8px; }
.search-big input { padding: 12px 14px; font-size: 1.05rem; }
.results { margin-top: 28px; }
.results h2 { font-size: 1.15rem; margin: 0 0 8px; }
.results .count { color: var(--muted); font-weight: 400; font-size: .95rem; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-list li > a { font-weight: 600; }
.result-list p { margin: 4px 0 0; color: var(--muted); font-size: .96rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topic-list a, .recent-list a { text-decoration: none; }
.topic-list a:hover, .recent-list a:hover { text-decoration: underline; }
.side-search .btn { padding-left: 14px; padding-right: 14px; }

/* Header search bar */
.nav-search { margin-left: 8px; }
.header-search { position: relative; }
.header-search input { width: 150px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: .95rem; transition: width .15s; }
.header-search input:focus { width: 150px; outline: 2px solid var(--accent); outline-offset: 1px; }
.search-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: 92vw; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 10px 14px 12px; z-index: 60; }
.search-pop[hidden] { display: none; }
.sp-group { margin: 8px 0 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.site-nav .sp-list a, .sp-list a { display: block; padding: 5px 0; color: var(--text); font-weight: 500; text-decoration: none; border-radius: 0; background: none; box-shadow: none; line-height: 1.35; }
.sp-list a:hover { color: var(--accent); background: none; }
.sp-all, .site-nav .sp-all { display: block; margin-top: 10px; padding: 6px 0 0; border-top: 1px solid var(--line); color: var(--accent); font-weight: 600; background: none; }
.sp-empty { margin: 6px 0; color: var(--muted); }
@media (max-width: 1100px) { .nav-ready .nav-search { margin: 8px 0 0; } .nav-ready .header-search input, .nav-ready .header-search input:focus { width: 100%; } .nav-ready .search-pop { position: static; width: 100%; max-width: none; margin-top: 8px; box-shadow: none; } }
@media (min-width: 1101px) { .site-header .wrap { max-width: 1240px; } .header-row { flex-wrap: nowrap; } .site-nav ul { flex-wrap: nowrap; } .brand, .header-cta { flex: none; } }
@media (min-width: 1101px) and (max-width: 1399px) { .header-cta { display: none; } }

/* Home: about, skills and experience summary */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }
.principles { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.principles h3 { margin: 0 0 14px; }
.principles ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.principles li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0; }
.principles p { margin: 0; }
.section-lead { color: var(--muted); margin: 4px 0 0; max-width: 62ch; }
.se-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .se-grid { grid-template-columns: 1fr; gap: 28px; } }
.se-grid .h3 { margin: 0 0 12px; }
.se-grid .glance li { grid-template-columns: 1fr; gap: 2px; }
.mini-skill { margin-bottom: 14px; }
.mini-title { font-weight: 600; margin: 0 0 6px; }
.mini-skill .chips { margin-bottom: 0; }
.cert-line { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.cert-line strong { color: var(--text); }

/* Skills and experience page */
.flow-part { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.flow-part:last-of-type { border-bottom: 0; }
.flow-part h2 { margin-bottom: 4px; }
.flow-part .section-lead { margin-bottom: 22px; }
.flow-end { margin: 0; }
.job-role { font-size: 1.25rem; margin: 0 0 .2em; }
.job-tools-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.job .chips { margin-bottom: 0; }

/* Blog filters, feedback prompt */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filters a { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .94rem; }
.filters a:hover { color: var(--text); }
.filters a[aria-current] { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.feedback-prompt { margin-top: 32px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feedback-prompt p { margin: 0 0 8px; }
.feedback-prompt p:last-child { margin: 0; }
.notice.ok { border-color: var(--accent); color: var(--accent-strong); }

/* Tools */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 12px; }
.tool .tf { margin: 0 0 14px; }
.tool .tf label { display: block; font-weight: 600; margin-bottom: 4px; }
.tool input:not([type=checkbox]), .tool select, .tool textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.tool textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; resize: vertical; }
.tool .tf .small { display: block; margin-top: 4px; }
.tf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.checks label { font-weight: 500; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip-btn { background: var(--accent-soft); color: var(--accent-strong); border: 0; border-radius: 999px; padding: 4px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.tool-out { margin: 8px 0 0; display: grid; gap: 0; }
.tool-out div { display: grid; grid-template-columns: 210px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.tool-out dt { color: var(--muted); font-weight: 600; }
.tool-out dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tool-out.wide div { grid-template-columns: 90px 1fr; }
.tool-out.wide dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; font-weight: 500; }
.tool-msg { color: var(--muted); margin: 8px 0 0; }
@media (max-width: 560px) { .tool-out div { grid-template-columns: 1fr; gap: 2px; } .tool-out.wide div { grid-template-columns: 1fr; } }
.tool-card h2 { margin-bottom: .4em; }
.tool-card h2 a { color: var(--text); text-decoration: none; }
.tool-card h2 a:hover { color: var(--accent); }
.site-nav .sp-list { display: block; }

.head-col { max-width: 760px; }

/* Courses and series */
progress { accent-color: var(--accent); width: 100%; height: 8px; display: block; margin: 8px 0 4px; }
progress.wide { max-width: 420px; }
.day-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .8rem; font-weight: 600; }
.filters .filter-more { margin-left: auto; color: var(--accent-strong); }
.series-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 24px; background: var(--surface, var(--bg)); }
.series-kicker { margin: 0; font-size: .9rem; font-weight: 600; }
.series-day { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; }
.series-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: .95rem; }
.series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 8px; }
.series-nav a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.series-nav a:hover { border-color: var(--accent); }
.series-nav .next { text-align: right; grid-column: 2; }
.series-nav .prev { grid-column: 1; }
.series-nav span { color: var(--muted); font-size: .88rem; }
.series-card progress { margin-top: 12px; }
@media (max-width: 560px) { .series-nav { grid-template-columns: 1fr; } .series-nav .next, .series-nav .prev { grid-column: auto; text-align: left; } }

/* Course player */
.kicker { margin: 0 0 6px; font-size: .86rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-strong); }
.course-hero { padding: 36px 0 28px; border-bottom: 1px solid var(--line); background: var(--surface, var(--bg)); }
.course-hero h1 { margin: 0 0 .3em; }
.course-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.course-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 20px; padding: 0; color: var(--muted); }
.course-facts strong { color: var(--text); }
.btn-large { padding: 12px 24px; font-size: 1.05rem; }
.progress-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.progress-card progress { margin: 6px 0; }
.progress-card p { margin: 6px 0 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.module { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; background: var(--bg); }
.module > summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.module > summary::-webkit-details-marker { display: none; }
.module > summary::before { content: ""; width: 8px; height: 8px; margin: 8px 10px 0 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; transition: transform .15s; }
.module[open] > summary::before { transform: rotate(45deg); margin-top: 5px; }
.m-title { flex: 1; }
.m-count { color: var(--muted); font-weight: 500; font-size: .9rem; }
.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lesson { border-bottom: 1px solid var(--line); }
.lesson:last-child { border-bottom: 0; }
.lesson > a, .lesson.soon { display: grid; grid-template-columns: 22px 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; color: var(--text); text-decoration: none; }
.lesson > a:hover { background: var(--accent-soft); }
.lesson.soon { color: var(--muted); }
.lesson.current > a { background: var(--accent-soft); font-weight: 600; }
.l-day { font-weight: 700; font-size: .9rem; color: var(--accent-strong); }
.lesson.soon .l-day { color: var(--muted); }
.l-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.tick { width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 50%; position: relative; box-sizing: border-box; }
.lesson.is-done .tick { background: var(--accent); border-color: var(--accent); }
.lesson.is-done .tick::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--on-accent, #fff); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lesson.soon .tick { border-style: dashed; }

.lms-bar { position: sticky; top: 64px; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.lms-bar-in { display: flex; align-items: center; gap: 24px; padding: 10px 24px; max-width: 1400px; margin: 0 auto; }
.lms-course { font-weight: 700; color: var(--text); text-decoration: none; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lms-progress { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--muted); font-size: .92rem; }
.lms-progress progress { max-width: 280px; margin: 0; }
.lms-progress span { white-space: nowrap; }
.lms-toggle { display: none; }
.lms-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; max-width: 1400px; margin: 0 auto; align-items: start; }
.lms-menu { position: sticky; top: 120px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 20px 16px 40px 24px; border-right: 1px solid var(--line); }
.lms-main { padding: 32px 40px 64px; max-width: 860px; min-width: 0; }
.lms-main h1 { margin-top: 0; }
.lesson-actions { display: flex; align-items: center; gap: 16px; margin: 36px 0 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.lms .series-nav { margin-top: 20px; }
.lms-menu .module > summary { padding: 10px 12px; font-size: .95rem; }
.lms-menu .lesson > a, .lms-menu .lesson.soon { grid-template-columns: 20px 46px minmax(0, 1fr); padding: 9px 12px; font-size: .94rem; }
.lms-menu .l-meta { display: none; }
@media (max-width: 900px) {
  .course-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lms-bar { top: 0; position: static; }
  .lms-bar-in { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .lms-course { max-width: 100%; flex: 1 1 100%; }
  .lms-progress { flex: 1; }
  .lms-ready .lms-toggle { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
  .lms-body { grid-template-columns: minmax(0, 1fr); }
  .lms-menu { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .lms-ready .lms-menu { display: none; }
  .lms-ready .lms-menu.open { display: block; }
  .lms-main { padding: 24px 16px 48px; }
  .lesson > a, .lesson.soon { grid-template-columns: 22px 48px minmax(0, 1fr); }
  .lesson .l-meta { display: none; }
}

.about-course h2 { font-size: 1.15rem; margin: 1.2em 0 .3em; }

/* Embedded media in posts */
.media { margin: 1.6em 0; }
.media iframe, .media video { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.media.embed iframe, .media.video video { aspect-ratio: 16 / 9; }
.media.doc iframe { height: 560px; }
.media figcaption { font-size: .92rem; color: var(--muted); margin-top: .5em; }
.file-card a { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.file-card a:hover { border-color: var(--accent); }
.file-type { font-weight: 700; font-size: .8rem; padding: 4px 8px; border-radius: 6px; background: var(--line); }
.file-dl { margin-left: auto; color: var(--accent); font-weight: 600; }
.topic-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.topic-jump a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .92rem; }
.topic-jump a:hover { border-color: var(--accent); }

.job-projects { list-style: none; margin: 0 0 1em; padding: 0; }
.job-projects li { padding: 8px 0; border-top: 1px solid var(--line); }
.job-projects li:first-child { border-top: 0; }
.job-projects a { font-weight: 600; }

.learning-box .path + .path { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.learning-box h3 { font-size: 1.02rem; margin: 0 0 .3em; }
.path-facts { list-style: none; padding: 0; margin: .4em 0; }
.path-facts li { padding: 1px 0; }
.learning-box progress { width: 100%; height: 8px; margin: .3em 0 .6em; }
.path-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0; }

.courses-block { margin: 0 0 34px; }
.courses-block h2 { font-size: 1.25rem; margin: 0 0 .6em; }
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.path-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; }
.path-card h3 { font-size: 1.08rem; margin: .2em 0 .4em; }
.path-card progress { width: 100%; height: 8px; margin: .3em 0 .8em; }

/* Insights: courses on the left, search and topics on the right */
.with-side.side-left { grid-template-columns: 290px minmax(0, 1fr); grid-template-areas: "left main"; gap: 32px; max-width: 1240px; }
.side-left .side-main { grid-area: main; }
.side-left .side-browse { grid-area: left; position: static; }
.side-left .side-right { grid-area: right; }
.side-left .courses-block { margin: 0; }
.side-left .courses-block h2 { font-size: 1.05rem; }
.side-left .path-card { padding: 16px 18px; }
.side-left .path-grid { grid-template-columns: minmax(0, 1fr); }
.side-left .grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 1100px) {
  .with-side.side-left { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "main"; }
  .side-left .side-right { position: static; }
  .side-left .grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
}
.page-head:has(+ .block .side-left) .wrap { max-width: 1240px; }

/* Insights browse sidebar, styled like the admin sidebar */
.side-browse nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.side-browse ul, .side-browse ol { list-style: none; margin: 0; padding: 0; }
.side-browse .nav-group { margin-top: 2px; }
.side-browse .nav-group summary { cursor: pointer; padding: 8px 10px; border-radius: 6px; font-weight: 700; list-style: none; display: flex; align-items: center; }
.side-browse .nav-group summary::-webkit-details-marker { display: none; }
.side-browse .nav-group summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.side-browse .nav-group[open] summary::after { transform: rotate(45deg); }
.side-browse .nav-group summary:hover { background: var(--bg); }
.side-browse .nav-group > ul { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.side-browse a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .96rem; }
.side-browse a:hover { background: var(--bg); }
.side-browse a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.side-browse .count { color: var(--muted); font-size: .88rem; }
.side-browse .part-list { margin: 2px 0 6px 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.side-browse .part-list a { display: block; font-size: .9rem; line-height: 1.35; }
.side-browse .part-no { color: var(--muted); font-size: .82rem; margin-right: 4px; }

.side-browse nav.side-box { padding: 18px 20px; }
.side-browse > * + * { margin-top: 20px; }
.side-browse .recent-list a { display: block; padding: 0; border-radius: 0; }
.side-browse .recent-list a:hover { background: none; text-decoration: underline; }

.captcha { display: grid; gap: 8px; max-width: 360px; }
.captcha-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha-img { border: 1px solid var(--line); border-radius: var(--radius); background: #eef3f1; }
.captcha input[type=text] { max-width: 180px; text-transform: uppercase; letter-spacing: .1em; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; max-width: 1080px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.contact-card h2 { margin: 0 0 6px; }
.contact-form-card .form { margin-top: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-actions { margin-bottom: .6em; }
.contact-side { display: grid; gap: 20px; }
.contact-open { background: var(--accent-soft); border-color: transparent; }
.contact-open p { margin: 0; color: var(--accent-strong); }
.contact-list { list-style: none; margin: 14px 0 0; padding: 0; }
.contact-list li { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.contact-list li:first-child { border-top: 0; padding-top: 0; }
.cl-label { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.cl-value { overflow-wrap: anywhere; }
.contact-cv { margin: 18px 0 0; }
.contact-cv .btn { width: 100%; text-align: center; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr); } .contact-card { padding: 20px; } }
.page-head:has(+ .block .contact-grid) .wrap { max-width: 1080px; }
.captcha { margin-bottom: 1.1em; }

.side-search { position: relative; }
.side-pop { left: 0; right: 0; top: calc(100% + 6px); width: auto; max-width: none; z-index: 20; }
.side-main .prose { max-width: none; }

/* Post header lines up with the wide layout */
.page-head:has(+ .block .side-left) .head-col { max-width: none; }
.page-head:has(+ .block .side-left) .lead { max-width: 75ch; }
/* Floating contents beside the article on wide screens */
@media (min-width: 1400px) {
  .post-article.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 210px; column-gap: 56px; align-content: start; }
  .post-article.has-toc > * { grid-column: 1; }
  .post-article.has-toc > .toc { grid-column: 2; grid-row: 1 / span 40; position: sticky; top: 96px; align-self: start; margin: 0; max-height: calc(100vh - 120px); overflow: auto; background: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 2px 0 2px 16px; font-size: .92rem; }
  .post-article.has-toc > .toc ol { list-style: none; margin: 0; padding: 0; }
  .post-article.has-toc > .toc li { margin: 0; }
  .post-article.has-toc > .toc a { display: block; padding: 5px 0; text-decoration: none; color: var(--muted); line-height: 1.35; }
  .post-article.has-toc > .toc a:hover { color: var(--accent); }
  .post-article.has-toc > .toc a[aria-current="true"] { color: var(--accent-strong); font-weight: 600; }
}

/* Roomier reading */
.with-side.side-left { gap: 48px; }
.side-main .prose { font-size: 1.06rem; line-height: 1.8; }
.side-main .prose p { margin: 0 0 1.35em; }
.side-main .prose h2 { margin: 2.4em 0 .7em; }
.side-main .prose h3 { margin: 1.9em 0 .6em; }
.side-main .prose ul, .side-main .prose ol { margin: 0 0 1.6em; padding-left: 1.5em; }
.side-main .prose li { margin-bottom: .6em; }
.side-main .prose pre { margin: 1.6em 0; padding: 18px 22px; }
.side-main .toc { margin-bottom: 36px; padding: 18px 24px; }
@media (min-width: 1400px) {
  .with-side.side-left { max-width: 1320px; }
  .page-head:has(+ .block .side-left) .wrap { max-width: 1320px; }
}
@media (max-width: 1100px) { .side-main .prose { line-height: 1.75; } }

/* Post page: hero band, article, right-hand contents and related posts */
.post-hero { background: var(--hero-bg); color: #fff; padding: 36px 0 40px; }
.post-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: center; max-width: 1240px; }
.post-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0 0 .4em; }
.post-hero .crumbs ol { margin-bottom: 14px; color: #bfdcd5; }
.post-hero .crumbs a { color: #fff; }
.post-hero .crumbs li + li::before { color: #6f9a91; }
.post-hero .meta { color: #cfe6e0; margin: 0 0 .8em !important; }
.post-hero .tag-type { color: #9ee0cf; }
.post-hero .lead { color: #e3f2ee; margin: 0; max-width: 62ch; }
.post-hero-cover { width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.2); }
.post-hero-card { min-height: 150px; border-radius: var(--radius); background: var(--hero-card); border: 1px solid rgba(255,255,255,.18); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.post-hero-card span { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #9ee0cf; font-weight: 700; }
.post-hero-card strong { font-size: 1.2rem; line-height: 1.3; }
.post-block { padding-top: 40px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; max-width: 1240px; }
.post-main .prose { max-width: none; font-size: 1.08rem; line-height: 1.85; }
.post-main .prose p { margin: 0 0 1.4em; }
.post-main .prose h2 { margin: 2.4em 0 .7em; }
.post-main .prose h3 { margin: 1.9em 0 .6em; }
.post-main .prose ul, .post-main .prose ol { margin: 0 0 1.6em; padding-left: 1.5em; }
.post-main .prose li { margin-bottom: .6em; }
.post-main .prose pre { margin: 1.6em 0; padding: 18px 22px; }
.post-aside { position: sticky; top: 92px; display: grid; gap: 28px; max-height: calc(100vh - 110px); overflow: auto; }
.post-aside .toc-side { background: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 2px 0 2px 16px; margin: 0; font-size: .94rem; }
.post-aside .toc-side ol { list-style: none; margin: 0; padding: 0; }
.post-aside .toc-side a { display: block; padding: 5px 0; text-decoration: none; color: var(--muted); line-height: 1.35; }
.post-aside .toc-side a:hover { color: var(--accent); }
.post-aside .toc-side a[aria-current="true"] { color: var(--accent-strong); font-weight: 600; }
.related-side ul { list-style: none; margin: 0 0 10px; padding: 0; }
.related-side li { padding: 11px 0; border-top: 1px solid var(--line); }
.related-side a:not(.more-link) { font-weight: 600; text-decoration: none; line-height: 1.35; display: block; }
.related-side a:not(.more-link):hover { color: var(--accent); }
.more-link { font-weight: 600; font-size: .94rem; }
@media (max-width: 1000px) {
  .post-hero-inner, .post-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .post-hero-card, .post-hero-cover { display: none; }
  .post-aside { position: static; max-height: none; overflow: visible; }
  .post-aside .toc-side { display: none; }
}
@media (min-width: 1001px) { .toc-inline { display: none; } }

/* One page width everywhere, matching Insights: 1240px, or 1320px on large screens */
:root { --page-max: 1240px; }
@media (min-width: 1400px) { :root { --page-max: 1320px; } }
.wrap, .site-header .wrap, .page-head .wrap,
.page-head:has(+ .block .side-left) .wrap, .page-head:has(+ .block .contact-grid) .wrap,
.with-side.side-left, .post-hero-inner, .post-layout, .contact-grid { max-width: var(--page-max); }

/* Contact form at a comfortable width; the side column stays on the right edge */
@media (min-width: 901px) {
  .contact-grid { grid-template-columns: minmax(0, 700px) minmax(300px, 380px); justify-content: space-between; column-gap: 48px; }
}

/* Tighter spacing across the site */
.block { padding: 36px 0; }
.page-head { padding: 32px 0 0; }
.page-head + .block { padding-top: 24px; }
.page-head h1 { margin-bottom: .2em; }
.hero { padding: 40px 0 28px; }
.cta { padding: 40px 0; }
.section-head { margin-bottom: 18px; }
.hero-grid, .two-col, .about-grid { gap: 32px; }
.with-side, .se-grid, .course-hero-grid { gap: 28px; }
.with-side.side-left { gap: 32px; }
.flow-part { padding-bottom: 28px; margin-bottom: 28px; }
.form p { margin-bottom: .85em; }
.contact-card { padding: 22px; }
.contact-side { gap: 16px; }
.contact-list li { padding: 9px 0; }
@media (min-width: 901px) { .contact-grid { column-gap: 32px; } }
.post-hero { padding: 26px 0 28px; }
.post-hero-inner, .post-layout { gap: 36px; }
.post-block { padding-top: 26px; }
.post-aside { gap: 22px; }
.side-main .prose, .post-main .prose { line-height: 1.7; }
.side-main .prose p, .post-main .prose p { margin: 0 0 1em; }
.side-main .prose h2, .post-main .prose h2 { margin: 1.7em 0 .5em; }
.side-main .prose h3, .post-main .prose h3 { margin: 1.4em 0 .45em; }
.side-main .prose ul, .side-main .prose ol, .post-main .prose ul, .post-main .prose ol { margin: 0 0 1.1em; }
.side-main .prose li, .post-main .prose li { margin-bottom: .3em; }
.side-main .prose pre, .post-main .prose pre { margin: 1.1em 0; padding: 14px 18px; }
.side-main .toc { margin-bottom: 24px; padding: 14px 20px; }
.sidebar > * + *, .side-browse > * + * { margin-top: 16px; }
@media (max-width: 800px) { .block { padding: 28px 0; } .page-head { padding-top: 24px; } .hero { padding: 28px 0 20px; } }
.card h2.h3 { margin-bottom: .4em; }
.card h2.h3 a { color: var(--text); text-decoration: none; }
.card h2.h3 a:hover { color: var(--accent); }

/* Justified body text; hyphenation keeps word gaps even */
.prose p, .prose li, .card-body p:not(.meta), .lead, .hero-intro, .section-lead,
.job li, .flow-part p, .flow-part li, .about-grid .prose p, .about-grid .prose li, .post-hero .lead {
  text-align: justify; hyphens: manual; -webkit-hyphens: manual;
}
.prose li code, .prose p code { hyphens: none; }

/* Article reading bar: title and time left, shown once the title scrolls away */
.read-bar { position: fixed; left: 0; right: 0; top: 64px; z-index: 45; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.06); transform: translateY(-6px); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
.read-bar.show { opacity: 1; transform: none; pointer-events: auto; }
.read-bar[hidden] { display: block; visibility: hidden; }
.read-bar.show[hidden] { visibility: visible; }
.read-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.rb-title { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rb-left { flex: none; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.rb-track { height: 3px; background: var(--line); }
.rb-fill { height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) { .read-bar { transition: none; } }
/* Room for the reading bar */
.post-aside { top: 124px; max-height: calc(100vh - 140px); }
.post-main h2, .post-main h3 { scroll-margin-top: 130px; }

/* Tools: compact list with the Insights-style sidebar */
.tool-group + .tool-group { margin-top: 26px; }
.tool-group-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.tool-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tool-list li + li { border-top: 1px solid var(--line); }
.tool-list a { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 4px 24px; align-items: baseline; padding: 12px 18px; color: var(--text); text-decoration: none; }
.tool-list a:hover { background: var(--surface); }
.tool-list a:hover .tl-title { color: var(--accent); }
.tl-title { font-weight: 600; }
.tl-sum { color: var(--muted); font-size: .95rem; }
.tools-note { margin-top: 18px; }
.tool-main .tool { max-width: none; }
@media (max-width: 640px) { .tool-list a { grid-template-columns: minmax(0, 1fr); } }

/* Home: one compact Experience summary instead of repeating the Experience page */
.exp-brief { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.exp-brief a { display: grid; gap: 4px; height: 100%; padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.exp-brief a:hover { border-color: var(--accent); }
.exp-brief a:hover strong { color: var(--accent); }
.eb-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.exp-brief strong { font-size: 1.15rem; }
.eb-note { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.exp-brief a { align-content: start; }
.eb-note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Home grids: three across on wide screens, so three cards fill the row */
@media (min-width: 1000px) { .wrap > .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* CV download form */
.cv-card { max-width: 760px; }
.cv-reasons { border: 0; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.cv-reasons legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.cv-reasons .radio { display: flex; gap: 10px; align-items: center; font-weight: 500; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; margin: 0; }
.cv-reasons .radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cv-reasons input { width: auto; margin: 0; accent-color: var(--accent); }
.form .cv-reasons input[type=radio] { width: auto; flex: none; padding: 0; }
.form .cv-reasons .radio { display: flex; text-align: left; }

/* Coming soon series and series plans */
.soon, .soon-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.side-browse .soon { margin-left: auto; }
.soon-banner { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; background: var(--surface); }
.soon-banner p { margin: 0; }
.soon-banner p + p { margin-top: 6px; }
.soon-banner a { text-decoration: none; }
.soon-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--surface); margin-bottom: 22px; }
.soon-box h2 { margin: 8px 0 6px; }
.series-plan { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.plan-mod { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 16px 0 6px; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.plan-list .part-no { color: var(--muted); font-size: .85rem; min-width: 64px; }
.plan-list li.later > span:not(.part-no):not(.soon) { color: var(--muted); }
.side-browse a .soon { align-self: flex-start; flex: none; line-height: 1.5; margin-top: 2px; }
/* No hyphenation in short intros: words stay whole */
.hero-intro, .lead, .section-lead, .post-hero .lead { hyphens: manual; -webkit-hyphens: manual; }
/* About section alignment: text fills its column, heading lines up with the side column, no broken words */
.about-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
.about-grid .prose { max-width: none; }
.about-grid .prose > h2:first-child { margin-top: 0; }
.about-grid .side { text-align: left; }
.about-grid .side p, .about-grid .side li { text-align: left; hyphens: manual; }
.prose p, .prose li, .card-body p, .job li, .flow-part p, .flow-part li { hyphens: manual; -webkit-hyphens: manual; }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
/* Hero intro fills the same width as the name and headline */
.hero-text .hero-intro { max-width: none; }

/* World clock */
.tool-sub { margin: 26px 0 12px; }
.wc-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.wc-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr) auto; gap: 6px 18px; align-items: center; padding: 12px 16px; }
.wc-list li + li { border-top: 1px solid var(--line); }
.wc-name strong { display: block; }
.wc-time { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wc-del { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.wc-del:hover { color: var(--text); border-color: var(--text); }
@media (max-width: 640px) { .wc-list li { grid-template-columns: minmax(0, 1fr) auto; } .wc-meta { grid-column: 1 / -1; } }
/* Banner text follows any accent colour */
.post-hero .crumbs ol { color: rgba(255,255,255,.78); }
.post-hero .crumbs li + li::before { color: rgba(255,255,255,.45); }
.post-hero .meta { color: rgba(255,255,255,.85); }
.post-hero .tag-type, .post-hero-card span { color: rgba(255,255,255,.82); }
.post-hero .lead { color: rgba(255,255,255,.92); }

/* ===== Motion and hover: one system across the site ===== */
:root { --ease: cubic-bezier(.2, .7, .2, 1); --dur: .18s; --lift: 0 6px 18px rgba(16, 24, 32, .08); }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --lift: 0 6px 18px rgba(0, 0, 0, .35); } }
:root[data-mode="dark"] { --lift: 0 6px 18px rgba(0, 0, 0, .35); }

/* Links: colour fades, underline appears on hover */
a { transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.prose a, .search-note a, .more-link { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.prose a:hover, .search-note a:hover, .more-link:hover { text-decoration-color: currentColor; }

/* Buttons: colour change, a small lift, and a press */
.btn, .chip-btn, .wc-del, .side-search .btn { transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--lift); }
.btn:active, .chip-btn:active { transform: translateY(0); box-shadow: none; }
.btn-ghost:hover { box-shadow: none; }
.chip-btn:hover { background: var(--accent); color: var(--on-accent); }

/* Main menu: an underline slides in on hover */
.site-nav > ul > li > a { position: relative; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.site-nav > ul > li > a:not([aria-current="page"])::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.site-nav > ul > li > a:hover { background: transparent; color: var(--text); }
.site-nav > ul > li > a:hover::after { transform: scaleX(1); }

/* Cards and list rows: accent border, a small lift and a shadow */
.card, .exp-brief a, .path-card, .cv-card { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card:hover, .exp-brief a:hover { border-color: var(--accent); box-shadow: var(--lift); transform: translateY(-2px); }
.card:hover h2 a, .card:hover h3 a { color: var(--accent); }
.tool-list a, .related-side a, .recent-list a, .plan-list a, .contact-list a, .topic-list a { transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.tool-list a:hover { background: var(--accent-soft); }
.tool-list a:hover .tl-title { color: var(--accent-strong); }

/* Sidebars: soft highlight and a short slide on hover */
.side-browse a { transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), padding-left var(--dur) var(--ease); }
.side-browse a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.side-browse .nav-group summary { transition: background-color var(--dur) var(--ease); }
.post-aside .toc-side a { transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }

/* Form fields: accent ring on focus */
input, select, textarea { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.form input:focus, .form select:focus, .form textarea:focus, .search-row input:focus, .tool input:focus, .tool select:focus, .tool textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Chips and tags */
.chips a, .tags a { transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.chips a:hover, .tags a:hover { background: var(--accent); color: var(--on-accent); }

/* Page entrance: the top of each page fades in once */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-text, .profile-card, .page-head .wrap, .post-hero-inner { animation: rise .45s var(--ease) both; }
.profile-card, .post-hero-card { animation-delay: .08s; }

/* Content further down fades in as it scrolls into view (added by site.js; nothing is hidden without JavaScript) */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:hover, .card:hover, .exp-brief a:hover { transform: none; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Insights sidebar: one compact panel that stays in view */
.browse-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-self: start; min-width: 0; }
.browse-panel nav, .browse-panel form { min-width: 0; }
.browse-panel .search-row { min-width: 0; }
@media (min-width: 1101px) { .side-left .browse-panel { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; overscroll-behavior: contain; } }
.browse-panel > * + * { margin-top: 0; }
.browse-panel nav { background: none; border: 0; padding: 0; }
.browse-panel .side-search { margin: 0 0 6px; }
.browse-panel .search-row input { background: var(--bg); }
.bp-title { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.browse-panel ul { list-style: none; margin: 0; padding: 0; }
.bp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.side-browse .bp-pills a { display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: .9rem; }
.side-browse .bp-pills a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.side-browse .bp-pills a[aria-current="page"] .count { color: var(--on-accent); }
.bp-list > li > a { padding: 6px 8px; }
.bp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.side-browse .bp-tags a { display: inline-flex; gap: 5px; align-items: center; padding: 3px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: .85rem; }
.side-browse .bp-tags a .count { font-size: .75rem; }
.side-browse .bp-tags a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.bp-more { margin-top: 8px; }
.bp-more summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); }
.bp-more[open] summary { margin-bottom: 8px; }
.bp-foot { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.side-browse .bp-foot a { display: inline; padding: 0; background: none; color: var(--accent); font-size: inherit; }
.side-browse .bp-foot a:hover { background: none; text-decoration: underline; }

/* Search: expand, highlight and drop-down */
.header-search input { transition: width .22s var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease); }
@media (min-width: 1101px) {
  .header-search input:focus { width: 280px; }
  .header-search .search-pop { width: 380px; }
}
.header-search input:focus, .side-search input:focus { outline: none; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-pop { padding: 8px 12px 12px; animation: pop-in .14s var(--ease); max-height: min(70vh, 520px); overflow: auto; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.search-pop .sp-list a, .site-nav .search-pop .sp-list a { padding: 7px 10px; margin: 0 -10px; border-radius: 6px; }
.search-pop .sp-list a { overflow-wrap: anywhere; }
.search-pop .sp-list a:hover, .search-pop .sp-list a.active { background: var(--accent-soft); color: var(--accent-strong); }
.search-pop .sp-list a.active { font-weight: 600; }
.side-search .side-pop { width: 100%; }
.side-browse .search-pop a { display: block; }
.side-browse .search-pop .sp-chip { display: inline-block; }
.search-pop mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.site-nav .search-pop .sp-chip, .search-pop .sp-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 500; text-decoration: none; box-shadow: none; }
.search-pop .sp-chip:hover, .search-pop .sp-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sp-hint { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
.search-pop .sp-all.active { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .search-pop { animation: none; } }
/* One scroll only: the sidebar panel and its search list grow with the page instead of scrolling inside */
@media (min-width: 1101px) { .side-left .browse-panel { max-height: none; overflow: visible; } }
.side-search .side-pop { max-height: none; overflow: visible; }
.side-search .side-pop .sp-list li:nth-child(n+5) { display: none; }

/* Series colours: each series has its own colour on cards, the sidebar and its page */
/* one calm, neutral colour for every series */
.sc-0, .sc-1, .sc-2, .sc-3, .sc-4, .sc-5 { --sc: #4a5563; --sc-soft: #f1f3f5; --sc-light: #aeb8c3; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) .sc-0, :root:not([data-mode="light"]) .sc-1, :root:not([data-mode="light"]) .sc-2, :root:not([data-mode="light"]) .sc-3, :root:not([data-mode="light"]) .sc-4, :root:not([data-mode="light"]) .sc-5 { --sc: var(--sc-light); --sc-soft: color-mix(in srgb, var(--sc-light) 14%, var(--bg)); } }
:root[data-mode="dark"] .sc-0, :root[data-mode="dark"] .sc-1, :root[data-mode="dark"] .sc-2, :root[data-mode="dark"] .sc-3, :root[data-mode="dark"] .sc-4, :root[data-mode="dark"] .sc-5 { --sc: var(--sc-light); --sc-soft: color-mix(in srgb, var(--sc-light) 14%, var(--bg)); }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sc, var(--accent)); flex: none; margin-right: 8px; vertical-align: middle; }

.post-card.in-series { border-top: 3px solid var(--sc); }
.post-card.in-series:hover { border-color: var(--sc); }
.series-strip { display: flex; align-items: center; gap: 0; padding: 8px 20px; background: var(--sc-soft); color: var(--sc); font-size: .82rem; font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.series-strip:hover { color: var(--sc); text-decoration: underline; }
.series-part { margin-left: auto; padding-left: 10px; font-weight: 600; opacity: .9; white-space: nowrap; }

.series-banner { border: 1px solid var(--line); background: var(--sc-soft); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px; }
.series-banner .series-kick { margin: 0 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sc); display: flex; align-items: center; }
.series-banner h2 { margin: 0 0 6px; }
.series-banner p { margin: 0 0 6px; }
.series-banner p:last-child { margin: 0; }

.bp-list > li > a { display: flex; align-items: center; }
.bp-list .sname { flex: 1; min-width: 0; }
.bp-list > li > a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; }
.post-hero-card.in-series { border-left: 4px solid var(--sc-light); }

/* Pager: page numbers and steps */
.pager { flex-direction: column; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager-count { margin: 0; font-size: .9rem; color: var(--muted); }
.pager-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.pg-num, .pg-step { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); font-weight: 600; font-size: .95rem; text-decoration: none; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.pg-num { padding: 0 10px; }
a.pg-num:hover, a.pg-step:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pg-num.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pg-step.is-off { color: var(--muted); background: var(--surface); border-style: dashed; cursor: default; }

/* Light and dark switch in the header */
.mode-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex: none; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.mode-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.mode-toggle[hidden] { display: none; }
.mode-toggle svg { width: 18px; height: 18px; }
.mode-toggle .i-sun { display: none; }
:root[data-mode="dark"] .mode-toggle .i-sun { display: block; }
:root[data-mode="dark"] .mode-toggle .i-moon { display: none; }
@media print { .mode-toggle { display: none; } }

/* Series in the sidebar: each one opens and closes */
.bp-series > li > details > summary { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; list-style: none; color: var(--text); font-weight: 500; transition: background var(--dur) var(--ease); }
.bp-series > li > details > summary::-webkit-details-marker { display: none; }
.bp-series > li > details > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--dur) var(--ease); margin-right: 2px; }
.bp-series > li > details[open] > summary::before { transform: rotate(45deg); }
.bp-series > li > details > summary:hover { background: var(--bg); }
.bp-series > li > details > summary.is-on { background: var(--bg); font-weight: 600; }
.bp-series .sname { flex: 1; min-width: 0; }
.bp-series-body { padding: 4px 0 8px 22px; }
.bp-series-body .part-list { margin: 0 0 6px; }
.bp-series-body p { margin: 2px 0 6px; }
.bp-series-all { display: inline-block; font-size: .88rem; font-weight: 600; color: var(--accent); padding: 2px 0; }
.bp-series-all[aria-current="page"] { color: var(--text); text-decoration: none; }
.side-browse .bp-series .bp-series-all { display: inline-block; padding: 2px 0; background: none; box-shadow: none; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.side-browse .bp-series .bp-series-all:hover { color: var(--accent-strong); background: none; }
.side-browse .bp-series .bp-series-all[aria-current="page"] { color: var(--muted); text-decoration: none; }
.bp-series > li > details > summary { align-items: flex-start; line-height: 1.45; }
.bp-series > li > details > summary::before { margin-top: .5em; }
.bp-series > li > details > summary .count, .bp-series > li > details > summary .soon { margin-top: 1px; }

/* Series as course modules in the sidebar */
.lms-head { margin: 4px 0 10px; }
.lms-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lms-bar span { display: block; height: 100%; width: 0; background: var(--sc, var(--accent)); border-radius: 99px; transition: width .4s var(--ease); }
.lms-status { margin: 6px 0 8px; font-size: .85rem; color: var(--muted); }
.side-browse .lms-start { display: block; width: 100%; text-align: center; padding: 8px 12px; font-size: .92rem; }
.lms-mods { list-style: none; margin: 0 0 8px; padding: 0; }
.lms-mods > li + li { border-top: 1px solid var(--line); }
.lms-mod > summary { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; font-size: .9rem; font-weight: 600; color: var(--text); }
.lms-mod > summary::-webkit-details-marker { display: none; }
.lms-mod > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin: .45em 2px 0 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--dur) var(--ease); }
.lms-mod[open] > summary::after { transform: rotate(-135deg); margin-top: .65em; }
.lms-mod-name { flex: 1; min-width: 0; line-height: 1.35; }
.lms-mod-no { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lms-mod-count { font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 1px; }
.lms-lessons { list-style: none; margin: 0 0 8px; padding: 0; }
.lms-lesson > a, .lms-lesson.is-later { display: flex; gap: 9px; align-items: flex-start; padding: 5px 6px; border-radius: 6px; font-size: .88rem; line-height: 1.35; }
.side-browse .lms-lesson > a { color: var(--text); text-decoration: none; }
.side-browse .lms-lesson > a:hover { background: var(--bg); color: var(--accent); }
.side-browse .lms-lesson > a[aria-current="page"] { background: var(--sc-soft, var(--accent-soft)); font-weight: 600; }
.lms-lesson.is-later { color: var(--muted); }
.lms-lesson .part-no { display: block; font-size: .74rem; color: var(--muted); }
.lms-mark { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 2px solid var(--line); border-radius: 50%; background: var(--bg); }
.lms-lesson > a .lms-mark { border-color: var(--muted); }
.lms-lesson.is-later .lms-mark { border-style: dashed; }
.lms-lesson.is-done .lms-mark { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.bp-series-body { padding-left: 14px; }
.plan-list li.is-done::after { content: "Read"; margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--accent); }
.side-browse a.lms-start, .side-browse a.lms-start:hover { color: var(--on-accent); text-decoration: none; }

/* ===== Insights: Posts and Series kept apart ===== */
.ins-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.ins-tabs a { padding: 10px 16px; margin-bottom: -1px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.ins-tabs a:hover { color: var(--text); }
.ins-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.ins-tabs .count { color: var(--muted); font-weight: 500; font-size: .88rem; margin-left: 2px; }

.side-browse .bp-series-links > li > a { display: flex; align-items: flex-start; gap: 8px; }
.side-browse .bp-series-links .sname { flex: 1; min-width: 0; line-height: 1.4; }
.side-browse .bp-series-links > li > a[aria-current="page"] { background: var(--bg); border: 1px solid var(--line); font-weight: 600; }
.side-browse .bp-series-links > li > a { border: 1px solid transparent; }
.bp-sublink { margin: 4px 0 0; }
.side-browse .bp-sublink a { display: inline-block; font-size: .88rem; font-weight: 600; color: var(--accent); padding: 4px 10px; }

/* Series tab: course cards */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.course-card { border: 1px solid var(--line); border-top: 3px solid var(--sc); border-radius: var(--radius); padding: 18px 20px; background: var(--bg); display: flex; flex-direction: column; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.course-card:hover { box-shadow: var(--lift); transform: translateY(-2px); }
.course-card h2 { margin: 4px 0 8px; }
.course-card h2 a { color: var(--text); text-decoration: none; }
.course-card h2 a:hover { color: var(--accent); }
.course-card > p.muted { margin: 0 0 14px; }
.course-card .lms-head { margin-top: auto; }
.course-card .soon-tag { align-self: flex-start; margin-top: auto; }
.course-more { margin: 12px 0 0; font-size: .92rem; font-weight: 600; }
.series-kick { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.series-kick a { color: var(--muted); }
.lms-start { display: inline-block; }
.course-card .lms-start { display: block; text-align: center; }

/* One series as a course */
.course-top { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; margin-bottom: 16px; }
.course-top h2 { margin: 6px 0 6px; }
.course-sum { margin: 0 0 14px; color: var(--muted); max-width: 70ch; }
.lms-big { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: center; max-width: 640px; }
.lms-big .lms-bar { grid-column: 1; height: 8px; }
.lms-big .lms-status { grid-column: 1; margin: 0; }
.lms-big .lms-start { grid-column: 2; grid-row: 1 / span 2; }
.course-about { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
.course-about > summary { cursor: pointer; font-weight: 600; }
.course-about .prose { margin-top: 10px; }
.course-mods { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.course-mod { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.course-mod-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.course-mod-head .lms-mod-no { margin: 0; grid-column: 1; }
.course-mod-head h3 { margin: 0; grid-column: 1; font-size: 1.08rem; }
.course-mod-head .lms-mod-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .85rem; }
.course-mod .lms-lessons { margin: 0; padding: 6px 8px; }
.course-mod .lms-lesson > a, .course-mod .lms-lesson.is-later { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 6px; font-size: .97rem; text-decoration: none; color: var(--text); }
.course-mod .lms-lesson + .lms-lesson { border-top: 1px solid var(--line); }
.course-mod .lms-lesson > a:hover { background: var(--surface); }
.course-mod .lms-lesson > a:hover .lms-title { color: var(--accent); }
.course-mod .lms-text { flex: 1; min-width: 0; }
.course-mod .lms-title { display: block; font-weight: 600; line-height: 1.35; }
.course-mod .lms-ex { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; line-height: 1.45; }
.course-mod .lms-time { flex: none; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.course-mod .is-later .lms-title { font-weight: 500; color: var(--muted); }
.course-mod .lms-mark { margin-top: 3px; width: 16px; height: 16px; }
.course-mod .lms-lesson.is-done .lms-time::after { content: " · Read"; color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .lms-big { grid-template-columns: 1fr; } .lms-big .lms-start { grid-column: 1; grid-row: auto; text-align: center; } }

/* Series posts: course progress on the left, contents and related on the right */
.post-layout.in-course { grid-template-columns: 260px minmax(0, 1fr) 230px; gap: 40px; max-width: 1400px; }
.course-aside { position: sticky; top: 128px; max-height: calc(100vh - 144px); overflow: auto; padding-right: 4px; }
.course-aside .side-title { margin-top: 0; }
@media (max-width: 1279px) {
  .post-layout.in-course { grid-template-columns: 250px minmax(0, 1fr); }
  .post-layout.in-course > .post-aside { grid-column: 2; position: static; max-height: none; overflow: visible; }
  .post-layout.in-course > .post-aside .toc-side { display: none; }
  .post-layout.in-course .toc-inline { display: block; }
}
@media (max-width: 1000px) {
  .post-layout.in-course { grid-template-columns: minmax(0, 1fr); }
  .post-layout.in-course > .course-aside { position: static; max-height: none; order: 2; }
  .post-layout.in-course > .post-aside { grid-column: 1; order: 3; }
}
.post-layout.in-course > .post-aside { top: 128px; max-height: calc(100vh - 144px); }

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 0.95;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  opacity: 1;
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 600px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* Code block wrapping, copy button and language tag */
.code-wrap {
  position: relative;
  margin: 1.4em 0;
}
.code-wrap pre {
  margin: 0 !important;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  color: #adb5bd;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}
.code-copy.is-copied {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.code-lang {
  position: absolute;
  top: 9px;
  left: 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #a3adb8;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}
.code-wrap:has(.code-lang) pre {
  padding-top: 36px;
}

/* Interactive click-to-copy in tool outputs */
.tool-out dd.copyable {
  cursor: pointer;
  position: relative;
  transition: background .15s ease, color .15s ease;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
}
.tool-out dd.copyable:hover {
  background: var(--surface);
  color: var(--accent);
}
.tool-out dd.copyable.copied {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

/* Article action buttons (Share / Copy link) */
.post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.post-share-btn.is-copied {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* Article Table of Contents subheadings */
.toc-sub {
  padding-left: 14px;
  font-size: 0.9em;
  opacity: 0.92;
}

/* Helpful tools card in article sidebar */
.related-tools-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 18px;
}
.tool-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-aside-list li {
  margin: 0;
}
.tool-aside-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  transition: background var(--dur) var(--ease);
}
.tool-aside-list a:hover {
  background: var(--bg);
  color: var(--accent);
}
.tool-aside-list strong {
  font-size: 0.92rem;
  color: var(--accent);
}
.tool-aside-list .small {
  font-size: 0.82rem;
}

/* Callout alerts in articles: [!NOTE], [!TIP], [!WARNING], [!IMPORTANT], [!CAUTION] */
.prose blockquote.callout {
  margin: 1.6em 0;
  padding: 14px 18px;
  border-radius: 6px;
  border-left-width: 4px;
  background: var(--surface);
}
.callout-header {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.callout p:last-child {
  margin-bottom: 0;
}

/* Note */
.callout-note {
  border-left-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.07) !important;
}
.callout-note .callout-header {
  color: #0284c7;
}

/* Tip */
.callout-tip {
  border-left-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.07) !important;
}
.callout-tip .callout-header {
  color: #059669;
}

/* Warning */
.callout-warning {
  border-left-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.08) !important;
}
.callout-warning .callout-header {
  color: #d97706;
}

/* Important */
.callout-important {
  border-left-color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.07) !important;
}
.callout-important .callout-header {
  color: #7c3aed;
}

/* Caution */
.callout-caution {
  border-left-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
.callout-caution .callout-header {
  color: #dc2626;
}


.chip-label { align-self: center; margin-right: 4px; }

/* Share buttons in the dark post header: light outline so they stay readable */
.post-hero .post-actions .btn { color: #ffffff; border-color: rgba(255, 255, 255, .55); background: transparent; }
.post-hero .post-actions .btn:hover { background: rgba(255, 255, 255, .12); border-color: #ffffff; color: #ffffff; }
.post-hero .post-actions .post-share-btn.is-copied { background: #ffffff; color: var(--hero-bg); border-color: #ffffff; }

/* Port reference tool */
.chip-btn.is-on { background: var(--accent); color: var(--on-accent); }
.port-search .tf input { width: 100%; max-width: 520px; }
.port-list { margin-top: 6px; }
.port-cat { margin: 0 0 22px; }
.port-cat h2 { margin: 0 0 6px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.port-cat ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.port-cat li { display: grid; grid-template-columns: 112px 74px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.port-cat li[hidden] { display: none; }
.pt-num { font-family: var(--mono); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.pt-proto { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.pt-body strong { display: block; }
.pt-body .muted { display: block; font-size: .92rem; line-height: 1.45; }
@media (max-width: 560px) { .port-cat li { grid-template-columns: 96px minmax(0, 1fr); } .pt-proto { grid-column: 1; grid-row: 2; } .pt-body { grid-column: 2; grid-row: 1 / span 2; } }
/* On phones, a tool page shows the tool first and the tool list after it */
@media (max-width: 1100px) { .with-side.side-left:has(> .tool-main) { grid-template-areas: "main" "left"; } }

/* ---- Series as a course dashboard: continue card, modules, progress panel ---- */
.cd-head { margin: 0 0 18px; }
.cd-head h2 { margin: 4px 0 6px; font-size: 1.7rem; }
.cd-head .course-sum { margin: 0; color: var(--muted); max-width: 62ch; }
.cd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "hero rail" "content rail"; gap: 20px 24px; align-items: start; }
.cd-hero { grid-area: hero; }
.cd-rail { grid-area: rail; display: grid; gap: 16px; }
.cd-content { grid-area: content; min-width: 0; }

.cd-hero, .cd-card, .cd-mod { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 30, 40, .04), 0 8px 22px rgba(20, 30, 40, .05); }
.cd-hero { padding: 26px 28px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.cd-kick { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-strong); }
.cd-title { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.2; }
.cd-ex { margin: 0 0 10px; color: var(--muted); max-width: 58ch; }
.cd-ex:empty { display: none; }
.cd-meta { margin: 0 0 18px; color: var(--muted); font-size: .92rem; }
.cd-meta-no { font-weight: 600; color: var(--text); }
.cd-meta-min::before { content: "\00b7"; margin: 0 6px; }
.cd-go-row { margin-bottom: 18px; }
.cd-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cd-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .4s var(--ease); }
.cd-pct { margin: 6px 0 0; text-align: right; font-size: .85rem; color: var(--muted); }
.cd-hero-soon { background: var(--surface); }

.cd-card { padding: 18px 20px; }
.cd-card-h { margin: 0 0 12px; font-size: .95rem; font-weight: 600; }
.cd-ring { position: relative; width: 150px; height: 150px; margin: 4px auto 12px; }
.cd-ring svg { width: 100%; height: 100%; display: block; }
.cd-ring-bg { stroke: var(--line); }
.cd-ring-fg { stroke: var(--accent); transition: stroke-dashoffset .5s var(--ease); }
.cd-ring-txt { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.cd-ring-txt strong { font-size: 1.9rem; font-weight: 600; }
.cd-ring-txt span { font-size: .8rem; color: var(--muted); }
.cd-count { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.cd-count span { color: var(--muted); font-size: .9rem; }
.cd-left, .cd-note { margin: 4px 0 0; font-size: .86rem; color: var(--muted); }
.cd-facts { list-style: none; margin: 0; padding: 0; }
.cd-facts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.cd-facts li:first-child { border-top: 0; padding-top: 0; }
.cd-facts span { color: var(--muted); }
.cd-next { margin: 0; font-weight: 600; line-height: 1.4; }
.cd-next .part-no { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }

.cd-sec { margin: 6px 0 12px; font-size: 1.05rem; font-weight: 600; }
.cd-mods { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cd-mod > summary { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; }
.cd-mod > summary::-webkit-details-marker { display: none; }
.cd-mod > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--dur) var(--ease); }
.cd-mod[open] > summary::after { transform: rotate(-135deg); }
.cd-modno { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.cd-modname strong { display: block; font-weight: 600; line-height: 1.3; }
.cd-modname small { display: block; color: var(--muted); font-size: .84rem; }
.cd-mod.is-later { opacity: 1; }
.cd-mod.is-later .cd-modno { background: var(--surface); color: var(--muted); }
.cd-mod .lms-lessons { margin: 0; padding: 0 8px 8px; border-top: 1px solid var(--line); }
.cd-mod .lms-lesson > a, .cd-mod .lms-lesson.is-later { display: flex; align-items: center; gap: 14px; padding: 11px 10px; border-radius: 8px; font-size: .96rem; color: var(--text); text-decoration: none; }
.cd-mod .lms-lesson + .lms-lesson { border-top: 1px solid var(--line); }
.cd-mod .lms-lesson > a:hover { background: var(--surface); }
.cd-mod .lms-lesson.is-next > a { background: var(--accent-soft); }
.cd-mod .lms-text { flex: 1; min-width: 0; }
.cd-mod .lms-title { display: block; font-weight: 500; line-height: 1.35; }
.cd-mod .lms-lesson.is-next .lms-title { font-weight: 600; }
.cd-mod .is-later .lms-title { color: var(--muted); }
.cd-mod .lms-time { flex: none; font-size: .84rem; color: var(--muted); }
.cd-mod .lms-mark { flex: none; width: 20px; height: 20px; margin: 0; }
.cd-no { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cd-mod .lms-lesson.is-next .cd-no { border-color: var(--accent); color: var(--accent-strong); }
.cd .course-about { margin-top: 16px; }

@media (max-width: 1100px) {
  .cd-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "rail" "content"; }
  .cd-rail { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 560px) {
  .cd-hero { padding: 20px; }
  .cd-title { font-size: 1.4rem; }
  .cd-mod .lms-time { display: none; }
}

/* Series list: same soft cards */
.course-card { border-top: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 30, 40, .04), 0 8px 22px rgba(20, 30, 40, .05); }
.course-card .lms-bar span { background: var(--accent); }

/* ---- Focus reading: only the article, in a narrow column ---- */
.focus-ui { display: none; }
.focus-btn[aria-pressed="true"] { background: var(--surface); }
html.focus-read .site-header, html.focus-read .site-footer, html.focus-read .read-bar, html.focus-read .back-to-top,
html.focus-read .post-aside, html.focus-read .course-aside, html.focus-read .series-box, html.focus-read .series-banner,
html.focus-read .author-box, html.focus-read .feedback-prompt, html.focus-read .post-hero-card, html.focus-read .post-hero-cover,
html.focus-read .post-hero .crumbs, html.focus-read .post-actions, html.focus-read .toc-inline, html.focus-read .chips.tags { display: none !important; }
html.focus-read .post-hero h1 { color: var(--text); }
html.focus-read .post-hero .meta { color: var(--muted); }
html.focus-read .post-hero .tag-type { color: var(--accent-strong); }
html.focus-read .post-hero .lead { color: var(--muted); }
html.focus-read .post-main { max-width: none; }
html.focus-read .focus-ui { display: block; }
html.focus-read .focus-track { position: fixed; left: 0; right: 0; top: 0; height: 3px; background: var(--line); z-index: 70; }
html.focus-read .focus-fill { height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
/* Long inline code wraps instead of widening the page on phones */
.prose :not(pre) > code { overflow-wrap: anywhere; }
html.focus-read .prose p, html.focus-read .prose li, html.focus-read .post-main p, html.focus-read .post-main li { text-align: left; hyphens: manual; }

/* Focus reading: roomier column, bigger text, reading options bar */
html.focus-read { --fs: 1; }
html.focus-read .post-hero { background: none; color: var(--text); padding: 96px 0 0; }
html.focus-read .post-hero-inner { display: block; max-width: 840px; margin: 0 auto; padding: 0 28px; }
html.focus-read .post-hero h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.15; margin-bottom: .5em; }
html.focus-read .post-hero .meta { font-size: 1rem; }
html.focus-read .post-hero .lead { font-size: 1.2rem; line-height: 1.6; max-width: none; }
html.focus-read .post-block { padding: 28px 0 120px; }
html.focus-read .post-layout, html.focus-read .post-layout.in-course { display: block; max-width: 840px; margin: 0 auto; padding: 0 28px; }
html.focus-read .prose { font-size: calc(1.22rem * var(--fs)); line-height: 1.85; hyphens: manual; text-align: left; }
html.focus-read .prose h2 { font-size: 1.6em; margin-top: 2.2em; }
html.focus-read .prose h3 { font-size: 1.28em; margin-top: 1.8em; }
html.focus-read .prose p, html.focus-read .prose li { margin-bottom: 1.1em; }
html.focus-read .prose pre { font-size: .82em; line-height: 1.6; }
html.focus-read .series-nav { margin-top: 56px; }
html.focus-read .focus-bar { position: fixed; top: 3px; left: 0; right: 0; z-index: 71; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
html.focus-read .focus-bar button { padding: 6px 14px; min-width: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
html.focus-read .focus-bar button:hover { background: var(--surface); }
html.focus-read .focus-bar button:disabled { color: var(--muted); cursor: default; background: var(--bg); }
@media (max-width: 640px) {
  html.focus-read .post-hero { padding-top: 84px; }
  html.focus-read .post-hero-inner, html.focus-read .post-layout, html.focus-read .post-layout.in-course { padding: 0 20px; }
  html.focus-read .prose { font-size: calc(1.1rem * var(--fs)); line-height: 1.8; }
  html.focus-read .focus-bar { padding: 8px 12px; gap: 6px; }
  html.focus-read .focus-bar button { padding: 6px 11px; font-size: .88rem; }
}
html.focus-read .post-hero .lead, html.focus-read .post-hero .meta { text-align: left; hyphens: manual; }

/* ======================================================================
   Design refresh (Oct 2026): ocean blue, rounded, soft shine, illustrations.
   Colours come from /theme.css, so changing the accent in admin still works.
   ====================================================================== */
:root { --shadow-s: 0 1px 2px rgba(20, 40, 70, .05), 0 8px 22px rgba(20, 40, 70, .06); --shadow-m: 0 2px 6px rgba(20, 40, 70, .06), 0 18px 40px rgba(20, 40, 70, .12); }
:root:not([data-mode="light"]) { }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --shadow-s: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .28); --shadow-m: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4); } }
:root[data-mode="dark"] { --shadow-s: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .28); --shadow-m: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4); }

h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-weight: 800; }

/* Buttons: pill shaped with a soft sheen */
.btn { position: relative; overflow: hidden; border-radius: 999px; padding: 11px 26px; border: 2px solid transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent); transition: transform .18s var(--ease, ease), box-shadow .18s var(--ease, ease), background .18s; }
.btn:hover { transform: translateY(-1px); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-strong) 90%, #fff), var(--accent-strong)); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 22px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .32) 50%, transparent 65%); transform: translateX(-130%); transition: transform .7s ease; pointer-events: none; }
.btn:hover::before { transform: translateX(130%); }
.btn-outline, .btn-ghost { background: transparent; box-shadow: none; }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-strong); box-shadow: none; transform: translateY(-1px); }
.btn-ghost:hover { background: var(--surface); box-shadow: none; }
.btn-outline::before, .btn-ghost::before { display: none; }
.btn-cta { background: linear-gradient(180deg, color-mix(in srgb, var(--cta) 94%, #fff), var(--cta)); color: var(--on-cta); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 20px color-mix(in srgb, var(--cta) 30%, transparent); }
.btn-cta:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--cta-strong) 94%, #fff), var(--cta-strong)); color: var(--on-cta); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 26px color-mix(in srgb, var(--cta) 36%, transparent); }
.header-cta.btn { padding: 8px 20px; }

/* Header */
.site-header { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.site-nav a { border-radius: 999px; padding: 8px 14px; }
.site-nav a[aria-current="page"] { box-shadow: none; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; }

/* Illustration frame: a soft blue shape with a glossy edge, same in light and dark so the drawings stay clear */
.art-blob { position: relative; isolation: isolate; display: grid; place-items: center; aspect-ratio: 1.14; width: 100%; }
.art-blob::before { content: ""; position: absolute; inset: 5% 2% 3% 5%; z-index: -1; border-radius: 58% 42% 52% 48% / 52% 58% 42% 48%; background: radial-gradient(120% 95% at 18% 12%, #eef6fd 0%, var(--blob-a) 34%, var(--blob-b) 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -22px 46px rgba(47, 111, 168, .18), 0 30px 60px rgba(47, 111, 168, .2); }
.art-blob::after { content: ""; position: absolute; left: 14%; top: 13%; width: 26%; height: 8%; border-radius: 50%; background: rgba(255, 255, 255, .6); filter: blur(10px); transform: rotate(-20deg); z-index: -1; }
.art-blob img { width: 90%; height: auto; max-height: 100%; object-fit: contain; filter: drop-shadow(0 16px 22px rgba(20, 40, 70, .18)); }

/* Home hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 120px; background: radial-gradient(760px 420px at 88% 8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%); }
.hero-grid { grid-template-columns: minmax(0, 1fr); align-items: center; gap: 56px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.7rem, 5.6vw, 4.5rem); line-height: 1.02; letter-spacing: -.035em; margin-bottom: .25em; }
.hero-headline { font-size: clamp(1.15rem, 2.2vw, 1.45rem); margin-bottom: .9em; }
.hero-intro { font-size: 1.12rem; line-height: 1.7; color: var(--text); opacity: .86; text-align: left; hyphens: manual; }
.hero-art { max-width: 620px; justify-self: end; }
.hero-actions { margin: 30px 0 8px; gap: 14px; }

/* Profile card becomes a wide card that overlaps the hero */
.glance-band { position: relative; z-index: 2; margin-top: -70px; padding-bottom: 20px; }
.glance-card { display: grid; grid-template-columns: 150px minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "photo facts contact" "role facts contact"; grid-template-rows: max-content 1fr; gap: 6px 40px; align-items: start; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 30px 34px; box-shadow: var(--shadow-m); }
.glance-card .pc-photo { grid-area: photo; }
.glance-card .pc-role { grid-area: role; margin: 0; }
.glance-card .facts { grid-area: facts; margin: 0; }
.glance-card .facts div:first-child { border-top: 0; padding-top: 0; }
.glance-card .contact-list { grid-area: contact; border-top: 0; padding: 0; margin: 0; }
.glance-card .pc-photo img, .glance-card .pc-photo .monogram { margin-bottom: 8px; border-radius: 18px; }
@media (max-width: 900px) {
  .hero { padding: 40px 0 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero-art { max-width: 460px; justify-self: center; }
  .glance-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "photo" "role" "facts" "contact"; padding: 24px; gap: 10px; }
}

/* Page headers with an illustration */
.page-head { background: linear-gradient(180deg, var(--accent-soft), transparent); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); line-height: 1.08; }
.page-head.has-art { padding: 36px 0 24px; }
.page-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: center; }
.page-head-grid .ph-art { justify-self: end; max-width: 330px; }
@media (max-width: 760px) { .page-head-grid { grid-template-columns: minmax(0, 1fr); } .page-head-grid .ph-art { display: none; } .page-head.has-art { padding: 28px 0 12px; } }

/* Sections and cards */
.block.alt { background: var(--sand); border-block: 0; }
.stats { background: var(--surface); border-block: 0; }
.stat-grid strong { font-weight: 800; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.card, .ach-grid li, .exp-brief a, .path-card, .skill-box, .principles li, .tool, .contact-card, .side-box, .author-box, .feedback-prompt { border-radius: var(--radius); box-shadow: var(--shadow-s); }
.card, .exp-brief a, .path-card, .post-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover, .exp-brief a:hover, .path-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.tool-list, .toc, .profile-card { border-radius: var(--radius); }
.chips li { box-shadow: none; }
.site-footer { background: var(--surface); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::before, .card, .exp-brief a, .path-card { transition: none; }
  .btn:hover, .card:hover, .exp-brief a:hover, .path-card:hover { transform: none; }
}
@media print { .art-blob { display: none; } .hero, .page-head { background: none; } }

/* Home: jump links and the numbered "My story" cards */
.jump-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.jump-bar ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 14px 0; }
.jump-bar a { display: inline-block; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font-size: .94rem; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.jump-bar a:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
#story, #about, #experience, #insights, #hire { scroll-margin-top: 84px; }
.story-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; counter-reset: none; }
.story-card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 26px 28px 22px; }
.story-no { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: var(--accent-strong); }
.story-card h3 { margin: 0 0 .5em; font-size: 1.3rem; }
.story-card .prose { font-size: 1rem; }
.story-card .prose p { margin: 0; text-align: left; hyphens: manual; }
.story-card .prose p + p { margin-top: .8em; }
@media (max-width: 800px) { .story-grid { grid-template-columns: minmax(0, 1fr); } .story-card { padding: 22px; } .jump-bar ul { flex-wrap: nowrap; overflow-x: auto; padding: 12px 0; } .jump-bar li { flex: none; } }
.section-lead { text-align: left; hyphens: manual; }

/* Pop-out window: only the tool, kept compact */
.popout-row { margin: 14px 0 0; }
body.popout .skip, body.popout .site-header, body.popout .site-footer, body.popout .back-to-top, body.popout .crumbs,
body.popout .page-head .lead, body.popout .tool-main > h2, body.popout .tool-main > p, body.popout .tool-main > noscript,
body.popout .feedback-prompt, body.popout .side-main ~ *, body.popout .popout-row, body.popout .cookie-note { display: none !important; }
body.popout .page-head { padding: 14px 0 4px; background: none; }
body.popout .page-head h1 { font-size: 1.15rem; margin: 0; }
body.popout .block { padding: 8px 0 16px; }
body.popout .wrap { padding-left: 16px; padding-right: 16px; max-width: none; }
body.popout .with-side { display: block; }
body.popout .hero::before, body.popout main::before { display: none; }

/* Tools index: plain directory, group name on the left and tools as rows on the right */
.tools-bar { display: flex; gap: 10px; max-width: 640px; margin: 0 0 36px; }
.tools-bar input { flex: 1; min-width: 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: inherit; font: inherit; box-shadow: var(--shadow-s); }
.tools-bar input:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.tools-main .tool-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.tools-main .tool-group + .tool-group { margin-top: 0; }
.tools-main .tool-group[hidden] { display: none; }
.tg-head { align-self: start; position: sticky; top: 86px; }
.tools-main .tool-group-title { font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: inherit; margin: 0 0 4px; }
.tg-count { margin: 0; color: var(--muted); font-size: .92rem; }
.tool-list.tool-rows { border: 0; border-radius: 0; overflow: visible; }
.tool-list.tool-rows li + li { border-top: 1px solid var(--line); }
.tool-list.tool-rows li[hidden] { display: none; }
.tool-list.tool-rows a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 4px; text-decoration: none; background: none; }
.tool-list.tool-rows a:hover { background: none; }
.tool-rows .tl-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-rows .tl-title { font-size: 1.05rem; font-weight: 600; }
.tool-rows .tl-sum { color: var(--muted); }
.tool-rows .tl-go::after { content: "\2192"; color: var(--accent-strong); font-size: 1.2rem; display: inline-block; transition: transform var(--dur) var(--ease); }
.tool-list.tool-rows a:hover .tl-title { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.tool-list.tool-rows a:hover .tl-go::after { transform: translateX(4px); }
.tool-list.tool-rows a:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 800px) { .tools-main .tool-group { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 22px 0; } .tg-head { position: static; } }
@media (prefers-reduced-motion: reduce) { .tool-rows .tl-go::after { transition: none; } }

/* Tools launcher: list on the left, the chosen tool on the right (wide screens, set by JavaScript) */
.tools-main.lc-on { display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-areas: "bar pane" "all pane" "notes pane" "list pane" "foot foot"; grid-template-rows: auto auto auto 1fr auto; gap: 0 32px; align-items: start; }
.tools-main.lc-on .tools-bar { grid-area: bar; margin-bottom: 16px; max-width: none; }
.tools-main.lc-on .search-note { grid-area: notes; }
.tools-main.lc-on .lc-list { grid-area: list; }
.tools-main.lc-on .lc-pane { grid-area: pane; align-self: start; }
.tools-main.lc-on .tools-note { grid-area: foot; margin-top: 24px; }
.tools-main.lc-on .tool-group { display: block; padding: 14px 0 6px; }
.tools-main.lc-on .tg-head { position: static; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tools-main.lc-on .tool-group-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 4px; }
.tools-main.lc-on .tl-sum, .tools-main.lc-on .tl-go { display: none; }
.tools-main.lc-on .tool-list.tool-rows a { padding: 9px 12px; border-radius: 10px; border: 0; }
.tools-main.lc-on .tool-list.tool-rows li + li { border-top: 0; }
.tools-main.lc-on .tool-list.tool-rows a:hover { background: var(--accent-soft); text-decoration: none; }
.tools-main.lc-on .tool-list.tool-rows a:hover .tl-title { text-decoration: none; }
.tools-main.lc-on .tool-list.tool-rows a[aria-current] { background: var(--accent-strong); }
.tools-main.lc-on .tool-list.tool-rows a[aria-current] .tl-title { color: var(--on-accent); }
.tools-main.lc-on .tool-list.tool-rows .tl-title { font-size: .98rem; font-weight: 600; }
.lc-pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; min-height: 0; }
.lc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lc-title { margin: 0; font-size: 1.15rem; }
.lc-actions { margin: 0; display: flex; gap: 8px; flex-shrink: 0; }
.lc-empty { padding: 36px 28px 44px; color: var(--muted); text-align: center; }
.lc-empty p { margin: 18px auto 0; max-width: 38ch; font-size: 1.05rem; }
.lc-art { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.lc-frame { display: block; width: 100%; min-height: 160px; height: 360px; border: 0; background: transparent; }

body.popout.embedded .page-head { display: none !important; }
body.popout.embedded .block { padding-top: 12px; }
.lc-pane:has(#lc-frame[hidden]) .lc-actions { display: none; }

/* Collapsible tool groups */
.tg-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 4px 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.tg-toggle:hover { color: var(--accent-strong); }
.tg-toggle:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }
.tg-chev { flex-shrink: 0; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 4px; transition: transform var(--dur) var(--ease); }
.tg-toggle[aria-expanded="false"] .tg-chev { transform: rotate(-45deg); }
.tool-list[hidden] { display: none; }
.tg-all { display: block; margin: 0 0 8px; padding: 4px 0; border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tools-main.lc-on .tg-all { grid-area: all; justify-self: start; }
.tools-main.lc-on .search-note { grid-area: notes; }
@media (prefers-reduced-motion: reduce) { .tg-chev { transition: none; } }
