/* ===== MeetAgent — 전문가용 앱 디자인 시스템 (라이트 기본 / 다크 토글) ===== */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --elevated: #ffffff;
  --text: #101828;
  --text-2: #475467;
  --muted: #98a2b3;
  --border: #e7eaee;
  --border-2: #d5d9e0;
  --brand: #635bff;
  --brand-strong: #4f46e5;
  --brand-soft: #eef0ff;
  --brand-ring: rgba(99, 91, 255, .22);
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --success: #2e9d5b;
  --warning: #d99311;
  --live: #e5484d;
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 4px 12px rgba(16,24,40,.08);
  --sh-3: 0 12px 32px rgba(16,24,40,.14);
  --r: 12px; --r-sm: 9px; --r-lg: 18px;
  --sidebar-w: 250px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "Helvetica Neue", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0a0d14;
  --surface: #12151e;
  --surface-2: #1a1f2b;
  --elevated: #161b26;
  --text: #eaecf0;
  --text-2: #98a2b3;
  --muted: #667085;
  --border: #232a37;
  --border-2: #303849;
  --brand: #8b85ff;
  --brand-strong: #a5a0ff;
  --brand-soft: #1b1c3a;
  --brand-ring: rgba(139,133,255,.25);
  --danger: #f2555a;
  --danger-soft: #2a1518;
  --success: #3ec77e;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 6px 18px rgba(0,0,0,.5);
  --sh-3: 0 16px 44px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.55; -webkit-font-smoothing: antialiased; letter-spacing: -.006em;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; line-height: 1.22; letter-spacing: -.02em; font-weight: 700; }
svg { width: 20px; height: 20px; display: block; flex: 0 0 auto; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 15px; color: #fff;
  background: var(--brand); transition: background .15s, box-shadow .15s, border-color .15s, transform .05s, color .15s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--brand-strong); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #cf3b40; }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
/* legacy bare buttons default to primary (커스텀 클래스 버튼은 제외) */
button:not(.btn):not(.iconbtn):not(.tab):not(.langbtn):not(.dock-btn):not(.panel-tab):not(.linkbtn) {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: #fff; background: var(--brand);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 15px; }
button:not(.btn):not(.iconbtn):not(.tab):not(.langbtn):not(.dock-btn):not(.panel-tab):not(.linkbtn):hover { background: var(--brand-strong); }
button.secondary { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border-2) !important; }

.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  padding: 0; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* language toggle */
.langseg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.langbtn { background: transparent; border: 0; padding: 6px 11px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.langbtn.active { background: var(--brand-soft); color: var(--brand); }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; text-align: left; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 10px 13px; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 2px 0; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; text-align: left; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.check label { font-size: 13.5px; color: var(--text); margin: 0; font-weight: 500; cursor: pointer; }
.check a { text-decoration: underline; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.card.pad-lg { padding: 26px; }

/* badges / avatars */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.live { background: var(--danger-soft); color: var(--danger); }
.badge.live svg { width: 9px; height: 9px; animation: pulse 1.4s infinite; }
.badge.ended { background: var(--surface-2); color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; width: 34px; height: 34px; flex: 0 0 auto; }

/* ========== APP SHELL ========== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; font-weight: 800; font-size: 19px; }
.sb-brand .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#635bff,#9333ea); display: grid; place-items: center; color: #fff; }
.sb-brand .mark svg { width: 18px; height: 18px; }
.sb-brand .dot { color: var(--brand); }
.sb-cta { padding: 4px 14px 12px; }
.sb-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.sb-section { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.navitem { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--text-2);
  font-size: 14px; font-weight: 600; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.navitem:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.navitem.active { background: var(--brand-soft); color: var(--brand); }
.navitem svg { width: 19px; height: 19px; }
.sb-spacer { flex: 1; }
.sb-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sb-tools { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.usercard { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.usercard:hover { background: var(--surface-2); }
.usercard .u-meta { min-width: 0; }
.usercard .u-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .u-mail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.appbar h1 { font-size: 17px; font-weight: 700; }
.appbar .sub { color: var(--muted); font-size: 13px; }
.appbar .spacer { flex: 1; }
.appbar-actions { display: flex; align-items: center; gap: 10px; }
.hamburger { display: none; }
.content { padding: 26px 24px 60px; max-width: 1120px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.section-title svg { width: 18px; height: 18px; color: var(--muted); }

/* dashboard action cards */
.action-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action-card { display: flex; flex-direction: column; gap: 12px; }
.action-card .ac-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.action-card .ac-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.action-card .row { display: flex; gap: 9px; }
.action-card .row input { flex: 1; }

/* tabs */
.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tab { border: 0; background: transparent; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text-2); border-radius: 8px; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* meeting list */
.mlist { display: flex; flex-direction: column; gap: 10px; }
.mrow { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.mrow:hover { border-color: var(--border-2); box-shadow: var(--sh-2); }
.mrow .m-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.mrow .m-body { min-width: 0; flex: 1; }
.mrow .m-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mrow .m-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.mrow .m-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mrow .m-meta svg { width: 14px; height: 14px; }
.mrow .m-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .e-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--muted); }
.empty svg { width: 26px; height: 26px; }

/* ========== AUTH ========== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside { background: linear-gradient(160deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside .brand { font-weight: 800; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.auth-aside .mark { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.auth-aside h2 { font-size: 30px; line-height: 1.25; margin-top: auto; font-weight: 800; }
.auth-aside p { color: rgba(255,255,255,.82); margin-top: 14px; font-size: 15px; }
.auth-aside .pts { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.auth-aside .pt { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: rgba(255,255,255,.92); }
.auth-aside .pt .pc { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth-tools { position: absolute; top: 20px; right: 24px; display: flex; gap: 8px; align-items: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.notice { background: var(--brand-soft); color: var(--brand); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 16px; }
.muted-note { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.linkbtn { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.hr-consent { border: 0; border-top: 1px solid var(--border); margin: 14px 0 6px; }

/* ========== LANDING ========== */
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; max-width: 1160px; margin: 0 auto; }
.lp-nav .brand { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 9px; }
.lp-nav .brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg,#635bff,#9333ea); display: grid; place-items: center; color:#fff; }
.lp-nav .right { display: flex; align-items: center; gap: 10px; }
.hero { text-align: center; padding: 68px 24px 30px; max-width: 860px; margin: 0 auto; }
.hero .pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 6px 13px; border-radius: 999px; margin-bottom: 22px; }
.hero .pill svg { width: 15px; height: 15px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 850; letter-spacing: -.035em; }
.hero h1 .grad { background: linear-gradient(120deg,#635bff,#9333ea); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); font-size: clamp(15px,2.3vw,19px); margin: 20px auto 0; max-width: 600px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.features { max-width: 1080px; margin: 60px auto 0; padding: 0 24px 70px; display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 16px; text-align: left; }
.features .card .f-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.features .card h3 { font-size: 16px; margin-bottom: 7px; }
.features .card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ========== MEETING ROOM ========== */
.lobby-overlay { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; padding: 20px; z-index: 40; }
.lobby-card { width: 100%; max-width: 420px; }
.lobby-card .l-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.lobby-card .brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.lobby-card .brand .mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg,#635bff,#9333ea); display: grid; place-items: center; color:#fff; }

.room { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }
.room-top { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.room-top .rt-title { font-weight: 700; font-size: 15px; }
.room-top .rt-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.room-top .rt-meta .chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); padding: 4px 9px; border-radius: 8px; }
.room-top .spacer { flex: 1; }
.room-body { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; padding: 16px; }
.video-grid { flex: 1; display: grid; gap: 12px; align-content: center; justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); min-height: 0; }
.tile { position: relative; background: #0b0f18; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--sh-1); }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.audio-only { display: grid; place-items: center; }
.tile .name { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; display: flex; align-items: center; gap: 5px; }

/* floating control dock */
.dock { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border);
  border-radius: 16px; padding: 9px; box-shadow: var(--sh-3); }
.dock-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 58px; height: 54px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  font-size: 10.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:hover { background: var(--surface-2); }
.dock-btn.on { color: var(--brand); }
.dock-btn.off { color: var(--danger); }
.dock-btn.danger { color: #fff; background: var(--danger); }
.dock-btn.danger:hover { background: #cf3b40; }
.dock-sep { width: 1px; align-self: stretch; background: var(--border); margin: 6px 3px; }

/* right panel */
.panel { width: 340px; flex: 0 0 340px; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; }
.panel-tabs { display: flex; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.panel-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 0; background: transparent;
  border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.panel-tab svg { width: 16px; height: 16px; }
.panel-tab.active { background: var(--brand-soft); color: var(--brand); }
.panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.panel-body.hide { display: none; }
.sub-item { margin-bottom: 13px; }
.sub-item .who { font-weight: 700; font-size: 13px; margin-right: 6px; }
.sub-item .when { color: var(--muted); font-size: 11px; }
.sub-item .txt { font-size: 14.5px; margin-top: 2px; }
.sub-item.interim .txt { color: var(--muted); font-style: italic; }
.sub-item .trans { color: var(--success); font-size: 13.5px; margin-top: 3px; }
.sub-item .orig { color: var(--muted); font-size: 12px; margin-top: 2px; }
.sub-sys { color: var(--muted); font-size: 12px; text-align: center; padding: 6px 0; }
.plist-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.plist-item .pn { font-size: 14px; font-weight: 600; }
.plist-item .pt { font-size: 11.5px; color: var(--muted); }

/* ========== DETAIL ========== */
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.videos .card { padding: 12px; }
.videos video { width: 100%; border-radius: 10px; background: #0b0f18; display: block; }
.videos .who { font-size: 13px; color: var(--muted); margin-top: 9px; display: flex; align-items: center; gap: 7px; }
.transcript { max-height: 460px; overflow-y: auto; }
.chatbox { display: flex; flex-direction: column; height: 460px; padding: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.chat-input .btn { padding: 10px 14px; }

/* AI 회의록(markdown) */
.md h3 { font-size: 15px; margin: 16px 0 6px; color: var(--text); }
.md h3:first-child { margin-top: 0; }
.md h4 { font-size: 13.5px; margin: 12px 0 5px; color: var(--text-2); }
.md p { margin: 6px 0; font-size: 14.5px; }
.md ul { margin: 6px 0 10px; padding-left: 20px; }
.md li { font-size: 14.5px; margin: 3px 0; }
.md strong { font-weight: 700; }

/* ---------- responsive ---------- */
.scrim { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--sh-3); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
  .hamburger { display: inline-flex; }
  .content { padding: 20px 16px 50px; }
  .action-cards, .grid-2 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 820px) {
  .room-body { flex-direction: column; }
  .panel { width: 100%; flex: none; border-left: 0; border-top: 1px solid var(--border); height: 40vh; }
  .stage { min-height: 52vh; }
  .video-grid { grid-template-columns: 1fr; }
  .dock-btn { min-width: 50px; }
}
.hide { display: none !important; }
