:root {
    --grid-step: 15px;
    --study-w: 900px;
}

.study {
    --text: var(--ink);
    --text-2: var(--ink-soft);
    --text-3: var(--ink-faint);
    --border: var(--line);
    --accent: var(--blue);
    --accent-bg: rgb(var(--blue-rgb) / 0.07);
    --bg-card: rgb(var(--surface-rgb) / 0.62);
    --bg-sunk: rgb(var(--ink-rgb) / 0.035);
    --hover: rgb(var(--ink-rgb) / 0.05);
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 8px;
}

:root[data-theme="light"] {
    --paper: #FFFFFF;
    --paper-rgb: 255 255 255;
}

body { background-image: none; }

.study-head .work-title {
    font-family: var(--brand);
    font-weight: 500;
    font-size: clamp(40px, 7.4vw, 76px);
    line-height: 0.98;
    letter-spacing: 0;
    margin: 0 0 10px;
}

.study-hand {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: clamp(21px, 3.2vw, 30px);
    font-weight: 600;
    line-height: 1;
    color: var(--blue);
    transform: rotate(-2deg);
    transform-origin: left center;
    margin: 0 0 26px;
}

.study-head .work-kicker a { color: inherit; text-decoration: none; }
.study-head .work-kicker a:hover { color: var(--blue); }

.study-layout { display: flex; flex-direction: column; }
.study-toc { order: -1; max-width: var(--content-w); width: 100%; margin: 30px auto 0; }

.study-toc h2 {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 25px;
    font-weight: 600;
    line-height: 1;
    color: var(--blue);
    transform: rotate(-2deg);
    transform-origin: left center;
    margin: 0 0 14px;
}

.study-toc ol {
    list-style: none;
    margin: 0;
    padding: 0 0 0 30px;
    border-left: 1px solid var(--line);
}
.study-toc li { margin: 0; }
.study-toc a {
    position: relative;
    display: block;
    padding: 6px 0;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.35;
}
.study-toc a:hover { color: var(--blue); }

.study-toc .no {
    position: absolute;
    left: -30px;
    width: 24px;
    text-align: right;
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink-faint);
}

.study-toc a.is-here { color: var(--ink); }
.study-toc a.is-here .no { color: var(--mark-red-pure); }
.study-toc a.is-here > span:last-child {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-weight: 600;
    font-size: 1.3em;
    line-height: 1.12;
}

.toc-subs {
    display: none;
    list-style: none;
    margin: 2px 0 10px;
    padding: 0 0 0 14px;
    border-left: 1px solid var(--line);
}
.study-toc li.is-open .toc-subs { display: block; }
.toc-subs a { padding: 3px 0; font-size: 13px; color: var(--ink-faint); }
.toc-subs a:hover { color: var(--blue); }
.toc-subs a.is-here { color: var(--ink); }
.toc-subs a.is-here > span:last-child { font-family: inherit; font-size: inherit; font-weight: 600; }

@media (min-width: 1001px) {
    .study-layout { flex-direction: row; align-items: flex-start; gap: 60px; }
    .study-layout .study { flex: 1 1 auto; min-width: 0; }
    .study-toc {
        order: 0;
        flex: 0 0 230px;
        margin: 44px 0 0;
        position: sticky;
        top: 96px;
        max-height: calc(100dvh - 130px);
        overflow-y: auto;
        scrollbar-width: none;
    }
    .study-toc::-webkit-scrollbar { display: none; }
    .work-wrap > .study-head,
    .work-wrap > .study-foot { margin-left: 0; }
    .study-layout .study > *,
    .study-layout .study .context-appendix > * { margin-left: 0 !important; }
    :root { --study-w: 810px; }
}

.study {
    margin-top: 44px;
    color: var(--ink-body, var(--ink));
}

.study > *,
.study .context-appendix > * {
    max-width: var(--content-w);
    margin-left: auto !important;
    margin-right: auto !important;
}
.study > :is(.chart, figure, section.chart, .passport, .parallel, .era, .qa) {
    max-width: var(--study-w);
}

.study p { margin: 0 0 1.1em; }
.study strong, .study b { font-weight: 600; color: var(--ink); }

.study h2 {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 72px auto 6px;
    text-wrap: balance;
    scroll-margin-top: 90px;
}
.study h2 .no {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-weight: 600;
    font-size: 1.15em;
    line-height: 1;
    color: var(--mark-red-pure);
    margin-right: .25em;
    white-space: nowrap;
}
.study h2 .no b { font-weight: 600; color: inherit; }
@media (min-width: 760px) {
    .study h2 { position: relative; }
    .study h2 .no {
        position: absolute;
        right: 100%;
        top: -.02em;
        margin: 0 12px 0 0;
        transform: rotate(-4deg);
    }
}

.study .h2sub {
    font-size: 15px;
    color: var(--ink-faint);
    margin-bottom: 26px;
}
.study h3 {
    position: relative;
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 44px auto 10px;
    text-wrap: balance;
}

.study h3 .dim { color: var(--ink-faint); font-weight: 600; }

.study .cut-icon {
    position: absolute;
    left: -30px;
    top: 0.12em;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}
@media (max-width: 1040px) {
    .study .cut-icon { position: static; display: block; margin: 0 0 6px; }
}
.study h4 {
    font-size: 1.02rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 30px auto 8px;
    text-wrap: balance;
}

.study a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid var(--blue-soft);
}
.study a:hover { border-bottom-width: 2px; }

.study {
    position: relative;
    --mark-pen: var(--blue-pure);
    --mark-red: var(--mark-red-pure);
    --mark-wash-mode: multiply;
    --mark-wash-alpha: 0.15;
}
:root[data-theme="dark"] .study {
    --mark-wash-mode: screen;
    --mark-wash-alpha: 0.22;
}
.study p, .study blockquote, .study h3, .study li { position: relative; }

.study .study-hint { font-size: 13.5px; color: var(--ink-faint); margin-top: 18px; }

.study blockquote {
    margin: 34px auto;
    padding: 2px 0 2px 20px;
}
.study blockquote { position: relative; }
.study .quote-line { position: static; }
.study .quote-line::before,
.study .quote-line::after {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-weight: 600;
    color: var(--mark-red-pure);
    line-height: 1;
}
.study .quote-line::before {
    content: "«";
    position: absolute;
    left: 0;
    top: 0.08em;
    font-size: 1.1em;
}
.study .quote-line::after {
    content: "»";
    font-size: 1.15em;
    vertical-align: -0.04em;
    margin-left: .08em;
}

.study .hand-icon {
    width: 1.25em; height: 1.25em;
    fill: none; stroke: var(--blue); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    overflow: visible;
}
.study .flap-icon { width: 1.15em; height: 1.15em; }

.study .callout {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    margin: 18px auto;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}
.study .callout + .callout { margin-top: -19px; }
.study .callout > .callout-icon { flex: none; line-height: 1.6; }
.study .callout p { margin: 0; }
.study .callout.blue strong { color: var(--blue); }

.study .tablebox { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.study .tablebox::-webkit-scrollbar { display: none; }
.study table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.study td, .study th {
    padding: 9px 12px 9px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}
.study td.cl { width: 26%; font-weight: 500; color: var(--ink); }
.study td.fx { color: var(--ink-soft); }
.study td.fx b { font-weight: 600; color: var(--ink); }

.study .passport {
    position: relative;
    margin-top: 52px; margin-bottom: 52px;
    padding: 30px 26px 14px;
    background: none;
    border: 0;
}
.ink-frame, .study .ink-frame {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}
.study .passport > *:not(.ink-frame),
.study .flap-box > *:not(.ink-frame) { position: relative; z-index: 1; }

.study .passport .pt {
    position: absolute;
    top: -0.72em;
    left: 18px;
    margin: 0;
    padding: 0 10px;
    background: var(--paper);
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 25px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: var(--mark-red-pure);
    transform: rotate(-1.2deg);
    transform-origin: left center;
}
.study .passport .tablebox { margin-top: 4px; }
.study .passport td.cl {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink);
}
.study .passport td.fx { font-size: 14.5px; color: var(--ink); }
.study .passport tr:last-child td { border-bottom: 0; }
.study .passport td { border-color: rgb(var(--ink-rgb) / 0.10); }

.study .flap-box {
    position: relative;
    max-width: var(--content-w);
    margin: 22px auto 32px;
    padding: 12px 18px;
}
.study .ill-flap {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}
.study .ill-flap > summary { padding: 2px 0; }
.study .ill-flap > p { padding: 10px 0 2px 32px; }

@media (max-width: 640px) {
    .study .passport { padding: 26px 14px 8px; }
    .study .passport .pt { font-size: 21px; left: 12px; }
}

.study .study-src { margin: 8px 0 0; }
.study .study-src > div {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 4px 24px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.study .study-src dt {
    font-size: 12px; font-weight: 500; line-height: 1.4;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-faint);
}
.study .study-src dd {
    grid-column: 2;
    margin: 0 0 3px;
    font-size: 13.5px; line-height: 1.5;
    color: var(--ink-soft);
}
@media (max-width: 700px) {
    .study .study-src > div { grid-template-columns: 1fr; gap: 6px; }
    .study .study-src dd { grid-column: 1; }
}

.study .context-store { margin-top: 40px; }
.study .context-entry { border-bottom: 1px solid var(--line); }
.study .context-entry summary { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--blue); }
.js-notes .study .context-store { display: none; }

.study .pen-fig {
    fill: none;
    stroke: var(--ill-blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#malthus-scene .paper-svg { max-width: 560px; margin-inline: auto; }
.study .pen-sack {
    fill: rgb(var(--ink-rgb) / 0.06);
    stroke: #77756d;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.study-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 1002;
    background: none;
    pointer-events: none;
}
.study-progress i {
    display: block; height: 100%; width: 0;
    background: var(--blue-pure);
}

.study-bar {
    position: fixed;
    top: calc(var(--frame-offset) + var(--frame-border));
    left: calc(var(--frame-offset) + var(--frame-border));
    right: calc(var(--frame-offset) + var(--frame-border));
    z-index: 1001;
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 26px rgb(var(--shadow-rgb) / 0.10);
    transform: translateY(-110%);
    transition: transform .28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.study-bar.is-on { transform: none; }

.study-bar button {
    font: inherit;
    color: var(--ink);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 10px 8px;
}
.study-bar-step { flex: none; width: 40px; }
.study-bar-step svg { width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.study-bar-here {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}
.study-bar-no {
    flex: none;
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 21px;
    font-weight: 600;
    line-height: 1;
    color: var(--mark-red-pure);
}
.study-bar-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.study-bar-list { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.study-bar-here[aria-expanded="true"] .study-bar-list { stroke: var(--mark-red-pure); }

@media (min-width: 1001px) { .study-bar { display: none; } }
@media (prefers-reduced-motion: reduce) { .study-bar { transition: none; } }

body.toc-open { overflow: hidden; }

@media (max-width: 1000px) {
    .study-toc.is-sheet {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1101;
        max-height: 78dvh;
        margin: 0;
        padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--paper);
        border-top: 1px solid var(--line);
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -18px 60px rgb(var(--shadow-rgb) / 0.26);
        transform: translateY(101%);
        transition: transform .35s cubic-bezier(0.2, 0.8, 0.3, 1);
    }
    .study-toc.is-sheet.is-open { transform: none; }
    .study-toc.is-sheet a { padding: 10px 0; font-size: 15px; }
    .study-toc.is-sheet h2 { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .study-toc.is-sheet { transition: none; }
}

.study-foot .study-note { font-size: 13px; color: var(--ink-faint); }
.study-foot .study-back a { border-bottom: 0; }
.study-foot .study-back a:hover { border-bottom: 1px solid var(--blue-soft); }

@media (max-width: 640px) {
    .study h2 { margin-top: 56px; scroll-margin-top: 76px; }
    .study .callout { font-size: 15px; }
    .study table { font-size: 14px; }
    .study td.cl { width: 36%; }
}

@media print {
    body { background: none; }
    .blue-frame { border: 0; margin: 0; }
    .logo-container, .menu-container, .study-toc, .play,
    .study-progress, .study-bar { display: none !important; }
}

h4 .dim { color: var(--accent); }

.passport { margin: 26px 0; }
.passport .pt {
  margin: 0 0 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-3);
}

.chart {
  margin: 20px 0;
  padding: 18px 18px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #FFFFFF;
}
.chart .ct { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: #212121; }
.chart .cs { margin: 0 0 10px; font-size: 12.5px; color: #8F9A96; }
.chart .cn { margin: 6px 0; max-width: none; font-size: 12px; color: #8F9A96; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg text { font-family: 'Inter', sans-serif; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 2px 0 8px;
          font-size: 12.5px; color: #5D686A; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.tip {
  position: fixed; z-index: 99;
  max-width: none; padding: 6px 9px;
  border: 0; border-radius: var(--r-md);
  background: #212121; color: #FFFFFF;
  font-size: 12px; line-height: 1.4; white-space: nowrap;
  box-shadow: none;
  opacity: 0; transform: translate(-50%, -130%);
  pointer-events: none;
  transition: opacity .12s ease-out;
}
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

.era {
  margin: 16px 0;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
}
.era .years {
  display: inline-block; margin-bottom: 8px; padding: 2px 9px;
  border-radius: var(--r-sm);
  background: var(--accent-bg); color: var(--accent);
  font-size: 12.5px; font-weight: 600;
}
.era h3, .era h4 { margin: 0 0 8px; }
.era p { max-width: none; font-size: 15px; }
.era .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.era .facts span {
  padding: 3px 9px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-sunk); color: var(--text-2); font-size: 12.5px;
}

.tl { margin: 20px 0; padding-left: 0; border-left: 2px solid var(--border); }
.tl .ev { position: relative; padding: 0 0 18px 26px; }
.tl .ev::before {
  content: ""; position: absolute; left: -6px; top: 7px;
  width: 10px; height: 10px; border-radius: 99px;
  background: var(--bg-card); border: 2px solid var(--accent);
}
.tl .ev.hot::before { background: #D9730D; border-color: #D9730D; }
.tl .ev .d { font-size: 12px; font-weight: 600; letter-spacing: .04em;
             text-transform: uppercase; color: var(--text-3); }
.tl .ev .t { max-width: 68ch; font-size: 15px; color: var(--text-2); }
.tl .ev .t b { font-weight: 600; color: var(--text); }

.parallel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
@media (max-width: 700px) { .parallel { grid-template-columns: 1fr; } }
.parallel .col {
  padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-card);
}
.parallel .col .h { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.parallel .col p { max-width: none; margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.parallel .col p b { color: var(--text); }

.qa {
  margin: 16px 0;
  padding: 20px 22px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-card);
}
.qa .q {
  margin: 0 0 10px; padding: 0;
  border: 0; border-radius: 0; background: none;
  font-size: 17px; font-weight: 700; color: var(--text); text-wrap: balance;
}
.qa .q .qn { margin-right: 8px; color: var(--accent); }
.qa p { max-width: none; font-size: 15px; }
.qa p:last-child { margin-bottom: 0; }

.chart.ill { --ill-blue: #0000FF; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }

.ill .paper-svg { display: block; width: 100%; height: auto; overflow: visible; margin: 4px 0 6px; }
.ill .paper-svg text { font-family: 'Inter', sans-serif; }
.ill .paper-svg .hand { font-family: var(--hand); font-size: 30px; font-weight: 500; fill: #313138; }
.ill .paper-svg .small-label, .ill .paper-svg .axis-label { font-size: 15px; fill: #5d5d62; }
.ill .paper-svg .blue-text { fill: var(--ill-blue); }
.ill .paper-svg .pencil-text { fill: #77736a; }
.ill .person.blue, .ill .blue { color: var(--ill-blue); }
.ill img.ill-photo { display: block; width: 100%; height: auto; margin: 6px 0; border-radius: var(--r-sm); }
.ill .pencil-line { fill: none; stroke: #77756d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ill .pen-line { fill: none; stroke: var(--ill-blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .graph-grid { fill: none; stroke: #d6d4cb; stroke-width: 1; stroke-dasharray: 3 5; }
.ill .trade-route { fill: none; stroke: var(--ill-blue); stroke-width: 2; stroke-dasharray: 5 8; }
.ill .growth-fast { fill: none; stroke: var(--ill-blue); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.ill .growth-slow { fill: none; stroke: #999184; stroke-width: 2.8; stroke-dasharray: 5 6; }
.ill .gear { transform-box: fill-box; transform-origin: center; }

.ill-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.ill-ctl button {
  padding: 5px 11px; border: 1px solid #E3E3E1; border-radius: var(--r-md);
  background: #FFFFFF; color: #3E3E3E; font: inherit; font-size: 13px; cursor: pointer;
}
.ill-ctl button:hover { background: #F2F2F1; color: #212121; }
.ill-ctl button:disabled { opacity: .5; cursor: default; }
.ill-ctl button:focus-visible { outline: 2px solid var(--ill-blue); outline-offset: 2px; }

.harvest-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.harvest-frame { position: relative; padding: 8px 8px 12px; text-align: center; border-right: 1px dashed #d6d2c6; }
.harvest-frame:last-child { border-right: 0; }
.harvest-frame .frame-title { display: block; margin-bottom: 4px; font: 500 26px/1.1 var(--hand); color: #212121; }
.harvest-frame > svg { max-height: 340px; }
.harvest-frame .fraction { display: block; font-size: 12px; color: #5d5d62; }
.harvest-frame > strong { display: block; font: 500 40px/1.1 var(--hand); color: var(--ill-blue); }
.harvest-frame > strong small { font-size: 22px; }
.harvest-frame:nth-child(2)::after {
  content: "ненадолго!"; position: absolute; right: 8px; top: 48px;
  font: 500 22px var(--hand); color: #a75232; transform: rotate(-9deg);
}

.engine-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.engine-row .hand-note { margin: 0; max-width: none; font: 500 30px/1.1 var(--hand); color: var(--ill-blue); transform: rotate(-4deg); }

.network-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.thread-board { position: relative; }
.network-explain .hand-note { display: block; margin: 0; max-width: none; font: 500 28px/1.1 var(--hand); color: var(--ill-blue); transform: rotate(-3deg); }
.network-explain p { margin: 18px 0 0; max-width: none; font-size: 14px; line-height: 1.6; color: #5d5d62; }
.network-explain p strong { font-size: 16px; font-weight: 600; color: #212121; }
.network-chart-wrap { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #d6d2c6; }
.thread-line { fill: none; stroke: #4c6fa8; stroke-width: 1.7; opacity: .5; }
.thread-pin { fill: var(--ill-blue); stroke: #fff; stroke-width: 2; }
.paper-friend {
  position: absolute; left: 10px; bottom: 10px; width: 60px; height: 92px; padding: 0;
  border: 0; background: transparent; cursor: pointer; transform: rotate(-9deg);
  filter: drop-shadow(2px 3px 2px #0003);
}
.paper-friend:hover { transform: rotate(-4deg) translateY(-3px); }
.paper-friend:disabled { opacity: .45; cursor: default; transform: rotate(-9deg); }
.paper-friend:focus-visible { outline: 2px solid var(--ill-blue); outline-offset: 3px; }
.friend-head { display: block; width: 24px; height: 24px; margin: auto; border: 1px solid #b5a082; border-radius: 48%; background: #e6c693; }
.friend-body {
  display: block; width: 46px; height: 55px; margin: auto; background: #cfaa60; color: #4c3d28;
  font: 500 36px/55px var(--hand);
  clip-path: polygon(20% 0, 80% 0, 100% 46%, 79% 51%, 87% 100%, 57% 100%, 50% 65%, 43% 100%, 13% 100%, 21% 51%, 0 46%);
}
.network-invite { position: absolute; left: 82px; bottom: 14px; font: 500 22px var(--hand); color: var(--ill-blue); }

.cost-visual { --coin: clamp(5px, 1.1vw, 13px); display: grid; grid-template-columns: 1.4fr .3fr 1fr; gap: 16px; align-items: end; padding: 14px 4px 6px; }
.cost-visual > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cost-bricks { display: grid; grid-template-columns: repeat(20, var(--coin)); gap: 3px; margin: 0 0 14px; }
.cost-bricks i, .one-brick { display: block; width: var(--coin); height: var(--coin); background: #d9b75b; border: 1px solid #a48742; }
.one-brick { margin: 0 0 14px; }
.cost-visual strong { font-size: 14px; font-weight: 600; color: #212121; }
.cost-visual span { margin-top: 2px; font-size: 12px; color: #5d5d62; }
.cost-visual .cost-arrow { align-self: center; font: 500 48px var(--hand); color: var(--ill-blue); }

.ill-flap { margin: 16px 0 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-card); }
.ill-flap > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 16px;
  font-weight: 600; color: var(--text); cursor: pointer; list-style: none;
}
.ill-flap > summary::-webkit-details-marker { display: none; }
.ill-flap > summary:hover { background: var(--hover); }
.ill-flap > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ill-flap > p { margin: 0; padding: 0 16px 14px 46px; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  .ill *, .ill *::before, .ill *::after { animation: none !important; transition: none !important; }
  .ill [data-replay] { display: none; }
}

@media (max-width: 600px) {
  .harvest-strip { display: block; }
  .harvest-frame {
    display: grid; grid-template-columns: minmax(0, 1fr) 96px; grid-template-rows: auto 1fr 1fr;
    padding: 12px 2px; border-right: 0; border-bottom: 1px dashed #d6d2c6; text-align: left;
  }
  .harvest-frame:last-child { border-bottom: 0; }
  .harvest-frame .frame-title { grid-column: 1 / -1; font-size: 24px; }
  .harvest-frame > svg { grid-column: 1; grid-row: 2 / 4; max-height: 240px; }
  .harvest-frame .fraction { grid-column: 2; grid-row: 2; align-self: end; margin-bottom: 8px; }
  .harvest-frame > strong { grid-column: 2; grid-row: 3; align-self: start; font-size: 38px; line-height: 1; }
  .harvest-frame > strong small { display: block; font-size: 20px; }
  .harvest-frame:nth-child(2)::after { font-size: 19px; top: auto; bottom: 16px; right: 0; }
  .engine-row, .network-layout { grid-template-columns: 1fr; gap: 8px; }
  .engine-row .hand-note { font-size: 26px; text-align: right; }
  .network-explain .hand-note { font-size: 24px; }
  .paper-friend { width: 48px; height: 78px; }
  .friend-head { width: 20px; height: 20px; }
  .friend-body { width: 38px; height: 46px; font-size: 28px; line-height: 46px; }
  .network-invite { left: 64px; font-size: 19px; }
  .cost-visual { grid-template-columns: 1.4fr .2fr 1fr; gap: 6px; }
  .cost-bricks { gap: 2px; }
  .cost-visual strong { font-size: 12px; }
  .cost-visual .cost-arrow { font-size: 32px; }
  #growth-scene .axis-label, #growth-scene .small-label { font-size: 23px; }
  #network-chart .axis-label, #network-chart .small-label { font-size: 24px; }
  #network-chart .hand { font-size: 36px; }
  #growth-scene .hand { font-size: 38px; }
  #copy-scene .small-label { font-size: 19px; }
  #copy-scene .hand { font-size: 33px; }
}

@media print {
  .ill-ctl, .paper-friend, .network-invite { display: none !important; }
  .ill-flap { break-inside: avoid; }
  .ill-flap > p { display: block; }
}

.study a.context-link {
    color: inherit;
    text-decoration: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='4'><path d='M1 2.6q5-1.2 9 .1M14 2.2q6-1.4 11 .3M29 2.8q6-1.3 13-.4' fill='none' stroke='rgb(0,0,255)' stroke-width='1.2' stroke-linecap='round'/></svg>");
    background-repeat: repeat-x;
    background-position: 0 100%;
    background-size: 44px 4px;
    padding-bottom: 3px;
    border-bottom: 0;
}
.study a.context-link:hover { color: var(--blue); background-size: 44px 5px; border-bottom: 0; }
.context-link:focus-visible,.context-close:focus-visible,[data-pause-films]:focus-visible{outline:2px solid var(--accent,#0000FF);outline-offset:4px;}
.context-sheet {
  --sheet-side: right;
  box-sizing: border-box; position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(560px, 100%); max-width: 100%;
  height: 100%; height: 100dvh; max-height: 100dvh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0; border: 0; border-left: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
  box-shadow: -2px 0 10px rgb(var(--shadow-rgb) / 0.10), -24px 0 70px rgb(var(--shadow-rgb) / 0.22);
  font-family: 'Inter', sans-serif;
}
.context-sheet::backdrop { background: transparent; }
.context-sheet[open] { animation: context-enter .35s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes context-enter { from { transform: translateX(60px); opacity: .4; } to { transform: none; opacity: 1; } }
.context-sheet-top {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.context-sheet-top > span {
  font-family: var(--hand); font-synthesis-weight: none;
  font-size: 25px; font-weight: 600; line-height: 1.2; color: var(--blue);
}
.context-close {
  border: 0; padding: 10px 0; background: none; cursor: pointer;
  font: 500 13px/1.3 'Inter', sans-serif; color: var(--ink-soft);
}
.context-close:hover { color: var(--blue); }
.context-sheet-content { padding: 30px 34px 44px; }
.context-sheet h2 { font-size: 26px; line-height: 1.22; letter-spacing: -.015em; font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
.context-sheet h2:focus { outline: none; }
.context-sheet h3 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; line-height: 1.4; }
.context-sheet p { font-size: 15px; line-height: 1.75; margin: 0 0 17px; }
.context-sheet .context-date { font-size: 12px; line-height: 1.5; color: var(--ink-faint); margin-bottom: 24px; }
.context-sheet .context-lead { font-size: 17px; line-height: 1.65; color: var(--ink); }
.context-sheet .context-caveat { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 26px; color: var(--ink-soft); font-size: 14px; }
.context-sheet .context-source { font-size: 12px; line-height: 1.65; padding-top: 10px; color: var(--ink-faint); }
.context-sheet a { color: var(--blue); text-decoration: none; border-bottom: 1px solid var(--blue-soft); }
@media (max-width: 640px) {
  .context-sheet {
    --sheet-side: bottom;
    inset: auto 0 0 0; width: 100%; height: auto; max-height: 88dvh;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 12px 12px 0 0;
    box-shadow: 0 -14px 44px rgb(var(--shadow-rgb) / 0.14);
  }
  .context-sheet[open] { animation-name: context-rise; }
  .context-sheet-content { padding: 24px 22px 34px; }
  .context-sheet-top { padding: 10px 22px; }
  .context-sheet h2 { font-size: 23px; }
}
@keyframes context-rise { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }
.context-appendix {margin-top:40px;}
.context-entry{border-bottom:1px solid var(--border);padding:11px 0;}
.context-entry summary{cursor:pointer;font-size:15px;color:var(--accent);}
.context-entry .context-body{padding:20px 0 6px;}
.context-entry .context-date{font-size:12px;color:var(--text-3);}
@media(prefers-reduced-motion:reduce){.context-sheet[open]{animation:none;}}
@media print{.context-sheet{display:none!important}.context-link{border-bottom:0!important}}

.study .chart,
.study .chart.ill,
.study .chart.directed-plate,
.study .chart.generated-plate {
  margin-top: 34px; margin-bottom: 34px;
  padding: 0;
  border: 0; border-radius: 0;
  background: none !important;
}
.study .chart .ct, .study .chart.ill > .ct { margin: 0 0 3px; font-size: 16px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.study .chart .cs, .study .chart.ill .cs {
  margin: 0 0 12px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint);
}
.study .chart .cn, .study .chart.ill .cn { margin: 10px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.study .chart > [id^="c-"], .study .chart .paper-svg, .study .chart .cost-visual, .study .chart .legend {
  background: #FFFFFF; border-radius: var(--r-md);
}
.study .chart > [id^="c-"] { padding: 10px 8px 4px; border: 1px solid var(--line); }
.study .chart .paper-svg, .study .chart .cost-visual { padding: 12px; border: 1px solid var(--line); box-sizing: border-box; }
.study .chart .legend { display: inline-flex; padding: 4px 10px; margin-bottom: 8px; }

.study .chart svg text.ink-note {
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-weight: 600;
}

.study .chart img { display: block; width: 100%; height: auto; margin: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.study .story-stage { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.study .story-explanation { margin: 0; padding: 0; border: 0; background: none; }
.study .story-explanation p {
  margin: 12px 0 0; padding: 0; max-width: 62ch; text-align: left;
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
}
.study .story-actions { display: block; margin: 0; }
.study .energy-comparison { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 14px 0 2px; color: var(--ink); }
.study .energy-comparison strong { display: block; font: 600 clamp(26px, 4vw, 38px)/1.1 var(--hand); color: var(--ink); }
.study .energy-comparison span { display: block; font-size: 13px; color: var(--ink-soft); }
.study .energy-comparison > b { font: 600 30px/1 var(--hand); color: var(--mark-red-pure); }
.study .chart .energy-unit { margin: 0; font-size: 12px; color: var(--ink-faint); }

.study .ill-flap > summary {
    gap: 10px;
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 1.42em;
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink);
}
.study .ill-flap > summary:hover { background: none; color: var(--blue); }

.study .era {
    position: relative;
    margin-top: 44px; margin-bottom: 44px;
    padding: 18px 0 0;
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: none;
}
.study .era .years {
    display: block; margin: 0 0 4px; padding: 0;
    background: none; border-radius: 0;
    font-family: var(--hand); font-synthesis-weight: none;
    font-size: 24px; font-weight: 600; line-height: 1.1;
    color: var(--mark-red-pure);
    transform: rotate(-1.5deg); transform-origin: left center;
}
@media (min-width: 1400px) {
    .study .era .years {
        position: absolute;
        right: calc(100% + 22px);
        top: 20px;
        width: 165px;
        margin: 0;
        text-align: right;
        font-size: 20px;
        line-height: 1.15;
        transform: rotate(-2deg);
        transform-origin: right center;
    }
}
.study .era h3, .study .era h4 { margin: 0 0 12px; font-size: 1.25rem; }
.study .era p { font-size: 16px; }
.study .era .facts { display: block; margin-top: 4px; }
.study .era .facts span {
    display: inline; padding: 0; border: 0; border-radius: 0; background: none;
    font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-faint);
}
.study .era .facts span + span::before { content: "  ·  "; white-space: pre; }

.study .qa {
    position: relative;
    margin-top: 44px; margin-bottom: 44px;
    padding: 18px 0 0;
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: none;
}
.study .qa .q { font-size: 1.2rem; line-height: 1.3; margin-bottom: 12px; }
.study .qa .q .qn {
    font-family: var(--hand); font-synthesis-weight: none;
    font-size: 1.5em; font-weight: 600; line-height: 1;
    color: var(--mark-red-pure); margin-right: 10px;
}
.study .qa p { font-size: 16px; }

.study .twins { margin: 40px auto; }
.study .twin + .twin { margin-top: 34px; }
.study .twin-h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-family: var(--hand);
    font-synthesis-weight: none;
    font-size: 27px;
    font-weight: 600;
    line-height: 1;
}
.study .twin-icon {
    flex: none;
    width: 26px; height: 26px;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.study .twin-same .twin-h { color: var(--blue); }
.study .twin-same .twin-icon { stroke: var(--blue); }
.study .twin-diff .twin-h { color: var(--mark-red-pure); }
.study .twin-diff .twin-icon { stroke: var(--mark-red-pure); }
.study .twin p { margin: 0 0 .9em; font-size: 16px; }
.study .twin p:last-child { margin-bottom: 0; }
.study .twin p b { font-weight: 600; }

.study .parallel { gap: 32px; }
.study .parallel .col { padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.study .parallel .col .h { font-size: 15px; }
.study .parallel .col p { font-size: 14.5px; }

.study .tl { border-left: 1px solid var(--line); }
.study .tl .ev::before {
    left: -7px; top: 9px; width: 13px; height: 12px;
    border: 0; border-radius: 0;
    background: var(--paper) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 12'><path d='M6.7 1.2c3 .1 5.1 2.2 5 4.9-.1 2.8-2.400 4.700-5.300 4.600C3.500 10.600 1.300 8.500 1.400 5.800 1.500 3 3.800 1.100 7.300 1.400' fill='none' stroke='rgb(0,0,255)' stroke-width='1.500' stroke-linecap='round'/></svg>") center / contain no-repeat;
}
.study .tl .ev.hot::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 12'><path d='M6.7 1.2c3 .1 5.1 2.2 5 4.9-.1 2.8-2.400 4.700-5.300 4.600C3.500 10.600 1.300 8.500 1.400 5.800 1.500 3 3.800 1.100 7.300 1.400' fill='rgb(238,0,0)' stroke='rgb(238,0,0)' stroke-width='1.500' stroke-linecap='round'/></svg>");
}
.study .tl .ev .d {
    font-family: var(--hand); font-synthesis-weight: none;
    font-size: 21px; font-weight: 600; line-height: 1.1;
    letter-spacing: 0; text-transform: none;
    color: var(--blue);
}
.study .tl .ev.hot .d { color: var(--mark-red-pure); }
.study .tl .ev .t { font-size: 15.5px; }

.study h3 .arc {
    font-family: var(--hand); font-synthesis-weight: none;
    font-size: 1.35em; font-weight: 600; line-height: 1;
    color: var(--mark-red-pure); margin-right: 8px;
}

.study .era .facts { line-height: 1.5; }
@media (max-width: 640px) {
    .study { margin-top: 20px; }
    .study .chart > [id^="c-"] { padding: 8px 4px 2px; }
    .study .era .years { font-size: 22px; }
    .study .qa .q { font-size: 1.1rem; }
    .study .tl .ev { padding-left: 20px; }
}

.study blockquote .src {
    display: block;
    margin-top: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-faint);
}
