* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e6e8f0;
  --text: #161923;
  --text-2: #5b5f6d;
  --text-3: #9298a5;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef1ff;
  --urgent: #e11d48;
  --urgent-soft: #fef1f4;
  --important: #d97706;
  --important-soft: #fff8ec;
  --personal: #0891b2;
  --personal-soft: #ecfbfd;
  --success: #16a34a;
  --success-soft: #eafbf0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

body.dark {
  --bg: #0d0e14;
  --surface: #171922;
  --surface-2: #1f2230;
  --border: #2a2d3a;
  --text: #f1f2f6;
  --text-2: #a7abb8;
  --text-3: #6d7180;
  --primary: #818cf8;
  --primary-600: #a5b4fc;
  --primary-soft: #242761;
  --urgent: #fb7185;
  --urgent-soft: #3a1620;
  --important: #fbbf24;
  --important-soft: #3a2a08;
  --personal: #22d3ee;
  --personal-soft: #103a42;
  --success: #4ade80;
  --success-soft: #0f2c1c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .5);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .2s ease, color .2s ease;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

/* ================= 로그인 화면 ================= */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 30px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.login-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; margin-bottom: 16px;
}
.login-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 26px; }
.google-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.gsi-button { display: flex; justify-content: center; min-height: 44px; margin-bottom: 6px; }
.google-btn:hover { border-color: var(--text-3); }
.google-btn:disabled { opacity: .55; cursor: not-allowed; }
.google-g {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #4285F4; flex-shrink: 0;
  border: 1px solid var(--border);
}
.login-domain { margin-top: 16px; font-size: 12px; color: var(--text-3); }

.dev-login { margin-top: 26px; width: 100%; padding-top: 20px; border-top: 1px dashed var(--border); }
.dev-login-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
}
.dev-account-list { display: flex; flex-direction: column; gap: 7px; }
.dev-account-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 9px 12px;
  transition: border-color .15s ease, background .15s ease;
}
.dev-account-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.dev-account-name { font-size: 13px; font-weight: 700; }
.dev-account-name .role { font-weight: 600; color: var(--primary); margin-left: 6px; font-size: 11.5px; }
.dev-account-email { font-size: 11.5px; color: var(--text-3); }
.login-error { margin-top: 16px; font-size: 12.5px; color: var(--urgent); line-height: 1.5; }

/* ================= 앱 레이아웃 ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 24px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  border: none; background: none; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-icon { display: flex; opacity: .85; }
.nav-item.is-active .nav-icon { opacity: 1; }
.nav-label { flex: 1; }

.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-2); flex-shrink: 0;
}
.user-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; font-weight: 700; color: var(--primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.topbar-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.content { padding: 24px 32px 60px; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.page { display: none; animation: fadeIn .2s ease; flex-direction: column; gap: 16px; }
.page.is-active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ================= 버튼 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ================= 카드 ================= */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 14px; }
.empty-state { padding: 30px 12px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.caption-note { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* ================= 팀 컨텍스트 바 ================= */
.team-context { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-context-label { font-size: 12px; font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.team-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.team-chip {
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 6px 12px;
}
.team-chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.team-locked {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px;
}
.team-locked svg { opacity: .6; }
.team-context-hint { font-size: 11.5px; color: var(--text-3); }

/* ================= 서브탭 ================= */
.subtabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; width: fit-content; }
.subtab-btn { border: none; background: none; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 7px 15px; border-radius: 999px; }
.subtab-btn.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.rec-mode-row { margin: 4px 0 12px; }

/* ================= 회의/미팅 폼 ================= */
.rec-form { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 14px; }
.rec-form-2 { grid-template-columns: 1fr 1fr; }
.rec-field-full { grid-column: 1 / -1; margin-bottom: 14px; }
.field-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.rec-input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13.5px; color: var(--text); outline: none; transition: border-color .15s ease, background .15s ease; }
.rec-input:focus { border-color: var(--primary); background: var(--surface); }
.rec-input::placeholder { color: var(--text-3); }
.field-note { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }
.field-note b { color: var(--primary); font-weight: 700; }

/* 직접 녹음 바 */
.rec-bar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.rec-bar.is-recording .rec-dot { background: var(--urgent); animation: pulse 1.4s ease-in-out infinite; }
.rec-bar.is-recording .rec-status { color: var(--urgent); }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(225,29,72,.35); } 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(225,29,72,0); } }
.rec-status { font-size: 12.5px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
.rec-timer { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; margin-left: auto; }
.rec-go { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--urgent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.rec-go:hover { transform: scale(1.06); }
.rec-go span { width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: border-radius .15s ease, width .15s ease, height .15s ease; }
.rec-bar.is-recording .rec-go span { border-radius: 3px; width: 11px; height: 11px; }

/* 파일 업로드 */
.upload-drop { display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 14px 16px; transition: border-color .15s ease, background .15s ease; }
.upload-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-drop svg { flex-shrink: 0; opacity: .7; }
.upload-drop-text { font-size: 12.5px; color: var(--text-2); }
.upload-drop-text b { color: var(--primary); font-weight: 700; }
.upload-drop-hint { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.upload-chosen { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 14px; margin-top: 10px; }
.upload-chosen-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.upload-chosen-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-chosen-meta { font-size: 11px; color: var(--text-3); }
.upload-remove { width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--surface); color: var(--text-3); font-size: 11px; flex-shrink: 0; }
.upload-remove:hover { background: var(--urgent-soft); color: var(--urgent); }

.process-btn { margin-top: 12px; width: 100%; border: none; background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 700; padding: 11px 0; border-radius: var(--radius-sm); transition: background .15s ease; }
.process-btn:hover:not(:disabled) { background: var(--primary-600); }
.process-btn:disabled { background: var(--border); color: var(--text-3); cursor: not-allowed; }

/* 수기 작성 */
.manual-form { display: flex; flex-direction: column; gap: 10px; }
.manual-field { display: flex; flex-direction: column; gap: 5px; }
.rec-textarea { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--text); resize: vertical; min-height: 52px; outline: none; line-height: 1.55; }
.rec-textarea:focus { border-color: var(--primary); background: var(--surface); }
.rec-textarea::placeholder { color: var(--text-3); }

/* 처리 진행 표시 */
.proc-card { margin-top: 12px; }
.proc-steps { list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.proc-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); font-weight: 600; position: relative; text-align: center; }
.proc-step:not(:last-child)::after { content: ""; position: absolute; top: 6px; left: 55%; width: 90%; height: 2px; background: var(--border); z-index: 0; }
.proc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); z-index: 1; }
.proc-step.is-active .proc-dot { background: var(--primary); }
.proc-step.is-active { color: var(--primary); }
.proc-step.is-done .proc-dot { background: var(--success); }
.proc-step.is-done { color: var(--success); }
.proc-note { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 12px; }
.proc-note.is-error { color: var(--urgent); }

/* 최근 회의/미팅 목록 */
.mini-history { display: flex; flex-direction: column; margin-top: 14px; }
.mini-history-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border); font-size: 12.5px; border-radius: 6px; }
.mini-history-item.is-clickable { cursor: pointer; }
.mini-history-item.is-clickable:hover { background: var(--surface-2); }
.mini-history-main { min-width: 0; }
.mini-history-title { font-weight: 600; }
.mini-history-meta { color: var(--text-3); font-size: 11.5px; margin-top: 1px; }
.mini-badge { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); white-space: nowrap; flex-shrink: 0; }
.mini-badge.badge-pending { background: var(--important-soft); color: var(--important); }

/* ================= 인사이트 ================= */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-row-2 { grid-template-columns: repeat(2, 1fr); }
.stat-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 15px; }
.stat-tile.has-flag { background: var(--important-soft); border-color: var(--important); }
.stat-num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; line-height: 1; }
.stat-tile.has-flag .stat-num { color: var(--important); }
.stat-tile .stat-label { font-size: 11px; color: var(--text-2); margin-top: 6px; }
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.issue-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.issue-title { font-size: 13.5px; font-weight: 700; }
.issue-tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.issue-tag.tag-repeat { background: var(--important-soft); color: var(--important); }
.issue-tag.tag-overdue { background: var(--urgent-soft); color: var(--urgent); }
.issue-detail { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.issue-empty { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 18px 0; }

/* ================= 상세 모달 ================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 12, 18, .5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.detail-modal { width: 100%; max-width: 480px; max-height: 84vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 22px 24px; animation: modalIn .15s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 700; text-wrap: balance; }
.modal-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; font-size: 13px; }
.modal-close:hover { background: var(--border); }
.modal-body { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.detail-label { font-size: 10.5px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.detail-value { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.detail-value-pre { white-space: pre-line; font-size: 13px; }
.modal-foot { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* ================= 뉴스 ================= */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.news-updated { font-size: 13px; color: var(--text-2); }
.news-updated strong { color: var(--text); }
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.news-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.news-panel-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.news-panel-header h2 { font-size: 14.5px; font-weight: 700; }
.news-region-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.news-panel-body { max-height: 480px; overflow-y: auto; padding: 6px; }
.news-item { padding: 10px 12px; border-radius: var(--radius-sm); }
.news-item + .news-item { border-top: 1px solid var(--border); }
.news-item-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.news-item-summary { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 6px; }
.news-item-source { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }

/* ================= 스카우팅 ================= */
.scouting-grid { grid-template-columns: repeat(3, 1fr); }
.scouting-signal { display: flex; align-items: flex-start; gap: 5px; font-size: 11.5px; color: var(--important); font-weight: 600; line-height: 1.5; margin-bottom: 6px; }
.scouting-rank-item { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; transition: background .15s ease; }
.scouting-rank-item:hover { background: var(--surface-2); }
.scouting-rank-item:hover .news-item-title { color: var(--primary); }
.scouting-rank-body { flex: 1; min-width: 0; }
.rank-badge { flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rank-badge.rank-top { background: linear-gradient(135deg, var(--important), #f59e0b); color: #fff; }

/* ================= 설정 ================= */
.settings-stack { display: flex; flex-direction: column; gap: 14px; }
.account-row { display: flex; align-items: center; gap: 12px; }
.account-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--text-2); flex-shrink: 0; }
.account-info { min-width: 0; flex: 1; }
.account-name { font-size: 14px; font-weight: 700; }
.account-email { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.account-teams { font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.logout-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); flex-shrink: 0; }
.logout-btn:hover { border-color: var(--urgent); color: var(--urgent); }

.settings-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.settings-item:first-of-type { border-top: none; }
.settings-item-label { font-size: 13.5px; font-weight: 600; }
.settings-item-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.settings-select { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; flex-shrink: 0; }

.toggle { position: relative; width: 40px; height: 23px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s ease; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(17px); }

.master-only-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--primary-soft); color: var(--primary); padding: 2px 7px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.roster-list { display: flex; flex-direction: column; margin-bottom: 16px; }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.roster-row:first-child { border-top: none; }
.roster-email { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.roster-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.roster-badge-master { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.roster-remove { width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text-3); font-size: 11px; flex-shrink: 0; }
.roster-remove:hover { background: var(--urgent-soft); color: var(--urgent); }
.roster-add { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.roster-check-group { display: flex; flex-wrap: wrap; gap: 10px; }
.roster-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.roster-check input { accent-color: var(--primary); }
.roster-check-master { font-weight: 600; color: var(--text); }

/* AI 테스트 패널 */
.ai-field-row { display: flex; gap: 8px; margin: 10px 0; }
.ai-field-row input { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ai-field-note { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.ai-status { font-size: 12px; margin-bottom: 8px; }
.text-success { color: var(--success); }
.text-error { color: var(--urgent); }
.ai-test-panel textarea { width: 100%; resize: vertical; min-height: 60px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; color: var(--text); line-height: 1.5; margin-top: 10px; }
.ai-test-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ai-test-hint { font-size: 12px; color: var(--text-3); }
.ai-response { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.ai-response.is-error { color: var(--urgent); }

/* ================= 토스트 ================= */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: none; }

/* ================= 스크롤바 ================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 반응형 ================= */
@media (max-width: 1200px) { .scouting-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 880px) {
  .news-grid { grid-template-columns: 1fr; }
  .scouting-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { width: 68px; padding: 16px 8px; }
  .brand-name, .nav-label, .user-info { display: none; }
  .brand { justify-content: center; padding-bottom: 20px; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .user-chip { justify-content: center; }
  .topbar { padding: 16px; }
  .content { padding: 18px 16px 50px; }
  .clock { display: none; }
  .rec-form, .rec-form-2 { grid-template-columns: 1fr; }
}
