* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: #111;
    color: #ddd;
    display: flex;
    min-height: 100vh;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 16px;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
}

.modal-text {
    font-size: 0.9rem;
    color: #999;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.secondary {
    background: transparent;
    border: 1px solid #333;
    color: #999;
}

.modal-btn.secondary:hover {
    background: #222;
    color: #fff;
}

.modal-btn.primary {
    background: #4169E1;
    border: none;
    color: #fff;
}

.modal-btn.primary:hover {
    background: #3358c4;
}

.modal-btn.primary.discord {
    background: #5865F2;
}

.modal-btn.primary.discord:hover {
    background: #4752c4;
}

.modal-form label {
    display: block;
    margin: 10px 0 6px;
    font-size: 0.8rem;
    color: #888;
}

.modal-form input {
    width: 100%;
    padding: 10px 12px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
}

.modal-form input:focus {
    border-color: #4169E1;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

body.light .modal-form label {
    color: #666;
}

body.light .modal-form input {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

.example-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    -webkit-text-fill-color: #ddd;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    outline: none;
}

.example-textarea:focus {
    border-color: #4169E1;
}

body.light .example-textarea {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
    -webkit-text-fill-color: #333;
}

/* Light mode modal */
body.light .modal {
    background: #fff;
    border-color: #e0e0e0;
}

body.light .modal-close {
    color: #999;
}

body.light .modal-close:hover {
    color: #333;
}

body.light .modal-title {
    color: #222;
}

body.light .modal-text {
    color: #666;
}

body.light .modal-btn.secondary {
    border-color: #ddd;
    color: #666;
}

body.light .modal-btn.secondary:hover {
    background: #f5f5f5;
    color: #333;
}

/* Sidebar */
.sidebar {
    width: 230px;
    background: #161616;
    padding: 24px 18px;
    border-right: 1px solid #222;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #4169E1;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tagline {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 20px;
}

.search-wrap {
    position: relative;
    margin-bottom: 20px;
}

.search-shortcut {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 600;
    color: #555;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 5px;
    pointer-events: none;
    line-height: 1;
    letter-spacing: 0.5px;
    transition: opacity 0.15s;
}

.search-wrap input:focus ~ .search-shortcut {
    opacity: 0;
}

.sidebar input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 40px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.85rem;
}

.sidebar input:focus {
    outline: none;
    border-color: #4169E1;
}

.regex-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
}

.regex-btn:hover {
    background: #222;
    color: #999;
}

.regex-btn.active {
    background: #4169E1;
    border-color: #4169E1;
    color: #fff;
}

.sidebar input::placeholder {
    color: #555;
}

.sidebar h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 8px;
    margin-top: 16px;
}

#typeFilters,
#addonFilters,
#versionFilters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-stacks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stack-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-group-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #777;
    text-transform: uppercase;
    padding: 2px 4px;
}

body.light .stack-group-title {
    color: #999;
}

.stack {
    border: 1px solid #222;
    border-radius: 10px;
    background: #141414;
    overflow: hidden;
}

.stack.selected {
    border-color: rgba(65, 105, 225, 0.45);
    box-shadow: 0 0 0 1px rgba(65, 105, 225, 0.2) inset;
}

.stack-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    background: transparent;
    border: none;
    color: #ddd;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.stack-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stack-burger {
    width: 16px;
    height: 16px;
    position: relative;
    opacity: 0.85;
}

.stack-burger::before,
.stack-burger::after,
.stack-burger span {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    height: 2px;
    background: #666;
    border-radius: 999px;
    transition: transform 0.2s, top 0.2s, opacity 0.2s;
}

.stack-burger::before { top: 4px; }
.stack-burger span { top: 7px; }
.stack-burger::after { top: 10px; }

.stack.open .stack-burger::before {
    top: 7px;
    transform: rotate(45deg);
}

.stack.open .stack-burger span {
    opacity: 0;
}

.stack.open .stack-burger::after {
    top: 7px;
    transform: rotate(-45deg);
}

.stack-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--cat-color, #4169E1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.stack-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ddd;
}

.stack-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #666;
    background: #101010;
    border: 1px solid #222;
    padding: 2px 8px;
    border-radius: 999px;
}

.stack-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-top: 1px solid #222;
    background: #121212;
}

.stack.open .stack-items {
    max-height: 420px;
}

.stack-items-inner {
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stack-items-inner::-webkit-scrollbar {
    display: none;
}

.stack-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #c9d1d9;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}

.stack-item:hover {
    background: rgba(65, 105, 225, 0.08);
    border-color: rgba(65, 105, 225, 0.25);
}

.stack-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--cat-color, #4169E1);
}

.stack-item-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a5d6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light .stack {
    background: #fff;
    border-color: #e0e0e0;
}

body.light .stack.selected {
    border-color: rgba(65, 105, 225, 0.4);
    box-shadow: 0 0 0 1px rgba(65, 105, 225, 0.12) inset;
}

body.light .stack-items {
    background: #fbfbfb;
    border-top-color: #e0e0e0;
}

body.light .stack-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light .stack-burger::before,
body.light .stack-burger::after,
body.light .stack-burger span {
    background: #999;
}

body.light .stack-title {
    color: #222;
}

body.light .stack-count {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #666;
}

body.light .stack-item-name {
    color: #1e5aa8;
}

.sidebar-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #222;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.35;
    min-height: 1.35em;
}

.filter {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #777;
    transition: all 0.25s ease;
}

.filter:hover {
    background: #1a1a1a;
    color: #ccc;
}

.filter.active {
    background: #4169E1;
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-footer a {
    font-size: 0.8rem;
    color: #4169E1;
    text-decoration: none;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

.footer-reload {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #333;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-reload:hover {
    background: #1a1a1a;
    color: #fff;
}

.footer-reload.loading svg {
    animation: spin 0.8s linear infinite;
}

/* Rate limit indicator */
.rate-limit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: #555;
    text-align: center;
    padding: 4px 0 2px;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.rate-limit.warn {
    color: #d29922;
}

.rate-limit.danger {
    color: #f85149;
}

/* Main */
main {
    flex: 1;
    margin-left: 230px;
    padding: 28px 36px;
    background: #111;
}

.header {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

body.light .top-bar .logo {
    color: #222;
}

body.light .logo-mark {
    filter: invert(0.02) drop-shadow(0 0 4px rgba(0,0,0,0.15));
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #eee;
    margin-bottom: 4px;
}

.entry-count {
    display: inline-block;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 0.3px;
}

.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    border: 1px solid #222;
    background: #141414;
    color: #bbb;
}

.status-pill.muted { color: #999; }
.status-pill.ok { border-color: rgba(63,185,80,0.35); color: #3fb950; }
.status-pill.warn { border-color: rgba(241,196,15,0.35); color: #f1c40f; }
.status-pill.danger { border-color: rgba(248,81,73,0.35); color: #f85149; }

.status-pill[hidden] { display: none; }

.refresh-float {
    position: fixed;
    left: 0;
    top: 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    background: #141414;
    border: 1px solid #222;
    color: #aaa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    z-index: 900;
    pointer-events: none;
}

.refresh-float[hidden] { display: none; }

.header p {
    color: #666;
    font-size: 0.9rem;
}

#count {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 16px;
}

#list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.15s ease;
}

#list.fade-out {
    opacity: 0;
}

#list.fade-in {
    opacity: 1;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: #666;
    font-size: 0.9rem;
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 8px;
    animation: cardFadeIn 0.3s ease forwards;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-results-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 8px;
}

.no-results-text {
    font-size: 0.9rem;
    color: #666;
    max-width: 320px;
    line-height: 1.5;
}

/* Splash */
.splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 72px 24px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.35s ease forwards;
}

.splash::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 300px at 50% 0%, rgba(65, 105, 225, 0.12), transparent),
        radial-gradient(ellipse 500px 280px at 85% 100%, rgba(65, 105, 225, 0.06), transparent);
    pointer-events: none;
}

.splash::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 60px);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
    pointer-events: none;
}

.splash-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #eee;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.splash-bio {
    font-size: 0.82rem;
    color: #777;
    max-width: 440px;
    line-height: 1.65;
    position: relative;
    z-index: 1;
}

.splash-divider {
    width: 40px;
    height: 1px;
    background: #333;
    margin: 18px 0;
    position: relative;
    z-index: 1;
}

.splash-text {
    font-size: 0.82rem;
    color: #666;
    max-width: 400px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.splash-hint {
    margin-top: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #555;
    position: relative;
    z-index: 1;
}

.splash-credit {
    margin-top: 10px;
    font-size: 0.72rem;
    color: #888;
    text-align: center;
}

.splash-credit a {
    color: #79c0ff;
    text-decoration: none;
}

.splash-credit a:hover {
    text-decoration: underline;
}

.splash-hint kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: #4169E1;
    background: rgba(65, 105, 225, 0.08);
    border: 1px solid rgba(65, 105, 225, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    margin: 0 1px;
}

body.light .splash {
    background: #fff;
    border-color: #e0e0e0;
}

body.light .splash::before {
    background:
        radial-gradient(ellipse 600px 300px at 50% 0%, rgba(65, 105, 225, 0.06), transparent),
        radial-gradient(ellipse 500px 280px at 85% 100%, rgba(65, 105, 225, 0.03), transparent);
}

body.light .splash::after {
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 60px);
}

body.light .splash-title {
    color: #222;
}

body.light .splash-bio {
    color: #888;
}

body.light .splash-divider {
    background: #e0e0e0;
}

body.light .splash-text {
    color: #999;
}

body.light .splash-hint {
    color: #999;
}

body.light .splash-hint kbd {
    color: #4169E1;
    background: rgba(65, 105, 225, 0.06);
    border-color: rgba(65, 105, 225, 0.15);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #222;
    border-top-color: #4169E1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 0;
    padding: 16px 20px 20px;
    animation: cardFadeIn 0.3s ease forwards;
    opacity: 0;
}

.card-focus {
    box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.35), 0 10px 30px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.card:hover {
    border-color: #333;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #eee;
}

.badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #4169E1;
    color: #fff;
}

/* Syntax type badge colors - dark to light blue scale */
.badge.event { background: #1e3a7a; }
.badge.condition { background: #2a4a8a; }
.badge.effect { background: #355a9a; }
.badge.expression { background: #4169E1; }
.badge.type { background: #5a7de6; }
.badge.function { background: #7391eb; }
.badge.section { background: #8ca5f0; }
.badge.structure { background: #a5b9f5; }

/* Category badge for LuaCraft docs */
.badge.category { background: #4169E1; }

.copy-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 5px 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-link-btn:hover {
    background: #222;
    color: #fff;
    transform: scale(1.1);
}

.copy-link-btn:active,
.copy-link-btn.clicked {
    background: #4169E1;
    border-color: #4169E1;
    color: #fff;
    transform: scale(0.95);
}

.addon-version {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.addon {
    font-size: 0.8rem;
    color: #666;
}

.version {
    font-size: 0.7rem;
    color: #555;
    background: #222;
    padding: 2px 8px;
    border-radius: 4px;
}

.pattern-wrap,
.example-wrap {
    position: relative;
    margin-bottom: 10px;
}

.pattern-wrap .copy-btn,
.example-wrap .copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.2s;
}

.example-wrap .vote-wrap {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    transition: all 0.2s;
}

.pattern-wrap:hover .copy-btn,
.example-wrap:hover .copy-btn {
    opacity: 1;
}

/* Example vote buttons only on hover */

.example-wrap .vote-wrap .vote-btn {
    opacity: 0;
    pointer-events: none;
}

.example-wrap:hover .vote-wrap .vote-btn {
    opacity: 1;
    pointer-events: auto;
}

.vote-btn.del {
    border-color: rgba(248, 81, 73, 0.35);
}

.vote-btn.del:hover {
    background: rgba(248, 81, 73, 0.12);
    border-color: rgba(248, 81, 73, 0.6);
    color: #f85149;
}

.vote-score {
    min-width: 20px;
    text-align: center;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.8rem;
    color: #666;
    opacity: 0;
    pointer-events: none;
}

.example-wrap:hover .vote-score {
    opacity: 1;
}

body.light .vote-score {
    color: #888;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 5px 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #333;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.copy-btn:active,
.copy-btn.clicked {
    background: #4169E1;
    border-color: #4169E1;
    color: #fff;
    transform: translateY(-50%) scale(0.95);
}

.pattern {
    background: #111;
    padding: 12px 14px;
    padding-right: 40px;
    border-radius: 0px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #94b8d6;
}

/* Syntax highlighting - blue shades */
.syn-type {
    color: #a5d6ff;
}

.syn-optional {
    color: #6ea8fe;
}

.syn-choice {
    color: #4169E1;
}

.syn-param {
    color: #79c0ff;
}

.syn-colon {
    color: #526d82;
}

.example-wrap {
    margin-bottom: 8px;
}

.desc {
    font-size: 0.9rem;
    color: #999;
    line-height: 1.5;
}

.vote-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #333;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: #222;
    color: #fff;
}

.vote-btn.up.active {
    border-color: rgba(63, 185, 80, 0.6);
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
}

.vote-btn.down.active {
    border-color: rgba(248, 81, 73, 0.6);
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
}

body.light .vote-btn {
    border-color: #ddd;
    color: #888;
}

body.light .vote-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #222;
}

.meta-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.meta-value {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.85rem;
    color: #a9c7e6;
    word-break: break-word;
}

.ret-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ret-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #2a2a2a;
    background: #111;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.8rem;
    color: #ddd;
}

.ret-pill.type {
    background: rgba(65, 105, 225, 0.14);
    border-color: rgba(65, 105, 225, 0.45);
    color: #a5d6ff;
}

.ret-pill.name {
    background: #151515;
    border-color: #2a2a2a;
    color: #c9d1d9;
}

.ret-pill.none {
    background: transparent;
    border-style: dashed;
    color: #777;
}

.ret-none {
    display: inline-flex;
    align-items: center;
    color: #7a8595;
}

.ret-none-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a8595;
}

.addon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.addon-header h3 {
    margin: 0;
}

.addon-search-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.addon-search-btn:hover {
    color: #4169E1;
    background: rgba(65, 105, 225, 0.1);
}

.addon-search-btn.active {
    color: #4169E1;
}

.addon-search-popout {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.addon-search-popout.show {
    opacity: 1;
    visibility: visible;
}

.addon-search-popout input {
    width: 100px;
    padding: 5px 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.2s;
}

.addon-search-popout input:focus {
    border-color: #4169E1;
}

.addon-search-popout input::placeholder {
    color: #666;
}

.examples-toggle {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #4169E1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.examples-toggle:hover {
    color: #5a7fe2;
}

.examples-toggle .arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.examples-toggle.open .arrow {
    transform: rotate(90deg);
}

.examples {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
}

.examples.show {
    max-height: 500px;
    margin-top: 12px;
    padding-top: 12px;
    border-top-color: #222;
}

/* Hide examples toggle but keep examples visible */
.examples-toggle {
    display: none !important;
}

.examples {
    max-height: none !important;
    overflow: visible;
    margin-top: 12px;
    padding-top: 12px;
    border-top-color: #222;
}

.example-code {
    background: #111;
    padding: 12px 14px;
    padding-right: 40px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a5d6a7;
    -webkit-text-fill-color: #a5d6a7;
    white-space: pre-wrap;
    line-height: 1.6;
}

.add-example-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: transparent;
    border: 1px dashed #333;
    border-radius: 6px;
    color: #666;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-example-btn:hover {
    border-color: #4169E1;
    color: #4169E1;
    background: rgba(65, 105, 225, 0.1);
}

/* Temporarily hidden (keep markup intact) */
.add-example-btn {
    display: none !important;
}

/* ── Functions Section ── */
.functions-section {
    margin-top: 10px;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Trigger button */
.fn-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #282828;
    border-radius: 4px;
    color: #888;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.fn-trigger-btn:hover {
    border-color: #4169E1;
    color: #ccc;
}

.functions-section.open .fn-trigger-btn {
    border-color: #4169E1;
    border-bottom: none;
    color: #ccc;
    border-radius: 4px 4px 0 0;
}

.fn-trigger-icon {
    display: flex;
    color: #4169E1;
}

.fn-trigger-icon svg {
    width: 12px;
    height: 12px;
}

.fn-trigger-label {
    text-align: left;
}

.fn-trigger-chevron {
    display: flex;
    color: #555;
    transition: transform 0.2s ease;
}

.fn-trigger-chevron svg {
    width: 10px;
    height: 10px;
}

.functions-section.open .fn-trigger-chevron {
    transform: rotate(180deg);
    color: #4169E1;
}

/* Panel container */
.fn-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-width 0s 0.3s;
    background: #0e0e0e;
    border: 0 solid transparent;
    border-radius: 0 0 4px 4px;
}

.functions-section.open .fn-panel {
    border-width: 1px;
    border-color: #2a2a2a;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-width 0s 0s;
}

/* Individual function row */
.fn-row {
    border-bottom: 1px solid #191919;
}

.fn-row:last-child {
    border-bottom: none;
}

.fn-row-head {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 5px;
    width: 100%;
    padding: 5px 10px;
    background: transparent;
    border: none;
    color: #ccc;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.12s;
}

.fn-row-head:hover {
    background: rgba(65, 105, 225, 0.05);
}

.fn-row.open .fn-row-head {
    background: rgba(65, 105, 225, 0.03);
    border-bottom: 1px solid #1c1c1c;
}

.fn-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.72rem;
    color: #58a6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.fn-sig-short {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 6px;
    margin-right: auto;
}

.fn-ret-pill {
    margin-left: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(65, 105, 225, 0.1);
    color: #79c0ff;
    border: 1px solid rgba(65, 105, 225, 0.18);
    flex-shrink: 0;
}

.fn-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #444;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    margin-left: 6px;
    margin-right: 2px;
    flex-shrink: 0;
}

.fn-row-chevron {
    margin-left: 6px;
    flex-shrink: 0;
}

.fn-row-head:hover .fn-link-btn {
    opacity: 1;
}

.fn-link-btn:hover {
    color: #4169E1;
}

.fn-link-btn.clicked {
    color: #3fb950;
}

.fn-row-chevron {
    display: flex;
    color: #333;
    transition: transform 0.18s ease;
    margin-left: 2px;
}

.fn-row-chevron svg {
    width: 10px;
    height: 10px;
}

.fn-row.open .fn-row-chevron {
    transform: rotate(180deg);
    color: #4169E1;
}

/* Expandable body */
.fn-row-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fn-row-body-inner {
    padding: 6px 10px 8px;
}

.fn-sig {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: #777;
    background: #111;
    padding: 3px 7px;
    border-radius: 3px;
    margin-bottom: 5px;
    word-break: break-all;
    border: 1px solid #1c1c1c;
}

.fn-desc {
    font-size: 0.72rem;
    color: #888;
    line-height: 1.45;
    margin-bottom: 5px;
}

.fn-return {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 6px 0 4px;
}

.fn-return-name {
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid #1c1c1c;
    color: #ddd;
    font-size: 0.7rem;
}

.fn-return-type {
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(88,101,242,0.08);
    border: 1px solid rgba(88,101,242,0.25);
    color: #9db3ff;
    font-size: 0.7rem;
}

.fn-params {
    margin-top: 3px;
    padding-top: 5px;
    border-top: 1px solid #1c1c1c;
}

.fn-params-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
    margin-bottom: 3px;
}

.fn-param-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid #1c1c1c;
}

.fn-param-row.child {
    grid-template-columns: 0.8fr auto;
    padding: 4px 0 4px 12px;
    border-bottom: none;
}

.fn-param-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: #d29922;
}

.fn-param-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: #79c0ff;
    padding: 1px 4px;
    background: rgba(121, 192, 255, 0.07);
    border-radius: 8px;
    border: 1px solid rgba(121, 192, 255, 0.1);
    display: inline-block;
    width: auto;
    max-width: max-content;
    white-space: nowrap;
}

.fn-param-type.empty {
    display: none;
}

.fn-param-meta {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

.fn-param-required {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.2);
    color: #f85149;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fn-param-optional {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.2);
    color: #3fb950;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fn-param-desc {
    color: #aaa;
}

.fn-param-props {
    padding: 4px 0 6px 6px;
    border-left: 2px solid #1c1c1c;
}

.entry-params {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #1c1c1c;
}

.fn-param-props-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #666;
    margin-bottom: 2px;
}

/* ── Light mode overrides for functions ── */
body.light .fn-trigger-btn {
    border-color: #ddd;
    color: #777;
}

body.light .fn-trigger-btn:hover {
    border-color: #4169E1;
    color: #444;
}

body.light .functions-section.open .fn-trigger-btn {
    border-color: #4169E1;
    border-bottom: none;
    color: #444;
}

body.light .fn-panel {
    background: #fafafa;
}

body.light .functions-section.open .fn-panel {
    border-color: #ccc;
}

body.light .fn-row {
    border-bottom-color: #eee;
}

body.light .fn-row-head {
    color: #444;
}

body.light .fn-row-head:hover {
    background: rgba(65, 105, 225, 0.04);
}

body.light .fn-row.open .fn-row-head {
    background: rgba(65, 105, 225, 0.03);
    border-bottom-color: #e8e8e8;
}

body.light .fn-name {
    color: #0969da;
}

body.light .fn-sig-short {
    color: #aaa;
}

body.light .fn-ret-pill {
    background: rgba(9, 105, 218, 0.07);
    color: #0969da;
    border-color: rgba(9, 105, 218, 0.12);
}

body.light .fn-row-chevron {
    color: #ccc;
}

body.light .fn-link-btn {
    color: #bbb;
}

body.light .fn-link-btn:hover {
    color: #4169E1;
}

body.light .fn-row.open .fn-row-chevron {
    color: #4169E1;
}

body.light .fn-sig {
    background: #f0f0f0;
    color: #555;
    border-color: #e0e0e0;
}

body.light .fn-desc {
    color: #555;
}

body.light .fn-return-name {
    background: rgba(0,0,0,0.02);
    border-color: #e0e0e0;
    color: #333;
}

body.light .fn-return-type {
    background: rgba(88,101,242,0.1);
    border-color: rgba(88,101,242,0.35);
    color: #394b9f;
}

body.light .fn-params {
    border-top-color: #e0e0e0;
}

body.light .fn-params-label {
    color: #aaa;
}

body.light .fn-param-name {
    color: #9a6700;
}

body.light .fn-param-type {
    color: #0969da;
    background: rgba(9, 105, 218, 0.05);
    border-color: rgba(9, 105, 218, 0.1);
}

body.light .fn-param-required {
    background: rgba(248, 81, 73, 0.12);
    border-color: rgba(248, 81, 73, 0.3);
    color: #c0392b;
}

body.light .fn-param-optional {
    background: rgba(63, 185, 80, 0.12);
    border-color: rgba(63, 185, 80, 0.3);
    color: #2e8b57;
}

body.light .fn-param-desc {
    color: #666;
}

body.light .fn-param-props {
    border-left-color: #e0e0e0;
}

body.light .fn-param-props-label {
    color: #999;
}

body.light .entry-params {
    border-top-color: #e0e0e0;
}

body.light .fn-trigger-chevron {
    color: #ccc;
}

body.light .functions-section.open .fn-trigger-chevron {
    color: #4169E1;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.top-bar .logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 28px;
    height: 28px;
    display: inline-block;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.65));
}

.logo-text {
    line-height: 1;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.examples-empty {
    font-size: 0.85rem;
    color: #666;
    padding: 6px 2px 2px;
}

body.light .examples-empty {
    color: #888;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    height: 40px;
    padding: 0 14px;
    color: #ddd;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #222;
    color: #fff;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.loading {
    position: relative;
}

.action-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
}

.discord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #5865F2;
    border: none;
    border-radius: 8px;
    height: 40px;
    padding: 0 16px;
    color: #fff;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.discord-btn:hover {
    background: #4752c4;
}

.discord-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.discord-btn.disabled {
    position: relative;
    overflow: hidden;
}

.discord-btn.disabled .label {
    opacity: 0.5;
}

.discord-btn.disabled .coming-soon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.75);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}

.discord-btn.loading {
    position: relative;
}

.discord-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: #2a2a2a;
    color: #fff;
}

.theme-toggle .icon-sun {
    display: none;
}

body.light .theme-toggle .icon-moon {
    display: none;
}

body.light .theme-toggle .icon-sun {
    display: block;
}

/* Light Mode */
body.light {
    background: #f5f5f5;
    color: #333;
}

body.light .sidebar {
    background: #fff;
    border-right-color: #e0e0e0;
}

body.light .sidebar input {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

body.light .sidebar input::placeholder {
    color: #999;
}

body.light .search-shortcut {
    color: #999;
    background: #eee;
    border-color: #ddd;
}

body.light .sidebar h3 {
    color: #888;
}

body.light .filter {
    color: #666;
}

body.light .filter:hover {
    background: #f0f0f0;
    color: #333;
}

body.light .filter.active {
    background: #4169E1;
    color: #fff;
}

body.light .regex-btn {
    color: #999;
}

body.light .regex-btn:hover {
    background: #eee;
    color: #666;
}

body.light .sidebar-footer {
    border-top-color: #e0e0e0;
}

body.light .rate-limit {
    color: #999;
}

body.light .rate-limit.warn {
    color: #b58900;
}

body.light .rate-limit.danger {
    color: #d73a49;
}

body.light .footer-reload {
    border-color: #ddd;
    color: #888;
}

body.light .footer-reload:hover {
    background: #f0f0f0;
    color: #333;
}

body.light .sidebar-actions {
    border-top-color: #e0e0e0;
}

body.light .status {
    color: #888;
}

body.light .action-btn {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

body.light .action-btn:hover {
    background: #f0f0f0;
}

body.light main {
    background: #f5f5f5;
}

body.light .loading {
    color: #999;
}

body.light .spinner {
    border-color: #ddd;
    border-top-color: #4169E1;
}

body.light .no-results {
    background: #fff;
    border-color: #e0e0e0;
}

body.light .no-results-title {
    color: #333;
}

body.light .no-results-text {
    color: #888;
}

body.light .header h1 {
    color: #222;
}

body.light .entry-count {
    color: #999;
}

body.light .status-pill {
    border-color: #e0e0e0;
    background: #f9f9f9;
    color: #555;
}

body.light .status-pill.ok { border-color: rgba(63,185,80,0.35); color: #2e8b57; }
body.light .status-pill.warn { border-color: rgba(241,196,15,0.35); color: #c9a302; }
body.light .status-pill.danger { border-color: rgba(248,81,73,0.35); color: #c0392b; }

body.light .refresh-float {
    background: #fff;
    border-color: #e0e0e0;
    color: #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body.light .header p {
    color: #888;
}

body.light #count {
    color: #888;
}

body.light .card {
    background: #fff;
    border-color: #e0e0e0;
    border-radius: 0;
}

body.light .card:hover {
    border-color: #ccc;
}

body.light .card-name {
    color: #111;
}

body.light .copy-link-btn {
    border-color: #ddd;
    color: #999;
}

body.light .copy-link-btn:hover {
    background: #f0f0f0;
    color: #333;
}

body.light .copy-btn {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

body.light .copy-btn:hover {
    background: #e5e5e5;
    color: #333;
}

body.light .theme-toggle:hover {
    background: #f0f0f0;
    color: #333;
}

body.light .discord-btn {
    background: #5865F2;
}

body.light .discord-btn:hover {
    background: #4752c4
}

body.light .discord-btn.disabled .coming-soon {
    background: rgba(255, 255, 255, 0.82);
    color: #111;
}

body.light .discord-btn.disabled .label {
    color: #333;
}

body.light .addon {
    color: #888;
}

body.light .version {
    background: #eee;
    color: #666;
}

body.light .add-example-btn {
    border-color: #ccc;
    color: #888;
}

body.light .add-example-btn:hover {
    border-color: #4169E1;
    color: #4169E1;
    background: rgba(65, 105, 225, 0.1);
}


body.light .pattern {
    background: #f0f4ff;
    color: #4a6da7;
}

/* Light mode syntax highlighting */
body.light .syn-type {
    color: #1e5aa8;
}

body.light .syn-optional {
    color: #3366cc;
}

body.light .syn-choice {
    color: #4169E1;
}

body.light .syn-param {
    color: #2563eb;
}

body.light .syn-colon {
    color: #7a9ac4;
}

body.light .addon-search-btn {
    color: #999;
}

body.light .addon-search-btn:hover {
    color: #4169E1;
    background: rgba(65, 105, 225, 0.1);
}

body.light .addon-search-popout input {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

body.light .addon-search-popout input:focus {
    border-color: #4169E1;
}

body.light .addon-search-popout input::placeholder {
    color: #999;
}

body.light .desc {
    color: #666;
}

body.light .meta-row {
    border-top-color: #e0e0e0;
}

body.light .meta-label {
    color: #888;
}

body.light .meta-value {
    color: #2563eb;
}

body.light .ret-pill {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

body.light .ret-pill.type {
    background: rgba(65, 105, 225, 0.1);
    border-color: rgba(65, 105, 225, 0.35);
    color: #1e5aa8;
}

body.light .ret-pill.name {
    background: #f7f7f7;
    border-color: #e0e0e0;
    color: #222;
}

body.light .ret-pill.none {
    background: transparent;
    border-color: #ccc;
    color: #888;
}

body.light .ret-none {
    color: rgba(17, 17, 17, 0.55);
}

body.light .ret-none-label {
    color: rgba(17, 17, 17, 0.55);
}

body.light .examples {
    border-top-color: #e0e0e0;
}

body.light .examples {
    margin-top: 12px;
    padding-top: 12px;
}

body.light .example-code {
    background: #f0fff0;
    color: #2e7d32;
    -webkit-text-fill-color: #2e7d32;
}

body.light .examples .meta {
    color: #999;
}

body.light .examples .meta span {
    color: #666;
}

body.light .theme-toggle {
    background: #fff;
    border-color: #ddd;
}

body.light .theme-toggle:hover {
    background: #f0f0f0;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #333;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: #222;
    color: #fff;
}

body.light .menu-toggle {
    border-color: #ddd;
    color: #666;
}

body.light .menu-toggle:hover {
    background: #f0f0f0;
    color: #333;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* Mobile Responsive */
.mobile-search {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.mobile-search:focus-within {
    border-color: #4169E1;
}

.mobile-search svg {
    flex-shrink: 0;
    color: #666;
}

.mobile-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.mobile-search input::placeholder {
    color: #666;
}

.mobile-search .regex-btn {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-search .regex-btn:hover {
    border-color: #4169E1;
    color: #4169E1;
}

.mobile-search .regex-btn.active {
    background: rgba(65, 105, 225, 0.2);
    border-color: #4169E1;
    color: #4169E1;
}

body.light .mobile-search {
    background: #f5f5f5;
    border-color: #ddd;
}

body.light .mobile-search:focus-within {
    border-color: #4169E1;
}

body.light .mobile-search svg {
    color: #999;
}

body.light .mobile-search input {
    color: #333;
}

body.light .mobile-search input::placeholder {
    color: #999;
}

body.light .mobile-search .regex-btn {
    border-color: #ccc;
    color: #999;
}

@media (max-width: 768px) {
    .mobile-search {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    main {
        margin-left: 0;
        padding: 20px 16px;
    }
    
    .top-bar {
        gap: 12px;
    }
    
    .top-bar .logo {
        font-size: 1.2rem;
        flex: 1;
    }

    .action-btn {
        height: 36px;
        padding: 0 10px;
        font-size: 0.8rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .card {
        padding: 14px 16px 18px;
    }
    
    .card-top {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-name {
        width: 100%;
        order: -1;
    }
    
    .addon-version {
        margin-left: 0;
    }
    
    .pattern {
        font-size: 0.75rem;
        padding: 10px 12px;
        padding-right: 36px;
        word-break: break-all;
    }
    
    .example-code {
        font-size: 0.75rem;
        padding: 10px 12px;
        padding-right: 36px;
    }
    
    .discord-btn span,
    .discord-btn svg + span {
        display: none;
    }
    
    .discord-btn {
        width: 40px;
        padding: 0;
    }
    
    .modal {
        padding: 24px 20px;
        margin: 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 16px 12px;
    }
    
    .top-bar .logo {
        font-size: 1rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    #count {
        font-size: 0.75rem;
    }
    
    .card {
        padding: 12px 14px 16px;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
    
    .desc {
        font-size: 0.85rem;
    }
    
    .examples-toggle {
        font-size: 0.75rem;
    }
    
    .add-example-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}
