@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    box-sizing: border-box;
}

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --text-heading: #0f172a;
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.12);
    --demand: #059669;
    --demand-light: #10b981;
    --demand-glow: rgba(5, 150, 105, 0.10);
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 20px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-btn: 0 4px 14px rgba(79, 70, 229, 0.20);
    --shadow-btn-hover: 0 6px 20px rgba(79, 70, 229, 0.30);
}

body {
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99,102,241,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(16,185,129,0.03) 0%, transparent 50%);
    color: var(--text);
}

/* ===== App Container ===== */
.app-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Header ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-mark {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.30);
    flex-shrink: 0;
}

.header-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-heading);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.header-sub {
    font-size: 12px;
    color: var(--text-faint);
    margin: 2px 0 0;
    letter-spacing: 0.3px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.20);
}
.btn-accent:hover {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.30);
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-card);
}
.btn-ghost:hover {
    border-color: #cbd5e1;
    color: var(--text);
    background: #f8fafc;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.20);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.30);
    transform: translateY(-1px);
}

.btn-danger-outline {
    background: var(--surface);
    color: #dc2626;
    border: 1.5px solid #fecaca;
}
.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.btn-text:hover { text-decoration: underline; }

.btn:active { transform: scale(0.97); }
.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}

/* ===== Search ===== */
.search-section {
    margin-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 0 0 0 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-card);
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
    flex-shrink: 0;
    color: var(--text-faint);
    transition: color 0.2s;
}
.search-box:focus-within .search-icon {
    color: var(--accent);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 14px;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    min-width: 0;
}
.search-box input::placeholder { color: var(--text-faint); }

.search-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: #f8fafc;
    padding: 8px 32px 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    margin-right: 4px;
}
.search-select:hover { background-color: #f1f5f9; }

#searchBtn {
    padding: 14px 26px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 4px;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.20);
}
#searchBtn:hover {
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
#searchBtn:active { transform: scale(0.97); }

/* ===== Main two-column ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    padding-bottom: 12px;
    flex: 1;
    min-height: 0;
}

.column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.scroll-container {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }
.scroll-container.hidden { display: none; }

/* ===== Toggle bar ===== */
.toggle-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.toggle-btn {
    flex: 1;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.toggle-btn[data-tab="supply"] {
    background: #eef2ff;
    color: #6366f1;
}
.toggle-btn[data-tab="supply"].active {
    background: #6366f1;
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.toggle-btn[data-tab="demand"] {
    background: #ecfdf5;
    color: #059669;
}
.toggle-btn[data-tab="demand"].active {
    background: #059669;
    color: white;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.toggle-count {
    font-size: 11px;
    opacity: 0.7;
}
.toggle-btn.active .toggle-count { opacity: 0.9; }

/* ===== Section ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-supply { background: #818cf8; box-shadow: 0 0 6px rgba(99,102,241,0.4); }
.dot-demand { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.4); }

.section-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
}

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

/* ===== Results List ===== */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    color: var(--text-faint);
    border: 1.5px dashed var(--border);
}
.empty-state.small { padding: 40px 20px; }
.empty-state svg { margin-bottom: 12px; stroke: #cbd5e1; }
.empty-state p { margin: 0; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.empty-state span { font-size: 12px; color: var(--text-faint); display: block; margin-top: 6px; }

.no-results {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 50px 20px;
    text-align: center;
    color: var(--text-faint);
    border: 1px solid var(--border-light);
}
.no-results p { margin: 0; font-size: 14px; }

/* ===== Card ===== */
.result-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s;
    animation: slideIn 0.35s ease-out;
    margin-bottom: 10px;
}
.result-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.result-card.new-arrival {
    background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(239,68,68,0.08));
    animation: slideIn 0.35s ease-out, flash-twice 1s ease-out 0.35s;
}

.result-card.demand-card.new-arrival {
    background: linear-gradient(135deg, rgba(16,185,129,0.02), rgba(16,185,129,0.05));
}

@keyframes flash-twice {
    0%, 100% { background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(239,68,68,0.08)); }
    15%  { background: linear-gradient(135deg, rgba(239,68,68,0.10), rgba(239,68,68,0.18)); }
    30%  { background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(239,68,68,0.08)); }
    45%  { background: linear-gradient(135deg, rgba(239,68,68,0.10), rgba(239,68,68,0.18)); }
    60%  { background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(239,68,68,0.08)); }
}

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

.result-meta {
    min-width: 0;
    flex: 1;
}

.result-company {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    display: inline;
    margin-right: 10px;
}

.type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-right: 6px;
}
.type-tag.supply { background: #eef2ff; color: #4f46e5; }
.type-tag.demand { background: #d1fae5; color: #047857; }

.city-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #fff7ed;
    color: #ea580c;
    margin-right: 6px;
}

.result-contact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1.5px solid #e2e8f0;
}
.result-contact svg { flex-shrink: 0; color: #6366f1; }

.result-time {
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 3px;
}

.result-text {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    color: #334155;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Inter', 'SF Mono', 'Consolas', monospace;
}

/* ===== Merchants (narrow column) ===== */
.merchants-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.merchants-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 12px;
    border-bottom: 1px solid #f1f5f9;
}
.merchants-header .section-title { margin: 0; }
.merchants-header .section-badge { flex-shrink: 0; }

.merchants-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}
#merchantsList.scroll-container {
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.merchant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.merchant-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.merchant-item:hover::before { transform: scale(1.5); box-shadow: 0 0 0 4px currentColor; }

.merchant-item:nth-child(5n+1)::before { background: #818cf8; color: rgba(129,140,248,0.15); }
.merchant-item:nth-child(5n+2)::before { background: #34d399; color: rgba(52,211,153,0.15); }
.merchant-item:nth-child(5n+3)::before { background: #f472b6; color: rgba(244,114,182,0.15); }
.merchant-item:nth-child(5n+4)::before { background: #fbbf24; color: rgba(251,191,36,0.15); }
.merchant-item:nth-child(5n+5)::before { background: #a78bfa; color: rgba(167,139,250,0.15); }

.merchant-item + .merchant-item { border-top: 1px solid #f1f5f9; }

.merchant-item:hover {
    background: #fafbfc;
}

.merchant-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.merchant-count {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: #f8fafc;
    padding: 3px 10px;
    border-radius: 10px;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}
.merchant-item:hover .merchant-count {
    background: #eef2ff;
    color: #6366f1;
}

/* ===== Merchant posts dialog ===== */
.merchant-posts-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    width: 560px;
    max-height: 72vh;
    z-index: 200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease-out;
}
.merchant-posts-dialog.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.merchant-posts-dialog .dialog-header {
    padding: 20px 24px 12px;
}
.merchant-posts-dialog .dialog-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--text-heading);
}
.mp-company-name {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mp-post-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 3px 12px;
    border-radius: 20px;
}
.merchant-posts-results {
    padding: 8px 24px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.merchant-posts-results::-webkit-scrollbar { width: 5px; }
.merchant-posts-results::-webkit-scrollbar-track { background: transparent; }
.merchant-posts-results::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.merchant-posts-results .result-card { margin-bottom: 10px; }

/* ===== Footer ===== */
.app-footer {
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.footer-disclaimer {
    margin: 0;
    font-size: 11px;
    line-height: 1.7;
    color: #94a3b8;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Publish Panel ===== */
.publish-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s, opacity 0.25s;
}
.publish-overlay.active {
    visibility: visible;
    opacity: 1;
}

.publish-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: var(--surface);
    z-index: 101;
    padding: 36px 32px 32px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 30px rgba(0,0,0,0.08);
}
.publish-panel.active { transform: translateX(0); }

.publish-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.publish-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--text-muted);
}
.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-heading);
}

/* Form */
.form-field { margin-bottom: 20px; }
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
.required { color: #ef4444; }
.optional { color: var(--text-faint); font-weight: 400; font-size: 11px; }

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: white;
}

.input-icon {
    flex-shrink: 0;
    color: var(--text-faint);
    transition: color 0.2s;
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 0;
    font-size: 14px;
    color: var(--text);
}
.input-wrap input::placeholder { color: var(--text-faint); }

.textarea-wrap {
    align-items: flex-start;
    padding-top: 10px;
}
.textarea-wrap textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text);
    resize: vertical;
    min-height: 180px;
    line-height: 1.7;
    font-family: 'Inter', 'SF Mono', 'Consolas', monospace;
}
.textarea-wrap textarea::placeholder {
    color: var(--text-faint);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.7;
}

.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-btn);
}
.submit-btn:hover {
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
}
.submit-btn:active { transform: scale(0.97); }
.submit-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}

.form-msg {
    text-align: center;
    font-size: 13px;
    padding: 12px 0 0;
    margin: 0;
}
.form-msg.success { color: #059669; font-weight: 500; }
.form-msg.error { color: #dc2626; }
.form-msg.hidden { display: none; }

.input-wrap.invalid {
    border-color: #fca5a5;
    background: #fef2f2;
}
.input-wrap.invalid .input-icon { color: #ef4444; }

/* ===== My Posts Dialog ===== */
.my-posts-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 520px;
    max-width: calc(100vw - 48px);
    max-height: 80vh;
    background: var(--surface);
    border-radius: var(--radius-lg);
    z-index: 101;
    padding: 32px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 60px rgba(0,0,0,0.15);
}
.my-posts-dialog.active {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.dialog-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.dialog-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.dialog-step.hidden { display: none; }

.key-input-wrap { margin-bottom: 16px; }

.dialog-key-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 12px;
}
.key-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.key-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.my-posts-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.my-post-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.my-post-item:hover { background: #f1f5f9; }
.my-post-item.selected {
    border-color: var(--accent);
    background: rgba(99,102,241,0.03);
}
.my-post-item .checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    margin-top: 2px;
}
.my-post-item.selected .checkbox {
    background: var(--accent);
    border-color: var(--accent);
}
.my-post-item.selected .checkbox::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}
.my-post-item .post-body { flex: 1; min-width: 0; }
.my-post-item .post-body .type-tag { margin-bottom: 4px; display: inline-block; }
.my-post-item .post-body .text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.my-post-item .post-body .meta {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.my-posts-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.my-posts-actions.hidden { display: none; }
.select-info { font-size: 12px; color: var(--text-muted); margin-right: auto; }

/* ===== Admin ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 380px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.login-card h1 { font-size: 24px; font-weight: 800; color: var(--text-heading); margin: 0; text-align: center; }
.login-card > p { text-align: center; font-size: 13px; color: var(--text-faint); margin: 6px 0 24px; }
.login-card .input-wrap { margin-bottom: 16px; }

.admin-panel {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-panel.hidden { display: none; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 0 20px;
}
.admin-header h1 { font-size: 20px; font-weight: 800; color: var(--text-heading); margin: 0; }
.admin-header-right { display: flex; align-items: center; gap: 14px; }
.admin-header-right span { font-size: 12px; color: var(--text-faint); }
.logout-btn {
    padding: 8px 18px;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.logout-btn:hover { background: #fee2e2; }

/* Tabs */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.admin-tab {
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    color: var(--text-faint);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(79,70,229,0.2);
}
.admin-tab:hover:not(.active) { border-color: #cbd5e1; background: #f8fafc; color: #475569; }
.admin-tab-content { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 20px; }
.admin-tab-content.hidden { display: none; }

.loading { text-align: center; padding: 60px 0; color: var(--text-faint); font-size: 14px; }

/* Admin post cards */
.admin-post-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}
.admin-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}
.admin-post-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-post-contact { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-post-text {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Inter', 'SF Mono', 'Consolas', monospace;
    margin: 8px 0;
}
.admin-post-ip { font-size: 11px; color: var(--text-faint); margin-bottom: 10px; }
.admin-post-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-action-btn:active { transform: scale(0.96); }
.btn-block-ip { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-block-ip:hover { background: #fee2e2; }
.btn-block-phone { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.btn-block-phone:hover { background: #ffedd5; }
.btn-delete { background: #f8fafc; color: var(--text-muted); border: 1px solid var(--border); }
.btn-delete:hover { background: #f1f5f9; }

/* Blacklist table */
.blacklist-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.blacklist-table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.blacklist-table td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}
.blacklist-table tr:last-child td { border-bottom: none; }
.blacklist-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.blacklist-type.ip { background: #fef2f2; color: #dc2626; }
.blacklist-type.phone { background: #fff7ed; color: #ea580c; }

.btn-unblock {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-unblock:hover { background: #f8fafc; border-color: #cbd5e1; }

.sw-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
}
.sw-tag-del {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.sw-tag-del:hover { color: #dc2626; }

@media (max-width: 860px) {
    .main-grid { grid-template-columns: 1fr; }
    .merchants-column { display: none; }
    .header-actions { width: 100%; }
    .header-actions .btn { flex: 1; justify-content: center; }
    .search-box { flex-wrap: wrap; padding: 8px; }
    .search-box input { min-width: 100%; order: -1; }
    .search-select { margin: 0; }
    #searchBtn { margin: 0; }
}
