.kc-radice {
  --kc-carta: #fbf6ec;
  --kc-testo: #2a2230;
  --kc-tenue: #4a4054;
  --kc-linea: rgba(42, 34, 48, 0.28);
  --kc-oro: #c9a25a;
  --kc-rosso: #a82f20;
  --kc-matcha: #5f7f5a;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483600;
  display: none;
  justify-content: center;
  padding: 0 0.75rem 0.75rem;
  pointer-events: none;
  font-family: var(--font-body, system-ui, -apple-system, 'Segoe UI', sans-serif);
}

:root[data-tema='notte'] .kc-radice {
  --kc-carta: #232a4a;
  --kc-testo: #fbf6ec;
  --kc-tenue: #c9d6ea;
  --kc-linea: rgba(251, 246, 236, 0.3);
  --kc-rosso: #f08a78;
  --kc-matcha: #9bc29a;
}

.kc-radice--aperta {
  display: flex;
}

.kc-scheda {
  pointer-events: auto;
  box-sizing: border-box;
  width: min(100%, 34rem);
  max-height: min(80vh, 40rem);
  overflow-y: auto;
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  color: var(--kc-testo);
  background: var(--kc-carta);
  border: 2px solid var(--kc-testo);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--kc-oro), 0 12px 32px rgba(0, 0, 0, 0.28);
  animation: kc-entra 0.22s ease-out;
}

.kc-titolo {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 700;
}

.kc-testo,
.kc-riga {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.kc-tenue {
  color: var(--kc-tenue);
  font-size: 0.82rem;
}

.kc-dettagli {
  margin: 0.4rem 0 0.7rem;
  border-top: 1px solid var(--kc-linea);
}

.kc-servizio {
  padding: 0.7rem 0 0.2rem;
  border-bottom: 1px solid var(--kc-linea);
}

.kc-servizio-testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.kc-nome {
  font-weight: 700;
  font-size: 0.95rem;
}

.kc-etichetta {
  flex: 1;
  cursor: pointer;
}

.kc-elenco {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--kc-tenue);
}

.kc-codice {
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 0.78rem;
  color: var(--kc-testo);
}

.kc-link {
  color: var(--kc-rosso);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kc-interruttore {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 2.8rem;
  height: 1.5rem;
  margin: 0;
  cursor: pointer;
  border: 2px solid var(--kc-testo);
  border-radius: 999px;
  background: transparent;
  transition: background 0.15s;
}

.kc-interruttore::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: -0.45rem;
  border-radius: 50%;
  background: var(--kc-testo);
  transition: transform 0.15s;
}

.kc-interruttore:checked {
  background: var(--kc-matcha);
}

.kc-interruttore:checked::after {
  transform: translateX(1.28rem);
  background: var(--kc-carta);
}

.kc-barra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.kc-btn {
  flex: 1 1 auto;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--kc-carta);
  background: var(--kc-testo);
  border: 2px solid var(--kc-testo);
  border-radius: 4px;
}

.kc-btn--bordo {
  color: var(--kc-testo);
  background: transparent;
}

.kc-btn:hover {
  filter: brightness(1.15);
}

.kc-btn:focus-visible,
.kc-interruttore:focus-visible,
.kc-link:focus-visible {
  outline: 3px solid var(--kc-oro, #c9a25a);
  outline-offset: 2px;
}

.kc-piede {
  margin: 0.4rem 0 0;
  align-self: flex-start;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kc-piede:hover {
  opacity: 0.75;
}

.kc-piede:focus-visible {
  outline: 3px solid #c9a25a;
  outline-offset: 2px;
}

@keyframes kc-entra {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-scheda {
    animation: none;
  }
  .kc-interruttore,
  .kc-interruttore::after {
    transition: none;
  }
}

@media (max-width: 560px) {
  .kc-radice {
    padding: 0 0.5rem 0.5rem;
  }
  .kc-btn {
    flex: 1 1 100%;
  }
}

@media print {
  .kc-radice,
  .kc-piede {
    display: none !important;
  }
}
