/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #98761d;
    --primary-hover: #7a6018;
    --primary-light: #fdf6e0;
    --primary-subtle: rgba(152, 118, 29, 0.10);
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --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: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px -8px rgba(0,0,0,0.12);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Sign-In Modal === */
.signin-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.signin-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.signin-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 24px 28px 24px;
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.signin-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 32px;
    font-weight: 300;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}

.signin-close:hover {
    color: var(--gray-600);
}

.signin-header {
    text-align: center;
    margin-bottom: 16px;
}

.signin-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.signin-header p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.signin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.signin-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: 0.02em;
}

.signin-field input {
    padding: 11px 13px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color var(--transition), background var(--transition);
}

.signin-field input:hover {
    border-color: var(--gray-300);
    background: white;
}

.signin-field input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.signin-error {
    font-size: 0.85rem;
    color: var(--danger);
    padding: 10px 12px;
    background: var(--danger-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.signin-btn {
    padding: 11px 16px;
    font-weight: 600;
    margin-top: 8px;
}

.signin-register-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.84rem;
    color: var(--gray-500);
}

.signin-register-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.signin-register-link:hover {
    text-decoration: underline;
}

/* Social sign-in buttons */
.social-signin-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-social:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-social:active { transform: translateY(0); }

.btn-google {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-facebook {
    background: #1877f2;
    color: #fff;
}

.btn-apple {
    background: #000;
    color: #fff;
}

.social-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 4px;
    color: var(--gray-400);
    font-size: 0.78rem;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.signin-card-register {
    max-width: 400px;
}
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* === Logout Button === */
.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    margin-left: 12px;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #312e81 100%);
    color: #fff;
    padding: 28px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* === Header Controls (right side) === */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.header-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-nav-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.header-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.header-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    flex-shrink: 0;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.profile-label {
    font-size: 0.78rem;
    color: var(--gray-600);
    font-family: 'Outfit', sans-serif;
}

.profile-user {
    font-size: 0.82rem;
    color: var(--gray-900);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    color: #1f1a0e;
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(152, 118, 29, 0.30), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(152, 118, 29, 0.38), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(152, 118, 29, 0.30);
}

.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-text {
    background: none;
    color: var(--gray-400);
    padding: 4px;
    border: none;
    border-radius: var(--radius-sm);
}

.btn-text:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.btn-icon {
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-400);
    padding: 7px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.btn-icon:hover, .btn-icon.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* === Filter Panel === */
.filter-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: -20px 0 20px;
    overflow: hidden;
    border: 1px solid var(--gray-100);
    position: relative;
    z-index: 10;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.filter-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
    letter-spacing: -0.01em;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px 24px 24px;
}

.filter-grid.collapsed {
    display: none;
}

/* New two-row filter layout */
.filter-form {
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-filter-form {
    gap: 14px;
}

.quick-search-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-search-wrap label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.quick-search-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.quick-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quick-search-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.quick-search-input-wrap svg {
    color: var(--gray-400);
    flex: 0 0 auto;
}

.quick-search-input-wrap input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 12px 0;
    font-size: 0.92rem;
    color: var(--gray-900);
}

.quick-options-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 0.7fr;
    gap: 10px;
}

.ot-filter-form {
    gap: 16px;
}

.ot-market-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 14px 24px 6px;
    border-bottom: 1px solid var(--gray-200);
    background: #f8fafb;
}

.ot-market-tab {
    border: none;
    background: transparent;
    color: #6c8f32;
    text-transform: uppercase;
    font-size: 0.88rem;
    padding: 8px 14px;
    border-bottom: 4px solid transparent;
    cursor: default;
}

.ot-market-tab.active {
    border-bottom-color: #8bc53f;
}

.ot-filter-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 18px;
}

.ot-filter-block h3 {
    margin-bottom: 8px;
    color: #245fb2;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ot-checklist {
    border: 1px solid var(--gray-200);
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    max-height: 190px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.ot-checklist-two-col {
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
}

.ot-checklist-two-col label:first-child {
    grid-column: 1 / -1;
}

.ot-checklist > label:first-child,
.ot-checklist-two-col > label:first-child {
    font-weight: 600;
    color: #4c627f;
}

.ot-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.94rem;
    color: var(--gray-700);
}

.ot-keyword-row {
    display: grid;
    grid-template-columns: 2fr 0.7fr 0.7fr;
    gap: 12px;
    align-items: end;
}

.ot-keyword-group,
.ot-keyword-mode-group,
.ot-status-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ot-keyword-group label,
.ot-keyword-mode-group label,
.ot-status-group label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.05em;
}

.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 11px 12px;
    font-size: 0.9rem;
}

.ot-action-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ot-more-options {
    margin-left: auto;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: #8a6726;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.ot-more-options:hover {
    border-color: #c39a45;
    background: #fbf4e2;
    color: #6f531f;
}

.advanced-filters.collapsed {
    display: none;
}

@media (max-width: 900px) {
    .quick-search-row {
        grid-template-columns: 1fr;
    }

    .quick-options-row {
        grid-template-columns: 1fr;
    }

    .ot-filter-grid,
    .ot-keyword-row {
        grid-template-columns: 1fr;
    }

    .ot-checklist-two-col {
        grid-template-columns: 1fr;
    }
}

.filter-row {
    display: grid;
    gap: 10px;
    align-items: flex-end;
}

.filter-row-primary {
    grid-template-columns: 2fr 1.2fr 1.8fr;
}

.filter-row-secondary {
    grid-template-columns: 1fr 1fr 1fr 1fr 0.8fr auto;
}

.filter-group-wide {
    /* grid placement handled by column definition */
}

.filter-group-source {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 8px;
    align-items: flex-end;
}

.filter-group-source label {
    grid-column: 1 / -1;
}

.filter-group-source .source-search-input,
.filter-group-source select {
    margin: 0;
}

.source-search-input {
    padding: 7px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.source-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.source-search-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.filter-actions {
    /* auto-sized to button content */
}

.filter-actions-btns {
    display: flex;
    gap: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group input,
.filter-group select {
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.filter-group input:hover,
.filter-group select:hover {
    border-color: var(--gray-300);
    background: #fff;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.filter-group input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.filter-actions {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

/* === Results Bar === */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.plans-section {
    margin: 36px 0 56px;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef4ff 100%);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.plans-header {
    max-width: 760px;
    margin: 0 auto 24px auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plans-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plans-header h2 {
    font-size: 2rem;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 10px;
    text-align: center;
}

.plans-header p {
    max-width: 640px;
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0 auto;
    text-align: center;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 780px;
    margin: 0 auto;
}

.plan-card {
    position: relative;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.plan-card-featured {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 18px 34px -18px rgba(79, 70, 229, 0.45);
}

.plan-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.plan-tier {
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.plan-card h3 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.plan-card h3 span {
    font-size: 0.92rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-left: 4px;
}

.plan-card p {
    color: var(--gray-600);
    margin-bottom: 18px;
}

.plan-features {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.plan-features li {
    position: relative;
    padding-left: 18px;
    color: var(--gray-700);
    font-size: 0.92rem;
}

.plan-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--success);
    transform: translateY(-50%);
}

.plan-btn {
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

.plan-btn.is-selected {
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.18);
    border-color: rgba(185, 28, 28, 0.44);
}

@media (max-width: 980px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }

    .plans-section {
        padding: 22px;
    }

    .plans-header h2 {
        font-size: 1.65rem;
    }
}

.results-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

.source-status-notice {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(217, 119, 6, 0.28);
    background: var(--warning-light);
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.filter-tag button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.filter-tag button:hover {
    opacity: 1;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--gray-100);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Error === */
.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

/* === Empty State === */
.empty-state {
    position: relative;
    padding: 72px 20px;
    margin: 8px 0 20px;
}

.empty-state svg {
    margin-bottom: 0;
    opacity: 0.95;
    stroke: #9f7a28;
}

.empty-state h3 {
    color: #f5e9cb;
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(28, 18, 6, 0.7), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.empty-state p {
    color: #dfc488;
    max-width: 580px;
    margin: 0 auto;
    font-size: 0.98rem;
    line-height: 1.65;
}

.empty-state-shell {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.empty-state-shell::before {
    content: '';
    position: absolute;
    inset: -14px -10px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 14% 18%, rgba(152, 118, 29, 0.28) 0, rgba(152, 118, 29, 0) 34%),
        radial-gradient(circle at 85% 78%, rgba(25, 87, 110, 0.2) 0, rgba(25, 87, 110, 0) 40%);
    pointer-events: none;
}

.empty-state-card {
    position: relative;
    z-index: 1;
    text-align: center;
    border-radius: 18px;
    border: 1px solid rgba(152, 118, 29, 0.5);
    padding: 30px 24px;
    background:
        linear-gradient(145deg, rgba(4, 39, 64, 0.96) 0%, rgba(2, 32, 56, 0.96) 55%, rgba(8, 58, 84, 0.94) 100%),
        repeating-linear-gradient(45deg, rgba(255, 244, 212, 0.05) 0 2px, rgba(152, 118, 29, 0.02) 2px 5px);
    box-shadow: 0 20px 40px rgba(2, 32, 56, 0.24), inset 0 1px 0 rgba(255, 235, 186, 0.16);
}

.empty-state-icon-wrap {
    width: 102px;
    height: 102px;
    margin: 0 auto 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(152, 118, 29, 0.56);
    background: radial-gradient(circle, rgba(255, 245, 213, 0.12) 0%, rgba(152, 118, 29, 0.08) 52%, rgba(2, 32, 56, 0.22) 100%);
    box-shadow: inset 0 0 0 8px rgba(2, 32, 56, 0.25), 0 12px 22px rgba(2, 32, 56, 0.35);
}

.empty-state-hints {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.empty-state-hints span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(152, 118, 29, 0.55);
    color: #f2dcab;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1.3;
    background: rgba(152, 118, 29, 0.14);
}

/* === Cards === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid var(--gray-100);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
    border-color: var(--gray-200);
}

.card-top {
    padding: 20px 20px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-ref {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.card-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.status-active { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.15); }
.status-closed { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }
.status-planning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.15); }

.card-body {
    padding: 12px 20px 20px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.new-badge {
    display: inline-block;
    background: #10b981;
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

.card-description-preview {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-auth-prompt {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
}

.card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.meta-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-value {
    font-size: 0.82rem;
    color: var(--gray-700);
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.briefing-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
}

.briefing-compulsory { background: var(--danger-light); color: var(--danger); }
.briefing-optional { background: var(--warning-light); color: var(--warning); }
.briefing-none { background: var(--gray-100); color: var(--gray-400); }

.card-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* === Table === */
.table-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--gray-100);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    table-layout: fixed;
}

/* Fixed column widths */
.col-ref       { width: 140px; }
.col-title     { width: auto; }       /* takes remaining space */
.col-buyer     { width: 160px; }
.col-province  { width: 110px; }
.col-type      { width: 90px; }
.col-closing   { width: 140px; }
.col-days      { width: 80px; }
.col-briefing  { width: 100px; }

.data-table thead {
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
}

.data-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--primary-subtle);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.td-title {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    max-width: 0; /* forces text to respect col width in table-layout:fixed */
    white-space: normal; /* allow inner divs to wrap/truncate themselves */
}

.td-title:hover::after {
    content: attr(data-desc);
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
    background: var(--gray-900);
    color: rgba(255,255,255,0.95);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    line-height: 1.6;
    max-width: 440px;
    min-width: 240px;
    width: max-content;
    white-space: normal;
    box-shadow: var(--shadow-xl);
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease;
    backdrop-filter: blur(4px);
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.td-title .title-text {
    font-weight: 500;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bookmark-inline-btn {
    border: 1px solid #e8c86a;
    background: #fffbf0;
    color: #b27b00;
    border-radius: 999px;
    width: 28px;
    min-width: 28px;
    height: 28px;
    line-height: 26px;
    padding: 0;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.bookmark-inline-btn:hover,
.bookmark-inline-btn.active {
    border-color: #f0b429;
    background: #fff3d6;
    transform: scale(1.15);
}
.td-title .desc-text {
    color: var(--gray-400);
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-title .desc-text.desc-blur {
    filter: blur(4px);
    color: var(--gray-500);
    font-style: italic;
    user-select: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.td-title .desc-text.desc-blur:hover {
    filter: blur(2px);
}

/* Guest hover tooltip: blurred with lock icon prompt */
.td-title-guest:hover::after {
    filter: blur(3px);
    background: var(--gray-800);
    content: '\1F512 Sign in to view full tender details';
    filter: none;
    background: var(--primary);
    color: #fff;
    font-style: italic;
    font-size: 0.8rem;
    padding: 10px 14px;
    border-radius: var(--radius);
    pointer-events: none;
}

.td-ref {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0; /* respects fixed col-ref width */
}

/* === Sortable Headers === */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color var(--transition-fast);
}

.sortable:hover {
    color: var(--primary);
}

.sort-icon::after {
    content: '\2195';
    margin-left: 4px;
    opacity: 0.25;
    font-size: 0.7rem;
}

.sortable.sort-asc .sort-icon::after {
    content: '\25B2';
    opacity: 1;
    color: var(--primary);
}

.sortable.sort-desc .sort-icon::after {
    content: '\25BC';
    opacity: 1;
    color: var(--primary);
}

/* === Days Left === */
.days-urgent {
    color: var(--danger);
    font-weight: 700;
}

.days-warning {
    color: var(--warning);
    font-weight: 600;
}

.days-ok {
    color: var(--success);
    font-weight: 500;
}

.days-closed {
    color: var(--gray-400);
    font-style: italic;
}

/* === Tender Type Badge === */
.type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.type-rfq { background: #dbeafe; color: #1e40af; border: 1px solid rgba(30,64,175,0.12); }
.type-tender { background: #ede9fe; color: #5b21b6; border: 1px solid rgba(91,33,182,0.12); }
.type-panel { background: #fce7f3; color: #9d174d; border: 1px solid rgba(157,23,77,0.12); }
.type-other, .type-- { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 0 40px;
}

.page-info {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 600;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-100);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-100);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--gray-800);
    word-break: break-word;
}

.detail-value a {
    color: var(--primary);
}

.detail-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(152, 118, 29, 0.72);
    background: linear-gradient(135deg, #b67c12 0%, #98761d 48%, #885408 100%);
    color: #fff8eb !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(136, 84, 8, 0.2);
    letter-spacing: 0.01em;
}

.detail-doc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-download-btn {
    border: 1px solid rgba(152, 118, 29, 0.72);
    cursor: pointer;
}

.detail-whatsapp-btn {
    border: 1px solid rgba(22, 163, 74, 0.62);
    background: linear-gradient(135deg, #1fab57 0%, #14833f 54%, #0e6a32 100%);
    box-shadow: 0 8px 18px rgba(20, 131, 63, 0.24);
}

.detail-whatsapp-btn:hover {
    background: linear-gradient(135deg, #22c35f 0%, #179248 54%, #12713a 100%);
    box-shadow: 0 12px 22px rgba(20, 131, 63, 0.28);
}

.detail-download-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.detail-doc-url {
    display: block;
    margin-top: 8px;
    color: #19576e;
    text-decoration: underline;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    font-weight: 600;
}

.detail-doc-url:hover {
    color: #022038;
}

.detail-doc-filename {
    margin-top: 8px;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 600;
    word-break: break-word;
}

.detail-download-link:hover {
    background: linear-gradient(135deg, #c68a18 0%, #a88423 48%, #946011 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(136, 84, 8, 0.28);
}

/* === Fetch Timestamp === */
.fetch-timestamp {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
    padding: 2px 10px;
    background: var(--gray-100);
    border-radius: 100px;
    white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .subtitle {
        margin-left: 0;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        padding: 12px 16px 16px;
    }

    .filter-row-primary {
        grid-template-columns: 1fr;
    }

    .filter-row-secondary {
        grid-template-columns: 1fr 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal {
        max-height: 95vh;
    }
}

/* === Local Tender Styles === */
.card-source {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-light);
    border-radius: 100px;
    white-space: nowrap;
    margin-left: auto;
}

.bookmark-btn {
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-500);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bookmark-btn:hover {
    border-color: #f0b429;
    color: #8a5a00;
    background: #fff9e8;
}

.bookmark-btn.active {
    border-color: #f0b429;
    color: #8a5a00;
    background: #fff3d6;
}

.source-info {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 2px;
}

.contact-info {
    font-size: 0.7rem;
    color: var(--gray-600);
    font-weight: 500;
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

@media (max-width: 480px) {
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-meta {
        grid-template-columns: 1fr;
    }
}

/* === KYZ Vhavenda Theme Overrides === */
:root {
    --primary: #c39a45;
    --primary-hover: #a88339;
    --primary-light: #fbf4e2;
    --primary-subtle: rgba(195, 154, 69, 0.2);
    --success: #3f6a5b;
    --warning: #b79242;
    --danger: #8f2f1b;
    --gray-50: #f6f2e9;
    --gray-100: #ede4d3;
    --gray-200: #dccbae;
    --gray-300: #bfa885;
    --gray-400: #937c63;
    --gray-500: #735c47;
    --gray-600: #5f4a39;
    --gray-700: #4a382b;
    --gray-800: #33251d;
    --gray-900: #231812;
}

body {
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    background: #8a7536;
}

.header {
    background: #ffffff;
    color: var(--gray-800);
    border-bottom: 2px solid #e8d5ac;
    box-shadow: 0 6px 20px rgba(109, 84, 37, 0.12);
}

.header::before {
    background: radial-gradient(circle, rgba(195, 154, 69, 0.2) 0%, transparent 70%);
}

.subtitle {
    color: #7f6330;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.login-overlay {
    background: #8a7536;
}

.brand-logo {
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: #ffffff;
}

.brand-logo-login {
    width: 212px;
    height: 212px;
    margin: 0 auto 14px;
}

.brand-logo-signin {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.brand-logo-header {
    width: 120px;
    height: 120px;
}

.logo h1 {
    color: #5a4517;
    background: none;
    -webkit-text-fill-color: initial;
    font-family: "Book Antiqua", "Palatino Linotype", Georgia, serif;
    font-size: 2.15rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 #f5e7c3, 0 -1px 0 #4b3a14, 1px 2px 0 rgba(75, 58, 20, 0.18);
}

.login-header h2 {
    color: #5a4517;
    font-family: "Book Antiqua", "Palatino Linotype", Georgia, serif;
    font-size: 1.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 #f5e7c3, 0 -1px 0 #4b3a14, 1px 2px 0 rgba(75, 58, 20, 0.15);
}

.logo {
    gap: 16px;
}

.btn-logout {
    background: linear-gradient(180deg, #fff9ea 0%, #f3e2b5 100%);
    color: #6d521f;
    border-color: #c39a45;
    box-shadow: 0 4px 12px rgba(99, 75, 26, 0.12);
    font-weight: 700;
}

.btn-logout:hover {
    background: linear-gradient(180deg, #fff1cb 0%, #e9cf89 100%);
    color: #4d3a17;
    border-color: #c39a45;
}

.ot-market-tabs {
    justify-content: flex-start;
    padding: 14px 24px 10px;
    background: linear-gradient(180deg, #f2e9d8 0%, #f7f2e8 100%);
}

.ot-market-tab {
    cursor: default;
    color: var(--gray-700);
    border-bottom: 3px solid transparent;
    font-weight: 700;
}

.ot-market-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.filter-panel {
    background: #f8f3e6;
    border: 1px solid #d4bf8a;
    box-shadow: 0 12px 34px rgba(61, 46, 17, 0.16);
    overflow: visible;
}

.filter-header {
    background: #f2e7cf;
    border-bottom-color: #d9c69a;
}

.filter-header h2 {
    color: #6d521f;
    font-size: 1.08rem;
    letter-spacing: 0.02em;
}

.ot-market-tabs {
    border-bottom-color: #d9c69a;
    text-shadow: 0 1px 0 #fff7de, 0 -1px 0 #5a4517, 1px 2px 0 rgba(75, 58, 20, 0.12);
}

.ot-market-tab {
    color: #6d521f;
}

.ot-filter-form {
    gap: 18px;
    text-shadow: 0 1px 0 #fff7de, 0 -1px 0 #5a4517, 1px 2px 0 rgba(75, 58, 20, 0.1);
}

.ot-filter-block h3,
.ot-keyword-group label,
.ot-keyword-mode-group label,
.ot-status-group label {
    color: #5a4517;
}

.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select,
.ot-multi-trigger {
    font-family: "Book Antiqua", "Palatino Linotype", Georgia, serif;
}

.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select {
    color: #2f2413;
    border-color: #d8c28f;
    background: #fffdf8;
}

.ot-keyword-group input:hover,
.ot-keyword-mode-group select:hover,
.ot-status-group select:hover,
.ot-multi-trigger:hover,
.ot-multi-trigger[aria-expanded="true"] {
    border-color: #c39a45;
    box-shadow: 0 0 0 3px rgba(195, 154, 69, 0.12);
}

.ot-keyword-group input:focus,
.ot-keyword-mode-group select:focus,
.ot-status-group select:focus {
    box-shadow: 0 0 0 3px rgba(195, 154, 69, 0.18);
}
.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select,
.ot-multi-trigger {
    color: #2f2413;
    background: #fffdf7;
}

.ot-keyword-group input::placeholder {
    color: #786641;
}

.ot-multiselect.open {
    z-index: 1200;
}

.ot-multi-menu {
    z-index: 1300;
    max-height: 320px;
    overflow: auto;
    border: 1px solid #cfb984;
    box-shadow: 0 18px 34px rgba(48, 34, 13, 0.28);
}

.ot-multi-options label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid #e3d3ad;
    background: #fffaf0;
    border-radius: 10px;
    padding: 9px 10px 9px 38px;
    font-size: 0.86rem;
    color: #3f2f15;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
}

.ot-multi-options label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ot-multi-options label::before {
    content: '';
    position: absolute;
    left: 11px;
    width: 16px;
    height: 16px;
    border: 1px solid #c4ae79;
    border-radius: 5px;
    background: #fff;
}

.ot-multi-options label:hover {
    border-color: #c39a45;
    background: #fbf1dc;
}

.ot-multi-options label:has(input:checked) {
    border-color: #c39a45;
    background: #f3e2bb;
    color: #33240d;
    box-shadow: inset 0 0 0 1px rgba(195, 154, 69, 0.18);
}

.ot-multi-options label:has(input:checked)::before {
    content: '✓';
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    border-color: #b98f3f;
    background: #c39a45;
}

.ot-multi-options label:first-child {
    font-weight: 700;
    border-style: dashed;
}

.filter-header h2,
.results-info h3,
.card-source,
.source-info {
    color: #b3862b;
}

.ot-filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ot-filter-block h3 {
    color: #65411c;
    font-size: 0.82rem;
    letter-spacing: 0.09em;
}

.ot-multiselect {
    position: relative;
}

.ot-multi-trigger {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ot-multi-trigger:hover,
.ot-multi-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.ot-multi-caret {
    color: var(--primary);
    font-size: 0.85rem;
}

.ot-multi-menu {
    display: none;
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: var(--shadow-xl);
    max-height: 260px;
    overflow: hidden;
}

.ot-multiselect.open .ot-multi-menu {
    display: block;
}

.ot-multi-options {
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ot-multi-options-two-col {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
}

.ot-multi-options-two-col > label:first-child {
    grid-column: 1 / -1;
}

.ot-multi-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    border-radius: 8px;
    font-size: 0.86rem;
    color: var(--gray-700);
}

.ot-multi-options label:hover {
    background: #fbf1e7;
}

.ot-multi-options label:first-child {
    font-weight: 700;
    color: #8a6726;
    border-bottom: 1px dashed var(--gray-200);
    padding-bottom: 8px;
    margin-bottom: 2px;
}

.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select {
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: #fffdfa;
    box-shadow: var(--shadow);
}

.ot-keyword-group input:focus,
.ot-keyword-mode-group select:focus,
.ot-status-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.ot-action-row .btn-primary {
    background: linear-gradient(135deg, #c39a45 0%, #dfbe75 100%);
    border-color: #b98f3f;
    color: #3f2e12;
}

.ot-action-row .btn-secondary {
    background: #fff;
    border-color: var(--gray-300);
}

@media (max-width: 900px) {
    .ot-filter-grid,
    .ot-keyword-row,
    .ot-multi-options-two-col {
        grid-template-columns: 1fr;
    }

    .brand-logo-login {
        width: 164px;
        height: 164px;
    }

    .brand-logo-header {
        width: 132px;
        height: 132px;
    }

    .logo h1 {
        font-size: 1.62rem;
    }
}

/* === Final Filter UX Overrides === */
.filter-panel {
    overflow: visible !important;
}

.ot-multiselect {
    position: relative;
    z-index: 20;
}

.ot-multiselect.open {
    z-index: 2200;
}

.ot-multi-menu {
    z-index: 2300 !important;
    overflow: auto !important;
    max-height: 320px !important;
}

.ot-multi-options label {
    position: relative;
    display: block;
    cursor: pointer;
    border: 1px solid #ddc89a;
    background: #fffaf0;
    border-radius: 10px;
    padding: 10px 34px 10px 12px !important;
    font-size: 0.9rem;
    color: #2f2413 !important;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
}

.ot-multi-options label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ot-multi-options label::before {
    content: none !important;
}

.ot-multi-options label::after {
    content: '';
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid #c8b280;
    background: #fff;
}

.ot-multi-options label:hover {
    border-color: #c39a45;
    background: #fbf0d7;
}

.ot-multi-options label:has(input:checked) {
    border-color: #c39a45;
    background: #f1ddb0;
    color: #2e200c;
    box-shadow: inset 0 0 0 1px rgba(195, 154, 69, 0.2);
}

.ot-multi-options label:has(input:checked)::after {
    content: '✓';
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    border-color: #b98f3f;
    background: #c39a45;
}

.ot-multi-options label:first-child {
    font-weight: 700;
    border-style: dashed;
}

.results-bar {
    background: #f8f3e6;
    border: 1px solid #d4bf8a;
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 6px 20px rgba(61, 46, 17, 0.12);
}

.results-summary {
    color: #4b3820;
    font-weight: 600;
}

.fetch-timestamp {
    background: #fff;
    color: #5c4623;
    border: 1px solid #d4bf8a;
}

.filter-tag {
    background: #fff;
    color: #6f531f;
    border-color: #d4bf8a;
}

.filter-tag button {
    color: #8a6726;
}

/* === Final KYZ Logo Palette === */
:root {
    --kyz-teal: #19576e;
    --kyz-navy: #022038;
    --kyz-gold: #98761d;
    --kyz-gold-dark: #885408;
}

body {
    background: #022038;
}

.header {
    background: #ffffff;
    border-bottom: 2px solid rgba(152, 118, 29, 0.55);
}

.logo h1,
.login-header h2 {
    color: var(--kyz-teal);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 -1px 0 rgba(2, 32, 56, 0.18);
}

.subtitle {
    color: var(--kyz-teal);
}

.btn-logout {
}

.btn-logout:hover {
}

.filter-panel {
    background: #f8f5ee;
    border-color: rgba(152, 118, 29, 0.48);
}

.filter-header {
    background: #f2ece0;
    border-bottom-color: rgba(152, 118, 29, 0.34);
}

.filter-header h2,
.ot-filter-block h3,
.ot-keyword-group label,
.ot-keyword-mode-group label,
.ot-status-group label {
    color: var(--kyz-gold-dark);
}

.ot-market-tab {
    color: var(--kyz-gold-dark);
}

.ot-market-tab.active {
    color: var(--kyz-gold);
    border-bottom-color: var(--kyz-gold);
}

.ot-multi-trigger,
.ot-keyword-group input,
.ot-keyword-mode-group select,
.ot-status-group select {
    color: #1e2e3a;
    border-color: rgba(152, 118, 29, 0.42);
    background: #fffdf8;
}

.ot-multi-trigger:hover,
.ot-multi-trigger[aria-expanded="true"],
.ot-keyword-group input:hover,
.ot-keyword-mode-group select:hover,
.ot-status-group select:hover {
    border-color: var(--kyz-gold);
}

.ot-multi-options label {
    border-color: rgba(152, 118, 29, 0.34);
    background: #fffaf0;
    color: #2a3a45;
}

.ot-multi-options label:hover {
    background: #f9edd0;
    border-color: var(--kyz-gold);
}

.ot-multi-options label:has(input:checked) {
    background: #efddaf;
    border-color: var(--kyz-gold);
    color: #1f3140;
}

.ot-multi-options label:has(input:checked)::after {
    background: var(--kyz-gold);
    border-color: var(--kyz-gold-dark);
}

.ot-action-row .btn-primary {
    background: linear-gradient(135deg, var(--kyz-gold) 0%, #b89539 100%);
    border-color: var(--kyz-gold-dark);
    color: #1f1a0e;
}

.ot-action-row .btn-secondary {
    color: var(--kyz-navy);
    border-color: rgba(152, 118, 29, 0.42);
}

.results-bar {
    background: #f5f0e3;
    border-color: rgba(152, 118, 29, 0.4);
}

.results-summary,
.fetch-timestamp,
.filter-tag {
    color: var(--kyz-navy);
}

/* === Results Visibility Lock === */
.results-bar {
    background: #f8f4ea !important;
    border: 1px solid rgba(152, 118, 29, 0.5) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 16px rgba(2, 32, 56, 0.08) !important;
    padding: 10px 14px !important;
}

.results-summary {
    color: #022038 !important;
    font-weight: 700 !important;
}

.fetch-timestamp {
    background: #ffffff !important;
    color: #022038 !important;
    border: 1px solid rgba(152, 118, 29, 0.45) !important;
}

.filter-tag {
    background: #ffffff !important;
    color: #022038 !important;
    border: 1px solid rgba(152, 118, 29, 0.45) !important;
    font-weight: 700 !important;
}

.filter-tag button {
    color: #98761d !important;
    opacity: 0.9 !important;
}

/* === Bookmarks Popup === */
.btn-bookmarks {
    background: linear-gradient(180deg, #f3fbff 0%, #d5eaf3 100%);
    color: #19576e;
    border-color: rgba(25, 87, 110, 0.45);
    box-shadow: 0 3px 10px rgba(2, 32, 56, 0.08);
    font-weight: 700;
}

.btn-bookmarks:hover {
    background: linear-gradient(180deg, #e8f7ff 0%, #c2dfec 100%);
    border-color: #19576e;
    color: #022038;
}

.bookmarks-modal {
    max-width: 820px;
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bookmark-item {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fffdf8;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.bookmark-item-main {
    min-width: 0;
}

.bookmark-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #022038;
    margin-bottom: 5px;
}

.bookmark-item-meta {
    font-size: 0.8rem;
    color: #5f4a39;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bookmark-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bookmark-stage {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid #d8c28f;
    background: #f8f3e6;
    color: #885408;
    white-space: nowrap;
}

.bookmark-stage.closed {
    border-color: #c8a7a0;
    background: #f9efed;
    color: #7a2e22;
}

.bookmark-remove-btn {
    border: 1px solid #d8b56d;
    background: #fff;
    color: #885408;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.bookmark-remove-btn:hover {
    background: #fff2d4;
    border-color: #c39a45;
}

.bookmarks-empty {
    text-align: center;
    color: #5f4a39;
    font-size: 0.92rem;
    padding: 20px;
    background: #fffdf8;
    border: 1px dashed #d8c28f;
    border-radius: 12px;
}

/* === Final Bookmark + Summary Polish === */
.btn-bookmarks {
}

.btn-bookmarks svg {
}

.btn-bookmarks:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(2, 32, 56, 0.18) !important;
}

.btn-bookmarks.has-items {
    border-color: rgba(152, 118, 29, 0.85) !important;
}

.btn-bookmarks-text {
    font-weight: 800;
    letter-spacing: 0.01em;
}

.btn-bookmarks-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--kyz-navy);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.bookmarks-modal {
    border-radius: 16px;
    border: 1px solid rgba(136, 84, 8, 0.38);
    overflow: hidden;
}

.bookmarks-modal .bookmarks-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.bookmarks-modal .modal-header {
    background: linear-gradient(135deg, rgba(2, 32, 56, 0.97) 0%, rgba(25, 87, 110, 0.95) 100%);
    border-bottom: 1px solid rgba(152, 118, 29, 0.6);
}

.bookmarks-modal .modal-header h2 {
    color: #f7eed9;
    letter-spacing: 0.02em;
}

.bookmarks-modal .modal-body {
    background: radial-gradient(circle at 0% 0%, rgba(255, 250, 240, 0.95), rgba(244, 235, 215, 0.95));
}

.bookmark-item {
    border: 1px solid rgba(152, 118, 29, 0.26);
    border-left: 4px solid var(--kyz-teal);
    border-radius: 14px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8eb 100%);
    box-shadow: 0 5px 12px rgba(2, 32, 56, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bookmarks-modal .bookmark-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px !important;
}

.bookmark-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(2, 32, 56, 0.1);
}

.bookmark-item-title {
    color: var(--kyz-navy);
    font-size: 0.98rem;
}

.bookmark-item-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px;
}

.bookmark-item-meta span {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(152, 118, 29, 0.2);
    border-radius: 999px;
    padding: 3px 8px;
}

.bookmark-stage {
    background: rgba(25, 87, 110, 0.12);
    border-color: rgba(25, 87, 110, 0.35);
    color: #19576e;
    font-weight: 800;
}

.bookmark-stage.closed {
    border-color: rgba(122, 46, 34, 0.4);
    background: rgba(122, 46, 34, 0.12);
    color: #7a2e22;
}

.bookmark-remove-btn {
    border: 1px solid rgba(152, 118, 29, 0.6);
    background: linear-gradient(180deg, #fffaf0 0%, #f7e4bd 100%);
    color: var(--kyz-gold-dark);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.bookmark-remove-btn:hover {
    background: linear-gradient(180deg, #fff2d6 0%, #eecf8f 100%);
}

.bookmark-open-btn {
    border: 1px solid rgba(25, 87, 110, 0.55);
    background: linear-gradient(180deg, #eef9fc 0%, #cfe7ef 100%);
    color: var(--kyz-navy);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.bookmark-open-btn:hover {
    background: linear-gradient(180deg, #dff2f8 0%, #bedce8 100%);
}

.bookmark-open-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.results-summary {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(2, 32, 56, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 240, 227, 0.98) 100%);
    color: var(--kyz-navy) !important;
}

.results-summary .rs-label {
    color: #34566b;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.results-summary .rs-range,
.results-summary .rs-total {
    color: #022038;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* === Header Wordmark Emboss === */
.header .logo .kyz-wordmark {
    position: relative;
    display: inline-block;
    font-family: "Book Antiqua", "Palatino Linotype", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.04;
    color: transparent !important;
    background-image:
        linear-gradient(180deg, #fff6d9 0%, #ecd089 16%, #c79a37 34%, #8d6718 58%, #f3dda3 76%, #6f4f10 100%),
        repeating-linear-gradient(135deg, rgba(255, 247, 219, 0.22) 0 6px, rgba(129, 92, 18, 0.12) 6px 12px),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 2px, rgba(123, 89, 19, 0.06) 2px 4px);
    background-size: 100% 100%, 240px 240px, 140px 140px;
    background-position: center center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 249, 229, 0.98),
        0 2px 0 rgba(219, 187, 101, 0.72),
        0 3px 0 rgba(105, 74, 14, 0.28),
        1px 4px 8px rgba(2, 32, 56, 0.16);
    filter: drop-shadow(0 1px 0 rgba(255, 243, 205, 0.95)) drop-shadow(0 3px 5px rgba(2, 32, 56, 0.1));
}

.header .logo .kyz-wordmark::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: transparent;
    background-image:
        radial-gradient(circle at 18% 22%, rgba(255, 248, 222, 0.92) 0, rgba(255, 248, 222, 0) 28%),
        radial-gradient(circle at 74% 36%, rgba(255, 232, 166, 0.38) 0, rgba(255, 232, 166, 0) 34%),
        repeating-linear-gradient(90deg, rgba(107, 77, 17, 0.16) 0 1px, rgba(255, 247, 217, 0.08) 1px 5px),
        repeating-linear-gradient(0deg, rgba(255, 246, 215, 0.1) 0 3px, rgba(113, 81, 18, 0.08) 3px 6px);
    background-size: 100% 100%, 100% 100%, 190px 190px, 150px 150px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.72;
    pointer-events: none;
}

.login-header h2 {
    color: #5a4517;
    text-shadow: 0 1px 0 #f5e7c3, 0 -1px 0 #4b3a14, 1px 2px 0 rgba(75, 58, 20, 0.15);
}

@media (max-width: 860px) {
    .bookmark-item {
        flex-direction: column;
        gap: 10px;
    }

    .bookmark-item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .results-summary {
        flex-wrap: wrap;
        border-radius: 12px;
    }

    .header .logo .kyz-wordmark {
        font-size: 1.72rem;
    }
}

/* === Final Responsive Layout Polish === */
@media (max-width: 1024px) {
    .header-content {
        gap: 12px;
        align-items: center;
    }

    .subtitle {
        margin-left: 0;
        flex: 1 1 240px;
        min-width: 220px;
    }

    .brand-logo-header {
        width: 156px;
        height: 156px;
    }

    .btn-bookmarks,
    .btn-logout {
        padding: 8px 12px;
    }

    .results-bar {
        gap: 10px;
    }

    .results-summary {
        max-width: 100%;
    }

    .modal,
    .bookmarks-modal {
        width: min(92vw, 820px);
    }
}

@media (max-width: 768px) {
    .header-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 10px;
    }

    .logo {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        gap: 0;
    }

    .brand-logo-header {
        width: 132px;
        height: 132px;
    }

    .subtitle {
        grid-column: 1 / -1;
        width: 100%;
        text-align: center;
        font-size: 0.82rem;
        line-height: 1.35;
        min-width: 0;
    }

    .btn-bookmarks {
        justify-content: center;
    }

    .filter-panel {
        border-radius: 16px;
    }

    .ot-market-tabs,
    .filter-header,
    .filter-form {
        padding-left: 14px;
        padding-right: 14px;
    }

    .filter-actions,
    .filter-actions-btns,
    .ot-action-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn,
    .filter-actions-btns .btn,
    .ot-action-row .btn-primary,
    .ot-action-row .btn-secondary,
    .ot-more-options {
        width: 100%;
        justify-content: center;
    }

    .results-bar {
        align-items: stretch !important;
    }

    .results-summary,
    .fetch-timestamp,
    .source-status-notice {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .active-filters {
        width: 100%;
    }

    .modal-overlay {
        padding: 12px;
    }

    .modal,
    .bookmarks-modal {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .modal-header,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bookmark-item-meta span {
        width: 100%;
        border-radius: 10px;
    }

    .bookmark-item-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .bookmark-open-btn,
    .bookmark-remove-btn,
    .bookmark-stage {
        flex: 1 1 calc(50% - 5px);
        justify-content: center;
        text-align: center;
    }

    .empty-state {
        padding: 40px 10px;
    }

    .empty-state-card {
        padding: 24px 16px;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    .empty-state p {
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-content {
        grid-template-columns: 1fr;
    }

    .brand-logo-header {
        width: 112px;
        height: 112px;
    }

    .btn-bookmarks,
    .btn-logout {
        font-size: 0.8rem;
        padding: 9px 10px !important;
    }

    .btn-bookmarks-count {
        min-width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .ot-market-tabs,
    .filter-header,
    .filter-form,
    .results-bar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .modal-header h2 {
        font-size: 1.05rem;
    }

    .bookmark-open-btn,
    .bookmark-remove-btn,
    .bookmark-stage {
        flex-basis: 100%;
    }

    .empty-state-icon-wrap {
        width: 88px;
        height: 88px;
    }

    .empty-state-hints span {
        width: 100%;
        border-radius: 10px;
        justify-content: flex-start;
        padding: 8px 10px;
    }
}

/* === Final Header Menu + Social + Logo Size === */
.header {
    position: relative;
    top: auto;
    z-index: 2400;
    padding: 8px 0 6px;
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.header .container {
    padding-top: 56px;
}

.brand-logo-header {
    width: 108px !important;
    height: 108px !important;
}

.header-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: min(96vw, 1600px);
    z-index: 2700;
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 14px;
    border: 1px solid rgba(152, 118, 29, 0.22);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(2, 32, 56, 0.08);
}

.header-content {
    gap: 10px;
    row-gap: 4px;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
}

.header-menu-link {
    position: relative;
    text-decoration: none;
    color: #1d4f69;
    font-size: 0.81rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 6px 10px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.header-menu-link::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 3px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #19576e 0%, #98761d 100%);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.header-menu-link:hover,
.header-menu-link.is-active {
    color: #022038;
    border-color: rgba(25, 87, 110, 0.45);
    background: #ffffff;
}

.header-menu-link:hover::after,
.header-menu-link.is-active::after {
    transform: scaleX(1);
}

.header-social {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-social-link {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(25, 87, 110, 0.3);
    background: #ffffff;
    color: #17435c;
}

.header-social-link:hover {
    border-color: #19576e;
    color: #022038;
    background: rgba(207, 231, 240, 0.9);
    box-shadow: 0 3px 8px rgba(2, 32, 56, 0.12);
}

/* === Header Contact Info === */
.header-contact {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.header-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1d4f69;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.01em;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.header-contact-item svg {
    color: #98761d;
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.header-contact-item:hover {
    color: #022038;
}

.header-contact-item:hover svg {
    color: #7a6018;
}

.header-contact-divider {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: rgba(25, 87, 110, 0.22);
    border-radius: 1px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .header-content {
        row-gap: 10px;
    }
}

@media (max-width: 768px) {
    .header .container {
        padding-top: 18px;
    }

    .brand-logo-header {
        width: 92px !important;
        height: 92px !important;
    }

    .header-topbar {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .header-menu {
        justify-content: center;
        width: 100%;
    }

    .header-menu-link {
        font-size: 0.72rem;
        padding: 6px 10px;
    }

    .header-social {
        justify-content: center;
        width: 100%;
    }

    .header-contact {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header .container {
        padding-top: 16px;
    }

    .brand-logo-header {
        width: 82px !important;
        height: 82px !important;
    }

    .header-menu {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .header-menu-link {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .header {
        position: relative;
    }

    .header-topbar {
        width: 100%;
    }
}
`n/* === Bookmarks and Plan Controls === */

/* Bookmark WhatsApp Button - Icon Only */
.bookmark-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.bookmark-whatsapp-btn:hover {
    background: #1fac51;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.bookmark-whatsapp-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.2);
}

.bookmark-whatsapp-btn.loading {
    opacity: 0.7;
    animation: whatsapp-pulse 1s ease-in-out infinite;
}

@keyframes whatsapp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bookmark-whatsapp-btn svg {
    width: 18px;
    height: 18px;
}

/* Plan Button Styling */
.plan-btn {
    transition: var(--transition);
}

.plan-btn.is-selected {
    opacity: 0.7;
    cursor: default;
}

.plan-btn.is-selected:hover {
    opacity: 0.7;
}

/* Bookmark Item Actions Responsive */
.bookmark-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .bookmark-whatsapp-btn {
        width: 32px;
        height: 32px;
    }
    
    .bookmark-item-actions {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .bookmark-whatsapp-btn {
        width: 32px;
        height: 32px;
    }
    
    .bookmark-whatsapp-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Premium Search & Filter Panel Layout */
.filter-panel {
    background: #ffffff !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 24px !important;
}

.filter-panel select,
.filter-panel input {
    background-color: #ffffff !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 8px !important;
    font-family: 'Outfit', sans-serif !important;
    color: var(--gray-800) !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    text-shadow: none !important;
}

.filter-panel select:focus,
.filter-panel input:focus {
    border-color: #98761d !important;
    box-shadow: 0 0 0 3px rgba(152, 118, 29, 0.12) !important;
}

#searchBtn:hover {
    background-color: #7a6018 !important;
}

#clearFiltersLink:hover {
    color: #7a6018 !important;
    text-decoration: underline !important;
}

/* Responsive grid for search filters */
@media (max-width: 768px) {
    .filter-columns-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .search-bar-row {
        flex-direction: column !important;
    }
    #searchBtn {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px !important;
    }
}

/* === Sticky Filter Topbar Styling === */
.header-topbar.is-sticky-active {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px rgba(2, 32, 56, 0.12);
    border-color: rgba(152, 118, 29, 0.35);
}

.header-topbar-filters select {
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header-topbar-filters select:focus {
    border-color: #98761d !important;
    box-shadow: 0 0 0 2px rgba(152, 118, 29, 0.12) !important;
}

.header-topbar-filters input:focus {
    border-color: #98761d !important;
    box-shadow: 0 0 0 2px rgba(152, 118, 29, 0.12) !important;
}

@media (max-width: 992px) {
    .sticky-logo-wrap .topbar-logo-text {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .sticky-select-wrap {
        display: none !important;
    }
    .header-topbar-filters {
        gap: 6px !important;
    }
}

.header-control-link:hover {
    color: #98761d !important;
}

/* === Header Action Buttons === */
.header-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modern clean nav buttons for white header */
.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 15px;
    background: transparent;
    border: 1px solid rgba(25, 87, 110, 0.28);
    border-radius: 8px;
    color: #1d4f69;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Outfit', 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1;
}

.header-action-btn svg {
    color: #19576e;
    flex-shrink: 0;
    transition: color 0.18s ease, transform 0.18s ease;
}

.header-action-btn:hover {
    background: rgba(25, 87, 110, 0.07);
    border-color: #19576e;
    color: #022038;
    box-shadow: 0 2px 8px rgba(2, 32, 56, 0.08);
    text-decoration: none;
    transform: translateY(-1px);
}

.header-action-btn:hover svg {
    color: #022038;
    transform: translateY(-1px);
}

/* Sign In — hero CTA style */
.header-action-btn.btn-signin {
    background: var(--primary);
    border-color: var(--primary);
    color: #1f1a0e;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(152, 118, 29, 0.30), inset 0 1px 0 rgba(255,255,255,0.15);
    padding: 10px 18px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.header-action-btn.btn-signin svg {
    color: #1f1a0e;
    opacity: 0.96;
}

.header-action-btn.btn-signin:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(152, 118, 29, 0.38), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
    text-decoration: none;
}

.header-action-btn.btn-signin:hover svg {
    color: #1f1a0e;
    opacity: 1;
    transform: translateY(-1px);
}

.header-action-btn.btn-signin span {
    white-space: nowrap;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-800);
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
}

@media (max-width: 820px) {
    .header {
        overflow: visible;
    }
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .header-action-group {
        display: none !important;
        position: absolute;
        top: 100%;
        right: 20px;
        background: #fff;
        padding: 16px;
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        flex-direction: column;
        gap: 12px;
        z-index: 1000;
        min-width: 200px;
        border: 1px solid var(--gray-200);
    }
    .header-action-group.is-open {
        display: flex !important;
    }
    .header-action-group .btn {
        width: 100%;
        justify-content: flex-start;
    }
    .profile-label {
        display: none;
    }
    .profile-section {
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.85rem;
    }
}

@media (max-width: 560px) {
    .header-action-btn.btn-signin span {
        display: none;
    }
}

/* === Back to Top Button === */
.back-to-top-btn {
    position: fixed;
    bottom: 32px;
    right: 28px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a88020 0%, #98761d 50%, #7a6018 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(152, 118, 29, 0.45),
        0 1px 4px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.88);
    transition:
        opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0.28s,
        box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top-btn svg {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.back-to-top-btn:hover {
    background: linear-gradient(135deg, #b89030 0%, #a88020 50%, #886818 100%);
    box-shadow:
        0 8px 24px rgba(152, 118, 29, 0.55),
        0 2px 8px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transform: translateY(-3px) scale(1.06);
}

.back-to-top-btn:hover svg {
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow:
        0 2px 8px rgba(152, 118, 29, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

@media (max-width: 600px) {
    .back-to-top-btn {
        bottom: 20px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}
