/* YJ 회의 통역 — 목업(../../meeting-mockup/index.html)과 같은 색·모양. 외부 글꼴 없음 (CSP: style-src 'self'). */
:root {
  --bg: #eef1ef; --panel: #ffffff; --ink: #17211e; --muted: #5d6a66; --line: #d5dcd9; --soft: #f5f7f6;
  --live: #d9732b; --live-soft: #fbe9dc; --ko: #2f5d8c; --ko-soft: #e3ecf5; --vi: #b0412b; --vi-soft: #f7e4df;
  --ok: #2e7d5b; --bad: #b3261e; --bad-soft: #fbe4e2;
  --font-body: "Be Vietnam Pro", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121816; --panel: #1b2321; --ink: #e6ece9; --muted: #9aa8a3; --line: #2f3a37; --soft: #222c29;
    --live: #f0954f; --live-soft: #3a2a1d; --ko: #86aedb; --ko-soft: #1f2d3b; --vi: #e88a74; --vi-soft: #3a2420;
    --ok: #6cc59b; --bad: #f2a29b; --bad-soft: #3b2120;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--ko); }
button { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--ko); outline-offset: 2px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left, 0px)) 40px max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; }
.note-page { max-width: 560px; padding-top: 48px; }
.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.top h1 { margin: 0; font-size: 20px; font-weight: 700; }
.top .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--live-soft); color: var(--live); vertical-align: middle; margin-left: 6px; }
.pill { font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; }
.card h2 { margin: 0; font-size: 17px; }
.muted { color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"] { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--ink); }
input.code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 9px 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--live); border-color: var(--live); color: #fff; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; border-radius: 14px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.error { color: var(--bad); font-size: 13px; min-height: 1.4em; margin: 0; }
.notice { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 8px 10px; margin: 0; }

/* 주관자 */
.host-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: center; }
.host-grid > .card { width: min(100%, 460px); }
.live { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.dot.on { background: var(--live); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.join { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--soft); border-radius: 12px; padding: 12px; }
.join img { width: 132px; height: 132px; border-radius: 6px; background: #fff; display: block; }
.join .code { font-family: var(--font-mono); font-size: 26px; font-weight: 500; letter-spacing: .08em; }
.join small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.linkrow { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.linkrow button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--ink); }
table.people { width: 100%; border-collapse: collapse; font-size: 13px; }
table.people th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.people td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.people td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lang { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 4px; }
.lang.ko { background: var(--ko-soft); color: var(--ko); }
.lang.vi { background: var(--vi-soft); color: var(--vi); }
.state { font-size: 12px; color: var(--muted); }
.state.speaking { color: var(--live); font-weight: 600; }
.state.off { color: var(--bad); }
.settings { display: grid; gap: 4px; font-size: 13px; }
.settings .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.settings .row span:last-child { text-align: right; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats div { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.stats b { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); font-size: 11px; }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--soft); border-radius: 10px; padding: 8px 10px; }

/* 참석자 화면 (휴대폰) */
.phone { width: min(100%, 460px); margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 10px; display: flex; flex-direction: column; height: calc(100dvh - 32px); min-height: 480px; max-height: 900px; }
.host-grid .phone { height: 680px; margin: 0; }
.phone .bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; gap: 8px; }
.phone .bar b { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone .bar .me { font-size: 12px; color: var(--muted); white-space: nowrap; }
.banner { margin: 0 4px 6px; font-size: 12px; padding: 6px 10px; border-radius: 10px; background: var(--soft); color: var(--muted); }
.banner.warn { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.banner button { border: 0; background: none; color: var(--ko); font-weight: 700; cursor: pointer; padding: 0 0 0 6px; }
.speaking-bar { margin: 0 4px 6px; font-size: 12px; padding: 6px 10px; border-radius: 10px; background: var(--live-soft); color: var(--live); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.stream { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 10px; }
.empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; max-width: 26ch; }
.msg { border-radius: 14px; padding: 10px 12px; background: var(--soft); display: grid; gap: 4px; min-width: 0; }
.msg.mine { background: transparent; border: 1px solid var(--line); }
.msg.tr { border-left: 3px solid var(--live); }
.msg.failed { border-left: 3px solid var(--bad); }
.msg .meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.msg .meta .who { font-weight: 600; color: var(--ink); }
.msg .meta .t { margin-left: auto; font-family: var(--font-mono); font-size: 11px; }
.msg .main { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.msg .main.fail { color: var(--bad); font-weight: 600; font-size: 14px; }
.msg .meta .x { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 0 8px; font-size: 11px; line-height: 18px; cursor: pointer; }
.msg .meta .x:hover { color: var(--bad); border-color: var(--bad); }
.msg .meta .x:disabled { opacity: .5; cursor: default; }
.msg.canceled { opacity: .6; }
.msg .main.canceled { color: var(--muted); font-size: 13px; font-style: italic; }
.msg .orig { margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.msg .orig::before { content: attr(data-label) " · "; font-weight: 600; }
.pending { color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--ko); color: var(--ko); }
.status { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 1em; }
.status.playing { color: var(--live); font-weight: 600; }
.status button { border: 0; background: none; color: var(--ko); font-weight: 600; cursor: pointer; padding: 0; font-size: 12px; }
.waves { display: inline-flex; gap: 2px; align-items: center; height: 12px; }
.waves i { width: 3px; height: 4px; background: currentColor; border-radius: 2px; animation: wave .9s infinite ease-in-out; }
.waves i:nth-child(2) { animation-delay: .15s; } .waves i:nth-child(3) { animation-delay: .3s; } .waves i:nth-child(4) { animation-delay: .45s; }
@keyframes wave { 50% { height: 12px; } }
.talk { margin-top: 8px; padding: 6px 4px 4px; display: grid; gap: 6px; justify-items: center; }
.talk button { width: 100%; border: 0; border-radius: 18px; padding: 18px; font-size: 17px; font-weight: 700; background: var(--ink); color: var(--bg); cursor: pointer; display: flex; justify-content: center; gap: 10px; align-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.talk button.rec { background: var(--live); color: #fff; }
.talk button.rec.ending { background: var(--bad); }
.talk button:disabled { opacity: .45; cursor: default; }
.talk small { color: var(--muted); font-size: 12px; text-align: center; min-height: 1.5em; }
.talk small.mic { min-height: 0; font-size: 11px; }
.talk small.mic.warn { color: var(--bad); font-weight: 600; }
.talk .timer { font-family: var(--font-mono); }
.mic { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.rec .mic { background: currentColor; animation: pulse 1s infinite; }
.meter { width: 100%; height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--live); transition: width .08s linear; }

.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); display: grid; place-items: center; padding: 16px; z-index: 10; }
.overlay .card { width: min(100%, 420px); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 480px) { .join { grid-template-columns: 1fr; justify-items: start; } .wrap { padding-top: 10px; } }
