:root {
    --ink: #211d29;
    --muted: #777382;
    --line: #e5e2e9;
    --surface: #ffffff;
    --surface-soft: #f7f6f8;
    --plum: #18131f;
    --plum-soft: #241c2c;
    --accent: #f58179;
    --accent-dark: #d95e59;
    --accent-soft: #fff1ef;
    --note: #f3f4f7;
    --success: #268260;
    --danger: #b83f48;
    --shadow: 0 18px 50px rgba(32, 23, 40, 0.12);
    --radius-sm: 10px;
    --radius-md: 14px;
    --sidebar-width: 286px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

.bizarre-faq-page button,
.bizarre-faq-page input {
    letter-spacing: normal;
    text-transform: none;
}

button {
    color: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(245, 129, 121, 0.36);
    outline-offset: 2px;
}

a {
    color: var(--accent-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

.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;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 25px 18px 22px;
    color: #f7f4fa;
    background: var(--plum);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand,
.mobile-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 29px;
    line-height: 1;
    letter-spacing: -0.6px;
}

.brand span,
.mobile-brand span {
    color: var(--accent);
    font-weight: 700;
}

.sidebar-caption {
    margin: 14px 4px 31px;
    color: #aaa2b2;
    font-size: 12px;
    line-height: 1.5;
}

.category-nav {
    display: grid;
    gap: 7px;
}

.category-button {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    color: #cac4d0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    text-align: left;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.category-button:hover {
    color: #ffffff;
    background: var(--plum-soft);
}

.category-button.is-active {
    color: var(--ink);
    background: var(--accent);
}

.category-button.is-active:hover {
    color: var(--ink);
    background: #fa8e86;
}

.category-button > span:nth-child(2) {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-button strong {
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.7;
}

.category-icon {
    width: 22px;
    height: 22px;
}

.category-icon svg {
    width: 100%;
    height: 100%;
}

.category-dot {
    width: 8px;
    height: 8px;
    margin-left: 7px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.65;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 6px 0;
    color: #8b8292;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
}

.app-content {
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: flex-end;
    padding: 0 38px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.logout-form {
    margin: 0;
}

.logout-button,
.mobile-menu {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    color: #615b69;
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.logout-button:hover,
.mobile-menu:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.logout-button svg,
.mobile-menu svg {
    width: 20px;
    height: 20px;
}

.mobile-menu,
.mobile-brand {
    display: none;
}

.main-content {
    width: min(1120px, calc(100% - 72px));
    margin: 0 auto;
    padding: 47px 0 72px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 27px;
}

.page-heading h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(39px, 4vw, 55px);
    font-weight: 700;
    letter-spacing: -1.6px;
    line-height: 1.02;
}

.page-heading p {
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.result-total {
    padding-bottom: 7px;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.result-total strong {
    color: var(--ink);
    font-size: 20px;
}

.search-wrap {
    position: sticky;
    top: 81px;
    z-index: 15;
    display: flex;
    align-items: center;
    margin-bottom: 27px;
    background: var(--surface);
    border: 1px solid #d9d5df;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.94);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(245, 129, 121, 0.14), 0 0 0 9px rgba(255, 255, 255, 0.94);
}

.search-icon {
    position: absolute;
    left: 19px;
    width: 21px;
    height: 21px;
    color: #494452;
}

#faq-search {
    width: 100%;
    height: 58px;
    padding: 0 145px 0 53px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: none;
    font-size: 16px;
}

#faq-search::placeholder {
    color: #96919f;
}

#faq-search::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    position: absolute;
    right: 104px;
    display: none;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #746e7c;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.search-clear.is-visible {
    display: grid;
}

.search-clear:hover {
    background: var(--surface-soft);
}

.search-clear svg {
    width: 18px;
    height: 18px;
}

.shortcut {
    position: absolute;
    right: 17px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #a09ba7;
    font-size: 11px;
}

kbd {
    min-width: 25px;
    padding: 2px 5px;
    color: #625d69;
    background: #f3f2f5;
    border: 1px solid #dedbe2;
    border-radius: 5px;
    box-shadow: 0 1px 0 #d4d0d8;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.mobile-categories {
    display: none;
}

.bsf-list {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.bsf-item + .bsf-item {
    border-top: 1px solid var(--line);
}

.bsf-item[hidden] {
    display: none;
}

.bsf-item h2 {
    margin: 0;
    color: var(--ink);
    background: transparent;
}

.bsf-trigger {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 22px;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 67px;
    padding: 12px 22px;
    position: static;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transform: none;
    appearance: none;
}

.bsf-trigger:hover {
    background: #fbfafc;
}

.bsf-number {
    color: #817a88;
    font-size: 13px;
    font-weight: 650;
}

.bsf-title {
    display: block;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(18px, 2vw, 21px);
    font-weight: 700;
    line-height: 1.25;
}

.bsf-category {
    padding: 4px 8px;
    color: #736c79;
    background: #f4f2f5;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.bsf-chevron {
    width: 20px;
    height: 20px;
    transition: transform 180ms ease;
}

.bsf-item.is-open .bsf-chevron {
    transform: rotate(180deg);
}

.bsf-panel {
    display: none;
    position: static;
    inset: auto;
    width: auto;
    padding: 2px 22px 24px 70px;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.bsf-item.is-open .bsf-panel {
    display: block;
}

.bsf-answer-block,
.bsf-note-block {
    padding: 20px 22px;
    border-radius: var(--radius-sm);
}

.bsf-answer-block {
    background: var(--accent-soft);
}

.bsf-note-block {
    margin-top: 12px;
    background: var(--note);
}

.bsf-block-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
}

.bsf-block-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3d3744;
    font-size: 13px;
    font-weight: 800;
}

.bsf-block-title svg {
    width: 21px;
    height: 21px;
}

.bsf-answer-text,
.bsf-note-text {
    color: #4f4857;
    font-size: 15px;
    line-height: 1.65;
}

.bsf-copy-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    color: #3d2d33;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    transition: background-color 150ms ease, transform 150ms ease;
}

.bsf-copy-button:hover {
    background: #f99088;
    transform: translateY(-1px);
}

.bsf-copy-button.is-copied {
    color: #ffffff;
    background: var(--success);
}

.bsf-copy-button svg {
    width: 17px;
    height: 17px;
}

.bsf-empty-state {
    padding: 70px 24px;
    border: 1px dashed #d7d2dc;
    border-radius: var(--radius-md);
    text-align: center;
}

.bsf-empty-state[hidden] {
    display: none;
}

.bsf-empty-state > svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 19px;
    color: #a8a2ae;
}

.bsf-empty-state h2 {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
}

.bsf-empty-state p {
    margin: 0 auto 22px;
    max-width: 420px;
    color: var(--muted);
    font-size: 14px;
}

.bsf-empty-state button,
.primary-button {
    min-height: 44px;
    padding: 10px 18px;
    color: #ffffff;
    background: var(--plum);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
}

.bsf-empty-state button:hover,
.primary-button:hover {
    background: #2a2133;
}

.toast {
    position: fixed;
    z-index: 60;
    right: 24px;
    bottom: 24px;
    padding: 11px 16px;
    color: #ffffff;
    background: var(--success);
    border-radius: 9px;
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-backdrop {
    display: none;
}

.login-page {
    min-height: 100vh;
    background: var(--plum);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 438px);
    padding: 42px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.26);
}

.brand--login {
    color: var(--ink);
    font-size: 25px;
}

.login-panel h1 {
    margin: 38px 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 39px;
    letter-spacing: -1px;
    line-height: 1.05;
}

.login-panel > p {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
}

.login-error {
    margin-bottom: 19px;
    padding: 11px 13px;
    color: var(--danger);
    background: #fff0f1;
    border: 1px solid #ffd6d9;
    border-radius: 8px;
    font-size: 13px;
}

.login-form label {
    display: block;
    margin-bottom: 7px;
    color: #4b4552;
    font-size: 13px;
    font-weight: 750;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 14px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid #d5d1d9;
    border-radius: 9px;
    outline: none;
}

.password-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(245, 129, 121, 0.14);
}

.password-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #77717e;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--surface-soft);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.primary-button {
    width: 100%;
    margin-top: 17px;
    min-height: 49px;
}

@media (max-width: 900px) {
    .sidebar {
        width: min(86vw, 300px);
        transform: translateX(-103%);
        transition: transform 200ms ease;
    }

    .sidebar.is-visible {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(17, 13, 21, 0.56);
    }

    .sidebar-backdrop.is-visible {
        display: block;
    }

    .app-content {
        margin-left: 0;
    }

    .topbar {
        justify-content: space-between;
        padding: 0 20px;
    }

    .mobile-menu,
    .mobile-brand {
        display: inline-flex;
    }

    .mobile-menu {
        padding-left: 0;
    }

    .mobile-brand {
        margin-right: auto;
        margin-left: 10px;
        font-size: 20px;
    }

    .main-content {
        width: min(100% - 40px, 760px);
        padding-top: 35px;
    }
}

.admin-bar .sidebar,
.admin-bar .topbar {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .sidebar,
    .admin-bar .topbar {
        top: 46px;
    }
}

@media (max-width: 620px) {
    .topbar {
        min-height: 60px;
        padding: 0 15px;
    }

    .logout-button span {
        display: none;
    }

    .main-content {
        width: min(100% - 28px, 560px);
        padding: 27px 0 48px;
    }

    .page-heading {
        align-items: flex-start;
        margin-bottom: 22px;
    }

    .page-heading h1 {
        font-size: 38px;
    }

    .page-heading p {
        display: none;
    }

    .result-total {
        padding-top: 7px;
        font-size: 12px;
    }

    .result-total strong {
        font-size: 16px;
    }

    .search-wrap {
        top: 72px;
        margin-bottom: 15px;
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.95);
    }

    #faq-search {
        height: 54px;
        padding-right: 50px;
        font-size: 15px;
    }

    .shortcut {
        display: none;
    }

    .search-clear {
        right: 9px;
    }

    .bsf-trigger {
        grid-template-columns: 23px minmax(0, 1fr) 19px;
        gap: 9px;
        min-height: 64px;
        padding: 12px 14px;
    }

    .bsf-category {
        display: none;
    }

    .bsf-title {
        font-size: 17px;
    }

    .bsf-panel {
        padding: 0 10px 13px 37px;
    }

    .bsf-answer-block,
    .bsf-note-block {
        padding: 16px;
    }

    .bsf-block-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .bsf-copy-button {
        width: 100%;
        justify-content: center;
    }

    .answer-text,
    .note-text {
        font-size: 14px;
    }

    .login-panel {
        padding: 32px 24px;
    }

    .login-panel h1 {
        font-size: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
