body.portal { line-height: 1.6; }
.ws-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ws-shell { max-width: 860px; margin: 0 auto; padding: 24px 16px 56px; }
.ws-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-intro h1 { margin-bottom: 12px; }
.ws-h1-sub { display: block; margin-top: 4px; color: var(--muted); font-size: .55em; font-weight: 700; letter-spacing: 0; }
.ws-intro .lead { margin-bottom: 16px; font-size: 17px; }
.ws-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }

.ws-tool { margin: 22px 0 36px; padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ws-label { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: var(--text); font-size: 14px; font-weight: 750; }
.ws-label:first-of-type { margin-top: 0; }
.ws-num { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.ws-chips, .ws-edit, .ws-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-chip { min-width: 44px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.ws-chip:hover:not(:disabled) { border-color: var(--accent); }
.ws-chip:disabled { opacity: .45; cursor: default; }
.ws-chip[aria-pressed="true"], .ws-chip-strong { background: var(--accent); border-color: var(--accent); color: #fff; }
.ws-chip-quiet { background: transparent; color: var(--muted); }
.ws-count { padding: 8px 0; font-variant-numeric: tabular-nums; }
.ws-sublabel { margin: 12px 0 8px; color: var(--text); font-size: 13px; font-weight: 700; }
.ws-sublabel span { color: var(--muted); font-weight: 600; }

/* Tubes: four fixed layer slots each, so the shelf never changes height. */
.ws-shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 6px; margin: 0 0 14px; padding: 12px 4px 8px; border-radius: 12px; background: #2f2a3d; }
.ws-tube { display: flex; flex: none; flex-direction: column; align-items: center; gap: 4px; width: 40px; padding: 0; border: 0; background: none; color: #f4efe2; cursor: pointer; touch-action: manipulation; transition: transform .25s ease; }
.ws-glass { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; height: 122px; padding: 3px 3px 4px; box-sizing: border-box; border: 2px solid rgba(244, 239, 226, .55); border-top-color: rgba(244, 239, 226, .2); border-radius: 6px 6px 18px 18px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ws-tube[aria-pressed="true"] .ws-glass { border-color: #ffd36b; box-shadow: 0 0 0 3px rgba(255, 211, 107, .45); }
.ws-tube[aria-pressed="true"] .ws-tube-num { background: #ffd36b; color: #2f2a3d; }
.ws-tube-num { min-width: 22px; padding: 0 4px; border-radius: 6px; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.ws-layer { display: grid; place-items: center; flex: 1 1 0; min-height: 0; border-radius: 3px; background: var(--c); }
.ws-layer:first-child { border-radius: 3px 3px 13px 13px; }
.ws-slot { background: transparent; }
.ws-glyph { width: 16px; height: 16px; fill: var(--ink); }
.ws-in { animation: ws-fill .45s ease-out both; transform-origin: bottom; }
.ws-lift { animation: ws-lift .5s ease-out; }
.ws-from .ws-glass { border-color: #ff9f7a; }
.ws-to .ws-glass { border-color: #7fe0c4; box-shadow: 0 0 0 3px rgba(127, 224, 196, .35); }
@keyframes ws-fill { from { transform: scaleY(0); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes ws-lift { 0%, 100% { transform: none; } 40% { transform: translateY(-10px) rotate(-8deg); } }

.ws-palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.ws-swatch { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; touch-action: manipulation; }
.ws-swatch:hover:not(:disabled) { border-color: var(--accent); }
.ws-swatch:disabled { opacity: .4; cursor: default; }
.ws-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.ws-dot .ws-glyph { width: 18px; height: 18px; }
.ws-swatch-name { max-width: 100%; font-size: 11px; font-weight: 700; line-height: 1.1; text-align: center; }
.ws-swatch-count { color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-swatch[data-done="true"] .ws-swatch-count { color: var(--accent); }
.ws-status { min-height: 3.2em; margin: 12px 0 0; color: var(--text); font-size: 14px; }
.ws-solve { width: 100%; font-size: 16px; }

.ws-result { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.ws-result:focus { outline: none; }
.ws-result-title { margin: 0 0 12px; font-size: 22px; }
.ws-replay .ws-shelf { margin-bottom: 10px; }
.ws-caption { min-height: 3.2em; margin: 0 0 10px; color: var(--text); font-size: 15px; font-weight: 650; }
.ws-controls { margin-bottom: 12px; }
.ws-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.ws-copy-status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }
.ws-copy-status:empty { display: none; }
.ws-problems { margin: 0 0 10px; padding-left: 20px; color: var(--text); font-weight: 650; }
.ws-problems li { margin-bottom: 4px; }
.ws-controls .ws-chip { padding: 8px 12px; }
.ws-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.ws-move { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.ws-move[data-done="true"] { color: var(--muted); }
.ws-move[aria-current="step"] { border-color: var(--accent); background: #e2f0e9; }
.ws-move-n { min-width: 22px; color: var(--muted); font-size: 12px; }
.ws-move-text { flex: 1; white-space: nowrap; }
.ws-move-what { display: inline-flex; white-space: nowrap; align-items: center; gap: 2px; font-size: 12px; }
.ws-mini { display: inline-grid; flex: none; width: 18px; height: 18px; border-radius: 50%; }
.ws-mini:first-child { border-radius: 50%; }
.ws-mini .ws-glyph { width: 12px; height: 12px; }
.ws-note { margin: 8px 0 0; font-size: 13px; }

.ws-article h2 { margin: 30px 0 12px; font-size: 24px; }
.ws-article li { margin-bottom: 8px; color: var(--muted); }
.ws-article li strong { color: var(--text); }
.ws-faq details { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ws-faq summary { color: var(--text); font-weight: 750; cursor: pointer; }
.ws-faq details p { margin: 8px 0 0; }
.ws-cta { margin-top: 32px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.ws-cta h2 { margin-top: 0; }
.ws-cta .text-link { color: var(--accent-strong); }
.ws-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .ws-in, .ws-lift { animation: none; }
  .ws-tube { transition: none; }
}
@media (min-width: 640px) {
  .ws-shell { padding: 36px 24px 64px; }
  .ws-tool { padding: 22px; }
  .ws-shelf { gap: 14px 12px; }
  .ws-tube { width: 48px; }
  .ws-glass { height: 140px; }
  .ws-palette { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
