/*
Theme Name: Telecomando One
Description: Tema minimale a pagina unica per il plugin Telecomando Shelly. Replica la pagina cancello12.php di open.contolemix.com.
Version: 1.1.1
Author: Florin
Text Domain: telecomando-one
*/
* {
  box-sizing: border-box;
}
/* Style the body */

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: black;
}
/* Header/logo Title */

.header {
  padding: 80px;
  text-align: center;
  color: white;
  background-image: url("assets/img/logo-bianco.png");
  /*height: auto;  */
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  position: relative;
}
/* Increase the font size of the heading */
.header h1 {
  font-size: 40px;
}

/* Sticky navbar - toggles between relative and fixed, depending on the scroll position. It is positioned relative until a given offset position is met in the viewport - then it "sticks" in place (like position:fixed). The sticky value is not supported in IE or Edge 15 and earlier versions. However, for these versions the navbar will inherit default position */
.navbar {
  overflow: hidden;
  background-color: #333;
  position: sticky;
  position: -webkit-sticky;
  top: 0;
}

/* Style the navigation bar links */

.navbar a {
  float: left;
  display: block;
  color: white;
  text-align: center;
  padding: 14px 20px;
  text-decoration: none;
}

/* Right-aligned link */
.navbar a.right {
  float: right;
}

/* Change color on hover */
.navbar a:hover {
  background-color: #ddd;
  color: black;
}

/* Active/current link */

.navbar a.active {
  background-color: #666;
  color: white;
}
/* Column container */
.row {
  display: -ms-flexbox; /* IE10 */
  display: flex;
  -ms-flex-wrap: wrap; /* IE10 */
  flex-wrap: wrap;
}
/* Create two unequal columns that sits next to each other */
/* Sidebar/left column */
.side {
  -ms-flex: 30%; /* IE10 */
  flex: 30%;
  background-color: black;
  padding: 20px;
}
/* Main column */
.main {
  -ms-flex: 70%; /* IE10 */
  flex: 70%;
  background-color: white;
  padding: 20px;
}

/* Fake image, just for this example */
.fakeimg {
  background-color: black;
  color:white;
  width: 100%;
  padding: 1px;
}
/* Footer */
.footer {
  padding: 20px;
  text-align: center;
  background: #ddd;
}

/* Responsive layout - when the screen is less than 700px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 700px) {
  .row {
    flex-direction: column;
  }
}

/* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
@media screen and (max-width: 400px) {
  .navbar a {
    float: none;
    width: 100%;
  }
}
.power {
  display: table;
  cursor: pointer;
}
.power input {
  display: none;
}
.power input + div {
  position: relative;
  overflow: hidden;
  background: #EB2C59;
  border-radius: 50%;
  padding: 18px;
  transition: -webkit-transform .4s ease;
  transition: transform .4s ease;
  transition: transform .4s ease, -webkit-transform .4s ease;
  -webkit-filter: drop-shadow(0 4px 6px rgba(235, 44, 89, 0.3));
  filter: drop-shadow(0 4px 6px rgba(235, 44, 89, 0.3));
}
.power input + div:before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
  position: absolute;
  left: 50%;
  z-index: 2;
  margin: 0 0 0 -2px;
  top: 18px;
  opacity: 1;
  -webkit-transform: scaleY(1) translate(0, 2px);
  transform: scaleY(1) translate(0, 2px);
  transition: opacity .4s ease .1s, -webkit-transform .9s ease .4s;
  transition: opacity .4s ease .1s, transform .9s ease .4s;
  transition: opacity .4s ease .1s, transform .9s ease .4s, -webkit-transform .9s ease .4s;
}
.power input + div:after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  background: #21E76E;
  -webkit-transform: translate(100%, 100%);
  transform: translate(100%, 100%);
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
  transition: -webkit-transform .8s ease;
  transition: transform .8s ease;
  transition: transform .8s ease, -webkit-transform .8s ease;
}
.power input + div svg {
  width: 72px;
  height: 72px;
  fill: none;
  display: block;
  stroke: #fff;
  position: relative;
  z-index: 2;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 84;
  stroke-dashoffset: 160;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  transition: stroke-dasharray .6s ease 0s, stroke-dashoffset .7s ease .0s;
}
.power input + div:active {
  -webkit-transform: scale(0.96);
          transform: scale(0.96);
}
.power input:checked + div {
  -webkit-filter: drop-shadow(0 4px 6px rgba(33, 231, 110, 0.3));
          filter: drop-shadow(0 4px 6px rgba(33, 231, 110, 0.3));
}
.power input:checked + div svg {
  stroke-dasharray: 120;
  stroke-dashoffset: 133;
  transition: stroke-dasharray 0.6s ease 0.45s, stroke-dashoffset 0.7s cubic-bezier(0.94, -0.1, 0.1, 1.2) 0.2s;
}
.power input:checked + div:before {
  -webkit-transform: scaleY(0) translate(0, 7px);
  transform: scaleY(0) translate(0, 7px);
  transition: opacity .4s ease .0s, -webkit-transform .6s ease .3s;
  transition: opacity .4s ease .0s, transform .6s ease .3s;
  transition: opacity .4s ease .0s, transform .6s ease .3s, -webkit-transform .6s ease .3s;
}
.power input:checked + div:after {
  -webkit-transform: translate(40%, 40%);
    transform: translate(40%, 40%);
}
.ptab{
	color:white;
    text-align:center;
}
.mytab1{
  width:100%;
}
.mytab1 tr {
  height:25px;
}
.mytab1 tr:nth-child(even) {background-color: #004080;}
.mytab1 tr:hover{color:black;background-color:white;}

/* Login */
.login-box {
  max-width: 340px;
  margin: 12vh auto 40px;
  padding: 0 20px;
  color: white;
}
.login-box h2 {
  text-align: center;
  font-weight: normal;
}
.login-box label {
  display: block;
  margin: 16px 0 6px;
}
.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #666;
  border-radius: 6px;
  background: #111;
  color: white;
}
.login-box button {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  font-size: 16px;
  border: 0;
  border-radius: 6px;
  background: #21E76E;
  color: black;
  cursor: pointer;
}
.login-error {
  background: #993366;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

/* Barra verde dopo l'apertura: si accorcia fino a sparire */
#progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: #21E76E;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
}

/* Interruttore notifiche */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #666;
  border-radius: 26px;
  transition: background .25s;
}
.slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .25s;
}
.switch input:checked + .slider { background: #21E76E; }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .6; cursor: wait; }

/* ===================== Login ===================== */
body.login-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #0f3a22 0%, #05100a 45%, #000 80%) fixed;
  overflow-x: hidden;
}
body.login-page:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(33,231,110,.14) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: lg-drift 40s linear infinite;
}
@keyframes lg-drift { to { background-position: 300px 300px; } }

.login-box { max-width: 380px; margin: 3vh auto 40px; padding: 0 20px; }
.login-box form {
  background: rgba(255,255,255,.04);
  border: 1px solid #1d3a29;
  border-radius: 18px;
  padding: 6px 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-box input[type="text"],
.login-box input[type="password"] {
  transition: border-color .2s, box-shadow .2s;
}
.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
  outline: none;
  border-color: #21E76E;
  box-shadow: 0 0 0 3px rgba(33,231,110,.22);
}
.login-box button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
  background: linear-gradient(135deg, #21E76E, #13b455);
  box-shadow: 0 8px 24px rgba(33,231,110,.25);
  transition: transform .15s, filter .2s;
}
.login-box button:hover { filter: brightness(1.08); }
.login-box button:active { transform: scale(.98); }

.bubble {
  position: relative;
  margin: 14px auto 18px;
  padding: 10px 16px;
  text-align: center;
  color: #c9ffe0;
  background: #0c2417;
  border: 1px solid #1f6b3f;
  border-radius: 14px;
  font-size: 15px;
}
.bubble:empty { display: none; }
.bubble:before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -7px;
  width: 14px;
  height: 14px;
  background: #0c2417;
  border-left: 1px solid #1f6b3f;
  border-top: 1px solid #1f6b3f;
  transform: rotate(45deg);
}

/* Robot */
.robot { width: min(210px, 58vw); margin: 0 auto; }
.robot-svg { width: 100%; height: auto; overflow: visible; --ex: 0px; --ey: 0px; --tilt: 0deg; display: block; }
.rb-float { animation: rb-float 3.6s ease-in-out infinite; }
@keyframes rb-float { 50% { transform: translateY(-6px); } }
.rb-shadow { transform-origin: 100px 226px; animation: rb-shadow 3.6s ease-in-out infinite; }
@keyframes rb-shadow { 50% { transform: scaleX(.86); opacity: .35; } }
.rb-head { transform-origin: 100px 126px; transform: rotate(var(--tilt)); transition: transform .25s ease-out; }
.rb-eyes { transform: translate(var(--ex), var(--ey)); transition: transform .15s ease-out; }
.rb-eye { transform-box: fill-box; transform-origin: center; animation: rb-blink 5s infinite; }
@keyframes rb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.rb-eye circle:first-child { filter: drop-shadow(0 0 5px rgba(33,231,110,.8)); }
.rb-led { fill: #21E76E; filter: drop-shadow(0 0 6px #21E76E); animation: rb-led 1.6s ease-in-out infinite; }
@keyframes rb-led { 50% { opacity: .3; } }
.rb-power { filter: drop-shadow(0 0 4px rgba(33,231,110,.8)); animation: rb-led 2.4s ease-in-out infinite; }
.eyes-x, .eyes-sleep, .eyes-happy, .mouth-sad { opacity: 0; transition: opacity .2s; }
.eyes-open, .mouth-smile { transition: opacity .2s; }
.rb-arm { transition: transform .5s cubic-bezier(.34, 1.4, .5, 1); }
.arm-l { transform-origin: 60px 142px; }
.arm-r { transform-origin: 140px 142px; }

.is-peek .arm-l { transform: rotate(196deg); }
.is-peek .arm-r { transform: rotate(-196deg); }

.is-error .eyes-open, .is-error .mouth-smile { opacity: 0; }
.is-error .eyes-x, .is-error .mouth-sad { opacity: 1; }
.is-error .rb-head { animation: rb-shake .5s; }
.is-error .rb-led { fill: #ff4d6d; filter: drop-shadow(0 0 6px #ff4d6d); }
@keyframes rb-shake { 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(5deg); } }

.is-locked .eyes-open, .is-locked .mouth-smile { opacity: 0; }
.is-locked .eyes-sleep { opacity: 1; }
.is-locked .rb-head { transform: rotate(7deg); }
.is-locked .rb-led { animation: none; opacity: .3; fill: #6b7a85; filter: none; }
.is-locked .rb-float { animation-duration: 6s; }

.is-happy .eyes-open { opacity: 0; }
.is-happy .eyes-happy { opacity: 1; }
.is-happy .rb-power { animation: rb-led .3s 2; }

.is-wave .arm-r { animation: rb-wave 2.4s ease-in-out; }
@keyframes rb-wave {
  0% { transform: rotate(0); } 15% { transform: rotate(-150deg); } 30% { transform: rotate(-125deg); }
  45% { transform: rotate(-155deg); } 60% { transform: rotate(-125deg); } 75% { transform: rotate(-150deg); } 100% { transform: rotate(0); }
}

/* ===================== Pagina del pulsante ===================== */
body.app-page {
  background: radial-gradient(ellipse at 50% 12%, #0c2a1a 0%, #05100a 40%, #000 75%) fixed;
  min-height: 100vh;
  color: white;
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20,24,22,.92);
  border-bottom: 1px solid #1d2822;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.navbar a { float: none; padding: 16px 20px; }
.navbar a.active { background: transparent; font-weight: bold; letter-spacing: .02em; }
.status {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  font-size: 13px;
  color: #cfe7d8;
}
.status i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: #21E76E;
  box-shadow: 0 0 8px #21E76E;
}
.status.ko { color: #ffb3c0; }
.status.ko i { background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }

.stage { max-width: 560px; margin: 0 auto; padding: 0 16px 120px; }
.power-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 44px 0 26px;
}
.power-wrap:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 210px;
  height: 210px;
  margin: -105px 0 0 -105px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33,231,110,.16) 0%, rgba(33,231,110,0) 70%);
  animation: pw-breathe 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pw-breathe { 50% { transform: scale(1.12); opacity: .6; } }
.hint {
  text-align: center;
  margin: 0 0 30px;
  color: #a8c2b3;
  font-size: 15px;
}
.hint-off { padding-top: 70px; color: #ffb3c0; line-height: 1.5; }

.recent {
  background: rgba(255,255,255,.03);
  border: 1px solid #1d2822;
  border-radius: 16px;
  padding: 4px 4px 10px;
}
.recent h3 {
  margin: 14px 14px 6px;
  font-size: 12px;
  font-weight: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8fa79a;
}
.recent .mytab1 { border-collapse: collapse; }
.recent .mytab1 tr { height: 44px; background: transparent; border-top: 1px solid rgba(255,255,255,.06); }
.recent .mytab1 tr:nth-child(even) { background: rgba(255,255,255,.025); }
.recent .mytab1 tr:hover { color: white; background: rgba(33,231,110,.08); }
.recent .mytab1 td { padding: 8px 12px; font-size: 14px; color: #e8f3ec; }
.recent .mytab1 td:last-child { text-align: right; }
.recent .mytab1 tr.row-off { background: rgba(153,51,102,.35); }
.badge {
  display: inline-block;
  min-width: 34px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
}
.badge.on { background: rgba(33,231,110,.16); color: #21E76E; }
.badge.off { background: rgba(255,77,109,.18); color: #ff8aa0; }
.empty { margin: 12px 14px; color: #8fa79a; font-size: 14px; }

/* Barra in basso: consenso notifiche */
.appbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10,14,12,.94);
  border-top: 1px solid #1d2822;
  backdrop-filter: blur(8px);
}
.appbar-text strong { display: block; font-size: 15px; }
.appbar-text span { display: block; margin-top: 2px; font-size: 12px; color: #8fa79a; }

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}

/* ===== Pulsante di apertura: piu' piccolo e rifinito ===== */
.power { position: relative; margin: 0 auto; transform: none; }
.power:before {                       /* anello che pulsa piano */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(33,231,110,.55);
  animation: pw-ring 2.8s ease-out infinite;
  pointer-events: none;
}
@keyframes pw-ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.55); opacity: 0; } }
.power:has(input:checked):before { animation: none; opacity: 0; }

.power-wrap .power input + div {
  padding: 20px;
  background: linear-gradient(150deg, #2b3530 0%, #0f1512 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.16),
    inset 0 -8px 16px rgba(0,0,0,.45),
    0 12px 28px rgba(0,0,0,.65),
    0 0 0 2px #25322b,
    0 0 0 6px rgba(33,231,110,.08);
  -webkit-filter: none;
  filter: none;
}
.power-wrap .power input + div svg {
  width: 60px;
  height: 60px;
  stroke: #dfffe9;
  stroke-width: 4.5;
  filter: drop-shadow(0 0 6px rgba(33,231,110,.55));
}
.power-wrap .power input + div:before {
  background: #dfffe9;
  top: 20px;
  height: 12px;
  box-shadow: 0 0 8px rgba(33,231,110,.6);
}
.power-wrap .power input + div:after {
  background: linear-gradient(145deg, #34f589, #12ad52);
}
.power-wrap .power input:checked + div {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.25),
    0 12px 30px rgba(33,231,110,.35),
    0 0 0 2px #1d7a45,
    0 0 0 8px rgba(33,231,110,.14);
  -webkit-filter: none;
  filter: none;
}
.power-wrap .power input:checked + div svg { stroke: #04140a; filter: none; }

/* ===== Uso da telefono ===== */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
button, label, input, .power { touch-action: manipulation; }
body.pin-open { overflow: hidden; }

/* zone sicure (notch / barra gesti) */
.header { padding-top: calc(80px + env(safe-area-inset-top)); }
.stage { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.recent .mytab1 tr:hover { background: transparent; }
.recent .mytab1 tr:nth-child(even):hover { background: rgba(255,255,255,.025); }

/* interruttore piu' comodo da toccare */
.appbar { min-height: 68px; }
.appbar .switch { width: 56px; height: 32px; flex: none; }
.appbar .slider { border-radius: 32px; }
.appbar .slider:before { width: 26px; height: 26px; left: 3px; top: 3px; }
.appbar .switch input:checked + .slider:before { transform: translateX(24px); }

/* check di conferma dopo l'apertura */
.power-wrap .power input:checked + div svg { opacity: 0; transition: opacity .15s; }
.power-wrap .power input:checked + div:before {
  top: 50%;
  left: 50%;
  width: 20px;
  height: 38px;
  margin: -26px 0 0 -10px;
  background: transparent;
  border: solid #04140a;
  border-width: 0 7px 7px 0;
  border-radius: 3px;
  box-shadow: none;
  opacity: 1;
  transform: rotate(45deg) scale(1);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1) .25s, opacity .2s .2s;
}

/* tastierino del codice (bottom sheet) */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  animation: pin-fade .2s ease-out;
}
.pin-overlay[hidden] { display: none; }
@keyframes pin-fade { from { opacity: 0; } }
@keyframes pin-up { from { transform: translateY(40px); opacity: 0; } }
.pin-sheet {
  width: 100%;
  max-width: 420px;
  padding: 22px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #141a17 0%, #0a0e0c 100%);
  border: 1px solid #1d2822;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  text-align: center;
  color: white;
  animation: pin-up .28s cubic-bezier(.2, .9, .3, 1);
}
.pin-sheet h2 { margin: 0 0 16px; font-size: 18px; font-weight: normal; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
.pin-dots i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #3b4a42;
  transition: background .12s, border-color .12s, transform .12s;
}
.pin-dots i.on { background: #21E76E; border-color: #21E76E; transform: scale(1.08); }
.pin-dots i.err { background: #ff4d6d; border-color: #ff4d6d; }
.pin-msg { min-height: 20px; margin: 6px 0 12px; font-size: 14px; color: #8fa79a; }
.pin-msg.err { color: #ff8aa0; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pin-pad button {
  height: 64px;
  font-size: 26px;
  color: white;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  font-family: inherit;
  transition: background .1s, transform .1s;
}
.pin-pad button:active { background: rgba(33,231,110,.25); transform: scale(.95); }
.pin-pad button[data-k="del"] { display: flex; align-items: center; justify-content: center; }
.pin-cancel {
  margin-top: 14px;
  padding: 12px 24px;
  font-size: 16px;
  color: #8fa79a;
  background: none;
  border: 0;
}

.hint { min-height: 1.4em; }

/* barra in alto su telefono */
.navbar a, .navbar a.active { text-align: left; white-space: nowrap; }
.status { white-space: nowrap; flex: none; padding: 0 16px; }
.navbar a.active { padding-left: 16px; overflow: hidden; text-overflow: ellipsis; }

/* ===== Freccia animata: comando partito ===== */
.feedback { position: relative; min-height: 88px; margin-bottom: 18px; }
.feedback .hint { margin: 0; padding-top: 6px; }
.sent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sent[hidden] { display: none; }
.sent svg { overflow: visible; filter: drop-shadow(0 0 8px rgba(33,231,110,.65)); }
.sent .ch {
  fill: none;
  stroke: #21E76E;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: ch-fly 1.5s ease-in-out infinite;
}
.sent .ch3 { animation-delay: 0s; }
.sent .ch2 { animation-delay: .2s; }
.sent .ch1 { animation-delay: .4s; }
@keyframes ch-fly {
  0%   { opacity: 0; transform: translateY(14px); }
  35%  { opacity: 1; }
  70%  { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 0; transform: translateY(-14px); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .sent .ch { opacity: 1; } }

/* pulsante disattivato durante i 2 secondi dopo la pressione */
.power.is-busy { pointer-events: none; cursor: default; }

/* ===== Icona account (in alto a destra): cambio del proprio PIN ===== */
.account-btn {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #cfe7d8;
  background: rgba(20,24,22,.72);
  border: 1px solid #1d2822;
  border-radius: 50%;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .1s;
}
.account-btn:hover { color: #21E76E; border-color: #21E76E; }
.account-btn:active { transform: scale(.94); }
.account-btn:focus-visible { outline: 2px solid #21E76E; outline-offset: 2px; }
.pin-msg.ok { color: #21E76E; }

/* ===== "Esci dall'account" sotto il tastierino ===== */
.pin-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 18px auto 0;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: #ff8aa0;
  background: rgba(255,77,109,.08);
  border: 1px solid rgba(255,77,109,.28);
  border-radius: 14px;
  cursor: pointer;
  transition: background .12s, transform .1s;
}
.pin-logout:active { background: rgba(255,77,109,.2); transform: scale(.98); }
.pin-cancel { display: block; margin-left: auto; margin-right: auto; }
