.sgcc-banner,
.sgcc-banner *,
.sgcc-modal,
.sgcc-modal *,
.sgcc-backdrop,
.sgcc-settings {
  box-sizing: border-box;
}

.sgcc-banner[hidden],
.sgcc-modal[hidden],
.sgcc-backdrop[hidden] {
  display: none !important;
}

.sgcc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999997;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: sgcc-fade-in 160ms ease-out;
}

.sgcc-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999998;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 18px;
  color: #172033;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.06);
  font-family: inherit;
  text-align: left;
  animation: sgcc-slide-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sgcc-banner h2,
.sgcc-modal h2 {
  margin: 0;
  padding: 0;
  color: #111827;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.sgcc-banner__body > p:not(.sgcc-links),
.sgcc-modal__intro p {
  margin: 7px 0 0;
  padding: 0;
  color: #596273;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
}

.sgcc-links {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  color: #6b7280;
  font-size: 12.5px;
  line-height: 1.3;
}

.sgcc-links a,
.sgcc-links a:visited {
  color: #4b5563;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.sgcc-banner__actions,
.sgcc-modal__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.sgcc-btn {
  appearance: none;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid #d7dce3;
  border-radius: 9px;
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  white-space: normal;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.sgcc-btn--ghost,
.sgcc-btn--ghost:visited {
  color: #374151;
  background: #ffffff;
}

.sgcc-btn--ghost:hover {
  color: #111827;
  background: #f7f8fa;
  border-color: #b8c0cb;
}

.sgcc-btn--primary,
.sgcc-btn--primary:visited {
  color: #ffffff;
  background: #172033;
  border-color: #172033;
}

.sgcc-btn--primary:hover {
  color: #ffffff;
  background: #263248;
  border-color: #263248;
}

.sgcc-btn:active {
  transform: translateY(1px);
}

.sgcc-btn:focus-visible,
.sgcc-close:focus-visible,
.sgcc-settings:focus-visible,
.sgcc-inline-settings:focus-visible,
.sgcc-category input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.sgcc-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.sgcc-modal__card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  padding: 25px;
  color: #172033;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
  font-family: inherit;
  text-align: left;
  pointer-events: auto;
  animation: sgcc-modal-in 190ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sgcc-modal__intro {
  padding-right: 32px;
  margin-bottom: 18px;
}

.sgcc-close {
  appearance: none;
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0 0 2px;
  color: #4b5563;
  background: #f3f4f6;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  transition: color 140ms ease, background-color 140ms ease;
}

.sgcc-close:hover {
  color: #111827;
  background: #e7e9ed;
}

.sgcc-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  margin: 8px 0 0;
  padding: 12px 14px;
  color: #172033;
  background: #f8fafc;
  border: 1px solid #e6eaf0;
  border-radius: 11px;
  cursor: pointer;
}

.sgcc-category--necessary {
  cursor: default;
}

.sgcc-category strong {
  display: block;
  margin: 0;
  color: #1f2937;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.sgcc-category small {
  display: block;
  margin-top: 3px;
  color: #697386;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.sgcc-category input {
  appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  padding: 0;
  background: #cbd1d9;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.sgcc-category input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 150ms ease;
}

.sgcc-category input:checked {
  background: #172033;
}

.sgcc-category input:checked::after {
  transform: translateX(18px);
}

.sgcc-always {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #3d5b49;
  background: #e8f3ec;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.sgcc-modal__actions {
  grid-template-columns: 1fr 1fr;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #e8ebef;
}

.sgcc-settings {
  appearance: none;
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 999996;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 9px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.13);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.sgcc-settings:hover {
  color: #111827;
  border-color: rgba(15, 23, 42, 0.3);
  transform: translateY(-1px);
}

.sgcc-settings svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sgcc-inline-settings {
  appearance: none;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes sgcc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sgcc-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sgcc-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 620px) {
  .sgcc-banner {
    left: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 15px;
    border-radius: 14px;
  }

  .sgcc-banner h2,
  .sgcc-modal h2 {
    font-size: 17px;
  }

  .sgcc-banner__body > p:not(.sgcc-links) {
    font-size: 13px;
    line-height: 1.43;
  }

  .sgcc-banner__actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 12px;
  }

  .sgcc-banner__actions .sgcc-btn--primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .sgcc-btn {
    min-height: 38px;
    padding: 8px 7px;
    font-size: 12px;
  }

  .sgcc-modal {
    align-items: flex-end;
    padding: 0;
  }

  .sgcc-modal__card {
    width: 100%;
    max-height: 92dvh;
    padding: 20px 16px max(18px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
    animation-name: sgcc-sheet-in;
  }

  .sgcc-modal__intro {
    padding-right: 34px;
    margin-bottom: 14px;
  }

  .sgcc-category {
    min-height: 64px;
    padding: 11px 12px;
  }

  .sgcc-category small {
    font-size: 11.5px;
  }

  .sgcc-settings {
    left: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
  }
}

@keyframes sgcc-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sgcc-banner,
  .sgcc-modal__card,
  .sgcc-backdrop {
    animation: none;
  }

  .sgcc-btn,
  .sgcc-close,
  .sgcc-settings,
  .sgcc-category input,
  .sgcc-category input::after {
    transition: none;
  }
}
