:root {
    --bg1: #21272a;
    --bg2: #1a1e21;
    --bg3: #14181a;
    --bg4: #0f1214;
    --text1: #fefefe;
    --text2: #cbcbcb;
    --text3: #989898;
    --text4: #656565;
    --accent1: #fba43b;
    --accent2: #c8832f;
    --accent3: #966223;
    --sidebar-width: 230px;
    --nav-header-height: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg1);
    color: var(--text1);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.65;
}

/* ── Layout ─────────────────────────────────────────────────── */

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg2);
    border-right: 1px solid var(--bg4);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0 24px;
    flex-shrink: 0;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent3); }

#content {
    flex: 1;
    overflow-y: auto;
    padding: 36px 48px 60px;
    max-width: 900px;
}

#content::-webkit-scrollbar { width: 6px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
#content::-webkit-scrollbar-thumb:hover { background: var(--accent3); }

/* ── Sidebar Navigation ─────────────────────────────────────── */

/* Website-only back link (see nav.js); never rendered in the in-app help. */
.nav-back {
    display: block;
    padding: 10px 16px 8px;
    color: var(--text3);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s;
}

.nav-back:hover { color: var(--accent1); text-decoration: none; }

.nav-logo {
    padding: 4px 16px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--bg4);
    margin-bottom: 10px;
}

.nav-logo span {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent1);
    letter-spacing: 0.3px;
}

.nav-section {
    margin-top: 4px;
}

.nav-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text4);
    padding: 10px 16px 4px;
    cursor: default;
    user-select: none;
}

.nav-section a {
    display: block;
    padding: 5px 16px 5px 22px;
    color: var(--text3);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-section a:hover {
    color: var(--text1);
    background: rgba(251, 164, 59, 0.07);
}

.nav-section a.active {
    color: var(--accent1);
    border-left-color: var(--accent1);
    background: rgba(251, 164, 59, 0.1);
    font-weight: 500;
}

/* ── Typography ─────────────────────────────────────────────── */

h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text1);
    margin-bottom: 8px;
    line-height: 1.3;
}

h1 .page-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent1);
    background: rgba(251, 164, 59, 0.12);
    border: 1px solid rgba(251, 164, 59, 0.25);
    border-radius: 3px;
    padding: 2px 7px;
    vertical-align: middle;
    margin-left: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.page-subtitle {
    color: var(--text3);
    font-size: 14px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg3);
}

h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text1);
    margin: 32px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bg3);
}

h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent1);
    margin: 22px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

p { margin-bottom: 12px; color: var(--text2); }

p:last-child { margin-bottom: 0; }

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

strong { color: var(--text1); font-weight: 600; }

/* ── Lists ──────────────────────────────────────────────────── */

ul, ol {
    margin: 8px 0 14px 20px;
    color: var(--text2);
}

li { margin-bottom: 4px; }
li strong { color: var(--text1); }

/* ── Tables ─────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 14px 0 20px; }

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

th {
    background: var(--bg3);
    color: var(--text1);
    font-weight: 600;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--accent3);
    white-space: nowrap;
}

td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--bg3);
    color: var(--text2);
    vertical-align: top;
}

tr:hover td { background: rgba(255,255,255,0.02); }

td code, th code {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    background: var(--bg4);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--accent1);
}

/* ── Code / Inline code ─────────────────────────────────────── */

code {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 12.5px;
    background: var(--bg4);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent1);
}

/* ── Callout boxes ──────────────────────────────────────────── */

.note, .tip, .warning, .important {
    border-left: 4px solid;
    border-radius: 0 4px 4px 0;
    padding: 10px 14px;
    margin: 16px 0;
    font-size: 13.5px;
}

.note {
    border-color: #5b9bd5;
    background: rgba(91, 155, 213, 0.08);
    color: var(--text2);
}

.tip {
    border-color: #4caf7d;
    background: rgba(76, 175, 125, 0.08);
    color: var(--text2);
}

.warning {
    border-color: var(--accent1);
    background: rgba(251, 164, 59, 0.08);
    color: var(--text2);
}

.important {
    border-color: #e05c5c;
    background: rgba(224, 92, 92, 0.08);
    color: var(--text2);
}

.note strong, .tip strong, .warning strong, .important strong {
    color: var(--text1);
    display: block;
    margin-bottom: 3px;
}

/* ── Step list ──────────────────────────────────────────────── */

.steps { list-style: none; margin: 12px 0 16px; padding: 0; counter-reset: step; }

.steps li {
    counter-increment: step;
    padding: 8px 12px 8px 44px;
    margin-bottom: 6px;
    background: var(--bg2);
    border-radius: 4px;
    position: relative;
    color: var(--text2);
    border: 1px solid var(--bg3);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: var(--accent3);
    color: var(--text1);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Shortcut / key badge ───────────────────────────────────── */

kbd {
    display: inline-block;
    background: var(--bg3);
    border: 1px solid var(--bg1);
    border-bottom: 2px solid var(--bg4);
    border-radius: 3px;
    padding: 2px 7px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text1);
    white-space: nowrap;
}

/* ── Screenshots ────────────────────────────────────────────── */

.screenshot {
    display: block;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    margin: 16px 0;
}

.screenshot-placeholder {
    border: 2px dashed rgba(251, 164, 59, 0.3);
    border-radius: 5px;
    padding: 22px 16px;
    text-align: center;
    color: var(--text4);
    font-size: 13px;
    margin: 16px 0;
    background: rgba(251, 164, 59, 0.03);
    font-style: italic;
}

/* ── Feature cards (index page) ─────────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--bg3);
    border-radius: 6px;
    padding: 14px 16px;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, background 0.15s;
}

.card:hover {
    border-color: var(--accent2);
    background: var(--bg1);
    text-decoration: none;
}

.card-icon { font-size: 20px; margin-bottom: 6px; }

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text1);
    margin-bottom: 3px;
}

.card-desc { font-size: 12px; color: var(--text3); line-height: 1.4; }

/* ── License tier table ─────────────────────────────────────── */

.tier-table th { text-align: center; }
.tier-table td { text-align: center; }
.tier-table td:first-child { text-align: left; font-weight: 500; color: var(--text1); }
.check { color: #4caf7d; font-size: 16px; }
.cross { color: #e05c5c; font-size: 16px; }
.partial { color: var(--accent1); font-size: 13px; }

/* ── Definition list ────────────────────────────────────────── */

dl { margin: 10px 0 16px; }
dt { font-weight: 600; color: var(--text1); margin-top: 10px; font-size: 13.5px; }
dd { margin-left: 16px; color: var(--text2); margin-bottom: 4px; font-size: 13.5px; }

/* ── Section divider ────────────────────────────────────────── */

hr { border: none; border-top: 1px solid var(--bg3); margin: 28px 0; }
