/* ─────────────────────────────────────────────────────────────────────────────
   INKLINE · Holista sketch board   (needs tokens.css; DESIGN.md §24, SKETCH.md)
   Flat ink or paper, hairlines, ONE marker colour (the recording dot, Holista's pen, snap guides, the spoken word), no gradients, no blur,
   springs (--ik-press / --ik-soft), shapes not colours. The board sets its own ground, so it follows `theme: 'ink' | 'paper'` and not the page.
   ───────────────────────────────────────────────────────────────────────────── */

.sk {
  --sk-bg: var(--ik-ink); --sk-text: var(--ik-paper);
  position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--ik-bg); color: var(--ik-text);
  font: 500 14px/1.3 var(--ik-font-body); -webkit-user-select: none; user-select: none; touch-action: none; outline: none; -webkit-tap-highlight-color: transparent;
}
/* the board's own ground (the page's [data-theme] only re-points :root) */
.sk, .sk[data-sk-theme="ink"] {
  --ik-bg: var(--ik-ink); --ik-surface: var(--ik-ink-1); --ik-surface-2: var(--ik-ink-2); --ik-text: var(--ik-paper); --ik-text-2: var(--ik-text-2-ink); --ik-text-3: var(--ik-text-3-ink);
  --ik-rule: var(--ik-ink-rule); --ik-line: var(--ik-faint); --ik-outline: color-mix(in srgb, var(--ik-faint) 40%, transparent); --ik-solid: var(--ik-paper); --ik-on-solid: var(--ik-ink);
  --ik-fill: color-mix(in srgb, var(--ik-paper) 7%, transparent); --ik-fill-2: color-mix(in srgb, var(--ik-paper) 15%, transparent); color-scheme: dark;
}
.sk[data-sk-theme="paper"] {
  --ik-bg: var(--ik-paper); --ik-surface: var(--ik-paper-1); --ik-surface-2: var(--ik-paper-2); --ik-text: var(--ik-ink); --ik-text-2: var(--ik-text-2-paper); --ik-text-3: var(--ik-text-3-paper);
  --ik-rule: var(--ik-paper-rule); --ik-line: var(--ik-faint); --ik-outline: color-mix(in srgb, var(--ik-faint) 50%, transparent); --ik-solid: var(--ik-ink); --ik-on-solid: var(--ik-paper);
  --ik-fill: color-mix(in srgb, var(--ik-ink) 5.5%, transparent); --ik-fill-2: color-mix(in srgb, var(--ik-ink) 12%, transparent); color-scheme: light;
}

/* ── the stage: four canvases and a hit layer, letterboxed to the board's aspect ── */
.sk-stage { position: absolute; background: var(--ik-bg); }
.sk-stage.is-letter { box-shadow: 0 0 0 var(--ik-hair) var(--ik-rule); }
.sk-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.sk-hit { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.sk-edit-host { position: absolute; inset: 0; pointer-events: none; }
.sk-editor {
  position: absolute; margin: 0; padding: 2px 4px; border: 0; outline: var(--ik-hair) dashed var(--ik-text-2); outline-offset: 2px; border-radius: 4px; background: transparent; color: var(--ik-text);
  font-family: var(--ik-font-body); resize: none; overflow: hidden; white-space: pre-wrap; min-width: 60px; pointer-events: auto; -webkit-user-select: text; user-select: text; caret-color: var(--ik-marker);
}
@keyframes sk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sk-stage.is-switch .sk-ink, .sk-stage.is-switch .sk-over { animation: sk-in 220ms var(--ik-quick); }

/* ── bars ── */
.sk-bar { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.sk-bar--top { top: 12px; left: 12px; right: 12px; flex-wrap: wrap; }
.sk-bar > * { pointer-events: auto; }
.sk-group, .sk-bar--bottom, .sk-rbar { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--ik-r-md); background: var(--ik-surface); box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-outline); }
.sk-group--right { margin-left: auto; gap: 6px; }
.sk-bar--bottom { bottom: 12px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 6px; gap: 6px; }
.sk-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.sk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; border: 0; border-radius: var(--ik-r-btn); background: transparent; color: var(--ik-text);
  font: 600 13px/1 var(--ik-font-body); cursor: pointer; transition: background var(--ik-quick), color var(--ik-quick), transform var(--ik-press); -webkit-user-select: none; user-select: none;
}
.sk-btn--icon { padding: 0; width: 36px; }
.sk-btn:hover { background: var(--ik-fill); }
.sk-btn:active { transform: translateY(1px) scale(0.97); background: var(--ik-fill-2); }
.sk-btn[aria-pressed="true"]:not(.sk-rec) { background: var(--ik-solid); color: var(--ik-on-solid); }
.sk-btn:disabled { opacity: 0.32; cursor: default; pointer-events: none; }
.sk-btn:focus-visible, .sk-thumb-go:focus-visible, .sk-thumb-x:focus-visible, .sk-switch:focus-visible, .sk-scrub:focus-visible, .sk-title:focus-visible { outline: 2px solid var(--ik-text); outline-offset: 2px; }
.sk-btn--ghost { height: 28px; min-width: 0; padding: 0 10px; color: inherit; box-shadow: inset 0 0 0 var(--ik-hair) currentColor; }
.sk-done { padding: 0 12px 0 8px; }
.sk-title { width: 168px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--ik-r-btn); background: transparent; color: var(--ik-text); font: 700 15px/1 var(--ik-font-display); letter-spacing: -0.015em; text-overflow: ellipsis; -webkit-user-select: text; user-select: text; }
.sk-title::placeholder { color: var(--ik-text-3); }
.sk-title:hover { background: var(--ik-fill); }
.sk-tools .sk-btn { width: 40px; }

/* Jev assist: a real switch (a checkbox with role=switch); on = the ground inverts, never a second colour */
.sk-assist { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.sk-switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; border: 0; border-radius: var(--ik-r-pill); background: var(--ik-fill-2); box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-line); cursor: pointer; transition: background var(--ik-quick), box-shadow var(--ik-quick); }
.sk-switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ik-text); transition: transform var(--ik-press), width var(--ik-press), background var(--ik-quick); }
.sk-switch:checked { background: var(--ik-solid); box-shadow: none; }
.sk-switch:checked::before { transform: translateX(18px); background: var(--ik-on-solid); }
.sk-switch:active::before { width: 22px; } .sk-switch:checked:active::before { transform: translateX(14px); }

/* record: the marker dot while recording, a live level meter and the elapsed time */
.sk-rec { padding: 0 12px 0 10px; }
.sk-recdot, .sk-meter, .sk-time { display: none; }
.sk-rec .sk-rec-ic { display: inline-flex; }
.sk.is-recording .sk-rec { box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-marker); }
.sk.is-recording .sk-rec-ic { display: none; }
.sk.is-recording .sk-recdot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--ik-marker); animation: sk-rec 1.2s ease-in-out infinite; }
.sk.is-recording .sk-meter { display: inline-flex; align-items: center; gap: 2px; height: 18px; }
.sk-meter i { display: block; width: 2px; height: 18px; border-radius: 1px; background: var(--ik-text); transform: scaleY(0.06); transition: transform 70ms linear; }
.sk.is-recording .sk-time { display: inline; font-variant-numeric: tabular-nums; min-width: 3ch; }
@keyframes sk-rec { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* Holista is drawing: her dot (the marker) and the words */
.sk-drawing { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; font-weight: 600; font-size: 13px; color: var(--ik-text); }
.sk-drawing[hidden] { display: none; }
.sk-presence { width: 10px; height: 10px; border-radius: 50%; background: var(--ik-marker); animation: sk-rec 1.4s ease-in-out infinite; }

/* ── slides ── */
.sk-thumbs { display: flex; gap: 6px; max-width: min(60vw, 720px); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.sk-thumbs::-webkit-scrollbar { display: none; }
.sk-thumb { position: relative; flex: none; }
.sk-thumb-go { position: relative; display: block; width: 76px; padding: 0; border: 0; border-radius: 7px; background: var(--ik-bg); cursor: pointer; overflow: hidden; box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-outline); transition: box-shadow var(--ik-quick), transform var(--ik-press); }
.sk-thumb-go:hover { box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-line); }
.sk-thumb-go:active { transform: scale(0.97); }
.sk-thumb.is-cur .sk-thumb-go { box-shadow: inset 0 0 0 1.5px var(--ik-text); }
.sk-thumb canvas { display: block; width: 100%; height: auto; }
.sk-thumb b { position: absolute; left: 4px; bottom: 3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 4px; background: var(--ik-bg); color: var(--ik-text); font: 700 10px/14px var(--ik-font-body); text-align: center; }
.sk-thumb-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: var(--ik-bg); color: var(--ik-text); display: none; place-items: center; cursor: pointer; box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-line); }
.sk-thumb-x .sk-ic { width: 12px; height: 12px; }
.sk-thumb:hover .sk-thumb-x, .sk-thumb:focus-within .sk-thumb-x { display: grid; }
.sk-count { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ik-text-2); }
.sk-play[hidden] { display: none; }

/* ── toast, help, replay ── */
.sk-toast { position: absolute; z-index: 4; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--ik-r-md); background: var(--ik-solid); color: var(--ik-on-solid); font-weight: 600; }
.sk-toast[hidden] { display: none; }
.sk-toast.is-in { animation: sk-toast var(--ik-soft) both; }
@keyframes sk-toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sk-help { position: absolute; z-index: 5; right: 12px; top: 64px; width: min(340px, calc(100% - 24px)); padding: 16px 18px; border-radius: var(--ik-r-lg); background: var(--ik-surface); box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-line); }
.sk-help[hidden] { display: none; }
.sk-help h3 { margin: 0 0 10px; font: 700 18px/1 var(--ik-font-display); letter-spacing: -0.02em; }
.sk-help dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13px; }
.sk-help dt { font-weight: 700; white-space: nowrap; } .sk-help dd { margin: 0; color: var(--ik-text-2); }

.sk-replay { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.sk-replay[hidden] { display: none; }
.sk-replay > * { pointer-events: auto; }
.sk-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: min(900px, 100%); min-height: 28px; }
.sk-w { padding: 4px 9px; border-radius: var(--ik-r-xs); background: var(--ik-surface); color: var(--ik-text-2); font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-outline); }
.sk-w.is-past { color: var(--ik-text); }
.sk-w.is-now { color: var(--ik-text); background: var(--ik-surface); box-shadow: inset 0 0 0 var(--ik-hair) var(--ik-outline), inset 0 -2.5px 0 var(--ik-marker); }
.sk-rbar { width: min(760px, 100%); gap: 10px; padding: 6px 8px; }
.sk-rt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--ik-text-2); min-width: 36px; text-align: center; }
.sk-scrub { appearance: none; -webkit-appearance: none; flex: 1; height: 20px; margin: 0; background: transparent; cursor: pointer; }
.sk-scrub::-webkit-slider-runnable-track { height: 2px; background: var(--ik-line); border-radius: 1px; }
.sk-scrub::-moz-range-track { height: 2px; background: var(--ik-line); border-radius: 1px; }
.sk-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--ik-text); border: 0; }
.sk-scrub::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ik-text); border: 0; }
.sk-speed { min-width: 44px; font-variant-numeric: tabular-nums; }
.sk.is-replay .sk-bar--bottom, .sk.is-replay .sk-hit { display: none; }
.sk.is-replay .sk-tools, .sk.is-replay [data-act="undo"], .sk.is-replay [data-act="redo"], .sk.is-replay [data-act="dup"], .sk.is-replay [data-act="clear"], .sk.is-replay .sk-assist, .sk.is-replay .sk-rec { opacity: 0.35; pointer-events: none; }
.sk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* narrow screens: labels give way to icons */
@media (max-width: 1040px) { .sk-assist-t, .sk-title { display: none; } .sk-title { display: none; } }
@media (max-width: 760px) { .sk-rec-t, .sk-done span, .sk-play span { display: none; } .sk-bar--top { gap: 6px; } .sk-btn { min-width: 34px; } .sk-thumb-go { width: 60px; } }
@media (prefers-reduced-motion: reduce) {
  .sk-stage.is-switch .sk-ink, .sk-stage.is-switch .sk-over, .sk-toast.is-in, .sk.is-recording .sk-recdot, .sk-presence { animation: none; }
  .sk-btn, .sk-switch, .sk-switch::before, .sk-thumb-go { transition: none; }
}
