:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #202b34; background: #f3f5f4; font-size: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; }
header, main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 12px 20px; }
header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; color: #61746c; }
h1 { font-size: 22px; margin: 3px 0 0; }
#connection { font-size: 12px; color: #527467; background: #e3ece6; border-radius: 20px; padding: 6px 12px; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 0; }
.controls, .transcript { background: #fff; border: 1px solid #dfe5e1; border-radius: 9px; }
.controls { flex: 0 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px 18px; padding: 12px 16px; max-height: 44vh; overflow: auto; }
label { font-size: 12px; color: #4c6156; }
select { display: block; width: 100%; padding: 6px; margin-top: 4px; border: 1px solid #cbd7d0; border-radius: 5px; background: white; color: #253c30; font-size: 13px; }
optgroup { font-weight: 600; }
input[type=range] { display: block; width: 100%; accent-color: #287956; margin-top: 9px; }
output { float: right; color: #253c30; }
button { border: 0; border-radius: 5px; background: #226b4c; color: white; padding: 7px 11px; font-size: 12px; cursor: pointer; }
button.secondary { background: #edf3ef; color: #29563c; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, select:focus-visible { outline: 3px solid #92b9a4; }
.buttons { grid-column: 1/-1; display: flex; gap: 8px; flex-wrap: wrap; }
.transcript { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.section-title { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid #e1e7e3; }
h2 { margin: 0; font-size: 13px; }
.section-title span { color: #748079; font-size: 11px; }
#items { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 5px 14px; }
.item { padding: 5px 56px 5px 0; border-bottom: 1px solid #edf0ed; position: relative; }
.item:last-child { border-bottom: 0; }
.en, .zh { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.5; }
.en { font-size: 13px; color: #778079; }
.zh { font-size: 15px; color: #213d2d; }
.draft .zh { color: #73816e; }
.meta { position: absolute; right: 0; top: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 9px; color: #8a948e; }
.meta button { padding: 2px 6px; font-size: 10px; background: #edf3ef; color: #29563c; }
.speaking { border-left: 3px solid #347d59; padding-left: 8px; background: #f5faf6; }
#empty { color: #84918a; padding: 20px; text-align: center; }
@media (max-width: 650px) {
  header, main { padding-left: 10px; padding-right: 10px; }
  .controls { grid-template-columns: 1fr 1fr; padding: 10px 12px; gap: 8px 12px; }
  .voice { grid-column: 1/-1; }
}

#speechStatus:not([hidden]) { grid-column: 1/-1; color: #a44635; font-size: 12px; }

#voiceDebug { grid-column: 1/-1; font-size: 12px; }
#voiceDetails { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: auto; }

h1 { display: flex; align-items: center; gap: 8px; }
