/* Voice — hand-driven speech in Logan's recorded voice */

#panel-voice.panel[hidden] {
  display: none !important;
}

#panel-voice.panel.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 5rem);
  max-height: calc(100dvh - 5rem);
  overflow: hidden;
  padding: 0;
  margin: 0;
}

body.vh-tab-active #panel-voice.panel.active {
  min-height: 100dvh;
  max-height: 100dvh;
}

body.vh-tab-active .site-footer,
body.vh-tab-active .site-header .subtitle {
  display: none;
}

body.vh-tab-active .site-header {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.vh-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: #eef3ee;
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(86, 140, 168, 0.28), transparent 56%),
    radial-gradient(ellipse 60% 45% at 92% 90%, rgba(186, 120, 72, 0.16), transparent 52%),
    linear-gradient(180deg, #10141a 0%, #0b0e12 58%, #08090c 100%);
}

.vh-top {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem 0.45rem;
  border-bottom: 1px solid rgba(140, 190, 210, 0.2);
}

.vh-top h2 {
  margin: 0 0 0.12rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: #f4ead6;
}

.vh-hint {
  margin: 0;
  max-width: 68rem;
  color: #a9b8c0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.vh-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(22rem, 1.35fr) minmax(18rem, 22rem);
  overflow: hidden;
}

.vh-stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.65rem;
  gap: 0.55rem;
}

.vh-cam-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 14rem;
  border: 1px solid rgba(154, 200, 214, 0.2);
  border-radius: 10px;
  overflow: hidden;
  background: #07090c;
}

.vh-cam-wrap video,
.vh-cam-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vh-cam-wrap video {
  transform: scaleX(-1);
}

.vh-cursor {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  margin: -0.55rem 0 0 -0.55rem;
  border-radius: 50%;
  border: 2px solid #f4ead6;
  background: rgba(127, 196, 220, 0.45);
  pointer-events: none;
  z-index: 3;
  display: none;
}

.vh-keys {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.22rem;
}

.vh-key {
  appearance: none;
  min-height: 1.85rem;
  border: 1px solid rgba(220, 230, 236, 0.16);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.72);
  color: #eef3ee;
  font: 700 0.78rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.vh-key.dwell,
.vh-key:hover {
  border-color: rgba(250, 220, 142, 0.7);
  background: rgba(217, 187, 102, 0.28);
  color: #fff8e6;
}

.vh-key.wide {
  grid-column: span 2;
}

.vh-line {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.vh-buffer {
  flex: 1 1 12rem;
  min-height: 2.6rem;
  border: 1px solid rgba(154, 200, 214, 0.22);
  border-radius: 8px;
  background: #081012;
  color: #f4ead6;
  padding: 0.5rem 0.7rem;
  font: 600 1.15rem/1.3 Georgia, serif;
}

.vh-btn {
  appearance: none;
  min-height: 2.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(154, 200, 214, 0.24);
  border-radius: 8px;
  background: rgba(14, 22, 28, 0.95);
  color: #e8efeb;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.vh-btn:hover {
  border-color: rgba(127, 196, 220, 0.7);
}

.vh-btn.accent {
  border-color: rgba(250, 220, 142, 0.64);
  background: linear-gradient(180deg, #d9bb66, #83602a);
  color: #171207;
  font-weight: 700;
}

.vh-btn.danger {
  border-color: rgba(218, 114, 100, 0.46);
  color: #ffd5ce;
}

.vh-btn.active {
  border-color: rgba(127, 196, 220, 0.8);
  background: rgba(127, 196, 220, 0.18);
}

.vh-side {
  min-height: 0;
  overflow: auto;
  padding: 0.65rem;
  border-left: 1px solid rgba(140, 190, 210, 0.16);
  background: rgba(3, 7, 10, 0.5);
}

.vh-card {
  border: 1px solid rgba(154, 200, 214, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem;
  margin-bottom: 0.65rem;
}

.vh-card h3 {
  margin: 0 0 0.45rem;
  color: #8fd0dc;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vh-script {
  margin: 0 0 0.5rem;
  color: #c5d0d4;
  font-size: 0.78rem;
  line-height: 1.45;
}

.vh-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.4rem 0;
  color: #c4cfca;
  font-size: 0.76rem;
}

.vh-field input[type="text"],
.vh-field select {
  min-height: 2.1rem;
  border: 1px solid rgba(154, 200, 214, 0.22);
  border-radius: 7px;
  background: #081012;
  color: #f2eee6;
  padding: 0.35rem 0.5rem;
  font: inherit;
}

.vh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vh-status {
  min-height: 1.1rem;
  margin: 0.4rem 0 0;
  color: #aebdb9;
  font-size: 0.74rem;
}

.vh-clips {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
}

.vh-clip {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.3rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(154, 200, 214, 0.14);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.76rem;
}

.vh-need {
  margin: 0;
  padding: 0.5rem 0.55rem;
  border-left: 3px solid #d6b45e;
  color: #dce6e2;
  font-size: 0.76rem;
  line-height: 1.4;
}

.vh-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

@media (max-width: 900px) {
  #panel-voice.panel.active,
  body.vh-tab-active #panel-voice.panel.active {
    max-height: none;
    overflow: auto;
  }

  .vh-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .vh-cam-wrap {
    height: min(72vw, 28rem);
    flex: 0 0 auto;
  }

  .vh-side {
    border-left: none;
    border-top: 1px solid rgba(140, 190, 210, 0.16);
  }
}
