/* ══════════════════════════════════════════
   Smart Pick — v7 (검색 → 모으기 → 내보내기)
   var(--sl-accent) primary, #f0f1f3 border, #f9fafb bg-muted
   ══════════════════════════════════════════ */

/* ═══ 셸 ═══ */
.sp-shell { display: flex; height: calc(100vh - 52px - 36px); overflow: hidden; }
.sp-shell.dragging-active { user-select: none; -webkit-user-select: none; }
.sp-shell.dragging-active .sp-main { pointer-events: none; }

/* ═══ 왼쪽 패널 ═══ */
.sp-panel { flex-shrink: 0; background: #fff; border-right: 1px solid #f0f1f3; display: flex; flex-direction: column; min-width: 240px; max-width: 480px; }
.sp-panel-inner { display: flex; flex-direction: column; height: 100%; }
.sp-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; background: #fafbfc; flex-shrink: 0; }
.sp-panel-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: #1e293b; }
.sp-panel-title svg { color: var(--sl-accent); }
.sp-reset-btn { font-size: 11px; font-weight: 600; color: var(--sl-accent); background: none; border: none; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background .12s; }
.sp-reset-btn:hover { background: rgba(230,0,126,.06); }
.sp-panel-body { flex: 1; overflow-y: auto; padding: 6px 18px 20px; }
.sp-panel-body::-webkit-scrollbar { width: 3px; }
.sp-panel-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

/* ═══ 섹션 ═══ */
.sp-section { margin-bottom: 16px; }
.sp-section-action { margin-top: 4px; margin-bottom: 18px; }
.sp-label { display: block; font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 7px; }

/* ═══ AI 검색 ═══ */
.sp-section-nl { margin-bottom: 12px; padding-top: 2px; }
.sp-nl-wrap { position: relative; display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 9px; overflow: visible; transition: all .12s; }
.sp-nl-wrap:focus-within { border-color: var(--sl-accent); box-shadow: 0 0 0 2.5px rgba(230,0,126,.08); background: #fff; }
.sp-nl-icon-wrap { display: flex; align-items: center; justify-content: center; width: 36px; flex-shrink: 0; color: #c4c8cf; transition: color .12s; }
.sp-nl-wrap:focus-within .sp-nl-icon-wrap { color: var(--sl-accent); }
.sp-nl-input { flex: 1; padding: 9px 0; font-size: 12.5px; font-weight: 500; color: #374151; background: transparent; border: none; outline: none; min-width: 0; }
.sp-nl-input::placeholder { color: #b0b8c4; font-weight: 400; }
.sp-nl-go { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 2px; background: var(--sl-accent); border: none; border-radius: 7px; color: #fff; cursor: pointer; transition: background .12s; flex-shrink: 0; }
.sp-nl-go:hover { background: #d1006f; }
.sp-nl-go:disabled { opacity: .3; cursor: not-allowed; }
.sp-nl-hints { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 4px; z-index: 20; display: flex; flex-direction: column; }
.sp-nl-hint { display: block; width: 100%; text-align: left; padding: 7px 10px; font-size: 12px; color: #4b5563; background: transparent; border: none; border-radius: 6px; cursor: pointer; transition: background .08s; }
.sp-nl-hint:hover { background: #fdf2f8; color: var(--sl-accent); }
.sp-nl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sp-nl-tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 5px 3px 6px; background: #fdf2f8; border: 1px solid #fce7f3; border-radius: 5px; font-size: 11px; font-weight: 500; color: #374151; }
.sp-nl-tag-k { font-size: 9.5px; font-weight: 700; color: var(--sl-accent); margin-right: 2px; }
.sp-nl-tag-x { display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 3px; border: none; background: transparent; color: #9ca3af; cursor: pointer; transition: all .1s; margin-left: 1px; }
.sp-nl-tag-x:hover { background: #fce7f3; color: var(--sl-accent); }

/* ═══ 폼 ═══ */
.sp-select { width: 100%; padding: 7px 28px 7px 10px; font-size: 12.5px; font-weight: 600; color: #374151; background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; border: 1px solid #e5e7eb; border-radius: 7px; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; transition: border-color .12s; }
.sp-select:focus { border-color: var(--sl-accent); box-shadow: 0 0 0 2px rgba(230,0,126,.08); }
.sp-grade-chips { display: flex; gap: 5px; }
.sp-grade-chip { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 11.5px; font-weight: 800; border-radius: 6px; border: 1.5px solid #e5e7eb; background: #fff; color: #9ca3af; cursor: pointer; transition: all .12s; }
.sp-grade-chip:hover { border-color: #cbd5e1; }
.sp-gc-s.active { background: #fdf2f8; border-color: var(--sl-accent); color: var(--sl-accent); }
.sp-gc-a.active { background: #eff6ff; border-color: #2563eb; color: #2563eb; }
.sp-gc-b.active { background: #ecfdf5; border-color: #059669; color: #059669; }
.sp-gc-c.active { background: #fff7ed; border-color: #c2410c; color: #c2410c; }
.sp-gc-d.active { background: #f3f4f6; border-color: #6b7280; color: #6b7280; }
.sp-radio-group { display: flex; flex-direction: column; gap: 3px; }
.sp-radio { display: flex; align-items: center; gap: 7px; padding: 5px 8px; font-size: 12px; font-weight: 500; color: #6b7280; border-radius: 6px; cursor: pointer; transition: all .1s; }
.sp-radio:hover { background: #f9fafb; color: #374151; }
.sp-radio.active { background: #fdf2f8; color: var(--sl-accent); font-weight: 600; }
.sp-radio-dot { width: 14px; height: 14px; border: 2px solid #d1d5db; border-radius: 50%; flex-shrink: 0; position: relative; transition: border-color .12s; }
.sp-radio.active .sp-radio-dot { border-color: var(--sl-accent); }
.sp-radio.active .sp-radio-dot::after { content: ''; position: absolute; top: 2px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--sl-accent); }
.sp-pill-group { display: flex; gap: 5px; flex-wrap: wrap; }
.sp-pill { padding: 5px 12px; font-size: 12px; font-weight: 600; color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 9999px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.sp-pill:hover { border-color: #cbd5e1; color: #374151; }
.sp-pill.active { background: #fdf2f8; border-color: var(--sl-accent); color: var(--sl-accent); }
.sp-pick-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; font-size: 13px; font-weight: 700; color: #fff; background: var(--sl-accent); border: none; border-radius: 8px; cursor: pointer; transition: background .15s, transform .1s; }
.sp-pick-btn:hover { background: #d1006f; }
.sp-pick-btn:active { transform: scale(.98); }
.sp-sep { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.sp-sep-line { flex: 1; height: 1px; background: #f0f1f3; }
.sp-sep-text { font-size: 10.5px; font-weight: 600; color: #c4c8cf; white-space: nowrap; }
.sp-preset-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-preset { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; font-size: 11.5px; font-weight: 600; color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 9999px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.sp-preset:hover { border-color: #cbd5e1; color: #374151; background: #fff; }
.sp-preset-active { background: #fdf2f8 !important; border-color: var(--sl-accent) !important; color: var(--sl-accent) !important; }
.sp-preset-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ═══ 좌우 리사이즈 ═══ */
.sp-resize-handle { width: 5px; flex-shrink: 0; cursor: col-resize; position: relative; z-index: 10; background: transparent; transition: background .15s; }
.sp-resize-handle::after { content: ''; position: absolute; left: 2px; top: 0; bottom: 0; width: 1px; background: #e5e7eb; transition: all .15s; }
.sp-resize-handle:hover::after, .sp-resize-handle.dragging::after { width: 3px; left: 1px; background: var(--sl-accent); border-radius: 2px; }
.sp-resize-handle:hover, .sp-resize-handle.dragging { background: rgba(230,0,126,.03); }

/* ═══ 오른쪽 ═══ */
.sp-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f8fafc; min-width: 0; }

/* ═══ 상단: 검색 결과 테이블 ═══ */
.sp-results { flex-shrink: 0; background: #fff; overflow: hidden; }
.sp-results-scroll { width: 100%; height: 100%; overflow: auto; }
.sp-results-scroll::-webkit-scrollbar { width: 3px; height: 3px; }
.sp-results-scroll::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

.sp-rank-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 11px; }
.sp-rk-th {
    position: sticky; top: 0; z-index: 2;
    padding: 5px 10px; font-size: 9.5px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .03em;
    background: #fafbfc; border-bottom: 1px solid #f0f1f3; text-align: left; white-space: nowrap;
}
.sp-rk-th-action { width: 60px; text-align: center; }
.sp-rk-row { cursor: default; transition: background .08s; }
.sp-rk-row:hover { background: #fdf2f8; }
.sp-rk-td { padding: 4px 10px; color: #374151; font-weight: 500; border-bottom: 1px solid #f8fafc; white-space: nowrap; line-height: 1.3; }
.sp-rk-td-num { text-align: center; font-weight: 800; color: #94a3b8; font-size: 10px; }
.sp-rk-td-id { font-weight: 700; color: var(--sl-accent); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.sp-rk-td-score { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 10.5px; }
.sp-score-wrap { display: inline-flex; align-items: center; gap: 5px; }
.sp-score-bar { display: inline-block; width: 40px; height: 3px; background: #f0f1f3; border-radius: 2px; vertical-align: middle; }
.sp-score-fill { display: block; height: 100%; border-radius: 2px; transition: width .3s; }
.sp-sf-s { background: var(--sl-accent); }
.sp-sf-a { background: #f59e0b; }
.sp-sf-b { background: #3b82f6; }
.sp-sf-c { background: #9ca3af; }
.sp-sf-d { background: #d1d5db; }
.sp-rk-td-grade { font-weight: 700; font-size: 10.5px; }
.sp-grade-wrap { display: inline-flex; align-items: center; gap: 3px; }
.sp-grade-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sp-gd-s { background: var(--sl-accent); }
.sp-gd-a { background: #f59e0b; }
.sp-gd-b { background: #3b82f6; }
.sp-gd-c { background: #9ca3af; }
.sp-gd-d { background: #d1d5db; }
.sp-rk-td-topic { color: #6b7280; font-size: 10.5px; }
.sp-rk-td-type { font-size: 10.5px; color: #6b7280; }
.sp-rk-td-summary { color: #1e293b; font-weight: 600; white-space: nowrap; }
.sp-rk-td-service { font-size: 10.5px; color: #0891b2; font-weight: 600; }
.sp-rk-td-dept { color: #9ca3af; font-size: 10.5px; }
.sp-rk-td-date { font-size: 10.5px; color: #9ca3af; font-variant-numeric: tabular-nums; }
.sp-rk-td-action { text-align: center; }

/* 이미 Pick된 행 */
.sp-rk-picked { opacity: .45; }
.sp-rk-picked:hover { opacity: .55; }

/* +Pick 버튼 */
.sp-add-btn {
    padding: 2px 8px; font-size: 10.5px; font-weight: 700;
    border-radius: 4px; border: 1px solid var(--sl-accent); background: #fff; color: var(--sl-accent);
    cursor: pointer; transition: all .12s;
}
.sp-add-btn:hover { background: #fdf2f8; }
.sp-add-btn:disabled { border-color: #d1d5db; color: #9ca3af; cursor: default; background: #f9fafb; }
.sp-add-inner { display: inline-flex; align-items: center; gap: 3px; }
.sp-add-done { color: #9ca3af; }

/* 빈 상태 */
.sp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: #c4c8cf; }
.sp-empty p { font-size: 12.5px; font-weight: 500; }

/* ═══ 상하 리사이즈 핸들 ═══ */
.sp-vresize {
    flex-shrink: 0; height: 7px; cursor: row-resize;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border-top: 1px solid #f0f1f3; border-bottom: 1px solid #f0f1f3;
    transition: background .12s; position: relative; z-index: 5;
}
.sp-vresize:hover { background: rgba(230,0,126,.03); }
.sp-vresize-grip { width: 32px; height: 3px; border-radius: 2px; background: #d1d5db; transition: background .12s; }
.sp-vresize:hover .sp-vresize-grip { background: var(--sl-accent); }

/* ═══ 하단: Pick 보드 ═══ */
.sp-board { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* 보드 헤더 */
.sp-board-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 20px; background: #fff; border-bottom: 1px solid #f0f1f3;
    flex-shrink: 0; gap: 10px;
}
.sp-board-left { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--sl-accent); }
.sp-board-left > svg { flex-shrink: 0; }
.sp-board-right { display: flex; gap: 6px; flex-shrink: 0; }
.sp-board-title-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: #1e293b; background: none; border: none; cursor: pointer; padding: 2px 5px; border-radius: 4px; transition: background .1s; }
.sp-board-title-btn:hover { background: #f3f4f6; }
.sp-board-title-btn svg { color: #c4c8cf; }
.sp-board-title-input { font-size: 13px; font-weight: 800; color: #1e293b; padding: 2px 7px; border: 1.5px solid var(--sl-accent); border-radius: 4px; outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(230,0,126,.08); }
.sp-board-count { font-size: 10.5px; font-weight: 700; color: var(--sl-accent); background: rgba(230,0,126,.06); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.sp-act-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; font-size: 11.5px; font-weight: 600; color: #6b7280; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; transition: all .12s; }
.sp-act-btn:hover { border-color: #d1d5db; color: #374151; background: #f9fafb; }
.sp-act-export:hover { border-color: #10b981; color: #059669; background: #ecfdf5; }

/* 보드 바디 */
.sp-board-body { flex: 1; overflow-y: auto; padding: 12px 20px 30px; display: flex; flex-direction: column; gap: 8px; }
.sp-board-body::-webkit-scrollbar { width: 4px; }
.sp-board-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* 빈 보드 */
.sp-board-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 6px; color: #c4c8cf; }
.sp-board-empty p { font-size: 12.5px; font-weight: 500; }
.sp-board-empty strong { color: var(--sl-accent); }

/* ═══ Pick 카드 ═══ */
.sp-card {
    background: #fff; border: 1px solid #f0f1f3; border-radius: 10px;
    position: relative; transition: box-shadow .12s;
}
.sp-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.03); }

/* 제거 ✕ (호버 시만) */
.sp-card-remove {
    position: absolute; top: 8px; right: 8px;
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; border: none; background: transparent;
    color: #d1d5db; cursor: pointer; transition: all .12s;
    opacity: 0;
}
.sp-card:hover .sp-card-remove { opacity: 1; }
.sp-card-remove:hover { background: #fef2f2; color: #ef4444; }

/* 접수번호 + AI 요약 */
.sp-card-top { padding: 10px 14px 0; display: flex; align-items: baseline; gap: 7px; padding-right: 32px; }
.sp-card-id { font-size: 11px; font-weight: 800; color: var(--sl-accent); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.sp-card-ai-summary { font-size: 11.5px; font-weight: 600; color: #6b7280; line-height: 1.4; }

/* 원문 */
.sp-card-voc { padding: 6px 14px 8px; font-size: 12.5px; font-weight: 500; color: #1e293b; line-height: 1.6; word-break: keep-all; }

/* 답변달기 토글 */
.sp-card-reply { padding: 0 14px 10px; }
.sp-reply-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; font-size: 11px; font-weight: 600;
    color: #9ca3af; background: transparent; border: 1px solid #e5e7eb;
    border-radius: 5px; cursor: pointer; transition: all .12s;
}
.sp-reply-toggle:hover { border-color: var(--sl-accent); color: var(--sl-accent); }
.sp-reply-open { border-color: var(--sl-accent); color: var(--sl-accent); background: rgba(230,0,126,.04); }

/* 답변 입력 영역 */
.sp-card-reply-area { padding: 0 14px 12px; }
.sp-reply-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sp-reply-label { font-size: 10px; font-weight: 700; color: var(--sl-accent); text-transform: uppercase; letter-spacing: .04em; }
.sp-reply-ai {
    display: inline-flex; align-items: center; padding: 2px 7px; font-size: 10.5px; font-weight: 600;
    color: #8b5cf6; background: rgba(139,92,246,.06); border: 1px solid rgba(139,92,246,.12);
    border-radius: 4px; cursor: pointer; transition: all .12s;
}
.sp-reply-ai:hover { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.25); }
.sp-reply-ai:disabled { opacity: .5; cursor: not-allowed; }
.sp-reply-ai-inner { display: flex; align-items: center; gap: 3px; }
.sp-reply-input {
    width: 100%; padding: 7px 10px; font-size: 12px; font-weight: 500; color: #374151;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    outline: none; resize: vertical; min-height: 34px; max-height: 120px;
    line-height: 1.55; transition: border-color .12s, box-shadow .12s; font-family: inherit;
}
.sp-reply-input::placeholder { color: #c4c8cf; }
.sp-reply-input:focus { border-color: var(--sl-accent); box-shadow: 0 0 0 2px rgba(230,0,126,.08); }

/* ═══ 반응형 ═══ */
@media (max-width: 640px) {
    .sp-shell { flex-direction: column; }
    .sp-panel { width: 100% !important; max-width: none; min-width: auto; border-right: none; border-bottom: 1px solid #f0f1f3; max-height: 40vh; }
    .sp-resize-handle { display: none; }
    .sp-main { height: auto; flex: 1; }
    .sp-results { height: auto !important; max-height: 200px; }
    .sp-vresize { display: none; }
    .sp-board-head { padding: 8px 14px; }
    .sp-board-body { padding: 10px 12px 24px; }
    .sp-card-remove { opacity: 1; }
}
