:root {
  --bg: #0F1115; --panel: #181B22; --line: #262A33; --text: #F4F6FA; --sub: #9AA3B2;
  --accent: #3D8BFF; --rec: #FF4D5E; --fs: 26px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; }
.title { font-weight: 700; font-size: 17px; }
.bar-right { display: flex; gap: 6px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip.on { border-color: var(--accent); color: var(--accent); }

.langs { display: flex; align-items: flex-end; gap: 8px; padding: 4px 14px 10px; }
.sel { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }
.sel select {
  appearance: none; -webkit-appearance: none; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-weight: 600;
}
.swap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 42px; font-size: 18px; }
.langs.locked { opacity: .55; pointer-events: none; }

.feed { flex: 1; overflow-y: auto; padding: 6px 16px 16px; scroll-behavior: smooth; }
.empty { color: var(--sub); text-align: center; margin-top: 18vh; line-height: 1.6; }
.empty b { color: var(--text); }
.sub { color: var(--sub); font-size: 13px; }
.item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.item .tr { font-size: var(--fs); line-height: 1.4; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
.item .or { font-size: calc(var(--fs) * .55); color: var(--sub); margin-top: 4px; line-height: 1.4; }
.hide-orig .item .or { display: none; }
.item.wait .tr { color: var(--sub); font-weight: 400; }
.item.err .tr { color: #FF9AA4; font-size: 15px; font-weight: 400; }
.item .retry { margin-left: 6px; background: none; border: 1px solid #FF9AA4; color: #FF9AA4; border-radius: 6px; padding: 1px 8px; font-size: 13px; }

.live { padding: 8px 16px; color: var(--sub); font-size: calc(var(--fs) * .6); border-top: 1px dashed var(--line); max-height: 22vh; overflow: hidden; }

.controls { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.tools { display: flex; gap: 6px; margin-bottom: 10px; }
.tool { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 0; font-size: 14px; }
.tool.on { border-color: var(--accent); color: var(--accent); }
.mic {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); border: 0; border-radius: 14px; padding: 15px; font-size: 18px; font-weight: 700; color: #fff;
}
.mic .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.mic.rec { background: var(--rec); }
.mic.rec .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.status { min-height: 18px; text-align: center; font-size: 12px; color: var(--sub); margin-top: 6px; }

.dlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; width: min(92vw, 420px); padding: 18px; }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg h3 { margin: 0 0 6px; font-size: 17px; }
.dlg input { width: 100%; margin: 12px 0; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.btn { background: var(--accent); border: 0; border-radius: 10px; padding: 9px 16px; color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(10px); opacity: 0; pointer-events: none;
  background: #2B303B; color: var(--text); padding: 10px 16px; border-radius: 999px; font-size: 14px; transition: .25s; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%); }
.ver { position: fixed; right: 6px; bottom: 2px; font-size: 9px; color: #3A404C; pointer-events: none; }
