.vcc,
.vcc-modal {
  --vcc-surface: var(--color-surface, #fbfcfd);
  --vcc-surface-hover: var(--color-surface-hover, #e9edf2);
  --vcc-border: var(--color-border, #dbe0e7);
  --vcc-foreground: var(--color-foreground, #1b2433);
  --vcc-muted: var(--color-muted, #5e6b7d);
  --vcc-primary: var(--color-primary, #1e4fd8);
  --vcc-primary-hover: var(--color-primary-hover, #1a45bd);
  --vcc-primary-foreground: var(--color-primary-foreground, #ffffff);
  --vcc-tint: var(--vcc-surface-hover);
  --vcc-shadow: 0 12px 40px rgba(16, 29, 50, 0.12);
  --vcc-overlay: rgba(16, 29, 50, 0.4);
  font-family: inherit;
}

.vcc,
.vcc *,
.vcc-modal,
.vcc-modal * {
  box-sizing: border-box;
}

@supports (background: color-mix(in srgb, white, transparent)) {
  .vcc,
  .vcc-modal {
    --vcc-surface-hover: color-mix(in srgb, var(--vcc-surface) 94%, var(--vcc-foreground));
    --vcc-primary-hover: color-mix(in srgb, var(--vcc-primary) 88%, var(--vcc-foreground));
    --vcc-tint: color-mix(in srgb, var(--vcc-primary) 8%, var(--vcc-surface));
    --vcc-shadow: 0 12px 40px color-mix(in srgb, var(--shadow, var(--vcc-foreground)) 12%, transparent);
    --vcc-overlay: color-mix(in srgb, var(--negative-surface, var(--vcc-foreground)) 40%, transparent);
  }
}

[data-vcc-hidden] {
  display: none !important;
}

.vcc {
  position: fixed;
  z-index: 99990;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(480px, calc(100% - 24px));
  color: var(--vcc-foreground);
  transform: translateX(-50%);
}

.vcc--compact {
  width: min(420px, calc(100% - 24px));
}

.vcc--normal {
  width: min(480px, calc(100% - 24px));
}

.vcc--wide {
  width: min(560px, calc(100% - 24px));
}

.vcc__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  overflow: auto;
  padding: 12px;
  border: 0;
  border-radius: var(--vcc-radius, 4px);
  background: var(--vcc-surface);
  box-shadow: var(--vcc-shadow);
}

.vcc__heading {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--vcc-foreground);
}

.vcc__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vcc__description {
  margin: 10px 0 0;
  color: var(--vcc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.vcc__icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 6px;
  border-radius: 50%;
  background: var(--vcc-tint);
  color: var(--vcc-primary);
}

.vcc__icon svg {
  width: 100%;
  height: 100%;
}

.vcc__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.vcc__links a,
.vcc-preferences-link {
  color: var(--vcc-primary);
  text-decoration: none;
  transition: color 200ms ease, background-color 200ms ease;
}

.vcc__links a {
  padding: 2px 6px;
  border-radius: 4px;
}

.vcc__links a:hover {
  background: var(--vcc-tint);
  color: var(--vcc-primary-hover);
}

.vcc-preferences-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.vcc-inventory { width: 100%; overflow-x: auto; }
.vcc-inventory table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vcc-inventory caption { text-align: left; font-weight: 700; padding-bottom: 16px; }
.vcc-inventory th, .vcc-inventory td { vertical-align: top; padding: 12px; border-bottom: 1px solid var(--color-border, #d6dee6); text-align: left; overflow-wrap: anywhere; }

@media (max-width: 639px) {
  .vcc-inventory caption { display: block; width: 100%; }
  .vcc-inventory table, .vcc-inventory tbody, .vcc-inventory tr, .vcc-inventory td { display: block; }
  .vcc-inventory thead { display: none; }
  .vcc-inventory tr { padding-block: 12px; border-bottom: 1px solid var(--color-border, #d6dee6); }
  .vcc-inventory td { border: 0; padding: 4px 0; }
  .vcc-inventory td:first-child { font-weight: 700; }
}

.vcc__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  justify-self: stretch;
}

.vcc__button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.vcc__secondary-actions {
  display: contents;
}

.vcc__actions [data-vcc-open-preferences] { grid-column: 1 / -1; }

.vcc__secondary-actions .vcc__button {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
  line-height: 1.4;
}

.vcc__button--primary {
  border-color: var(--vcc-primary);
  background: var(--vcc-primary);
  color: var(--vcc-primary-foreground);
}

.vcc__button--primary:hover {
  border-color: var(--vcc-primary-hover);
  background: var(--vcc-primary-hover);
}

.vcc--button-outline .vcc__button--primary {
  background: transparent;
  color: var(--vcc-primary);
}

.vcc--button-outline .vcc__button--primary:hover {
  background: var(--vcc-tint);
  color: var(--vcc-primary-hover);
}

.vcc__button--secondary {
  border-color: var(--vcc-primary);
  background: var(--vcc-primary);
  color: var(--vcc-primary-foreground);
}

.vcc__button--secondary:hover {
  background: var(--vcc-primary-hover);
}

.vcc--button-outline .vcc__button--secondary {
  background: transparent;
  color: var(--vcc-primary);
}

.vcc__button--text:hover {
  background: var(--vcc-surface-hover);
}

.vcc__button--text {
  border-color: transparent;
  background: transparent;
  color: var(--vcc-foreground);
}

.vcc__button:focus-visible,
.vcc__links a:focus-visible,
.vcc-preferences-link:focus-visible,
.vcc-modal__close:focus-visible,
.vcc-switch input:focus-visible + span {
  outline: 2px solid var(--vcc-primary, var(--color-primary, #1e4fd8));
  outline-offset: 3px;
}

.vcc-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  color: var(--vcc-foreground);
}

.vcc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--vcc-overlay);
}

.vcc-modal__dialog {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 16px auto;
  overflow: auto;
  border: 0;
  border-radius: var(--vcc-radius, 4px);
  background: var(--vcc-surface);
  box-shadow: var(--vcc-shadow);
}

/* Respect the opaque Vantec surfaces even when backdrop effects are supported. */
@supports (background: color-mix(in srgb, white, transparent)) and ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .vcc__inner,
  .vcc-modal__dialog {
    background: var(--vcc-surface);
  }
}

.vcc-modal__header,
.vcc-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px;
}

.vcc-modal__header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
}

.vcc-modal__close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 10px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--vcc-tint);
  color: var(--vcc-foreground);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: background-color 200ms ease, color 200ms ease;
}

.vcc-modal__close:hover {
  background: var(--vcc-surface-hover);
  color: var(--vcc-primary);
}

.vcc-modal__close svg {
  width: 24px;
  height: 24px;
}

.vcc-modal__body {
  display: grid;
  gap: 12px;
  padding: 0 24px;
}

.vcc-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--vcc-border);
  border-radius: calc(var(--vcc-radius, 12px) * 0.75);
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.vcc-category:hover,
.vcc-category:focus-within {
  background: var(--vcc-tint);
}

.vcc-category__text {
  display: grid;
  gap: 4px;
}

.vcc-category__label {
  font-weight: 700;
}

.vcc-category__description {
  color: var(--vcc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.vcc-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
}

.vcc-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vcc-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--vcc-border);
  transition: background-color 200ms ease;
}

.vcc-switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--vcc-surface);
  content: "";
  transition: transform 200ms ease;
}

.vcc-switch input:checked + span {
  background: var(--vcc-primary);
}

.vcc-switch input:checked + span::after {
  transform: translateX(20px);
}

.vcc-switch input:disabled + span {
  opacity: 0.6;
  cursor: not-allowed;
}

body.vcc-modal-open {
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .vcc-modal__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .vcc__button {
    width: 100%;
  }

  .vcc__heading {
    font-size: 18px;
  }

  .vcc-modal__header,
  .vcc-modal__footer {
    padding: 20px;
  }

  .vcc-modal__body {
    padding: 0 20px;
  }

  .vcc-modal__header h2 {
    font-size: 21px;
  }

  .vcc-category {
    gap: 12px;
    padding: 14px;
  }
}

@media (min-width: 640px) {
  .vcc {
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
  }

  .vcc--compact {
    width: min(420px, calc(100% - 32px));
  }

  .vcc--normal {
    width: min(480px, calc(100% - 32px));
  }

  .vcc--wide {
    width: min(560px, calc(100% - 32px));
  }

  .vcc__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    justify-self: stretch;
  }

  .vcc__actions > .vcc__button,
  .vcc__secondary-actions .vcc__button {
    width: 100%;
    min-height: 44px;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.4;
  }

  .vcc__secondary-actions {
    display: contents;
  }

  .vcc__actions [data-vcc-open-preferences] { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .vcc__button,
  .vcc__links a,
  .vcc-preferences-link,
  .vcc-modal__close,
  .vcc-category,
  .vcc-switch span,
  .vcc-switch span::after {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .vcc__inner,
  .vcc-modal__dialog {
    background: var(--vcc-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
