.color-view .workspace{display:none}
#colors-panel{--scene:#eee9d8;--scene-ink:#161616;background:var(--scene);color:var(--scene-ink);transition:background-color 1.2s ease-in-out;min-height:100svh}
#colors-panel[hidden],#colors-panel [hidden]{display:none}
#colors-panel button{cursor:pointer;font:inherit;color:inherit}
.color-scene{display:grid;grid-template-columns:minmax(0,1fr) 384px;min-height:100svh}
.color-atmosphere{padding:34px 48px 28px;display:flex;flex-direction:column;min-width:0}
.color-scene-top{display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:13px}
#color-catalog-open{border:0;background:transparent;padding:12px 0 12px 16px;min-height:44px}#color-catalog-open span{margin-left:12px}
.color-focus{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:65px 0;min-height:340px}
#color-reading{font-size:12px;letter-spacing:3px;text-transform:uppercase;max-width:85%;overflow-wrap:anywhere;margin:0 0 24px}
#color-name{font-size:clamp(48px,6vw,100px);line-height:1.3;font-weight:400;letter-spacing:.08em;max-width:100%;overflow-wrap:anywhere;margin:0 0 32px}
#copy-color-hex{font-size:22px;letter-spacing:2px;padding:12px 0;border:0;border-bottom:1px solid currentColor;background:none;min-height:48px}
#color-copy-status{font-size:12px;min-height:20px;margin-top:12px}
#color-manual{padding:12px;font-size:16px;max-width:90%}
.color-scene-footer{display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center}
.color-play-controls{display:flex;gap:10px;flex-wrap:wrap}
.color-play-controls button{padding:12px 20px;min-height:48px;background:transparent;border:1px solid currentColor;border-radius:2px}
#color-shuffle span{margin-left:20px}#color-next{border-color:transparent;padding-inline:12px}
#color-play-note{font-size:12px;margin:0;text-align:right;line-height:1.8}
#color-provenance{grid-column:1/-1;font-size:12px;line-height:1.8}#color-provenance summary{cursor:pointer;min-height:44px;padding:12px 0;width:fit-content}#color-origins{max-height:140px;overflow:auto;overflow-wrap:anywhere}#color-origins a{color:inherit;text-decoration:underline}
.color-associations{border-left:1px solid #0002;background:#ffffff12;padding:40px 28px 24px;display:flex;flex-direction:column;justify-content:center}
.association-heading h2{font-size:16px;font-weight:500;margin:0 0 10px}.association-heading p{font-size:12px;margin:0 0 38px}
#color-related{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px}
.color-related-card{position:relative;display:flex;align-items:center;flex-direction:column;border:0;border-top:5px solid var(--related);background:transparent;min-width:0;padding:13px 0 0;min-height:320px}
.color-related-index{font-size:10px;letter-spacing:1px;margin-bottom:18px}
.color-related-name{writing-mode:vertical-rl;font-size:17px;letter-spacing:3px;max-height:140px;overflow:hidden;line-height:1.5}
.color-related-hex{writing-mode:vertical-rl;font-size:10px;letter-spacing:1px;margin-top:16px}
.color-related-note{writing-mode:vertical-rl;font-size:10px;letter-spacing:2px;margin-top:18px;border-left:1px solid #0002;padding-left:8px}
.color-related-card:hover{background:#ffffff28}.color-related-card::after{content:'';height:24px;width:1px;background:currentColor;opacity:.35;margin-top:auto}
.association-caption{font-size:11px;margin-top:40px}
#color-state{padding:60px 32px;font-size:16px}#color-retry{margin:0 32px 40px;padding:14px;border:1px solid;background:transparent}
#colors-panel button:focus-visible,#colors-panel input:focus-visible,#colors-panel summary:focus-visible{outline:3px solid currentColor;outline-offset:5px}
#color-catalog{width:min(1050px,calc(100% - 32px));max-height:85svh;box-sizing:border-box;border:0;border-radius:8px;padding:28px;color:#161616;background:#fff}#color-catalog::backdrop{background:#0006;backdrop-filter:blur(5px)}
.color-catalog-head{display:flex;justify-content:space-between;align-items:center;gap:16px}.color-catalog-head h2{font-size:22px;font-weight:500}.color-catalog-head button{border:0;background:transparent;min-height:44px;padding:10px}
#color-catalog label{font-size:14px;margin-right:12px}#color-search{min-height:44px;max-width:100%;border:1px solid #ddd;padding:10px;font:inherit;box-sizing:border-box}#color-count{display:block;font-size:12px;color:#666;margin:20px 0}
#color-wall{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:4px}
#color-wall .color-tile{border:0;background:var(--tile);color:var(--ink);height:126px;padding:14px 10px;text-align:left;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;content-visibility:auto;contain-intrinsic-size:auto 126px}.color-tile span{font-size:13px;overflow-wrap:anywhere}.color-tile small{font-size:11px}
@media(max-width:1100px){header .library-switch{gap:4px}header .library-switch button{padding:0 8px}.color-scene{grid-template-columns:1fr}.color-associations{border-left:0;border-top:1px solid #0002}.color-atmosphere{padding:24px 28px}.color-associations{padding:32px 22px}.color-scene-footer{grid-template-columns:1fr}#color-play-note{text-align:left}}
@media(max-width:760px){header .library-switch{overflow-x:auto;flex-wrap:nowrap}header .library-switch button{padding:0 9px;flex:1 0 auto}.color-scene{grid-template-columns:1fr;min-height:100svh}.color-atmosphere{padding:20px 24px}.color-focus{padding:45px 0;min-height:310px}#color-name{font-size:52px;letter-spacing:.04em}.color-associations{border-left:0;border-top:1px solid #0002;padding:26px 24px}.association-heading p{margin-bottom:24px}.color-related-card{min-height:280px}.association-caption{margin-top:24px}#color-catalog{padding:20px}#color-wall{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){#colors-panel,.color-focus{transition:none}#color-related,.color-related-card{transition:none!important;animation:none!important}}

.color-view > header{display:none}
#colors-panel{position:relative}
.color-focus-top{position:absolute;top:24px;right:24px;z-index:1}
#color-exit{border:1px solid currentColor;border-radius:3px;background:transparent;padding:14px 20px;min-height:48px}
.color-atmosphere{padding-top:100px}
@media(max-width:760px){.color-atmosphere{padding-top:100px}}

/* Stable text slots keep the scene anchored while color metadata changes. */
.color-focus{--name-size:clamp(48px,6vw,100px)}
#color-reading{height:54px;line-height:18px;width:100%;max-width:100%;margin-bottom:24px;flex-shrink:0;overflow:auto}
#color-name{height:calc(var(--name-size) * 2.6);width:100%;font-size:var(--name-size);flex-shrink:0;overflow:hidden}
#copy-color-hex,#color-copy-status{flex-shrink:0}
.color-associations{min-width:0}
.color-related-card{display:grid;grid-template-rows:14px 140px 84px 112px 24px;row-gap:16px;justify-items:center;align-items:start;min-height:0;height:456px;overflow:hidden}
.color-related-index,.color-related-name,.color-related-hex,.color-related-note{margin:0;min-width:0;min-height:0;max-width:100%;max-height:100%;overflow:hidden}
.color-related-name{height:140px;text-align:start;white-space:nowrap;text-overflow:ellipsis}
.color-related-hex{height:84px}
.color-related-note{height:112px}
.color-related-card::after{margin:0}
@media(max-width:760px){.color-focus{--name-size:52px}}

.color-scroll-hint{font-size:12px;align-self:center;opacity:.72}

/* The words fade with the surface; nothing cuts over a half-turned background. */
.color-focus{transition:opacity .18s ease}
.color-focus.is-fading{opacity:0}

/* Associations arrive after the scene settles, so a pressed card keeps its identity. */
#color-related{transition:opacity .24s ease}
#color-related.is-swapping{opacity:0}
.color-related-card{transition:background-color .25s ease,box-shadow .25s ease}
.color-related-card.is-selected{background:#ffffff45;box-shadow:inset 0 0 0 1px currentColor}
#color-related.is-revealing .color-related-card{animation:related-in .4s ease both}
#color-related.is-revealing .color-related-card:nth-child(2){animation-delay:.05s}
#color-related.is-revealing .color-related-card:nth-child(3){animation-delay:.1s}
#color-related.is-revealing .color-related-card:nth-child(4){animation-delay:.15s}
#color-related.is-revealing .color-related-card:nth-child(5){animation-delay:.2s}
#color-related.is-revealing .color-related-card:nth-child(6){animation-delay:.25s}
@keyframes related-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
