:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.logo-icon {
    font-size: 28px;
    background: var(--primary-light);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.brand-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.brand-en {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 6px;
}

.brand-badge {
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: default;
}

.subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.subtitle strong {
    color: var(--gray-700);
    font-weight: 600;
}

/* Brand Meaning Intro Bar */
.brand-intro-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--gray-700);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.brand-intro-bar .intro-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.brand-intro-bar .intro-content {
    line-height: 1.5;
    flex: 1;
}

.brand-intro-bar .intro-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid #c7d2fe;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.brand-intro-bar em {
    font-style: normal;
    color: var(--primary);
    font-weight: 700;
    background: rgba(79, 70, 229, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--success-light);
    color: var(--success);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.disconnected {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.status-badge.disconnected .pulse-dot {
    background-color: var(--danger);
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Tabs (Segmented Control Style) */
.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 5px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.18s ease;
}

.tab-btn:hover {
    color: var(--gray-900);
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    background: #ffffff;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.badge {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    transition: all 0.18s ease;
}

.tab-btn.active .badge {
    background: var(--primary-light);
    color: var(--primary);
}

/* Panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.subtext {
    font-size: 13px;
    color: var(--gray-500);
}

/* Grid & Cards */
.feed-grid, .rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.item-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-rule-tag {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.item-time {
    font-size: 12px;
    color: var(--gray-400);
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.4;
}

.item-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

.item-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.item-snippet {
    font-size: 13px;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    line-height: 1.4;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-100);
    padding-top: 10px;
    font-size: 12px;
}

.matched-keywords-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kw-chip {
    background: var(--warning-light);
    color: #b45309;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Rule Card */
.rule-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.rule-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--gray-300);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

.rule-detail-row {
    margin-bottom: 8px;
    font-size: 13px;
}

.rule-label {
    font-weight: 600;
    color: var(--gray-500);
    display: inline-block;
    width: 75px;
}

.rule-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    vertical-align: middle;
}

.tag-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.tag-badge.exclude {
    background: var(--danger-light);
    color: var(--danger);
}

.rule-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--gray-100);
    padding-top: 14px;
    margin-top: 12px;
}

/* Search Card */
.search-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.search-results-section { margin-top: 24px; }
.search-results-header { margin-bottom: 16px; }

/* Forms */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
label.required::after { content: " *"; color: var(--danger); }

.form-input, .form-select {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-800);
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.help-text { font-size: 11px; color: var(--gray-500); }

/* Tag Chip Input */
.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: #ffffff;
    min-height: 42px;
}

.tags-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.tags-input-container input {
    border: none;
    outline: none;
    font-size: 14px;
    flex: 1;
    min-width: 100px;
    padding: 4px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.tag-item.exclude { background: var(--danger-light); color: var(--danger); }
.tag-item .tag-remove { cursor: pointer; font-size: 14px; font-weight: bold; opacity: 0.7; }
.tag-item .tag-remove:hover { opacity: 1; }

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-outline { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: var(--danger); color: #ffffff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.form-actions-inline { justify-content: flex-end; }

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px dashed var(--gray-300);
    color: var(--gray-500);
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-400);
}

.empty-icon svg {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    stroke: var(--gray-500);
    fill: none;
    stroke-width: 1.75;
    display: block;
}

.empty-state p { font-size: 15px; font-weight: 600; color: var(--gray-700); }
.empty-desc { font-size: 13px; color: var(--gray-400); margin-top: 4px; display: block; }

/* Modal Popup */
.modal-overlay, .modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.show, .modal-backdrop.show {
    display: flex !important;
    animation: fadeIn 0.2s ease;
}

.modal-dialog, .modal-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--gray-200);
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-dialog.auth-dialog {
    max-width: 440px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    background: #ffffff;
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.modal-close, .btn-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.modal-close:hover, .btn-close:hover {
    color: var(--gray-800);
    background: var(--gray-100);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

@keyframes modalScaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: #ffffff;
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideInRight 0.3s ease;
    border: 1px solid var(--gray-200);
}

.toast.success { border-left-color: var(--success); }
.toast.info { border-left-color: var(--primary); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

.toast-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.toast-title { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.toast-body { font-size: 13px; color: var(--gray-600); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .form-row { flex-direction: column; gap: 12px; }
    .feed-grid, .rules-grid { grid-template-columns: 1fr; }
    .checkbox-group { grid-template-columns: 1fr; }
}

/* Auth & Points */
.auth-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
}

.point-pill {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #fde68a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.point-pill.pulse {
    animation: pointPulse 0.4s ease;
}

@keyframes pointPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); background: #fcd34d; }
    100% { transform: scale(1); }
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 16px;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-notice {
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 12px;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.item-point-tag {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Kakao Login & VIP Badge & Complexity */
.btn-kakao-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fee500;
    color: #191919;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, transform 0.1s ease;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-kakao-login:hover {
    background: #fada0a;
    transform: translateY(-1px);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    margin: 16px 0 8px 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider span {
    padding: 0 8px;
}

.vip-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(217,119,6,0.3);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.web-only-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    border: 1px solid #bae6fd;
}

.complexity-badge-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

/* Rule Card Highlight Animation */
.rule-card.highlight {
    animation: highlightPulse 2.8s ease-out;
    border-color: var(--primary) !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.5), 0 12px 28px rgba(37, 99, 235, 0.25);
        transform: scale(1.03);
        background: #eff6ff;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.25), 0 8px 20px rgba(37, 99, 235, 0.15);
        transform: scale(1.01);
        background: #f8fafc;
    }
    100% {
        box-shadow: var(--shadow-sm);
        transform: scale(1);
        background: #ffffff;
    }
}

/* Delete Log Button & Item Actions */
.btn-delete-log {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-delete-log:hover {
    color: #dc2626;
    background: #fee2e2;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-action:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Auth Notice Banner */
.auth-notice-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-notice-banner .banner-icon {
    font-size: 26px;
    background: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.auth-notice-banner .banner-content {
    flex: 1;
}

.auth-notice-banner .banner-content strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.auth-notice-banner .banner-content p {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0;
}

/* Monitor Button */
.btn-monitor {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #fbbf24;
    color: #b45309;
    background: #fffbeb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-monitor:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.btn-monitor.is-monitored {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
}

.btn-monitor.is-monitored:hover {
    background: #059669;
}

/* Monitoring Card Badges */
.badge-monitoring {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-monitoring.inactive {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

.badge-monitoring-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: pulse 1.5s infinite;
}

.badge-monitoring-dot.inactive {
    background: #94a3b8;
    box-shadow: none;
    animation: none;
}

.subscriber-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.scraping-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--gray-600);
}

.scraping-info-box.inactive {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}


/* Kakao Notice Box */
.channel-notice-kakao {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 12px;
    color: #713f12;
    line-height: 1.5;
}

.channel-notice-kakao .notice-icon {
    font-size: 16px;
    line-height: 1;
    margin-top: 2px;
}

.channel-notice-kakao strong {
    color: #854d0e;
}

.kakao-sub-tip {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #854d0e;
    text-align: center;
    line-height: 1.4;
}

/* ==========================================================================
   Feed Filter Bar & Quick Keyword Chips & Monitored Sort Styles
   ========================================================================== */

.feed-filter-bar {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-controls-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    border: 1.5px solid var(--gray-300);
    background: #ffffff;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-filter-toggle:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-filter-toggle.active {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.btn-filter-toggle .star-icon {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.btn-filter-toggle.active .star-icon {
    transform: scale(1.15);
}

.filter-count-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-filter-toggle.active .filter-count-badge {
    background: #f59e0b;
    color: #ffffff;
}

.filter-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.filter-select {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 210px;
    height: 36px;
    border-radius: var(--radius-sm);
    background-color: #ffffff;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 12px;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 5px 11px;
    border-radius: 20px;
    font-weight: 600;
}

.sort-indicator .sort-icon {
    font-size: 13px;
}

.quick-keywords-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px dashed var(--gray-200);
    padding-top: 10px;
}

.quick-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    white-space: nowrap;
}

.quick-chips-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.keyword-chip-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.keyword-chip-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.keyword-chip-btn .chip-count {
    font-size: 10px;
    opacity: 0.75;
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 5px;
    border-radius: 8px;
}

.keyword-chip-btn.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.keyword-chip-btn.rule-chip {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.keyword-chip-btn.rule-chip:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
}

.keyword-chip-btn.rule-chip.active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.35);
}

/* Item Card Highlight when Monitored */
.item-card.is-monitored-card {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(to right, #fffdfa 0%, #ffffff 50px);
    box-shadow: 0 2px 6px -1px rgba(245, 158, 11, 0.12);
}

.monitored-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Platform Badges */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1.2;
}

.platform-badge-daangn {
    background: #fff4ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

.platform-badge-joongna {
    background: #edfbf3;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.platform-badge-bunjang {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.platform-badge-other {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Region Selector Modal Styles
   ========================================================================== */

.region-selector-dialog {
    max-width: 780px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.region-modal-body {
    padding: 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-subtext {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* All Region Card */
.all-region-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.all-region-card.active {
    background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.all-region-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.all-region-badge {
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
}

.all-region-cost-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.all-region-desc {
    font-size: 12px;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.4;
}

/* Search Bar */
.region-search-bar {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input-wrapper .form-input {
    padding-left: 36px;
    padding-right: 36px;
    height: 40px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-300);
}

.search-input-wrapper .form-input:focus {
    border-color: var(--primary);
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.btn-clear-search:hover {
    color: var(--gray-700);
}

/* Region Tree (3 columns) */
.region-tree-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #f8fafc;
    padding: 10px;
    min-height: 250px;
    max-height: 310px;
}

.region-tree-col {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tree-col-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    background: #f1f5f9;
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tree-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 250px;
}

.tree-empty-hint {
    padding: 30px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
}

.tree-item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    user-select: none;
}

.tree-item-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.tree-item-btn.selected {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--primary);
    font-weight: 700;
}

.tree-item-btn.has-dong {
    border-bottom: 1px solid var(--gray-100);
}

.tree-item-add-btn {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tree-item-add-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.tree-item-add-btn.is-added {
    background: #10b981;
    color: #ffffff;
}

/* Region Search Results */
.region-search-results {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #ffffff;
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.region-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-100);
}

.region-search-hint {
    font-size: 11px;
    font-weight: normal;
    color: var(--gray-500);
}

.region-search-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.region-search-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.region-search-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.region-search-card.is-selected {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.region-card-info {
    display: flex;
    flex-direction: column;
}

.region-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.region-card-path {
    font-size: 11px;
    color: var(--gray-500);
}

.region-card-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
}

.region-card-btn.selected {
    background: #10b981;
}

/* Selected Regions Section */
.selected-regions-section {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.selected-regions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.selected-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
}

.selected-cost-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.selected-region-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 38px;
    padding: 6px 0;
}

.region-chip-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #f1f5f9;
    border: 1px solid var(--gray-300);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    animation: fadeIn 0.15s ease;
}

.region-chip-tag.all-region-tag {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.region-chip-tag .btn-remove-tag {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.region-chip-tag .btn-remove-tag:hover {
    color: #ef4444;
}

.selected-empty-text {
    font-size: 12px;
    color: var(--gray-400);
    align-self: center;
}

/* Region Cost Notice Box */
.region-cost-notice-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 12px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.45;
}

.region-cost-notice-box .notice-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.btn-text-sm {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-text-sm:hover {
    color: #ef4444;
}

/* Search Period Guide & Badges */
.search-period-guide-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #166534;
    line-height: 1.5;
}

.search-period-guide-box .guide-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.search-period-guide-box strong {
    display: block;
    font-size: 14px;
    color: #14532d;
    margin-bottom: 2px;
}

.period-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* ==========================================================================
   규칙으로 검색하기 & 검증 모드 (Rule-based Search & Verification)
   ========================================================================== */
.modal-footer-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.modal-footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-rule-search {
    color: var(--primary);
    border-color: #a5b4fc;
    background-color: #f5f3ff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-rule-search:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.rule-search-verify-banner {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verify-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.verify-badge-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.verify-rule-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.verify-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.verify-conditions-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-sm);
    border: 1px solid #e0e7ff;
}

.v-label {
    font-weight: 600;
    color: var(--gray-600);
    margin-right: 4px;
}

.v-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-800);
}

.v-chip.v-exclude {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.v-chip.v-region {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.verify-status-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.45;
}

.verify-status-box.success {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.verify-status-box.warning {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.verify-status-box.info {
    background-color: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.verify-status-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.verify-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.verify-match-badge.match-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.verify-match-badge.match-partial {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.verify-matched-kws {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #4338ca;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}






