/* Interface em tela cheia do kranio. Sem aninhamento de CSS. */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #020814;
  color: #e7f7ff;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 42%, #0c3f82 0%, #07284f 26%, #03101e 58%, #020814 100%);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.grid,
#orb,
.vignette,
.rail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.grid {
  background-image:
    linear-gradient(rgba(90, 170, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 170, 255, 0.075) 1px, transparent 1px);
  background-size: 52px 52px;
  background-position: center center;
  z-index: 0;
  pointer-events: none;
}

#orb {
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vignette {
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 18%, rgba(1, 6, 16, 0.28) 70%, rgba(1, 4, 12, 0.72) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(60, 150, 255, 0.16), transparent 36%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 90, 190, 0.16), transparent 42%);
  box-shadow: inset 0 0 90px rgba(40, 150, 255, 0.16);
}

.rail {
  z-index: 3;
  right: auto;
  width: 86px;
  top: 18%;
  bottom: auto;
  left: 18px;
  height: auto;
  pointer-events: none;
}

.rail-panel {
  height: 78px;
  margin-bottom: 12px;
  border: 1px solid rgba(90, 190, 255, 0.28);
  background-color: rgba(4, 18, 40, 0.28);
  background-image:
    linear-gradient(rgba(150, 225, 255, 0.45), rgba(150, 225, 255, 0.45)),
    linear-gradient(rgba(150, 225, 255, 0.28), rgba(150, 225, 255, 0.28)),
    linear-gradient(rgba(150, 225, 255, 0.28), rgba(150, 225, 255, 0.28));
  background-size: 52px 1px, 36px 1px, 44px 1px;
  background-position: 10px 18px, 10px 34px, 10px 50px;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 18px rgba(0, 140, 255, 0.08);
}

.rail-panel-short {
  height: 46px;
  width: 62px;
}

.top,
.stage,
.dock {
  position: relative;
  z-index: 5;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 12px 16px 0;
}

.brand-block {
  min-width: 88px;
}

.brand {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  letter-spacing: 0.24em;
  color: #dff6ff;
  text-transform: none;
}

.relogio {
  display: block;
  margin-top: 2px;
  color: #8ebbd0;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-basis: 100%;
  order: 3;
  margin-top: 4px;
}

.wing {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(130, 220, 255, 0.85));
}

.wing-dir {
  background: linear-gradient(90deg, rgba(130, 220, 255, 0.85), transparent);
}

.status {
  display: inline-flex;
  align-items: center;
  margin: 0 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid rgba(120, 220, 255, 0.55);
  background: rgba(3, 16, 34, 0.62);
  color: #e7f8ff;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.28em;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.18);
}

.status-dot {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #8eefff;
  box-shadow: 0 0 8px #8eefff;
  letter-spacing: 0;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tool {
  padding: 6px 8px;
  border: 1px solid rgba(120, 200, 255, 0.35);
  border-radius: 3px;
  background: rgba(4, 18, 36, 0.45);
  color: #c5e8f6;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.tool-voz {
  max-width: 148px;
  cursor: pointer;
}

.tool[aria-pressed="true"] {
  border-color: rgba(170, 245, 255, 0.95);
  background: rgba(16, 90, 140, 0.55);
  color: #f3fcff;
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.28);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 16px 6px;
}

.card {
  width: 100%;
  max-width: 460px;
  overflow: visible;
  box-sizing: border-box;
  padding: 16px 18px 14px;
  text-align: center;
  color: #f4fcff;
  background: rgba(3, 14, 28, 0.88);
  border: 1px solid rgba(110, 220, 255, 0.55);
  border-radius: 4px;
  box-shadow:
    0 0 24px rgba(0, 170, 255, 0.16),
    inset 0 0 24px rgba(0, 140, 255, 0.06);
  position: relative;
}

.canto {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(170, 245, 255, 0.85);
}

.canto-tl {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.canto-tr {
  top: -1px;
  right: -1px;
  border-left: 0;
  border-bottom: 0;
}

.canto-bl {
  bottom: -1px;
  left: -1px;
  border-right: 0;
  border-top: 0;
}

.canto-br {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.kicker {
  margin: 0;
  color: #8fdfff;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.card h1 {
  margin: 8px 0 6px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.linha {
  margin: 0;
  color: #d5eef8;
  font-size: 15px;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.chip {
  margin: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(120, 210, 255, 0.35);
  border-radius: 999px;
  color: #9fd0e2;
  background: rgba(6, 24, 44, 0.35);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip.is-ativo {
  color: #041018;
  background: #8aefff;
  border-color: #8aefff;
}

.chip.is-feito {
  color: #e7fbff;
  border-color: rgba(160, 245, 255, 0.85);
  background: rgba(28, 110, 150, 0.45);
}

.nota {
  margin: 10px 0 0;
  color: #8eb9cc;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.ouvido,
.legenda,
.nota,
.dica {
  max-width: 860px;
}

.ouvido {
  margin: 0;
  color: #9ec6d6;
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

.legenda {
  margin: 0;
  max-width: 920px;
  overflow: visible;
  flex-shrink: 1;
  color: #f3fbff;
  font-size: 18px;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 0 16px rgba(80, 200, 255, 0.35);
}

.legenda.is-longa {
  font-size: 16px;
  line-height: 1.4;
}

.legenda::-webkit-scrollbar {
  width: 8px;
}

.legenda::-webkit-scrollbar-thumb {
  background: rgba(130, 220, 255, 0.45);
  border-radius: 8px;
}

.legenda::-webkit-scrollbar-track {
  background: transparent;
}

.ouvido:empty,
.legenda:empty,
.nota:empty {
  display: none;
}

.form-comando {
  display: flex;
  width: 100%;
  max-width: 560px;
  gap: 8px;
}

.form-comando[hidden] {
  display: none;
}

.login {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 8, 18, 0.78);
}

.login[hidden] {
  display: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  padding: 22px 20px 18px;
  text-align: center;
  background: rgba(3, 14, 28, 0.92);
  border: 1px solid rgba(110, 220, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 170, 255, 0.18);
}

.login-card h1 {
  margin: 8px 0 16px;
  font-family: "Courier New", Courier, monospace;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: none;
}

.login-card input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 210, 255, 0.5);
  border-radius: 4px;
  background: rgba(3, 16, 32, 0.78);
  color: #e7f8ff;
  font-size: 16px;
}

.login-card button {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(150, 230, 255, 0.75);
  border-radius: 4px;
  background: rgba(16, 78, 120, 0.85);
  color: #f3fcff;
}

#btn-sair[hidden] {
  display: none;
}

.form-comando input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(120, 210, 255, 0.5);
  border-radius: 4px;
  background: rgba(3, 16, 32, 0.78);
  color: #e7f8ff;
  font-size: 16px;
}

.form-comando input::placeholder {
  color: #7f9eae;
}

.form-comando button {
  padding: 10px 14px;
  border: 1px solid rgba(150, 230, 255, 0.75);
  border-radius: 4px;
  background: rgba(16, 78, 120, 0.85);
  color: #f3fcff;
}

.mic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 6px;
  width: 74px;
  height: 74px;
  padding: 0;
  border: 2px solid rgba(150, 240, 255, 0.9);
  border-radius: 50%;
  color: #f4fcff;
  background: radial-gradient(circle at 50% 38%, rgba(48, 150, 210, 0.7), rgba(4, 20, 40, 0.95));
  box-shadow:
    0 0 18px rgba(0, 190, 255, 0.65),
    inset 0 0 12px rgba(130, 230, 255, 0.35);
}

.mic svg {
  width: 30px;
  height: 30px;
  display: block;
}

.mic:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dica {
  margin: 0;
  color: #8eb4c6;
  font-size: 13px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.noscript {
  position: absolute;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: 24px;
  margin: 0;
  padding: 12px;
  text-align: center;
  background: rgba(3, 14, 28, 0.9);
  border: 1px solid rgba(120, 210, 255, 0.5);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #b6f4ff;
  outline-offset: 2px;
}

body[data-estado="ouvindo"] .status {
  border-color: rgba(170, 255, 245, 0.9);
  box-shadow: 0 0 18px rgba(80, 255, 230, 0.28);
}

body[data-estado="ouvindo"] .status-dot {
  background: #7dfff2;
  box-shadow: 0 0 10px #7dfff2;
}

body[data-estado="processando"] .status-dot {
  animation: pulso-ponto 0.9s steps(2, start) infinite;
}

body[data-estado="falando"] .status {
  border-color: rgba(190, 245, 255, 0.95);
}

body[data-estado="ouvindo"] .mic {
  animation: pulso-mic 1.15s ease-in-out infinite;
}

body[data-estado="processando"] .card {
  animation: pulso-card 1.4s ease-in-out infinite;
}

@keyframes pulso-ponto {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes pulso-mic {
  0%,
  100% {
    box-shadow:
      0 0 0 6px rgba(90, 235, 255, 0.38),
      0 0 22px rgba(0, 210, 255, 0.95);
  }
  70% {
    box-shadow:
      0 0 0 18px rgba(90, 235, 255, 0),
      0 0 32px rgba(0, 230, 255, 1);
  }
}

@keyframes pulso-card {
  0%,
  100% { border-color: rgba(110, 220, 255, 0.45); }
  50% { border-color: rgba(200, 252, 255, 0.95); }
}

@media (min-width: 1080px) {
  .status-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    flex-basis: auto;
    order: 0;
    margin-top: 0;
    transform: translate(-50%, -50%);
  }

  .top {
    padding-top: 14px;
    padding-bottom: 8px;
  }
}

@media (max-width: 720px) {
  .rail {
    display: none;
  }

  .brand {
    letter-spacing: 0.16em;
  }

  .status {
    letter-spacing: 0.16em;
    font-size: 12px;
  }

  .wing {
    width: 18px;
  }

  .card h1 {
    font-size: 22px;
  }

  .legenda {
    font-size: 18px;
  }

  .tool {
    padding: 6px 7px;
  }
}

@media (max-height: 560px) {
  .rail {
    display: none;
  }

  .mic {
    width: 56px;
    height: 56px;
  }

  .mic svg {
    width: 24px;
    height: 24px;
  }

  .dica {
    display: none;
  }

  .card {
    padding: 10px 12px;
  }

  .card h1 {
    margin: 4px 0;
    font-size: 18px;
  }

  .legenda,
  .legenda.is-longa {
    max-height: 22vh;
    overflow: auto;
    font-size: 14px;
  }

  .top {
    min-height: 0;
    padding-top: 8px;
  }
}

.rosto {
  position: absolute;
  z-index: 3;
  width: 280px;
  height: 280px;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.72;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 48%, rgba(0, 0, 0, 0.65) 64%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 46%, #000 48%, rgba(0, 0, 0, 0.65) 64%, transparent 74%);
}

.rosto picture,
.rosto img {
  display: block;
  width: 100%;
  height: 100%;
}

.rosto-boca {
  position: absolute;
  left: 40%;
  top: 62%;
  width: 20%;
  height: 8%;
  border-radius: 50%;
  background: rgba(190, 250, 255, 0);
  -webkit-transform-origin: 50% 30%;
  transform-origin: 50% 30%;
}

.rosto-scan {
  position: absolute;
  top: 10%;
  right: 14%;
  bottom: 12%;
  left: 14%;
  opacity: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(120, 230, 255, 0) 0,
    rgba(120, 230, 255, 0) 7px,
    rgba(160, 245, 255, 0.22) 8px
  );
  background-size: 100% 18px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 42%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 42%, #000 42%, transparent 72%);
}

body[data-estado="aguardando"] .rosto {
  -webkit-animation: respirar 5.2s ease-in-out infinite;
  animation: respirar 5.2s ease-in-out infinite;
}

body[data-estado="ouvindo"] .rosto {
  -webkit-animation: none;
  animation: none;
  opacity: calc(0.78 + var(--nivel, 0.15) * 0.22);
  -webkit-filter: brightness(calc(1.05 + var(--nivel, 0) * 0.75));
  filter: brightness(calc(1.05 + var(--nivel, 0) * 0.75));
}

body[data-estado="processando"] .rosto {
  opacity: 0.84;
  -webkit-animation: respirar 2.1s ease-in-out infinite;
  animation: respirar 2.1s ease-in-out infinite;
}

body[data-estado="falando"] .rosto {
  -webkit-animation: brilho-fala 0.48s ease-in-out infinite;
  animation: brilho-fala 0.48s ease-in-out infinite;
}

body[data-estado="falando"] .rosto-boca {
  background: rgba(186, 250, 255, 0.78);
  -webkit-animation: boca 0.16s ease-in-out infinite alternate;
  animation: boca 0.16s ease-in-out infinite alternate;
}

.rosto.is-silaba .rosto-boca {
  opacity: 1;
  -webkit-transform: scaleY(1.35);
  transform: scaleY(1.35);
}

body[data-estado="falando"] .rosto-scan {
  opacity: 0.95;
  -webkit-animation: varredura 1.8s linear infinite;
  animation: varredura 1.8s linear infinite;
}

body[data-qualidade="baixa"][data-estado="aguardando"] .rosto,
body[data-qualidade="baixa"][data-estado="processando"] .rosto,
body[data-qualidade="baixa"][data-estado="falando"] .rosto {
  -webkit-animation: none;
  animation: none;
  opacity: 0.8;
  -webkit-filter: none;
  filter: none;
}

body[data-qualidade="baixa"] .rosto-scan {
  display: none;
}

body[data-qualidade="baixa"][data-estado="falando"] .rosto-boca {
  -webkit-animation: none;
  animation: none;
  opacity: 0.55;
  -webkit-transform: none;
  transform: none;
}

@-webkit-keyframes respirar {
  0%,
  100% { opacity: 0.55; }
  50% { opacity: 0.84; }
}

@keyframes respirar {
  0%,
  100% { opacity: 0.55; }
  50% { opacity: 0.84; }
}

@-webkit-keyframes brilho-fala {
  0%,
  100% { opacity: 0.76; }
  50% { opacity: 1; }
}

@keyframes brilho-fala {
  0%,
  100% { opacity: 0.76; }
  50% { opacity: 1; }
}

@-webkit-keyframes boca {
  from {
    -webkit-transform: scaleY(0.35);
    transform: scaleY(0.35);
    opacity: 0.35;
  }
  to {
    -webkit-transform: scaleY(1.2);
    transform: scaleY(1.2);
    opacity: 1;
  }
}

@keyframes boca {
  from {
    -webkit-transform: scaleY(0.35);
    transform: scaleY(0.35);
    opacity: 0.35;
  }
  to {
    -webkit-transform: scaleY(1.2);
    transform: scaleY(1.2);
    opacity: 1;
  }
}

@-webkit-keyframes varredura {
  from { background-position: 0 0; }
  to { background-position: 0 36px; }
}

@keyframes varredura {
  from { background-position: 0 0; }
  to { background-position: 0 36px; }
}

.quadros {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
}

.quadros[hidden] {
  display: none;
}

.quadro {
  position: absolute;
  width: 230px;
  box-sizing: border-box;
  padding: 10px 12px 12px;
  text-align: left;
  color: #e7f7ff;
  pointer-events: auto;
  background: rgba(3, 16, 32, 0.72);
  border: 1px solid rgba(110, 220, 255, 0.45);
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(0, 160, 255, 0.16);
  opacity: 0;
  -webkit-transform: translateY(12px);
  transform: translateY(12px);
  -webkit-transition: opacity 0.4s ease, -webkit-transform 0.4s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.quadro.is-visivel {
  opacity: 1;
  -webkit-transform: none;
  transform: none;
}

.quadro-whatsapp { top: 16%; left: 2%; }
.quadro-emails { top: 40%; left: 2.5%; }
.quadro-agenda { top: 64%; left: 3%; }
.quadro-clientes { top: 16%; right: 2%; }
.quadro-clima { top: 40%; right: 2.5%; }
.quadro-lembretes { top: 64%; right: 3%; }

.quadro-topo {
  display: flex;
  align-items: center;
}

.quadro-ico {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  color: #9aefff;
}

.quadro-ico svg {
  display: block;
  width: 18px;
  height: 18px;
}

.quadro h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.quadro-contagem {
  margin: 6px 0 0;
  color: #9aefff;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.quadro ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.quadro li {
  margin: 3px 0;
  color: #d7eef8;
  font-size: 12px;
  line-height: 1.3;
}

.fechar-quadros {
  position: absolute;
  top: 74px;
  right: 18px;
  z-index: 5;
  pointer-events: auto;
  padding: 6px 10px;
  border: 1px solid rgba(150, 230, 255, 0.7);
  border-radius: 3px;
  background: rgba(4, 20, 40, 0.8);
  color: #e7f8ff;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
}

body[data-quadros="1"] .card,
body[data-quadros="1"] .rail {
  visibility: hidden;
}

@media (max-width: 980px) {
  .quadros {
    top: auto;
    height: 46%;
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    padding: 8px 8px 96px;
    -webkit-overflow-scrolling: touch;
  }

  .quadro,
  .quadro-whatsapp,
  .quadro-emails,
  .quadro-agenda,
  .quadro-clientes,
  .quadro-clima,
  .quadro-lembretes {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: calc(50% - 10px);
    margin: 5px;
  }

  .fechar-quadros {
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - 10px);
    margin: 4px 5px 8px;
  }
}

@media (orientation: portrait) {
  .rail {
    display: none;
  }

  .quadros {
    top: auto;
    height: 48%;
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    padding: 8px 8px 100px;
  }

  .quadro,
  .quadro-whatsapp,
  .quadro-emails,
  .quadro-agenda,
  .quadro-clientes,
  .quadro-clima,
  .quadro-lembretes {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: calc(50% - 10px);
    margin: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mic,
  .status-dot,
  .card,
  .rosto,
  .rosto-boca,
  .rosto-scan {
    -webkit-animation: none;
    animation: none;
  }

  .quadro {
    -webkit-transition: none;
    transition: none;
  }
}
