/* =============================================
   JJIRASI Auto Trading — Styles
   ============================================= */

/* ── 변수 (기존 테마 연동) ── */
:root {
    --at-green:  #10b981;
    --at-red:    #ef4444;
    --at-blue:   #3b82f6;
    --at-yellow: #fbbf24;
    --at-purple: #8b5cf6;
    --at-muted:  #64748b;
    --at-border: rgba(51,65,85,0.7);
    --at-bg:     rgba(15,23,42,0.5);
    --at-card:   rgba(22,32,54,0.85);
    --at-hover:  rgba(30,41,59,0.9);
}

/* ── 페이지 레이아웃 ── */
/* NOTE: display는 .page.active 규칙(style.css)에 위임
   ID 선택자가 클래스 선택자보다 specificity가 높으므로
   display 속성은 여기서 설정하지 않음 → .page { display:none } 보존 */
#page-autotrading.active {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 24px;
    min-height: 100%;
}

/* ══════════════════════════════════════════════════════════
   ZONE LOG — 통합 운영 로그 패널
   검색 로그 + 거래 내역 + 시스템 이벤트 통합 표시
   jj-log-panel 과 동일 구조, AT 그린 테마 적용
══════════════════════════════════════════════════════════ */
.at-log-panel {
    display: flex;
    flex-direction: column;
    background: #020617;
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 10px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Consolas', 'SF Mono', monospace;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
    flex-shrink: 0;
}
.at-log-panel.collapsed .at-log-panel-body { display: none; }

/* 헤더 */
.at-log-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px;
    background: rgba(16,185,129,0.07);
    border-bottom: 1px solid rgba(16,185,129,0.18);
    flex-wrap: wrap; gap: 6px;
    flex-shrink: 0;
}
.at-log-panel-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.at-log-panel-right { display: flex; align-items: center; gap: 6px; }

.at-log-panel-title {
    font-size: 11.5px; font-weight: 700;
    color: #6ee7b7; letter-spacing: 0.3px;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}
.at-log-err-badge {
    display: inline-flex; align-items: center;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
    font-family: 'Inter', sans-serif;
}

/* 탭 */
.at-log-tabs {
    display: flex; gap: 2px;
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 6px; padding: 2px;
}
.at-log-tab {
    padding: 2px 9px; border-radius: 4px;
    font-size: 10.5px; font-weight: 600;
    background: none; border: none; cursor: pointer;
    color: #475569; font-family: 'Inter', sans-serif;
    transition: background .12s, color .12s;
}
.at-log-tab:hover  { color: #94a3b8; background: rgba(255,255,255,0.04); }
.at-log-tab.active { background: rgba(16,185,129,0.18); color: #6ee7b7; }

/* 우측 컨트롤 */
.at-log-search-input {
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(16,185,129,0.25);
    color: #e2e8f0; font-size: 10.5px;
    padding: 3px 9px; border-radius: 5px;
    width: 120px; font-family: 'Inter', sans-serif;
    outline: none;
}
.at-log-search-input:focus { border-color: rgba(16,185,129,0.5); }
.at-log-panel-btn {
    padding: 3px 9px; border-radius: 5px;
    font-size: 10.5px; font-weight: 600; cursor: pointer;
    border: 1px solid; display: flex; align-items: center; gap: 4px;
    font-family: 'Inter', sans-serif; transition: all .15s;
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.35); color: #6ee7b7;
}
.at-log-panel-btn:hover { background: rgba(16,185,129,0.22); }
.at-log-panel-btn.warn  { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.35); color: #f87171; }
.at-log-panel-btn.warn:hover  { background: rgba(239,68,68,0.22); }
.at-log-panel-btn.close { background: rgba(71,85,105,0.15); border-color: rgba(71,85,105,0.35); color: #64748b; }
.at-log-panel-btn.close:hover { background: rgba(71,85,105,0.3); color: #94a3b8; }

/* 로그 바디 */
.at-log-panel-body {
    height: 210px;       /* 항상 펼쳐진 상태 고정 */
    overflow-y: auto;
    padding: 4px 0;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(16,185,129,0.2) transparent;
}
.at-log-panel-body::-webkit-scrollbar { width: 4px; }
.at-log-panel-body::-webkit-scrollbar-thumb {
    background: rgba(16,185,129,0.2); border-radius: 4px;
}
.at-log-panel-empty {
    color: #475569; font-size: 11px; text-align: center;
    padding: 24px 0; font-family: 'Inter', sans-serif;
}

/* 로그 엔트리 — jj-log-entry 와 동일 구조 */
.at-log-entry {
    display: grid;
    grid-template-columns: 100px 64px 1fr auto;
    align-items: baseline;
    gap: 0 14px;
    padding: 2px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 10.5px; line-height: 1.65;
    transition: background .1s;
}
.at-log-entry:hover { background: rgba(255,255,255,0.025); }
.at-log-entry.error { background: rgba(239,68,68,0.04); }
.at-log-entry.error:hover { background: rgba(239,68,68,0.09); }

.at-le-ts     { color: #475569; font-size: 9.5px; white-space: nowrap; letter-spacing: 0.2px; }
.at-le-tag    {
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px;
    padding: 1px 5px; border-radius: 3px; text-align: center;
    white-space: nowrap;
}
/* 태그 색상 — 거래(매수/매도), 검색, WS, 에러, 경고, 시스템 */
.at-le-tag.ok     { background: rgba(16,185,129,0.15); color: #34d399; }
.at-le-tag.cloud  { background: rgba(99,102,241,0.15); color: #818cf8; }
.at-le-tag.cache  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.at-le-tag.rss    { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.at-le-tag.error  { background: rgba(239,68,68,0.15);  color: #f87171; }
.at-le-tag.warn   { background: rgba(245,158,11,0.15); color: #f59e0b; }
.at-le-tag.system { background: rgba(226,232,240,0.07);color: #64748b; }
.at-le-tag.info   { background: rgba(148,163,184,0.08);color: #475569; }

.at-le-msg    { color: #94a3b8; font-size: 10.5px; }
.at-le-detail {
    color: #64748b; font-size: 9.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 260px;
}

/* ── 헤더 바 ── */
.at-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.at-header-left  { display: flex; align-items: center; gap: 10px; }
.at-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.at-page-title {
    font-size: 17px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
    display: flex; align-items: center; gap: 7px;
    margin: 0;
}
.at-page-title i { color: var(--at-blue); }

/* 상태 배지 */
.at-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
}
.at-status-badge.running { background: rgba(16,185,129,.18); color: var(--at-green); border: 1px solid rgba(16,185,129,.4); }
.at-status-badge.running i { animation: at-blink 1s ease-in-out infinite; }
.at-status-badge.paused  { background: rgba(251,191,36,.15); color: var(--at-yellow); border: 1px solid rgba(251,191,36,.35); }
.at-status-badge.stopped { background: rgba(100,116,139,.18); color: var(--at-muted); border: 1px solid rgba(100,116,139,.35); }
@keyframes at-blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* 실전 / 모의 토글 */
.at-env-toggle { display: flex; gap: 4px; }
.at-env-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
    background: rgba(51,65,85,.4); border: 1px solid var(--at-border);
    color: var(--at-muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.at-env-btn:hover { background: rgba(99,102,241,.15); color: #a5b4fc; }
.at-env-btn.active { background: rgba(59,130,246,.2); color: #60a5fa; border-color: rgba(59,130,246,.45); }
.at-env-btn#at-env-real.active { background: rgba(239,68,68,.18); color: #f87171; border-color: rgba(239,68,68,.4); }

/* 일일 손실 현황 */
.at-daily-loss-wrap {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 7px;
    background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
    font-size: 11px;
}
.at-daily-loss-label { color: var(--at-muted); }
.at-daily-loss-val   { color: #f87171; font-weight: 800; font-family: monospace; }
.at-daily-loss-limit { color: var(--at-muted); font-size: 10px; }

/* ── 티커 바 ── */
.at-ticker-bar-wrap {
    background: rgba(15,23,42,.6);
    border: 1px solid var(--at-border);
    border-radius: 8px;
    padding: 6px 14px;
    overflow: hidden;
}
.at-ticker-bar {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 11.5px; font-family: monospace;
}
.at-ticker-item.pos  { color: var(--at-green); }
.at-ticker-item.neg  { color: var(--at-red); }
.at-ticker-sep       { color: var(--at-border); }
.at-ticker-placeholder { color: var(--at-muted); font-size: 11px; font-family: inherit; }

/* ── 메인 그리드 (Zone C 포지션 영역만 사용) ── */
.at-main-grid {
    display: block;
}

/* ── 공통 카드 ── */
.at-card {
    background: var(--at-card);
    border: 1px solid var(--at-border);
    border-radius: 10px;
    padding: 12px 13px;
    margin-bottom: 10px;
}
.at-card:last-child { margin-bottom: 0; }

.at-card-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 10px;
}
.at-card-title i { color: var(--at-blue); font-size: 13px; }
.at-card-refresh, .at-card-collapse {
    margin-left: auto;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(51,65,85,.4); border: 1px solid var(--at-border);
    border-radius: 5px; color: var(--at-muted); cursor: pointer;
    transition: background .15s; font-size: 11px;
}
.at-card-refresh:hover, .at-card-collapse:hover { background: rgba(99,102,241,.2); color: #a5b4fc; }

/* ── 사이드바 ── */
.at-sidebar { display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════
   ZONE A — AI 추천 종목 검색 카드
   구조: 타이틀바 / 카드본문(좌: 체크박스 3열 | 우: 결과)
══════════════════════════════════════════════════════════ */
.at-card-wide {
    width: 100%; box-sizing: border-box;
    margin-bottom: 8px;
}

/* 타이틀 바 */
.at-sc-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid var(--at-border);
}
.at-sc-title-actions {
    display: flex; align-items: center; gap: 8px;
}
.at-wide-title {
    font-size: 13px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
    display: flex; align-items: center; gap: 6px;
}
.at-wide-title i { color: var(--at-blue); }

/* 전체선택 레이블 (구버전 호환 유지) */
.at-cond-all {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--at-muted); cursor: pointer;
}
.at-cond-all input { accent-color: var(--at-blue); }

/* ── 전체선택 버튼 ── */
.at-cond-selall-btn {
    padding: 4px 10px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
    background: rgba(99,179,237,.12); border: 1px solid rgba(99,179,237,.30);
    color: #63b3ed; cursor: pointer;
    transition: background .12s;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.at-cond-selall-btn:hover { background: rgba(99,179,237,.25); }
.at-cond-selall-btn i { font-size: 10px; }

/* ── 선택해제 버튼 ── */
.at-cond-desel-btn {
    padding: 4px 10px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
    background: rgba(148,163,184,.10); border: 1px solid rgba(148,163,184,.25);
    color: #94a3b8; cursor: pointer;
    transition: background .12s;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.at-cond-desel-btn:hover { background: rgba(148,163,184,.22); }
.at-cond-desel-btn i { font-size: 10px; }

/* ── 조건검색식 불러오기 버튼 ── */
.at-cond-reload-btn {
    padding: 4px 12px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
    background: rgba(99,102,241,.13); border: 1px solid rgba(99,102,241,.38);
    color: #818cf8; cursor: pointer;
    transition: background .15s;
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.at-cond-reload-btn:hover:not(:disabled) {
    background: rgba(99,102,241,.26);
}
.at-cond-reload-btn:hover:not(:disabled) i.fa-rotate {
    animation: spin-once .5s linear;
}
.at-cond-reload-btn:disabled {
    opacity: .50; cursor: not-allowed;
}
@keyframes spin-once {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 구버전 추천만 버튼 호환 */
.at-cond-preset-btn {
    padding: 4px 10px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
    background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3);
    color: #fbbf24; cursor: pointer;
    transition: background .12s;
    display: flex; align-items: center; gap: 4px;
}
.at-cond-preset-btn:hover { background: rgba(251,191,36,.25); }

/* ── 카드 본문: 좌/우 2컬럼 ── */
.at-sc-body {
    display: grid;
    grid-template-columns: 1fr 700px;
    gap: 14px;
    align-items: start;
}
@media (max-width: 1100px) {
    .at-sc-body { grid-template-columns: 1fr; }
}

/* ── 좌: 체크박스 3열 그리드 ── */
.at-sc-left { min-width: 0; }

/* JS가 채우는 3열 그리드 */
.at-cond-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
}
@media (max-width: 900px) {
    .at-cond-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 그룹 제목 (AI추천 / 조건검색식) — 3열 전체 span */
.at-cond-group-title {
    grid-column: 1 / -1;
    font-size: 9.5px; font-weight: 700; color: var(--at-muted);
    letter-spacing: .5px; text-transform: uppercase;
    padding: 4px 2px 2px;
    border-bottom: 1px solid var(--at-border);
    margin-top: 4px;
}
.at-cond-group-title:first-child { margin-top: 0; }

/* 개별 조건식 체크박스 아이템 */
.at-cond-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: 6px;
    background: rgba(30,41,59,.5); border: 1px solid transparent;
    cursor: pointer; transition: background .12s, border-color .12s;
    user-select: none;
}
.at-cond-item:hover { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.25); }
.at-cond-item:has(input:checked) {
    background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.4);
}
.at-cond-item.chip-ai:has(input:checked) {
    background: rgba(99,102,241,.18); border-color: rgba(99,102,241,.5);
}
.at-cond-item input[type=checkbox] {
    accent-color: var(--at-blue); flex-shrink: 0;
    width: 12px; height: 12px;
}
.at-cond-name {
    font-size: 11px; font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    display: flex; align-items: center; gap: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-cond-name i { color: var(--at-blue); font-size: 10px; flex-shrink: 0; }
/* AI 항목 강조 */
.at-cond-item.chip-ai .at-cond-name { color: #a5b4fc; }
.at-cond-item.chip-ai .at-cond-name i { color: #818cf8; }

/* 로딩 */
.at-cond-loading {
    grid-column: 1 / -1;
    font-size: 11px; color: var(--at-muted);
    padding: 16px; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}

/* ══════════════════════════════════════════════════════════
   장 상태 배지 — 조건검색 패널 타이틀에 인라인으로 표시
   market-badge--pre / --open / --after / --closed
══════════════════════════════════════════════════════════ */
.market-phase-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600; letter-spacing: .03em;
    padding: 2px 8px; border-radius: 20px;
    border: 1px solid currentColor;
    vertical-align: middle;
    transition: color .3s, background .3s, border-color .3s;
    white-space: nowrap;
    cursor: default;
}
.market-phase-badge i { font-size: 9px; }

/* 정규장 운영 중 — 초록 강조 */
.market-badge--open {
    color: #10b981;
    background: rgba(16,185,129,.12);
    border-color: rgba(16,185,129,.35);
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
    50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* 장 시작 전 — 노란 */
.market-badge--pre {
    color: #f59e0b;
    background: rgba(245,158,11,.1);
    border-color: rgba(245,158,11,.35);
}

/* 시간외 — 오렌지 */
.market-badge--after {
    color: #fb923c;
    background: rgba(251,146,60,.1);
    border-color: rgba(251,146,60,.35);
}

/* 장 종료 / 주말 — 회색 */
.market-badge--closed {
    color: #64748b;
    background: rgba(100,116,139,.1);
    border-color: rgba(100,116,139,.25);
}

/* ── 배지가 들어가는 타이틀에서 세로정렬 맞춤 ── */
.sp-cond-title,
.at-wide-title {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* 안내 UI — API 키 미설정 / 목록 새로고침 필요 시 */
.at-cond-empty-guide {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px 16px;
    border: 1.5px dashed rgba(99,179,237,.25);
    border-radius: 10px; text-align: center;
    background: rgba(99,179,237,.04);
}
.at-cond-empty-guide > i {
    font-size: 22px; color: #63b3ed; opacity: .75;
}
.at-cond-empty-guide > p {
    margin: 0; font-size: 12px; line-height: 1.7;
    color: var(--at-muted, #94a3b8);
}
.at-cond-empty-guide > p strong {
    color: #93c5fd; font-weight: 700;
}

/* ── 우: 검색 바 + 결과 목록 ── */
.at-sc-right {
    display: flex; flex-direction: column; gap: 8px;
    min-width: 0;
}

/* 중복 조건 + 검색 버튼 한 줄 */
.at-sc-search-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.at-overlap-inline {
    display: flex; align-items: center; gap: 5px;
}
.at-overlap-label { font-size: 10px; color: var(--at-muted); white-space: nowrap; }
.at-overlap-btns  { display: flex; gap: 3px; }
.at-overlap-btn {
    padding: 4px 9px; border-radius: 5px;
    font-size: 10.5px; font-weight: 700;
    background: rgba(51,65,85,.4); border: 1px solid var(--at-border);
    color: var(--at-muted); cursor: pointer;
    transition: background .12s, color .12s;
}
.at-overlap-btn:hover  { background: rgba(59,130,246,.15); color: #60a5fa; }
.at-overlap-btn.active { background: rgba(59,130,246,.25); color: #93c5fd; border-color: rgba(59,130,246,.5); }

.at-result-count-inline {
    font-size: 11px; font-weight: 700; color: var(--at-blue);
    white-space: nowrap; margin-left: auto;
}
.at-search-run-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(99,102,241,.3));
    border: 1px solid rgba(59,130,246,.5); border-radius: 7px;
    color: #93c5fd; font-size: 11.5px; font-weight: 700;
    cursor: pointer; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s, transform .1s;
}
.at-search-run-btn:hover { background: linear-gradient(135deg, rgba(59,130,246,.5), rgba(99,102,241,.5)); transform: translateY(-1px); }
.at-search-run-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* 결과 선택 바 */
.at-result-sel-bar {
    display: flex; align-items: center; gap: 6px;
}
.at-result-all {
    display: flex; align-items: center; gap: 4px;
    font-size: 10.5px; color: var(--at-muted); cursor: pointer;
}
.at-result-all input { accent-color: var(--at-green); }

/* 결과 목록 (세로 스크롤) */
.at-result-list {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 308px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--at-border) transparent;
}
.at-result-list::-webkit-scrollbar { width: 4px; }
.at-result-list::-webkit-scrollbar-thumb { background: var(--at-border); border-radius: 4px; }

/* 결과 없음 */
.at-result-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 20px 0;
    color: var(--at-muted); font-size: 11px; text-align: center;
}
.at-result-empty i { font-size: 26px; color: #1e293b; }
.at-result-empty p { line-height: 1.7; }

/* ── 검색 진행 상태 바 ── */
.at-search-progress-wrap {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 0 2px;
}
.at-search-progress-track {
    flex: 1; height: 4px; border-radius: 4px;
    background: rgba(51,65,85,.6);
    overflow: hidden;
}
.at-search-progress-fill {
    height: 100%; border-radius: 4px; width: 0%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transition: width .3s ease;
}
.at-search-progress-label {
    font-size: 10px; color: var(--at-muted); white-space: nowrap;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}

/* ── 검색 로그 패널 ── */
.at-search-log-wrap {
    background: rgba(2,6,23,.7); border: 1px solid var(--at-border);
    border-radius: 7px; overflow: hidden;
    margin: 4px 0;
}
.at-search-log-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 9px; font-size: 10px; font-weight: 700;
    color: var(--at-muted); background: rgba(15,23,42,.5);
    border-bottom: 1px solid var(--at-border);
}
.at-search-log-close {
    background: none; border: none; cursor: pointer;
    color: var(--at-muted); padding: 0; font-size: 11px;
    transition: color .12s;
}
.at-search-log-close:hover { color: #f87171; }
.at-search-log {
    font-size: 9.5px; font-family: 'Courier New', monospace;
    color: #94a3b8; margin: 0; padding: 7px 10px;
    max-height: 120px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-all;
    scrollbar-width: thin; scrollbar-color: var(--at-border) transparent;
    line-height: 1.6;
}
.at-search-log::-webkit-scrollbar { width: 3px; }
.at-search-log::-webkit-scrollbar-thumb { background: var(--at-border); border-radius: 3px; }
/* 로그 타입별 색상 */
.at-search-log .at-log-info  { color: #60a5fa; }
.at-search-log .at-log-warn  { color: #fbbf24; }
.at-search-log .at-log-error { color: #f87171; }

/* ── 결과 종목 행 (2줄 그리드 레이아웃) ── */
.at-result-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 0;
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(30,41,59,.5); border: 1px solid var(--at-border);
    cursor: pointer; transition: background .12s, border-color .12s;
    align-items: center;
}
.at-result-item:hover { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); }

/* 체크박스 — 2행 span */
.at-result-item input[type=checkbox] {
    accent-color: var(--at-green); flex-shrink: 0;
    grid-column: 1; grid-row: 1 / 3;
    align-self: center;
}

/* 종목명 — 1행 */
.at-result-item-name {
    grid-column: 2; grid-row: 1;
    font-size: 11.5px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.5;
}

/* 스코어 — 2행 span, 우측 */
.at-result-item-score {
    grid-column: 3; grid-row: 1 / 3;
    align-self: center;
    font-size: 11px; font-weight: 900; font-family: monospace;
    color: var(--at-green); flex-shrink: 0;
    padding-left: 4px;
}

/* 2행: 코드 + 가격 + 태그 한줄 */
.at-result-item-info {
    grid-column: 2; grid-row: 2;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    min-width: 0;
}

/* 코드 + 가격 + 등락률 */
.at-result-item-meta {
    display: contents; /* 하위 요소가 at-result-item-info flex에 직접 입력 */
}
.at-result-item-code  { font-size: 9.5px; color: var(--at-muted); font-family: monospace; }
.at-result-item-price { font-size: 9.5px; color: #94a3b8; }

/* 태그 랑크 — 2행 유서에 함께 표시 */
.at-result-item-tags  { display: flex; gap: 3px; flex-wrap: nowrap; }
.at-result-tag {
    font-size: 8.5px; font-weight: 700; padding: 1px 5px; border-radius: 10px;
    background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.25);
    white-space: nowrap;
}
.at-result-tag.ai     { background: rgba(99,102,241,.18); color: #a5b4fc; border-color: rgba(99,102,241,.35); }
.at-result-tag.vol    { background: rgba(251,191,36,.12); color: #fbbf24; border-color: rgba(251,191,36,.3); }
.at-result-tag.rsi    { background: rgba(16,185,129,.12); color: #34d399; border-color: rgba(16,185,129,.3); }
.at-result-tag.golden { background: rgba(251,146,60,.12); color: #fb923c; border-color: rgba(251,146,60,.3); }

/* ══════════════════════════════════════════════════════════
   ZONE B — 전략 설정 카드 (풀와이드 가로 1줄)
══════════════════════════════════════════════════════════ */
.at-card-strategy { padding: 10px 13px; }

/* 전략 바 전체 — 가로 스크롤 1줄 */
.at-strategy-bar {
    display: flex; align-items: stretch; gap: 0;
    overflow-x: auto; scrollbar-width: none;
}
.at-strategy-bar::-webkit-scrollbar { display: none; }

/* 타이틀 셀 */
.at-strategy-title-cell {
    display: flex; flex-direction: column; justify-content: space-between;
    align-items: flex-start; gap: 6px;
    flex-shrink: 0; padding-right: 10px;
    border-right: 1px solid var(--at-border);
    margin-right: 10px;
}

/* 설정 그룹 컨테이너 — 가로 flex */
.at-sg {
    display: flex; align-items: stretch; gap: 0;
    flex: 1; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none;
}
.at-sg::-webkit-scrollbar { display: none; }

/* 그룹 블록 */
.at-sg-block {
    display: flex; flex-direction: column; gap: 6px;
    padding: 0 12px; flex-shrink: 0;
    min-width: fit-content;
}
.at-sg-block:first-child { padding-left: 0; }

/* 구분선 */
.at-sg-divider {
    width: 1px; background: var(--at-border);
    flex-shrink: 0; align-self: stretch; margin: 0 2px;
}

/* 그룹 레이블 */
.at-sg-label {
    font-size: 9.5px; font-weight: 700; color: var(--at-muted);
    white-space: nowrap; display: flex; align-items: center; gap: 4px;
    margin-bottom: 2px;
}
.at-sg-label i { color: var(--at-blue); }

/* 그룹 내용 */
.at-sg-content { display: flex; flex-direction: column; gap: 5px; }

/* 예산 입력 */
.at-budget-row {
    display: flex; align-items: center; gap: 5px;
}
.at-input-sm {
    width: 110px; background: rgba(15,23,42,.7); border: 1px solid var(--at-border);
    border-radius: 5px; color: var(--text-primary, #e2e8f0);
    padding: 4px 7px; font-size: 11px;
    transition: border-color .15s;
}
.at-input-sm:focus { outline: none; border-color: rgba(59,130,246,.6); }
.at-unit { font-size: 10px; color: var(--at-muted); white-space: nowrap; }
.at-budget-presets {
    display: flex; gap: 3px; flex-wrap: nowrap;
}
.at-budget-presets button {
    padding: 2px 6px; border-radius: 4px;
    font-size: 9.5px; font-weight: 700;
    background: rgba(51,65,85,.4); border: 1px solid var(--at-border);
    color: var(--at-muted); cursor: pointer;
    transition: background .12s, color .12s; white-space: nowrap;
}
.at-budget-presets button:hover { background: rgba(59,130,246,.2); color: #60a5fa; }

/* 슬라이더 세트 */
.at-sg-sliders { display: flex; flex-direction: column; gap: 5px; }
.at-sl-item {
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.at-sl-name {
    font-size: 9.5px; color: var(--at-muted);
    min-width: 60px; white-space: nowrap;
}
.at-sl-item input[type=range] {
    width: 90px; accent-color: var(--at-blue); flex-shrink: 0;
    cursor: pointer;
}
.at-sl-val {
    font-size: 10px; font-weight: 800; font-family: monospace;
    color: var(--at-blue); min-width: 34px; text-align: right;
}
/* 텍스트 입력 슬라이더 대용 */
.at-input-text-sl {
    width: 80px; background: rgba(15,23,42,.7); border: 1px solid var(--at-border);
    border-radius: 4px; color: var(--text-primary, #e2e8f0);
    padding: 2px 5px; font-size: 10px; font-family: monospace;
}
.at-input-text-sl:focus { outline: none; border-color: rgba(59,130,246,.6); }
/* select 슬라이더 대용 */
.at-select-sl {
    background: rgba(15,23,42,.7); border: 1px solid var(--at-border);
    border-radius: 4px; color: var(--text-primary, #e2e8f0);
    padding: 2px 4px; font-size: 10px; cursor: pointer;
}
.at-select-sl:focus { outline: none; border-color: rgba(59,130,246,.6); }

/* 켈리 결과 표시 */
.at-kelly-result-item { align-items: flex-start; flex-direction: column; gap: 1px; }
.at-kelly-result {
    font-size: 14px; font-weight: 900; font-family: monospace;
    color: var(--at-green);
}
.at-kelly-fraction { font-size: 9px; color: var(--at-muted); }

/* 컨트롤 블록 */
.at-sg-control {
    flex-direction: column; justify-content: center; gap: 5px;
    padding-left: 12px; min-width: 100px;
}

/* ── 컨트롤 버튼 ── */
.at-control-panel { display: none; } /* 구형 호환 유지 (숨김) */
.at-btn {
    padding: 7px 14px;
    border-radius: 7px; font-size: 11.5px; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .15s, transform .1s, box-shadow .15s;
    border: none; white-space: nowrap;
}
.at-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.at-btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.at-btn-success:hover { background: linear-gradient(135deg, #047857, #059669); }
.at-btn-danger  { background: linear-gradient(135deg, #b91c1c, #ef4444); color: #fff; }
.at-btn-danger:hover { background: linear-gradient(135deg, #991b1b, #b91c1c); }
.at-btn {
    flex: 1; padding: 11px;
    border-radius: 8px; font-size: 13px; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: background .15s, transform .1s, box-shadow .15s;
    border: none;
}
.at-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.at-btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.at-btn-success:hover { background: linear-gradient(135deg, #047857, #059669); }
.at-btn-warn    { background: linear-gradient(135deg, #b45309, #fbbf24); color: #fff; }
.at-btn-warn:hover { background: linear-gradient(135deg, #92400e, #b45309); }
.at-btn-danger  { background: linear-gradient(135deg, #b91c1c, #ef4444); color: #fff; }
.at-btn-danger:hover { background: linear-gradient(135deg, #991b1b, #b91c1c); }

/* ── 포지션 요약 바 ── */
.at-summary-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 10px;
}
.at-summary-item {
    flex: 1; min-width: 100px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 10px; border-radius: 8px;
    background: var(--at-card); border: 1px solid var(--at-border);
}
.at-summary-label { font-size: 10px; color: var(--at-muted); }
.at-summary-val   { font-size: 13px; font-weight: 900; font-family: monospace; color: var(--text-primary, #e2e8f0); }

/* ── 포지션 카드 ── */
.at-positions-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    min-height: 80px;
}
.at-empty {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px;
    padding: 48px 0;
    color: var(--at-muted); font-size: 12px; text-align: center;
}
.at-empty i { font-size: 36px; color: #1e293b; }
.at-empty p { line-height: 1.7; }

.at-pos-card {
    background: var(--at-card);
    border: 1px solid var(--at-border);
    border-top: 3px solid var(--at-blue);
    border-radius: 10px;
    padding: 10px 11px 9px;
    display: flex; flex-direction: column; gap: 7px;
    transition: box-shadow .15s, transform .12s;
}
.at-pos-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.4); }

/* 포지션 카드 — 헤더 */
.at-pos-header {
    display: flex; align-items: center; gap: 6px;
}
.at-pos-name-wrap { flex: 1; min-width: 0; }
.at-pos-name { font-size: 12.5px; font-weight: 800; color: var(--text-primary, #e2e8f0); display: block; }
.at-pos-code { font-size: 9px; color: var(--at-muted); font-family: monospace; }
.at-pos-rate { font-size: 12px; font-weight: 900; font-family: monospace; flex-shrink: 0; }
.at-pos-rate.pos { color: var(--at-green); }
.at-pos-rate.neg { color: var(--at-red); }

/* 포지션 — 상태 배지 */
.at-pos-status-badge {
    font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.at-pos-s-watching { background: rgba(100,116,139,.2); color: #94a3b8; }
.at-pos-s-holding  { background: rgba(16,185,129,.18); color: #34d399; }
.at-pos-s-paused   { background: rgba(251,191,36,.15); color: #fbbf24; }
.at-pos-s-stopped  { background: rgba(239,68,68,.18);  color: #f87171; }

/* 포지션 — 손익 */
.at-pos-pnl-row {
    display: flex; align-items: baseline; gap: 6px;
}
.at-pos-pnl { font-size: 15px; font-weight: 900; font-family: monospace; }
.at-pos-pnl.pos { color: var(--at-green); }
.at-pos-pnl.neg { color: var(--at-red); }
.at-pos-comm { font-size: 9.5px; color: var(--at-muted); }

/* 포지션 — 미니 차트 */
.at-pos-chart-wrap {
    height: 50px; border-radius: 6px;
    background: rgba(15,23,42,.4); overflow: hidden;
    border: 1px solid rgba(51,65,85,.5);
}
.at-pos-chart { width: 100%; height: 100%; }

/* 포지션 — 상세 그리드 */
.at-pos-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 5px;
}
.at-pos-detail-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 5px 7px; border-radius: 5px;
    background: rgba(15,23,42,.4);
}
.at-pos-detail-label { font-size: 9px; color: var(--at-muted); }
.at-pos-detail-item > span:last-child { font-size: 11px; font-weight: 700; font-family: monospace; color: var(--text-primary, #e2e8f0); }

/* 포지션 — 분할매수 진행 바 */
.at-pos-progress-wrap {
    height: 4px; background: rgba(255,255,255,.07);
    border-radius: 99px; overflow: hidden;
}
.at-pos-progress-bar {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--at-blue), #6366f1);
    transition: width .5s ease;
}

/* 포지션 — 수동 매매 버튼 */
.at-pos-manual-btns {
    display: flex; gap: 4px;
}
.at-manual-btn {
    flex: 1; padding: 5px 4px;
    border-radius: 5px; font-size: 10px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 3px;
    transition: background .12s, transform .08s;
    white-space: nowrap;
}
.at-manual-btn:hover { transform: scale(1.04); }
.at-manual-btn.buy     { background: rgba(16,185,129,.18); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
.at-manual-btn.sell    { background: rgba(239,68,68,.18);  color: #f87171; border: 1px solid rgba(239,68,68,.35); }
.at-manual-btn.edit    { background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.at-manual-btn.sellall { background: rgba(139,92,246,.18); color: #c4b5fd; border: 1px solid rgba(139,92,246,.35); }
.at-manual-btn:hover.buy     { background: rgba(16,185,129,.3); }
.at-manual-btn:hover.sell    { background: rgba(239,68,68,.3); }
.at-manual-btn:hover.edit    { background: rgba(251,191,36,.25); }
.at-manual-btn:hover.sellall { background: rgba(139,92,246,.3); }

/* ── 거래 로그 ── */
.at-log-card { }
.at-trade-log {
    max-height: 260px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 3px;
}
.at-log-empty { color: var(--at-muted); font-size: 11px; text-align: center; padding: 16px 0; }
.at-log-item {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    padding: 5px 8px; border-radius: 5px; font-size: 10.5px;
    border-left: 2px solid transparent;
}
.at-log-item.buy  { background: rgba(16,185,129,.07); border-left-color: var(--at-green); }
.at-log-item.sell { background: rgba(239,68,68,.07);  border-left-color: var(--at-red); }
.at-log-time   { color: var(--at-muted); font-size: 9.5px; font-family: monospace; flex-shrink: 0; }
.at-log-type   { font-weight: 800; flex-shrink: 0; }
.at-log-item.buy  .at-log-type  { color: var(--at-green); }
.at-log-item.sell .at-log-type  { color: var(--at-red); }
.at-log-name   { font-weight: 700; color: var(--text-primary, #e2e8f0); }
.at-log-qty    { color: var(--at-muted); }
.at-log-price  { font-family: monospace; color: var(--text-primary, #e2e8f0); }
.at-log-pnl    { font-family: monospace; font-weight: 900; margin-left: auto; }
.at-log-pnl.pos { color: var(--at-green); }
.at-log-pnl.neg { color: var(--at-red); }
.at-log-reason { font-size: 9.5px; color: var(--at-muted); }

/* 스크롤바 */
.at-result-list::-webkit-scrollbar,
.at-cond-list::-webkit-scrollbar,
.at-trade-log::-webkit-scrollbar { width: 4px; }
.at-result-list::-webkit-scrollbar-thumb,
.at-cond-list::-webkit-scrollbar-thumb,
.at-trade-log::-webkit-scrollbar-thumb { background: var(--at-border); border-radius: 4px; }

/* ── 토스트 알림 ── */
.at-toast-wrap {
    position: fixed; bottom: 24px; right: 20px;
    display: flex; flex-direction: column; gap: 7px;
    z-index: 9999; pointer-events: none;
}
.at-toast {
    padding: 10px 16px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
    max-width: 340px; line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    opacity: 0; transform: translateX(30px);
    transition: opacity .3s, transform .3s;
    pointer-events: auto;
}
.at-toast.show { opacity: 1; transform: translateX(0); }
.at-toast-info   { background: rgba(30,41,59,.97); color: #e2e8f0; border: 1px solid var(--at-border); }
.at-toast-buy    { background: rgba(6,78,59,.95); color: #6ee7b7; border: 1px solid rgba(16,185,129,.4); }
.at-toast-profit { background: rgba(6,78,59,.95); color: #34d399; border: 1px solid rgba(16,185,129,.5); }
.at-toast-loss   { background: rgba(127,29,29,.95); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.at-toast-warn   { background: rgba(120,53,15,.9); color: #fde68a; border: 1px solid rgba(251,191,36,.4); }
.at-toast-error  { background: rgba(127,29,29,.97); color: #fca5a5; border: 1px solid rgba(239,68,68,.5); }

/* ── 모달 ── */
.at-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}
.at-modal-overlay.hidden { display: none; }
.at-modal {
    background: rgba(22,32,54,.98); border: 1px solid var(--at-border);
    border-radius: 12px; padding: 18px 20px;
    min-width: 280px; max-width: 400px; width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.at-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; font-size: 14px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
}
.at-modal-header button {
    width: 28px; height: 28px; border-radius: 6px;
    background: rgba(51,65,85,.5); border: 1px solid var(--at-border);
    color: var(--at-muted); cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.at-modal-header button:hover { background: rgba(239,68,68,.2); color: #f87171; }

/* ══════════════════════════════════════════════════════════
   AI 추천 종목 페이지 (page-search) — 상단 공유 컴포넌트
   실시간 운영 로그 + 다중 조건식 검색바
   sp- 네임스페이스 (search-page)
══════════════════════════════════════════════════════════ */

/* ── sp-log-panel: at-log-panel과 동일 구조, 인디고 테마 ── */
.sp-log-panel {
    display: flex;
    flex-direction: column;
    background: #020617;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 10px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Consolas', 'SF Mono', monospace;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
    flex-shrink: 0;
    margin-bottom: 10px;
}
.sp-log-panel.collapsed .sp-log-body { display: none; }

.sp-log-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px;
    background: rgba(99,102,241,0.07);
    border-bottom: 1px solid rgba(99,102,241,0.18);
    flex-wrap: wrap; gap: 6px;
    flex-shrink: 0;
}
.sp-log-header-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-log-header-right { display: flex; align-items: center; gap: 6px; }

.sp-log-title {
    font-size: 11.5px; font-weight: 700;
    color: #a5b4fc; letter-spacing: 0.3px;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}
/* 인디고 테마 탭 — at-log-tab 재사용하되 active 색상 오버라이드 */
.sp-log-panel .at-log-tab.active {
    background: rgba(99,102,241,0.2); color: #a5b4fc;
}

.sp-log-body {
    height: 210px;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.2) transparent;
}
.sp-log-body::-webkit-scrollbar { width: 4px; }
.sp-log-body::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.2); border-radius: 4px;
}

/* ── sp-cond-panel: 다중 조건식 검색 바 ── */
.sp-cond-panel {
    background: var(--bg-card, rgba(22,32,54,0.85));
    border: 1px solid rgba(99,102,241,0.35);
    border-top: 2px solid #6366f1;
    border-radius: 10px;
    padding: 12px 16px 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

/* 타이틀 바 */
.sp-cond-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99,102,241,0.2);
}
.sp-cond-title {
    font-size: 13px; font-weight: 800;
    color: var(--text-primary, #e2e8f0);
    display: flex; align-items: center; gap: 7px;
}
.sp-cond-title i { color: #6366f1; font-size: 13px; }
.sp-cond-title-actions {
    display: flex; align-items: center; gap: 8px;
}

/* 조건식 체크박스 그리드 — 가로로 넓게 더 많은 열 허용 */
.sp-cond-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px 8px;
    margin-bottom: 10px;
}
@media (max-width: 900px) {
    .sp-cond-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .sp-cond-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 그룹 타이틀 */
.sp-cond-grid .at-cond-group-title {
    grid-column: 1 / -1;
}

/* 검색 실행 바 */
.sp-cond-searchbar {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(99,102,241,0.15);
}
.sp-search-progress-wrap {
    flex: 1; display: flex; align-items: center; gap: 7px;
    min-width: 160px;
}
.sp-result-count {
    font-size: 11px; font-weight: 700;
    color: #818cf8; white-space: nowrap;
    margin-left: auto;
}
.sp-run-btn {
    background: linear-gradient(135deg, rgba(99,102,241,.3), rgba(139,92,246,.3)) !important;
    border-color: rgba(99,102,241,.5) !important;
    color: #a5b4fc !important;
    flex-shrink: 0;
}
.sp-run-btn:hover {
    background: linear-gradient(135deg, rgba(99,102,241,.5), rgba(139,92,246,.5)) !important;
}

/* ── sidebar 조건검색 탭 교체 스타일 ── */
.sp-sidebar-cond-guide {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px;
    background: rgba(99,102,241,0.07);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 7px;
    font-size: 11.5px; color: #94a3b8;
    margin-bottom: 10px;
    line-height: 1.6;
}
.sp-sidebar-cond-guide i { flex-shrink: 0; margin-top: 2px; }
.sp-sidebar-cond-guide strong { color: #a5b4fc; }

.sp-sidebar-quick {
    display: flex; flex-direction: column; gap: 7px;
}
.sp-sidebar-quick-label {
    font-size: 10px; font-weight: 700;
    color: var(--text-secondary, #64748b);
    letter-spacing: 0.5px; text-transform: uppercase;
}
.sp-quick-btn {
    width: 100%;
    justify-content: center;
}
.sp-cond-select-sm {
    width: 100%; padding: 5px 8px;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 6px;
    color: #94a3b8; font-size: 11px;
    cursor: pointer; outline: none;
    font-family: 'Inter', sans-serif;
}
.sp-cond-select-sm:focus { border-color: rgba(99,102,241,0.6); }

/* ── signal-tag: 다중 조건 충족 배지 (SpSearch 전용 타입) ── */
.signal-tag.normal {
    background: rgba(59,130,246,.12);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,.3);
}
.signal-tag.strong {
    background: rgba(99,102,241,.2);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,.4);
}
