.styvi-site-preferences {
  --styvi-storage-paper: color-mix(in srgb, #fffaf0 88%, transparent);
  --styvi-storage-ink: #111015;
  --styvi-storage-muted: #68625b;
  --styvi-storage-line: #11101529;
  --styvi-storage-accent: #7c3cff;
  position: relative;
  z-index: 2147483000;
  color: var(--styvi-storage-ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.styvi-site-preferences *,
.styvi-site-preferences *::before,
.styvi-site-preferences *::after {
  box-sizing: border-box;
}

.styvi-storage-panel {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(22px, 4vw, 52px);
  width: min(1060px, calc(100% - 28px));
  margin-inline: auto;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--styvi-storage-line);
  border-radius: 28px;
  background: var(--styvi-storage-paper);
  box-shadow: 0 24px 80px #17101f2b;
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 30px));
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.styvi-storage-panel[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.styvi-storage-panel[hidden] {
  display: none;
}

.styvi-storage-copy {
  max-width: 680px;
}

.styvi-storage-eyebrow {
  margin: 0 0 7px;
  color: var(--styvi-storage-accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.styvi-storage-panel h2 {
  margin: 0;
  color: var(--styvi-storage-ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.styvi-storage-panel p {
  margin: 10px 0 0;
  color: var(--styvi-storage-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.styvi-storage-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 14px;
  color: var(--styvi-storage-muted);
  font-size: 0.73rem;
}

.styvi-storage-links a {
  color: var(--styvi-storage-ink);
  font-weight: 760;
  text-underline-offset: 0.18em;
}

.styvi-storage-status {
  min-height: 1.1em;
  font-size: 0.72rem !important;
}

.styvi-storage-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 9px;
}

.styvi-storage-actions button,
.styvi-storage-settings {
  min-height: 48px;
  border: 1px solid var(--styvi-storage-line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.styvi-storage-actions button {
  padding: 11px 18px;
  background: var(--styvi-storage-ink);
  color: #fffaf0;
  transition:
    opacity 150ms ease,
    transform 150ms ease,
    border-color 150ms ease;
}

.styvi-storage-actions button[data-styvi-storage-choice="all"] {
  border-color: var(--styvi-storage-accent);
  background: var(--styvi-storage-accent);
  color: white;
}

.styvi-storage-actions button:hover,
.styvi-storage-actions button:focus-visible,
.styvi-storage-settings:hover,
.styvi-storage-settings:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--styvi-storage-accent) 30%, transparent);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.styvi-storage-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.styvi-storage-settings {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: none;
  min-height: 40px;
  padding: 8px 14px;
  background: var(--styvi-storage-paper);
  color: var(--styvi-storage-ink);
  text-decoration: none;
  box-shadow: 0 12px 38px #17101f24;
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

.styvi-storage-settings[data-visible="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .styvi-site-preferences {
    --styvi-storage-paper: color-mix(in srgb, #141216 90%, transparent);
    --styvi-storage-ink: #faf7f0;
    --styvi-storage-muted: #aaa4ad;
    --styvi-storage-line: #faf7f026;
    --styvi-storage-accent: #9a67ff;
  }

  .styvi-storage-actions button {
    color: #111015;
    background: #faf7f0;
  }
}

html[data-theme="light"] .styvi-site-preferences,
html[data-styvi-preview-theme="light"] .styvi-site-preferences {
  --styvi-storage-paper: color-mix(in srgb, #fffaf0 88%, transparent);
  --styvi-storage-ink: #111015;
  --styvi-storage-muted: #68625b;
  --styvi-storage-line: #11101529;
  --styvi-storage-accent: #7c3cff;
}

html[data-theme="dark"] .styvi-site-preferences,
html[data-styvi-preview-theme="dark"] .styvi-site-preferences {
  --styvi-storage-paper: color-mix(in srgb, #141216 90%, transparent);
  --styvi-storage-ink: #faf7f0;
  --styvi-storage-muted: #aaa4ad;
  --styvi-storage-line: #faf7f026;
  --styvi-storage-accent: #9a67ff;
}

@media (max-width: 760px) {
  .styvi-storage-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 18px;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    border-radius: 24px;
  }

  .styvi-storage-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .styvi-storage-panel,
  .styvi-storage-actions button,
  .styvi-storage-settings {
    transition: none;
  }
}
