:root {
    --bg: #090b10;
    --bg-soft: #10131b;
    --panel: rgba(18, 21, 30, 0.86);
    --panel-strong: rgba(24, 28, 40, 0.94);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f7fb;
    --muted: #aeb7c7;
    --muted-2: #7e8899;
    --accent: #ff3b3b;
    --accent-2: #8f5cff;
    --accent-3: #56f08a;
    --blue: #4ea4ff;
    --shadow: rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 14%, rgba(255, 59, 59, 0.16), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(143, 92, 255, 0.16), transparent 32%),
        radial-gradient(circle at 70% 88%, rgba(86, 240, 138, 0.1), transparent 28%),
        linear-gradient(135deg, #080a0f 0%, #11141d 52%, #090b10 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 24%, black 0%, transparent 72%);
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.help-shell {
    width: min(1240px, calc(100vw - 38px));
    max-width: 100%;
    margin: 0 auto;
    padding: 22px 0 42px;
}

.help-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
    margin-bottom: 18px;
    padding: 12px 14px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(9, 11, 16, 0.76);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 36px var(--shadow);
}

.help-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.help-brand-logo {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 59, 59, 0.36);
    background: rgba(255, 59, 59, 0.1);
    box-shadow: 0 0 24px rgba(255, 59, 59, 0.2);
    flex: 0 0 52px;
}

.help-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.help-brand strong,
.help-brand small {
    display: block;
}

.help-brand strong {
    font-size: 20px;
    line-height: 1.1;
}

.help-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.help-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
    min-width: 0;
}

.top-action,
.select-wrap {
    min-height: 42px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.top-action {
    padding: 0 13px;
}

.top-action i {
    color: var(--accent-3);
}

.select-wrap {
    padding: 0 9px 0 12px;
}

.select-wrap i {
    color: var(--accent-2);
}

.select-wrap select {
    min-width: 112px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.select-wrap option {
    color: #111;
}

.select-wrap.custom-select-wrap {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.engine-select-wrap.custom-select-wrap {
    width: 168px;
}

.language-select-wrap.custom-select-wrap {
    width: 96px;
}

.help-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.help-hero {
    min-height: 330px;
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: stretch;
    padding: 32px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 86% 10%, rgba(86, 240, 138, 0.16), transparent 31%),
        radial-gradient(circle at 12% 18%, rgba(255, 59, 59, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.025));
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.help-hero-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(86, 240, 138, 0.34);
    color: #bafccc;
    background: rgba(86, 240, 138, 0.08);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.help-hero h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 0.98;
    letter-spacing: -0.02em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.help-hero h1 span {
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.help-hero p {
    max-width: 740px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
    font-weight: 650;
}

.help-hero-panel {
    min-width: 0;
    display: grid;
    gap: 12px;
    align-content: center;
}

.hero-stat {
    min-height: 88px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(6, 8, 12, 0.44);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-stat strong {
    font-size: 30px;
    line-height: 1;
}

.hero-stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.help-topic-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.help-link {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 13px;
    border: 1px solid rgba(143, 92, 255, 0.38);
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(143, 92, 255, 0.16), rgba(255, 255, 255, 0.04)),
        rgba(255, 255, 255, 0.035);
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.help-link[data-help-link="docs"] {
    border-color: rgba(78, 164, 255, 0.62);
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.18), transparent 18%),
        linear-gradient(135deg, rgba(24, 74, 170, 0.95), rgba(15, 132, 204, 0.78));
}

.help-link i {
    color: var(--accent-3);
}

.help-link[data-help-link="docs"] i {
    color: #dbeafe;
}

.help-link:hover {
    transform: translateY(-1px);
    border-color: rgba(86, 240, 138, 0.56);
    box-shadow: 0 16px 30px rgba(86, 240, 138, 0.14);
}

.help-engine-pane[hidden] {
    display: none;
}

.help-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    min-width: 0;
}

.category-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(9, 11, 16, 0.74);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.category-button {
    min-height: 46px;
    width: 100%;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-weight: 900;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.category-button i {
    color: var(--accent-2);
    text-align: center;
}

.category-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-button strong {
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #c9ffd8;
    background: rgba(86, 240, 138, 0.1);
    border: 1px solid rgba(86, 240, 138, 0.24);
    text-align: center;
    font-size: 11px;
}

.category-button:hover,
.category-button.is-active {
    color: var(--text);
    border-color: rgba(143, 92, 255, 0.36);
    background:
        linear-gradient(90deg, rgba(143, 92, 255, 0.18), transparent 74%),
        rgba(255, 255, 255, 0.04);
}

.category-button:hover {
    transform: translateX(2px);
}

.topic-list {
    display: grid;
    gap: 11px;
    min-width: 0;
}

.help-topic {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel-strong), rgba(12, 15, 22, 0.92));
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.help-topic.is-open {
    border-color: rgba(86, 240, 138, 0.32);
    box-shadow: 0 18px 38px rgba(86, 240, 138, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.help-topic-button {
    width: 100%;
    min-height: 82px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.help-topic-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    border: 1px solid rgba(255, 59, 59, 0.28);
    color: #ffb8b8;
    background: rgba(255, 59, 59, 0.08);
}

.help-topic-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.help-topic-title {
    font-size: 17px;
    line-height: 1.22;
    font-weight: 950;
}

.help-topic-summary {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
}

.help-topic-badge {
    padding: 5px 9px;
    border-radius: 999px;
    color: #d8c8ff;
    background: rgba(143, 92, 255, 0.1);
    border: 1px solid rgba(143, 92, 255, 0.24);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.help-topic-chevron {
    color: var(--accent-3);
    transition: transform 0.18s ease;
}

.help-topic.is-open .help-topic-chevron {
    transform: rotate(180deg);
}

.help-topic-panel {
    display: none;
    padding: 0 18px 18px 76px;
}

.help-topic-section {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.help-topic-section h3 {
    margin: 0 0 10px;
    color: #c9ffd8;
    font-size: 14px;
    line-height: 1.3;
}

.help-topic-section ul {
    margin: 0;
    padding-left: 18px;
    color: #dbe1ec;
}

.help-topic-section li {
    line-height: 1.58;
}

.help-topic-section li + li {
    margin-top: 7px;
}

.help-note {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    margin: 8px 0;
    padding: 12px;
    border-radius: 13px;
    border: 1px solid rgba(86, 240, 138, 0.26);
    color: #e8edf5;
    background: rgba(86, 240, 138, 0.075);
}

.help-note.is-warning {
    border-color: rgba(255, 190, 92, 0.32);
    background: rgba(255, 190, 92, 0.09);
}

.help-note i {
    color: var(--accent-3);
    padding-top: 3px;
    text-align: center;
}

.help-note.is-warning i {
    color: #ffc76d;
}

.help-note p {
    margin: 0;
    line-height: 1.52;
}

.help-note p + p {
    margin-top: 8px;
}

.help-topic-links {
    margin-top: 12px;
}

.help-topic-rich {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.help-topic-rich .maubot-overview {
    display: grid;
    gap: 14px;
    color: var(--text);
}

.help-topic-rich .maubot-overview-hero,
.help-topic-rich .maubot-overview-section {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.help-topic-rich .maubot-overview-hero {
    padding: 18px;
    border-color: rgba(143, 92, 255, 0.28);
    background:
        radial-gradient(circle at 90% 10%, rgba(86, 240, 138, 0.12), transparent 36%),
        linear-gradient(145deg, rgba(143, 92, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.help-topic-rich .maubot-overview-section {
    padding: 14px;
}

.help-topic-rich .maubot-overview-eyebrow,
.help-topic-rich .maubot-overview-label {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(86, 240, 138, 0.24);
    color: #bafccc;
    background: rgba(86, 240, 138, 0.08);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.help-topic-rich .maubot-overview h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.16;
}

.help-topic-rich .maubot-overview p,
.help-topic-rich .maubot-command-list ul {
    margin: 0;
    color: var(--muted);
    line-height: 1.52;
}

.help-topic-rich .maubot-command-list li + li {
    margin-top: 7px;
}

.help-topic-rich .maubot-command-list table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.24);
}

.help-topic-rich .maubot-command-list th,
.help-topic-rich .maubot-command-list td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    line-height: 1.42;
}

.help-topic-rich .maubot-command-list th {
    color: #d8c8ff;
    background: rgba(143, 92, 255, 0.13);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.help-topic-rich .maubot-command-list tr:last-child td {
    border-bottom: 0;
}

.help-topic-rich .maubot-command-list td:first-child {
    width: 260px;
}

.help-topic-rich .maubot-command-list code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(86, 240, 138, 0.24);
    color: #e9fff0;
    background: rgba(86, 240, 138, 0.08);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    white-space: nowrap;
}

.help-empty {
    min-height: 170px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-weight: 900;
}

.help-empty:not([hidden]) {
    display: flex;
}

@media (max-width: 980px) {
    .help-shell {
        width: min(760px, calc(100vw - 24px));
    }

    .help-topbar {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .help-top-actions {
        justify-content: stretch;
    }

    .top-action,
    .select-wrap {
        flex: 1 1 150px;
    }

    .help-hero {
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .help-hero-panel {
        grid-template-columns: repeat(3, 1fr);
    }

    .help-link {
        width: 100%;
    }

    .help-layout {
        grid-template-columns: 1fr;
    }

    .category-panel {
        position: static;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .category-button {
        flex: 0 0 auto;
        width: auto;
        min-width: 148px;
    }
}

@media (max-width: 620px) {
    .help-shell {
        width: calc(100vw - 16px);
        max-width: 374px;
        margin-left: 8px;
        margin-right: 8px;
        padding-top: 8px;
    }

    .help-topbar,
    .help-hero,
    .category-panel,
    .help-topic {
        border-radius: 14px;
    }

    .help-brand-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .help-brand strong {
        font-size: 18px;
    }

    .help-brand small {
        font-size: 10px;
    }

    .help-top-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .top-action {
        grid-column: auto;
    }

    .select-wrap select {
        min-width: 0;
        width: 100%;
    }

    .help-hero {
        padding: 18px;
    }

    .help-hero h1 {
        font-size: 22px;
        line-height: 1.16;
        letter-spacing: 0;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .help-hero h1 span {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .help-hero p {
        font-size: 13px;
        overflow-wrap: break-word;
    }

    .help-hero p span {
        overflow-wrap: break-word;
    }

    .help-hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-stat {
        min-height: 68px;
    }

    .help-topic-button {
        min-height: 74px;
        grid-template-columns: 42px minmax(0, 1fr) 20px;
        padding: 12px;
    }

    .help-topic-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .help-topic-badge {
        display: none;
    }

    .help-topic-title {
        font-size: 15px;
    }

    .help-topic-summary {
        font-size: 12px;
    }

    .help-topic-panel {
        padding: 0 12px 14px;
    }

    .help-topic-rich .maubot-command-list table,
    .help-topic-rich .maubot-command-list tbody,
    .help-topic-rich .maubot-command-list tr,
    .help-topic-rich .maubot-command-list th,
    .help-topic-rich .maubot-command-list td {
        display: block;
        width: 100%;
    }

    .help-topic-rich .maubot-command-list tr {
        border-bottom: 1px solid var(--line);
    }

    .help-topic-rich .maubot-command-list tr:last-child {
        border-bottom: 0;
    }

    .help-topic-rich .maubot-command-list th {
        display: none;
    }

    .help-topic-rich .maubot-command-list td {
        border-bottom: 0;
    }

    .help-topic-rich .maubot-command-list td:first-child {
        width: auto;
        padding-bottom: 3px;
    }

    .help-topic-links {
        display: grid;
        grid-template-columns: 1fr;
    }
}
