:root {
    --bs-body-font-family: 'Comfortaa', cursive;
    --color-primary: #074d31;
    --color-primary-light: #1b8354;
    --color-primary-rgb: 7, 77, 49;
    --color-accent: #d3b98c;
    --color-accent-rgb: 211, 185, 140;
    --color-danger: #ff4d4f;
    --color-success: #52c41a;
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-text-muted: rgba(0, 0, 0, 0.45);
    --color-text-dim: rgba(0, 0, 0, 0.35);
    --color-text-faint: rgba(0, 0, 0, 0.30);
    --color-text-hint: rgba(0, 0, 0, 0.25);
    --color-star: #f5b301;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-btn: rgba(0, 0, 0, 0.15);
    --color-spinner-track: rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --transition-base: 0.3s ease;
    --transition-smooth: 0.2s ease;
}

[data-theme="dark"] {
    --color-primary: #2fad73;
    --color-primary-light: #45c988;
    --color-primary-rgb: 47, 173, 115;
    --color-accent: #c49b60;
    --color-accent-rgb: 196, 155, 96;
    --color-bg: #121e17;
    --color-surface: #1c2c23;
    --color-text: #dce5e0;
    --color-text-muted: rgba(220, 229, 224, 0.5);
    --color-text-dim: rgba(220, 229, 224, 0.42);
    --color-text-faint: rgba(220, 229, 224, 0.35);
    --color-text-hint: rgba(220, 229, 224, 0.28);
    --color-star: #f5c842;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-btn: rgba(255, 255, 255, 0.15);
    --color-spinner-track: rgba(255, 255, 255, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

*::-webkit-scrollbar { width: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

html { height: 100%; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    font-weight: bold;
    color: var(--color-text);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light), var(--color-accent));
    z-index: 1030;
}

.navbar-main {
    background: var(--color-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 0.25rem 0;
    position: sticky;
    top: 4px;
    z-index: 1020;
    width: 100%;
    flex-shrink: 0;
}

.navbar-brand-custom {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--color-text) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand-custom .brand-dot {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link-custom {
    font-size: 0.85rem;
    color: var(--color-text-muted) !important;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    transition: all var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nav-link-custom:hover { color: var(--color-primary) !important; background: rgba(var(--color-primary-rgb), 0.06); }
.nav-link-custom.active { color: var(--color-primary) !important; font-weight: 800; }

.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-smooth);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }

#authArea {
    margin-left: 8px;
    height: 28px;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-text);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logoutBtn {
    margin-left: 2px;
}

.app {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px 48px;
    flex: 1;
}

.page { }

#title {
    font-size: 36px;
    background: linear-gradient(to left, var(--color-primary), var(--color-primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 500% 500%;
    animation: Gradient 20s ease infinite;
    text-align: center;
    position: relative;
}
#title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    margin: 8px auto 0;
}
#title .brand-dot { -webkit-text-fill-color: var(--color-primary-light); }

.subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
    font-weight: normal;
    text-align: center;
    line-height: 1.8;
    margin: 0;
}
.subtitle-soft { font-size: 12px; color: var(--color-text-dim); }

.btn_one, .btn_two, label.btn_one {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-primary);
    font-size: 14px;
    font-family: 'Comfortaa', cursive;
    font-weight: bold;
    transition: var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-align: center;
    min-height: 40px;
}
.btn_one, label.btn_one { color: var(--color-primary); background: transparent; }
.btn_one:hover, label.btn_one:hover { background: var(--color-primary); color: #fff; }
.btn_one:disabled, label.btn_one:disabled { opacity: 0.35; cursor: default; }
.btn_two { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.btn_two:hover { background: transparent; color: var(--color-primary); }
.btn_two:disabled { opacity: 0.35; cursor: default; }

.btn_small {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-btn);
    background: transparent;
    color: var(--color-text-muted);
    font-family: 'Comfortaa', cursive;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    transition: var(--transition-base);
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn_small:hover { color: var(--color-primary); border-color: var(--color-primary); }
.btn_small:disabled { opacity: 0.3; cursor: default; }

button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.input-group-section {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bin-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    font-family: 'Comfortaa', cursive;
    font-size: 16px;
    color: var(--color-text);
    resize: vertical;
    line-height: 1.6;
    min-height: 100px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-card);
}
.bin-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}
.bin-textarea::placeholder { color: var(--color-text-faint); font-size: 14px; font-weight: normal; }

.lookup-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.example-hint {
    font-size: 12px;
    font-weight: normal;
    color: var(--color-text-faint);
}

.upload-msg {
    min-height: 18px;
    font-size: 12px;
    font-weight: normal;
    text-align: center;
}
.upload-msg.error { color: #cf1322; }
.upload-msg.info { color: var(--color-text-muted); }

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 10px;
    flex-wrap: wrap;
}
.results-count {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: normal;
}
.results-actions {
    display: flex;
    gap: 8px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 12px;
}
.filter-group { flex: 1; min-width: 140px; }
.filter-select, .filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-family: 'Comfortaa', cursive;
    font-size: 13px;
    font-weight: bold;
    color: var(--color-text);
    transition: border-color var(--transition-smooth);
    -webkit-appearance: none;
    appearance: none;
}
.filter-select { cursor: pointer; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000' stroke-opacity='0.3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; padding-right: 30px; }
.filter-select option {
    padding: 3px 8px;
    font-size: 12px;
    font-weight: normal;
}
.filter-select:focus, .filter-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.06); }
.filter-input::placeholder { color: var(--color-text-hint); font-weight: normal; }

.exclude-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    margin: 8px 0 4px;
    font-size: 11px;
    font-weight: bold;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-smooth);
}
.exclude-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }
.exclude-toggle i { transition: transform var(--transition-smooth); }
.exclude-toggle.expanded i { transform: rotate(180deg); }
.exclude-hidden { display: none; }

.checkbox-dropdown {
    position: relative;
}
.checkbox-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-family: 'Comfortaa', cursive;
    font-size: 13px;
    font-weight: bold;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color var(--transition-smooth);
    text-align: left;
}
.checkbox-dropdown-toggle:focus,
.checkbox-dropdown.open .checkbox-dropdown-toggle {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.06);
}
.checkbox-dropdown-toggle i {
    font-size: 10px;
    transition: transform var(--transition-smooth);
}
.checkbox-dropdown.open .checkbox-dropdown-toggle i {
    transform: rotate(180deg);
}
.checkbox-dropdown-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.checkbox-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
    min-width: 180px;
}
.checkbox-dropdown.open .checkbox-dropdown-menu {
    display: block;
}
.checkbox-dropdown-search {
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border);
}
.checkbox-dropdown-search input {
    width: 100%;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
}
.checkbox-dropdown-search input:focus {
    border-color: var(--color-primary);
}
.checkbox-dropdown-items {
    max-height: 200px;
    overflow-y: auto;
    padding: 2px 0;
}
.checkbox-dropdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background var(--transition-smooth);
}
.checkbox-dropdown-item:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
}
.checkbox-dropdown-item input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: var(--color-primary);
    margin: 0;
}
.checkbox-dropdown-item label {
    flex: 1;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
}

.single-select-dropdown {
    position: relative;
}
.single-select-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-family: 'Comfortaa', cursive;
    font-size: 13px;
    font-weight: bold;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color var(--transition-smooth);
    text-align: left;
}
.single-select-dropdown-toggle:focus,
.single-select-dropdown.open .single-select-dropdown-toggle {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.06);
}
.single-select-dropdown-toggle i {
    font-size: 10px;
    transition: transform var(--transition-smooth);
}
.single-select-dropdown.open .single-select-dropdown-toggle i {
    transform: rotate(180deg);
}
.single-select-dropdown-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.single-select-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
    min-width: 180px;
}
.single-select-dropdown.open .single-select-dropdown-menu {
    display: block;
}
.single-select-dropdown-items {
    max-height: 200px;
    overflow-y: auto;
    padding: 2px 0;
}
.single-select-dropdown-item {
    padding: 3px 8px;
    cursor: pointer;
    transition: background var(--transition-smooth);
    font-size: 12px;
    font-weight: normal;
    color: var(--color-text);
    line-height: 1.3;
}
.single-select-dropdown-item:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
}
.single-select-dropdown-item.selected {
    background: rgba(var(--color-primary-rgb), 0.12);
    font-weight: bold;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    min-height: 8px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: bold;
    cursor: default;
}
.filter-chip .chip-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition-smooth);
}
.filter-chip .chip-remove:hover { opacity: 1; }
.exclude-chip {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.results-table-container {
    margin-top: 8px;
}
.bin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-weight: normal;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
}
.bin-table thead th {
    background: rgba(0, 0, 0, 0.02);
    padding: 10px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}
.bin-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}
.bin-table tbody tr:hover { background: rgba(var(--color-primary-rgb), 0.02); }
.bin-table tbody tr:last-child td { border-bottom: none; }
.bin-table .td-bin { font-family: "Courier New", monospace; font-weight: bold; color: var(--color-primary); }
.bin-table .td-notfound { color: var(--color-text-faint); font-style: italic; }
.bin-table .td-flag { white-space: nowrap; }
.bin-table .td-copy { text-align: center; }

.copy-btn {
    background: none;
    border: 0;
    color: var(--color-text-hint);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    transition: color var(--transition-smooth);
    border-radius: var(--radius-sm);
}
.copy-btn:hover { color: var(--color-primary); }

.bin-table .td-actions { text-align: right; white-space: nowrap; }

.star-btn {
    background: none;
    border: 0;
    color: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 15px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: color var(--transition-smooth), transform 0.1s ease;
}
.star-btn:hover { color: var(--color-star); transform: scale(1.18); }
.star-btn.starred { color: var(--color-star); }
.star-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.bin-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color var(--transition-smooth);
}
.bin-table th.sortable:hover { color: var(--color-primary); }
.bin-table th.sort-active { color: var(--color-primary); }
.bin-table th.sortable .sort-ind { font-size: 0.8em; margin-left: 2px; }
.bin-table th.sortable .sort-ind:empty { display: none; }

.results-cards { display: none; }
@media (max-width: 768px) {
    .results-table-container .table-responsive { display: none; }
    .results-cards { display: flex; flex-direction: column; gap: 10px; }
    .bin-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: 14px;
        box-shadow: var(--shadow-card);
    }
    .bin-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    .bin-card-bin {
        font-family: "Courier New", monospace;
        font-weight: bold;
        color: var(--color-primary);
        font-size: 16px;
    }
    .bin-card-flag { }
    .flag-img { vertical-align: middle; margin-right: 4px; }
    .bin-card-row {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        font-size: 12px;
        font-weight: normal;
        color: rgba(0, 0, 0, 0.6);
    }
    .bin-card-row strong { color: var(--color-text); font-weight: bold; }
    .bin-card-notfound {
        padding: 14px;
        text-align: center;
        color: var(--color-text-dim);
        font-weight: normal;
        font-style: italic;
        border: 1px dashed var(--color-border-btn);
        border-radius: var(--radius-lg);
    }
    .filter-bar { flex-direction: column; }
    .filter-group { min-width: 100%; }
}

.status-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    min-height: 24px;
}
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--color-spinner-track);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rotate 0.6s infinite linear;
}
@keyframes rotate { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--color-text-faint);
    font-weight: normal;
    font-size: 13px;
}

.toast {
    position: fixed;
    top: 60px; left: 50%;
    transform: translate(-50%, -20px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 13px;
    font-weight: normal;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-elevated);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 4px;
}
.page-btn {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: 'Comfortaa', cursive;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-info { font-size: 12px; color: rgba(0, 0, 0, 0.4); font-weight: normal; }

.section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}
.section:hover::before { transform: scaleX(1); }

.section-title {
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}
.endpoint-desc {
    font-size: 13px;
    font-weight: normal;
    color: rgba(0, 0, 0, 0.55);
    margin-bottom: 12px;
}
.code-block {
    background: rgba(0, 0, 0, 0.03);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: normal;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

#footer {
    text-align: center;
    padding: 16px 0 4px;
    font-size: 11px;
    color: var(--color-text-faint);
    flex-shrink: 0;
}
#footer a {
    color: var(--color-text-dim);
    text-decoration: none;
    transition: color var(--transition-smooth);
}
#footer a:hover { color: var(--color-primary); }

@keyframes Gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Touch-friendly tap targets ---- */
@media (pointer: coarse) {
    .star-btn { padding: 6px 10px; font-size: 18px; }
    .copy-btn { padding: 6px 10px; font-size: 16px; }
    .page-btn { padding: 8px 14px; font-size: 13px; min-height: 40px; }
}
@media (max-width: 640px) {
    .navbar-brand-custom { font-size: 0; gap: 0; }
    .navbar-brand-custom i { font-size: 1.3rem; margin-right: 0; }
    .nav-link-custom { font-size: 0; gap: 0; padding: 0.4rem 0.5rem; }
    .nav-link-custom i { font-size: 1.15rem; }
    .nav-link-custom.active { background: rgba(var(--color-primary-rgb), 0.08); }
    .navbar-main .px-3 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .navbar-main .gap-2 { gap: 0.25rem !important; }
    .app { padding: 16px 10px 40px; gap: 14px; }
    #title { font-size: 30px; }
    #title::after { width: 36px; height: 2px; margin-top: 6px; }
    .subtitle { font-size: 13px; line-height: 1.6; }
    .subtitle-soft { display: block; margin-top: 2px; }
    .btn_one, .btn_two { padding: 10px 18px; font-size: 13px; }
    .bin-textarea { font-size: 16px; padding: 12px; min-height: 80px; }
    .input-group-section { max-width: 100%; }
    .lookup-actions { flex-direction: column; }
    .lookup-actions .btn_two { width: 100%; justify-content: center; }
    .section { padding: 16px; }
    .section-title { font-size: 11px; letter-spacing: 1px; }
    .code-block { font-size: 11px; padding: 10px 12px; }
    .results-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; }
    .pagination { flex-wrap: wrap; gap: 4px; }
    .toast { top: 52px; max-width: 92%; }
    #browseFilterBar { flex-direction: column; }
    #browseFilterBar .filter-group { min-width: 100%; }
    #browseFilterBar .btn_one { width: 100%; justify-content: center; }
}
@media (max-width: 400px) {
    .app { padding: 12px 8px 40px; }
    #title { font-size: 26px; }
    .btn_one, .btn_two { padding: 9px 14px; font-size: 12px; }
    .bin-textarea { font-size: 15px; }
    .section { padding: 14px; }
    .bin-card { padding: 12px; }
    .bin-card-row { font-size: 11px; }
}
@media (min-width: 641px) {
    .app { max-width: 640px; padding: 28px 20px 48px; }
    #title { font-size: 40px; }
    .btn_one, .btn_two { padding: 11px 28px; font-size: 15px; }
    .bin-textarea { font-size: 17px; }
}
@media (min-width: 1024px) {
    .app { max-width: 960px; padding: 36px 24px 56px; }
    #title { font-size: 48px; }
    .btn_one, .btn_two { padding: 12px 32px; font-size: 16px; }
    .bin-textarea { font-size: 18px; }
}
@media (min-width: 1400px) {
    .app { max-width: 1100px; padding: 44px 32px 64px; }
}
.brand-logo { width: 28px; height: 18px; vertical-align: -2px; margin-right: 6px; object-fit: contain; }
.brand-logo-lg { width: 36px; height: 22px; }

/* ---- Dark mode overrides for non-variable colors ---- */

[data-theme="dark"] .navbar-main { box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
[data-theme="dark"] .bin-textarea { border-color: var(--color-border); }
[data-theme="dark"] .bin-table thead th { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .bin-table tbody td { border-bottom-color: rgba(255,255,255,0.04); }
[data-theme="dark"] .star-btn { color: rgba(220,229,224,0.28); }
[data-theme="dark"] .bin-card-row { color: rgba(220,229,224,0.6); }
[data-theme="dark"] .bin-card-row strong { color: var(--color-text); }
[data-theme="dark"] .page-info { color: var(--color-text-dim); }
[data-theme="dark"] .page-btn { border-color: var(--color-border); }
[data-theme="dark"] .page-btn:disabled { color: var(--color-text-faint); }
[data-theme="dark"] .section-title { border-bottom-color: var(--color-border); }
[data-theme="dark"] .endpoint-desc { color: rgba(220,229,224,0.6); }
[data-theme="dark"] .code-block { background: rgba(255,255,255,0.04); border-color: var(--color-border); color: rgba(220,229,224,0.7); }
[data-theme="dark"] .filter-select, [data-theme="dark"] .filter-input { border-color: var(--color-border); }
[data-theme="dark"] .filter-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-opacity='0.3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
[data-theme="dark"] .example-hint { color: var(--color-text-faint); }
[data-theme="dark"] .upload-msg.error { color: #ff6b6b; }

.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    #title { animation: none; }
    .section::before { transition: none; }
    .spinner { animation: none !important; }
}
