/* =============================================
   THEME ALIGNED WITH GETSITE BRAND PALETTE
   ============================================= */
:root {
    /* 🎨 PALETA DO BRAND (extraída dos assets getsitelogo / getsitelogo2) */
    --accent-hue: 214;
    --accent-saturation: 68%;

    --accent: #2f67d6;
    --accent-hover: #4480e0;
    --accent-bg: rgba(47, 103, 214, 0.12);
    --accent-border: rgba(47, 103, 214, 0.26);

    /* 🌙 FUNDOS ESCUROS COM TOM AZUL-NAVY */
    --bg-body: #07101d;
    --bg-body-blur: rgba(7, 16, 29, 0.88);
    --sidebar-bg: #0b1730;
    --topbar-bg: #0d1d3d;
    --bg-card: #11203f;
    --bg-code: #08111d;

    /* 📝 TIPOGRAFIA */
    --texto-brilhante: #ffffff;
    --texto-principal: #e8eefc;
    --texto-secundario: #9db0d5;
    --texto-codigo: #8ec5ff;

    --sidebar-text: var(--texto-principal);
    --sidebar-text-dim: var(--texto-secundario);

    /* 🎛️ BORDAS E CAMADAS */
    --borda: rgba(255, 255, 255, 0.06);
    --borda-leve: rgba(255, 255, 255, 0.03);
    --borda-forte: rgba(255, 255, 255, 0.09);
    --sidebar-border: rgba(138, 164, 216, 0.14);
    --topbar-border: rgba(138, 164, 216, 0.15);

    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(47, 103, 214, 0.2);
    --overlay-input: rgba(255, 255, 255, 0.04);
    --overlay-input-focus: rgba(47, 103, 214, 0.16);

    /* STATUS ALERT */
    --green: #1a9b6a;
    --green-bg: rgba(26, 155, 106, 0.12);

    /* CONFIGURAÇÕES MISC */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.28);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* <--- O fechamento do :root corrigido aqui! */

/* =============================================
   RESET, BASE & GLOBAL INHERITANCE
   ============================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--bg-body);
    color: var(--texto-principal);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* THREE-COLUMN APP LAYOUT */
.app-layout {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

/* =============================================
   HEADER (TOPBAR REDESIGN)
   ============================================= */
.app-header {
    height: 64px;
    min-height: 64px;
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--texto-brilhante);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.header-logo-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
}

.logo-badge {
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--sidebar-text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--texto-brilhante);
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    height: 38px;
    background: var(--overlay-input);
    border: 1px solid var(--borda-forte);
    border-radius: var(--radius-lg);
    color: var(--texto-principal);
    font-size: 13.5px;
    padding: 0 40px 0 36px;
    outline: none;
    transition: all var(--transition);
}

.search-bar input::placeholder {
    color: var(--sidebar-text-dim);
}

.search-bar input:focus {
    background: var(--overlay-input-focus);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text-dim);
    pointer-events: none;
    display: flex;
}

.search-kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    background: var(--sidebar-hover);
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--sidebar-text-dim);
    font-family: monospace;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-link {
    color: var(--sidebar-text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-link:hover {
    color: var(--texto-brilhante);
}

.status-badge {
    background: var(--green-bg);
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--green);
    border-radius: 50%;
    display: inline-block;
}

.btn-signup {
    background-color: var(--accent);
    color: var(--texto-brilhante);
    border: none;
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition);
    text-decoration: none;
}

.btn-signup:hover {
    background-color: var(--accent-hover);
}

.btn-signup:active {
    transform: scale(0.98);
}

/* =============================================
   SIDEBAR (LEFT COLUMN)
   ============================================= */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 8px 24px 16px;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-active);
    border-radius: var(--radius-sm);
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sidebar-text-dim);
    line-height: 1.4;
    user-select: none;
    text-decoration: none;
}

.menu-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--texto-brilhante);
}

.menu-item.active {
    background-color: var(--sidebar-active);
    color: var(--texto-brilhante);
    font-weight: 600;
}

.chapter-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.chapter-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    color: var(--sidebar-text-dim);
    font-size: 13.5px;
    font-weight: 600;
    user-select: none;
}

.chapter-header:hover {
    background-color: var(--sidebar-hover);
    color: var(--texto-brilhante);
}

.chapter-icon {
    display: flex;
    align-items: center;
    margin-right: 8px;
    color: var(--sidebar-text-dim);
}

.chapter-title-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.chapter-chevron {
    display: flex;
    align-items: center;
    color: var(--sidebar-text-dim);
    transition: transform var(--transition);
    transform: rotate(-90deg);
}

.chapter-children {
    list-style: none;
    padding-left: 0;
    display: none;
    margin-top: 2px;
    flex-direction: column;
    gap: 2px;
}

.chapter-container.expanded .chapter-chevron {
    transform: rotate(0deg);
}

.chapter-container.expanded .chapter-children {
    display: flex;
}

.chapter-container.expanded>.chapter-header {
    color: var(--texto-brilhante);
}

.chapter-container.expanded>.chapter-header .chapter-icon,
.chapter-container.expanded>.chapter-header .chapter-chevron {
    color: var(--texto-brilhante);
}

.sub-item {
    padding-left: 32px;
}

.sidebar-section-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--texto-secundario);
    opacity: 0.4;
    margin: 20px 12px 6px 12px;
}

.sidebar-section-header:first-of-type {
    margin-top: 0;
}

.loading {
    text-align: center;
    color: var(--sidebar-text-dim);
    font-style: italic;
    font-size: 12px;
    padding: 16px;
}

/* =============================================
   MAIN CONTENT (CENTER COLUMN)
   ============================================= */
.content-column {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 32px;
}

.main-content {
    width: 100%;
    max-width: 760px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 64px;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

.content-header {
    background: transparent;
    border-bottom: 1px solid var(--borda);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--texto-secundario);
    flex-shrink: 0;
}

/* =============================================
   BREADCRUMB STICKY
   ============================================= */
.breadcrumb-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-body-blur);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 24px 0 16px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--borda-leve);
}

.breadcrumb-item {
    color: var(--texto-secundario);
}

.breadcrumb-item a {
    color: var(--texto-secundario);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    color: var(--texto-secundario);
    opacity: 0.3;
    font-size: 11px;
    margin: 0 2px;
}

.breadcrumb-current {
    color: var(--texto-principal);
    font-weight: 500;
}

.article-container {
    max-width: 800px;
    width: 100%;
    margin: 32px auto;
    padding: 0 32px;
    flex: 1;
}

.article-card {
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin-bottom: 32px;
}

.article-card-header {
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--borda);
}

.article-card-body {
    padding: 24px 0 0 0;
}

#titulo-artigo {
    font-size: 32px;
    font-weight: 700;
    color: var(--texto-brilhante);
    margin-bottom: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* =============================================
   ARTICLE CONTENT TYPOGRAPHY
   ============================================= */
#conteudo-artigo {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--texto-principal);
}

#conteudo-artigo hr {
    border: 0;
    height: 1px;
    background: var(--borda);
    margin: 24px 0;
}

#conteudo-artigo h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: var(--texto-brilhante);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--borda);
    letter-spacing: -0.015em;
}

#conteudo-artigo h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 14px;
    color: var(--texto-brilhante);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--borda-leve);
    letter-spacing: -0.01em;
}

#conteudo-artigo .markdown-article-heading {
    margin-top: 32px;
}

#conteudo-artigo h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 22px 0 10px;
    color: var(--texto-brilhante);
}

#conteudo-artigo h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--texto-brilhante);
}

#conteudo-artigo p {
    margin-bottom: 16px;
    color: var(--texto-principal);
}

#conteudo-artigo a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

#conteudo-artigo a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

#conteudo-artigo ul,
#conteudo-artigo ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

#conteudo-artigo li {
    margin-bottom: 6px;
}

#conteudo-artigo img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--borda);
    margin: 16px 0;
}

#conteudo-artigo pre {
    background: var(--bg-code);
    color: var(--texto-principal);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 16px 0;
    border: 1px solid var(--borda);
}

#conteudo-artigo code {
    background: var(--sidebar-active);
    color: var(--texto-codigo);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

#conteudo-artigo pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

#conteudo-artigo blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--accent-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--texto-principal);
}

.article-feedback {
    margin-top: 40px;
    padding: 20px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.article-feedback-title {
    color: var(--texto-brilhante);
    font-size: 14px;
    font-weight: 600;
}

.article-feedback-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-feedback-btn {
    background: var(--overlay-input);
    border: 1px solid var(--borda-forte);
    border-radius: var(--radius-md);
    color: var(--texto-principal);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.article-feedback-btn:hover,
.article-feedback-btn.selected {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent);
}

.article-feedback-btn:active {
    transform: scale(0.98);
}

.article-feedback-message {
    width: 100%;
    min-height: 18px;
    color: var(--texto-secundario);
    font-size: 12.5px;
}

#conteudo-artigo table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
}

#conteudo-artigo th {
    background: var(--sidebar-hover);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--borda);
    color: var(--texto-brilhante);
}

#conteudo-artigo td {
    padding: 10px 12px;
    border: 1px solid var(--borda);
    color: var(--texto-principal);
}

#conteudo-artigo tr:nth-child(even) td {
    background: var(--borda-leve);
}

.emoji-icon {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.15em;
    margin: 0 0.12em;
    stroke-width: 2;
}

.emoji-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* =============================================
   FLOATING SUPPORT ACTION (BOTTOM RIGHT)
   ============================================= */
.support-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--texto-brilhante);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.support-fab:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.support-fab:active {
    transform: scale(0.98);
}

.support-fab-icon {
    font-size: 16px;
    line-height: 1;
}

.support-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.support-modal.is-open {
    display: flex;
}

.support-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 18, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.support-modal-card {
    position: relative;
    width: min(760px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    background: var(--bg-body);
    border: 1px solid var(--borda-forte);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 24px;
}

.support-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.support-modal-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--texto-secundario);
    margin-bottom: 6px;
}

.support-modal-header h2 {
    color: var(--texto-brilhante);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.support-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--borda-forte);
    background: var(--overlay-input);
    color: var(--texto-principal);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.support-modal-intro {
    color: var(--texto-principal);
    font-size: 15px;
    margin-bottom: 20px;
}

.support-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.support-choice-btn {
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--borda-forte);
    border-radius: 16px;
    padding: 16px;
    color: var(--texto-principal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.support-choice-btn:hover,
.support-choice-btn:focus-visible {
    border-color: var(--accent-border);
    background: var(--accent-bg);
    transform: translateY(-1px);
}

.support-choice-label {
    font-weight: 700;
    color: var(--texto-brilhante);
}

.support-choice-email {
    color: var(--texto-secundario);
    font-size: 13px;
}

.support-details {
    margin-top: 24px;
    border-top: 1px solid var(--borda);
    padding-top: 20px;
}

.support-details.hidden {
    display: none;
}

.support-details h3,
.support-details h4 {
    color: var(--texto-brilhante);
    margin: 0 0 12px;
}

.support-details h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

.support-details h4 {
    font-size: 18px;
    margin-top: 28px;
}

.support-email-copy-label {
    margin-bottom: 10px;
    color: var(--texto-secundario);
}

.support-email-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--borda-forte);
    border-radius: 14px;
    margin-bottom: 18px;
}

#support-email-text {
    color: var(--texto-brilhante);
    font-weight: 700;
    word-break: break-all;
}

.support-copy-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    background: var(--accent);
    color: var(--texto-brilhante);
    font-weight: 700;
    cursor: pointer;
}

.support-copy-btn:hover {
    background: var(--accent-hover);
}

.support-copy-btn.copied {
    background: #1a9b6a;
}

.support-step-list,
.support-check-list {
    padding-left: 20px;
    color: var(--texto-principal);
}

.support-step-list {
    margin-bottom: 14px;
}

.support-step-list li,
.support-check-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.support-check-list {
    list-style: none;
    padding-left: 0;
}

.support-check-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.support-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 700;
    margin-top: 2px;
}

@media (max-width: 700px) {
    .support-fab {
        right: 16px;
        bottom: 16px;
        width: calc(100% - 32px);
        justify-content: center;
    }

    .support-choice-grid {
        grid-template-columns: 1fr;
    }

    .support-modal-card {
        padding: 18px;
    }
}

/* =============================================
   TOC SIDEBAR (RIGHT — STICKY COMPONENT)
   ============================================= */
.toc-sidebar {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 32px;
    margin-left: 64px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 0;
    display: none;
}

.toc-sidebar::-webkit-scrollbar {
    width: 0;
}

.toc-box {
    padding-left: 0;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--texto-secundario);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 1px solid var(--borda);
    padding-left: 0;
    margin: 0;
}

.toc-item {
    font-size: 13px;
    line-height: 1.4;
    color: var(--texto-secundario);
    cursor: pointer;
    transition: all var(--transition);
    padding: 4px 0 4px 16px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item:hover {
    color: var(--texto-brilhante);
}

.toc-item.active {
    color: var(--accent);
    font-weight: 600;
    border-left-color: var(--accent);
}

.toc-item.level-h3 {
    padding-left: 28px;
    font-size: 12.5px;
}

/* =============================================
   WELCOME / EMPTY STATE (TELA INICIAL)
   ============================================= */
.welcome-state {
    text-align: center;
    padding: 80px 24px;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.welcome-state h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--texto-brilhante);
    margin-bottom: 8px;
}

.welcome-state p {
    font-size: 14px;
    color: var(--texto-secundario);
}

/* =============================================
   BOOKSHELF (GRID & CARDS)
   ============================================= */
.bookshelf-container {
    max-width: 1000px;
    margin: 16px auto;
}

.bookshelf-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--texto-brilhante);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.bookshelf-subtitle {
    font-size: 14px;
    color: var(--texto-secundario);
    margin-bottom: 32px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--borda);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    text-decoration: none;
    box-shadow: var(--shadow-card);
}

.book-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.book-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    width: 100%;
}

.book-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.book-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.book-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--texto-brilhante);
    line-height: 1.3;
}

.book-card-arrow {
    color: var(--texto-secundario);
    transition: transform var(--transition), color var(--transition);
}

.book-card:hover .book-card-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.book-card-desc {
    font-size: 13px;
    color: var(--texto-secundario);
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-footer {
    display: flex;
    justify-content: flex-end;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.book-card:hover .book-card-footer {
    opacity: 1;
}

.back-to-shelf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 12px 20px 12px;
    background: var(--overlay-input);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.back-to-shelf:hover {
    background: var(--sidebar-hover);
    color: var(--texto-brilhante);
    border-color: rgba(255, 255, 255, 0.12);
}

.back-to-shelf svg {
    color: var(--sidebar-text-dim);
    transition: transform var(--transition);
}

.back-to-shelf:hover svg {
    color: var(--texto-brilhante);
    transform: translateX(-2px);
}

/* =============================================
   SEARCH MODAL (COMMAND PALETTE)
   ============================================= */
.search-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.search-modal-container {
    background: var(--bg-body);
    width: 100%;
    max-width: 640px;
    border-radius: 12px;
    border: 1px solid var(--borda);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    animation: scaleUp 0.2s ease forwards;
}

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--borda-leve);
    gap: 12px;
}

#modal-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--texto-principal);
    font-size: 16px;
    outline: none;
    font-family: inherit;
}

#modal-search-input::placeholder {
    color: var(--texto-secundario);
    opacity: 0.6;
}

.search-modal-close {
    background: var(--bg-card);
    border: 1px solid var(--borda);
    color: var(--texto-secundario);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.search-modal-body {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
}

.search-modal-body::-webkit-scrollbar {
    width: 6px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: var(--borda);
    border-radius: 4px;
}

.search-results-list {
    list-style: none;
    padding: 8px;
    margin: 0;
}

.search-result-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.1s;
}

/* O Segredo da navegação por teclado: focar no estado ACTIVE */
.search-result-item.active,
.search-result-item:hover {
    background: var(--accent-bg);
}

.search-result-item.active .sr-title,
.search-result-item:hover .sr-title {
    color: var(--accent);
}

.sr-title {
    font-size: 14px;
    color: var(--texto-principal);
    font-weight: 500;
}

.sr-type {
    font-size: 11px;
    color: var(--texto-secundario);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-right: 8px;
}

.sr-context {
    font-size: 12px;
    color: var(--texto-secundario);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--borda-leve);
    background: var(--bg-body);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 12px;
    color: var(--texto-secundario);
}

.search-modal-footer kbd {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: inherit;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}