/* ===================================================================
   LumiROM Documentation - CSS
   =================================================================== */

:root {
    color-scheme: dark;
    --bg-outer: #030407;
    --bg-main: #0b0c14;
    --bg-secondary: #111220;
    --bg-sidebar: #0e0f1a;
    --bg-code: #141525;
    --bg-hover: rgba(59, 130, 246, 0.08);

    --border-color: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(59, 130, 246, 0.25);

    --text-primary: #e8eaf0;
    --text-secondary: #8b90a8;
    --text-muted: #555b78;
    --text-code: #93c5fd;

    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --primary-light: #60a5fa;
    --secondary: #06b6d4;
    --accent: #d946ef;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;

    --link-color: #60a5fa;
    --link-hover: #93c5fd;

    --sidebar-width: 240px;
    --font-main: "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono", monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --transition: all 0.2s ease;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-outer);
    min-height: 100%;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 10%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
        var(--bg-outer);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-code);
    color: var(--text-code);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

pre {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    overflow-x: auto;
    line-height: 1.5;
    font-family: var(--font-mono);
    font-size: 0.86em;
    color: var(--text-primary);
    position: relative;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

blockquote {
    border-left: 3px solid var(--primary);
    margin: 1em 0;
    padding: 0.5em 1em;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

ul,
ol {
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.3em;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2em 0;
}

/* ── #fmain - outer wrapper ─────────────────────── */
div#fmain {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(59, 130, 246, 0.2);
    margin: 1em auto;
    padding: 0;
    width: 92%;
    max-width: 1300px;
}

/* ── Top & Bottom Navigation bars ──────────────────────────────── */
div.related {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.55em 1.2em;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86em;
    flex-wrap: wrap;
}

div.related:first-of-type {
    border-top-left-radius: calc(var(--radius-lg) - 1px);
    border-top-right-radius: calc(var(--radius-lg) - 1px);
}

div.related:last-of-type {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
}

div.related h3 {
    display: none;
}

div.related ul {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

div.related li {
    display: flex;
    align-items: center;
}

div.related li.right {
    margin-left: auto;
}

div.related a {
    color: var(--text-secondary);
    transition: color 0.15s;
    font-weight: 500;
}

div.related a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

div.related li.nav-item-this a {
    color: var(--primary-light);
    font-weight: 600;
}

/* Separator chevron */
div.related li:not(:first-child)::before {
    content: "›";
    color: var(--text-muted);
    margin-right: 6px;
}

div.related li:first-child::before {
    content: none;
}

/* Logo in related bar */
div.related li img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Inline search in top bar ──────────────────────────────────── */
.inline-search form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.inline-search input[type="text"] {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82em;
    padding: 4px 10px;
    outline: none;
    transition: border-color 0.2s;
    width: 160px;
}

.inline-search input[type="text"]:focus {
    border-color: var(--primary);
}

.inline-search input[type="submit"] {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 0.8em;
    padding: 4px 10px;
    transition: opacity 0.2s;
}

.inline-search input[type="submit"]:hover {
    opacity: 0.85;
}

/* ── Document layout ───────────────────────────────────────────── */
div.document {
    display: flex;
    min-height: calc(100vh - 150px);
}

/* ── Sidebar ───────────────────────────────────────────────────── */
div.sphinxsidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    position: sticky;
    top: 0;
    max-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-accent) transparent;
    flex-shrink: 0;
}

div.sphinxsidebar::-webkit-scrollbar {
    width: 4px;
}

div.sphinxsidebar::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 4px;
}

div.sphinxsidebarwrapper {
    padding: 16px 12px;
}

div.sphinxsidebar h3 {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    padding: 0;
}

div.sphinxsidebar h3 a {
    color: inherit;
    text-decoration: none;
}

div.sphinxsidebar h4 {
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 16px 0 6px 0;
    padding: 0;
}

div.sphinxsidebar h4 a {
    color: inherit;
    text-decoration: none;
}

div.sphinxsidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
}

div.sphinxsidebar ul li {
    margin-bottom: 2px;
}

div.sphinxsidebar ul li a {
    display: block;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88em;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

div.sphinxsidebar ul li a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

div.sphinxsidebar ul li.toctree-l1.current>a,
div.sphinxsidebar ul li.current>a {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    border-left: 2px solid var(--primary);
    padding-left: 8px;
}

/* Sub-items */
div.sphinxsidebar ul ul {
    margin-left: 12px;
    margin-top: 2px;
    border-left: 1px solid var(--border-color);
    padding-left: 8px;
}

div.sphinxsidebar ul ul li a {
    font-size: 0.82em;
    color: var(--text-muted);
    padding: 3px 8px;
}

div.sphinxsidebar ul ul li a:hover {
    color: var(--text-secondary);
}

/* Sidebar search box */
div.sphinxsidebar #searchbox {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

div.sphinxsidebar #searchbox h3 {
    margin-bottom: 8px;
}

.searchformwrapper form {
    display: flex;
    gap: 4px;
}

.searchformwrapper input[type="text"] {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82em;
    padding: 5px 8px;
    outline: none;
}

.searchformwrapper input[type="text"]:focus {
    border-color: var(--primary);
}

.searchformwrapper input[type="submit"] {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 0.78em;
    padding: 5px 10px;
    white-space: nowrap;
}

/* ── Document wrapper / body ───────────────────────────────────── */
div.documentwrapper {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

div.bodywrapper {
    padding: 0;
}

div.body {
    padding: 2em 2.5em;
    max-width: 860px;
}

div.body h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

div.body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

div.body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
    color: var(--text-primary);
}

div.body p {
    margin-bottom: 0.9em;
    color: var(--text-secondary);
}

div.body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Header anchor links */
a.headerlink {
    color: var(--text-muted);
    font-size: 0.75em;
    padding: 0 4px;
    visibility: hidden;
    text-decoration: none;
}

*:hover>a.headerlink {
    visibility: visible;
}

a.headerlink:hover {
    color: var(--primary-light);
}

/* ── Footer ────────────────────────────────────────────────────── */
div.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8em;
    padding: 12px 24px;
    text-align: center;
    border-bottom-left-radius: calc(var(--radius-lg) - 1px);
    border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}

div.footer a {
    color: var(--text-secondary);
}

div.footer a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

/* ── Admonitions (warning/note) ────────────────────────────────── */
div.admonition {
    border-radius: var(--radius-md);
    margin: 1.2em 0;
    padding: 12px 16px;
    border-left: 3px solid;
}

div.note {
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.07);
}

div.warning {
    border-color: var(--yellow);
    background: rgba(245, 158, 11, 0.07);
}

div.danger {
    border-color: var(--red);
    background: rgba(239, 68, 68, 0.07);
}

div.tip {
    border-color: var(--green);
    background: rgba(34, 197, 94, 0.07);
}

p.admonition-title {
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    color: var(--text-primary);
}

p.admonition-title::after {
    content: "";
}

/* ── Code copy button ──────────────────────────────────────────── */
pre {
    position: relative;
}

pre button.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.72em;
    font-family: var(--font-main);
    padding: 3px 10px;
    transition: var(--transition);
    letter-spacing: 0.04em;
    font-weight: 600;
}

pre button.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ── Syntax highlight prompt (like fish) ───────────────────────── */
.gp {
    color: var(--text-muted);
    user-select: none;
}

.nf {
    color: var(--primary-light);
}

.no {
    color: var(--secondary);
}

.s2 {
    color: var(--green);
}

.c {
    color: var(--text-muted);
    font-style: italic;
}

.o {
    color: var(--accent);
}

/* ── Devices grid ──────────────────────────────────────────────── */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 1.5em 0;
}

.device-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.device-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 12px var(--primary-glow);
}

.device-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.device-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.device-model {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.device-code {
    font-size: 0.78em;
    color: var(--secondary);
    font-family: var(--font-mono);
    background: rgba(6, 182, 212, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.device-desc {
    font-size: 0.86em;
    color: var(--text-secondary);
    margin: 8px 0;
}

.device-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8em;
    color: var(--text-muted);
}

.status-supported {
    color: var(--green);
    font-weight: 700;
    font-size: 0.85em;
}

/* Device search */
.search-container {
    position: relative;
    margin-bottom: 16px;
    max-width: 360px;
}

.search-container input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9em;
    padding: 9px 14px 9px 38px;
    outline: none;
    transition: border-color 0.2s;
}

.search-container input:focus {
    border-color: var(--primary);
}

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

/* Note box */
.note-box {
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.88em;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.note-box strong {
    color: var(--text-primary);
}

/* ── Feature tabs ──────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85em;
    font-weight: 600;
    padding: 6px 14px;
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    color: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Feature list */
.features-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--border-accent);
}

.feature-icon {
    font-size: 1.3em;
    flex-shrink: 0;
    margin-top: 1px;
}

.feature-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.feature-desc {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Knox apps grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.app-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    text-align: center;
    transition: var(--transition);
    font-size: 0.83em;
    color: var(--text-secondary);
}

.app-card:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.app-card .app-icon {
    font-size: 1.4em;
}

/* ── Build guide ───────────────────────────────────────────────── */
.guide-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.guide-tab-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.88em;
    font-weight: 600;
    padding: 7px 16px;
    transition: var(--transition);
}

.guide-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.guide-tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    color: var(--primary-light);
}

.guide-panel {
    display: none;
}

.guide-panel.active {
    display: block;
}

/* Steps */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 24px;
}

.step-item:last-child {
    padding-bottom: 0;
}

.step-item:last-child::before {
    display: none;
}

/* Vertical connector line */
.step-item::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid var(--primary);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 800;
    flex-shrink: 0;
}

.step-body {
    flex: 1;
}

.step-title {
    font-size: 0.98em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 5px 0 8px;
}

.step-content p {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Terminal block */
.terminal-block {
    background: #080910;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 10px 0;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
}

.term-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f57;
}

.dot-yellow {
    background: #febc2e;
}

.dot-green {
    background: #28c840;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.78em;
    color: var(--text-muted);
    flex: 1;
}

.copy-term-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.72em;
    padding: 2px 8px;
    transition: var(--transition);
}

.copy-term-btn:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.terminal-body {
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    line-height: 1.6;
    color: #b0c4de;
    overflow-x: auto;
}

.terminal-body code {
    background: none;
    border: none;
    color: inherit;
    font-size: inherit;
    padding: 0;
}

.terminal-prompt {
    color: var(--green);
    user-select: none;
    margin-right: 6px;
}

.terminal-cmd {
    color: var(--primary-light);
}

.terminal-output {
    color: var(--text-secondary);
    white-space: pre;
}

/* Alert box */
.alert-box {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 10px 0;
    font-size: 0.88em;
    border-left: 3px solid;
}

.alert-tip {
    background: rgba(34, 197, 94, 0.07);
    border-color: var(--green);
    color: var(--text-secondary);
}

.alert-tip strong {
    color: var(--green);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.07);
    border-color: var(--yellow);
    color: var(--text-secondary);
}

.alert-warning strong {
    color: var(--yellow);
}

/* Cache interactive buttons */
.cache-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.btn-cache {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.78em;
    padding: 5px 12px;
    transition: var(--transition);
}

.btn-cache:hover,
.btn-cache.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ── Changelogs ─────────────────────────────────────────────────── */
.cl-layout {
    display: flex;
    gap: 0;
    min-height: 500px;
}

.cl-sidebar {
    width: 200px;
    min-width: 200px;
    border-right: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    flex-shrink: 0;
}

.cl-series-heading {
    font-size: 0.7em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 14px 4px;
}

.cl-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    padding: 6px 14px;
    width: 100%;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.cl-sidebar-item:hover {
    background: var(--bg-hover);
}

.cl-sidebar-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary);
}

.cl-item-version {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary);
}

.cl-sidebar-item.active .cl-item-version {
    color: var(--primary-light);
}

.cl-item-date {
    font-size: 0.75em;
    color: var(--text-muted);
}

.cl-tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.cl-panel {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cl-hero {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cl-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.cl-version-label {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

.cl-version-label span {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cl-series {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 4px;
}

.cl-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cl-tag {
    border-radius: 20px;
    border: 1px solid;
    font-size: 0.75em;
    font-weight: 700;
    padding: 3px 12px;
    letter-spacing: 0.04em;
}

.cl-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(36, 161, 222, 0.12);
    border: 1px solid rgba(36, 161, 222, 0.3);
    border-radius: var(--radius-sm);
    color: #24A1DE;
    font-size: 0.83em;
    font-weight: 600;
    padding: 6px 14px;
    text-decoration: none;
    transition: var(--transition);
}

.cl-download-btn:hover {
    background: rgba(36, 161, 222, 0.2);
    text-decoration: none;
}

.cl-device-note {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    color: var(--yellow);
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 14px;
    padding: 8px 14px;
}

.cl-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cl-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--section-color, var(--primary));
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.cl-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.cl-section-icon {
    font-size: 1.1em;
}

.cl-section-title {
    font-size: 0.88em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin: 0;
}

.cl-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cl-list li {
    font-size: 0.9em;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
    margin-bottom: 0;
}

.cl-list li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* ── Process flow steps (index page) ───────────────────────────── */
.flow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin: 1.5em 0;
}

.flow-step {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: var(--transition);
}

.flow-step:hover {
    border-color: var(--border-accent);
}

.flow-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid var(--primary);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9em;
    flex-shrink: 0;
}

.flow-step-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 5px;
}

.flow-step-desc {
    font-size: 0.84em;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Highlight box (used in intro) */
.highlight-box {
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 1.2em 0;
}

.highlight-box h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.highlight-box p {
    margin-bottom: 0;
}

/* ── Mobile sidebar toggle (changelogs) ────────────────────────── */
.cl-mobile-toggle {
    display: none;
    margin-bottom: 10px;
}

.cl-mobile-toggle button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.86em;
    font-weight: 600;
    padding: 7px 14px;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    div#fmain {
        width: 100%;
        border-radius: 0;
        margin: 0;
    }

    div.document {
        flex-direction: column;
    }

    div.sphinxsidebar {
        width: 100%;
        min-width: unset;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    div.body {
        padding: 1.5em 1.2em;
    }

    .devices-grid {
        grid-template-columns: 1fr;
    }

    .cl-layout {
        flex-direction: column;
    }

    .cl-sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .cl-mobile-toggle {
        display: block;
    }

    .flow-steps {
        grid-template-columns: 1fr;
    }

    div.sphinxsidebar h3,
    div.sphinxsidebar h4 {
        cursor: pointer;
        padding: 10px;
        background: var(--bg-hover);
        border-radius: var(--radius-sm);
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
    }

    div.sphinxsidebar h3::after,
    div.sphinxsidebar h4::after {
        content: "▼";
        font-size: 0.8em;
        transition: transform 0.2s;
    }

    div.sphinxsidebar h3.collapsed::after,
    div.sphinxsidebar h4.collapsed::after {
        transform: rotate(-90deg);
    }

    div.sphinxsidebar h3.collapsed+ul,
    div.sphinxsidebar h4.collapsed+ul {
        display: none;
    }
}

@media (max-width: 480px) {
    .tab-bar {
        flex-direction: column;
    }

    .guide-tabs {
        flex-direction: column;
    }

    div.related {
        font-size: 0.78em;
    }
}