/* Porterad från affectUI Shimmer Loader (motion), MIT, Copyright (c) 2026 Florian Höller */
/* Ändrat: skenet sveper två gånger när man klickar på Spela upp, sedan visas innehållet; inga oändliga loopar */
.ui-shm,
.ui-shm-text {
  --ui-shm-base: #ececec;
  --ui-shm-glow: rgba(255, 255, 255, 0.9);
  --ui-shm-text: rgba(0, 0, 0, 0.58);
  --ui-shm-text-glow: #D9601C;
  --ui-shm-dur: 2.2s;
}
.ui-shm {
  display: block;
  flex: none;
  width: 100%;
  height: 12px;
  max-width: 100%;
  border-radius: 6px;
  background-color: var(--ui-shm-base);
  background-image: linear-gradient(100deg, transparent 0%, transparent 30%, var(--ui-shm-glow) 50%, transparent 70%, transparent 100%);
  background-size: 150vw 100%;
  background-repeat: repeat-x;
  background-attachment: fixed;
  background-position: -50vw 0;
}
.nsh-card[data-loading] .ui-shm { animation: ui-shm-sweep var(--ui-shm-dur) linear 2; }
@keyframes ui-shm-sweep { from { background-position: -50vw 0; } to { background-position: 100vw 0; } }

.ui-shm-text {
  display: inline-block;
  color: var(--ui-shm-text);
  background-image: linear-gradient(90deg, var(--ui-shm-text) 0%, var(--ui-shm-text) 40%, var(--ui-shm-text-glow) 50%, var(--ui-shm-text) 60%, var(--ui-shm-text) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nsh-card[data-loading] .ui-shm-text { animation: ui-shm-text 2.2s linear 2; }
@keyframes ui-shm-text { from { background-position: 100% 0; } to { background-position: 0% 0; } }

@media (prefers-reduced-motion: reduce) {
  .ui-shm { animation: none !important; background-image: none; }
  .ui-shm-text { animation: none !important; background-image: none; -webkit-text-fill-color: currentColor; }
}

/* Kortet runt omkring */
.nsh-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.88);
  overflow: hidden;
}
.nsh-card *, .nsh-card *::before, .nsh-card *::after { box-sizing: border-box; }
.nsh-card ul { margin: 0; padding: 0; list-style: none; }
.nsh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0 16px; border-bottom: 0.5px solid rgba(0, 0, 0, 0.06); }
.nsh-title { font-weight: 500; color: #000; }
.nsh-state { font-size: 12px; color: #1E7A4C; font-weight: 500; }
.nsh-card[data-loading] .nsh-state { color: rgba(0, 0, 0, 0.58); font-weight: 400; }
.nsh-body { padding: 4px 16px; min-height: 154px; }
.nsh-skel[hidden], .nsh-list[hidden] { display: none; }
.nsh-skel li, .nsh-list li { display: flex; align-items: center; gap: 10px; height: 48px; }
.nsh-skel li + li, .nsh-list li + li { border-top: 0.5px solid rgba(0, 0, 0, 0.06); }
.nsh-lines { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.nsh-list[data-in] li { animation: nsh-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.nsh-list[data-in] li:nth-child(2) { animation-delay: 60ms; }
.nsh-list[data-in] li:nth-child(3) { animation-delay: 120ms; }
@keyframes nsh-in { from { opacity: 0; transform: translateY(4px); } }
.nsh-av { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.61); font-size: 12px; font-weight: 600; }
.nsh-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nsh-t b { font-weight: 500; color: #000; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsh-t small { font-size: 12px; line-height: 16px; color: rgba(0, 0, 0, 0.58); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsh-amt { font-variant-numeric: tabular-nums; white-space: nowrap; color: rgba(0, 0, 0, 0.88); }
.nsh-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 0.5px solid rgba(0, 0, 0, 0.06); background: #FCFCFB; }
.nsh-think { min-width: 0; font-size: 12px; line-height: 16px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsh-play {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 10px 0 8px; margin: 0; border: 0; border-radius: 6px;
  background: #fff; color: rgba(0, 0, 0, 0.88);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font: 500 13px/20px var(--sans); cursor: pointer;
}
.nsh-play:focus-visible { outline: 2px solid rgba(217, 96, 28, 0.4); outline-offset: 1px; }
.nsh-play svg { width: 12px; height: 12px; fill: #D9601C; }
.nsh-play:disabled { opacity: 0.45; cursor: default; }

/* Mörkt läge, samma konvention som affectUI */
:where(.dark, [data-theme="dark"]) .ui-shm, :where(.dark, [data-theme="dark"]) .ui-shm-text {
  --ui-shm-base: rgba(255, 255, 255, 0.07);
  --ui-shm-glow: rgba(255, 255, 255, 0.12);
  --ui-shm-text: rgba(255, 255, 255, 0.58);
  --ui-shm-text-glow: #F08A4B;
}
:where(.dark, [data-theme="dark"]) .nsh-card { background: #1C1B1A; box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.9); }
:where(.dark, [data-theme="dark"]) .nsh-head, :where(.dark, [data-theme="dark"]) .nsh-foot { border-color: rgba(255, 255, 255, 0.08); }
:where(.dark, [data-theme="dark"]) .nsh-skel li + li, :where(.dark, [data-theme="dark"]) .nsh-list li + li { border-top-color: rgba(255, 255, 255, 0.08); }
:where(.dark, [data-theme="dark"]) .nsh-title, :where(.dark, [data-theme="dark"]) .nsh-t b { color: rgba(255, 255, 255, 0.94); }
:where(.dark, [data-theme="dark"]) .nsh-state { color: #3EC27A; }
:where(.dark, [data-theme="dark"]) .nsh-card[data-loading] .nsh-state, :where(.dark, [data-theme="dark"]) .nsh-t small { color: rgba(255, 255, 255, 0.58); }
:where(.dark, [data-theme="dark"]) .nsh-av { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.64); }
:where(.dark, [data-theme="dark"]) .nsh-amt { color: rgba(255, 255, 255, 0.9); }
:where(.dark, [data-theme="dark"]) .nsh-foot { background: #201F1E; }
:where(.dark, [data-theme="dark"]) .nsh-think { color: rgba(255, 255, 255, 0.64); }
:where(.dark, [data-theme="dark"]) .nsh-play { background: #1C1B1A; color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4); }
:where(.dark, [data-theme="dark"]) .nsh-play:hover { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 1px 3px rgba(0, 0, 0, 0.5); }

/* Inga bokstavsavatarer: namnet står som text */
.nsh-av { display: none !important; }
