/* Shadows tab. The stage is a light grey tabletop, so text over the view is dark ink. */
body[data-tab=shadows] .viewport{background:#9fa3a4;color:#1f3037}
body[data-tab=shadows] .view-top .eyebrow{opacity:.8}
body[data-tab=shadows] .view-top h1{color:#16262c}
body[data-tab=shadows] #object-note{color:#2f4048}
body[data-tab=shadows] .view-top>div:first-child{flex:0 1 auto;background:#efece6d9;border-radius:9px;padding:6px 10px 7px;margin:-6px 0 0 -6px}

/* Squint: blur only the render, so the big value shapes show. */
#scene.sh-squint canvas{filter:blur(7px)}
.sh-overlay.sh-squint{opacity:.25}

/* Labels and leader lines over the 3D view */
.sh-overlay{position:absolute;inset:0;pointer-events:none}
.sh-leaders{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.sh-halo{stroke:#fff;stroke-width:4;stroke-linecap:round;opacity:.75}
.sh-lead{stroke-width:1.5;stroke:#1f3037}
.sh-lead-light{stroke:#1f3037}
.sh-lead-shadow{stroke:#1f3037;stroke-dasharray:4 3}
.sh-anchor{fill:#fff;stroke:#1f3037;stroke-width:1.5;stroke-dasharray:none}
.sh-anchor.sh-lead-shadow{fill:#1f3037;stroke:#fff}
.sh-label{position:absolute;left:0;top:0;padding:4px 8px 5px;border-radius:7px;font-size:.75rem;line-height:1.2;white-space:nowrap;box-shadow:0 1px 4px #0003;max-width:44vw}
.sh-label b{display:block;font-weight:700}
.sh-label span{display:block;font-size:.66rem;letter-spacing:.2px}
.sh-label.sh-light{background:#fffdf6;color:#1f3037;border:1px solid #c9c2ae}
.sh-label.sh-light span{color:#6a6450}
.sh-label.sh-shadow{background:#27343a;color:#f1f5f6;border:1px solid #101a1e}
.sh-label.sh-shadow span{color:#b9c7cc}
.sh-tag{position:absolute;left:0;top:0;padding:2px 6px;border-radius:5px;font-size:.75rem;font-weight:700;color:#fff;background:var(--c,#263238);white-space:nowrap;box-shadow:0 1px 3px #0004}

/* Where is the light: a badge on the sun or lamp, or on the edge of the view with an arrow toward it */
.sh-lightmark{position:absolute;left:0;top:0;display:flex}
.sh-lm-body{display:flex;align-items:center;gap:5px;padding:3px 10px 3px 4px;border-radius:999px;background:#fffdf4;color:#3d3000;border:1px solid #c9a43a;font-size:.75rem;font-weight:700;line-height:1.2;white-space:nowrap;box-shadow:0 1px 4px #0003}
.sh-lm-body svg{width:22px;height:22px;flex:none}
/* Crowded view: the icon alone. */
.sh-lm-compact .sh-lm-body{padding:3px 4px}
.sh-lm-compact .sh-lm-text{display:none}
.sh-lm-arrow{position:absolute;left:50%;top:50%;width:12px;height:12px;background:#8a6400;clip-path:polygon(0 0,100% 50%,0 100%)}

/* Value legend along the bottom of the view */
.sh-legend{pointer-events:auto;background:#fffffff0;color:#1f3037;border:1px solid #c9cfcf;border-radius:10px;padding:6px 8px 7px;box-shadow:0 2px 10px #0002;max-width:100%}
.sh-scale{margin:0 0 4px;font-size:.7rem;color:#4c5b61}
.sh-scale b{color:#1f3037}
.sh-fams{display:flex;flex-wrap:wrap;gap:4px 12px}
.sh-fam{display:flex;flex-direction:column;gap:2px}
.sh-fam-name{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:#4c5b61}
.sh-fam-shadow .sh-fam-name{color:#27343a}
.sh-chips{display:flex;flex-wrap:wrap;gap:4px}
.view-bottom .sh-chip{display:flex;align-items:center;gap:6px;padding:3px 8px 3px 3px;min-height:36px;font-size:.72rem;font-weight:600;background:#fff;border:1px solid #cbd4d5;color:#1f3037}
.view-bottom .sh-chip:hover{background:#f3f6f0}
.view-bottom .sh-chip[aria-pressed=true]{background:#ffe7d3;border-color:#ff7a1a;box-shadow:inset 0 0 0 1px #ff7a1a}
.sh-sw{display:grid;place-items:center;width:28px;height:28px;border-radius:5px;border:1px solid #0003;font-size:.8rem;font-weight:800;flex:none}
.sh-fam-shadow .sh-chip .sh-cn::after{content:''}

/* Practice bar (replaces the legend while predicting) */
.sh-pbar{pointer-events:auto;flex:1 1 auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#fff8e6;color:#4a3a14;border:1px solid #d9c27d;border-radius:10px;padding:6px 8px 6px 12px;font-size:.85rem;line-height:1.35;box-shadow:0 2px 10px #0002;max-width:100%}
.sh-pbar span{flex:1 1 220px}

/* Side panel: light controls first and compact, so the sliders show without scrolling */
body[data-tab=shadows] .sh-light{padding-top:12px}
.sh-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.panel .sh-head h2{margin:0}
.sh-object{display:flex;align-items:center;gap:6px;font-size:.8rem;font-weight:600;color:var(--muted);min-width:0}
.sh-object select{min-width:0;max-width:170px;background:#fff;border:1px solid #cbd4d5;border-radius:6px;padding:7px 6px;font-size:.85rem;color:#26383e;min-height:36px}
.sh-light .range-title{margin-top:10px}
.sh-light h3{margin-top:12px}
.sh-light #sh-type-note{margin:6px 0 0}
.sh-seg{display:flex;flex-wrap:wrap;border:1px solid #cbd4d5;border-radius:9px;overflow:hidden;background:#fff}
.sh-seg>button{flex:1 1 auto;border:0;border-radius:0;border-right:1px solid #cbd4d5;min-height:38px}
.sh-seg>button:last-child{border-right:0}
.sh-seg>button[hidden]{display:none}
.sh-modes{display:grid;grid-template-columns:1fr 1fr}
.sh-modes>button{border-bottom:1px solid #cbd4d5}
.sh-modes>button:nth-child(2n){border-right:0}
.sh-modes>button:nth-child(n+3){border-bottom:0}
.sh-modes>button:nth-child(2):has(+ [hidden]){border-bottom:0}
.sh-presets,.sh-toggles{display:flex;flex-wrap:wrap;gap:6px}
.sh-presets>button,.sh-toggles>button{flex:1 1 auto}
.sh-toggles{margin-top:12px}
.sh-light .status{margin-top:8px}
.sh-readout{margin:10px 0 0;padding:8px 10px;border-radius:6px;background:#f1f4f4;color:#1f3037!important;font-weight:600;font-variant-numeric:tabular-nums}
.sh-readout:empty{display:none}
.sh-az-ends span{width:0;display:flex;justify-content:center;white-space:nowrap}
.sh-az-ends span:first-child{justify-content:flex-start}
.sh-az-ends span:last-child{justify-content:flex-end}
.sh-notes{margin:0;padding-left:18px}
details.sh-notice[open]>summary{margin-bottom:6px}
.sh-notes li{margin:4px 0}
.sh-key{list-style:none;margin:10px 0 0;padding:0}
.sh-key li{display:flex;align-items:center;gap:8px;margin:3px 0;font-size:.8rem}
.sh-key i{flex:none;width:26px;height:0;border-top:3px solid}
.sh-key .k-ray{border-color:#e65100}
.sh-key .k-plumb{border-top:2px dashed #263238}
.sh-key .k-line{border-color:#1565c0}
.sh-key .k-point{width:12px;height:12px;border:0;border-radius:50%;background:#d50000;margin:0 7px}
.sh-key .k-outline{border-top:2px dashed #1565c0}
.sh-practice .row{margin-top:10px}
.sh-practice .status{margin-top:10px}
.sh-words dl{margin:0}
.sh-words dt{font-weight:700;font-size:.85rem;margin-top:10px;color:#1f3037}
.sh-words dd{margin:2px 0 0;font-size:.85rem;line-height:1.45;color:var(--muted)}

@media(max-width:600px){
  .sh-label{font-size:.68rem;padding:3px 6px 4px}
  .sh-label span{font-size:.6rem}
  /* One scrolling row of chips, so the legend leaves room for the view. */
  .sh-legend{width:100%;padding:5px 6px 6px}
  .sh-fams{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding-bottom:2px}
  .sh-fam{flex:none}
  .sh-chips{flex-wrap:nowrap}
  .view-bottom .sh-chip{font-size:.66rem;padding-right:6px;gap:4px;white-space:nowrap}
  .sh-sw{width:24px;height:24px}
  .sh-scale{font-size:.64rem;margin-bottom:2px}
  .sh-fam-name{font-size:.6rem}
  .sh-pbar{font-size:.8rem;padding:6px 8px}
}
