/* STHB Labs — component styles. Loaded after tokens.css. Prefix: sl- */

body { margin: 0; font-family: var(--font-sans); background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }

/* Technical voice: numbers and labels in Martian Mono */
.sl-num, .number, .number-s { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sl-label, .label { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-variation-settings: "wdth" 75; color: var(--ink-muted); }
.sl-label--ink { color: var(--ink); }
.sl-callout { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: var(--hairline) solid var(--ink); font-family: var(--font-mono); font-size: 10px; line-height: 1; color: var(--ink); flex: none; }
.sl-callout--on { background: var(--ink); color: var(--on-ink); }

.sl-icon { width: 24px; height: 24px; display: block; flex: none; }
[data-theme="dark"] .sl-icon { filter: invert(1); }

.sl-stage { padding: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

/* ---------- Button ---------- */
.sl-btn {
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-6); border-radius: var(--radius-pill);
  border: var(--hairline) solid var(--ink); background: var(--paper); color: var(--ink);
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.sl-btn:hover { background: var(--paper-raised); }
.sl-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sl-btn--primary { background: var(--punkt); border-color: var(--punkt); color: var(--on-punkt); }
.sl-btn--primary:hover { background: var(--punkt); opacity: .9; }
.sl-btn--ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.sl-btn--ink:hover { background: var(--ink); opacity: .85; }
.sl-btn--ghost { border-color: transparent; background: transparent; }
.sl-btn--danger { color: var(--red); border-color: var(--red); }
.sl-btn--s { height: 36px; padding: 0 var(--space-4); font-size: 14px; }
.sl-btn:disabled { opacity: .4; cursor: not-allowed; }
.sl-btn--primary .sl-icon { filter: var(--punkt-icon-filter, invert(1)); }
.sl-btn--ink .sl-icon { filter: invert(1); }
[data-theme="dark"] .sl-btn--primary .sl-icon, [data-theme="dark"] .sl-btn--ink .sl-icon { filter: none; }

/* ---------- Tag ---------- */
.sl-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px;
  border-radius: var(--radius-pill); border: var(--hairline) solid var(--ink);
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink); white-space: nowrap;
}
.sl-tag--on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--punkt); }
.sl-tag--quiet { border-color: transparent; background: var(--paper-raised); color: var(--ink-muted); }
.sl-tag--punkt { border-color: var(--punkt); background: var(--punkt); color: var(--on-punkt); }

/* ---------- The edge: a line, the punkt sits centred on it ---------- */
.sl-edge { position: relative; height: 18px; }
.sl-edge::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--edge); margin-top: calc(var(--edge) / -2); background: var(--line); border-radius: 0; }
.sl-edge__done { position: absolute; left: 0; top: 50%; height: var(--edge); margin-top: calc(var(--edge) / -2); background: var(--ink); }
.sl-edge__ball { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--punkt); transition: left 260ms cubic-bezier(.3, 1.2, .5, 1); }
@media (prefers-reduced-motion: reduce) { .sl-edge__ball { transition: none; } }

/* ---------- Switch: the rail (Schiene). Off: hollow ring left, on: the punkt right ---------- */
.sl-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: 16px; line-height: 24px; }
.sl-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sl-switch__track { position: relative; width: 52px; height: 30px; flex: none; box-sizing: border-box; border: 1.5px solid var(--ink); border-radius: var(--radius-pill); }
.sl-switch__track::after { content: ""; position: absolute; top: 3.5px; left: 3.5px; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); transition: transform 180ms cubic-bezier(.3, 1.3, .5, 1), background 120ms ease, border-color 120ms ease; }
.sl-switch input:checked + .sl-switch__track::after { transform: translateX(22px); background: var(--punkt); border-color: var(--punkt); }
.sl-switch input:focus-visible + .sl-switch__track { box-shadow: var(--focus-ring); }
.sl-switch input:disabled + .sl-switch__track { opacity: .4; }
@media (prefers-reduced-motion: reduce) { .sl-switch__track::after { transition: none; } }

/* ---------- Field: text stands on the edge ---------- */
.sl-field { display: flex; flex-direction: column; gap: 4px; max-width: 360px; }
.sl-field__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.sl-field__input {
  font: inherit; font-size: 20px; line-height: 28px; height: 44px; box-sizing: border-box; padding: 0;
  border: 0; border-bottom: var(--edge) solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
}
.sl-field__input::placeholder { color: var(--ink-muted); }
.sl-field__input:focus-visible { outline: none; border-bottom-color: var(--punkt); }
.sl-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sl-field--error .sl-field__input { border-bottom-color: var(--red); }
.sl-field--error .sl-field__hint { color: var(--red); }

/* ---------- Card ---------- */
.sl-card { background: var(--paper-raised); color: var(--ink); border-radius: var(--radius-l); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.sl-card--line { background: var(--paper); border: var(--hairline) solid var(--ink); }
.sl-card__title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.02em; }
.sl-card__text { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ---------- Widget ---------- */
.sl-widget { background: var(--paper-raised); border-radius: var(--radius-l); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); box-sizing: border-box; }
.sl-widget__label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.sl-widget__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 56px; line-height: 56px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); }
.sl-widget--ink { background: var(--ink); }
.sl-widget--ink .sl-widget__label { color: var(--ink-muted); }
.sl-widget--ink .sl-widget__value { color: var(--on-ink); }
.sl-widget--ink .sl-edge::before { background: var(--ink-muted); }
.sl-widget--ink .sl-edge__done { background: var(--on-ink); }

/* ---------- List ---------- */
.sl-list { list-style: none; margin: 0; padding: 0; background: var(--paper-raised); border-radius: var(--radius-m); overflow: hidden; }
.sl-list__row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-4); }
.sl-list__row + .sl-list__row { border-top: var(--hairline) solid var(--line); }
.sl-list__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sl-list__title { font-size: 16px; line-height: 22px; }
.sl-list__sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sl-list__value { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sl-list__row--selected { background: var(--punkt-soft); }

/* ---------- App icon frames (previews only) ---------- */
.sl-appicon { display: block; overflow: hidden; border-radius: 22.37%; box-shadow: 0 0 0 1px var(--line); }
.sl-appicon img { width: 100%; height: 100%; display: block; }

/* ---------- Spec: product card with type number and data sheet ---------- */
.sl-spec { background: var(--paper); border: var(--hairline) solid var(--ink); border-radius: var(--radius-l); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sl-spec__head { display: flex; justify-content: space-between; align-items: center; }
.sl-spec__name { font-size: 28px; line-height: 30px; font-weight: 800; letter-spacing: -0.045em; }
.sl-spec__what { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sl-spec__table { border-top: var(--hairline) solid var(--ink); display: flex; flex-direction: column; }
.sl-spec__row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; }
.sl-spec__row + .sl-spec__row { border-top: var(--hairline) solid var(--line); }
.sl-spec__row b { font-family: var(--font-mono); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.sl-status { display: inline-flex; align-items: center; gap: 6px; }
.sl-status::before { content: ""; width: 8px; height: 8px; box-sizing: border-box; border-radius: 50%; border: var(--hairline) solid var(--ink); }
.sl-status--on::before { background: var(--punkt); border-color: var(--punkt); }

/* ---------- Manual step ---------- */
.sl-step { display: flex; flex-direction: column; gap: 14px; }
.sl-step__art { position: relative; height: 150px; border-radius: var(--radius-l); background: var(--paper-raised); display: flex; align-items: center; justify-content: center; }
.sl-step__art .sl-callout { position: absolute; left: 14px; top: 14px; }
.sl-step__art img { width: 96px; height: 96px; }
[data-theme="dark"] .sl-step__art img { filter: invert(1) hue-rotate(180deg); }
.sl-step__title { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -0.035em; }
.sl-step__text { font-size: 15px; line-height: 22px; color: var(--ink-muted); }

/* ---------- Punkt: every name ends with it ---------- */
/* Usage: <span class="sl-spec__name">capture<span class="sl-punkt"></span></span>. Diameter = half the x-height of the font it follows. */
.sl-punkt { display: inline-block; width: .272em; height: .272em; margin-left: .085em; border-radius: 50%; background: var(--punkt); vertical-align: -.012em; flex: none; }
.sl-punkt--open { background: transparent; box-shadow: inset 0 0 0 max(1.5px, .05em) var(--punkt); }
