body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

html, body, .rd-scroll {
    scrollbar-width: thin;
    scrollbar-color: #6366f1 transparent;
}

::-webkit-scrollbar,
.rd-scroll::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track,
.rd-scroll::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb,
.rd-scroll::-webkit-scrollbar-thumb {
    background-color: #6366f1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover,
.rd-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #4f46e5;
}

@keyframes bar-infinite {
  0% {
    left: -33%;
  }
  100% {
    left: 100%;
  }
}

.animate-bar-infinite {
  animation: bar-infinite 1.5s infinite linear;
}

/* iOS safe area for mobile bottom nav */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #session-scroll-container ~ nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── App sidebar ────────────────────────────────────────────────────────────
   The nav entries carried the same dozen Tailwind classes each, in blue — the
   app's accent is indigo everywhere else. One class here instead, so the hover,
   the icon colour and the active marker stay in step.                        */

.rd-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    /* A <button> centres its text and an <a> does not; the rows are a mix of
       both, so say it once here. */
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;               /* gray-700 */
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* The marker grows out of the left edge rather than appearing whole, which
   keeps the row from jumping. */
.rd-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 2px;
    height: 0;
    border-radius: 9999px;
    background-color: #6366f1;    /* indigo-500 */
    transform: translateY(-50%);
    transition: height 0.15s ease;
}

.rd-nav-item:hover {
    background-color: #eef2ff;    /* indigo-50  */
    color: #4338ca;               /* indigo-700 */
}
.rd-nav-item:hover::before { height: 1.25rem; }

/* Set by _setActiveNav (js/app.js) on the view currently on screen. */
.rd-nav-item.is-active {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 700;
}
.rd-nav-item.is-active::before { height: 1.25rem; }

/* A muted icon that lights up reads as one row with its label; a fixed width
   keeps the labels aligned whatever the glyph. */
.rd-nav-item > i {
    width: 1.25rem;
    text-align: center;
    color: #9ca3af;               /* gray-400 */
    transition: color 0.15s ease;
}
.rd-nav-item:hover > i,
.rd-nav-item.is-active > i { color: #6366f1; }

.rd-nav-item.is-disabled {
    color: #9ca3af;
    cursor: not-allowed;
}
.rd-nav-item.is-disabled:hover {
    background-color: transparent;
    color: #9ca3af;
}
.rd-nav-item.is-disabled:hover::before { height: 0; }
.rd-nav-item.is-disabled:hover > i { color: #9ca3af; }

/* The profile card at the top of the sidebar. It is not a .rd-nav-item — it is
   a card with an avatar, not a nav row — but it does lead to a page, so it
   answers to the same is-active mark _setActiveNav sets on the rest. */
[data-nav="profile"].is-active {
    border-color: #6366f1;                                  /* indigo-500 */
    box-shadow: 0 0 0 1px #6366f1, 0 1px 2px rgb(0 0 0 / 0.05);
}

/* Collapsed sidebar: icons only, centered, labels and badges hidden */
.rd-sidebar-collapsed {
    width: 5rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    align-items: center !important;
}

.rd-sidebar-collapsed .sidebar-label {
    display: none !important;
}

.rd-sidebar-collapsed [data-js-function="toggleSidebar"] {
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 0.625rem !important;
}

.rd-sidebar-collapsed [data-nav="profile"] {
    justify-content: center !important;
    padding: 0.375rem !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    background-color: transparent !important;
    border-color: transparent !important;
    border-radius: 1rem !important;
    margin: 0 auto !important;
}

.rd-sidebar-collapsed [data-nav="profile"]:hover {
    background-color: #f1f5f9 !important;
}

.rd-sidebar-collapsed .rd-nav-item {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.rd-sidebar-collapsed .rd-nav-item::before { height: 0 !important; }

.rd-sidebar-collapsed .rd-nav-item > i {
    margin: 0 !important;
}

/* ── Preferences: the theme picker ──────────────────────────────────────────
   Three cards showing the three choices at once, where the floating gear menu
   had one pill you clicked until its label said what you wanted.              */

.rd-theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.875rem 0.5rem;
    border: 1px solid #e5e7eb;                              /* gray-200   */
    border-radius: 0.75rem;
    background-color: #f9fafb;                              /* gray-50    */
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;                                         /* gray-700   */
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.rd-theme-card > i {
    font-size: 1.125rem;
    color: #9ca3af;                                         /* gray-400   */
    transition: color 0.15s ease;
}

.rd-theme-card:hover {
    border-color: #a5b4fc;                                  /* indigo-300 */
    background-color: #eef2ff;                              /* indigo-50  */
}

.rd-theme-card.is-active {
    border-color: #6366f1;                                  /* indigo-500 */
    background-color: #eef2ff;
    color: #4338ca;                                         /* indigo-700 */
    box-shadow: 0 0 0 1px #6366f1;
}

.rd-theme-card:hover > i,
.rd-theme-card.is-active > i { color: #6366f1; }

/* ── In-app documentation ───────────────────────────────────────────────────
   The index doubles as a phone-sized chip row and a desktop sticky index, so
   the shared bits live here rather than in a long Tailwind class list.        */

.doc-toc-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    color: #374151;               /* gray-700  */
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.doc-toc-link:hover {
    background-color: #eef2ff;    /* indigo-50  */
    color: #4338ca;               /* indigo-700 */
}
/* Set by _docStartSpy on the section currently under the top of the viewport. */
.doc-toc-link.is-active {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 700;
}
.doc-toc-link.is-active > i { color: #6366f1; }

/* Filtered out by the search box. A class rather than an inline style so a
   section can be hidden and shown again without touching its own styling. */
.doc-hidden { display: none !important; }

/* Search hits, wrapped by _docHighlight. */
.doc-mark {
    background-color: #c7d2fe;    /* indigo-200 */
    color: inherit;
    border-radius: 0.25rem;
    padding: 0 0.125rem;
}
