/* Envisioning Crystal: looking into a gem.
   A deep, quiet ground lit from within; faint facet planes like light inside a stone; translucent glass;
   pill buttons with fine light edges that glow when touched. Jewel tones, softened: amethyst, sapphire,
   jade, citrine, rose, orchid. Room to breathe. */

@font-face { font-family: "Crystal Serif"; font-weight: 400; font-display: swap; src: url(/fonts/garamond-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Crystal Serif"; font-weight: 400; font-display: swap; src: url(/fonts/garamond-400-latinext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crystal Serif"; font-weight: 600; font-display: swap; src: url(/fonts/garamond-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Crystal Serif"; font-weight: 600; font-display: swap; src: url(/fonts/garamond-600-latinext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  /* The stone */
  --gem-0: #07060c; --gem-1: #0e0c19; --gem-2: #191528;
  /* Jewel tones, the six facets */
  --amethyst: #a897ee; --sapphire: #87a8e8; --jade: #7cc7a9; --citrine: #e1c07c; --rose: #e3a198; --orchid: #c79bdc;
  --depth: var(--amethyst); --vision: var(--sapphire); --path: var(--jade); --hands: var(--citrine); --ground: #aaa7b9;
  /* Light and text */
  --ink: #efebf7; --soft: rgba(232,227,245,.78); --muted: rgba(225,220,240,.58); --faint: rgba(225,220,240,.36);
  /* Glass */
  --glass: rgba(255,255,255,.035); --glass-2: rgba(255,255,255,.065); --glass-hi: rgba(255,255,255,.1);
  --line: rgba(255,255,255,.09); --edge: rgba(255,255,255,.15); --edge-hi: rgba(214,204,252,.55);
  --halo: rgba(168,151,238,.32); --halo-soft: rgba(168,151,238,.16);
  --solid: #14111f; --danger: #eb9a8f; --ok: #8fd0b3;
  --blur: blur(20px) saturate(130%);
  --shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 60px rgba(0,0,0,.32);
  /* Type */
  --serif: "Crystal Serif", "EB Garamond", Garamond, "Hoefler Text", Georgia, serif;
  --sans: "Avenir Next", -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Room */
  --side: 384px; --gap: 16px;
  /* The box for the raw stones: felt drawn as fine noise; the wood is a photograph, chosen in app.js (--wood). */
  --fuzz: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 1  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23f)'/%3E%3C/svg%3E");
  --wood: url(/box/burl-2.jpg); --frame: url(/box/frame-burl-8.jpg); --lid: url(/box/lid-burl-8.jpg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--gem-0); }
html, body { margin: 0; color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
body {
  display: grid; grid-template-columns: 1fr var(--side); grid-template-rows: auto 1px 1fr; min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 46% 44%, rgba(168,151,238,.17), transparent 64%),
    radial-gradient(ellipse 45% 40% at 10% 92%, rgba(135,168,232,.10), transparent 62%),
    radial-gradient(ellipse 40% 35% at 92% 86%, rgba(199,155,220,.08), transparent 62%),
    radial-gradient(ellipse 35% 30% at 90% 6%, rgba(124,199,169,.05), transparent 62%),
    linear-gradient(165deg, var(--gem-2) 0%, var(--gem-1) 46%, var(--gem-0) 100%);
  background-attachment: fixed;
}
/* Facet planes: light caught inside the stone. */
body::before {
  content: ""; position: fixed; inset: -20%; pointer-events: none; z-index: 0;
  background: conic-gradient(from 12deg at 46% 44%, rgba(255,255,255,.028) 0 3%, transparent 3% 11%, rgba(255,255,255,.02) 11% 13%, transparent 13% 24%,
    rgba(255,255,255,.03) 24% 27%, transparent 27% 38%, rgba(255,255,255,.016) 38% 41%, transparent 41% 52%, rgba(255,255,255,.028) 52% 54%,
    transparent 54% 66%, rgba(255,255,255,.02) 66% 70%, transparent 70% 81%, rgba(255,255,255,.024) 81% 83%, transparent 83% 100%);
  mask-image: radial-gradient(circle at 46% 44%, #000 0%, rgba(0,0,0,.45) 45%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 46% 44%, #000 0%, rgba(0,0,0,.45) 45%, transparent 75%);
}
/* The backlight: always faintly there, brighter and breathing while the crystal works. */
body::after {
  content: ""; position: fixed; left: 46%; top: 44%; width: 120vmax; height: 120vmax; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 0; opacity: .4; transition: opacity 1.4s ease;
  background: radial-gradient(circle, rgba(190,176,245,.16) 0%, rgba(168,151,238,.06) 22%, transparent 48%);
}
body > * { position: relative; z-index: 1; }
body.login { display: flow-root; } /* flow-root keeps the card's margin inside, so the background reaches the top */

h1, h2, h3 { font-weight: 600; }
::selection { background: rgba(168,151,238,.35); }

/* ---------- Header ---------- */
header.top { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 16px 28px;
  background: rgba(10,9,18,.32); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--line); }
.spectrum { grid-column: 1 / -1; background: linear-gradient(90deg, transparent 4%, var(--amethyst), var(--sapphire), var(--jade), var(--citrine), var(--rose), transparent 96%); opacity: .32; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); margin-right: 4px; }
/* The mark draws its lines in the colour of what lies behind it, and its centre in light. */
.brand .mark { width: 30px; height: 30px; flex: none; --mark-ground: #100d1c; --mark-centre: #f2eff8; filter: drop-shadow(0 0 10px rgba(168,151,238,.35)); transition: filter 1s ease; }
.brand .word { font: 400 20px/1 var(--sans); letter-spacing: -.02em; color: var(--muted); white-space: nowrap; }
.brand .word b { font-weight: 600; color: var(--ink); }
.print-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#cost { margin-right: 4px; color: var(--faint); }

/* ---------- Fields ---------- */
select, input[type=text], input[type=password], textarea {
  font: 400 14.5px/1.5 var(--sans); color: var(--ink); background: var(--glass); border: 1px solid var(--edge); border-radius: 16px; padding: 9px 14px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .25s, box-shadow .25s; }
select { border-radius: 999px; padding: 7px 34px 7px 16px; min-width: 140px; max-width: 176px; text-overflow: ellipsis; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 53%, calc(100% - 14px) 53%; background-size: 5px 5px; background-repeat: no-repeat; background-color: var(--glass); }
select option { background: var(--solid); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select:hover, input:hover, textarea:hover { border-color: rgba(255,255,255,.24); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--edge-hi); box-shadow: 0 0 0 4px rgba(168,151,238,.1), 0 0 22px var(--halo-soft); }
#langSelect { min-width: 0; max-width: 170px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input[type=file] { color: var(--muted); font-size: 13.5px; }
input[type=file]::file-selector-button { font: 500 13px var(--sans); color: var(--ink); background: var(--glass-2); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; margin-right: 12px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--amethyst); }
label.small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

/* ---------- Pills ---------- */
.btn { font: 500 13.5px/1.2 var(--sans); letter-spacing: .01em; color: var(--ink); cursor: pointer; border-radius: 999px; padding: 9px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .25s, box-shadow .3s, background .25s, transform .1s; }
.btn:hover { border-color: var(--edge-hi); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 22px var(--halo); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tool:focus-visible, .tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(168,151,238,.25), 0 0 22px var(--halo); }
.btn.primary { border-color: rgba(214,204,252,.5); background: linear-gradient(140deg, rgba(168,151,238,.34), rgba(135,168,232,.2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 24px var(--halo-soft); }
.btn.primary:hover { border-color: rgba(224,216,255,.75); box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 0 30px rgba(168,151,238,.45); }
.btn.small { padding: 5px 13px; font-size: 12.5px; }
.btn.quiet { border-color: transparent; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--muted); font-weight: 400; }
.btn.quiet:hover { color: var(--ink); border-color: var(--line); background: var(--glass); box-shadow: 0 0 14px var(--halo-soft); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .35; cursor: default; box-shadow: none; border-color: var(--line); }
a.btn { display: inline-block; text-decoration: none; }
.linkish { background: none; border: 0; padding: 0; color: #c9bdf6; text-decoration: underline; text-decoration-color: rgba(201,189,246,.35); text-underline-offset: 3px; cursor: pointer; font: inherit; }
a { color: #c9bdf6; text-underline-offset: 3px; }
code { background: var(--glass-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.problem { color: var(--danger); }

/* ---------- Clarity ---------- */
.clarity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.clarity .bar { flex: none; width: 64px; min-width: 0; height: 4px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.clarity .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--amethyst), var(--sapphire), var(--jade), var(--citrine)); box-shadow: 0 0 10px rgba(168,151,238,.6); transition: width .8s ease; }
.clarity .num { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); white-space: nowrap; letter-spacing: .01em; }

/* ---------- Layout ---------- */
main { position: relative; padding: 28px 32px 40px; overflow: auto; }
aside { border-left: 1px solid var(--line); background: rgba(12,10,22,.28); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); padding: 26px 28px 40px; overflow: auto; }
aside h2 { font: 500 10.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin: 28px 0 14px; }
aside h2:first-of-type { margin-top: 8px; }

.empty { max-width: 560px; margin: 12vh auto 0; text-align: center; }
.empty h1 { font: 600 40px/1.15 var(--serif); margin: 0 0 14px; letter-spacing: -.005em; }
.empty p { color: var(--soft); font-size: 16px; line-height: 1.7; margin: 0 0 26px; }

/* ---------- Map view ---------- */
.strata { position: relative; display: grid; gap: 18px; }
.stratum { display: grid; grid-template-columns: 150px 1fr; gap: 20px; background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 20px 22px;
  box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.stratum .label { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 2px 0 2px 14px; border-left: 1px solid var(--c); }
.stratum .label b { font: 600 21px/1.2 var(--serif); }
.stratum .label span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.stratum .label .btn { margin-top: 10px; margin-left: -12px; white-space: nowrap; }
.stratum .cards { display: flex; flex-wrap: wrap; gap: 14px; align-content: flex-start; min-height: 56px; }
.stratum .cards > p { margin: 6px 0; }
.stratum[data-h=depth] { --c: var(--depth); } .stratum[data-h=vision] { --c: var(--vision); }
.stratum[data-h=path] { --c: var(--path); } .stratum[data-h=hands] { --c: var(--hands); } .stratum[data-h=ground] { --c: var(--ground); }

/* ---------- Cards ---------- */
.card { position: relative; width: 264px; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px 12px;
  border-top: 1px solid color-mix(in srgb, var(--c, var(--amethyst)) 45%, transparent); transition: box-shadow .3s, border-color .3s; }
.card:hover { box-shadow: 0 0 28px -10px var(--c, var(--amethyst)); }
.card.offered { border-style: dashed; background: rgba(255,255,255,.018); }
.card.offered .text { color: var(--soft); }
.card.kept { background: color-mix(in srgb, var(--c, var(--amethyst)) 9%, rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.card.picking { outline: 1px solid var(--edge-hi); outline-offset: 4px; cursor: crosshair; box-shadow: 0 0 24px var(--halo); }
.card .tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.tag { font: 500 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--faint); }
.tag.kind { color: var(--c, var(--amethyst)); }
.tag.cluster { background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 1px 9px; border-radius: 99px; text-transform: none; letter-spacing: .01em; font-size: 11px; color: var(--muted); }
.tag.state { margin-left: auto; }
.card .text { margin: 0; font-size: 15px; line-height: 1.5; }
.card .text[contenteditable=true] { outline: 1px dashed var(--edge-hi); border-radius: 8px; padding: 2px 6px; }
.card .acts { display: flex; gap: 4px; margin: 14px -8px 0; flex-wrap: wrap; opacity: .55; transition: opacity .2s; }
.card:hover .acts, .card:focus-within .acts { opacity: 1; }
.card .more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13.5px; }
.card .more blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 1px solid var(--c, var(--amethyst)); color: var(--soft); font: 400 16.5px/1.5 var(--serif); }
.card .more .src { color: var(--faint); font: 400 11.5px/1.4 var(--sans); margin-top: 4px; letter-spacing: .02em; }
.card .more .small { line-height: 1.8; }
.card .blankmark { position: absolute; top: -9px; right: 14px; background: var(--citrine); color: #1c160a; font: 600 10.5px/17px var(--sans); border-radius: 99px; padding: 0 8px; box-shadow: 0 0 12px rgba(225,192,124,.45); }
.card.frag { cursor: pointer; --c: var(--ground); }
.card.frag .name { font-weight: 500; margin: 0; word-break: break-word; line-height: 1.45; }
.card.frag .problem { margin: 8px 0 0; }
.card.frag.failed { border-color: rgba(235,154,143,.5); }
.card.add { background: rgba(255,255,255,.018); border: 1px dashed var(--edge); width: 100%; max-width: 580px; padding: 20px 22px 18px; }
.card.add > b { font: 600 19px var(--serif); margin-right: 6px; }
.card.add.over { background: rgba(168,151,238,.1); border-color: var(--edge-hi); box-shadow: 0 0 30px var(--halo); }
.card.add .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.card.add textarea { margin-top: 14px; }
.vision-card { width: 100%; max-width: 780px; --c: var(--vision); padding: 20px 24px 14px; }
.vision-card p.text { margin: 0 0 14px; font: 400 19px/1.55 var(--serif); color: var(--ink); }
.vision-card .line { display: flex; gap: 12px; align-items: baseline; }
.vision-card .line .n { color: var(--faint); font-size: 11px; min-width: 14px; font-variant-numeric: tabular-nums; }
.vision-card .line .wish { color: var(--citrine); font: 500 10px var(--sans); text-transform: uppercase; letter-spacing: .12em; margin-left: 4px; }

svg.threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
svg.threads path { fill: none; stroke-width: 1.2; opacity: .55; }
svg.threads path.offered { stroke-dasharray: 4 5; opacity: .35; }
svg.threads path.hi { stroke-width: 2; opacity: .95; }

/* ---------- Questions ---------- */
.blank { border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px 14px; margin-bottom: 16px; background: var(--glass); }
.blank .kind { font: 500 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--citrine); }
.blank .on { font-size: 12.5px; color: var(--faint); margin-top: 4px; line-height: 1.45; }
.blank .q { margin: 10px 0 14px; font: 400 19.5px/1.4 var(--serif); color: var(--ink); }
.blank .offer { margin: 0 0 12px; padding: 10px 14px; border-left: 1px dashed var(--citrine); background: rgba(225,192,124,.06); border-radius: 0 14px 14px 0; font-size: 14px; line-height: 1.5; color: var(--soft); }
.blank .offer .btn { margin-top: 8px; }
.blank textarea { min-height: 64px; }
.blank .acts { display: flex; gap: 6px; margin-top: 10px; }
.side-note { color: var(--faint); font-size: 12.5px; line-height: 1.55; margin: -6px 0 18px; }
.blank.answered { opacity: .82; }
.blank .answer { font-size: 14px; line-height: 1.55; background: rgba(124,199,169,.08); border: 1px solid rgba(124,199,169,.2); padding: 10px 14px; border-radius: 14px; }

/* ---------- Connect, status, dialogs, login ---------- */
.connect { max-width: 720px; margin: 0 auto 26px; background: var(--glass); border: 1px solid var(--edge); border-radius: 26px; padding: 22px 26px; box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.connect h2 { margin: 0 0 8px; font: 600 24px var(--serif); }
.connect p { margin: 0; line-height: 1.6; }
.connect .row { display: flex; gap: 10px; margin-top: 16px; } .connect input { flex: 1; }

.status { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); color: var(--ink); font-size: 14px; padding: 11px 22px; border-radius: 999px; max-width: 80vw; z-index: 20;
  background: rgba(20,17,34,.8); border: 1px solid var(--edge-hi); box-shadow: 0 0 30px var(--halo-soft), 0 12px 40px rgba(0,0,0,.4); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.status.bad { border-color: rgba(235,154,143,.6); box-shadow: 0 0 30px rgba(235,154,143,.22); }
dialog { color: var(--ink); background: rgba(19,16,32,.84); border: 1px solid var(--edge); border-radius: 30px; padding: 30px 32px 26px; max-width: 580px; width: calc(100vw - 40px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 40px 100px rgba(0,0,0,.55), 0 0 50px var(--halo-soft); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
dialog::backdrop { background: rgba(6,5,12,.5); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 10px; font: 600 28px/1.2 var(--serif); }
dialog p { line-height: 1.65; }
dialog input[type=text], dialog select, dialog textarea { margin-top: 6px; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
dialog pre { white-space: pre-wrap; max-height: 50vh; overflow: auto; background: rgba(255,255,255,.035); border: 1px solid var(--line); padding: 16px 18px; border-radius: 18px; font: 13px/1.6 ui-monospace, Menlo, monospace; color: var(--soft); }
dialog img { border-radius: 16px; }
.login main.card { width: auto; max-width: 420px; margin: 16vh auto; background: var(--glass); border: 1px solid var(--edge); border-radius: 30px; padding: 36px 34px 32px; text-align: center; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 0 60px var(--halo-soft); }
.login main.card h1 { font: 600 34px var(--serif); margin: 16px 0 6px; }
.login main.card p { color: var(--muted); margin: 0 0 22px; }
.login main.card img { filter: drop-shadow(0 0 16px rgba(168,151,238,.45)); }
.login form { display: flex; gap: 10px; justify-content: center; }
.login button { font: 500 13.5px var(--sans); color: var(--ink); border-radius: 999px; padding: 9px 20px; border: 1px solid rgba(214,204,252,.5); background: linear-gradient(140deg, rgba(168,151,238,.34), rgba(135,168,232,.2)); box-shadow: 0 0 24px var(--halo-soft); cursor: pointer; }

/* ---------- Views ---------- */
.views { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--edge); border-radius: 999px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.views button { font: 500 13px var(--sans); border: 1px solid transparent; background: transparent; color: var(--muted); padding: 5px 15px; border-radius: 999px; cursor: pointer; transition: all .25s; }
.views button:hover { color: var(--ink); }
.views button.on { color: var(--ink); border-color: rgba(214,204,252,.4); background: linear-gradient(140deg, rgba(168,151,238,.28), rgba(135,168,232,.16)); box-shadow: 0 0 18px var(--halo-soft); }

/* ---------- The crystal view ---------- */
main.crystal-main { padding: 24px 28px 32px; }
.stage { position: relative; height: calc(100vh - 132px); min-height: 560px; border-radius: 34px; overflow: hidden; color: var(--ink);
  background: radial-gradient(circle at 50% 50%, rgba(80,64,140,.26) 0%, rgba(22,18,38,.36) 42%, rgba(7,6,12,.55) 100%);
  border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 0 110px rgba(168,151,238,.08), 0 30px 80px rgba(0,0,0,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* Inside the stone: fine facet planes, lit from the centre. */
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from 30deg at 50% 50%, rgba(255,255,255,.028) 0 4%, transparent 4% 16.6%, rgba(255,255,255,.02) 16.6% 20%, transparent 20% 33.3%,
    rgba(255,255,255,.028) 33.3% 37%, transparent 37% 50%, rgba(255,255,255,.016) 50% 54%, transparent 54% 66.6%, rgba(255,255,255,.024) 66.6% 70%, transparent 70% 83.3%, rgba(255,255,255,.02) 83.3% 87%, transparent 87%);
  mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 72%); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 72%); }
.crystal-svg { display: block; }
.crystal-svg .ring { fill: none; stroke: rgba(255,255,255,.055); stroke-dasharray: 1 7; }
.crystal-svg .backlight { opacity: .55; transform-box: fill-box; transform-origin: center; transition: opacity 1.2s ease; }
.crystal-svg .incoming { opacity: .7; }
.crystal-svg .ground-label { fill: var(--faint); font: 500 10.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.crystal-svg .ground-label:hover { fill: var(--ink); }
.crystal-svg .haze .beam { opacity: .4; pointer-events: none; }
.crystal-svg .beam { opacity: .5; cursor: pointer; transition: opacity .6s; mix-blend-mode: screen; }
.crystal-svg .beam.lit { opacity: .95; }
.crystal-svg .beam.dim, .crystal-svg .ray-label.dim, .crystal-svg .blank-mark.dim { opacity: .12; }
.crystal-svg .dot-words { font: 400 12.5px var(--sans); fill: var(--soft); cursor: pointer; paint-order: stroke; stroke: rgba(9,8,15,.8); stroke-width: 4px; stroke-linejoin: round; }
.crystal-svg .ray-label { font: 500 10.5px var(--sans); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; transition: opacity .6s; }
.crystal-svg .ray-label:hover { filter: brightness(1.2); }
.crystal-svg .blank-mark { cursor: pointer; transition: opacity .6s; }
.crystal-svg .blank-mark circle { fill: rgba(9,8,15,.7); stroke-width: 1; stroke-opacity: .7; }
.crystal-svg .blank-mark text { font: 400 13px var(--serif); }
.crystal-svg .thread { fill: none; stroke-width: 1; opacity: .14; transition: opacity .3s, stroke-width .3s; }
.crystal-svg .thread.offered { stroke-dasharray: 1 5; stroke-linecap: round; }
.crystal-svg .thread.hi { opacity: .9; stroke-width: 1.8; }
.crystal-svg .crossing { fill: none; stroke: #f2eff8; stroke-width: 1.5; stroke-dasharray: 2 6; opacity: .85; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.crystal-svg .dot { cursor: pointer; transition: opacity .6s; }
.crystal-svg .dot > * { fill: var(--c); stroke: rgba(9,8,15,.85); stroke-width: 1.5; transition: transform .25s; transform-box: fill-box; transform-origin: center; }
.crystal-svg .dot.offered > * { fill: color-mix(in srgb, var(--c) 16%, rgba(9,8,15,.85)); stroke: var(--c); stroke-width: 1.1; stroke-opacity: .75; }
.crystal-svg .dot.yours > * { stroke: #f2eff8; stroke-width: 1.8; }
.crystal-svg .dot:hover > *, .crystal-svg .dot.focus > * { transform: scale(1.4); }
.crystal-svg .dot.focus > *, .crystal-svg .dot.held > * { stroke: #f2eff8; stroke-width: 2; stroke-dasharray: none; }
.crystal-svg .dot.dim { opacity: .16; }
.crystal-svg .dot.pick > * { animation: pickme 1.1s ease-in-out infinite; }
@keyframes pickme { 50% { transform: scale(1.3); } }
.crystal-svg .crystal { cursor: pointer; }
.crystal-svg .cf { transform-box: fill-box; transform-origin: center; }
.crystal-svg .cc { fill: #f2eff8; }
.crystal-svg .clines { fill: none; stroke: #0e0c18; stroke-width: 2.2; stroke-linejoin: round; }
.stage-tools { position: absolute; top: 22px; left: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.stage .tool { font: 500 13px var(--sans); color: var(--ink); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .25s, box-shadow .3s; }
.stage .tool:hover { border-color: var(--edge-hi); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 22px var(--halo); }
.stage-legend { position: absolute; right: 24px; bottom: 22px; text-align: right; font-size: 11.5px; line-height: 1.75; color: var(--faint); pointer-events: none; letter-spacing: .01em; }
.stage-legend span { color: rgba(225,220,240,.26); }
.stage-empty { position: absolute; left: 50%; top: calc(50% + 86px); transform: translateX(-50%); text-align: center; }
.stage-empty p { color: var(--soft); font: 400 24px var(--serif); margin: 0 0 18px; text-shadow: 0 0 22px rgba(168,151,238,.4); }
.mote-tip { position: absolute; max-width: 280px; background: rgba(18,15,30,.86); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--ink);
  border: 1px solid var(--line); border-left: 2px solid var(--amethyst); border-radius: 14px; padding: 11px 14px; font: 400 15.5px/1.45 var(--serif); pointer-events: none; box-shadow: 0 14px 40px rgba(0,0,0,.45); z-index: 3; }
.mote-tip .tk { display: block; font: 500 9.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }

/* ---------- Side panel in the crystal view ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 24px; }
.tabs .tab { font: 500 13px var(--sans); background: none; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; color: var(--muted); padding: 8px 12px 13px; cursor: pointer; transition: color .2s, border-color .2s; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.on { color: var(--ink); border-bottom-color: var(--amethyst); }
.tabs .tab i { font-style: normal; font-size: 10.5px; background: rgba(168,151,238,.16); color: #d8cffb; border-radius: 99px; padding: 1px 7px; margin-left: 5px; }
.back { margin: 0 0 16px; font-size: 13px; }
#side .card { width: 100%; }
#side .vision-card, #side .card.add { max-width: none; }
#side .vision-card { margin-bottom: 16px; }
.side-ground { display: grid; gap: 14px; }
.ray-head { display: flex; align-items: center; gap: 12px; font: 600 28px/1.2 var(--serif); text-transform: capitalize; margin-bottom: 8px; }
.ray-head .swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 16px var(--c); }
#side h3 { font: 500 10.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin: 26px 0 10px; }
.ray-row { display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; font: 400 14.5px/1.5 var(--sans); background: none; border: 0; border-radius: 12px; padding: 8px 10px; margin: 0 -10px; cursor: pointer; color: var(--ink); transition: background .2s; }
.ray-row:hover { background: var(--glass-2); }
.dotmini { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); transform: translateY(-1px); box-shadow: 0 0 8px var(--c); }
.dotmini.offered { background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid var(--c); box-shadow: none; }
.cross { display: grid; gap: 6px; }
.cross p { margin: 0; }
.cross .cross-a, .cross .cross-b { font: 400 22px/1.4 var(--serif); }
.cross .cross-and { color: var(--faint); font: 500 10.5px var(--sans); text-transform: uppercase; letter-spacing: .2em; margin: 6px 0; }
.cross .q { margin-top: 22px; color: var(--soft); }
.cross textarea { min-height: 130px; margin-top: 8px; }
.cross .acts { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- The crystal at work ---------- */
@keyframes lit { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes beams { 0%, 100% { opacity: .5; } 50% { opacity: .9; } }
@keyframes backlight { 0%, 100% { opacity: .6; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
body.working .brand .mark .f0, body.working .crystal-svg .cf0 { animation: lit 1.8s ease-in-out 0s infinite; }
body.working .brand .mark .f1, body.working .crystal-svg .cf1 { animation: lit 1.8s ease-in-out .3s infinite; }
body.working .brand .mark .f2, body.working .crystal-svg .cf2 { animation: lit 1.8s ease-in-out .6s infinite; }
body.working .brand .mark .f3, body.working .crystal-svg .cf3 { animation: lit 1.8s ease-in-out .9s infinite; }
body.working .brand .mark .f4, body.working .crystal-svg .cf4 { animation: lit 1.8s ease-in-out 1.2s infinite; }
body.working .brand .mark .f5, body.working .crystal-svg .cf5 { animation: lit 1.8s ease-in-out 1.5s infinite; }
body.working .crystal-svg .backlight { animation: breathe 2.8s ease-in-out infinite; }
body.working .crystal-svg .beam { animation: beams 2.8s ease-in-out infinite; }
body.working .stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(168,151,238,.14), transparent 62%); animation: breathe 2.8s ease-in-out infinite; }
body.working::after { animation: backlight 2.8s ease-in-out infinite; }
body.working .brand .mark { filter: drop-shadow(0 0 16px rgba(190,176,245,.8)); }
@media (prefers-reduced-motion: reduce) {
  body.working *, body.working::after { animation: none !important; }
  .crystal-svg .crossing { animation: none; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  :root { --side: 340px; }
  header.top { padding: 16px 22px; }
  main { padding: 22px 22px 32px; }
}
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1px auto auto; }
  header.top { padding: 14px 16px; gap: 12px 14px; }
  .top-actions { margin-left: 0; }
  main, main.crystal-main { padding: 16px; }
  aside { border-left: 0; border-top: 1px solid var(--line); padding: 22px 16px 32px; }
  .stratum { grid-template-columns: 1fr; padding: 18px; }
  .card { width: 100%; }
  .clarity { min-width: 180px; }
  select { min-width: 0; }
  .stage { height: 78vh; min-height: 440px; border-radius: 26px; }
  .stage-legend { display: none; }
}

/* ---------- Left to right: the rough, the crystal, the cuts and the light ---------- */
:root { --rough: 312px; }
body { grid-template-columns: var(--rough) 1fr var(--side); }
body.no-print { grid-template-columns: 1fr; }
body.no-print main { grid-column: 1 / -1; }
body.no-print #rough, body.no-print #side { display: none; }
/* The raw stones live in a box: dark felt inside a frame of real wood, so each piece rests in its own place. */
#rough { border: 11px solid transparent; padding: 20px 12px 30px; overflow: auto;
  border-image-source: var(--frame); border-image-slice: 33; border-image-width: 11px; border-image-repeat: stretch;
  background: var(--fuzz) padding-box, radial-gradient(ellipse 130% 55% at 50% 0%, #261b2f, #160f1c 72%) padding-box;
  background-size: 160px 160px, auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), inset 0 14px 26px rgba(0,0,0,.6), inset 6px 0 14px rgba(0,0,0,.35), inset 0 -6px 16px rgba(0,0,0,.3); }
.panel-head { margin: 0 0 18px; }
.panel-title { font: 600 27px/1.15 var(--serif) !important; margin: 0 0 4px !important; letter-spacing: -.005em !important; text-transform: none !important; color: var(--ink) !important; }
.panel-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
/* Folding the raw stones away (app.js, foldStones) */
.stones-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fold-btn { all: unset; flex: none; box-sizing: border-box; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; line-height: 1; color: var(--faint); border: 1px solid var(--line); cursor: pointer; transition: color .2s, border-color .2s, box-shadow .2s; }
.fold-btn:hover, .fold-btn:focus-visible { color: var(--ink); border-color: var(--edge-hi); box-shadow: 0 0 12px var(--halo-soft); }
body.stones-folded #rough { padding: 0; overflow: hidden; border: 0; border-image: none;
  background: var(--lid) center top / 100% auto repeat-y;
  box-shadow: inset 0 0 0 1px rgba(255,214,170,.1), inset -3px 0 8px rgba(0,0,0,.4); }
.stones-strip { all: unset; box-sizing: border-box; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.stones-strip { color: rgba(255,238,215,.65); }
.stones-strip:hover, .stones-strip:focus-visible, .stones-strip.over { background: rgba(255,230,200,.07); color: #fff6ea; }
.stones-strip.over { box-shadow: inset 0 0 30px var(--halo); }
.strip-chev { font-size: 18px; line-height: 1; }
.strip-label { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 10.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .2em; color: rgba(255,238,215,.62); text-shadow: 0 -1px 0 rgba(0,0,0,.75), 0 1px 0 rgba(255,230,200,.12); }
.stones-strip:hover .strip-label { color: rgba(255,240,222,.85); }
.strip-count { min-width: 26px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 3px; display: grid; place-items: center; font: 700 11px var(--sans); color: #2a1c0c;
  background: linear-gradient(160deg, #e2c48c, #b08b4f 55%, #8c6a36); box-shadow: inset 0 1px 0 rgba(255,245,215,.6), 0 1px 2px rgba(0,0,0,.55); }
.strip-wait { width: 7px; height: 7px; border-radius: 50%; background: var(--edge-hi); box-shadow: 0 0 8px var(--halo); }
.panel-h { font: 500 10.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin: 30px 0 12px; }
.panel-h i { font-style: normal; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.waiting { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); margin: -2px 0 12px; }
.waiting .btn { flex: none; white-space: nowrap; }
.intake { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.02); transition: border-color .3s, box-shadow .3s, background .3s; }
.intake.over { border-color: var(--edge-hi); background: rgba(168,151,238,.08); box-shadow: 0 0 34px var(--halo); }
.drop { display: grid; justify-items: center; gap: 8px; padding: 18px 12px 16px; border: 1px dashed var(--edge); border-radius: 16px; text-align: center; color: var(--soft); font-size: 13.5px; }
.drop .hint { color: var(--faint); font-size: 11.5px; }
.drop label.btn { display: inline-block; }
.link-row, .note-row { display: flex; gap: 8px; align-items: center; }
.link-row input, .note-row input[type=text] { flex: 1; min-width: 0; width: 0; padding: 7px 12px; font-size: 13.5px; }
.intake textarea { min-height: 76px; font-size: 13.5px; }
.add-row { display: flex; justify-content: flex-end; }
.intake #noteInput { padding: 7px 12px; font-size: 13.5px; }
.frags, .returns { display: grid; gap: 6px; }
.frag-row { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 6px 10px 6px 8px; border-radius: 12px; cursor: pointer; transition: background .2s;
  background: rgba(0,0,0,.22); box-shadow: inset 0 2px 6px rgba(0,0,0,.55), inset 0 -1px 0 rgba(255,255,255,.03); }
.frag-row:hover { background: rgba(255,255,255,.045); }
.frags { gap: 4px; }
.frag-row .fname { font-size: 13.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.frag-row .fname .problem { display: block; font-size: 11.5px; }
.frag-row .fname .kind { display: block; font-size: 11px; color: var(--faint); }
.raw-stone { display: block; width: 38px; height: 38px; overflow: visible; }
.raw-stone .glint { fill: #fff; opacity: .85; }
.wood-pick { display: flex; align-items: center; gap: 9px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); font: 500 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.wood-pick span { margin-right: auto; }
.wood { all: unset; width: 22px; height: 22px; border-radius: 50%; background-size: cover; background-position: center; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.5); transition: box-shadow .2s; }
.wood:hover, .wood:focus-visible { box-shadow: 0 0 0 2px #160f1c, 0 0 0 3.5px rgba(214,204,252,.4); }
.wood.on { box-shadow: 0 0 0 2px #160f1c, 0 0 0 3.5px rgba(214,204,252,.75); }
.frag-row .facts { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(20,17,34,.92); border: 1px solid var(--line); }
.frag-row:hover .facts, .frag-row:focus-within .facts { display: flex; }
.return-row { display: grid; gap: 4px; padding: 10px 12px; border-left: 1px solid rgba(124,199,169,.45); border-radius: 0 12px 12px 0; background: rgba(124,199,169,.05); }
.return-row .rq { color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.return-row .ra { font: 400 15.5px/1.45 var(--serif); color: var(--soft); }
.return-row.fresh { animation: arrive 2.2s ease-out; }
@keyframes arrive { 0% { background: rgba(124,199,169,.35); box-shadow: 0 0 30px rgba(124,199,169,.5); } 100% { background: rgba(124,199,169,.05); box-shadow: none; } }
.side-note { color: var(--faint); font-size: 12.5px; line-height: 1.55; margin: -4px 0 18px; }
#side .side-note + h2 { margin-top: 8px; }

/* The living stone */
.crystal-svg .stone { cursor: pointer; }
.crystal-svg .stone .sf { transform-box: fill-box; transform-origin: center; }
.crystal-svg .stone .glint { animation: glint 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glint { 0%, 70%, 100% { opacity: .95; transform: scale(1); } 80% { opacity: .5; transform: scale(.6); } 88% { opacity: 1; transform: scale(1.25); } }
.crystal-svg .stone.just-cut { animation: cutflash 1.5s ease-out; }
@keyframes cutflash { 0% { filter: brightness(1.9) drop-shadow(0 0 22px rgba(255,255,255,.9)); } 100% { filter: none; } }
.crystal-svg .returning { fill: none; stroke: rgba(124,199,169,.85); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 2 900; animation: returning 2s ease-in forwards; filter: drop-shadow(0 0 6px rgba(124,199,169,.9)); }
@keyframes returning { 0% { stroke-dasharray: 0 2000; stroke-dashoffset: 0; opacity: 0; } 15% { opacity: 1; } 100% { stroke-dasharray: 180 2000; stroke-dashoffset: -1800; opacity: 0; } }
.crystal-svg .ring { fill: none; stroke: rgba(255,255,255,.05); stroke-dasharray: 1 7; }
.crystal-svg .ray-label { text-anchor: start; }
.stage-empty { top: calc(50% + 92px); }
.stage-empty .small-note { font: 400 13px var(--sans) !important; color: var(--faint) !important; text-shadow: none !important; margin-top: -8px !important; }
body.working .crystal-svg .stone .sf0 { animation: lit 1.8s ease-in-out 0s infinite; }
body.working .crystal-svg .stone .sf1 { animation: lit 1.8s ease-in-out .3s infinite; }
body.working .crystal-svg .stone .sf2 { animation: lit 1.8s ease-in-out .6s infinite; }
body.working .crystal-svg .stone .sf3 { animation: lit 1.8s ease-in-out .9s infinite; }
body.working .crystal-svg .stone .sf4 { animation: lit 1.8s ease-in-out 1.2s infinite; }
body.working .crystal-svg .stone .sf5 { animation: lit 1.8s ease-in-out 1.5s infinite; }
body.working .crystal-svg .stone .rough { animation: lit 2.6s ease-in-out infinite; }
@keyframes markglow { 50% { filter: drop-shadow(0 0 18px rgba(214,204,252,.95)); } }
body.working .brand .mark { animation: markglow 2s ease-in-out infinite; }
.brand .mark { width: 32px; height: 32px; }
@media (prefers-reduced-motion: reduce) { .crystal-svg .stone .glint, .crystal-svg .returning, .crystal-svg .stone.just-cut, .return-row.fresh { animation: none; } }

@media (max-width: 1280px) { :root { --rough: 280px; --side: 340px; } #rough { padding: 22px 18px 32px; } }
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1px auto auto auto; }
  body.no-print { grid-template-columns: 1fr; }
  #rough { border-width: 8px; border-image-width: 8px; padding: 18px 12px 24px; }
  .stones-strip { flex-direction: row; padding: 12px 18px; }
  .strip-label { writing-mode: horizontal-tb; transform: none; }
}

.stage-legend { right: auto; left: 24px; text-align: left; }

.cross .cross-theme { font: 500 10px var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin: 8px 0 -2px; }
.cross .side-note { margin: 0 0 12px; }
.cross textarea + .side-note { margin-top: 10px; }

/* ---------- Suggestions and models ---------- */
.cross .suggest { margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cross .suggest > .btn { justify-self: start; margin-left: -10px; }
.cross .cost-hint { color: var(--faint); font-size: 11.5px; margin-top: -6px; }
.cross .asking { animation: lit 1.8s ease-in-out infinite; }
.offers-head { color: var(--faint); font-size: 12px; margin: 0 0 2px; }
.offer-card { display: grid; gap: 4px; text-align: left; font: 400 16px/1.45 var(--serif); color: var(--soft); background: rgba(255,255,255,.025); border: 1px dashed var(--edge); border-radius: 16px; padding: 12px 14px; cursor: pointer; transition: border-color .25s, box-shadow .3s, background .25s; }
.offer-card:hover { border-color: var(--edge-hi); background: rgba(168,151,238,.07); box-shadow: 0 0 22px var(--halo-soft); color: var(--ink); }
.offer-card .ok { font: 500 9.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--amethyst); }
.offer-card .use { font: 500 11.5px var(--sans); color: var(--faint); justify-self: end; }
.offer-card:hover .use { color: #c9bdf6; }
.from-offer { color: var(--amethyst); font-size: 12px; margin: -2px 0 0; }
.cost-pill { font: 500 12.5px var(--sans); color: var(--faint); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; transition: all .25s; }
.cost-pill span { color: var(--muted); }
.cost-pill:hover { color: var(--ink); border-color: var(--line); background: var(--glass); box-shadow: 0 0 14px var(--halo-soft); }
.models { display: grid; gap: 16px; margin: 18px 0 6px; }
.model-row { display: grid; grid-template-columns: 1fr 230px; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.model-row b { font: 600 18px var(--serif); }
.model-row p { margin: 2px 0 0; }
.model-row select { max-width: none; min-width: 0; width: 100%; }
.spent { color: var(--faint); margin: 14px 0 0; }
dialog:has(.models) { max-width: 680px; }
@media (max-width: 640px) { .model-row { grid-template-columns: 1fr; } }

/* ---------- How it works ---------- */
.btn.round { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; font: 500 15px var(--serif); }
.guide { text-align: left; }
.guide-lead { font: 400 19px/1.5 var(--serif); color: var(--soft); margin: 0 0 22px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.guide-steps .gn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--serif); color: var(--ink);
  border: 1px solid rgba(214,204,252,.45); background: linear-gradient(140deg, rgba(168,151,238,.28), rgba(135,168,232,.14)); box-shadow: 0 0 14px var(--halo-soft); }
.guide-steps b { font: 600 18px/1.3 var(--serif); }
.guide-steps p { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.guide-foot { margin: 22px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.empty .guide { max-width: 560px; margin: 0 auto 28px; }
dialog:has(.guide) { max-width: 620px; }

/* ---------- The master cutter ---------- */
.tabs .tab { position: relative; }
.tabs .calling { position: absolute; top: 7px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #d9cffc; box-shadow: 0 0 10px 2px rgba(190,176,245,.8); animation: calling 3.2s ease-in-out infinite; }
@keyframes calling { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.master-head { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 18px; }
.master-head b { font: 600 22px/1.2 var(--serif); }
.master-head p { margin: 4px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.master-mark { flex: none; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f2eff8, #a897ee 45%, rgba(168,151,238,.1) 72%); box-shadow: 0 0 18px rgba(168,151,238,.55); }
body.working .master-mark { animation: breathe 2.8s ease-in-out infinite; }
.m-talk { display: grid; gap: 14px; max-height: calc(100vh - 430px); min-height: 60px; overflow: auto; padding: 2px 2px 6px; }
.m-turn .m-text p { margin: 0 0 10px; }
.m-turn .m-text p:last-child { margin-bottom: 0; }
.m-turn.master .m-text { font: 400 17px/1.55 var(--serif); color: var(--ink); }
.m-turn.you { justify-self: end; max-width: 88%; text-align: right; }
.m-turn.you .m-text { display: inline-block; text-align: left; font-size: 14px; line-height: 1.55; color: var(--soft); background: var(--glass-2); border: 1px solid var(--line); border-radius: 18px 18px 6px 18px; padding: 10px 14px; }
.m-keep { display: block; margin: 4px 4px 0 auto; font-size: 11.5px; color: var(--faint) !important; text-decoration: none !important; opacity: 0; transition: opacity .2s; }
.m-turn.you:hover .m-keep { opacity: 1; }
.m-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.m-considering { color: var(--muted); font: italic 400 16px var(--serif); animation: lit 2.2s ease-in-out infinite; }
.m-starts { display: grid; gap: 8px; margin: 4px 0 16px; }
.m-start { text-align: left; font: 400 16px/1.4 var(--serif); color: var(--soft); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; cursor: pointer; transition: border-color .25s, box-shadow .3s, color .2s; }
.m-start:hover { color: var(--ink); border-color: var(--edge-hi); box-shadow: 0 0 20px var(--halo-soft); }
.m-input { margin-top: 14px; display: grid; gap: 8px; }
.m-input textarea { min-height: 84px; }
.m-send { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.blank.beckoned { border-color: var(--edge-hi); box-shadow: 0 0 26px var(--halo); }

/* ---------- The entrance: the rough becomes the crystal (entrance.js, entrance.svg) ---------- */
.entrance { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; cursor: pointer; }
.entrance .e-bg { position: absolute; inset: 0; transition: opacity .9s ease;
  background: radial-gradient(ellipse 60% 50% at 50% 46%, rgba(168,151,238,.14), transparent 64%), linear-gradient(165deg, var(--gem-2) 0%, var(--gem-1) 46%, var(--gem-0) 100%); }
.entrance .e-art { position: relative; width: 176px; height: 176px; margin-top: -40px; transition: transform .9s cubic-bezier(.65, 0, .25, 1), opacity .3s ease; }
.entrance .e-art svg { width: 100%; height: 100%; overflow: visible; }
.entrance .e-caption { position: absolute; left: 0; right: 0; top: calc(50% + 92px); margin: 0; height: 32px; text-align: center; font: 400 24px var(--serif); color: var(--soft); text-shadow: 0 0 22px rgba(168,151,238,.4); transition: opacity .4s ease; }
.entrance .e-caption span { position: absolute; left: 0; right: 0; opacity: 0; }
body.entering .brand .mark { opacity: 0; }

/* Everything waits for .go (the drawing has arrived), then plays on one clock. */
.entrance .e-art svg * { animation-play-state: paused; }
.entrance.go .e-art svg * { animation-play-state: running; }
.entrance .e-rough { transform-box: fill-box; transform-origin: center; filter: brightness(.72) saturate(.7); animation: e-rough 2.4s ease both; }
.entrance .e-in { opacity: 0; animation: e-in 3s ease .2s both; }
.entrance .facet { opacity: 0; transform-box: fill-box; transform-origin: center; animation: e-cut .55s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--d) + var(--k, 0) * 45ms); }
.entrance .facet.table { --d: .85s; } .entrance .facet.star { --d: 1.1s; } .entrance .facet.kite { --d: 1.4s; } .entrance .facet.girdle { --d: 1.7s; }
.entrance .edges, .entrance .outline { opacity: 0; animation: e-fade 1s ease 1s both; }
.entrance .inner { opacity: 0; animation: e-fade .8s ease 2.2s both; }
.entrance .glint { opacity: 0; transform-box: fill-box; transform-origin: center; animation: e-glint 1.1s ease 2.35s both; }
.entrance .e-glow { opacity: 0; animation: e-glow 1.6s ease 2.1s both; }
.entrance .e-rays polygon { opacity: 0; transform-box: fill-box; transform-origin: left center; animation: e-ray .8s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(2.4s + var(--k) * 70ms); }
.entrance.go .e-caption span:nth-child(1) { animation: e-say 1.15s ease .15s both; }
.entrance.go .e-caption span:nth-child(2) { animation: e-say 1.15s ease 1.3s both; }
.entrance.go .e-caption span:nth-child(3) { animation: e-fade .7s ease 2.45s both; }

/* Leaving: the light and words fade, the room appears, the stone flies to the header and becomes the mark. */
.entrance.leaving { pointer-events: none; }
.entrance.leaving .e-bg { opacity: 0; }
.entrance.leaving .e-caption, .entrance.leaving .e-rays, .entrance.leaving .e-glow, .entrance.leaving .e-in, .entrance.leaving .e-rough { opacity: 0; transition: opacity .4s ease; }
.entrance.landed .e-art { opacity: 0; }

@keyframes e-rough { 0% { opacity: 0; transform: scale(.9); } 20% { opacity: 1; transform: scale(1); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06); } }
@keyframes e-in { 0% { opacity: 0; } 25% { opacity: .5; } 70% { opacity: 1; } 100% { opacity: .8; } }
@keyframes e-cut { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes e-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes e-glint { 0% { opacity: 0; transform: scale(.2) rotate(-30deg); } 45% { opacity: 1; transform: scale(1.5) rotate(0); } 100% { opacity: .95; transform: scale(1); } }
@keyframes e-glow { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: .65; } }
@keyframes e-ray { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes e-say { 0% { opacity: 0; transform: translateY(6px); } 25%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }

/* ---------- People: badges, the People window, sharing (online only) ---------- */
.who { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; margin-right: 6px; vertical-align: -4px;
  font: 600 9.5px/1 var(--sans); letter-spacing: .02em; color: #0e0c18; background: var(--c); box-shadow: 0 0 0 1.5px rgba(14,12,24,.9), 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.print-people { display: inline-flex; align-items: center; }
.print-people .who { width: 24px; height: 24px; font-size: 10.5px; margin-right: -5px; }
.print-people:not(:empty) { margin: 0 12px 0 4px; }
.me-btn { background: none; border: 0; padding: 0; cursor: pointer; display: inline-grid; place-items: center; }
.me-btn .who { width: 32px; height: 32px; font-size: 12.5px; margin: 0; }
.me-btn.shared { font: 500 12px var(--sans); color: var(--muted); border: 1px dashed var(--edge); border-radius: 999px; padding: 8px 12px; }
.me-btn.shared:hover { color: var(--ink); border-color: var(--edge-hi); }
.me-head { display: flex; align-items: center; gap: 14px; }
.me-head .who { width: 44px; height: 44px; font-size: 16px; margin: 0; }
.me-head h2 { margin: 0; }
#dialog .row.left { justify-content: flex-start; margin-top: 14px; }
.note { border-left: 2px solid var(--amethyst); padding: 4px 0 4px 12px; color: var(--soft); }
.people-list { display: grid; gap: 8px; margin: 16px 0; }
.person-row { display: flex; align-items: center; gap: 8px; }
.person-row .who { width: 30px; height: 30px; font-size: 11.5px; }
.person-row .pn { flex: 1; display: grid; }
.add-person { display: flex; gap: 8px; align-items: center; }
.add-person input { flex: 1; }
.code-show { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 14px 18px; border: 1px solid var(--edge); border-radius: 16px; background: rgba(255,255,255,.03); }
.code-show code { flex: 1; font: 500 22px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; color: var(--ink); user-select: all; }
.share-list { display: grid; gap: 10px; margin: 14px 0 4px; }
.share-row { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.share-row input { margin-right: 6px; }
.orphan { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
.orphan .tick { margin-left: 10px; white-space: nowrap; }
.answer .who, .ra .who, .m-text .who { width: 17px; height: 17px; font-size: 8.5px; vertical-align: -3px; }
.frag-row .who { width: 18px; height: 18px; font-size: 8.5px; }

/* ---------- Sliders between the panels (layout.js) ---------- */
.handle { display: none; }
@media (min-width: 901px) {
  body:not(.no-print) #rough { grid-area: 3 / 1; }
  body:not(.no-print) main { grid-area: 3 / 2; min-width: 0; }
  body:not(.no-print) #side { grid-area: 3 / 3; }
  body:not(.no-print) .handle { display: block; grid-row: 3; position: relative; z-index: 6; width: 14px; cursor: col-resize; touch-action: none; }
  .handle[data-edge="rough"] { grid-column: 1; justify-self: end; margin-right: -7px; }
  /* The box is as tall as the window and stays in view while the page scrolls; its stones scroll inside it. */
  body:not(.no-print) #rough { position: sticky; top: 0; align-self: start; height: calc(100vh - var(--top, 121px)); }
  .handle[data-edge="side"] { grid-column: 3; justify-self: start; margin-left: -7px; }
  body.stones-folded:not(.no-print) { grid-template-columns: 48px 1fr var(--side); }
  body.stones-folded .handle[data-edge="rough"] { display: none; }
  /* A hairline that brightens, and a small grip that stays in view while the page scrolls. */
  .handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 6.5px; width: 1px; background: transparent; transition: background .2s, box-shadow .2s; }
  .handle::after { content: ""; position: sticky; top: calc(50vh - 18px); display: block; margin: 0 auto; width: 4px; height: 36px; border-radius: 4px;
    background: rgba(214,204,252,.18); transition: background .2s, box-shadow .2s; }
  .handle:hover::before, .handle:focus-visible::before, body.resizing .handle::before { background: rgba(214,204,252,.45); box-shadow: 0 0 10px var(--halo-soft); }
  .handle:hover::after, .handle:focus-visible::after { background: rgba(214,204,252,.6); box-shadow: 0 0 12px var(--halo); }
  .handle:focus-visible { outline: none; }
  body.resizing { cursor: col-resize; user-select: none; }
  body.resizing * { transition: none !important; }
}

/* ---------- Where an answer goes, and what is new for Refract ---------- */
.blank .went { font-size: 12.5px; line-height: 1.5; color: var(--soft); margin: 8px 0 2px; }
.blank .went.muted { color: var(--faint); }
#refractBtn .new-count { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; background: rgba(214,204,252,.18); }
#refractBtn.ready { box-shadow: 0 0 0 1px var(--edge-hi), 0 0 26px var(--halo); animation: e-breathe 2.8s ease-in-out infinite; }
@keyframes e-breathe { 50% { box-shadow: 0 0 0 1px var(--edge-hi), 0 0 38px var(--halo); } }
@media (prefers-reduced-motion: reduce) { #refractBtn.ready { animation: none; } }

/* ---------- Toward a clearer vision: the next step, statement and story ---------- */
.next-step { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 14px 16px; margin: 0 0 20px;
  border: 1px solid var(--edge); border-radius: 18px; background: linear-gradient(140deg, rgba(168,151,238,.10), rgba(135,168,232,.04)); }
.next-step .ns-k { font: 600 10px/1.9 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--amethyst); }
.next-step p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.next-step .btn { grid-column: 2; justify-self: start; margin-top: 8px; }
.vision-head { display: grid; gap: 4px; margin-bottom: 14px; }
.vision-head .btn { justify-self: start; }
.vision-card .vk, dialog .vk { display: block; font: 500 10px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; }
dialog .vk { margin-top: 16px; }
.vision-card .statement { font: 500 21px/1.4 var(--serif); color: var(--ink); margin: 0 0 4px; text-shadow: 0 0 22px rgba(168,151,238,.25); }
.vision-card .sharpen { font-size: 12.5px; color: var(--soft); border-left: 2px solid var(--citrine); padding-left: 10px; margin: 10px 0; }
.stage-legend em { font-style: normal; color: var(--soft); opacity: .7; }

/* ---------- Illustrations, and notes for the crystal ---------- */
.vision-card .illus { font-size: 12.5px; line-height: 1.55; color: var(--soft); border-left: 2px solid var(--rose); padding-left: 10px; margin: 12px 0 6px; }
.vision-card .illus b { font-weight: 500; color: var(--ink); }
#side h3.notes-h { margin-top: 30px; }
.notes { display: grid; gap: 6px; margin: 10px 0; }
.note-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-left: 2px solid var(--amethyst); border-radius: 12px; background: rgba(255,255,255,.025); }
.note-row .nt { flex: 1; font-size: 13.5px; line-height: 1.45; }
.note-row .who { width: 17px; height: 17px; font-size: 8.5px; vertical-align: -3px; }
.note-add { display: flex; gap: 8px; align-items: center; }
.note-add input { flex: 1; }
.person-row .spend { display: grid; text-align: right; font-size: 12px; color: var(--soft); white-space: nowrap; margin-right: 6px; }
.person-row .spend i { font-style: normal; color: var(--faint); font-size: 11px; }
.spend-total { color: var(--soft); border-top: 1px solid var(--line); padding-top: 10px; }
.orphan .btn { justify-self: start; }

/* ---------- Speak instead of typing (listen.js): a microphone in every writing box ---------- */
.mic-wrap { position: relative; display: block; min-width: 0; flex: 1 1 auto; }
.mic-wrap > textarea { width: 100%; padding-right: 44px; }
.mic { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.mic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mic:hover, .mic:focus-visible { color: var(--ink); border-color: var(--edge-hi); outline: none; }
.mic.listening { color: #fff3ef; background: rgba(227,161,152,.24); border-color: rgba(227,161,152,.7); animation: mic-listen 1.6s ease-in-out infinite; }
.mic.writing { color: var(--amethyst); border-color: rgba(168,151,238,.5); animation: mic-write 1.1s ease-in-out infinite; cursor: progress; }
.mic.mic-trouble { color: var(--danger); }
@keyframes mic-listen { 50% { box-shadow: 0 0 0 6px rgba(227,161,152,.12), 0 0 18px rgba(227,161,152,.35); } }
@keyframes mic-write { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mic.listening, .mic.writing { animation: none; } }

/* ---------- The navigator (navigator.js): beside the work, never over it ---------- */
.nav-panel { position: fixed; padding: 0; margin: 0; min-height: 0; height: auto; right: 20px; bottom: 20px; z-index: 40; width: min(380px, calc(100vw - 40px)); max-height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column; border-radius: 22px; border: 1px solid var(--edge); background: rgba(20,17,31,.94);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 40px var(--halo-soft); overflow: hidden; }
.nav-panel[hidden] { display: none; }
.nav-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.nav-head b { display: block; font: 600 20px/1.2 var(--serif); }
.nav-head span { color: var(--muted); font-size: 12.5px; }
.nav-close { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); font-size: 18px; }
.nav-close:hover, .nav-close:focus-visible { color: var(--ink); background: rgba(255,255,255,.06); }
.nav-talk { flex: 1; overflow: auto; padding: 14px 18px; display: grid; gap: 8px; align-content: start; }
.nav-empty { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.nav-q { justify-self: end; max-width: 86%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: rgba(168,151,238,.16); font-size: 13.5px; line-height: 1.45; }
.nav-a { max-width: 94%; font-size: 13.5px; line-height: 1.55; color: var(--soft); margin-bottom: 6px; }
.nav-a b, .nav-b b { color: var(--ink); }
.nav-thinking { color: var(--faint); animation: mic-write 1.1s ease-in-out infinite; }
.nav-wait { font-size: 12px; color: var(--faint); margin: -4px 0 8px; }
.nav-b { padding: 9px 12px; border-left: 2px solid var(--jade); border-radius: 0 12px 12px 0; background: rgba(124,199,169,.07); font-size: 13.5px; line-height: 1.5; margin-bottom: 8px; }
.nav-b span { display: block; font: 500 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--jade); margin-bottom: 3px; }
.nav-b.fresh { animation: arrive 2.2s ease-out; }
.nav-ask { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 6px; border-top: 1px solid var(--line); }
.nav-ask .mic-wrap { flex: 1; }
.nav-ask textarea { min-height: 44px; max-height: 140px; font-size: 13.5px; resize: none; }
.nav-foot { display: flex; justify-content: space-between; gap: 10px; padding: 2px 18px 12px; font-size: 11.5px; color: var(--faint); }
.nav-foot .linkish { font-size: 11.5px; }
#guideBtn { position: relative; }
/* The navigator's compass: a slow glow, so it is found without asking for attention. */
.compass svg { width: 19px; height: 19px; display: block; }
.compass .ring { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .75; }
.compass .needle { fill: rgba(214,204,252,.35); }
.compass .north { fill: var(--amethyst); }
.compass .pin { fill: var(--ink); }
#guideBtn.compass { display: grid; place-items: center; color: #d6ccfc; animation: compass-glow 4.5s ease-in-out infinite; }
@keyframes compass-glow { 0%, 100% { box-shadow: 0 0 0 rgba(168,151,238,0); } 50% { box-shadow: 0 0 14px rgba(168,151,238,.45), inset 0 0 8px rgba(168,151,238,.18); border-color: rgba(214,204,252,.55); } }
@media (prefers-reduced-motion: reduce) { #guideBtn.compass { animation: none; } }
.export-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.export-choice:last-of-type { border-bottom: 0; }
.export-choice p { margin: 2px 0 0; }
.export-choice .btn { flex: none; }
#guideBtn.has-news::after { content: ""; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 10px var(--jade); }

/* Clarity, part by part (showClarity) */
.clarity-btn { all: unset; display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 999px; padding: 2px 6px; }
.clarity-btn:hover .num, .clarity-btn:focus-visible .num { color: var(--ink); }
.clarity-parts { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; }
.clarity-parts td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.clarity-parts td.n { text-align: right; white-space: nowrap; color: var(--soft); }
.clarity-parts .cbar { display: block; width: 90px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.clarity-parts .cbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amethyst), var(--sapphire)); }
.clarity-parts tr.sum td { border-bottom: 0; font-weight: 600; color: var(--ink); }

/* Spending, in the Models window (chooseModels) */
.spend-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spend-table td, .spend-table th { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.spend-table th { font: 500 10.5px/1.3 var(--sans); letter-spacing: .06em; color: var(--faint); vertical-align: bottom; }
.spend-table td.n, .spend-table th:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spend-table tr.sum td { border-bottom: 0; font-weight: 600; color: var(--ink); }
.spend-scroll { overflow-x: auto; }
.refract-warn { color: var(--citrine); margin-top: 10px; }

/* ---------- The centre as liquid glass, clearing with the Print's clarity (--clarity, 0 to 1, set in drawCrystal) ----------
   Frosted while unclear: a milky veil and fine grain over the light (drawn in the SVG), the page behind more blurred.
   As clarity grows: the rim catches more light, a sheen crosses the pane, and near full clarity light moves through it
   as through water. A cut made sends a wave of clearing out from the stone. Words and marks stay sharp throughout. */
.stage { --clarity: 0;
  backdrop-filter: blur(calc(6px + 14px * (1 - var(--clarity)))) saturate(calc(.9 + .4 * var(--clarity)));
  -webkit-backdrop-filter: blur(calc(6px + 14px * (1 - var(--clarity)))) saturate(calc(.9 + .4 * var(--clarity)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / calc(.04 + .14 * var(--clarity))), inset 0 0 110px rgba(168,151,238,.08),
    inset 0 0 0 1px rgb(255 255 255 / calc(.02 + .05 * var(--clarity))), 0 30px 80px rgba(0,0,0,.4); }
.stage .glass { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden; }
/* The rim: light caught along the top-left edge of the pane, and a fainter return along the bottom right. */
.stage .glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(135deg, rgb(255 255 255 / calc(.10 + .45 * var(--clarity))) 0%, rgb(255 255 255 / .04) 18%, transparent 45%,
    transparent 62%, rgb(214 204 252 / calc(.04 + .16 * var(--clarity))) 88%, rgb(255 255 255 / calc(.05 + .22 * var(--clarity))) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* The sheen: a soft band of light lying across the glass, and the bending of light just inside its edge. */
.stage .glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(118deg, transparent 8%, rgb(255 255 255 / calc(.012 + .05 * var(--clarity))) 22%, transparent 34%),
    radial-gradient(120% 90% at 50% 50%, transparent 72%, rgb(214 204 252 / calc(.02 + .06 * var(--clarity))) 96%);
  mix-blend-mode: screen; }
/* Near full clarity, light moves through the glass as through water. Slow, and composited only. */
.stage .caustic { position: absolute; inset: -20%; opacity: max(0, calc((var(--clarity) - .55) * 1.1)); mix-blend-mode: screen;
  background: radial-gradient(18% 12% at 30% 40%, rgba(214,204,252,.15), transparent 70%), radial-gradient(14% 20% at 62% 58%, rgba(135,168,232,.12), transparent 70%),
    radial-gradient(22% 10% at 48% 28%, rgba(124,199,169,.09), transparent 70%), radial-gradient(12% 16% at 72% 32%, rgba(255,255,255,.10), transparent 70%);
  animation: caustic 26s ease-in-out infinite alternate; will-change: transform; }
.stage .caustic.b { animation-duration: 34s; animation-direction: alternate-reverse; transform: rotate(180deg); }
@keyframes caustic { from { transform: translate(-3%, -2%) scale(1); } to { transform: translate(4%, 3%) scale(1.08); } }
/* A cut made: a ring of clearing spreads from the stone across the glass. */
.stage .wave { position: absolute; left: var(--sx); top: var(--sy); width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35); box-shadow: 0 0 24px rgba(214,204,252,.35), inset 0 0 18px rgba(214,204,252,.2);
  animation: clearing 1.7s cubic-bezier(.2,.7,.3,1) both; will-change: transform, opacity; }
@keyframes clearing { from { transform: scale(.6); opacity: .9; } to { transform: scale(22); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stage .caustic { animation: none; } .stage .wave { display: none; } }
.stage .tool.on { border-color: var(--edge-hi); color: #fff; }
.crystal-svg .dot, .crystal-svg .blank-mark, .crystal-svg .ray-label, .crystal-svg .dot-words { transition: opacity .25s; }
.stage:has(.crystal-svg.lensing) .stage-legend { opacity: .3; transition: opacity .3s; }
/* The loupe's glass, following the pointer over the crystal (lens in crystal.js). */
.stage .loupe { position: absolute; left: 0; top: 0; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%; pointer-events: none; will-change: transform;
  border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 0 0 5px rgba(255,255,255,.02), inset 0 0 36px rgba(214,204,252,.07), 0 0 0 1px rgba(0,0,0,.28), 0 10px 40px rgba(0,0,0,.25);
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.07), transparent 42%), radial-gradient(circle at 50% 50%, transparent 86%, rgba(214,204,252,.06) 97%); }
.stage .loupe[hidden] { display: none; }
/* What is in focus, and the way back to the whole crystal (focusChip). */
.stage .tool.focus-chip { display: inline-flex; align-items: center; gap: 8px; border-color: color-mix(in srgb, var(--c) 55%, transparent); text-transform: none; }
.focus-chip .fc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.focus-chip .fc-x { margin-left: 2px; font-size: 16px; line-height: 1; color: var(--faint); }
.focus-chip:hover .fc-x { color: var(--ink); }

/* ---------- Depth: three framed areas on a desk, and a glass shelf above them ----------
   The centre is a raised glass panel with a chamfered frame (bezel in crystal.js), squarer like a cut frame and
   casting its shadow on the desk. The top bar is a glass shelf in front: its lower edge is chamfered, its hairline of
   light is the spectrum, and it casts a soft shadow onto the work below. */
.stage { border-radius: 6px; border: 0;
  box-shadow: 0 26px 60px rgba(0,0,0,.55), 0 6px 16px rgba(0,0,0,.35), inset 0 0 110px rgba(168,151,238,.08); }
.stage .glass, .stage .glass::after { border-radius: 6px; }
.stage .glass::before { display: none; }
.stage .bezel { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.stage-tools { top: 28px; left: 28px; z-index: 3; }
.stage-legend { right: 30px; bottom: 28px; }
header.top { position: relative; z-index: 20;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.012)), rgba(14,12,24,.62);
  border-bottom: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 34px rgba(0,0,0,.42), 0 3px 8px rgba(0,0,0,.3); }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(20,16,34,.75) 40%, rgba(0,0,0,.0)); }
.spectrum { position: relative; z-index: 21; opacity: .5; }

/* ---------- One surface: the wooden box and the glass panel, side by side, no gaps ----------
   Both start under the shelf, fill the window and stay in place while the page scrolls; both have square corners
   and the same 24px edge (face, then chamfer). No shadow between them: the glass is set into the desk, not laid on it. */
main.crystal-main { padding: 0; }
.crystal-main .stage { height: 100%; min-height: 0; border-radius: 0;
  box-shadow: inset 0 0 110px rgba(168,151,238,.08), inset 0 0 0 1px rgba(0,0,0,.35); }
.crystal-main .stage .glass, .crystal-main .stage .glass::after { border-radius: 0; }
.crystal-main .stage-tools { top: 29px; left: 29px; }
.crystal-main .stage-legend { right: 31px; bottom: 27px; }
@media (min-width: 901px) {
  body:not(.no-print) main.crystal-main { position: sticky; top: 0; align-self: start; height: calc(100vh - var(--top, 121px)); overflow: hidden; }
}

/* ---------- Liquid glass: thickness at the frame, reflections that move, crisp highlights, a trace of rainbow ----------
   The frame's glass faces bend and brighten what lies beneath them (their own backdrop, inside the stage). A soft
   reflection follows the pointer. Thin streaks of light run along the top and left inner edges, and the inner edge
   splits the light faintly into the crystal's own colours. */
.stage .bezel-glass i { position: absolute; z-index: 2; pointer-events: none; background: rgba(255,255,255,.025);
  backdrop-filter: blur(2.5px) saturate(1.45) brightness(1.18); -webkit-backdrop-filter: blur(2.5px) saturate(1.45) brightness(1.18); }
.stage .bezel-glass .t { left: 0; right: 0; top: 0; height: 11px; clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 100%, 11px 100%); }
.stage .bezel-glass .b { left: 0; right: 0; bottom: 0; height: 11px; clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 100%, 0 100%); }
.stage .bezel-glass .l { top: 0; bottom: 0; left: 0; width: 11px; clip-path: polygon(0 0, 100% 11px, 100% calc(100% - 11px), 0 100%); }
.stage .bezel-glass .r { top: 0; bottom: 0; right: 0; width: 11px; clip-path: polygon(0 11px, 100% 0, 100% 100%, 0 calc(100% - 11px)); }
.stage .liquid { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.stage .liquid i { position: absolute; display: block; }
.stage .liquid .reflect { inset: 0; mix-blend-mode: screen;
  background: radial-gradient(520px 340px at var(--px, 28%) var(--py, 18%), rgb(255 255 255 / calc(.035 + .035 * var(--clarity))), transparent 62%); }
.stage .liquid .spec { inset: 11px; }
.stage .liquid .spec::before { content: ""; position: absolute; top: 1px; left: 6%; width: 58%; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6) 18%, rgba(255,255,255,.18) 60%, transparent); filter: blur(.3px); }
.stage .liquid .spec::after { content: ""; position: absolute; left: 1px; top: 5%; width: 1.5px; height: 42%; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.5) 15%, rgba(255,255,255,.12) 65%, transparent); filter: blur(.3px); }
.stage .liquid .fringe { inset: 11px; box-shadow: inset 1px 1px 0 rgba(168,151,238,.38), inset 2px 2px 0 rgba(135,168,232,.16), inset -1px -1px 0 rgba(124,199,169,.28), inset -2px -2px 0 rgba(225,192,124,.12); }

/* The shelf's edge: a hairline of light split into the crystal's colours, with a soft glow beneath it and, now and
   then, a faint glint travelling along it, as light catches the edge of a glass shelf. */
.spectrum { opacity: .85; height: 1px; box-shadow: 0 0 10px rgba(168,151,238,.35), 0 2px 14px rgba(135,168,232,.18); overflow: visible; }
.spectrum::before { content: ""; position: absolute; left: 0; right: 0; top: 1px; height: 6px; pointer-events: none; opacity: .45; filter: blur(3px);
  background: linear-gradient(90deg, transparent 4%, var(--amethyst), var(--sapphire), var(--jade), var(--citrine), var(--rose), transparent 96%); }
.spectrum::after { content: ""; position: absolute; top: -1px; height: 3px; width: 18%; left: -20%; pointer-events: none; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); filter: blur(.6px); animation: shelf-glint 14s ease-in-out infinite; }
@keyframes shelf-glint { 0%, 55% { left: -20%; opacity: 0; } 60% { opacity: .9; } 85% { opacity: .7; } 100% { left: 102%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .spectrum::after { animation: none; display: none; } }
/* Tab names stay on one line, even when the side panel is narrow. */
.tabs .tab { white-space: nowrap; }
.tabs { gap: 2px; }

/* ---------- Titles for every area, with their tools at the right of the title line (as on the HearthVS home) ---------- */
.stage .crystal-svg { position: absolute; left: 0; }
.stage-head { position: absolute; z-index: 3; top: 29px; left: 31px; right: 29px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; pointer-events: none; }
.stage-head .panel-title { margin: 0 0 3px !important; }
.stage-head .panel-sub { font-size: 12.5px; max-width: 420px; }
.crystal-main .stage-tools { top: 31px; left: auto; right: 31px; justify-content: flex-end; }
.crystal-main .stage-tools .tool { padding: 6px 12px; font-size: 12.5px; }
.stage-empty { top: calc(50% + 86px + var(--headroom, 0px) / 2); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -4px 0 4px; }
.side-sub { margin: 0 0 20px !important; }
.side-head .panel-title { margin: 0 0 3px !important; }
.side-head .panel-sub { font-size: 12.5px; }
.tabs.side-switch { flex: none; margin: 4px 0 0; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 0; background: rgba(255,255,255,.03); }
.tabs.side-switch .tab { padding: 4px 10px; font-size: 12px; border: 0; border-radius: 999px; margin: 0; }
.tabs.side-switch .tab.on { background: rgba(168,151,238,.18); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(214,204,252,.35); }
.tabs.side-switch .tab i { font-style: normal; margin-left: 3px; color: var(--muted); font-size: 11px; }
.stage .crystal-svg { overflow: visible; }

/* ---------- One set of measures for the three areas ----------
   Every area's title sits on the same line, the same distance in from its outer edge (the wood or glass frame
   included), on a title line of one height with its controls centred on it; beneath it, one short line at one size,
   spacing and measure, then the same pause before the work begins. */
:root { --head-top: 34px; --head-x: 30px; --title-line: 34px; --sub-measure: 34ch; --after-head: 24px; }
.area-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--title-line); margin: 0 0 6px; }
.area-head .panel-title { margin: 0 !important; line-height: var(--title-line) !important; white-space: nowrap; }
.area-sub { margin: 0 0 var(--after-head); max-width: var(--sub-measure); color: var(--muted); font: 400 13px/1.55 var(--sans); }
.area-head .fold-btn { margin: 0; }
/* Left: the frame is 11px, so the rest of the inset is padding. */
#rough { padding: calc(var(--head-top) - 11px) calc(var(--head-x) - 11px) 30px; }
/* Centre: the title line and the tools at the same height and inset as the others. */
.stage-head { top: var(--head-top); left: var(--head-x); right: var(--head-x); display: block; }
.stage-head .area-sub { margin-bottom: 0; }
.crystal-main .stage-tools { top: calc(var(--head-top) + (var(--title-line) - 30px) / 2); right: var(--head-x); }
.crystal-main .stage-tools .tool { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; }
/* Right. */
#side { padding: var(--head-top) var(--head-x) 40px; }
#side .area-head .tabs.side-switch { margin: 0; }
#side { padding-left: calc(var(--head-x) - 1px); }   /* its 1px border line is part of the inset */
#side .area-head .tabs.side-switch { height: 30px; box-sizing: border-box; align-items: center; }

/* The reading key: one quiet line at the same inset as the titles, opening when pointed at (or focused). */
.crystal-main .stage-legend { left: var(--head-x); right: auto; bottom: var(--head-x); z-index: 3; pointer-events: auto; text-align: left; max-width: 330px;
  padding: 8px 12px; margin: -8px -12px; border-radius: 12px; transition: background .25s, box-shadow .25s; outline: none; }
.stage-legend b { font: 500 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); cursor: help; }
.stage-legend .legend-more { display: none; margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.stage-legend:hover, .stage-legend:focus-visible { background: rgba(14,12,24,.88); box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0,0,0,.45); }
.stage-legend:hover .legend-more, .stage-legend:focus-visible .legend-more { display: block; }
.stage:has(.crystal-svg.lensing) .stage-legend { opacity: .5; }

/* Your glass: the swatches at the foot of the crystal, opposite the reading key, as the wood's are at the foot of the box. */
.glass-pick { position: absolute; z-index: 3; right: var(--head-x); bottom: var(--head-x); display: flex; align-items: center; gap: 9px;
  font: 500 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.glass-pick span { margin-right: 4px; }
.glass-swatch { all: unset; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.5); transition: box-shadow .2s; }
.glass-swatch:hover, .glass-swatch:focus-visible { box-shadow: 0 0 0 2px #160f1c, 0 0 0 3.5px rgba(214,204,252,.4); }
.glass-swatch.on { box-shadow: 0 0 0 2px #160f1c, 0 0 0 3.5px rgba(214,204,252,.75); }
.g-spectrum { background: repeating-linear-gradient(90deg, #a897ee 0 3px, #87a8e8 3px 6px, #7cc7a9 6px 9px, #e1c07c 9px 12px, #e3a198 12px 15px, #c79bdc 15px 18px); }
.g-dusk { background: repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px), linear-gradient(180deg, #3a3d92, #7a2f78 45%, #c2455a 75%, #eda046); }
.g-reeded { background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 1px, rgba(205,200,232,.35) 1px 3px, rgba(0,0,0,.25) 3px 4px), #3a3550; }
.g-clear { background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), rgba(255,255,255,.08) 55%), #2a2538; }
.stage:has(.crystal-svg.lensing) .glass-pick { opacity: .5; }

/* ---------- The top bar on one line ----------
   Smaller pills and fields, closer together, so the whole bar fits one row and the work below gains the height. On
   narrower screens the wordmark steps back to the gem alone. */
header.top { flex-wrap: nowrap; gap: 8px; padding: 10px 22px; min-height: 0; }
header.top .print-pick, header.top .top-actions { flex-wrap: nowrap; gap: 6px; }
header.top .brand { margin-right: 2px; gap: 9px; }
header.top .brand .mark { width: 26px; height: 26px; }
header.top .brand .word { font-size: 17px; }
header.top .btn { padding: 6px 13px; font-size: 12.5px; }
header.top .btn.round { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; }
header.top select { padding: 5px 28px 5px 13px; font-size: 13px; min-width: 0; max-width: 150px; background-position: calc(100% - 16px) 53%, calc(100% - 11px) 53%; }
header.top #langSelect { max-width: 132px; }
header.top .views { padding: 2px; }
header.top .views button { padding: 4px 12px; font-size: 12.5px; }
header.top .clarity .bar { width: 46px; }
header.top .cost-pill { padding: 5px 9px; font-size: 12px; }
header.top .me-btn .who { width: 28px; height: 28px; font-size: 11.5px; }
@media (max-width: 1320px) { header.top .brand .word { display: none; } }
@media (max-width: 1180px) { header.top .cost-pill span { display: none; } header.top .clarity .num { font-size: 11.5px; } }
/* When space runs short, the Print and language fields give way first; only on narrow screens does the bar wrap. */
header.top .print-pick { min-width: 0; flex: 0 1 auto; }
header.top select { flex: 0 1 auto; min-width: 96px; }
header.top .clarity { flex: none; }
header.top .top-actions { flex: none; }
@media (max-width: 1000px) { header.top { flex-wrap: wrap; } header.top .print-pick, header.top .top-actions { flex-wrap: wrap; } }
/* Breathing room on the top bar: more air around it and between its groups, a little more within them. */
header.top { gap: 18px; padding: 14px 30px; }
header.top .print-pick, header.top .top-actions { gap: 9px; }
header.top .brand { margin-right: 6px; }
header.top .clarity { margin-left: 4px; }

/* ---------- The right: a leather writing pad, with the cuts as sheets of paper and your words in ink ----------
   The leather's grain is a relief lit by a low light from the top left (feDiffuseLighting), multiplied into the chosen
   leather colour; a burnished edge as deep as the wood's and the glass's frames, with a hairline of light. Each cut
   lies on it as a sheet of ivory paper with one corner cut away, casting a soft shadow; the question is printed in
   dark ink, and what the person writes reads as their own ink, in blue. */
:root { --leather: #3a2a22;
  --leather-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='l' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='2.2' diffuseConstant='1.05'%3E%3CfeDistantLight azimuth='225' elevation='52'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23l)'/%3E%3C/svg%3E");
  --paper: #e8e0cf; --paper-edge: #d6ccb6; --ink-dark: #2a2027; --ink-soft: #6a5e55; --ink-blue: #233a73; }
#side { border-left: 0;
  background: radial-gradient(130% 90% at 30% 0%, rgba(255,235,210,.07), transparent 55%), radial-gradient(140% 120% at 50% 50%, transparent 55%, rgba(0,0,0,.45)),
    var(--leather-grain), var(--leather);
  background-size: auto, auto, 240px 240px, auto; background-blend-mode: normal, normal, multiply, normal;
  box-shadow: inset 0 0 0 1px rgba(255,225,190,.14), inset 0 0 0 2px rgba(0,0,0,.45), inset 0 0 0 14px rgba(0,0,0,.18), inset 0 0 0 15px rgba(255,225,190,.07), inset 0 0 40px rgba(0,0,0,.45);
  backdrop-filter: none; -webkit-backdrop-filter: none; }
#side h2:not(.panel-title) { color: rgba(240,226,210,.5); }
#side .side-note, #side .area-sub { color: rgba(240,226,210,.62); }
#side .tabs.side-switch { background: rgba(0,0,0,.22); border-color: rgba(255,225,190,.16); }
#side .next-step { background: rgba(0,0,0,.24); border-color: rgba(255,225,190,.14); }

/* A cut, as a sheet of paper with its top right corner cut away. */
#side .blank { position: relative; isolation: isolate; border: 0; border-radius: 0; background: none; padding: 20px 22px 16px; margin-bottom: 18px; color: var(--ink-dark); }
#side .blank::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.35), transparent 60%), linear-gradient(180deg, var(--paper), var(--paper-edge));
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
#side .blank::after { content: ""; position: absolute; inset: 4px -2px -5px 3px; z-index: -2; background: rgba(0,0,0,.55); filter: blur(7px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
#side .blank .kind { color: #8a5a1a; }
#side .blank .on { color: var(--ink-soft); }
#side .blank .q { color: var(--ink-dark); }
#side .blank .offer { border-left-color: #a07a2a; background: rgba(160,122,42,.09); color: #4d4339; }
#side .blank .answer { font: italic 400 17px/1.5 var(--serif); color: var(--ink-blue); }
#side .blank .went { color: var(--ink-soft); }
#side .blank .who { box-shadow: none; }
/* Writing on the paper: ruled faintly, in the person's own blue ink. */
#side .blank textarea { background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(35,58,115,.14) 25px 26px); background-attachment: local;
  border: 0; border-bottom: 1px solid rgba(35,58,115,.25); border-radius: 0; padding: 2px 44px 4px 2px; line-height: 26px;
  font: italic 400 17px/26px var(--serif); color: var(--ink-blue); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
#side .blank textarea::placeholder { color: rgba(106,94,85,.7); font-style: italic; }
#side .blank textarea:focus { box-shadow: none; border-bottom-color: rgba(35,58,115,.55); }
#side .blank .btn { color: var(--ink-dark); background: rgba(0,0,0,.035); border-color: rgba(42,32,39,.22); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#side .blank .btn:hover { border-color: rgba(42,32,39,.5); background: rgba(0,0,0,.06); box-shadow: none; }
#side .blank .btn.quiet { background: transparent; border-color: transparent; color: var(--ink-soft); }
#side .blank .linkish { color: #5a3e8a; text-decoration-color: rgba(90,62,138,.35); }
#side .blank .mic { color: var(--ink-soft); background: rgba(0,0,0,.04); border-color: rgba(42,32,39,.2); }
#side .blank .mic:hover { color: var(--ink-dark); border-color: rgba(42,32,39,.45); }
#side .blank.answered { opacity: .9; }

/* Your leather: swatches at the foot of the pad, as the wood's and the glass's. */
.leather-pick { display: flex; align-items: center; gap: 9px; margin-top: 30px; padding-top: 14px; border-top: 1px solid rgba(255,225,190,.12);
  font: 500 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(240,226,210,.45); }
.leather-pick span { margin-right: auto; }
.leather-swatch { all: unset; width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  background: var(--leather-grain), var(--sw); background-size: 120px 120px, auto; background-blend-mode: multiply, normal;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.5); transition: box-shadow .2s; }
.leather-swatch:hover, .leather-swatch:focus-visible { box-shadow: 0 0 0 2px #1a1210, 0 0 0 3.5px rgba(255,225,190,.4); }
.leather-swatch.on { box-shadow: 0 0 0 2px #1a1210, 0 0 0 3.5px rgba(255,225,190,.75); }
#side .blank textarea { min-height: 82px; }

/* The vision, on the pad: a page of the same paper, its corner cut, the statement set large in ink. */
#side .vision-card { position: relative; isolation: isolate; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-dark); padding: 22px 24px 16px; }
#side .vision-card::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.35), transparent 60%), linear-gradient(180deg, var(--paper), var(--paper-edge));
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
#side .vision-card::after { content: ""; position: absolute; inset: 4px -2px -5px 3px; z-index: -2; background: rgba(0,0,0,.55); filter: blur(7px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
#side .vision-card.offered::before { background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.3), transparent 60%), linear-gradient(180deg, #e2dccd, #d2c9b4); }
#side .vision-card p.text, #side .vision-card .statement { color: var(--ink-dark); text-shadow: none; }
#side .vision-card .line .n, #side .vision-card .vk, #side .vision-card .tag, #side .vision-card .muted { color: var(--ink-soft); }
#side .vision-card .tag { border-color: rgba(42,32,39,.2); background: transparent; }
#side .vision-card .tag.kind { color: #5a3e8a; }
#side .vision-card .line .wish { color: #8a5a1a; }
#side .vision-card .sharpen { color: #4d4339; border-left-color: #a07a2a; }
#side .vision-card .illus { color: var(--ink-soft); }
#side .vision-card .btn { color: var(--ink-dark); background: rgba(0,0,0,.035); border-color: rgba(42,32,39,.22); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#side .vision-card .btn:hover { border-color: rgba(42,32,39,.5); background: rgba(0,0,0,.06); }
#side .vision-card .btn.quiet { background: transparent; border-color: transparent; color: var(--ink-soft); }
#side .vision-card .acts { opacity: 1; }
#side .vision-card [contenteditable=true] { outline-color: rgba(35,58,115,.45); color: var(--ink-blue); font-style: italic; }
/* On the leather, the quieter text is a warm parchment tone, a little stronger, so it reads against the brown. */
#side { --muted: rgba(240,226,210,.70); --faint: rgba(240,226,210,.52); --soft: rgba(244,234,222,.85); }

/* The leather is a photograph (Markus's own), not drawn: it replaces the drawn grain and colour. */
:root { --leather-img: url(/box/leather-graphite-6.jpg); }
#side { background: radial-gradient(130% 90% at 30% 0%, rgba(255,235,210,.06), transparent 55%), radial-gradient(140% 120% at 50% 50%, transparent 55%, rgba(0,0,0,.42)), var(--leather-img) 0 0 / 320px 320px repeat;
  background-blend-mode: normal; }
.leather-swatch { background-size: 70px 70px; background-blend-mode: normal; }

/* ---------- Quiet by default: the page is still when nothing is happening (15 October) ----------
   The graphics chip redraws a page only when something on it changes. Endless animations made it redraw 60 times a
   second, and every blurred surface was blurred again each time; the Mac ran hot. Now:
   - only the shelf, the crystal's glass panel, its glass frame, the navigator and dialogs blur what lies behind them;
     buttons, fields and panels on an already dark ground do not (the difference was invisible);
   - the compass glows a few times when the page opens, and again when pointed at; the shelf's glint passes a few times;
   - light moves through the glass only once it is clear enough to see it;
   - glows are drawn once and faded with opacity, which the chip does without redrawing. */
:where(body *):not(header.top, .stage, .bezel-glass > i, .nav-panel, dialog) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.stage { backdrop-filter: blur(calc(4px + 6px * (1 - var(--clarity)))) saturate(1.15); -webkit-backdrop-filter: blur(calc(4px + 6px * (1 - var(--clarity)))) saturate(1.15); }
#guideBtn.compass { animation: none; }
#guideBtn.compass::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; opacity: 0; will-change: opacity;
  box-shadow: 0 0 14px rgba(168,151,238,.55), inset 0 0 8px rgba(168,151,238,.25), 0 0 0 1px rgba(214,204,252,.55);
  animation: compass-breathe 4.5s ease-in-out 1s 4; }
#guideBtn.compass:hover::before, #guideBtn.compass:focus-visible::before { animation: none; opacity: 1; transition: opacity .3s; }
@keyframes compass-breathe { 50% { opacity: 1; } }
.spectrum::after { left: 0; width: 18%; transform: translateX(-110%); will-change: transform, opacity; animation: shelf-glint 14s ease-in-out 2s 3; }
@keyframes shelf-glint { 0%, 55% { transform: translateX(-110%); opacity: 0; } 60% { opacity: .9; } 85% { opacity: .7; } 100% { transform: translateX(570%); opacity: 0; } }
.stage .caustic { display: none; }
.stage.clear .caustic { display: block; }
@media (prefers-reduced-motion: reduce) { #guideBtn.compass::before { animation: none; } }

/* Reading on leather (15 October): an oiled, darker finish over the whole pad, firmer dark backings behind text that
   lies on the leather itself, and a faint shadow under small type so it lifts off the grain. Paper is unchanged. */
#side { background: linear-gradient(rgba(12,7,4,.42), rgba(12,7,4,.42)), radial-gradient(140% 120% at 50% 50%, transparent 55%, rgba(0,0,0,.45)), var(--leather-img) 0 0 / 320px 320px repeat; }
#side .next-step, #side .tabs.side-switch { background: rgba(10,6,4,.62); border-color: rgba(255,225,190,.16); }
#side .area-sub, #side .side-note, #side h2:not(.panel-title), #side .leather-pick, #side .m-talk, #side .small.muted, #side .muted { text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 0 8px rgba(0,0,0,.6); }
#side .panel-title { text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#side .m-turn .m-text, #side .m-starts button, #side .ray-row { background: rgba(10,6,4,.55); }
#side { --muted: rgba(244,234,222,.80); --faint: rgba(244,234,222,.62); }

/* The reading key, always in view (Vesna, 15 October): the crystal's own marks, each with its meaning, in one quiet
   line at the foot of the glass; pointing at it opens the rest. */
.crystal-main .stage-legend { max-width: none; right: auto; }
.legend-key { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font: 400 12px/1.4 var(--sans); color: var(--muted); }
.legend-key b { margin-right: 2px; }
.legend-key .lk { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-key i { display: inline-grid; place-items: center; flex: none; }
.legend-key .k-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amethyst); box-shadow: 0 0 6px rgba(168,151,238,.6); }
.legend-key .k-dot.faint { background: rgba(168,151,238,.15); border: 1px solid var(--amethyst); box-shadow: none; width: 9px; height: 9px; }
.legend-key .k-dia { width: 9px; height: 9px; background: var(--citrine); transform: rotate(45deg); box-shadow: 0 0 6px rgba(225,192,124,.5); }
.legend-key .k-q { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); font: 400 10px/1 var(--serif); font-style: normal; color: var(--soft); }
.stage-legend:hover .legend-more, .stage-legend:focus-visible .legend-more { display: block; }
.stage:has(.glass-pick) .legend-key { max-width: calc(100% - 260px); }
/* Connect two: say on the crystal where the answer goes. */
.cross-note { position: absolute; z-index: 4; left: 50%; top: calc(var(--headroom, 0px) + 6px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 999px; background: rgba(16,13,28,.9); border: 1px solid rgba(214,204,252,.4); box-shadow: 0 0 24px var(--halo), 0 10px 30px rgba(0,0,0,.4);
  font: 400 13px/1.4 var(--sans); color: var(--soft); white-space: nowrap; animation: cross-note-in .5s ease-out both; }
.cross-note b { color: var(--ink); font-weight: 600; }
.cross-note .cn-mark { color: #d6ccfc; }
.cross-note .cn-arrow { color: #d6ccfc; font-size: 16px; animation: cross-arrow 1.2s ease-in-out 3; }
@keyframes cross-note-in { from { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes cross-arrow { 50% { transform: translateX(5px); } }
.stage:has(.glass-pick) .legend-key { max-width: none; }
.crystal-main .stage-legend { right: 250px; }
.legend-key { gap: 6px 16px; }
/* A long title on the right (Connect two, a ray's name): the switch moves under it rather than off the edge. */
#side .area-head { height: auto; min-height: var(--title-line); flex-wrap: wrap; row-gap: 8px; }
.legend-key, .legend-key b { color: var(--soft); } .legend-key b { color: var(--muted); }

/* A new version waiting (stayCurrent): one quiet line at the bottom centre, where short messages appear. */
.update-notice { position: fixed; z-index: 30; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 7px 8px 7px 16px; border-radius: 999px; background: rgba(16,13,28,.92); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.45);
  font: 400 12.5px/1.4 var(--sans); color: var(--muted); white-space: nowrap; }
.update-notice .linkish { font-size: 12.5px; }
.update-notice .un-x { all: unset; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); font-size: 15px; }
.update-notice .un-x:hover { color: var(--ink); background: rgba(255,255,255,.06); }

/* Nine leathers: smaller swatches, wrapping if the pad is narrow. */
.leather-pick { flex-wrap: wrap; row-gap: 8px; }
.leather-pick span { flex-basis: 100%; margin: 0 0 2px; }
.leather-swatch { width: 18px; height: 18px; background-size: 60px 60px; }
/* The top bar: 20% more breathing room (15 October). */
header.top { gap: 22px; padding: 17px 36px; }
header.top .print-pick, header.top .top-actions { gap: 11px; }
header.top .brand { margin-right: 8px; }
#side { padding-left: var(--head-x); }   /* the leather has no border line, so no pixel to allow for */
/* On paper, type is printed clean: no lifting shadow (that is only for type lying on the leather). */
#side .blank *, #side .vision-card * { text-shadow: none !important; }
/* Contrast on leather, measured (15 October): ordinary text 7:1 or more even on the brightest grain, the faintest 5.5:1 or more. */
#side { --muted: rgba(244,234,222,.82); --faint: rgba(244,234,222,.70); }

/* 'None': no wood, no glass frame, no leather. The surface plain and unadorned, as it was before the materials. */
.none-swatch { position: relative; background: #1a1724 !important; }
.none-swatch::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1px; background: rgba(225,220,240,.55); transform: rotate(-45deg); }
body.plain-wood #rough { border: 0; border-image: none; border-right: 1px solid var(--line); background: rgba(12,10,22,.28); box-shadow: none; padding: var(--head-top) var(--head-x) 30px; }
body.plain-wood.stones-folded #rough { background: rgba(12,10,22,.4); }
body.plain-wood .stones-strip, body.plain-wood .strip-label { color: var(--muted); text-shadow: none; }
.stage.plain-glass .bezel-glass, .stage.plain-glass .liquid .spec, .stage.plain-glass .liquid .fringe { display: none; }
.stage.plain-glass { box-shadow: inset 0 0 0 1px var(--line); }
body.plain-leather #side { background: rgba(12,10,22,.28); box-shadow: none; border-left: 1px solid var(--line); padding-left: calc(var(--head-x) - 1px); }

/* The vivid leathers (coral, scarlet) keep more of their own colour: a lighter darkening, with the quieter text a touch
   brighter, so even the faintest text stays at 4.5:1 or more over the brightest grain (measured 15 October). */
body[data-leather="coral"] #side, body[data-leather="scarlet"] #side { --muted: rgba(248,240,230,.88); --faint: rgba(248,240,230,.80);
  background: linear-gradient(rgba(12,7,4,.28), rgba(12,7,4,.28)), radial-gradient(140% 120% at 50% 50%, transparent 60%, rgba(0,0,0,.35)), var(--leather-img) 0 0 / 320px 320px repeat; }

/* ---------- Your room: the mood of the ground (15 October) ----------
   Night is the first ground, blue-violet. Smoked oak and Deep plum warm it, so the wood, leather and paper belong to
   the room and the crystal is the one place of coloured light. Paper and the crystal's own colours never change. */
.room-pick { display: flex; align-items: center; gap: 6px; margin-right: 4px; }
.room-swatch { all: unset; width: 16px; height: 16px; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.18); transition: box-shadow .2s; }
.room-swatch:hover, .room-swatch:focus-visible { box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 3px rgba(255,255,255,.45); }
.room-swatch.on { box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 3.5px rgba(255,255,255,.8); }
.r-night { background: radial-gradient(circle at 35% 30%, #4a3d78, #191528 60%, #07060c); }
.r-oak { background: radial-gradient(circle at 35% 30%, #4a3f36, #1d1916 60%, #0c0a09); }
.r-plum { background: radial-gradient(circle at 35% 30%, #553a50, #221720 60%, #0d080c); }

html[data-room] body { background-attachment: fixed; }
html[data-room] body::after { opacity: .18; }
html[data-room] .btn:not(.primary), html[data-room] input[type=text], html[data-room] .views { background-color: var(--field); background-image: linear-gradient(180deg, var(--field-hi), var(--field)); }
html[data-room] select { background-color: var(--field); }   /* keeps its own arrow */
html[data-room] .views button.on, html[data-room] .tabs.side-switch .tab.on { background: var(--on); box-shadow: inset 0 0 0 1px var(--on-edge); border-color: transparent; }
html[data-room] .intake { background-color: var(--field); }
html[data-room] body:not(.plain-wood) #rough { background: var(--fuzz) padding-box, radial-gradient(ellipse 130% 55% at 50% 0%, var(--felt-1), var(--felt-2) 72%) padding-box; background-size: 160px 160px, auto; }
html[data-room] body.plain-wood #rough, html[data-room] body.plain-leather #side { background: var(--plain); }
html[data-room] header.top { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.01)), var(--shelf); }
html[data-room] .stage { background: radial-gradient(circle at 50% 50%, var(--stage-in) 0%, var(--stage-mid) 42%, var(--stage-out) 100%); }
html[data-room="oak"] { --gem-0: #0c0a09; --gem-1: #13100e; --gem-2: #1d1916; --solid: #13100e;
  --ink: #f1ece6; --soft: rgba(240,233,225,.80); --muted: rgba(236,228,218,.60); --faint: rgba(236,228,218,.38);
  --line: rgba(255,240,225,.09); --edge: rgba(255,240,225,.15); --glass: rgba(255,245,235,.035); --glass-2: rgba(255,245,235,.065);
  --field: rgba(255,245,235,.035); --field-hi: rgba(255,245,235,.06); --on: rgba(255,245,235,.12); --on-edge: rgba(255,240,225,.35);
  --felt-1: #2a2420; --felt-2: #171310; --plain: rgba(20,16,14,.6); --shelf: rgba(22,18,16,.82);
  --stage-in: rgba(96,82,140,.30); --stage-mid: rgba(28,23,30,.55); --stage-out: rgba(10,8,8,.70); }
html[data-room="oak"] body { background: radial-gradient(ellipse 70% 55% at 46% 44%, rgba(168,151,238,.07), transparent 64%), linear-gradient(165deg, var(--gem-2) 0%, var(--gem-1) 46%, var(--gem-0) 100%); }
html[data-room="plum"] { --gem-0: #0d080c; --gem-1: #150e14; --gem-2: #221720; --solid: #150e14;
  --ink: #f1ebf0; --soft: rgba(240,230,238,.80); --muted: rgba(236,224,232,.60); --faint: rgba(236,224,232,.38);
  --line: rgba(255,235,248,.09); --edge: rgba(255,235,248,.15); --glass: rgba(255,240,250,.035); --glass-2: rgba(255,240,250,.065);
  --field: rgba(255,240,250,.035); --field-hi: rgba(255,240,250,.06); --on: rgba(255,240,250,.12); --on-edge: rgba(255,230,245,.35);
  --felt-1: #2b1f29; --felt-2: #180f16; --plain: rgba(24,15,22,.6); --shelf: rgba(24,16,22,.82);
  --stage-in: rgba(104,78,140,.30); --stage-mid: rgba(32,21,32,.55); --stage-out: rgba(12,7,11,.70); }
html[data-room="plum"] body { background: radial-gradient(ellipse 70% 55% at 46% 44%, rgba(168,151,238,.10), transparent 64%), linear-gradient(165deg, var(--gem-2) 0%, var(--gem-1) 46%, var(--gem-0) 100%); }

/* Cappuccino: the one light room. The ground, the top bar and the box's felt turn cappuccino and oat, with dark ink;
   the crystal's glass panel stays dark, like a jeweller's black velvet tray, and the leather pad keeps its own dark
   leather, so the light only lives where it reads well. Light-text variables stay global for those dark areas; the
   dark ink is set only on the top bar and the box. */
.r-latte { background: radial-gradient(circle at 35% 30%, #efe3d1, #c9b49b 60%, #9c8468); }
html[data-room="latte"] { --gem-0: #b9a387; --gem-1: #c9b49b; --gem-2: #d8c6ae; --shelf: rgba(222,208,188,.88);
  --stage-in: rgba(122,88,68,.62); --stage-mid: rgba(52,37,28,.95); --stage-out: rgba(30,21,16,.98);   /* espresso, not grey: the crystal on a dark brown velvet */
  --felt-1: #e3d5c1; --felt-2: #cdbba3; --plain: rgba(214,198,176,.6);
  --field: rgba(255,255,255,.14); --field-hi: rgba(255,255,255,.22); --on: rgba(255,255,255,.12); --on-edge: rgba(255,245,235,.35); }
html[data-room="latte"] body { background: radial-gradient(ellipse 70% 55% at 46% 44%, rgba(255,250,240,.35), transparent 64%), linear-gradient(165deg, var(--gem-2) 0%, var(--gem-1) 46%, var(--gem-0) 100%); }
html[data-room="latte"] body::before, html[data-room="latte"] body::after { opacity: 0; }
html[data-room="latte"] header.top, html[data-room="latte"] #rough {
  --ink: #241c16; --soft: rgba(36,28,22,.9); --muted: rgba(40,30,22,.88); --faint: rgba(46,34,24,.80);
  --line: rgba(60,40,25,.16); --edge: rgba(60,40,25,.26); --edge-hi: rgba(90,60,40,.5); --glass: rgba(255,255,255,.3); --glass-2: rgba(255,255,255,.45);
  --field: rgba(255,255,255,.42); --field-hi: rgba(255,255,255,.6); --on: rgba(255,255,255,.75); --on-edge: rgba(90,60,40,.35); color: var(--ink); }
html[data-room="latte"] header.top { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 26px rgba(60,40,25,.25); }
html[data-room="latte"] header.top::after { background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(120,95,70,.3) 40%, transparent); }
html[data-room="latte"] header.top .btn.primary, html[data-room="latte"] #rough .btn.primary { color: #1f1830; background-image: linear-gradient(140deg, rgba(168,151,238,.55), rgba(135,168,232,.4)); border-color: rgba(110,90,190,.55); }
html[data-room="latte"] #rough .frag-row { background: rgba(255,255,255,.32); box-shadow: inset 0 1px 3px rgba(60,40,25,.18); }
html[data-room="latte"] #rough .frag-row:hover { background: rgba(255,255,255,.5); }
html[data-room="latte"] #rough .drop { border-color: rgba(60,40,25,.3); }
html[data-room="latte"] #rough input::placeholder, html[data-room="latte"] #rough textarea::placeholder { color: rgba(60,46,36,.6); }
html[data-room="latte"] #rough .mic { color: var(--muted); background: rgba(255,255,255,.4); border-color: var(--line); }
html[data-room="latte"] #rough .fold-btn { color: var(--muted); border-color: var(--edge); }
html[data-room="latte"] .clarity .bar { background: rgba(60,40,25,.15); }
html[data-room="latte"] .brand .mark { --mark-ground: #cdb89e; filter: drop-shadow(0 0 6px rgba(120,95,70,.35)); }
html[data-room="latte"] body.stones-folded #rough .stones-strip { color: rgba(255,238,215,.75); }
html[data-room="latte"] #guideBtn.compass { color: #4a3b78; }
html[data-room="latte"] .glass-pick, html[data-room="latte"] .legend-key b { color: var(--muted); }

/* ---------- Your workshop (workshop.js): one easel, one panel for every personal choice ---------- */
.easel svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.easel .e-art { stroke: #c9a8f0; }
header.top .btn.round.easel { display: inline-grid; place-items: center; }
.workshop-panel { position: fixed; z-index: 45; top: calc(var(--top, 67px) + 8px); right: 24px; width: 380px; max-height: calc(100vh - var(--top, 67px) - 40px); overflow: auto;
  padding: 20px 22px 18px; border-radius: 18px; background: rgba(20,17,22,.97); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06); color: #efebf2;
  --ink: #efebf2; --muted: rgba(236,230,240,.66); --faint: rgba(236,230,240,.45); }
.workshop-panel[hidden] { display: none; }
.workshop-panel h3 { margin: 0; font: 600 21px/1.2 var(--serif); }
.workshop-panel .ws-sub { margin: 3px 0 16px; color: var(--muted); font-size: 12.5px; }
.workshop-panel .ws-row { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.workshop-panel .ws-name { font: 500 10.5px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 9px; }
.workshop-panel .ws-name i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.workshop-panel .ws-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.workshop-panel .ws-swatches button { border: 0; padding: 0; margin: 0; appearance: none; -webkit-appearance: none; flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.5); transition: box-shadow .2s; position: relative; }
.workshop-panel .ws-swatches button:hover, .workshop-panel .ws-swatches button:focus-visible { box-shadow: 0 0 0 2px #141116, 0 0 0 3.5px rgba(255,255,255,.4); }
.workshop-panel .ws-swatches button.on { box-shadow: 0 0 0 2px #141116, 0 0 0 3.5px rgba(255,255,255,.85); }
.workshop-panel .ws-foot { margin: 12px 0 0; color: var(--faint); font-size: 11.5px; }
.crystal-main .stage-legend { right: var(--head-x); }
.workshop-panel { background: #17141a; }

/* Cappuccino with no leather: the pad is light, so it reads as the box does: dark ink, no lifting shadow, light backings. */
html[data-room="latte"] body.plain-leather #side {
  --ink: #241c16; --soft: rgba(36,28,22,.9); --muted: rgba(40,30,22,.88); --faint: rgba(46,34,24,.80);
  --line: rgba(60,40,25,.16); --edge: rgba(60,40,25,.26); --edge-hi: rgba(90,60,40,.5); --glass: rgba(255,255,255,.3); --glass-2: rgba(255,255,255,.45);
  --field: rgba(255,255,255,.42); --field-hi: rgba(255,255,255,.6); --on: rgba(255,255,255,.75); --on-edge: rgba(90,60,40,.35);
  color: var(--ink); background: rgba(222,208,188,.55); border-left-color: rgba(60,40,25,.14); }
html[data-room="latte"] body.plain-leather #side * { text-shadow: none !important; }
html[data-room="latte"] body.plain-leather #side h2:not(.panel-title), html[data-room="latte"] body.plain-leather #side .side-note,
html[data-room="latte"] body.plain-leather #side .area-sub, html[data-room="latte"] body.plain-leather #side .muted { color: var(--muted); }
html[data-room="latte"] body.plain-leather #side .panel-title { color: var(--ink); }
html[data-room="latte"] body.plain-leather #side .next-step, html[data-room="latte"] body.plain-leather #side .tabs.side-switch,
html[data-room="latte"] body.plain-leather #side .m-turn .m-text, html[data-room="latte"] body.plain-leather #side .m-starts button, html[data-room="latte"] body.plain-leather #side .ray-row {
  background: rgba(255,255,255,.4); border-color: var(--line); color: var(--ink); }
html[data-room="latte"] body.plain-leather #side .btn:not(.primary) { color: var(--ink); }
html[data-room="latte"] body.plain-leather #side textarea:not(.blank *) { color: var(--ink); }

/* The closed lid shows its wood in every room; felt only when the box has no wood. */
html[data-room] body.stones-folded:not(.plain-wood) #rough { background: var(--lid) center top / 100% auto repeat-y; }
