/* Add logo next to the New Chat button */
#cl-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo styling */
.cl-custom-logo {
    height: 32px;
    width: auto;
    cursor: pointer;
}

/* ── Sticky README Table of Contents ── */

/* Switch the README scroll container to a 2-column grid so the TOC
   sits beside the content instead of above it.
   data-toc-panel is set by JS (React does not reset data-* attributes). */
/* Pull the README dialog away from the right edge so the close button is visible */
[data-readme-dialog] {
    right: 16px !important;
    max-width: calc(100% - 32px) !important;
}

[data-toc-panel] {
    display: grid !important;
    grid-template-columns: 1fr 220px !important;
    align-items: start !important;
    scrollbar-gutter: stable;
    /* Thin scrollbar so it never covers the panel's close button */
    scrollbar-width: thin;
    scrollbar-color: var(--border, rgba(128, 128, 128, 0.3)) transparent;
}

[data-toc-panel]::-webkit-scrollbar {
    width: 5px;
}

[data-toc-panel]::-webkit-scrollbar-track {
    background: transparent;
}

[data-toc-panel]::-webkit-scrollbar-thumb {
    background: var(--border, rgba(128, 128, 128, 0.3));
    border-radius: 3px;
}

/* All scroll-container children except the TOC wrapper go into column 1 */
[data-toc-panel] > *:not(.cl-toc-wrapper) {
    grid-column: 1 !important;
}

/* TOC wrapper occupies column 2, spanning all rows, and sticks to the top */
.cl-toc-wrapper {
    grid-column: 2;
    grid-row: 1 / -1;
    position: sticky;
    top: 0;
    align-self: start;
    z-index: 50;
    pointer-events: none;
    padding: 10px 10px 0 0; /* breathing room from top and right edge */
}

#cl-readme-toc {
    pointer-events: auto;
    background: var(--card, var(--background, #fff));
    color: var(--card-foreground, var(--foreground, inherit));
    border: 1px solid var(--border, rgba(128, 128, 128, 0.2));
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cl-toc-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    opacity: 0.5;
    pointer-events: none;
}

/* Search input with clear button */
.cl-toc-search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.cl-toc-search {
    width: 100%;
    box-sizing: border-box;
    background: var(--muted, rgba(128, 128, 128, 0.1));
    border: 1px solid var(--border, rgba(128, 128, 128, 0.2));
    border-radius: 4px;
    color: inherit;
    font-size: 12px;
    padding: 4px 24px 4px 8px;
    outline: none;
}

.cl-toc-search::placeholder {
    opacity: 0.4;
}

.cl-toc-search:focus {
    background: var(--accent, rgba(128, 128, 128, 0.15));
    border-color: var(--ring, rgba(128, 128, 128, 0.4));
}

.cl-toc-search-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 2px;
}

.cl-toc-search-clear:hover {
    opacity: 1;
}

.cl-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 1;
}

.cl-toc-item {
    line-height: 1.5;
}

.cl-toc-item a {
    font-size: 13px;
    text-decoration: none;
    color: inherit;
    opacity: 0.88;
    display: block;
    padding: 3px 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-toc-item a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Indentation by heading level */
.cl-toc-h1 > a { font-weight: 700; opacity: 1; }
.cl-toc-h2 > a { font-weight: 500; padding-left: 0px; opacity: 0.95; }
.cl-toc-h3 > a { padding-left: 12px; font-size: 12px; opacity: 0.8; }
