.week5-hero { background: var(--lime); }
.week5-hero h1 { font-size: clamp(3rem, 7.5vw, 6rem); }
.token-example { display: flex; flex-wrap: wrap; gap: 7px; }
.token-example span { padding: 6px 9px; border: 1px solid var(--line); background: var(--cream); font: 14px/1.5 "DM Mono", monospace; }
.table-scroll { margin-top: 35px; }
.text-section { background: var(--blue); }
.case-intro { max-width: 760px; font-size: 17px; line-height: 1.7; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 35px; }
.case-card { padding: 30px; background: var(--cream); border: 1px solid var(--line); }
.case-card h3 { margin: 16px 0 24px; font-size: 30px; font-weight: 600; line-height: 1.08; letter-spacing: -.035em; }
.case-card p { font-size: 16px; line-height: 1.7; }
.case-card .section-label { font-size: 12px; }
.case-card .small-copy { font-size: 14px; }
.case-card a, .source-note a { text-decoration: underline; }
blockquote { margin: 20px 0; padding: 0 0 0 18px; border-left: 3px solid var(--coral); font-size: 18px; line-height: 1.55; }
.source-note { margin-top: 28px; }
#inspect[hidden] { display: none; }
#inspect label { display: block; margin-bottom: 10px; font-weight: 600; }
#character-select { width: 100%; padding: 14px; border: 1px solid var(--ink); background: var(--cream); color: var(--ink); font: inherit; }
.inspector-output { margin-top: 25px; padding: 24px; background: var(--cream); }
.inspector-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.inspector-stats dt { font-size: 14px; }
.inspector-stats dd { margin: 7px 0 0; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.explore-link { display: inline-block; margin-top: 28px; padding: 14px 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--cream); font-weight: 500; }
.network-jump { margin-left: 8px; background: transparent; color: var(--ink); }
.network-intro { max-width: 780px; font-size: 17px; line-height: 1.7; }
.network-story { scroll-margin-top: 20px; }
.net-controls { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; margin: 28px 0 18px; }
.net-controls label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.net-controls select { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--ink); background: var(--cream); color: var(--ink); font: 14px "Space Grotesk", sans-serif; }
.network-story button { padding: 10px 13px; min-width: 44px; min-height: 44px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; font: 500 14px "Space Grotesk", sans-serif; }
.network-story button:hover { background: var(--lime); }
.network-story button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.network-story button:disabled { opacity: .4; cursor: default; }
.net-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.net-view-toggle, .net-camera, .net-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#network-zoom { min-width: 48px; text-align: center; font: 12px "DM Mono", monospace; }
.net-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 12px; margin: 22px 0 12px; }
.net-legend span { display: flex; align-items: center; gap: 7px; }
.net-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--ink); }
.net-key-selected { background: var(--lime); }
.net-key-incoming { background: var(--coral); }
.net-key-outgoing { background: var(--blue); }
.net-legend .net-key-both { background: var(--blue); border: 3px solid var(--coral); }
.net-frame { position: relative; background: var(--ink); border: 1px solid var(--ink); overflow: hidden; }
#article-network { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; user-select: none; }
#article-network:active { cursor: grabbing; }
.net-link { fill: none; pointer-events: none; }
.net-link-other { stroke: var(--cream); stroke-opacity: .12; stroke-width: .7; }
.net-link-incoming { stroke: var(--coral); stroke-width: 1.7; }
.net-link-outgoing { stroke: var(--blue); stroke-width: 1.7; }
.net-node { fill: var(--cream); fill-opacity: .65; stroke: var(--ink); stroke-width: 1; cursor: pointer; }
.net-node-selected { fill: var(--lime); fill-opacity: 1; stroke: var(--cream); stroke-width: 2; }
.net-node-incoming { fill: var(--coral); fill-opacity: 1; }
.net-node-outgoing { fill: var(--blue); fill-opacity: 1; }
.net-node-both { fill: var(--blue); fill-opacity: 1; stroke: var(--coral); stroke-width: 3; }
.net-node:hover { stroke: var(--cream); stroke-width: 2; fill-opacity: 1; }
.net-node:focus-visible { outline: none; stroke: var(--cream); stroke-width: 3; fill-opacity: 1; }
.net-node-label { fill: var(--cream); stroke: var(--ink); stroke-width: 3; paint-order: stroke; font: 13px "Space Grotesk", sans-serif; pointer-events: none; }
.net-tray-label, .net-empty-label { fill: var(--cream); font: 12px "DM Mono", monospace; }
.net-isolate-divider { stroke: var(--cream); stroke-opacity: .3; }
.net-tooltip { position: absolute; z-index: 2; max-width: 232px; padding: 10px 12px; background: var(--cream); border: 1px solid var(--ink); font-size: 13px; line-height: 1.5; pointer-events: none; }
.net-presets { margin: 20px 0 28px; }
.net-details { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.net-selected h3 { font-size: 27px; line-height: 1.1; letter-spacing: -.035em; margin: 0 0 16px; }
.net-selected p { font-size: 14px; line-height: 1.7; }
.net-selected a { display: inline-block; font-size: 14px; padding: 12px 0; text-decoration: underline; }
.net-neighbours { min-width: 0; }
.net-neighbours h4 { font-size: 15px; margin: 0 0 14px; }
.net-neighbours h4 span { font-weight: 400; }
.net-neighbours ul { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; border-top: 1px solid var(--line); }
.net-neighbours li { border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.net-neighbours li:has(> button) { padding: 0; }
.net-neighbours li:not(:has(> button)) { padding: 12px 0; }
.network-story .net-neighbours button { display: block; width: 100%; border: 0; text-align: left; padding: 10px 6px; font-weight: 400; }
@media (max-width: 760px) {
  .network-jump { margin-left: 0; margin-top: 12px; }
  .net-controls { grid-template-columns: 1fr; gap: 15px; }
  .net-details { grid-template-columns: 1fr; }
  .net-toolbar { gap: 12px; }
  .net-view-toggle { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .net-legend { gap: 8px 14px; }
}
[hidden] { display: none !important; }
.token-lab { margin: 28px 0; padding: 24px; border: 1px solid var(--ink); background: var(--cream); }
.token-lab > label { display: block; margin-bottom: 8px; font-weight: 600; }
.token-lab textarea { width: 100%; resize: vertical; padding: 12px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 16px/1.5 "DM Mono", monospace; }
.token-options { display: grid; gap: 4px; margin: 14px 0; font-size: 14px; }
.token-options label { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.token-options input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
#token-summary { font-weight: 600; }
.token-lab button, .explore-board button { min-height: 44px; padding: 10px 13px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 500 14px "Space Grotesk", sans-serif; cursor: pointer; }
.token-lab button { margin-top: 18px; }
.token-lab button:hover, .explore-board button:hover { background: var(--lime); }
.explore-board button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.explore-board button:disabled { opacity: .45; cursor: default; background: transparent; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.explore-board { margin-top: 38px; padding: 30px; border: 1px solid var(--ink); scroll-margin-top: 20px; }
.explore-heading { display: grid; grid-template-columns: 1.2fr 1fr; gap: 35px; align-items: end; }
.explore-heading h3 { margin: 16px 0 0; font-size: clamp(2rem, 3.4vw, 2.8rem); letter-spacing: -.045em; line-height: 1.1; font-weight: 600; }
.explore-heading > p { margin: 0; font-size: 16px; line-height: 1.65; max-width: 400px; }
.plot-controls { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 18px; margin-top: 32px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); align-items: end; }
.plot-controls label, .scale-control legend { font-size: 13px; font-weight: 600; }
.plot-controls select { display: block; width: 100%; min-height: 44px; margin-top: 9px; padding: 10px; border: 1px solid var(--ink); background: var(--cream); color: var(--ink); font: 14px "Space Grotesk", sans-serif; }
.scale-control { border: 0; padding: 0; margin: 0; white-space: nowrap; }
.scale-control legend { padding: 0 0 9px; }
.scale-control button + button { margin-left: -1px; }
.explore-stats { display: grid; grid-template-columns: .8fr 1.2fr 1fr; gap: 20px; margin: 24px 0 12px; }
.explore-stats dt { font-size: 12px; line-height: 1.5; }
.explore-stats dd { margin: 7px 0 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; font-variant-numeric: tabular-nums; }
#filter-status { margin-bottom: 24px; }
.explore-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 24px; align-items: start; }
.plot-column, .character-inspector { min-width: 0; }
.plot-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; font-size: 11px; }
.plot-key span { display: flex; align-items: center; gap: 6px; }
.plot-key i { display: inline-block; width: 9px; height: 9px; background: var(--ink); border-radius: 50%; }
.plot-key .key-case { background: var(--coral); }
.plot-key .key-selected { background: var(--lime); border: 1px solid var(--ink); }
.plot-key .key-line { width: 20px; height: 0; background: none; border-top: 2px dashed var(--ink); border-radius: 0; }
.scatter-frame { position: relative; margin-top: 12px; }
#length-scatter, #length-histogram { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick { fill: var(--ink); font: 12px "DM Mono", monospace; }
.chart-label { fill: var(--ink); font: 13px "Space Grotesk", sans-serif; }
.trend-line { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 6 5; opacity: .65; pointer-events: none; }
.article-point { fill: var(--ink); fill-opacity: .6; stroke: var(--cream); stroke-width: .7; cursor: pointer; }
.article-point.checked-case { fill: var(--coral); fill-opacity: 1; stroke: var(--ink); stroke-width: 1; }
.article-point.is-selected { fill: var(--lime); fill-opacity: 1; stroke: var(--ink); stroke-width: 2.5; }
.article-point:not(.is-selected):hover, .article-point:not(.is-selected):focus-visible { fill: var(--coral); fill-opacity: 1; stroke: var(--ink); stroke-width: 2; }
.plot-tooltip { position: absolute; z-index: 2; width: 232px; padding: 10px 12px; border: 1px solid var(--ink); background: var(--ink); color: var(--cream); font-size: 13px; line-height: 1.5; pointer-events: none; }
.histogram-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.histogram-heading h4 { margin: 0; font-size: 21px; font-weight: 600; }
.histogram-heading p { margin: 7px 0 0; }
.histogram-heading label { min-width: 90px; max-width: 110px; font: 12px "DM Mono", monospace; }
.histogram-heading input { display: block; width: 100%; min-height: 44px; accent-color: var(--ink); }
#length-histogram { margin-top: 12px; }
.histogram-bar { cursor: pointer; }
.bar-fill { fill: var(--blue); stroke: var(--ink); stroke-width: 1; pointer-events: none; }
.histogram-bar.active-band .bar-fill, .histogram-bar:hover .bar-fill, .histogram-bar:focus-visible .bar-fill { fill: var(--coral); }
.histogram-bar:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.character-inspector { padding: 20px; background: var(--blue); }
.character-inspector .section-label { margin: 0 0 18px; }
#inspect label { font-size: 13px; margin-bottom: 8px; }
#character-select { padding: 11px 8px; font-size: 14px; min-height: 44px; }
.case-shortcuts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.explore-board .case-shortcuts button { font-size: 12px; padding: 8px 10px; }
.character-inspector .inspector-output { background: transparent; padding: 0; margin-top: 24px; }
.inspector-output h3 { margin: 0 0 22px; font-size: 27px; line-height: 1.1; letter-spacing: -.035em; }
.character-inspector .inspector-stats { gap: 22px 12px; }
.character-inspector .inspector-stats dt { font-size: 12px; line-height: 1.5; }
.character-inspector .inspector-stats dd { font-size: 27px; }
.inspector-output p { font-size: 14px; line-height: 1.65; }
.inspector-output a { display: block; padding: 12px 0; text-decoration: underline; font-size: 14px; }
.explore-note { border-top: 1px solid var(--line); margin: 28px 0 0; padding-top: 20px; }
@media (max-width: 1000px) {
  .plot-controls { grid-template-columns: 1fr 1.3fr; }
  .scale-control { grid-column: 1 / -1; }
  .explore-layout { grid-template-columns: minmax(0, 1fr); }
  .character-inspector { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px 24px; }
  .character-inspector > .section-label { grid-column: 1 / -1; }
  #inspect > label { grid-column: 1; margin: 0; }
  #character-select, .case-shortcuts { grid-column: 1; align-self: start; }
  .character-inspector .inspector-output { grid-column: 2; grid-row: 2 / 6; margin: 0; }
  .character-inspector > .small-copy { grid-column: 1; }
}
@media (max-width: 760px) {
  .case-grid { grid-template-columns: 1fr; }
  .case-card { padding: 24px; }
  .inspector-output { padding: 20px; }
  .explore-board { padding: 20px 14px; }
  .explore-heading { display: block; }
  .explore-heading > p { margin-top: 20px; }
  .plot-controls { grid-template-columns: 1fr; }
  .explore-stats { gap: 12px; grid-template-columns: .7fr 1fr 1fr; }
  .explore-stats dt { font-size: 11px; }
  .explore-stats dd { font-size: 22px; overflow-wrap: anywhere; }
  .token-lab { padding: 18px; }
  .character-inspector { display: block; }
  .character-inspector .inspector-output { margin-top: 24px; }
  .histogram-heading { gap: 12px; }
  .histogram-heading h4 { font-size: 19px; }
  .histogram-heading label { min-width: 75px; }
}
