.rig-learning { min-width: 0; color: var(--fable-ink); font-family: inherit; }
.rig-learning *, .rig-learning *::before, .rig-learning *::after { box-sizing: border-box; }
.rig-learning [hidden] { display: none !important; }
.rig-topic-menu { margin-bottom: 12px; border-bottom: 1px solid var(--fable-line); }
.rig-topic-menu > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; cursor: pointer; }
.rig-topic-menu > summary strong { font-size: 1.125rem; }
.rig-topic-menu > summary span { font-size: .875rem; color: var(--fable-water); }
.rig-topic-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-block: 8px 16px; }
.rig-kind-switch > summary { min-height: 44px; display: flex; gap: 4px; align-items: center; color: var(--fable-water); font-size: .875rem; cursor: pointer; }
.lab-topic-menu { margin: 0 0 12px; }
.lab-topic-menu > summary { min-height: 44px; display: flex; align-items: center; color: var(--fable-water); font-size: .875rem; cursor: pointer; }
.rig-kind-switch { max-width: 420px; margin: 0 auto 12px; padding: 10px 12px 0; background: var(--fable-surface-soft); border-radius: 12px; }
.rig-kind-label { display: block; color: var(--fable-muted); font-size: 12px; font-weight: 600; }
.rig-kind-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
.rig-learning button { min-width: 0; min-height: 44px; padding: 8px 9px; border: 1px solid var(--fable-line); border-radius: 10px; background: var(--fable-surface); color: var(--fable-ink); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.rig-learning button[aria-pressed="true"] { color: var(--fable-on-water); border-color: var(--fable-water-strong); background: var(--fable-water-strong); }
.rig-kind-options button { border: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: var(--fable-muted); font-weight: 600; }
.rig-kind-options button[aria-pressed="true"] { border-color: var(--fable-water-strong); color: var(--fable-water-strong); background: transparent; font-weight: 700; }
.rig-learning button:not(:disabled):hover { filter: brightness(.96); }
.rig-learning button:disabled { opacity: .38; cursor: default; }
.rig-learning button:focus-visible, .rig-learning summary:focus-visible, .rig-learning a:focus-visible { outline: 3px solid var(--fable-focus); outline-offset: 3px; }
.rig-stage { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); align-items: center; gap: 24px; }
.rig-learning figure { min-width: 0; margin: 0; }
.rig-scene { display: block; width: 100%; height: auto; max-width: 420px; margin: auto; overflow: hidden; color: var(--fable-ink); }
.rig-water { fill: var(--fable-water-soft); }
.rig-seabed-back { fill: var(--fable-surface-soft); }
.rig-seabed { fill: var(--fable-amber); fill-opacity: .35; }
.rig-grains { stroke: var(--fable-amber); fill: none; stroke-width: 2; }
.rig-line { fill: none; stroke: var(--fable-water-strong); stroke-width: 2.5; stroke-linecap: round; }
.rig-spreader { fill: none; stroke: var(--fable-ink); stroke-width: 3; stroke-linejoin: round; }
.rig-snap, .rig-learning .tackle-metal { fill: none; stroke: var(--fable-ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.rig-sinker { fill: var(--fable-line); stroke: var(--fable-ink); stroke-width: 2.2; }
.rig-sinker-shine { fill: none; stroke: var(--fable-surface-strong); stroke-width: 3; }
.rig-labels text { fill: var(--fable-ink); font-family: inherit; font-size: 16px; font-weight: 650; }
.rig-labels path { fill: none; stroke: var(--fable-muted); stroke-width: 1; }
.rig-before { fill: none; stroke: var(--fable-muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .65; }
.rig-rock { fill: var(--fable-muted); stroke: var(--fable-ink); stroke-width: 1.5; }
.rig-safety-symbol { fill: none; stroke: var(--fable-ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.rig-snap-large { fill: none; stroke: var(--fable-ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.rig-latch { stroke: var(--fable-water-strong); }
.rig-knot-metal { fill: none; stroke: var(--fable-muted); stroke-width: 5; stroke-linecap: round; }
.rig-knot-barrel { fill: var(--fable-line); }
.rig-knot-metal .rig-metal-shine { stroke: var(--fable-surface-strong); stroke-width: 1.4; }
.rig-contact { fill: var(--fable-amber); }
.rig-eja .tackle-pearl { fill: var(--fable-surface-strong); stroke: var(--fable-muted); stroke-width: 1.5; }
.rig-knot-main, .rig-knot-tag, .rig-knot-cross { fill: none; stroke: var(--fable-water-strong); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.rig-knot-tag { stroke: var(--fable-current-marker); }
.rig-learning .rig-rope-shadow { stroke: var(--fable-ink); stroke-width: 6; stroke-dasharray: none; opacity: .28; }
.rig-learning .rig-rope-shine { stroke: var(--fable-surface-strong); stroke-width: 1; opacity: .55; transform: translate(-.65px,-.65px); }
.rig-knot-cross[data-top-strand="tag"] { stroke: var(--fable-current-marker); }
.rig-knot-gap { fill: none; stroke: var(--fable-water-soft); stroke-width: 7; stroke-linecap: round; }
.rig-knot-tip { fill: var(--fable-surface-strong); fill-opacity: .4; stroke: var(--fable-water-strong); stroke-width: 1.5; }
.rig-knot-labels text { font-size: 14px; font-weight: 600; }
.rig-knot-labels .rig-main-name { fill: var(--fable-water-strong); }
.rig-knot-labels .rig-tag-name { fill: var(--fable-current-marker); }
.rig-wet-cue { fill: var(--fable-water-soft); stroke: var(--fable-water-strong); stroke-width: 1.5; }
.rig-wet-cue text { fill: var(--fable-muted); stroke: none; font: 13px var(--font-sans, sans-serif); }
.rig-rod { fill: none; stroke: var(--fable-ink); stroke-width: 7; stroke-linecap: round; }
.rig-linebreaker { fill: var(--fable-surface-strong); stroke: var(--fable-ink); stroke-width: 2; }
.rig-tool-wrap { fill: none; stroke: var(--fable-water-strong); stroke-width: 2.5; }
.rig-load-line { stroke-width: 3; }
.rig-break-mark { fill: none; stroke: var(--fable-muted); stroke-width: 2; }
.rig-learning figcaption { margin-top: 3px; text-align: right; color: var(--fable-muted); font-size: 12px; }
.rig-learning .rig-phase { margin: 0 0 8px; color: var(--fable-water-strong); font-size: 13px; font-weight: 700; }
.rig-copy { display: grid; min-width: 0; }
.rig-copy > div { grid-area: 1 / 1; min-width: 0; }
.rig-copy-reserve { visibility: hidden; pointer-events: none; }
.rig-learning .rig-sentence { margin: 0 0 16px; color: var(--fable-ink); font-size: 18px; line-height: 1.6; word-break: keep-all; }
.rig-playback { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 8px; }
.rig-seek-row { display: grid; grid-template-columns: 52px minmax(0,1fr) 52px; align-items: center; gap: 10px; margin-top: 8px; }
.rig-seek-row input { width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0; accent-color: var(--fable-water-strong); cursor: pointer; }
.rig-learning .rig-safety-note { color: var(--fable-muted); font-size: 12px; line-height: 1.5; margin: -6px 0 12px; }
.rig-playback [data-rig-play] { background: var(--fable-water-strong); color: var(--fable-on-water); border-color: var(--fable-water-strong); }
.rig-progress { height: 3px; margin-top: 16px; overflow: hidden; border-radius: 8px; background: var(--fable-line); }
.rig-progress i { display: block; height: 100%; width: 0; background: var(--fable-water); }
.rig-learning .rig-motion-note { color: var(--fable-muted); font-size: 12px; margin: 10px 0 0; }
.rig-learning .rig-sources { margin: 16px 0 0; padding: 0; background: transparent; border: 0; border-bottom: 1px solid var(--fable-line); box-shadow: none; }
.rig-sources summary { display: flex; align-items: center; min-height: 44px; color: var(--fable-muted); font-size: 13px; cursor: pointer; }
.rig-learning .rig-sources p { color: var(--fable-muted); font-size: 13px; line-height: 1.65; word-break: keep-all; }
.rig-sources a { color: var(--fable-water-strong); }
.rig-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fable-content:has([data-rig-guide]) .page-head { margin-block: 10px 18px; }
.fable-content:has([data-rig-guide]) .page-head .intent, .fable-content:has([data-rig-guide]) .page-head .sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fable-content:has([data-rig-guide]) .page-head h1 { font-size: clamp(24px,4vw,36px); margin: 0; }
.fable-content:has([data-rig-guide]) .top { margin-bottom: 10px; }
.fable-content:has([data-rig-guide]) section.rig-learning { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.fable-content:has([data-rig-guide]) .guide-more { margin-top: 22px; padding: 10px 0; }
@media(max-width: 680px) {
  .rig-stage { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .rig-scene { max-width: 360px; }
  .rig-topic-tabs { gap: 4px; }
  .rig-topic-tabs button { font-size: 13px; padding-inline: 4px; }
  .rig-kind-switch { margin-bottom: 8px; }
  .rig-learning .rig-phase { margin: 0 0 5px; }
  .rig-learning .rig-sentence { font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
  .rig-learning .rig-sources { margin-top: 10px; }
  .rig-progress { margin-top: 10px; }
  .fable-content:has([data-rig-guide]) .fable-shell { padding-inline: 14px; }
}
@media(min-width: 681px) and (max-height: 760px) {
  .rig-scene { max-width: 330px; }
  .rig-learning .rig-sentence { font-size: 16px; }
  .fable-content:has([data-rig-guide]) .fable-shell { margin-top: 12px; padding-top: 16px; }
  .fable-content:has([data-rig-guide]) .page-head { margin-block: 6px 10px; }
  .fable-content:has([data-rig-guide]) .page-head h1 { max-width: none; max-inline-size: none; font-size: clamp(26px,2.4vw,32px); }
}
@media(prefers-reduced-motion: reduce) { .rig-learning *, .rig-learning *::before, .rig-learning *::after { animation: none !important; transition: none !important; } }

/* Visual-scan: current lesson has one diagram; optional choices use pictograms. */
.rig-topic-menu > summary > .sea-icon { width: 28px; height: 28px; color: var(--fable-water); }
.rig-topic-menu > summary > strong { flex: 1 1 0; }
.rig-topic-tabs button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 14px 8px; }
.rig-topic-tabs .sea-icon { width: 30px; height: 30px; }
.lab-topic-menu > summary { gap: 8px; }
.lab-topic-menu .lab-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.lab-topic-menu .lab-tabs button { display: flex; align-items: center; flex-direction: column; gap: 8px; padding: 12px 6px; min-height: 76px; white-space: normal; }
.lab-topic-menu .lab-tabs .sea-icon { width: 30px; height: 30px; }
.rig-stage figure { padding: 12px; border-radius: 18px; background: var(--fable-surface); }
.rig-step-content { padding: 16px; border-radius: 14px; background: var(--fable-surface); }
@media(max-width:680px) {
  .rig-stage figure { padding: 8px; }
  .rig-step-content { padding: 12px; }
  .rig-topic-tabs button { font-size: .875rem; }
}

/* Teaching depth is independent of the two ends' colors. */
.rig-learning { --knot-main:#006b72; --knot-tag:#a54920; --knot-paper:var(--fable-water-soft); }
:root[data-fable-scheme="dark"] .rig-learning { --knot-main:#78e1d5; --knot-tag:#ffb27f; }
.rig-knot-casing { fill:none; stroke:var(--knot-paper); stroke-width:9; stroke-linejoin:round; stroke-linecap:round; }
.rig-learning :is(.rig-knot-main,.rig-knot-cross[data-top-strand="main"]) { stroke:var(--knot-main); }
.rig-learning :is(.rig-knot-tag,.rig-knot-cross[data-top-strand="tag"]) { stroke:var(--knot-tag); }
.rig-learning [data-knot-depth="back"] :is(.rig-knot-main,.rig-knot-tag,.rig-knot-cross) { stroke-dasharray:5 4; opacity:.8; }
.rig-learning [data-knot-depth="front"] :is(.rig-knot-main,.rig-knot-tag,.rig-knot-cross) { stroke-width:4.5; }
.rig-learning .rig-knot-gap { stroke:var(--knot-paper); stroke-width:9; }
.rig-learning .rig-main-name { fill:var(--knot-main); }
.rig-learning .rig-tag-name { fill:var(--knot-tag); }
.knot-tools { margin-top:10px; }
.knot-rope-key,.knot-depth-key { display:flex; flex-wrap:wrap; gap:6px 14px; margin:8px 0; font-size:.8125rem; line-height:1.5; color:var(--fable-muted); }
.knot-key-main { color:var(--knot-main); font-weight:700; border-bottom:3px solid currentColor; }
.knot-key-tag { color:var(--knot-tag); font-weight:700; border-bottom:3px solid currentColor; }
.knot-depth-key span:first-child { border-bottom:2px solid currentColor; }
.knot-depth-key span:nth-child(2) { border-bottom:2px dashed currentColor; }
.knot-detail-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:center; margin-top:12px; padding:10px; border:1px solid var(--fable-line); border-radius:12px; }
.knot-detail { width:100%; height:160px; background:var(--knot-paper); border-radius:8px; }
.knot-detail-row strong { display:block; font-size:.9375rem; }
.knot-detail-row p { margin:6px 0; font-size:.875rem; line-height:1.5; }
.knot-check > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:var(--fable-water); font-size:.875rem; }
.knot-check p { font-size:.875rem; line-height:1.6; }
.knot-check-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.rig-learning .knot-check-pair figure { padding:0; }
.rig-options { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; margin-bottom:8px; }
.rig-options label { display:flex; align-items:center; gap:8px; min-height:44px; font-size:.875rem; }
.rig-options select { min-height:44px; padding:6px; color:var(--fable-ink); background:var(--fable-surface); border:1px solid var(--fable-line); border-radius:8px; }
.rig-options input[type="checkbox"] { width:20px; height:20px; accent-color:var(--fable-water); }
.knot-steps { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:10px; }
.knot-steps button { min-width:44px; min-height:44px; flex:1 1 40px; }
.rig-learning:has([data-rig-topic="knot"]) .rig-copy-reserve { display:none; }
.rig-learning:has([data-rig-topic="knot"]) .rig-phase { font-size:1rem; color:var(--fable-ink); }
.rig-learning:has([data-rig-topic="knot"]) .rig-sentence { font-size:1rem; line-height:1.5; }
@media(max-width:680px) {
  .rig-learning:has([data-rig-topic="knot"]) .rig-stage { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; }
  .rig-learning:has([data-rig-topic="knot"]) .rig-step-content { display:contents; }
  .rig-learning:has([data-rig-topic="knot"]) .rig-copy { grid-row:1; padding:12px; background:var(--fable-surface); border-radius:12px; }
  .rig-learning:has([data-rig-topic="knot"]) .rig-stage > figure { grid-row:2; }
  .rig-learning:has([data-rig-topic="knot"]) [data-rig-controls] { grid-row:3; padding:12px; background:var(--fable-surface); border-radius:12px; }
  .knot-tools { grid-row:4; }
  .knot-steps { flex-wrap:nowrap; gap:0; }
  .knot-steps button { padding:6px 0; min-width:0; border-radius:0; }
}
@media(max-width:350px) { .knot-detail-row { grid-template-columns:minmax(0,1fr); } .knot-detail { height:190px; } }
@media(forced-colors:active) { .rig-knot-casing,.rig-knot-gap { stroke:Canvas; } .rig-learning :is(.rig-knot-main,.rig-knot-tag,.rig-knot-cross) { stroke:CanvasText; } .knot-steps button[aria-pressed="true"] { outline:2px solid Highlight; } }

.knot-tools { grid-column:1 / -1; }
.journey-ready #lureView { padding-top:0; }
.journey-ready #lureView .lab-topic-menu { margin-bottom:4px; }

.rig-knot-arrow {fill:none;stroke:var(--fable-ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

@media(max-width:360px) { .knot-steps { display:grid; grid-template-columns:repeat(4,minmax(44px,1fr)); gap:4px; } .knot-steps button { min-width:44px; } }
