/* 눈치 mobile — meeting only: one-line header, the conversation, a fixed dock. Tokens from theme.css. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 15px/1.5 -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.hidden { display: none !important; }
.hint { color: var(--mut); font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
.mark { font-weight: 700; letter-spacing: -.08em; font-size: 30px; }
.mark.sm { width: 34px; height: 34px; border-radius: 50%; background: var(--txt); color: #fff; font-size: 11px; letter-spacing: -.06em; display: grid; place-items: center; flex: none; }

/* header: one line */
.bar { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; border-bottom: 1px solid var(--line2); background: var(--bg); }
.head-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.head-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capdot { width: 6px; height: 6px; border-radius: 50%; background: #cfcfcf; flex: none; }
.capdot.on { background: var(--grn); }
.lang { appearance: none; -webkit-appearance: none; border: 0; background: var(--panel); color: var(--txt); font: inherit; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 10px; }
.live-pill { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--mut); background: var(--panel); border-radius: 999px; padding: 6px 9px; font-variant-numeric: tabular-nums; }
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #b4b4b4; }
.live-pill.on { color: #b54343; }
.live-pill.on .dot { background: #d64545; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel) center/cover no-repeat; flex: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--mut); }

/* conversation: newest at the bottom, like a chat on a phone */
.thread { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 22px; overscroll-behavior: contain; position: relative; overflow-anchor: none; }
.empty { margin: auto 0; text-align: center; padding: 20px 8px; }
.eyebrow { font-size: 10px; font-weight: 600; color: var(--mut); letter-spacing: .15em; margin: 0 0 12px; }
.empty h2 { font-size: 24px; font-weight: 550; line-height: 1.25; letter-spacing: -.05em; margin: 0 0 14px; }
.msg { max-width: 92%; overflow-wrap: anywhere; }
.msg .who { color: var(--mut); font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.msg.them { align-self: flex-start; }
.msg.them.tap { cursor: pointer; }
.msg.them.tap:active { opacity: .6; }
.msg .orig { font-size: 15px; line-height: 1.65; }
.msg .orig.sub { font-size: 13px; color: var(--mut); }
.msg .trans { font-size: 15px; line-height: 1.65; margin-top: 6px; }
.msg .trans.draft { color: #9a9a9a; }
.msg .sum { margin-top: 6px; padding-left: 9px; border-left: 2px solid var(--line); font-size: 13px; color: var(--mut); }
.msg.live .who::after { content: " · live"; color: var(--grn); font-weight: 500; }
.msg.selected { outline: 2px solid var(--acc); outline-offset: 6px; border-radius: 6px; }
.msg.ai { align-self: flex-start; border-left: 3px solid #0f766e; padding: 2px 0 2px 12px; }
.msg.ai .who { color: #0f766e; }
.msg.ai.answer { border-left-color: var(--acc); }
.msg.ai.answer .who { color: var(--txt); }
.msg.ai .body { font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; }
.msg.ai ul { margin: 0; padding-left: 18px; white-space: normal; }
.msg.ai li { margin: 3px 0; }
.msg.ai .en { margin-top: 8px; font-size: 13.5px; line-height: 1.65; color: #33564d; background: #f5f8f7; border-radius: 12px; padding: 10px 12px; }
.msg.ai .note { margin-top: 8px; font-size: 13px; background: var(--panel); border-radius: 12px; padding: 10px 12px; }
.msg.sys { align-self: center; max-width: 100%; text-align: center; font-size: 11.5px; color: var(--mut); }

.meetctx { flex: none; margin: 0 16px 6px; padding: 8px 12px; background: #e6f4f1; border-radius: 12px; font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; overflow: hidden; white-space: nowrap; }
.statusline { flex: none; text-align: center; font-size: 11px; color: var(--mut); padding: 4px 16px 6px; min-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* dock: Agent join · Record/Stop · About meeting */
.dock { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 16px calc(env(safe-area-inset-bottom) + 12px); border-top: 1px solid var(--line2); background: var(--bg); }
.dock-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--mut); font-size: 11px; font-weight: 600; padding: 6px 0; min-height: 52px; }
.dock-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.dock-btn[aria-pressed="true"] { color: #0f766e; }
.dock-btn[aria-pressed="true"] svg { fill: #0f766e; stroke: #0f766e; }

.rec { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--txt); background: var(--bg); display: grid; place-items: center; padding: 0; }
.rec-icon { width: 54px; height: 54px; border-radius: 50%; background: #d64545; transition: all .2s; }
.rec.on { border-color: #d64545; }
.rec.on .rec-icon { width: 24px; height: 24px; border-radius: 6px; }
.rec:disabled { opacity: .4; }

/* sheets */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(20, 20, 20, .35); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 86dvh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom) + 18px); }
.sheet.tall { max-height: 92dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.04em; }
.x { border: 0; background: var(--panel); width: 32px; height: 32px; border-radius: 50%; color: var(--mut); font-size: 14px; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 16px; line-height: 1.5; color: var(--txt); background: var(--bg); resize: vertical; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.primary, .secondary { border-radius: 999px; font-size: 14px; font-weight: 600; padding: 13px 18px; }
.primary { flex: 1; background: var(--acc); color: #fff; border: 0; }
.secondary { background: var(--bg); color: var(--txt); border: 1px solid var(--line); }
.saved { background: #e6f4f1; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; margin-bottom: 10px; white-space: pre-wrap; }
.reply { background: var(--panel); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; margin-top: 10px; white-space: pre-wrap; }
.state { font-size: 13px; color: var(--mut); margin: 0 0 10px; }
.state.ok { color: var(--grn); font-weight: 600; }
.ask { background: var(--panel); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.ask p { margin: 0; font-size: 14px; line-height: 1.6; }
.report { font-size: 14px; line-height: 1.65; }
.md h1 { font-size: 18px; margin: 4px 0 6px; } .md h2 { font-size: 15px; margin: 16px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line); } .md h3 { font-size: 14px; margin: 10px 0 2px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; } .md p { margin: 4px 0; }
.md blockquote { margin: 0; padding: 0 10px; border-left: 3px solid var(--line); color: var(--mut); }
.md table { border-collapse: collapse; width: 100%; font-size: 12.5px; } .md th, .md td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.mut { color: var(--mut); }
.acc-email { font-weight: 600; margin: 0 0 8px; overflow-wrap: anywhere; }
.acc-settings { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0 0 6px; }
.acc-settings dt { color: var(--mut); } .acc-settings dd { margin: 0; }

/* sign-in */
.gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; }
.gate h1 { font-size: 26px; font-weight: 550; letter-spacing: -.05em; margin: 22px 0 4px; }
.gate-tag { color: var(--mut); margin: 0 0 22px; }
.gate .hint { max-width: 320px; }
.gate .primary { flex: none; width: 100%; max-width: 300px; margin-top: 10px; }
.gate-msg { color: var(--mut); font-size: 13px; min-height: 1.5em; margin-top: 14px; max-width: 320px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 112px); transform: translateX(-50%); z-index: 40; background: var(--txt); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px; max-width: calc(100% - 32px); }

/* rows: them (person icon) left · 눈치 (agent) left · me (my photo) right */
.mrow { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; }
.mrow.me { flex-direction: row-reverse; align-self: flex-end; }
.mrow .msg { min-width: 0; max-width: calc(100% - 40px); }
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--panel) center/cover no-repeat; border: 1px solid var(--line); margin-top: 1px; }
.av.person svg { width: 17px; height: 17px; fill: none; stroke: #8a8a8a; stroke-width: 1.6; stroke-linecap: round; }
.av.nunchi { background: var(--txt); border-color: var(--txt); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: -.06em; }
.av.mine { font-size: 12px; font-weight: 600; color: var(--mut); }
.msg.me { background: #f4f4f4; border-radius: 18px; padding: 10px 14px; }
.msg.me .orig { font-size: 15px; }
.msg.ai, .msg.ai.answer { border-left: 0; padding: 0; }
.msg.ai .who { color: var(--mut); }
.msg.live .orig::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--grn); vertical-align: middle; animation: pulse 1.2s ease-in-out infinite; }
.msg.live .who::after { content: none; }
.say { margin-top: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); border-radius: 999px; font-size: 12.5px; font-weight: 600; padding: 7px 12px; }
.say.playing { background: var(--txt); color: #fff; border-color: var(--txt); }

/* paused: 회의 종료 card at the top of the conversation */
.pausecard { align-self: stretch; border: 1px solid var(--line); border-radius: 18px; padding: 14px; text-align: center; background: var(--panel); }
.pausecard p { margin: 0 0 10px; font-size: 13px; color: var(--mut); line-height: 1.6; }
.pausecard .end { width: 100%; background: #b54343; color: #fff; border: 0; border-radius: 999px; padding: 13px; font-size: 15px; font-weight: 700; }

/* record button: red dot → pause bars while recording */
.rec.on .rec-icon { width: 26px; height: 26px; border-radius: 0; background: linear-gradient(90deg, #d64545 0 36%, transparent 36% 64%, #d64545 64% 100%); }
.rec.paused { border-color: #d64545; }
.dock-ico.nunchi { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; letter-spacing: -.06em; border: 1.5px solid currentColor; }
.dock-btn[aria-pressed="true"] .dock-ico.nunchi { background: #0f766e; border-color: #0f766e; color: #fff; }
#btnAbout { color: #b0b0b5; }
#btnAbout[aria-pressed="true"] { color: #0f766e; }
#btnAbout[aria-pressed="true"] svg { fill: #0f766e; stroke: #0f766e; }
#btnAbout[aria-pressed="true"] svg path + path { stroke: #fff; }
body.about .bar { background: #e6f4eb; }

/* install bar + iPhone steps */
.install { position: fixed; z-index: 60; top: calc(env(safe-area-inset-top) + 8px); left: 12px; right: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.12); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line2); }
.install img { border-radius: 50%; flex: none; }
.install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--mut); line-height: 1.4; }
.install-txt b { font-size: 13.5px; color: var(--txt); }
.install-btn { border: 0; background: var(--acc); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; flex: none; }
.install-x { border: 0; background: none; color: var(--mut); font-size: 13px; padding: 6px; flex: none; }
.steps { margin: 6px 0 12px; padding-left: 20px; font-size: 14.5px; line-height: 1.9; }
.share-ico { display: inline-block; width: 14px; height: 17px; vertical-align: -2px; border: 1.6px solid #0a7aff; border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.share-ico::before { content: "↑"; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); color: #0a7aff; font-size: 13px; font-weight: 700; }

/* About meeting: 리셋하기 replaces the language picker in the header */
.reset-btn { display: none; border: 1px solid var(--line); background: var(--bg); color: var(--txt); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; flex: none; }

body.about .lang { display: none; }

/* logo = phone settings */
button.mark.sm { border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.pref-label { font-size: 12px; font-weight: 600; color: var(--mut); margin: 18px 0 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--panel); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; color: var(--mut); font: inherit; font-size: 14px; font-weight: 600; padding: 10px; border-radius: 9px; }
.seg button[aria-checked="true"] { background: var(--bg); color: var(--txt); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pref-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.pref-row span { flex: 1; min-width: 0; font-size: 14px; }
.pref-row small, .envs small { display: block; color: var(--mut); font-size: 12px; line-height: 1.5; margin-top: 2px; font-weight: 400; }
.pref-row input { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; margin: 0; transition: background .15s; }
.pref-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.pref-row input:checked { background: var(--grn); }
.pref-row input:checked::after { transform: translateX(20px); }
.envs { display: flex; flex-direction: column; gap: 8px; }
.envs button { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--txt); font: inherit; font-size: 14.5px; padding: 12px 14px; border-radius: 14px; }
.envs button[aria-checked="true"] { border-color: var(--txt); box-shadow: inset 0 0 0 1px var(--txt); }
#prefEnvNote { margin: 10px 0 0; font-size: 12px; }

/* Flip Screen: the whole app upside down, so the phone can stand on its head with the bottom mic facing the room */
html.flip body { transform: rotate(180deg); }

/* dark */
html[data-theme="dark"] { color-scheme: dark; --bg: #161617; --panel: #232325; --card: #1d1d1f; --line: #3a3a3d; --line2: #2a2a2c; --txt: #ececec; --mut: #9a9a9f; --acc: #ececec; --acc2: #2a2a2c; --grn: #3fbf86; }
html[data-theme="dark"] .mark.sm, html[data-theme="dark"] .av.nunchi, html[data-theme="dark"] .primary, html[data-theme="dark"] .install-btn,
html[data-theme="dark"] .toast, html[data-theme="dark"] .say.playing { color: var(--bg); }
html[data-theme="dark"] .msg.me { background: #2a2a2d; }
html[data-theme="dark"] .meetctx, html[data-theme="dark"] .saved { background: #173a33; }
html[data-theme="dark"] body.about .bar { background: #1b2523; }
html[data-theme="dark"] .msg.ai .en { background: #1b2523; color: #a8d5c9; }
html[data-theme="dark"] .msg .trans.draft { color: #77777c; }
html[data-theme="dark"] .capdot { background: #4a4a4e; }
html[data-theme="dark"] .overlay { background: rgba(0, 0, 0, .55); }
html[data-theme="dark"] .dock-btn[aria-pressed="true"], html[data-theme="dark"] .dock-btn.has-ctx { color: #4fb8a3; }
html[data-theme="dark"] .seg button[aria-checked="true"] { background: #3a3a3d; }
html[data-theme="dark"] #btnAbout[aria-pressed="true"] svg path + path { stroke: var(--bg); }

/* Mode controls and the latest answer stay outside the scrolling bubbles. */
.meetctx b { flex: none; }
#meetingCtxText { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mode-actions { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line2); }
.mode-actions #modeHint { flex: 1; min-width: 0; font-size: 11px; color: var(--mut); }
.mode-actions .secondary, .mode-actions .reset-btn { flex: none; padding: 7px 9px; font-size: 11px; white-space: nowrap; }
body.about .mode-actions .reset-btn { display: block; }
body.about #modeHint { display: none; }
.mode-actions #btnReturnMeeting { margin-left: auto; }
.pinned-answer { position: relative; flex: none; padding: 10px 16px 7px; background: var(--panel); border-bottom: 1px solid var(--line2); touch-action: pan-y; }
.pinned-toggle { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--txt); text-align: left; cursor: pointer; touch-action: pan-y; }
.pin-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pin-label { font-size: 10px; font-weight: 700; color: #7654b3; }
#pinnedExpandHint { font-size: 10px; color: var(--mut); }
#pinnedAnswerText { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; max-height: 6.2em; }
.pinned-answer.expanded .pinned-toggle { max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain; }
.pinned-answer.expanded #pinnedAnswerText { display: block; -webkit-line-clamp: unset; max-height: none; overflow: visible; }
.pin-nav-hint { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(60, 42, 86, .12); color: rgba(87, 59, 126, .8); opacity: 0; pointer-events: none; }
.pin-nav-hint.prev { left: 5px; }
.pin-nav-hint.next { right: 5px; }
.pin-nav-hint svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pinned-answer.expanded .pin-nav-hint { animation: pin-nav-peek 1.8s ease-out both; }
@keyframes pin-nav-peek { 0%, 100% { opacity: 0; } 12%, 65% { opacity: 1; } }
html[data-theme="dark"] .pin-nav-hint { background: rgba(224, 204, 255, .14); color: rgba(231, 216, 255, .85); }
@media (prefers-reduced-motion: reduce) {
  .pinned-answer.expanded .pin-nav-hint { animation: pin-nav-peek 1.8s steps(1, end) both !important; }
}

/* Hold Record to enter a purple conversation space. */
.rec { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.rec.holding::after, .rec.agent::after { content: ""; position: absolute; inset: -7px; border: 3px solid transparent; border-top-color: #9b79d0; border-right-color: #d2bdeb; border-radius: 50%; pointer-events: none; animation: agent-ring 1.4s linear infinite; }
.rec.holding::after { animation-duration: .6s; }
@keyframes agent-ring { to { transform: rotate(360deg); } }
.rec.agent, .rec.agent.paused { border-color: #8b5bc2; }
.rec.agent .rec-icon { background: #8b5bc2; }
.rec.agent.on .rec-icon { background: linear-gradient(90deg, #8b5bc2 0 36%, transparent 36% 64%, #8b5bc2 64% 100%); }
.rec.agent.paused::after { animation-play-state: paused; }
body.agent .bar { background: #f1e9fb; }
body.agent .lang { display: none; }
body.agent #meetingTitle { color: #7650a6; font-weight: 700; }
html[data-theme="dark"] body.agent .bar { background: #30223f; }
html[data-theme="dark"] body.agent #meetingTitle, html[data-theme="dark"] .pin-label { color: #ceb1f4; }
html[data-theme="dark"] #btnAbout[aria-pressed="true"] { color: #4fb8a3; }
@media (prefers-reduced-motion: reduce) { .rec.agent::after, .rec.holding::after { animation: none; } }
.gate-join { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; }
.gate-join .btnlink { display: block; text-decoration: none; line-height: 44px; border-radius: 12px; }
.gate-join .small { font-size: 12.5px; margin-top: 18px; }
.joinrow { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.joinrow input { flex: 1; min-width: 0; height: 42px; text-transform: uppercase; letter-spacing: .15em; text-align: center; }
.joinrow button { flex: none; padding: 0 18px; }
.linkbtn { background: none; border: 0; color: var(--mut); text-decoration: underline; margin-top: 16px; font: inherit; font-size: 13px; }
.livelock { align-self: stretch; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 13.5px; line-height: 1.5; }
.livelock b { display: block; margin-bottom: 4px; }
.livelock button { margin-top: 10px; width: 100%; }
