:root {
  --celia-yellow: #ffc456;
  --celia-orange: #ef8b00;
  --celia-dark: #17152d;
  --celia-cream: #fff7ea;
  --animation-time: 7s;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: #858585;
  color: var(--celia-dark);
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.mobile-app {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--celia-yellow);
  isolation: isolate;
}

/* Intro */
.intro {
  position: absolute;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  background: var(--celia-yellow);
  transition: opacity .45s ease, visibility .45s ease;
}

.intro.is-finished {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.dark-expansion {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--celia-dark);
  transform: translate(-50%, -50%) scale(0);
  animation: expand-dark var(--animation-time) cubic-bezier(.76, 0, .24, 1) both;
}

.final-yellow {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: var(--celia-yellow);
  opacity: 0;
  animation: final-background var(--animation-time) ease-in-out both;
}

.intro-logo {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 92px;
  height: auto;
  transform: translate(-50%, -50%);
  user-select: none;
  -webkit-user-drag: none;
}

.intro-logo--yellow {
  opacity: 0;
  animation: yellow-logo var(--animation-time) ease-in-out both;
}

.intro-logo--black {
  width: 106px;
  opacity: 0;
  animation: black-logo var(--animation-time) ease-out both;
}

.intro-message {
  position: absolute;
  z-index: 4;
  top: calc(50% + 70px);
  left: 20px;
  right: 20px;
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.35;
}

.intro-message--hello {
  color: #fff;
  opacity: 0;
  animation: hello-message var(--animation-time) ease both;
}

.intro-message--welcome {
  opacity: 0;
  animation: welcome-message var(--animation-time) ease both;
}

/* Viste e form */
.app-view {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 24px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--celia-yellow);
  animation: view-in .35s ease both;
}

.app-view[hidden] {
  display: none;
}

.auth-card {
  width: min(100%, 390px);
  margin: auto;
}

.auth-card__body {
  position: relative;
  z-index: 2;
  padding: 22px 20px 26px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgb(23 21 45 / 9%);
}

.auth-card--light .auth-card__body {
  background: var(--celia-cream);
}

.auth-card--dark .auth-card__body {
  background: var(--celia-dark);
  color: #fff;
}

.auth-title {
  display: flex;
  align-items: center;
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 400;
}

.auth-title small,
.auth-switch small {
  margin-left: 5px;
  font-size: 11px;
  font-weight: 400;
}

.title-dot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  border: 3px solid var(--celia-dark);
  border-radius: 50%;
  background: var(--celia-yellow);
}

.title-dot--dark {
  border: 0;
  background: var(--celia-dark);
}

label {
  display: block;
  margin: 0 0 10px;
  color: var(--celia-orange);
  font-size: 14px;
}

input {
  display: block;
  width: 100%;
  height: 35px;
  margin: 0 0 20px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 23px;
  outline: 0;
  background: #fff;
  color: var(--celia-dark);
  font-size: 14px;
}

input:focus {
  border-color: var(--celia-orange);
  box-shadow: 0 0 0 3px rgb(239 139 0 / 18%);
}

.field-note {
  margin: -8px 0 17px;
  font-size: 10px;
  line-height: 1.25;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border-radius: 24px;
  font-size: 16px;
}

.button--primary {
  margin-top: 4px;
  border: 0;
  background: var(--celia-orange);
  color: var(--celia-dark);
}

.button--primary:hover {
  filter: brightness(.96);
}

.button--social {
  gap: 10px;
  margin-top: 14px;
  border: 0;
  background: #fff;
  color: var(--celia-dark);
}

.social-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.separator {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 18px 0 4px;
  font-size: 13px;
}

.separator::before,
.separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd5ca;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
}

.help-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.help-link span {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--celia-dark);
  color: #fff;
  font-weight: 700;
}

.auth-switch {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  margin-top: -18px;
  padding: 30px 22px 15px;
  border: 0;
  border-radius: 0 0 10px 10px;
  background: var(--celia-dark);
  color: #fff;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
}

.auth-switch--light {
  background: var(--celia-cream);
  color: var(--celia-dark);
}

/* Recupero password e verifica OTP */
.support-card {
  position: relative;
  width: min(100%, 390px);
  margin: auto;
  padding: 42px 22px 70px;
  border-radius: 10px;
  background: var(--celia-dark);
  color: #fff;
  box-shadow: 0 10px 30px rgb(23 21 45 / 9%);
}

.support-card h1 {
  margin: 0 0 20px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 600;
}

.support-label {
  margin: 35px 0px;
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
}

.back-link {
  position: absolute;
  top: 18px;
  right: 20px;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}

.support-card input:not(.otp-input) {
  margin-bottom: 20px;
}

.support-card--otp h1 {
  margin-bottom: 12px;
  font-weight: 400;
}

.otp-fields {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.otp-input {
  min-width: 0;
  aspect-ratio: 1;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  background: var(--celia-cream);
  text-align: center;
  font-size: 19px;
  font-weight: 700;
}

.otp-note {
  margin: 10px 0 100px;
  font-size: 9px;
}

.otp-actions {
  display: grid;
  gap: 14px;
}

.button--outline {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  text-decoration: none;
}

.welcome-view h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
}

.welcome-view {
  transition: opacity .8s ease;
}

.welcome-view.is-leaving {
  opacity: 0;
}

.success-view {
  transition: opacity .8s ease;
}

.success-view h1 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
}

.success-view.is-leaving {
  opacity: 0;
}

/* Home */
.home {
  overflow: hidden;
}

.home-header {
  position: relative;
  z-index: 2;
  height: clamp(125px, 16vh, 140px);
  transition: height .45s ease;
}

.home-compact-balance {
  position: absolute;
  top: max(78px, calc(env(safe-area-inset-top) + 58px));
  left: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  visibility: hidden;
  opacity: 0;
  font-size: 18px;
  transition: opacity .3s ease;
}

.home-compact-balance span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--celia-cream);
}

.home-compact-balance img {
  width: 13px;
}

.profile-button {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--celia-cream);
}

.profile-button::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--celia-cream);
  transform: translateX(-50%);
}

.profile-button span {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 23px;
  height: 12px;
  border-radius: 50% 50% 20% 20%;
  background: var(--celia-cream);
  transform: translateX(-50%);
}

.profile-button::before {
  display: none;
}

.profile-button>img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-hero {
  transition: opacity .3s ease, transform .45s ease;
}

.home-hero h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
}

.harmony-card {
  position: relative;
  display: flex;
  width: min(73%, 380px);
  aspect-ratio: 1;
  flex-direction: column;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 26px);
  border-radius: clamp(28px, 7vw, 38px);
  background: var(--celia-cream);
}

.harmony-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.harmony-card__top img {
  width: 18px;
  height: 17px;
  object-fit: contain;
}

.harmony-card__top button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.harmony-card__top button {
  font-size: clamp(15px, 4vw, 17px);
}

.home-favorites-add {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0 !important;
  border-radius: 50%;
  line-height: 1;
}

.css-add-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--celia-yellow);
}

.css-add-icon::before,
.css-add-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: var(--celia-dark);
  transform: translate(-50%, -50%);
}

.css-add-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.home-favorites-add .css-add-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--celia-dark);
  background: transparent;
}

.home-favorites-add[hidden] {
  display: none;
}

.home-favorites-empty {
  position: absolute;
  top: clamp(20px, 5vw, 26px);
  right: 25px;
  left: 58px;
  margin: 0;
  padding: 0;
  text-align: right;
  font-size: clamp(13px, 3.5vw, 16px);
  line-height: 1.25;
}

.bubble-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  column-gap: 6px;
  margin-top: 4px;
}

.bubble {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: clamp(19px, 5vw, 22px);
}

.bubble img {
  display: block;
  width: 88%;
  height: 88%;
  margin: auto;
  object-fit: contain;
}

.bubble>span:not(.home-bubble-badge) {
  position: absolute;
  top: 50%;
  right: -4px;
  left: -4px;
  overflow: hidden;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.bubble .home-bubble-badge {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  bottom: auto;
  left: auto;
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--celia-yellow);
  color: var(--celia-dark);
  font-size: 20px;
  line-height: 1;
  overflow: visible;
  transform: none;
}

.home-bubble-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-favorite-plus {
  display: grid;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--celia-dark);
  font-size: 36px;
}

#homeFavoritesGrid .bubble:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.home-accordion {
  --tab-height: 69px;
  --tab-step: 68px;
  --closed-tail: clamp(100px, 16vh, 135px);
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--tab-step) + var(--tab-step) + var(--closed-tail));
  background: transparent;
  transition: height .55s cubic-bezier(.65, 0, .35, 1);
}

.accordion-item {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}

.accordion-item:nth-child(1) {
  z-index: 1;
  top: 0;
}

.accordion-item:nth-child(2) {
  z-index: 2;
  top: var(--tab-step);
}

.accordion-item:nth-child(3) {
  z-index: 3;
  top: calc(var(--tab-step) + var(--tab-step));
}

.accordion-item--light {
  background: var(--celia-cream);
  color: var(--celia-dark);
}

.accordion-item--dark {
  background: var(--celia-dark);
  color: #fff;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--tab-height);
  padding: 0 25px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  text-align: left;
}

.accordion-trigger img {
  width: 25px;
  height: 25px;
  transition: transform .4s ease;
}

.accordion-trigger[aria-expanded="true"] img {
  transform: rotate(180deg);
}

.accordion-trigger.is-internal img {
  transform: none;
}

#harmoniesAccordion>.accordion-trigger img {
  transform: none;
}

.accordion-panel {
  height: calc(100% - var(--tab-height));
  max-height: 0;
  opacity: 0;
  transition: max-height .55s cubic-bezier(.65, 0, .35, 1), opacity .3s ease;
}

.accordion-item.is-open .accordion-panel {
  max-height: 100%;
  opacity: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.accordion-item.is-open .accordion-panel::-webkit-scrollbar {
  display: none;
}

.devices-intro {
  min-height: 360px;
  padding: 6px 34px 34px;
  border-top: 1px solid var(--celia-dark);
}

.devices-intro[hidden] {
  display: none;
}

.devices-intro p {
  margin: 24px 0 34px;
  font-size: clamp(15px, 3.8vw, 19px);
  line-height: 1.25;
}

.device-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 16px;
}

.device-categories button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px clamp(10px, 3vw, 16px);
  border: 1px solid var(--celia-dark);
  border-radius: 24px;
  background: transparent;
  color: inherit;
  font-size: clamp(15px, 3.8vw, 19px);
  text-decoration: none;
}

.device-categories img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

#devicesAccordion>.accordion-trigger {
  font-size: clamp(18px, 4.5vw, 21px);
}

.home.devices-open .home-header,
.home.settings-open .home-header,
.home.harmonies-open .home-header {
  height: 148px;
}

.home.devices-open .home-hero,
.home.settings-open .home-hero,
.home.harmonies-open .home-hero {
  opacity: 0;
  transform: translateY(-25px);
  pointer-events: none;
}

.home.devices-open .home-compact-balance,
.home.settings-open .home-compact-balance,
.home.harmonies-open .home-compact-balance {
  visibility: visible;
  opacity: 1;
}

.home.devices-open .home-accordion,
.home.settings-open .home-accordion,
.home.harmonies-open .home-accordion {
  height: calc(100dvh - 148px);
}

/* Quando Impostazioni è aperta, le altre due schede rimangono ancorate in basso. */
.home.settings-open .accordion-item:nth-child(2) {
  top: auto;
  height: calc(var(--tab-step) + var(--closed-tail));
}

.home.settings-open .accordion-item:nth-child(3) {
  top: auto;
  height: var(--closed-tail);
}

/* Harmonies occupa lo spazio centrale e lascia Dispositivi ancorata in basso. */
.home.harmonies-open .accordion-item:nth-child(3) {
  top: auto;
  height: var(--closed-tail);
}

.harmonies-panel {
  color: #fff;
}

.harmony-panel-view {
  min-height: 100%;
  padding: 0 clamp(28px, 8vw, 42px) 32px;
  border-top: 1px solid var(--celia-cream);
}

.harmony-panel-view[hidden] {
  display: none;
}

.harmony-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 15px;
}

.harmony-panel-heading p {
  margin: 0;
  font-size: clamp(16px, 3.7vw, 19px);
}

#harmoniesAccordion>.accordion-trigger {
  font-size: clamp(18px, 4.5vw, 22px);
}

#harmonyCreateView .harmony-panel-heading p {
  font-size: clamp(15px, 3.5vw, 18px);
  line-height: 1.3;
}

#newHarmonyName {
  height: 47px;
  margin-bottom: 0;
  padding: 0 22px;
  border-radius: 25px;
  font-size: clamp(15px, 3.8vw, 18px);
}

.harmony-edit-button,
.harmony-done-button {
  min-width: 96px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--celia-cream);
  border-radius: 24px;
  background: transparent;
  color: #fff;
  font-size: clamp(14px, 3.4vw, 17px);
}

.harmony-library,
.harmony-icon-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px clamp(22px, 6vw, 34px);
}

.harmony-library {
  margin-top: 34px;
}

.harmony-library-item {
  min-width: 0;
  text-align: center;
}

.harmony-tile,
.harmony-add,
.harmony-icon-option {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: clamp(24px, 6vw, 32px);
  background: var(--celia-cream);
}

.harmony-tile>img,
.harmony-icon-option>img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.harmony-library-item>span {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.harmony-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: clamp(26px, 6.8vw, 34px);
  height: clamp(26px, 6.8vw, 34px);
  padding: 0;
  place-items: center;
  background: transparent;
}

.harmony-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.harmony-badge:not(.harmony-badge--remove) {
  top: -6px;
  right: -6px;
}

.harmony-badge--remove {
  top: -4px;
  right: -4px;
  width: clamp(22px, 5.6vw, 28px);
  height: clamp(22px, 5.6vw, 28px);
  background: transparent;
}

.harmony-add {
  color: var(--celia-dark);
  font-size: 40px;
  font-weight: 300;
}

.harmony-create-note {
  min-height: 18px;
  margin: 18px 0 0;
  font-size: clamp(12px, 3vw, 14px);
}

#harmonyCreateView .harmony-icon-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px clamp(16px, 4vw, 22px);
  margin-top: 20px;
}

.harmony-icon-option.is-selected {
  border-color: var(--celia-yellow);
  box-shadow: 0 0 0 2px rgb(255 196 86 / 25%);
}

.harmony-configuration {
  padding-top: 18px;
  padding-right: 23px;
  padding-bottom: calc(var(--tab-height) + 48px);
  padding-left: 23px;
  border-top: 0;
}

.harmony-config-identity {
  padding: 4px 0 34px;
  text-align: center;
}

.harmony-config-identity>div {
  display: grid;
  width: min(45%, 155px);
  aspect-ratio: 1;
  margin: 0 auto 17px;
  padding: 16px;
  place-items: center;
  border-radius: 22px;
  background: var(--celia-cream);
}

.harmony-config-identity img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.harmony-config-identity h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

.harmony-device-settings h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 4px 26px;
  border-bottom: 1px solid var(--celia-cream);
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 400;
}

.harmony-device-settings+.harmony-device-settings {
  margin-top: 58px;
}

.harmony-device-settings h3 img {
  width: 24px;
  height: 27px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.harmony-light-control {
  padding: 34px 3px;
  border-bottom: 1px solid rgb(255 247 234 / 35%);
}

.harmony-light-control__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.harmony-light-control h4 {
  margin: 0;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 400;
}

.harmony-light-control:not(.is-enabled) h4 {
  opacity: .55;
}

.harmony-light-control label {
  margin: 20px 0 10px;
  color: #fff;
  font-size: clamp(12px, 3.3vw, 14px);
}

.harmony-control-ranges {
  display: none;
}

.harmony-light-control.is-enabled .harmony-control-ranges {
  display: block;
}

.harmony-light-control input[type="range"] {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: transparent;
  accent-color: var(--celia-cream);
  box-shadow: none;
  cursor: pointer;
}

.harmony-light-control input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--celia-cream);
}

.harmony-light-control input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--celia-cream);
  box-shadow: 0 0 0 1px rgb(23 21 45 / 8%);
}

.harmony-light-control input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--celia-cream);
}

.harmony-light-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--celia-cream);
}

.harmony-light-control input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--celia-dark), 0 0 0 5px var(--celia-cream);
}

.harmony-light-control input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--celia-dark), 0 0 0 5px var(--celia-cream);
}

.harmony-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.harmony-light-control .harmony-switch {
  margin: 0;
}

.harmony-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.harmony-switch span {
  position: relative;
  width: 66px;
  height: 34px;
  border: 1.5px solid var(--celia-cream);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.harmony-switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 23px;
  height: 23px;
  border: 1.5px solid var(--celia-cream);
  border-radius: 50%;
  background: var(--celia-dark);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.harmony-switch input:checked+span {
  background: var(--celia-cream);
  border-color: var(--celia-cream);
}

.harmony-switch input:checked+span::after {
  background: var(--celia-dark);
  border-color: var(--celia-dark);
  transform: translateX(32px);
}

.harmony-switch input:focus-visible+span {
  outline: 2px solid var(--celia-cream);
  outline-offset: 3px;
}

.harmony-music-settings {
  margin-top: 52px;
}

.harmony-music-settings>h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 68px;
  padding: 0 5px 30px;
  border-bottom: 1px solid var(--celia-cream);
  font-size: clamp(20px, 4.5vw, 24px);
  font-weight: 400;
}

.music-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.playlist-service+.playlist-service {
  margin-top: 68px;
}

.playlist-service h4 {
  margin: 0 0 clamp(52px, 9vh, 80px) 5px;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 400;
}

.playlist-slider {
  display: grid;
  width: calc(100% + 23px);
  grid-auto-columns: 27%;
  grid-auto-flow: column;
  gap: clamp(14px, 4vw, 20px);
  margin: 0 -23px 0 0;
  padding: 0 0 12px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.playlist-slider::-webkit-scrollbar {
  display: none;
}

.playlist-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  scroll-snap-align: start;
}

.playlist-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 25px;
  object-fit: cover;
  transition: border-color .2s ease, transform .2s ease;
}

.playlist-card span {
  display: block;
  margin-top: 14px;
  overflow: hidden;
  font-size: clamp(13px, 3.5vw, 17px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-card.is-selected img {
  border-color: var(--celia-yellow);
  transform: scale(.96);
}

.harmony-save-area {
  display: grid;
  justify-items: end;
  gap: 9px;
  padding: 34px 5px 0;
}

.harmony-save-button {
  min-width: 92px;
  min-height: 43px;
  padding: 0 22px;
  border: 1px solid var(--celia-cream);
  border-radius: 23px;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.harmony-save-button:active {
  transform: scale(.97);
}

.harmony-save-area p {
  min-height: 17px;
  margin: 0;
  font-size: 11px;
  color: var(--celia-yellow);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-content {
  min-height: 100%;
  padding: 34px 21px;
  border-top: 1px solid var(--celia-dark);
}

.settings-content>p {
  margin: 20px 0 18px;
  font-size: clamp(13px, 3.3vw, 15px);
}

.service-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 21px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--celia-dark);
}

.service-options button {
  display: grid;
  min-width: 130px;
  height: 48px;
  padding: 0 16px;
  place-items: center;
  border: 1px solid var(--celia-dark);
  border-radius: 25px;
  background: transparent;
}

.service-options img {
  display: block;
  max-width: 100px;
  max-height: 22px;
  object-fit: contain;
}

.settings-links {
  display: grid;
  gap: 16px;
  padding-top: 20px;
}

.settings-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: inherit;
  font-size: clamp(14px, 3.5vw, 16px);
  text-decoration: none;
}

.settings-links img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#settingsAccordion>.accordion-trigger {
  font-size: clamp(18px, 4.5vw, 21px);
}

.home-device-detail {
  min-height: 430px;
  padding: 0 32px 30px;
}

.home-device-detail[hidden] {
  display: none;
}

.home-device-detail__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  border-bottom: 1px solid var(--celia-dark);
}

.home-device-detail__title span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.home-device-detail__title img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.home-device-detail__title strong {
  font-size: clamp(20px, 4.8vw, 24px);
  font-weight: 400;
}

.home-device-detail__title button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--celia-dark);
  color: #fff;
  font-size: 0;
  line-height: 1;
}

.home-device-detail__title button img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

@media (max-height: 760px) {
  .home-accordion {
    --tab-height: 58px;
    --tab-step: 58px;
    --closed-tail: 58px;
  }
}

@media (max-width: 360px) {
  .bubble {
    font-size: 18px;
  }

  .device-categories {
    gap: 13px 10px;
  }

  .device-categories button {
    padding-inline: 14px;
  }

  .service-options {
    gap-inline: 12px;
  }

  .service-options button {
    min-width: 124px;
  }
}

/* Elenco della singola categoria dispositivo */
.device-page {
  overflow: hidden;
}

.device-header {
  position: relative;
  display: flex;
  align-items: center;
  height: 150px;
  padding: 25px 30px;
}

.device-header .profile-button {
  top: 30px;
}

.device-balance {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 18px;
}

.device-star {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--celia-cream);
}

.device-star img {
  width: 13px;
}

.device-stack {
  position: absolute;
  inset: 150px 0 0;
}

.device-stack__tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 69px;
  padding: 0 25px;
  border-radius: 24px 24px 0 0;
  font-size: 18px;
}

.device-stack__tab img {
  width: 25px;
  height: 25px;
}

.device-stack__tab--light {
  background: var(--celia-cream);
}

.device-stack__tab--dark {
  margin-top: -1px;
  background: var(--celia-dark);
  color: #fff;
}

.device-manager {
  position: absolute;
  inset: 137px 0 0;
  padding: 0 25px 30px;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: var(--celia-cream);
}

.device-manager__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 61px;
  border-bottom: 1px solid var(--celia-dark);
}

.device-manager__title span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.device-manager__title img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.device-manager__title strong {
  font-size: 18px;
  font-weight: 400;
}

.device-manager__title a {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--celia-dark);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}

.device-list-section {
  padding: 22px 0 44px;
}

.device-list-section h2 {
  margin: 0 0 20px;
  font-size: clamp(17px, 4.2vw, 20px);
  font-weight: 400;
}

.device-list-section--available {
  border-top: 1px solid var(--celia-dark);
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 12px;
  font-size: clamp(15px, 3.7vw, 18px);
  animation: device-row-in .3s ease both;
  transition: opacity .23s ease, transform .23s ease;
}

.device-row.is-moving {
  opacity: 0;
  transform: translateX(18px);
}

@keyframes device-row-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
}

.device-remove {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: url('../img/croce-elimina.png') center / contain no-repeat;
  flex: 0 0 auto;
}

.device-connect {
  min-width: 94px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--celia-dark);
  color: #fff;
  font-size: clamp(14px, 3.5vw, 17px);
}

@media (max-height: 700px) {
  .device-header {
    height: 120px;
  }

  .device-stack {
    inset-block-start: 120px;
  }

  .device-stack__tab {
    height: 58px;
  }

  .device-manager {
    inset-block-start: 115px;
  }
}

/* Profilo */
.profile-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(32px, env(safe-area-inset-top)) 42px max(30px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--celia-cream);
}

.profile-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-header>a {
  position: absolute;
  left: 0;
  display: block;
  width: 20px;
  height: 20px;
}

.profile-header img {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
}

.profile-identity {
  text-align: center;
}

.profile-avatar {
  position: relative;
  width: 145px;
  height: 145px;
  margin: 8px auto 30px;
}

.profile-avatar>img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-avatar button {
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--celia-cream);
}

.profile-avatar button img {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-identity h2 {
  margin: 0 0 14px;
  font-size: 23px;
  font-weight: 400;
}

.profile-identity p {
  margin: 0;
  font-size: 16px;
}

.profile-account {
  margin-top: 70px;
}

.profile-account>h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 400;
}

.profile-detail:first-of-type {
  border-top: 1px solid var(--celia-dark);
}

.profile-detail+.profile-detail {
  margin-top: 22px;
}

.profile-detail button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 15px;
  text-align: left;
}

.profile-detail button img {
  width: 30px;
  height: 30px;
  transition: transform .25s ease;
}

.profile-detail button[aria-expanded="true"] img {
  transform: rotate(180deg);
}

.profile-detail p {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: rgb(23 21 45 / 70%);
  font-size: 14px;
  opacity: 0;
  transition: max-height .3s ease, margin .3s ease, opacity .2s ease;
}

.profile-detail.is-open p {
  max-height: 40px;
  margin: -5px 0 14px;
  opacity: 1;
}

.profile-logout {
  display: block;
  min-width: 84px;
  min-height: 42px;
  margin: 100px auto 0;
  padding: 0 24px;
  border: 1px solid var(--celia-dark);
  border-radius: 21px;
  background: transparent;
  color: inherit;
  font-size: 16px;
}

.logout-modal {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgb(23 21 45 / 76%);
}

.logout-modal[hidden] {
  display: none;
}

.logout-modal__dialog {
  width: clamp(220px, 58vw, 275px);
  padding: 23px 22px 27px;
  border-radius: 25px;
  background: var(--celia-cream);
  text-align: center;
}

.logout-modal__dialog h2 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.05;
}

.logout-modal__dialog p {
  margin: 0;
  font-size: 12px;
  line-height: 1.12;
}

.logout-modal__actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 23px;
}

.logout-modal__actions button {
  min-width: 77px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--celia-dark);
  border-radius: 20px;
  font-size: 14px;
}

.logout-modal__confirm {
  background: var(--celia-yellow);
  color: var(--celia-dark);
}

.logout-modal__cancel {
  background: var(--celia-dark);
  color: #fff;
}

.harmony-delete-modal {
  z-index: 50;
}

@media (max-height: 680px) {
  .profile-account {
    margin-top: 46px;
  }

  .profile-logout {
    margin-top: 60px;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes expand-dark {

  0%,
  13% {
    transform: translate(-50%, -50%) scale(0)
  }

  17% {
    transform: translate(-50%, -50%) scale(1)
  }

  38%,
  100% {
    transform: translate(-50%, -50%) scale(14)
  }
}

@keyframes yellow-logo {

  0%,
  11% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.06)
  }

  17% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.55)
  }

  38% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.72)
  }

  52%,
  73% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 65px)) scale(1.12)
  }

  80%,
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 65px)) scale(1.12)
  }
}

@keyframes hello-message {

  0%,
  50% {
    opacity: 0;
    transform: translateY(8px)
  }

  57%,
  72% {
    opacity: 1;
    transform: translateY(0)
  }

  79%,
  100% {
    opacity: 0;
    transform: translateY(-4px)
  }
}

@keyframes final-background {

  0%,
  75% {
    opacity: 0
  }

  84%,
  100% {
    opacity: 1
  }
}

@keyframes black-logo {

  0%,
  80% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 65px)) scale(.85)
  }

  88%,
  100% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 65px)) scale(1)
  }
}

@keyframes welcome-message {

  0%,
  86% {
    opacity: 0;
    transform: translateY(7px)
  }

  94%,
  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

@media (max-height: 650px) {
  .auth-card {
    transform: scale(.88);
  }
}

@media (max-width: 500px) {
  .home-hero h1 {
    font-size: 19px;
  }

  .harmony-card__top button {
    font-size: 15px;
  }

  .bubble {
    font-size: 17px;
  }

  .bubble>span:not(.home-bubble-badge) {
    right: 0;
    left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro * {
    animation-delay: 0s !important;
    animation-duration: .01ms !important;
  }

  .app-view {
    animation: none;
  }
}
