#sc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 99997;
  backdrop-filter: blur(2px);
}

/* -- Barra inferiore -- */
#sc-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 3px solid #19719D;
  box-shadow: 0 -4px 28px rgba(0, 0, 0, .12);
  z-index: 99998;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: .88rem;
  line-height: 1.65;
  color: #333;
}

#sc-bar-inner {
  max-width: 75%;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

#sc-bar-text {
  flex: 1;
  min-width: 260px;
}

#sc-bar-text a {
  color: #19719D;
  text-decoration: underline;
}

#sc-bar-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* -- Pulsanti comuni -- */
.sc-btn {
  padding: 9px 20px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #19719D;
  transition: background .2s, color .2s;
  white-space: nowrap;
  font-family: inherit;
}

#sc-btn-accept {
  background: #19719D;
  color: #fff;
}

#sc-btn-accept:hover {
  background: #3a5a52;
  border-color: #3a5a52;
}

#sc-btn-reject {
  background: #fff;
  color: #19719D;
}

#sc-btn-reject:hover {
  background: #edf5f3;
}

#sc-btn-custom {
  background: transparent;
  border-color: transparent;
  color: #19719D;
  text-decoration: underline;
  font-weight: 400;
  padding: 9px 6px;
}

#sc-btn-custom:hover {
  color: #3a5a52;
}

/* -- Modale preferenze -- */
#sc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#sc-modal.sc-open {
  display: flex;
}

#sc-modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .22);
  position: relative;
}

#sc-modal-box h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #2d4640;
}

#sc-modal-box>p {
  margin: 0 0 18px;
  font-size: .83rem;
  color: #666;
}

/* -- Righe categoria -- */
.sc-cat {
  border-top: 1px solid #e8eeec;
  padding: 14px 0;
}

.sc-cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sc-cat-info {
  flex: 1;
}

.sc-cat-name {
  font-weight: 700;
  font-size: .9rem;
  color: #2d2d2d;
}

.sc-cat-desc {
  font-size: .78rem;
  color: #777;
  margin-top: 3px;
  line-height: 1.5;
}

.sc-always {
  font-size: .72rem;
  font-weight: 600;
  color: #19719D;
  white-space: nowrap;
  padding-top: 3px;
  flex-shrink: 0;
}

/* -- Toggle switch -- */
.sc-switch {
  position: relative;
  width: 46px;
  height: 25px;
  flex-shrink: 0;
}

.sc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.sc-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 25px;
  cursor: pointer;
  transition: background .2s;
}

.sc-slider:before {
  content: '';
  position: absolute;
  width: 19px;
  height: 19px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.sc-switch input:checked+.sc-slider {
  background: #19719D;
}

.sc-switch input:checked+.sc-slider:before {
  transform: translateX(21px);
}

.sc-switch input:disabled+.sc-slider {
  opacity: .5;
  cursor: default;
}

/* -- Footer modale -- */
#sc-modal-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8eeec;
  font-size: .75rem;
  color: #888;
  line-height: 1.5;
}

#sc-modal-footer a {
  color: #19719D;
}

#sc-modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

#sc-save {
  background: #19719D;
  color: #fff;
  border-color: #19719D;
}

#sc-save:hover {
  background: #3a5a52;
  border-color: #3a5a52;
}

#sc-reject-modal {
  background: #fff;
  color: #19719D;
}

#sc-reject-modal:hover {
  background: #edf5f3;
}

/* -- Badge riapertura -- */
#sc-badge {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 18px;
  background: #19719D;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  border: none;
  font-family: inherit;
  letter-spacing: .02em;
}

#sc-badge:hover {
  background: #3a5a52;
}

@media (max-width: 560px) {
  #sc-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  #sc-bar-btns {
    flex-direction: column;
  }

  .sc-btn {
    text-align: center;
  }

  #sc-modal-box {
    padding: 20px 16px;
  }
}