/* ── 기본 리셋 & 변수 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d2e;
  --surface2: #252840;
  --border: #2e3250;
  --accent: #6c8dfa;
  --accent2: #a78bfa;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

/* ── 라이트 모드 ── */
body.light {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #e8eaf2;
  --border: #d0d4e8;
  --accent: #4a6cf7;
  --accent2: #7c4dff;
  --text: #1a1d2e;
  --text-muted: #5a6282;
  --green: #16a34a;
  --yellow: #ca8a04;
  --red: #dc2626;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 헤더 ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 58px;
}
.logo { font-size: 1.1rem; font-weight: 700; color: var(--accent2); white-space: nowrap; }

#main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; flex: 1; }
#main-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; transition: all .2s;
  white-space: nowrap; flex-shrink: 0;
}
.tab-btn:hover { color: var(--text); background: var(--surface2); }
.tab-btn.active { color: var(--accent); background: rgba(108,141,250,.12); }

/* ── 헤더 우측 액션 그룹 ── */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* ── GitHub 드롭다운 ── */
.github-wrap { position: relative; }
.github-icon-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px; cursor: pointer;
  transition: background .2s; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
}
.github-icon-btn img { width: 20px; height: 20px; display: block; filter: var(--github-icon-filter); }
:root { --github-icon-filter: invert(1); }
body.light { --github-icon-filter: invert(0); }
.github-icon-btn:hover { background: var(--border); }
.github-icon-btn.connected { border-color: var(--green); }
.github-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; width: 260px;
  box-shadow: var(--shadow); z-index: 200;
}
.github-user-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
#github-username-badge { color: var(--green); font-weight: 600; font-size: .88rem; }
#github-repo-select { width: 100%; font-size: .82rem; margin-bottom: 8px; }
.github-disconnect-btn {
  width: 100%; font-size: .8rem; padding: 5px 10px;
  background: none; border: 1px solid var(--text-muted);
  border-radius: 6px; color: var(--text-muted); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.github-disconnect-btn:hover { border-color: var(--red); color: var(--red); }
.github-dropdown-desc { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }

/* ── 테마 버튼 ── */
.theme-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
  font-size: 1rem; transition: background .2s; flex-shrink: 0;
}
.theme-btn:hover { background: var(--border); }

/* ── 햄버거 버튼 (모바일 전용) ── */
.menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; width: 38px; height: 38px;
}
.menu-btn span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 모바일 반응형 ── */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap; height: auto; min-height: 58px;
    padding: 10px 16px; gap: 10px;
  }
  .logo { flex: 1; }
  .header-actions { margin-left: 0; }
  .menu-btn { display: flex; }
  #main-nav {
    display: none; flex-direction: column; gap: 4px;
    width: 100%; order: 3; flex: none;
    padding: 8px 0; border-top: 1px solid var(--border);
  }
  #main-nav.open { display: flex; }
  .tab-btn { text-align: left; padding: 10px 14px; font-size: .95rem; }
  .github-dropdown { right: 0; left: auto; width: 240px; }
}

/* ── 메인 ── */
main { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

.tab-content { display: none; }
.tab-content.active { display: block; }
.hidden { display: none !important; }

/* ── 카드 ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.desc { color: var(--text-muted); margin-bottom: 20px; font-size: 0.9rem; }

/* ── 페이지네이션 ── */
.page-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); cursor: pointer;
  font-size: .82rem; transition: background .15s;
}
.page-btn:hover:not([disabled]) { background: var(--accent); color: #fff; }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn[disabled] { opacity: .35; cursor: default; }
.page-ellipsis { line-height: 2; color: var(--text-muted); font-size: .85rem; }

/* ── 토글 (details/summary) ── */
details summary::-webkit-details-marker { display: none; }
details .toggle-arrow { transition: transform .2s; display:inline-block; font-size:.75rem; color:var(--text-muted); }
details[open] .toggle-arrow { transform: rotate(90deg); }

/* ── 폼 ── */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
input[type="number"], input[type="text"], input[type="password"], textarea, select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 14px;
  font-size: 0.95rem; font-family: inherit; outline: none; transition: border-color .2s;
}
input[type="number"]:focus, input[type="text"]:focus, input[type="password"]:focus,
textarea:focus, select:focus { border-color: var(--accent); }
input[type="number"] { max-width: 200px; }
select { cursor: pointer; }
textarea { resize: vertical; font-family: 'Consolas', 'Fira Code', monospace; font-size: 0.88rem; }

/* ── 버튼 ── */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; transition: opacity .2s, transform .1s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary {
  background: transparent; color: var(--accent); border: 1.5px solid var(--accent);
  padding: 8px 20px; border-radius: 8px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background .2s, opacity .2s;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }
.btn-secondary:active { opacity: .85; }

/* ── 플랫폼 토글 ── */
.platform-toggle { display: flex; gap: 8px; }
.btn-toggle {
  padding: 6px 18px; border-radius: 20px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: 1.5px solid var(--border);
  background: transparent; color: var(--text-muted); transition: all .15s;
}
.btn-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-toggle:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── 소형 액션 버튼 (코드 보기 / AI 리뷰) ── */
.btn-sm {
  padding: 4px 12px; border-radius: 6px; font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: opacity .15s, transform .1s;
  border: none; white-space: nowrap;
}
.btn-sm:active { transform: scale(.97); }
.btn-sm:disabled { opacity: .4; cursor: not-allowed; }
.btn-code { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-code:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ai   { background: var(--accent); color: #fff; }
.btn-ai:hover:not(:disabled) { opacity: .85; }

/* ── 로딩 스피너 ── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 리뷰 결과 ── */
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.problem-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.problem-title { font-size: 1.15rem; font-weight: 700; }
.tier-badge {
  font-size: 0.78rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tag {
  font-size: 0.78rem; padding: 3px 10px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted);
}

/* 효율성 요약 박스 */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.summary-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
}
.summary-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.summary-value { font-size: 1rem; font-weight: 700; }

/* 강점/약점 */
.points-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .points-grid { grid-template-columns: 1fr; } }
.points-box { background: var(--surface2); border-radius: 8px; padding: 16px; }
.points-box h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.points-box ul { padding-left: 16px; }
.points-box li { font-size: 0.88rem; margin-bottom: 6px; color: var(--text-muted); }
.points-box.good h4 { color: var(--green); }
.points-box.bad h4 { color: var(--yellow); }

/* 피드백 마크다운 */
.feedback-box { background: var(--surface2); border-radius: 8px; padding: 20px; }
.feedback-box h4 { font-size: 0.85rem; font-weight: 700; color: var(--accent2); margin-bottom: 12px; }
.markdown-body { font-size: 0.9rem; line-height: 1.7; color: var(--text); }
.markdown-body h1,.markdown-body h2,.markdown-body h3 { margin: 14px 0 6px; color: var(--accent2); }
.markdown-body p { margin-bottom: 8px; }
.markdown-body ul,.markdown-body ol { padding-left: 20px; margin-bottom: 8px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body code { background: var(--border); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; font-family: 'Consolas', monospace; }
.markdown-body pre { background: var(--border); padding: 14px; border-radius: 8px; overflow-x: auto; margin: 10px 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body strong { color: var(--text); }

/* ── 통계 ── */
.stat-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stat-tag-name { width: 140px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.stat-bar-wrap { flex: 1; background: var(--surface2); border-radius: 4px; height: 10px; overflow: hidden; }
.stat-bar { height: 100%; border-radius: 4px; transition: width .4s; }
.stat-counts { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; min-width: 80px; text-align: right; }

.history-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.history-table th { text-align: left; padding: 8px 12px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 0.78rem; text-transform: uppercase; }
.history-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.history-table tr:last-child td { border-bottom: none; }
.history-table a { color: var(--accent); text-decoration: none; }
.history-table a:hover { text-decoration: underline; }

/* ── 추천 ── */
.rec-tag-title { font-size: 0.85rem; font-weight: 700; color: var(--accent2); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: .05em; }
.rec-problems { display: grid; gap: 10px; }
.rec-problem-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.rec-problem-card a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.rec-problem-card a:hover { color: var(--accent); }

/* ── 제출 탭 선택 ── */
.submission-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.submission-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  transition: border-color .2s, background .2s; text-align: left;
}
.submission-tab:hover { border-color: var(--accent); }
.submission-tab.active {
  border-color: var(--accent); background: rgba(108,141,250,.1);
}

/* ── 배지 색 ── */
.tier-bronze { background: rgba(180,100,40,.2); color: #cd7f32; border: 1px solid rgba(180,100,40,.3); }
.tier-silver { background: rgba(160,160,160,.15); color: #aaa; border: 1px solid rgba(160,160,160,.2); }
.tier-gold { background: rgba(255,200,0,.15); color: #fbbf24; border: 1px solid rgba(255,200,0,.2); }
.tier-platinum { background: rgba(0,200,180,.1); color: #2dd4bf; border: 1px solid rgba(0,200,180,.15); }
.tier-diamond { background: rgba(100,150,255,.15); color: #818cf8; border: 1px solid rgba(100,150,255,.2); }
.tier-ruby { background: rgba(255,80,80,.12); color: #f87171; border: 1px solid rgba(255,80,80,.18); }

/* 효율성 배지 */
.eff-good { color: var(--green); }
.eff-ok   { color: var(--yellow); }
.eff-poor { color: var(--red); }

/* ── 리뷰 기록 목록 ── */
.history-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  transition: border-color .2s, background .2s;
}
.history-card:hover { border-color: var(--accent); background: var(--surface2); }
.history-card-info { flex: 1; min-width: 0; }
.history-card-title { font-weight: 600; font-size: .95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card-meta { font-size: .8rem; color: var(--text-muted); }
.history-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }

/* ── 모달 ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 820px;
  padding: 32px; position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 6px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }

/* 코드 블록 */
.code-block {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; overflow-x: auto;
  font-family: 'Consolas', 'Fira Code', monospace; font-size: .85rem;
  line-height: 1.6; white-space: pre; margin: 0;
  max-height: 400px; overflow-y: auto;
}

/* 알림 */
.alert {
  padding: 14px 18px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 16px;
}
.alert-error { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.25); color: var(--red); }
.alert-info  { background: rgba(108,141,250,.1); border: 1px solid rgba(108,141,250,.2); color: var(--accent); }

/* ── 문제 풀기 모달 ── */
.pm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.pm-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 1200px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  min-height: 80vh;
}
.pm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pm-header h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }
.pm-meta { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.pm-link a {
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(108,141,250,.45);
}
.pm-link a:hover { opacity: .85; }
.pm-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 6px; cursor: pointer; font-size: 1rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: color .2s;
}
.pm-close:hover { color: var(--text); }
.pm-body {
  display: grid; grid-template-columns: 1fr 1fr; flex: 1;
  overflow: hidden;
}
@media (max-width: 768px) {
  .pm-body { grid-template-columns: 1fr; }
}
.pm-left {
  padding: 20px; border-right: 1px solid var(--border);
  overflow-y: auto; max-height: calc(90vh - 70px);
}
.pm-right {
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; max-height: calc(90vh - 70px);
}
.pm-text { font-size: .9rem; line-height: 1.7; white-space: normal; word-break: break-word; }
.pm-section-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pm-section-card h3 {
  font-size: .86rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pm-sample { margin-top: 16px; }
.pm-sample-title { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.pm-pre {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; font-family: 'Consolas', monospace;
  font-size: .85rem; white-space: pre; overflow-x: auto; margin-bottom: 8px;
}
.cm-wrap { border-radius: 8px; overflow: hidden; }
.cm-wrap .CodeMirror {
  min-height: 320px; height: auto;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: 'Fira Code', Consolas, monospace;
}
.cm-wrap .CodeMirror-scroll { min-height: 320px; }
.cm-wrap:focus-within .CodeMirror { border-color: var(--accent); }

.pm-code {
  flex: 1; min-height: 260px;
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 8px;
}
.pm-code .CodeMirror {
  flex: 1; min-height: 260px; height: auto;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: 'Fira Code', Consolas, monospace;
}
.pm-code .CodeMirror-scroll { min-height: 260px; }
.pm-code:focus-within .CodeMirror { border-color: var(--accent); }
.pm-run-row { display: flex; gap: 10px; align-items: center; }

/* 테스트 케이스 결과 */
.test-case {
  border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); font-size: .88rem;
}
.test-case.pass { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.3); }
.test-case.fail { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); }
.test-case.pending { background: rgba(108,141,250,.08); border-color: rgba(108,141,250,.2); color: var(--text-muted); }
.tc-badge { font-weight: 700; margin-right: 8px; }
.tc-detail { margin-top: 8px; font-size: .82rem; }
.tc-detail pre { background: var(--surface2); border-radius: 4px; padding: 6px 8px; margin: 3px 0 6px; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }

/* 커스텀 예제 */
.pm-custom-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.pm-custom-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pm-custom-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.pm-custom-add-btn { font-size: .78rem; padding: 3px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer; }
.pm-custom-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.pm-custom-case { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.pm-custom-case-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-custom-case label { font-size: .75rem; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 3px; }
.pm-custom-case textarea { width: 100%; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-family: monospace; font-size: .8rem; padding: 5px 7px; resize: vertical; min-height: 56px; }
.pm-custom-case textarea:focus { outline: none; border-color: var(--accent); }
.pm-custom-case-footer { display: flex; justify-content: flex-end; margin-top: 6px; }
.pm-custom-delete-btn { font-size: .75rem; padding: 2px 9px; background: transparent; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); cursor: pointer; }
.pm-custom-delete-btn:hover { border-color: var(--red); color: var(--red); }

.btn-review { background: var(--green); color: #000; }
.btn-review:hover { opacity: .88; }

/* 추천 문제 카드에서 클릭 커서 */
.rec-problem-card.cf-clickable { cursor: pointer; transition: background .15s; }
.rec-problem-card.cf-clickable:hover { background: var(--surface2); }

/* ── CodeMirror 자동완성 힌트 UI ── */
.CodeMirror-hints {
  z-index: 10000 !important;
  background: #1e2030;
  border: 1px solid #3b4261;
  border-radius: 6px;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: .82rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  min-width: 160px;
}
.CodeMirror-hint {
  color: #c0caf5;
  padding: 4px 14px 4px 10px;
  white-space: nowrap;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.CodeMirror-hint-active {
  background: #2d3f76;
  color: #7aa2f7;
  border-left-color: #7aa2f7;
}
body.light .CodeMirror-hints {
  background: #ffffff;
  border-color: #d0d4e8;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
body.light .CodeMirror-hint { color: #1a1d2e; }
body.light .CodeMirror-hint-active { background: #e8eeff; color: #4a6cf7; border-left-color: #4a6cf7; }
