#ccs-root {
  --ccs-bg: #ffffff;
  --ccs-text: #1b1b1b;
  --ccs-muted: #666666;
  --ccs-accent: #2f6f4f;
  --ccs-accent-text: #ffffff;
  --ccs-border: #d8d8d8;
  --ccs-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  z-index: 999999;
}

.ccs-banner,
.ccs-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
}

.ccs-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--ccs-bg);
  color: var(--ccs-text);
  border-top: 1px solid var(--ccs-border);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
}

.ccs-banner[hidden],
.ccs-panel[hidden] {
  display: none;
}

.ccs-text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ccs-muted);
}

.ccs-text a {
  color: var(--ccs-text);
  text-decoration: underline;
}

.ccs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ccs-btn {
  cursor: pointer;
  border-radius: var(--ccs-radius);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ccs-btn-primary {
  background: var(--ccs-accent);
  color: var(--ccs-accent-text);
}

.ccs-btn-outline {
  background: transparent;
  color: var(--ccs-text);
  border-color: var(--ccs-border);
}

.ccs-btn-ghost {
  background: transparent;
  color: var(--ccs-muted);
  text-decoration: underline;
  border: none;
  padding: 10px 6px;
}

.ccs-panel {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
}

.ccs-panel-inner {
  background: var(--ccs-bg);
  color: var(--ccs-text);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.ccs-panel-inner h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.ccs-cat {
  padding: 12px 0;
  border-top: 1px solid var(--ccs-border);
}

.ccs-cat:first-of-type {
  border-top: none;
}

.ccs-cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ccs-cat-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ccs-muted);
  line-height: 1.5;
}

.ccs-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}

.ccs-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ccs-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #555;
  border-radius: 22px;
  transition: 0.2s;
}

.ccs-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.ccs-switch input:checked + .ccs-slider {
  background: var(--ccs-accent);
}

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

.ccs-switch input:disabled + .ccs-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.ccs-reopen {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ccs-bg);
  color: var(--ccs-text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ccs-reopen[hidden] {
  display: none;
}

.ccs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.ccs-table th,
.ccs-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
}

.ccs-table th {
  background: #f3f3f3;
}

@media (max-width: 640px) {
  .ccs-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .ccs-actions {
    justify-content: stretch;
  }
  .ccs-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

.ccs-mini-footer {
  text-align: center;
  padding: 14px 16px;
  margin-bottom: 64px; /* lascia libera la zona in basso a sinistra dove galleggia il pulsante 🍪 */
  font-size: 12px;
  color: #777777;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ccs-mini-footer a {
  color: inherit;
  text-decoration: underline;
}

.ccs-mini-footer a:hover {
  color: #333333;
}
