:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#5f6b7a;
  --primary:#1565c0;
  --primary-dark:#0d47a1;
  --primary-soft:#eaf2ff;
  --border:#dfe7f3;
  --shadow:0 18px 50px rgba(15, 23, 42, 0.12);
  --success:#1f8f5f;
  --warn:#b7791f;
}

*{box-sizing:border-box}

html,body{
  height:100%;
  margin:0;
  overflow-x:hidden;
}

body{
  font:16px/1.45 Arial, sans-serif;
  color:var(--text);
  background:
    linear-gradient(180deg, rgba(21,101,192,.06), rgba(21,101,192,0) 35%),
    var(--bg);
}

.voice-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px 16px;
}

.voice-card{
  width:100%;
  max-width:760px;
  background:var(--card);
  border-radius:24px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.voice-header{
  background:linear-gradient(135deg, var(--primary-dark), var(--primary));
  color:#fff;
  padding:22px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.voice-brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.brand-mark{
  width:52px;
  height:52px;
  border-radius:50%;
  background:#ffffff;
  color:var(--primary);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:16px;
  flex-shrink:0;
}

.brand-copy h1{
  margin:0;
  font-size:30px;
  line-height:1.1;
}

.brand-copy p{
  margin:6px 0 0;
  font-size:15px;
  opacity:.95;
}

.status-wrap{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.badge{
  padding:7px 12px;
  border-radius:999px;
  font-size:.8rem;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.12);
  color:#fff;
}

.badge.-ok{
  background:rgba(27, 94, 32, .25);
  border-color:rgba(181, 246, 206, .4);
}

.badge.-warn{
  background:rgba(180, 120, 20, .22);
  border-color:rgba(255, 232, 176, .4);
}

.badge.-idle{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.22);
}

.voice-body{
  padding:22px;
}

.intro-box{
  background:#f7faff;
  border:1px solid #e3edff;
  border-radius:18px;
  padding:16px;
  margin-bottom:18px;
}

.intro-box h2{
  margin:0 0 8px;
  font-size:20px;
  color:var(--text);
}

.intro-box p{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.voice-stage{
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  padding:18px;
}

.nowplaying{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.hint{
  color:var(--muted);
  font-size:.95rem;
}

.eq{
  display:inline-flex;
  gap:4px;
  height:18px;
  flex-shrink:0;
}

.eq span{
  width:4px;
  background:linear-gradient(180deg, #5db0ff, #1565c0);
  border-radius:2px;
  height:6px;
  opacity:.3;
  transition:height .12s ease, opacity .15s ease;
}

.scope{
  width:100%;
  height:140px;
  background:#f7faff;
  border:1px solid #e2eaf5;
  border-radius:16px;
  display:block;
}

.controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:18px;
  flex-wrap:wrap;
}

.btn{
  appearance:none;
  border:1px solid #cfd9ea;
  color:var(--primary);
  background:#fff;
  padding:12px 16px;
  border-radius:12px;
  cursor:pointer;
  font-size:14px;
  transition:.18s ease transform, .18s ease background, .18s ease border;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:#aac2ea;
  background:#f7faff;
}

.btn:active{
  transform:translateY(0);
}

.btn.-ghost{
  background:#fff;
}

.btn.-tiny{
  padding:6px 10px;
  font-size:.8rem;
}

.mic-btn{
  appearance:none;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  cursor:pointer;
  padding:16px 22px;
  min-width:190px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  box-shadow:0 12px 30px rgba(21, 101, 192, 0.22);
  transition:.18s ease transform, .18s ease box-shadow;
}

.mic-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 16px 36px rgba(21, 101, 192, 0.28);
}

.mic-btn:active{
  transform:translateY(0);
}

.mic-icon{
  font-size:20px;
  line-height:1;
}

.mic-label{
  font-size:15px;
  font-weight:600;
}

.mic-btn[aria-pressed="true"]{
  box-shadow:0 0 0 10px rgba(21, 101, 192, 0.12), 0 16px 36px rgba(21, 101, 192, 0.28);
}

.logcard{
  margin-top:18px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
}

.loghead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid #e8eef7;
  color:#5470a0;
  font-weight:600;
}

.log{
  margin:0;
  padding:14px;
  max-height:180px;
  overflow:auto;
  color:#5c6f91;
  background:#fbfdff;
  font-size:13px;
  white-space:pre-wrap;
  word-break:break-word;
}

.pulse{
  animation:pulse 1.2s ease-in-out infinite;
}

@keyframes pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(21,101,192,0)}
  50%{box-shadow:0 0 0 10px rgba(21,101,192,.14)}
}

.hidden{
  display:none !important;
}

@media (max-width: 768px){
  .voice-page{
    padding:14px;
    align-items:flex-start;
  }

  .voice-card{
    border-radius:20px;
  }

  .voice-header{
    padding:16px;
  }

  .brand-mark{
    width:46px;
    height:46px;
    font-size:14px;
  }

  .brand-copy h1{
    font-size:24px;
  }

  .brand-copy p{
    font-size:14px;
  }

  .voice-body{
    padding:16px;
  }

  .intro-box{
    padding:14px;
    margin-bottom:14px;
  }

  .intro-box h2{
    font-size:18px;
  }

  .intro-box p{
    font-size:13px;
  }

  .voice-stage{
    padding:14px;
  }

  .nowplaying{
    flex-direction:column;
    align-items:flex-start;
  }

  .hint{
    font-size:13px;
  }

  .scope{
    height:110px;
  }

  .controls{
    gap:10px;
  }

  .mic-btn{
    width:100%;
    min-width:0;
  }

  .btn{
    width:100%;
  }

  .log{
    max-height:140px;
  }
}


.compact-header {
  padding: 14px 18px;
  justify-content: flex-end;
  min-height: auto;
}

.compact-header .status-wrap {
  width: 100%;
  justify-content: flex-start;
}


.call-agent{
  text-align:center;
  margin-bottom:18px;
}

.agent-avatar{
  width:96px;
  height:96px;
  margin:0 auto 14px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:700;
  box-shadow:0 12px 30px rgba(21, 101, 192, 0.22);
}

.call-agent h2{
  margin:0;
  font-size:28px;
  color:var(--primary-dark);
}

.call-agent p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:16px;
}

.call-status{
  text-align:center;
  margin-bottom:14px;
}

.eq-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:14px;
}

.call-controls{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-top:18px;
  flex-wrap:wrap;
}

.call-btn{
  appearance:none;
  border:none;
  border-radius:999px;
  padding:14px 20px;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  min-width:130px;
}

.start-btn{
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
}

.mute-btn{
  background:#eef3ff;
  color:var(--primary-dark);
  border:1px solid #d7e4ff;
}

.end-btn{
  background:#ef4444;
  color:#fff;
}

@media (max-width: 768px){
  .call-controls{
    flex-direction:column;
  }

  .call-btn{
    width:100%;
  }
}


.input-box{
  margin-top:18px;
  padding:14px;
  border-radius:18px;
  background:#f4f7fc;
  border:1px solid #d9e3f3;
  box-shadow:0 8px 20px rgba(15, 23, 42, 0.06);
}

.input-label{
  font-size:14px;
  color:var(--muted);
  margin-bottom:10px;
  text-align:left;
}

.input-row{
  display:flex;
  gap:10px;
  align-items:center;
}

#userInput{
  flex:1;
  height:48px;
  border:1px solid #cfd9ea;
  border-radius:12px;
  padding:0 14px;
  font-size:15px;
  color:var(--text);
  background:#fff;
  outline:none;
}

#userInput:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(21,101,192,.10);
}

#submitInput{
  height:48px;
  padding:0 18px;
  border:none;
  border-radius:12px;
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}

#submitInput:hover{
  opacity:.96;
}

.voice-card{
  max-width:460px;
}

.voice-body{
  padding:24px 18px 22px;
}

.call-agent{
  text-align:center;
  margin-top:6px;
  margin-bottom:18px;
}

.agent-avatar{
  width:110px;
  height:110px;
  margin:0 auto 14px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:30px;
  font-weight:700;
  box-shadow:0 14px 34px rgba(21, 101, 192, 0.22);
}

.call-agent h2{
  margin:0;
  font-size:20px;
  color:var(--primary-dark);
}

.call-agent p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:15px;
}

.call-status{
  text-align:center;
  margin-bottom:14px;
}

.hint{
  color:var(--muted);
  font-size:14px;
}

.eq-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:14px;
}

.scope{
  width:100%;
  height:120px;
  background:#f7faff;
  border:1px solid #e2eaf5;
  border-radius:16px;
  display:block;
}

.call-controls{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:18px;
}

.call-btn{
  appearance:none;
  border:none;
  border-radius:999px;
  padding:16px 18px;
  font-size:18px;
  font-weight:700;
  cursor:pointer;
  width:100%;
}

.start-btn{
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  box-shadow:0 12px 30px rgba(21,101,192,.20);
}

.end-btn{
  background:#ef4444;
  color:#fff;
  box-shadow:0 10px 24px rgba(239,68,68,.18);
}

@media (max-width: 768px){
  .voice-page{
    padding:10px;
    align-items:flex-start;
  }

  .voice-card{
    max-width:100%;
    border-radius:24px;
  }

  .voice-body{
    padding:18px 14px 18px;
  }

  .agent-avatar{
    width:92px;
    height:92px;
    font-size:26px;
  }

  .call-agent h2{
    font-size:18px;
  }

  .call-agent p{
    font-size:14px;
  }

  .scope{
    height:105px;
  }

  .input-row{
    flex-direction:column;
    align-items:stretch;
  }

  #submitInput{
    width:100%;
  }
}