/* Mechanics: "Try the settings".
 * A Kirigami-style settings window. The preview strip on top (.sp) is drawn
 * in a fixed 240px-high design space that js/features.js scales to fit.
 * Without JS the preview and sidebar are hidden and every page is stacked. */

main > section.setw > .section-title + .setw-intro,
.setw-intro {
  margin: 0.75rem 0 0;
  color: var(--bone-dim);
  font-size: 1.05rem;
}

main > section.setw > .setw-intro ~ .sw { margin-top: clamp(1.5rem, 3vw, 2.25rem); }

.sw-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sw-vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Window + colour scheme ---------- */

.sw {
  --sw-bg: var(--ink);
  --sw-side: #140e0b;
  --sw-card: var(--ink-2);
  --sw-fg: var(--bone);
  --sw-dim: var(--bone-dim);
  --sw-mut: var(--muted);
  --sw-line: var(--line);
  --sw-line2: var(--line-strong);
  --sw-field: rgba(0, 0, 0, 0.28);
  --sw-hover: rgba(244, 236, 224, 0.06);
  --pv-panel: rgba(24, 17, 13, 0.78);
  --pv-solid: #231a14;
  --pv-edge: rgba(244, 236, 224, 0.14);
  --pv-winbg: #2b211a;
  --pv-winbar: #1f1712;
  --pv-winline: rgba(244, 236, 224, 0.16);

  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-win);
  background: var(--sw-bg);
  color: var(--sw-fg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.sw[data-scheme="light"] {
  --sw-bg: #eff0f1;
  --sw-side: #e3e5e7;
  --sw-card: #fcfcfc;
  --sw-fg: #232629;
  --sw-dim: #3b4045;
  --sw-mut: #5a6168;
  --sw-line: rgba(35, 38, 41, 0.12);
  --sw-line2: rgba(35, 38, 41, 0.24);
  --sw-field: #fff;
  --sw-hover: rgba(35, 38, 41, 0.06);
  --pv-panel: rgba(239, 240, 241, 0.82);
  --pv-solid: #eff0f1;
  --pv-edge: rgba(35, 38, 41, 0.16);
  --pv-winbg: #fcfcfc;
  --pv-winbar: #e3e5e7;
  --pv-winline: rgba(35, 38, 41, 0.16);
}

.sw :focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.sw[data-scheme="light"] :focus-visible { box-shadow: 0 0 0 4px rgba(35, 38, 41, 0.55); }

.sw-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  background: var(--sw-side);
  border-bottom: 1px solid var(--sw-line);
  font-size: 0.86rem;
  color: var(--sw-dim);
}

.sw-appicon svg { display: block; width: 18px; height: 18px; fill: var(--night); }
.sw-wintitle { flex: 1; text-align: center; font-weight: 600; }
.sw-winbtns { display: flex; gap: 8px; }
.sw-winbtns i {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--sw-mut);
  opacity: 0.7;
}
.sw-winbtns i:last-child { border-color: transparent; background: var(--sw-mut); }

.sw-live {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------- Body: sidebar + pages ---------- */

.sw-body { display: block; }

html.js .sw-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}

.sw-side {
  /* offsetParent for the tab scroll math in js/features.js (offsetLeft). */
  position: relative;
  background: var(--sw-side);
  border-right: 1px solid var(--sw-line);
  padding: 10px 8px;
}

.sw-tabs { display: flex; flex-direction: column; gap: 2px; }

.sw-tabs [role="tab"] {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sw-dim);
  font: inherit;
  font-size: 0.93rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.sw-tabs [role="tab"] svg {
  flex: none;
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sw-tabs [role="tab"]:hover { background: var(--sw-hover); color: var(--sw-fg); }

.sw-tabs [role="tab"][aria-selected="true"] {
  background: color-mix(in srgb, var(--blue) 22%, transparent);
  color: var(--sw-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 55%, transparent);
}

.sw-tabs [role="tab"]:focus-visible { outline-offset: -2px; }

.sw-pages {
  min-width: 0;
  padding: 18px clamp(14px, 2.4vw, 28px) 24px;
}

html.js .sw-pages { display: grid; }
html.js .sw-page { grid-area: 1 / 1; min-width: 0; }
html.js .sw-page.is-off { visibility: hidden; }

.sw-page + .sw-page { margin-top: 28px; }
html.js .sw-page + .sw-page { margin-top: 0; }

.sw-page-h {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.sw-lede { margin: 0 0 12px; font-size: 0.92rem; color: var(--sw-mut); }
.sw-page-h + .sw-card { margin-top: 12px; }

/* FormCard */
.sw-card {
  border: 1px solid var(--sw-line);
  border-radius: 8px;
  background: var(--sw-card);
}

.sw-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 18px;
  min-width: 0;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--sw-line);
}

.sw-card > .sw-row:first-child { border-top: 0; }

.sw-row--stack { grid-template-columns: minmax(0, 1fr); }

fieldset.sw-row { display: block; min-inline-size: 0; }

/* <legend> can't be a grid item, so float it into the flow. */
fieldset.sw-row > legend { float: left; width: 100%; padding: 0; }
fieldset.sw-row > .sw-help { clear: both; padding-top: 3px; }

.sw-text { min-width: 0; }

.sw-label {
  display: inline;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sw-fg);
}

.sw-out {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--sw-field);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--sw-fg);
}

.sw-help {
  margin: 3px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--sw-mut);
}

.sw-help code { font-family: var(--mono); font-size: 0.92em; color: var(--sw-dim); }

.sw-hint { margin: 8px 0 0; font-size: 0.8rem; color: var(--sw-mut); }

html:not(.js) .js-only,
html:not(.js) .sw-stage,
html:not(.js) .sw-titlebar { display: none; }

/* Switch (input role=switch) */
.sw-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 38px; height: 22px;
  margin: 0;
  border-radius: 11px;
  border: 1px solid var(--sw-line2);
  background: var(--sw-field);
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s;
}

.sw-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--sw-dim);
  transition: transform 0.18s var(--ease-out), background-color 0.18s;
}

.sw-switch:checked { background: var(--blue); border-color: var(--blue); }
.sw-switch:checked::after { transform: translateX(16px); background: #fff; }

/* Slider */
.sw-range {
  width: 100%;
  margin: 6px 0 0;
  accent-color: var(--blue);
  cursor: pointer;
}

/* Segmented radio group */
.sw-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sw-seg label { position: relative; display: inline-flex; }

.sw-seg input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.sw-seg span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--sw-line2);
  border-radius: 6px;
  background: var(--sw-field);
  font-size: 0.86rem;
  color: var(--sw-dim);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.sw-seg label:hover span { color: var(--sw-fg); }

.sw-seg input:checked + span {
  background: color-mix(in srgb, var(--blue) 24%, transparent);
  border-color: var(--blue);
  color: var(--sw-fg);
}

.sw-seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.sw-seg input:disabled + span { opacity: 0.45; }
.sw-seg input:disabled { cursor: not-allowed; }

.sw-select {
  min-height: 32px;
  padding: 4px 30px 4px 10px;
  border: 1px solid var(--sw-line2);
  border-radius: 6px;
  background: var(--sw-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23a89684' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--sw-fg);
  font: inherit;
  font-size: 0.88rem;
  appearance: none;
  cursor: pointer;
}

.sw-select option { background: var(--sw-card); color: var(--sw-fg); }

.sw-btn {
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid var(--sw-line2);
  border-radius: 6px;
  background: var(--sw-field);
  color: var(--sw-fg);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}

.sw-btn:hover { border-color: var(--blue); }

.sw-try {
  font-size: 0.8rem;
  color: var(--sw-mut);
  white-space: nowrap;
}

.sw-try::before { content: "\2191\00a0"; color: var(--blue); }

/* Reorder chips */
.sw-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.sw-order button {
  display: block;
  width: 40px; height: 40px;
  padding: 4px;
  border: 1px solid var(--sw-line2);
  border-radius: 8px;
  background: var(--sw-field);
  color: var(--blue);
  cursor: grab;
}

.sw-order svg { display: block; width: 100%; height: 100%; }

/* Shortcuts table */
.sw-keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.sw-keys caption {
  padding: 12px 16px 6px;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-mut);
}

.sw-keys th,
.sw-keys td {
  padding: 8px 16px;
  border-top: 1px solid var(--sw-line);
  text-align: left;
  vertical-align: middle;
  color: var(--sw-dim);
}

.sw-keys thead th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sw-mut);
}

.sw-keys tbody th { font-weight: 400; white-space: nowrap; }

.sw-keys + .sw-hint { padding: 0 16px 12px; }

.sw-key {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: -4px -8px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sw-key:hover { border-color: var(--sw-line2); background: var(--sw-hover); }
.sw-key.is-hit kbd { border-color: var(--blue); color: var(--blue); }

.sw kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.12em 0.45em;
  border: 1px solid var(--sw-line2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--sw-field);
  font-family: var(--mono);
  font-size: 0.8em;
  line-height: 1.5;
  text-align: center;
  color: var(--sw-fg);
  transition: border-color 0.15s, color 0.15s;
}

/* ---------- Preview stage ---------- */

.sw-stage {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-bottom: 1px solid var(--sw-line);
  background: var(--night);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.sp {
  position: absolute;
  top: 0; left: 0;
  width: var(--pv-w, 480px);
  height: 240px;
  transform: scale(var(--pv-k, 1));
  transform-origin: 0 0;
  overflow: hidden;
  font-family: var(--font);
  --b: 38px;
}

.sp-wall {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 90% at 12% 115%, var(--glow), transparent 70%),
    radial-gradient(55% 80% at 92% -12%, color-mix(in srgb, var(--blue) 34%, transparent), transparent 72%),
    linear-gradient(165deg, var(--ink-2), var(--night) 70%);
}

.sp-wall::before,
.sp-wall::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 130%;
  height: 46%;
  transform: skewY(-9deg);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue) 18%, transparent) 45%, transparent);
}

.sp-wall::before { top: 30%; }
.sp-wall::after { top: 55%; opacity: 0.5; transform: skewY(-4deg); }

.sp-tray {
  position: absolute;
  top: 8px; right: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.sp-pill {
  display: none;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(17, 12, 9, 0.72);
  border: 1px solid rgba(244, 236, 224, 0.14);
  font-size: 10.5px;
  font-weight: 600;
  color: #e6e9ec;
  white-space: nowrap;
}

.sp-pill svg { width: 11px; height: 11px; fill: currentColor; }

.sw[data-dnd="on"] .sp-pill-dnd { display: inline-flex; }
.sp-pill-att.is-on { display: inline-flex; }

/* Mock app window */
.sp-win {
  position: absolute;
  top: 18px;
  left: 14%;
  width: min(58%, 330px);
  height: 150px;
  border-radius: 7px;
  background: var(--pv-winbg);
  border: 1px solid var(--pv-winline);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  z-index: 1;
  will-change: transform;
}

.sp-win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  background: var(--pv-winbar);
  font-size: 10px;
  color: var(--sw-dim);
}

.sp-win-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.sp-win-bar b { font-weight: 600; }

.sp-win-body { padding: 10px 12px; display: grid; gap: 8px; }
.sp-win-body i { display: block; height: 7px; border-radius: 4px; background: var(--pv-winline); }
.sp-win-body i:nth-child(1) { width: 62%; }
.sp-win-body i:nth-child(2) { width: 84%; }
.sp-win-body i:nth-child(3) { width: 45%; }
.sp-win-body i:nth-child(4) { width: 70%; }

.sp-win.is-swap .sp-win-body { animation: sp-swap 0.35s var(--ease-out); }

@keyframes sp-swap {
  from { opacity: 0.2; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

/* Dock */
.sp-dock {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.35s;
}

.sp-dock.is-hidden { transform: translateY(calc(var(--b) + 26px)); }

.sp-bar {
  position: absolute;
  left: 0;
  bottom: 8px;
  height: calc(var(--b) + 16px);
  border-radius: 12px;
  background: var(--pv-panel);
  border: 1px solid var(--pv-edge);
  transform-origin: 0 50%;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.sw[data-bg="clear"] .sp-bar { background: transparent; border-color: transparent; }
.sw[data-bg="tint"] .sp-bar {
  background: color-mix(in srgb, var(--blue) 30%, rgba(17, 12, 9, 0.35));
  border-color: color-mix(in srgb, var(--blue) 50%, transparent);
}
.sw[data-bg="acrylic"] .sp-bar {
  background: rgba(244, 236, 224, 0.13);
  border-color: rgba(244, 236, 224, 0.24);
  backdrop-filter: blur(10px) saturate(1.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
}

.sp-ico {
  position: absolute;
  left: 0;
  bottom: 16px;
  width: var(--b);
  height: var(--b);
  transform-origin: 50% 100%;
  will-change: transform;
}

.sp-tile { display: block; width: 100%; height: 100%; color: var(--blue); transform-origin: 50% 100%; }
.sp-tile svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }

/* Icon themes with built-in padding: shown when "Icon size normalization" is off */
.sw[data-even="off"] .sp-ico[data-app="firefox"] .sp-tile,
.sw[data-even="off"] .sp-ico[data-app="kmail"] .sp-tile { transform: scale(0.72); }
.sw[data-even="off"] .sp-ico[data-app="settings"] .sp-tile { transform: scale(0.82); }
.sp-tile { transition: transform 0.25s var(--ease-out); }

.sp-dot {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--sw-fg);
  transition: opacity 0.2s;
}

.sp-ico.is-closed .sp-dot { opacity: 0; }

.sp-badge {
  position: absolute;
  top: -4px; right: -5px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #da4453;
  border: 1.5px solid var(--pv-solid);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

.sw[data-badge="dot"] .sp-badge { min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; top: -2px; right: -2px; }
.sw[data-badge="off"] .sp-badge { display: none; }

.sp-prog {
  position: absolute;
  left: 12%; right: 12%;
  bottom: 3px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: none;
}

.sp-prog i {
  display: block;
  height: 100%;
  background: var(--sw-fg);
  transform-origin: 0 50%;
  transform: scaleX(0.62);
}

.sw[data-page="attention"] .sp-prog { display: block; }
.sw[data-page="attention"] .sp-prog i { animation: sp-prog 7s linear infinite; }

@keyframes sp-prog { from { transform: scaleX(0.05); } to { transform: scaleX(1); } }

.sp-wheel {
  position: absolute;
  left: 50%;
  top: -18px;
  width: 10px; height: 14px;
  margin-left: -5px;
  border: 1.5px solid #fff;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.sp-wheel::after {
  content: "";
  position: absolute;
  left: 50%; top: 2px;
  width: 2px; height: 3px;
  margin-left: -1px;
  background: #fff;
  border-radius: 1px;
}

.sp-wheel.is-on { opacity: 0.9; }
.sp-wheel.is-on::after { animation: sp-wheel 0.9s ease-in-out infinite; }
@keyframes sp-wheel { from { transform: translateY(0); } to { transform: translateY(5px); opacity: 0; } }

/* Launch / attention animations on the tile */
.sp-tile.a-launch { animation: sp-bounce 0.55s var(--ease-out) 2; }
.sp-tile.a-bounce { animation: sp-bounce 0.7s var(--ease-out) infinite; }
.sp-tile.a-wiggle { animation: sp-wiggle 0.5s ease-in-out infinite; }
.sp-tile.a-pulse { animation: sp-pulse 0.9s ease-in-out infinite; }
.sp-tile.a-glow svg { animation: sp-glow 1.1s ease-in-out infinite; }
.sp-tile.a-blink { animation: sp-blink 0.8s steps(2, jump-none) infinite; }
.sp-ico.a-dot .sp-dot { background: #f67400; width: 12px; margin-left: -6px; border-radius: 2px; opacity: 1; animation: sp-dotc 0.8s ease-in-out infinite; }

@keyframes sp-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-45%); } 70% { transform: translateY(-8%); } }
@keyframes sp-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes sp-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes sp-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 14px var(--blue)) drop-shadow(0 0 5px var(--blue)); }
}
@keyframes sp-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes sp-dotc { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Static attention cue for reduced motion */
.sp-tile.a-static svg { filter: drop-shadow(0 0 6px var(--blue)); }

/* Keyboard walk ring */
.sp-ico.is-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--blue);
  border-radius: 12px;
}

.sp-ico.is-drag { z-index: 2; }
.sw[data-page="plasma"] .sp-dock { pointer-events: none; }
.sw[data-page="plasma"] .sw-stage { cursor: grab; }

/* Fake pointer */
.sp-cursor {
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 20px;
  fill: #fff;
  stroke: #111;
  stroke-width: 1.2;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.sp-cursor.is-on { opacity: 1; }

/* Preview popup */
.sp-pop {
  position: absolute;
  top: 26px;
  left: 0;
  z-index: 4;
  display: none;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--pv-solid);
  border: 1px solid var(--pv-edge);
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.7);
}

.sw[data-page="previews"][data-preview="on"] .sp-pop { display: flex; }

.sp-th { position: relative; }
.sp-th.is-gone { display: none; }

.sp-th-raise {
  display: grid;
  gap: 4px;
  width: 104px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--sw-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sp-th-raise:hover,
.sp-th.is-hover .sp-th-raise { background: var(--sw-hover); border-color: color-mix(in srgb, var(--blue) 60%, transparent); }

.sp-th-title { font-size: 9.5px; font-weight: 600; padding-right: 16px; white-space: nowrap; }

.sp-th-shot {
  position: relative;
  display: block;
  height: 60px;
  border-radius: 4px;
  background: #1b1e20;
  overflow: hidden;
}

.sp-th-lines { display: grid; gap: 5px; padding: 6px; }
.sp-th-lines i { display: block; height: 3px; border-radius: 2px; background: #6fd08c; opacity: 0.8; }
.sp-th-lines i:nth-child(2n) { width: 70%; background: #d8dadc; }
.sp-th-lines i:nth-child(3n) { width: 45%; }
.sp-th-lines { animation: sp-scroll 2.4s steps(8) infinite; }
@keyframes sp-scroll { to { transform: translateY(-64px); } }
.sp-th[data-th="1"] .sp-th-lines { animation-duration: 3.1s; }
.sp-th[data-th="2"] .sp-th-lines { animation-duration: 1.9s; }

.sp-th-close {
  position: absolute;
  top: 5px; right: 5px;
  width: 16px; height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #da4453;
  cursor: pointer;
}

.sp-th-close svg { display: block; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

/* Screens view */
.sp-screens {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5%;
  background: var(--night);
}

.sw[data-page="screens"] .sp-screens { display: flex; }
.sw[data-page="screens"] .sp-dock,
.sw[data-page="screens"] .sp-win,
.sw[data-page="screens"] .sp-tray { visibility: hidden; }

.sp-mon {
  position: relative;
  width: min(230px, 44%);
  height: 150px;
  border: 5px solid #33271f;
  border-radius: 8px;
  background:
    radial-gradient(70% 90% at 20% 110%, var(--glow), transparent 70%),
    linear-gradient(165deg, var(--ink-2), var(--night) 75%);
  overflow: hidden;
}

.sp-mon::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -26px;
  width: 50px; height: 14px;
  margin-left: -25px;
  background: #33271f;
}

.sp-mon-n {
  position: absolute;
  top: 6px; left: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--bone-dim);
}

.sp-mon-win {
  position: absolute;
  top: 22px; left: 26%;
  width: 52%; height: 64px;
  border-radius: 4px;
  background: #2b211a;
  border: 1px solid rgba(244, 236, 224, 0.14);
  border-top: 9px solid #1f1712;
  transition: border-color 0.25s;
}

.sp-mon.is-focus .sp-mon-win { border-top-color: var(--blue); }

.sp-mdock {
  position: absolute;
  left: 50%; bottom: 7px;
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(24, 17, 13, 0.85);
  border: 1px solid rgba(244, 236, 224, 0.14);
  transform: translate(-50%, 40px);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}

.sp-mdock i { width: 14px; height: 14px; border-radius: 4px; background: var(--blue); transition: opacity 0.3s, width 0.3s; }
.sp-mdock i:nth-child(2) { background: #7d6c5e; }
.sp-mdock i:nth-child(3) { background: #ff7139; }
.sp-mdock i:nth-child(4) { background: #e8ebee; }
.sp-mdock i:nth-child(5) { background: #1b8a6b; }

.sp-screens[data-vd="dim"] .d2 { opacity: 0.3; }
.sp-screens[data-vd="current"] .d2 { width: 0; margin-left: -4px; opacity: 0; }

.sp-mon.has-dock .sp-mdock { transform: translate(-50%, 0); opacity: 1; }

.sp-mcursor { z-index: 8; }

/* Offscreen or background tab: freeze CSS loops too */
.sw.is-paused .sp *,
.sw.is-paused .sp *::after { animation-play-state: paused !important; }

/* ---------- Narrow ---------- */

@media (max-width: 760px) {
  html.js .sw-body { grid-template-columns: minmax(0, 1fr); }

  .sw-side {
    border-right: 0;
    border-bottom: 1px solid var(--sw-line);
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .sw-tabs { flex-direction: row; }
  .sw-tabs [role="tab"] { width: auto; min-height: 36px; padding: 6px 10px; gap: 7px; font-size: 0.86rem; }
  .sw-tabs [role="tab"] svg { width: 17px; height: 17px; }

  html.js .sw-page.is-off { display: none; }

  .sw-row { padding: 11px 12px; gap: 6px 12px; }
  .sw-keys th, .sw-keys td { padding: 8px 10px; }
  .sw-keys caption { padding: 10px 10px 4px; }
  .sw-keys tbody th { white-space: normal; }
  .sw-keys + .sw-hint { padding: 0 10px 10px; }
  .sw-wintitle { text-align: left; }
}

/* ---------- Reduced motion: no loops, instant state changes ---------- */

@media (prefers-reduced-motion: reduce) {
  .sp-dock,
  .sp-tile,
  .sp-mdock,
  .sp-bar,
  .sw-switch,
  .sw-switch::after { transition: none; }

  .sp-tile[class*="a-"],
  .sp-tile[class*="a-"] svg,
  .sp-ico.a-dot .sp-dot,
  .sp-th-lines,
  .sp-wheel.is-on::after,
  .sp-win.is-swap .sp-win-body,
  .sw[data-page="attention"] .sp-prog i { animation: none !important; }
}
