/* Sifferverkstan / uppställningar only (uppstallningar.html).
   Split out of css/style.css so pages do not download rules they cannot use; tests/css-scope.test.js checks the scope. */

/* ------------------------------------------------ Sifferverkstan (uppställningar) */
.sv-hero { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
.sv-hero-art svg { width: 140px; height: auto; }
@media (max-width: 560px) {
  .sv-hero { grid-template-columns: 1fr; }
  .sv-hero-art svg { width: 110px; }
}
.sv-place { margin-top: 18px; border: 3px dashed var(--plum); }
.sv-notation { display: grid; gap: 2px; }
.sv-work { max-width: 640px; margin: 0 auto; }
.sv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.sv-title { font-size: 1.1rem; flex: 1 1 100%; margin: 0; }
.sv-dots { display: flex; gap: 6px; flex: 1; }
.sv-dots span { width: 26px; height: 8px; border-radius: 4px; background: var(--line); }
.sv-dots span.on { background: var(--mint); }
.sv-dots span.now { background: var(--sun); }
.sv-crystals { font-size: .95rem; }
.sv-task { font-size: 1.6rem; font-weight: 800; text-align: center; margin: 4px 0 10px; letter-spacing: .02em; }
.sv-board { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 12px 8px; }
@media (max-width: 560px) {
  .sv-task { font-size: 1.35rem; margin: 2px 0 6px; }
  .sv-title { font-size: 1rem; }
  .b-h { width: 22px; height: 22px; }
  .sv-help { margin: 8px 0 4px; min-height: 52px; }
  .sv-buddy, .sv-buddy svg { width: 48px; }
  .sv-bubble { font-size: .95rem; padding: 8px 12px; }
}
.sv-grid, .sv-blocks { --sv-cell: clamp(42px, 12vw, 60px); --sv-opw: clamp(26px, 7vw, 36px); display: grid; grid-template-columns: var(--sv-opw) repeat(var(--sv-cols, 3), var(--sv-cell)); gap: 6px; justify-content: center; }
.sv-hd { font-size: .8rem; font-weight: 800; text-align: center; border-radius: 10px; padding: 3px 0; }
.hd-h { color: var(--sv-h); background: var(--sv-h-bg); }
.hd-t { color: var(--sv-t); background: var(--sv-t-bg); }
.hd-e { color: var(--sv-e); background: var(--sv-e-bg); }
.hd-k { color: var(--sv-k); background: var(--sv-k-bg); }
.sv-op { display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; }
.sv-cell { height: calc(var(--sv-cell) * .95); border-radius: 14px; display: grid; place-items: center; font: inherit; font-size: calc(var(--sv-cell) * .52); font-weight: 800; color: var(--ink); position: relative; border: 0; padding: 0; }
.sv-digit, .sv-blank { background: transparent; }
.sv-digit.col-h { background: var(--sv-h-bg); }
.sv-digit.col-t { background: var(--sv-t-bg); }
.sv-digit.col-e { background: var(--sv-e-bg); }
.sv-digit.col-k { background: var(--sv-k-bg); }
.sv-blank.sv-small { height: calc(var(--sv-cell) * .62); background: transparent; }
.sv-cell.hl { box-shadow: 0 0 0 3px var(--sun); }
.sv-digit.struck::before { content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 4px; background: var(--bad, #b8262c); transform: rotate(-28deg); border-radius: 2px; }
button.sv-cell { cursor: pointer; }
.sv-box { height: calc(var(--sv-cell) * .62); font-size: calc(var(--sv-cell) * .36); border: 3px dashed #b9b2a3; background: #fffdf7; color: var(--ink); }
.sv-box.ok { border-style: solid; border-color: #d99a00; background: #fff6d6; }
.sv-ten { position: absolute; left: 4px; top: 2px; font-size: .62em; font-weight: 800; color: var(--ink-soft); }
.sv-rule { grid-column: 1 / -1; height: 4px; background: var(--ink); border-radius: 2px; margin: 2px 0; }
.sv-ans { background: #fff; border: 3px solid var(--line); }
.sv-cell.ok { color: var(--mint-dark); }
.sv-ans.ok { border-color: var(--mint); }
.sv-cell.given { color: var(--ink-soft); }
.sv-cell.given.sv-ans { border-color: #c9c2b3; border-style: dotted; }
.sv-cell.bad { color: #b8262c; border-color: #b8262c; background: #fff0f0; animation: sv-shake .3s; }
.sv-cell.active { outline: 4px solid var(--sky); outline-offset: 2px; }
.sv-cell.active .v:empty::after { content: ""; display: block; width: 24px; height: 4px; border-radius: 2px; background: var(--ink); margin-top: 1.2em; animation: sv-blink 1s steps(2) infinite; }
.sv-cell:focus-visible { outline: 4px solid var(--plum); outline-offset: 2px; }
.sv-help { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 8px; min-height: 64px; }
.sv-buddy { flex: none; width: 64px; }
.sv-buddy svg { width: 64px; height: auto; }
.sv-bubble { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); margin: 0; flex: 1; font-size: 1.02rem; }
.sv-help.empty .sv-bubble { visibility: hidden; }
.sv-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.sv-pad { margin-top: 8px; }
.sv-pad.numpad { grid-template-columns: repeat(6, 1fr); max-width: 460px; gap: 8px; }
.sv-pad.numpad button { height: 54px; }
.sv-pad.numpad .ok { background: var(--mint-dark); box-shadow: 0 5px 0 #095644; }
.sv-head { margin-bottom: 12px; }
.sv-head h1 { margin: 0; }
body.sv-working .sv-head { margin-bottom: 4px; }
body.sv-working .sv-head h1 { font-size: 1.1rem; }
body.sv-working .sv-head .eyebrow { display: none; }
.sv-icon { border: 0; background: #fff; border-radius: 50%; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.sv-icon[aria-pressed="true"] { background: #fff3dc; box-shadow: 0 0 0 3px var(--sun); }
.sv-work { scroll-margin-top: 6px; }
.sv-keys { text-align: center; }
@media (pointer: coarse) {
  .sv-keys { display: none; }
}
/* Base-ten blocks: cube (ental), rod (tiotal), flat (hundratal), big cube (tusental). */
.sv-blocks { padding-left: 0; margin-bottom: 10px; align-items: end; }
.sv-blocks::before { content: ""; }
.sv-bcol { display: flex; flex-wrap: wrap-reverse; gap: 2px; align-content: flex-start; justify-content: center; min-height: 30px; }
.sv-blocks.phase-2 .sv-bcol { transform: scale(.7); transform-origin: bottom center; }
.b-e { width: 11px; height: 11px; }
.b-h { width: 26px; height: 26px; background-image: repeating-linear-gradient(0deg, transparent 0 1.6px, rgba(31,35,72,.2) 1.6px 2.6px), repeating-linear-gradient(90deg, transparent 0 1.6px, rgba(31,35,72,.2) 1.6px 2.6px); }
.b-k { width: 30px; height: 30px; border-radius: 4px; background: #9fd8b0; }
.sv-blocks.flash { animation: sv-flash .6s; }
.sv-end { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
.sv-end-art svg { width: 140px; height: auto; }
.sv-end h2:focus { outline: none; }
.sv-gain { font-weight: 800; font-size: 1.15rem; }
@media (max-width: 560px) {
  .sv-end { grid-template-columns: 1fr; }
  .sv-end-art svg { width: 100px; }
}
