/* Effort Counter: matches the approved mockup. Neutral surfaces, serif article voice, system sans UI, blue links. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --tint: #f3f3f2;
  --tint-2: #e9e9e7;
  --text: #141413;
  --text-2: #5e5d59;
  --text-3: #8b8a85;
  --line: #e6e5e1;
  --line-2: #cfcec9;
  --link: #1f5fb8;
  --accent-bg: #e6f0fb;
  --good: #2f6f3a;
  --warn: #854f0b;
  --low: #a32d2d;
  --serif: "Tiempos Text", Charter, "Bitstream Charter", "Source Serif 4", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1a;
    --panel: #252524;
    --tint: #2e2e2c;
    --tint-2: #383836;
    --text: #ecebe7;
    --text-2: #b0afa9;
    --text-3: #85847e;
    --line: #353533;
    --line-2: #4a4a47;
    --link: #8ab4f0;
    --accent-bg: #0c2c4f;
    --good: #8fd19e;
    --warn: #e5b45a;
    --low: #f09595;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 2000px; margin: 0 auto; padding: 0 28px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }

/* Header */
.topbar { background: var(--bg); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 52px; }
.brand { display: flex; align-items: center; gap: 5px; color: var(--text); font-family: var(--serif); font-size: 16px; font-weight: 500; white-space: nowrap; }
.brand i { font-size: 16px; }
.brand:hover { text-decoration: none; }
.search { position: relative; margin-left: auto; width: 200px; }
.search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; font-size: 14px; }
.search input { width: 100%; height: 30px; padding: 0 10px 0 30px; border: 0.5px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
.suggest { position: absolute; top: 38px; left: 0; right: 0; min-width: 300px; background: var(--panel); border: 0.5px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); overflow: hidden; }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; color: var(--text); font-size: 14px; }
.suggest a small { color: var(--text-3); margin-left: auto; font-size: 12px; white-space: nowrap; }
.suggest .thumb { width: 28px; height: 28px; border-radius: 5px; font-size: 15px; }
.suggest a.active, .suggest a:hover { background: var(--tint); text-decoration: none; }
.suggest .all { color: var(--link); border-top: 0.5px solid var(--line); }

main { min-height: 70vh; padding-bottom: 64px; outline: none; }
.footer { border-top: 0.5px solid var(--line); color: var(--text-3); font-size: 12px; padding: 20px 0 36px; }
.footer p { margin: 0; }
.footer nav { display: flex; gap: 18px; margin-bottom: 8px; }
.footer nav a { color: var(--text-2); }

/* Shared */
.crumbs { font-size: 12px; color: var(--text-2); margin: 0 0 4px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--text-2); white-space: nowrap; }
.conf-high { color: var(--good); }
.conf-medium { color: var(--warn); }
.conf-low { color: var(--low); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0.5px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.btn:hover { background: var(--tint); text-decoration: none; }
.thumb { position: relative; display: flex; align-items: center; justify-content: center; background: var(--tint); border-radius: var(--radius); color: var(--text-3); flex-shrink: 0; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Tabs */
.tabs { display: flex; gap: 18px; border-bottom: 0.5px solid var(--line); font-size: 13px; }
.tabs a { padding: 6px 0; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -0.5px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Article */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; margin-top: 20px; }
.article-head { margin-bottom: 16px; }
.article-head h1 { font-size: 30px; font-weight: 500; margin: 0; line-height: 1.7; }
.tagline { font-size: 12px; color: var(--text-2); margin: 2px 0 0; line-height: 1.7; }
.mstats { display: none; font-size: 14px; color: var(--text-2); margin: 10px 0 0; }
.mstats b { color: var(--text); }
.prose { font-family: var(--serif); font-size: 15px; line-height: 1.75; }
.prose p { margin: 0 0 .75rem; }
.cite { font-family: var(--sans); font-size: 11px; vertical-align: super; line-height: 0; margin-left: 1px; font-variant-numeric: lining-nums; }
.sec { font-size: 20px; font-weight: 500; margin: 1.75rem 0 .6rem; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); line-height: 1.7; scroll-margin-top: 70px; }
.toc { display: inline-block; border: 0.5px solid var(--line); background: #fafaf9; border-radius: var(--radius); padding: 10px 14px; margin: .25rem 0 .5rem; font-size: 13px; }
.toc strong { display: block; font-weight: 500; margin-bottom: 4px; }
.toc ol { margin: 0; padding: 0; list-style: none; line-height: 1.8; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li a::before { content: counter(toc) " "; }

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.chain a { background: var(--tint); color: var(--text); padding: 4px 10px; border-radius: var(--radius); line-height: 1.7; }
.chain a:hover { background: var(--tint-2); text-decoration: none; }
.chain a.end { background: var(--accent-bg); color: var(--link); }
.chain i { color: var(--text-2); font-size: 12px; }
.note { font-size: 12px; color: var(--text-2); margin: 8px 0 0; }

.part { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 0.5px solid var(--line); }
.part:last-child { border-bottom: none; }
.part .thumb { width: 64px; height: 64px; font-size: 22px; }
.part h3 { font-family: var(--sans); font-size: 15px; font-weight: 500; margin: 0; line-height: 1.7; }
.part h3 .meta { font-weight: 400; font-size: 12px; color: var(--text-2); margin-left: 4px; }
.part p { margin: 3px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.7; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.tools a { display: inline-flex; align-items: center; gap: 6px; border: 0.5px solid var(--line-2); border-radius: var(--radius); padding: 3px 10px; color: var(--text); background: var(--panel); }
.tools a:hover { border-color: var(--line-2); text-decoration: none; }
.tools a i { color: var(--text-3); }
.tools a small { color: var(--text-3); }
.method { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.method p { margin: 0 0 .7em; }
.seealso { font-size: 14px; line-height: 1.9; }

.refs { font-size: 13px; line-height: 1.6; padding-left: 0; list-style: none; margin: 0; counter-reset: ref; }
.refs li { display: grid; grid-template-columns: 22px minmax(0, 1fr); margin-bottom: 6px; scroll-margin-top: 90px; border-radius: 4px; transition: background .4s; }
.refs li::before { counter-increment: ref; content: counter(ref) "."; }
.refs .back { font-size: 11px; vertical-align: super; line-height: 0; }
.refs i { font-style: italic; }
.further { font-size: 13px; }
.updated { font-size: 12px; color: var(--text-2); margin-top: 10px; }

/* Infobox and sidebar */
.side { padding-top: 0; }
.infobox { border: 0.5px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px; }
.infobox .title { text-align: center; font-family: var(--serif); font-size: 15px; font-weight: 500; margin: 0 0 8px; line-height: 1.7; }
.infobox .figure { height: 140px; font-size: 24px; border-radius: var(--radius); }
.infobox .caption { font-size: 12px; color: var(--text-2); margin: 6px 0 10px; line-height: 1.7; }
.infobox .caption a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); }
.kv { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 0.5px solid var(--line); font-size: 13px; line-height: 1.7; }
.kv > span:first-child { color: var(--text-2); font-size: 12px; }
.kv > span:last-child { text-align: right; }
.kv.big > span:last-child { font-weight: 500; }
.side h4 { font-size: 12px; font-weight: 400; color: var(--text-2); margin: 14px 0 4px; }
.side ul { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 1.9; }
.side ul small { color: var(--text); font-size: 13px; }
.side .facts li { line-height: 1.6; margin-bottom: 6px; }

/* Tree */
.tree { font-size: 13px; margin-top: 14px; }
.tree details { margin-left: 18px; }
.tree > details { margin-left: 0; }
.tree summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--tint); }
.tree summary .chev { color: var(--text-3); width: 14px; }
.tree details[open] > summary .chev { transform: rotate(90deg); }
.tree summary .leaf { width: 14px; }
.tree .thumb { width: 24px; height: 24px; border-radius: 5px; font-size: 13px; }
.tree .qty { color: var(--text-3); }
.tree .t { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tree .kids { border-left: 1px solid var(--line); margin-left: 12px; }
.tree-tools { display: flex; gap: 8px; margin-top: 14px; }

/* History */
.history { font-size: 13px; border-top: 0.5px solid var(--line); }
.history div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 0.5px solid var(--line); }
.history div span:first-child { color: var(--text-2); }

/* Home */
.hero { padding: 44px 0 20px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.hero h1 { font-size: 36px; margin: 0 0 12px; letter-spacing: -0.01em; }
.hero p { font-family: var(--serif); font-size: 16px; color: var(--text-2); margin: 0 0 18px; line-height: 1.75; }
.hero-search { position: relative; max-width: 440px; }
.hero-search input { width: 100%; height: 40px; font: inherit; font-size: 14px; padding: 0 14px 0 36px; border: 0.5px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.hero-search input:focus { outline: none; border-color: var(--link); }
.hero-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 17px; }
.stats { display: flex; gap: 12px; margin-top: 22px; }
.stats span { background: var(--tint); border-radius: var(--radius); padding: 8px 12px; font-size: 12px; color: var(--text-2); min-width: 100px; }
.stats b { display: block; font-size: 20px; font-weight: 500; color: var(--text); }
.feature { border: 0.5px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.feature .thumb { aspect-ratio: 16 / 9; border-radius: 0; font-size: 40px; }
.feature .in { padding: 16px 20px 20px; }
.feature .kicker { font-size: 13px; color: var(--text-2); margin: 0 0 2px; }
.feature h2 { font-size: 20px; margin: 0; }
.feature h2 a { color: var(--text); }
.feature .big { font-size: 28px; font-weight: 500; margin: 6px 0 0; line-height: 1.2; }
.feature .sub { color: var(--text-2); font-size: 13px; margin: 2px 0 12px; }
.bars { display: grid; grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--text-2); }
.bars .b { height: 8px; border-radius: 4px; background: var(--link); opacity: .7; }
.bars .v { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.section-title { font-size: 20px; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-title a { font-family: var(--sans); font-size: 13px; font-weight: 400; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cat { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; border: 0.5px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px; color: var(--text); }
.cat:hover { border-color: var(--line-2); text-decoration: none; }
.cat .thumb { width: 64px; height: 64px; font-size: 24px; }
.cat h3 { font-size: 15px; margin: 0; }
.cat p { font-size: 12px; color: var(--text-2); margin: 2px 0 0; line-height: 1.5; }
.cat small { color: var(--text-3); font-size: 12px; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fact { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; }
.fact .thumb { width: 56px; height: 56px; font-size: 20px; }
.fact p { font-family: var(--serif); font-size: 14px; margin: 0; line-height: 1.6; }

/* Lists */
.list { border-top: 0.5px solid var(--line); }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 0.5px solid var(--line); color: var(--text); }
.row:hover { text-decoration: none; background: color-mix(in srgb, var(--tint) 55%, transparent); }
.row .thumb { width: 44px; height: 44px; font-size: 18px; }
.row .name { font-weight: 500; color: var(--link); font-size: 15px; }
.row .sum { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.row .val { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); white-space: nowrap; line-height: 1.5; }
.row .val b { display: block; color: var(--text); font-size: 14px; font-weight: 500; }
.page-head h1 { font-size: 30px; font-weight: 500; margin: 0 0 4px; }
.page-head p { font-family: var(--serif); font-size: 15px; color: var(--text-2); margin: 0; max-width: 720px; line-height: 1.75; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 20px 0 10px; font-size: 13px; }
.toolbar .chip { border: 0.5px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 12px; color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px; }
.toolbar .chip.on { background: var(--accent-bg); color: var(--link); border-color: transparent; }
.toolbar .spacer { flex: 1; }
.toolbar select { font: inherit; font-size: 13px; padding: 3px 8px; border-radius: var(--radius); border: 0.5px solid var(--line-2); background: var(--panel); color: var(--text); }
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0; font-size: 14px; }
.az a { padding: 2px 8px; border-radius: 6px; }
.az a:hover { background: var(--tint); text-decoration: none; }
.letter { font-size: 20px; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); scroll-margin-top: 70px; }
.cols { columns: 4 200px; column-gap: 28px; font-size: 14px; line-height: 1.9; }
.cols a { display: block; break-inside: avoid; }
.src-list { list-style: none; padding: 0; margin: 0; }
.src-list li { padding: 13px 0; border-bottom: 0.5px solid var(--line); }
.src-list .t { font-size: 14px; }
.src-list .m { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.empty { padding: 60px 0; text-align: center; color: var(--text-2); }
.empty h1 { font-size: 30px; color: var(--text); }

@media (max-width: 900px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .side { padding-top: 0; }
  .mstats { display: block; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .search { width: auto; flex: 1; max-width: 320px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .article-head h1, .hero h1 { font-size: 26px; }
  .prose { font-size: 15px; }
  .row { grid-template-columns: 44px minmax(0, 1fr); }
  .row .thumb { width: 44px; height: 44px; }
  .row .val { grid-column: 2; text-align: left; }
  .row .val b { display: inline; margin-right: 6px; font-size: 14px; }
  .brand span { display: none; }
  .part { grid-template-columns: 60px minmax(0, 1fr); }
  .part .thumb { width: 60px; height: 60px; }
}

/* Effort chain: parallel timeline */
.tl-intro { font-size: 14px; color: var(--text-2); margin: 0 0 14px; }
.tl-intro b { color: var(--text); font-weight: 500; }
.tl { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 8px 16px; align-items: center; padding-right: 4px; }
.tl-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name.on { color: var(--link); font-weight: 500; }
.tl-lane { position: relative; height: 24px; background: var(--tint); border-radius: 4px; }
.tl-lane.bare { background: transparent; }
.tl-seg { position: absolute; top: 0; height: 24px; border-radius: 4px; display: flex; align-items: center; padding: 0 7px; font-size: 11px; white-space: nowrap; overflow: hidden; border-right: 2px solid var(--panel); box-sizing: border-box; }
.tl-seg:hover { text-decoration: none; filter: brightness(0.96); }
.tl-seg.stock { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 2px dotted var(--line-2); color: var(--text-2) !important; }
.tl-final-label { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tl-scale { position: relative; height: 18px; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tl > .tl-scale { margin-bottom: 2px; }
.tl-legend { font-size: 12px; color: var(--text-2); margin: 12px 0 0; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 5px 0 0; vertical-align: -1px; }
.tl-legend i + i, .tl-legend i:not(:first-child) { margin-left: 12px; }

/* Effort chain: slowest path step by step */
.ec-bar { display: flex; height: 34px; }
.ec-seg { border: 0; border-right: 2px solid var(--panel); padding: 0 8px; font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: clip; text-align: left; cursor: pointer; min-width: 16px; transition: opacity .2s; }
.ec-seg:last-child { border-right: 0; }
.ec-scale { margin-top: 6px; }
.ec-cap { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--text-2); margin: 4px 0 20px; }
.ec-cols { display: grid; column-gap: 14px; row-gap: 18px; }
.ec-col { cursor: pointer; outline-offset: 4px; }
.ec-col:not(.on) { opacity: .72; }
.ec-col:hover { opacity: 1; }
.ec-rule { height: 4px; margin-bottom: 8px; transition: height .15s; }
.ec-col.on .ec-rule { height: 8px; margin-bottom: 4px; }
.ec-col .ec-img { width: 100%; aspect-ratio: 4 / 3; border-radius: 0; font-size: 22px; }
.ec-no { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; margin: 10px 0 0; }
.ec-n { font-family: var(--serif); font-size: 15px; line-height: 1.35; margin: 4px 0 0; }
.ec-m { font-size: 12px; color: var(--text-2); margin: 3px 0 0; line-height: 1.5; }
.ec-detail { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; margin-top: 22px; padding-top: 16px; border-top: 0.5px solid var(--line); }
.ec-big { font-family: var(--serif); font-size: 56px; font-weight: 500; line-height: .9; }
.ec-meta { font-size: 12px; color: var(--text-2); margin: 0; }
.ec-h { font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 2px 0 6px; line-height: 1.3; }
.ec-body { font-family: var(--serif); font-size: 15px; line-height: 1.75; margin: 0; }
.ec-walk { font-size: 13px; margin: 10px 0 0; color: var(--text-3); }
.ec-walk a.off { color: var(--text-3); pointer-events: none; }
@media (max-width: 700px) {
  .tl { grid-template-columns: 92px minmax(0, 1fr); }
  .ec-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ec-detail { grid-template-columns: 40px minmax(0, 1fr); }
  .ec-big { font-size: 40px; }
}
