.p5w {
  --p5-bg: #f3f2f2; --p5-surface: #eae9e9; --p5-text: #201e1d;
  --p5-accent: #ec3013; --p5-accent-600: #dd2b0f; --p5-accent-700: #ae1800; --p5-accent-900: #4d170e;
  --p5-n300: #d7d3d3; --p5-n700: #605d5d; --p5-n900: #2d2b2b;
  --p5-divider: color-mix(in srgb, #201e1d 40%, transparent);
  --p5-shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --p5-shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
  --p5-font: "Archivo", system-ui, sans-serif;
  --p5-h: 112px;
  font-family: var(--p5-font); color: var(--p5-text); line-height: 1.4;
}
.p5w *, .p5w *::before, .p5w *::after { box-sizing: border-box; }
.p5w button { font: inherit; border-radius: 0; margin: 0; text-transform: none; letter-spacing: normal; }
.p5w button:focus { outline: none; }
.p5w button:focus-visible, .p5w a:focus-visible { outline: 2px solid var(--p5-accent); outline-offset: 2px; }
.p5w [hidden] { display: none !important; }

/* Bar */
.p5w-bar {
  position: fixed; right: 16px; bottom: 16px; z-index: 99990;
  display: flex; height: var(--p5-h); max-width: calc(100vw - 32px);
  box-shadow: var(--p5-shadow-md);
}
.p5w-logo { width: var(--p5-h); height: 100%; flex: none; display: block; max-width: none; margin: 0; padding: 0; border: 0; object-fit: cover; }
.p5w-info {
  width: 270px; min-width: 0; flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 0 12px calc(var(--p5-h) / 4);
  background: var(--p5-surface);
  border-top: 2px solid var(--p5-text); border-bottom: 2px solid var(--p5-text);
}
.p5w-no-cookies .p5w-info { padding-bottom: 0; }
.p5w-row { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.1; }
.p5w-play {
  width: 36px; height: 36px; flex: none; padding: 0; display: grid; place-items: center;
  border: 0; background: var(--p5-text); color: var(--p5-bg); cursor: pointer;
}
.p5w-play:hover { background: var(--p5-n700); }
.p5w-play:active { background: var(--p5-n900); }
.p5w-play svg { display: block; }
.p5w-i-pause { display: none !important; }
.p5w-playing .p5w-i-pause { display: block !important; }
.p5w-playing .p5w-i-play { display: none !important; }
.p5w-title { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p5w-sub { font-size: 13px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.8; }

/* Cookie button */
.p5w-cookie-btn {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  height: calc(var(--p5-h) / 4); min-width: calc(var(--p5-h) / 4);
  padding: 0 calc((var(--p5-h) / 4 - 16px) / 2);
  display: flex; align-items: center; justify-content: flex-start;
  border: 0; background: var(--p5-accent); color: var(--p5-bg);
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: padding 220ms ease;
}
.p5w-cookie-btn:hover { background: var(--p5-accent-600); }
.p5w-cookie-btn:active { background: var(--p5-accent-700); }
.p5w-cookie-btn svg { flex: none; display: block; }
.p5w-cookie-label {
  display: block; overflow: hidden; max-width: 0; margin-left: 0; opacity: 0;
  transition: max-width 260ms ease, margin-left 260ms ease, opacity 200ms ease;
}
.p5w-cookie-btn:hover, .p5w-cookie-btn:focus-visible { padding: 0 8px; }
.p5w-cookie-btn:hover .p5w-cookie-label, .p5w-cookie-btn:focus-visible .p5w-cookie-label { max-width: 200px; margin-left: 8px; opacity: 1; }
.p5w-solo { position: fixed; right: 16px; bottom: 16px; z-index: 99990; width: 28px; height: 28px; box-shadow: var(--p5-shadow-md); --p5-h: 112px; }

/* Toast */
.p5w-toast {
  position: fixed; right: 16px; bottom: calc(16px + var(--p5-h) + 8px); z-index: 99991;
  height: 44px; display: flex; align-items: center; padding: 0 12px;
  background: var(--p5-text); color: var(--p5-bg); font-size: 14px;
  animation: p5wFade 160ms ease-out;
}

/* Dialog */
.p5w-backdrop {
  position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--p5-n900) 50%, transparent);
  animation: p5wFade 160ms ease-out;
}
.p5w-dialog {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  display: flex; flex-direction: column;
  background: var(--p5-surface); box-shadow: var(--p5-shadow-lg); color: var(--p5-text);
  animation: p5wIn 200ms ease-out;
}
.p5w-dhead { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 2px solid var(--p5-divider); }
.p5w-kicker { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.p5w-close { width: 32px; height: 32px; margin-right: -8px !important; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; }
.p5w-close:hover { background: color-mix(in srgb, var(--p5-text) 7%, transparent); }
.p5w-dbody { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.p5w-h { margin: 0; font-family: var(--p5-font); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.015em; color: inherit; }
.p5w-p { margin: 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.p5w-p a { color: var(--p5-accent-700); text-underline-offset: 3px; }
.p5w-p a:hover { color: var(--p5-accent-900); }
.p5w-cats { display: flex; flex-direction: column; border-top: 2px solid var(--p5-divider); }
.p5w-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--p5-n300); }
.p5w-cat-l { font-weight: 600; font-size: 15px; }
.p5w-cat-d { font-size: 13px; line-height: 1.4; opacity: 0.8; }
.p5w-switch { width: 44px; height: 24px; padding: 2px; border: 2px solid var(--p5-text); background: transparent; display: flex; justify-content: flex-start; cursor: pointer; }
.p5w-switch span { width: 16px; height: 16px; display: block; background: var(--p5-text); }
.p5w-switch[aria-checked="true"] { background: var(--p5-accent); justify-content: flex-end; }
.p5w-switch[aria-checked="true"] span { background: var(--p5-bg); }
.p5w-switch:disabled { opacity: 0.5; cursor: not-allowed; }
.p5w-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; border-top: 2px solid var(--p5-divider); }
.p5w-btn { height: 40px; padding: 0 16px; display: flex; align-items: center; justify-content: flex-start; text-align: left; border: 2px solid transparent; background: transparent; color: var(--p5-text); font-size: 15px; font-weight: 600; cursor: pointer; }
.p5w-btn-pri { background: var(--p5-accent); color: var(--p5-bg); }
.p5w-btn-pri:hover { background: var(--p5-accent-600); }
.p5w-btn-pri:active { background: var(--p5-accent-700); }
.p5w-btn-sec { border-color: var(--p5-divider); }
.p5w-btn-sec:hover { background: color-mix(in srgb, var(--p5-text) 7%, transparent); }
.p5w-btn-sec:active { background: color-mix(in srgb, var(--p5-text) 14%, transparent); }
.p5w-btn-ghost { grid-column: 1 / -1; padding-inline: 0; color: var(--p5-accent-700); }
.p5w-btn-ghost:hover { background: color-mix(in srgb, var(--p5-accent) 10%, transparent); }

@keyframes p5wIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes p5wFade { from { opacity: 0; } to { opacity: 1; } }

/* Mobil: dockad i botten */
@media (max-width: 640px) {
  .p5w { --p5-h: 80px; }
  .p5w-bar { left: 0; right: 0; bottom: 0; max-width: none; }
  .p5w-info { width: auto; }
  .p5w-toast { right: 0; left: 0; bottom: calc(var(--p5-h) + 8px); }
  .p5w-cookie-btn:hover, .p5w-cookie-btn:focus-visible { padding: 0 calc((var(--p5-h) / 4 - 16px) / 2); }
  .p5w-cookie-btn:hover .p5w-cookie-label, .p5w-cookie-btn:focus-visible .p5w-cookie-label { max-width: 0; margin-left: 0; opacity: 0; }
  body { padding-bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .p5w *, .p5w *::before, .p5w *::after { animation: none !important; transition: none !important; }
}
