.wad-div-page { --wad-ink: #142b34; --wad-teal: #2d6d70; --wad-selected: #24716e; --wad-trace: #9b5126; --wad-silver: #c4d5d7; }
.wad-film, .wad-lab, .wad-method-layout, .wad-results-layout, .wad-toy { width: min(100%, 1040px); margin-inline: auto !important; }
.wad-film { position: relative; text-align: left; border: 1px solid var(--v-line); border-radius: 8px; background: #fff; overflow: hidden; }
.wad-film-head, .wad-film-body, .wad-rug-panel, .wad-film-source { padding-inline: clamp(14px, 2.1vw, 30px); }
.wad-film-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.3rem; padding-block: .85rem .75rem; }
.wad-film-head h2 { font-size: var(--v-subheading); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.wad-film-source, .wad-trace-hint { font-size: var(--v-meta); line-height: 1.5; color: var(--v-muted); }
.wad-film-head p { margin-top: .2rem; color: var(--v-muted); font-size: var(--v-body); line-height: 1.6; }
.wad-image-controls { display: flex; align-items: flex-end; gap: .65rem; }
.wad-image-controls label, .wad-trace-select, .wad-pool-choice legend { display: block; margin: 0; padding: 0; color: #354e57; font-size: var(--v-control); font-weight: 600; line-height: 1.5; }
.wad-div-page select { color: var(--v-ink); background: white; border: 1px solid #8da6ab; border-radius: 5px; font: 500 var(--v-control)/1.5 var(--font-body); min-height: 40px; padding: .35rem .55rem; }
.wad-image-controls select, .wad-trace-select select { display: block; margin-top: .28rem; }
.wad-film-body { background: #14252b; color: #f4f8f7; display: grid; grid-template-columns: minmax(100px, 145px) minmax(0, calc(var(--wad-visible, 3) * 154px)); justify-content: center; gap: clamp(14px, 2.6vw, 34px); padding-block: .75rem .65rem; align-items: start; }
.wad-original { border-right: 1px solid #47595f; padding-right: clamp(9px, 1.5vw, 20px); }
.wad-film-body h3 { color: #fff; font-size: var(--v-meta); font-weight: 650; letter-spacing: .005em; margin-bottom: .4rem; }
.wad-neighbours h3 small { color: #b5cacc; font: 400 var(--v-meta)/1.5 var(--font-body); margin-left: .4rem; }
.wad-film-body figure { display: flex; flex-direction: column; align-items: flex-start; }
.wad-image-frame { display: block; position: relative; background: #060c0e; border: 1px solid #52676a; border-radius: 3px; overflow: hidden; }
.wad-film-body .wad-image-frame { width: min(100%, clamp(100px, 15.7vh, 148px)); }
.wad-image-frame img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; margin: 0; }
.wad-original .wad-image-frame { border-color: #b4d8d2; }
.wad-film-body figcaption, .wad-image-name { color: #edf3f1; padding: 0; font-size: var(--v-meta); font-weight: 500; line-height: 1.5; margin-top: .32rem; }
.wad-neighbours { min-width: 0; }
.wad-rank-head { display: flex; align-items: center; justify-content: space-between; gap: .35rem; min-height: 28px; margin-bottom: .3rem; }
.wad-rank-head h3 { margin: 0; }
.wad-original h3 { min-height: 28px; display: flex; align-items: center; margin-bottom: .3rem; }
.wad-neighbours ol { --wad-gap: clamp(8px, 1.2vw, 18px); padding: 4px 3px; list-style: none; display: flex; align-items: flex-start; gap: var(--wad-gap); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #72898c #1a3037; }
.wad-neighbours li { min-width: 0; flex: 0 0 min(138px, calc((100% - (var(--wad-visible, 3) - 1) * var(--wad-gap) - 3px) / var(--wad-visible, 3))); }
.wad-original figure { padding-top: 4px; }
.wad-rank-nav { display: inline-flex; align-items: center; gap: .25rem; color: #dce9e9; }
.wad-rank-nav button { height: 30px; width: 30px; border: 1px solid #6a8488; border-radius: 4px; background: transparent; color: #fff; font: 500 1.25rem/1 var(--font-body); display: grid; place-content: center; }
.wad-rank-nav button:disabled { color: #a3b5b8; border-color: #415a5e; cursor: default; }
.wad-rank-nav button:focus-visible { outline-color: #b9e5dd; }
.wad-rank-nav button:enabled:hover { background: #34535a; }
.wad-rank-nav output { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: var(--v-meta); min-width: 2.9em; text-align: center; }
.wad-portrait { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 0; border: 0; border-radius: 4px; font: inherit; text-align: left; color: #fff; background: transparent; }
button.wad-portrait:hover .wad-image-frame { border-color: #e8b596; }
.wad-div-page .wad-portrait:focus-visible { outline-color: #b9e5dd; outline-offset: 3px; }
.wad-portrait[aria-pressed="true"] .wad-image-frame, .wad-portrait.wad-static-trace .wad-image-frame { border-color: #f4b581; box-shadow: 0 0 0 2px #f4b581; }
.wad-rank-tag { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #255c5e; color: #fff; border: 1px solid #d3e7e2; font: 650 .73rem/1 var(--font-body); }
.wad-portrait[aria-pressed="true"] .wad-rank-tag, .wad-static-trace .wad-rank-tag { background: var(--wad-trace); border-color: #f7d9c5; }
.wad-image-distance { color: #bad5d1; font-variant-numeric: tabular-nums; font-size: var(--v-meta); line-height: 1.5; }
.wad-rug-panel { padding-block: .65rem .15rem; }
.wad-rug-label { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .15rem .65rem; }
.wad-rug-label h3 { font-size: var(--v-item); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.wad-trace-hint { font-size: var(--v-meta); }
#wad-image-rug { display: block; width: 100%; height: 58px; overflow: visible; margin-top: .18rem; }
.wad-axis-text { fill: #496269; font: 11.5px var(--font-body); }
.wad-axis-rule { stroke: #879b9f; stroke-width: 1; }
.wad-rug-mark line { stroke: var(--wad-selected); stroke-width: 1.7; }
.wad-rug-mark circle { fill: var(--wad-selected); stroke: #fff; stroke-width: 1.2; }
.wad-rug-mark text { font: 650 10px var(--font-body); fill: #fff; }
.wad-rug-mark.wad-active circle { fill: var(--wad-trace); }
.wad-rug-mark.wad-active line { stroke: var(--wad-trace); stroke-width: 2; }
.wad-film-source { padding-block: .35rem .75rem; }
.wad-film-source a, .wad-toy > summary { text-decoration: underline; text-underline-offset: .18em; }
.wad-pool-controls { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1rem; }
.wad-pool-choice { padding: 0; margin: 0; border: 0; }
.wad-pool-choice legend { float: none; width: auto; margin-bottom: .28rem; }
.wad-pool-choice > div { display: flex; flex-wrap: wrap; gap: .3rem; }
.wad-pool-choice label { display: inline-flex; align-items: center; gap: .36rem; border: 1px solid #b3c6c8; border-radius: 5px; color: #354e57; min-height: 40px; padding: .4rem .65rem; font: 500 var(--v-control)/1.5 var(--font-body); cursor: pointer; }
.wad-pool-choice label:has(input:checked) { background: #e6f0ed; color: #225c5d; border-color: #387675; }
.wad-pool-choice input { accent-color: var(--wad-selected); margin: 0; }
.wad-pool-layout { display: grid; grid-template-columns: minmax(0, .77fr) minmax(0, 1.8fr); gap: clamp(18px, 2.4vw, 38px); margin-block: 1rem .85rem; border-block: 1px solid #d8e2e3; padding-block: 1rem; align-items: center; }
.wad-pair { padding-right: clamp(8px, 1.4vw, 20px); border-right: 1px solid #d6e2e3; }
.wad-trace-select select { width: min(100%, 14rem); }
.wad-pair-images { display: flex; align-items: center; justify-content: flex-start; gap: .42rem; margin-block: .7rem .45rem; }
.wad-pair-images figure { min-width: 0; width: min(40%, 83px); }
.wad-pair-images img { height: auto; width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #111c20; border-radius: 3px; margin: 0; }
.wad-pair-images > span { color: var(--wad-trace); font-size: 1rem; }
.wad-pair-images figcaption { color: var(--v-muted); font-size: var(--v-meta); padding: 0; margin-top: .2rem; }
.wad-pair-readout { display: flex; gap: .45rem; align-items: baseline; }
.wad-pair-readout strong { font: 650 var(--v-subheading)/1.3 var(--font-body); color: var(--wad-trace); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.wad-pair-readout span, #wad-bin-readout { color: var(--v-muted); font-size: var(--v-control); }
#wad-bin-readout { margin-top: .25rem; line-height: 1.35; }
.wad-hist { min-width: 0; }
.wad-hist-head { display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.wad-hist-head h3 { font-size: var(--v-item); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.wad-hist-head > span { color: var(--v-muted); font-size: var(--v-meta); font-variant-numeric: tabular-nums; }
#wad-image-histogram { width: 100%; display: block; overflow: visible; margin-top: .5rem; }
.wad-hist-grid { stroke: #d9e4e4; stroke-width: 1; }
.wad-bin-guide { fill: #f6e9dd; }
.wad-bar-other, .wad-hist-key i { fill: var(--wad-silver); background: var(--wad-silver); }
.wad-bar-selected, .wad-hist-key .wad-key-selected { fill: var(--wad-selected); background: var(--wad-selected); }
.wad-bar-traced, .wad-bin-pointer, .wad-hist-key .wad-key-traced { fill: var(--wad-trace); background: var(--wad-trace); }
.wad-hist-key { display: flex; justify-content: center; flex-wrap: wrap; gap: .28rem 1rem; padding: 0; margin-top: .6rem; color: var(--v-muted); font-size: var(--v-meta); }
.wad-hist-key span { display: inline-flex; align-items: center; gap: .35em; }
.wad-hist-key i { width: .75rem; height: .75rem; border-radius: 2px; display: inline-block; }
.wad-pool-summary { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem 1rem; }
#wad-pool-equation { font-size: var(--v-body); font-weight: 600; }
#wad-pool-score { font-size: var(--v-body); color: #3b5962; }
.wad-count-table { margin-top: .65rem; }
.wad-count-table summary, .wad-toy > summary { color: var(--v-accent); cursor: pointer; font-size: var(--v-control); font-weight: 600; width: fit-content; }
.wad-count-table .study-table { font-size: var(--v-meta); }
.wad-count-table .study-table caption { font-size: var(--v-meta); color: var(--v-muted); }
.wad-count-table .wad-tabled-trace { background: #f9eee6; }
.wad-image-explorer .study-source { margin-top: .75rem; }
.wad-toy { margin-block: 0; }
.wad-toy-intro { margin-block: .7rem !important; font-size: var(--v-body) !important; }
.wad-lab { margin-top: .8rem !important; }
@media (prefers-reduced-motion: no-preference) {
  .wad-tracing line { animation: wad-stem .42s ease-out both; stroke-dasharray: 1; }
  .wad-tracing circle, .wad-bin-arrival { animation: wad-settle .45s ease-out both; }
  @keyframes wad-stem { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes wad-settle { from { opacity: .45; } to { opacity: 1; } }
}
@media (max-width: 760px) {
  .wad-film-head { flex-wrap: wrap; padding-block: .9rem .75rem; }
  .wad-image-controls { gap: .6rem; }
  .wad-image-controls select, .wad-trace-select select, .wad-pool-choice label { min-height: 44px; }
  .wad-film-body { grid-template-columns: minmax(75px, .95fr) minmax(0, 3.2fr); gap: .75rem; }
  .wad-neighbours ol { --wad-gap: .55rem; }
  .wad-neighbours li { flex-basis: clamp(78px, 22vw, 113px); }
  .wad-rank-head { flex-wrap: wrap; justify-content: flex-start; gap: .2rem .6rem; }
  .wad-rank-nav button { width: 40px; height: 40px; }
  .wad-neighbours h3 small { display: none; }
  .wad-rug-label { gap: .12rem .5rem; }
  .wad-film-source { padding-block: .45rem .75rem; }
  .wad-pool-layout { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .wad-pair { border-right: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .65rem; padding: 0 0 .8rem; border-bottom: 1px solid #d6e2e3; }
  .wad-trace-select { grid-column: 1; grid-row: 1; align-self: end; }
  .wad-pair-images { grid-column: 2; grid-row: 1 / 4; margin: 0; justify-content: flex-end; }
  .wad-pair-readout { grid-column: 1; grid-row: 2; flex-wrap: wrap; gap: .03rem .4rem; }
  #wad-bin-readout { grid-column: 1; grid-row: 3; }
  .wad-count-table .study-table :is(td,th) { overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  .wad-film-body { grid-template-columns: minmax(68px, .85fr) minmax(0, 2.45fr); }
  .wad-neighbours li { flex-basis: 76px; }
  .wad-film-head, .wad-film-body, .wad-rug-panel, .wad-film-source { padding-inline: .68rem; }
  .wad-pair-images { align-self: center; }
}
.wad-settings { display: grid; grid-template-columns: 1.15fr 1fr 1fr; align-items: end; gap: clamp(16px, 3vw, 50px); }
.wad-settings label { color: var(--v-ink); font-size: var(--v-control); font-weight: 550; }
.wad-settings input, .wad-settings select { display: block; width: 100%; margin-top: 8px; font-weight: 450; }
.wad-settings input { accent-color: var(--v-accent); height: 2.125rem; }
.wad-settings output { display: inline; color: var(--v-accent); margin-left: .4em; font-size: var(--v-control); font-variant-numeric: tabular-nums; }
.wad-lab-views { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 3vw, 45px); border-block: 1px solid #d6e2e3; margin-block: 1.3rem 1rem; padding-block: 1.15rem .8rem; }
.wad-plot-box svg { display: block; width: 100%; max-height: 210px; margin-block: .45rem .2rem; overflow: visible; }
.wad-plot-box svg text { font: 11px var(--font-body); fill: #425f65; }
.wad-plot-box p, .wad-plot-key { text-align: center; }
.wad-cloud-field { fill: #f2f7f6; stroke: #d7e3e2; }
.wad-cloud-point { fill: #4b8c89; stroke: #275d5d; stroke-width: 1.4; }
.wad-empty { fill: #a7bbbd; }
.wad-axis-grid { stroke: #d7e2e5; stroke-width: 1; }
.wad-cdf-observed, .wad-cdf-reference { fill: none; stroke-width: 3; }
.wad-cdf-observed { stroke: #246e6e; }
.wad-cdf-reference { stroke: #84673e; stroke-dasharray: 5 5; stroke-width: 2.3; }
.wad-plot-key { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; font-size: var(--v-meta); color: var(--v-muted); }
.wad-plot-key span { display: inline-flex; align-items: center; gap: .4em; }
.wad-plot-key i { border-bottom: 3px solid #246e6e; width: 1.5rem; }
.wad-plot-key span + span i { border-bottom: 2px dashed #84673e; }
.wad-reading { display: flex; align-items: center; gap: 1.75rem; }
.wad-reading > div { white-space: nowrap; color: var(--v-accent); }
.wad-reading span { display: block; font-size: var(--v-meta); font-weight: 600; }
.wad-reading strong { font-size: var(--v-heading); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wad-reading p { max-width: 41rem; font-size: var(--v-body); line-height: 1.6; }
.wad-lab .study-source { margin-top: .9rem; }
.wad-method-layout, .wad-results-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 4vw, 64px); align-items: center; }
.wad-method-steps { justify-content: center; }
.wad-method-steps li { padding-top: 0; }
.wad-method-steps h3, .wad-figure-guide h3, .wad-references h3 { font-size: var(--v-item); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.wad-method-steps p, .wad-references [data-view] p, .wad-figure-guide p { color: var(--v-muted); font-size: var(--v-body); margin-top: 6px; line-height: 1.6; }
.wad-references [data-view] svg { display: block; width: 100%; height: 78px; margin-block: .85rem; }
.wad-ref-axis { fill: none; stroke: #8ba2a8; stroke-width: 1.5; }
.wad-ref-fill { fill: #73aaa5; stroke: #326a70; stroke-width: 1.5; }
.wad-references .study-controls, .wad-figure-guide .study-controls { margin-block: .9rem; }
.wad-references .study-source { margin-top: 1rem; }
.wad-references h4, .wad-figure-guide h4 { font-size: var(--v-item); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.wad-results-layout { grid-template-columns: minmax(0, 1.8fr) minmax(0, .9fr); }
.wad-paper-figure img { display: block; width: 100%; height: auto; border: 1px solid #d4dfe1; border-radius: 4px; background: #fff; }
.wad-paper-figure figcaption { font-size: var(--v-meta); color: var(--v-muted); line-height: 1.5; margin-top: .65rem; }
.wad-contrast { margin-top: 1.3rem; border-top: 1px solid var(--v-line); padding-top: 1.2rem; }
@media (max-width: 760px) {
  .wad-settings, .wad-lab-views, .wad-method-layout, .wad-results-layout { grid-template-columns: 1fr; }
  .wad-settings { gap: 12px; }
  .wad-settings label { max-width: 100%; }
  .wad-lab-views { padding-block: 1rem; }
  .wad-method-layout, .wad-results-layout { gap: 1.65rem; }
  .wad-plot-box svg { max-height: 190px; }
  .wad-reading { align-items: start; gap: 1rem; }
}
@media (max-width: 520px) {
  .wad-reading { flex-direction: column; gap: .45rem; }
}

@media (max-width: 600px) {
  .wad-film { display: flex; flex-direction: column; }
  .wad-film-head { display: contents; }
  .wad-film-head > div:first-child { order: 0; padding: .65rem .75rem .55rem; }
  .wad-film-body { order: 1; }
  .wad-film-head > .wad-image-controls { order: 2; padding: .65rem .75rem .25rem; }
  .wad-rug-panel { order: 3; }
  .wad-film-source { order: 4; }
  .wad-rank-head { min-height: 32px; }
  .wad-rank-head h3 { width: 100%; }
  .wad-original h3 { min-height: 32px; }
  .wad-film-body { align-items: start; }
  .wad-rank-nav { width: 100%; justify-content: flex-start; }
  .wad-rank-nav button { height: 32px; width: 35px; }
}

.wad-connect { position: absolute; inset: 0; height: 100%; width: 100%; pointer-events: none; }
.wad-connect path { fill: none; stroke: #a16b42; stroke-width: 1.25; opacity: .67; }
.wad-rug-label h3, .wad-rug-label .wad-trace-hint { position: relative; z-index: 1; background: white; box-shadow: 0 0 0 3px white; }
@media (prefers-reduced-motion: no-preference) { .wad-connect .wad-flowing { animation: wad-stem .42s ease-out both; stroke-dasharray: 1; } }

.wad-div-page .wad-film-source { font-size: var(--v-meta); line-height: 1.5; }
.wad-bin-count { fill: #344f56; font: 600 11px var(--font-body); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .wad-neighbours { display: flex; flex-direction: column; }
  .wad-rank-head { display: contents; }
  .wad-rank-head h3 { order: 0; min-height: 32px; display: flex; align-items: center; margin-bottom: .3rem; }
  .wad-neighbours ol { order: 1; }
  .wad-rank-nav { order: 2; margin-top: .3rem; }
  .wad-rank-nav button { width: 44px; height: 40px; }
}

.wad-build-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem 1.1rem; margin-top: .8rem; border-top: 1px solid #dce5e6; padding-top: .7rem; }
.wad-build-controls, .wad-build-state { display: flex; align-items: center; gap: .45rem; }
.wad-build-controls button { border: 1px solid #7c999e; background: #fff; color: #245a60; border-radius: 4px; padding: .42rem .72rem; min-height: 37px; font: 600 var(--v-control)/1.5 var(--font-body); }
.wad-build-controls button:first-child { background: #326a70; color: #fff; border-color: #326a70; }
.wad-build-controls button:hover { background: #e4eeeb; }
.wad-build-controls button:first-child:hover { background: #24585c; }
.wad-build-state { flex: 1; justify-content: flex-end; min-width: min(100%, 200px); }
.wad-build-state img { border-radius: 3px; width: 38px; height: 38px; object-fit: contain; background: #152427; }
.wad-build-state p { font-size: var(--v-meta); line-height: 1.5; font-weight: 600; color: var(--v-ink); font-variant-numeric: tabular-nums; }
.wad-build-state small { display: block; color: var(--v-muted); font-size: var(--v-meta); line-height: 1.5; }
.wad-bar-added, .wad-hist-key .wad-key-added i { fill: #587aa0; background: #587aa0; }
.wad-pool-layout { margin-top: .7rem; }
@media (max-width: 760px) { .wad-build-controls button { min-height: 44px; } .wad-build-state { justify-content: flex-start; } }
