/* ==========================================================================
   reset & base layout (Classic theme)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Trebuchet MS', sans-serif;
    background: linear-gradient(135deg, #f8f6f6 0%, #ece8e8 100%);
    color: #3a3a3a;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   sidebar & themes selector
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #fff5f5 0%, #faf8f8 100%);
    border-right: 1px solid #d4a5a5;
    padding: 20px;
    position: fixed;
    height: 100vh;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
}

.sidebar h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #8b3a3a;
    margin: 15px 0 10px 0;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar h3:first-child {
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin: 3px 0;
}

.sidebar a {
    color: #a84a4a;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
    word-break: break-word;
    white-space: normal;
}

.sidebar a:hover {
    background: linear-gradient(90deg, #f0e5e5, #e8dcdc);
    color: #8b2e2e;
}

.sidebar a.active {
    background: linear-gradient(90deg, #ffe8e8, #ffd9d9);
    color: #8b2e2e;
    font-weight: 600;
}

.toc-empty {
    padding: 5px 10px;
    font-size: 13px;
    opacity: 0.75;
    font-style: italic;
}

.search-box {
    padding: 8px 12px;
    border: 1px solid #d4a5a5;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    background: linear-gradient(90deg, #fffbfb, #fff8f8);
}

.theme-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.theme-button {
    border: 1px solid #d4a5a5;
    background: linear-gradient(90deg, #fff7f7, #f9efef);
    color: #8b3a3a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 8px 10px;
    text-align: left;
    transition: all 0.25s ease;
}

.theme-button:hover {
    background: linear-gradient(90deg, #f8ecec, #f2e3e3);
    border-color: #b98181;
}

.theme-button.active {
    background: linear-gradient(90deg, #ffe5e5, #ffd6d6);
    border-color: #a84a4a;
    color: #7a2c2c;
}

/* ==========================================================================
   main content & typography
   ========================================================================== */
.content {
    flex: 1;
    margin-left: 250px;
    padding: 40px;
    max-width: 960px;
    width: calc(100% - 250px);
    overflow-wrap: break-word;
}

.main {
    background: linear-gradient(135deg, #fdfbfb 0%, #fcf8f8 100%);
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(139, 0, 0, 0.1);
}

h1 {
    font-size: 2.5em;
    margin: 20px 0 30px 0;
    color: #7a2c2c;
    border-bottom: 3px solid #a84a4a;
    padding-bottom: 10px;
    font-family: 'Trebuchet MS', sans-serif;
    word-break: break-word;
}

h2 {
    font-size: 1.8em;
    margin: 30px 0 15px 0;
    color: #7a2c2c;
    padding-top: 10px;
    border-top: 1px solid #e8d4d4;
    font-family: 'Trebuchet MS', sans-serif;
    word-break: break-word;
}

h3 {
    font-size: 1.3em;
    margin: 20px 0 10px 0;
    color: #7a2c2c;
    font-family: 'Trebuchet MS', sans-serif;
    word-break: break-word;
}

h4 {
    font-size: 1.1em;
    margin: 15px 0 8px 0;
    color: #7a2c2c;
    font-family: 'Trebuchet MS', sans-serif;
}

h5 {
    font-size: 1.0em;
    margin: 12px 0 6px 0;
    color: #7a2c2c;
    font-family: 'Trebuchet MS', sans-serif;
}

h6 {
    font-size: 0.9em;
    margin: 10px 0 5px 0;
    color: #7a2c2c;
    font-family: 'Trebuchet MS', sans-serif;
}

p {
    margin: 15px 0;
    line-height: 1.8;
}

a {
    color: #a84a4a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
    overflow-wrap: break-word;
}

a:hover {
    border-bottom-color: #a84a4a;
    color: #8b2e2e;
}

blockquote {
    border-left: 3px solid #a84a4a;
    padding-left: 15px;
    margin: 15px 0;
    color: #6a5a5a;
    font-style: italic;
}

ul, ol {
    margin: 15px 0;
}

.main ul, .main ol {
    padding-left: 24px;
}

li {
    margin: 8px 0;
}

hr {
    border: none;
    border-top: 2px solid #e8d4d4;
    margin: 30px 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

/* ==========================================================================
   code & base highlight.js tokens
   ========================================================================== */
code {
    background: linear-gradient(90deg, #f5f0f0, #f2eded);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: #b83a3a;
    overflow-wrap: break-word;
}

pre {
    background: linear-gradient(135deg, #2a1f1f 0%, #1f1515 100%);
    color: #e8d5d5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
    line-height: 1.5;
    -webkit-overflow-scrolling: touch;
}

pre code {
    display: block;
    background: transparent;
    color: #e8d5d5;
    padding: 0;
    border: none;
    border-radius: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: pre;
    word-break: normal;
}

.hljs-literal, .hljs-number { color: #ff9d76; }
.hljs-string, .hljs-attr { color: #c9a373; }
.hljs-function, .hljs-title { color: #e8b4a8; }
.hljs-keyword { color: #ff7f7f; }
.hljs-property { color: #d5a8a8; }
.hljs-comment { color: #9c7474; font-style: italic; }
.hljs-variable, .hljs-params { color: #e8d5d5; }
.hljs-punctuation { color: #c9a9a9; }
.hljs-built_in { color: #e8956f; }

/* ==========================================================================
   tables, search highlight, controls & modal
   ========================================================================== */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 3px;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 0;
}

th, td {
    border: 1px solid #d4a5a5;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: linear-gradient(90deg, #f5e8e8, #f0dede);
    font-weight: 600;
    color: #7a2c2c;
    white-space: nowrap;
}

td {
    overflow-wrap: break-word;
}

.toc-toggle {
    display: none;
    background: linear-gradient(135deg, #a84a4a 0%, #8b3a3a 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 18px;
    align-items: center;
    gap: 6px;
}

.toc-toggle:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6f2e2e 100%);
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.2);
}

mark.womble-highlight {
    background-color: #ffd1d1;
    color: #7a2c2c;
    border-bottom: 1px dashed #a84a4a;
    padding: 0 2px;
    border-radius: 2px;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #a84a4a 0%, #8b3a3a 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(139, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 1000;
}

.back-to-top svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #b85a5a 0%, #9b4a4a 100%);
}

/* modal */
.womble-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 15px;
}

.womble-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.womble-modal {
    background: linear-gradient(135deg, #fdfbfb 0%, #fcf8f8 100%);
    border: 1px solid #d4a5a5;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.2);
    width: 100%;
    max-width: 850px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.25s ease;
}

.womble-modal-overlay.visible .womble-modal {
    transform: translateY(0);
}

.womble-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #e8d4d4;
    background: rgba(255, 255, 255, 0.5);
    gap: 10px;
    flex-wrap: wrap;
}

.womble-modal-title {
    font-size: 1.05em;
    color: #7a2c2c;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-family: inherit;
    word-break: break-all;
    flex: 1;
    min-width: 160px;
}

.womble-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.womble-modal-btn {
    background: linear-gradient(135deg, #a84a4a 0%, #8b3a3a 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.womble-modal-btn:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6f2e2e 100%);
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.2);
    color: white;
    border-bottom-color: transparent;
}

.womble-modal-close {
    background: transparent;
    border: none;
    color: #7a2c2c;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.womble-modal-close:hover {
    color: #b83a3a;
}

.womble-modal-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.womble-modal-body pre {
    margin: 0;
    max-height: 100%;
    overflow-x: auto;
}

/* ==========================================================================
   Dark theme
   ========================================================================== */
body.theme-dark {
    background: linear-gradient(135deg, #141212 0%, #0d0c0c 100%);
    color: #d1c7c7;
}

body.theme-dark .sidebar {
    background: linear-gradient(180deg, #1c1818 0%, #151212 100%);
    border-right-color: #522d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.theme-dark .sidebar h3 { color: #e58e8e; }
body.theme-dark .sidebar a { color: #e27d7d; }

body.theme-dark .sidebar a:hover {
    background: linear-gradient(90deg, #2b1f1f, #241a1a);
    color: #ff9e9e;
}

body.theme-dark .sidebar a.active {
    background: linear-gradient(90deg, #3d2222, #331c1c);
    color: #ffb3b3;
}

body.theme-dark .theme-button {
    border-color: #522d2d;
    background: linear-gradient(90deg, #211919, #1c1515);
    color: #e58e8e;
}

body.theme-dark .theme-button:hover {
    background: linear-gradient(90deg, #2b1f1f, #261b1b);
    border-color: #723e3e;
}

body.theme-dark .theme-button.active {
    background: linear-gradient(90deg, #422121, #381c1c);
    border-color: #a84a4a;
    color: #ffb3b3;
}

body.theme-dark .main {
    background: linear-gradient(135deg, #1d1818 0%, #171313 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark h5,
body.theme-dark h6 {
    color: #f0a8a8;
}

body.theme-dark h1 { border-bottom-color: #a84a4a; }
body.theme-dark h2,
body.theme-dark hr { border-top-color: #3d2828; }

body.theme-dark a { color: #e57373; }
body.theme-dark a:hover {
    color: #ff8a8a;
    border-bottom-color: #ff8a8a;
}

body.theme-dark code {
    background: linear-gradient(90deg, #2b1c1c, #261818);
    color: #ff8e8e;
}

body.theme-dark pre code {
    background: transparent;
    color: #e8d5d5;
    padding: 0;
}

body.theme-dark blockquote {
    border-left-color: #a84a4a;
    color: #a89292;
}

body.theme-dark th,
body.theme-dark td {
    border-color: #522d2d;
}

body.theme-dark th {
    background: linear-gradient(90deg, #281a1a, #211515);
    color: #f0a8a8;
}

body.theme-dark .search-box {
    border-color: #522d2d;
    background: linear-gradient(90deg, #211919, #1c1515);
    color: #e0d8d8;
}

body.theme-dark mark.womble-highlight {
    background-color: #591b1b;
    color: #ffc2c2;
    border-bottom-color: #ff8a8a;
}

body.theme-dark .womble-modal {
    background: linear-gradient(135deg, #1d1818 0%, #171313 100%);
    border-color: #522d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

body.theme-dark .womble-modal-header {
    border-bottom-color: #3d2828;
    background: rgba(0, 0, 0, 0.2);
}

body.theme-dark .womble-modal-title { color: #f0a8a8; }

body.theme-dark .womble-modal-btn {
    background: linear-gradient(135deg, #8b3a3a 0%, #6f2e2e 100%);
    color: #ffb3b3;
}

body.theme-dark .womble-modal-btn:hover {
    background: linear-gradient(135deg, #a84a4a 0%, #8b3a3a 100%);
}

body.theme-dark .womble-modal-close { color: #f0a8a8; }

/* ==========================================================================
   Metro theme
   ========================================================================== */
body.theme-metro {
    background: #ffcc44;
    color: #070707;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
}

body.theme-metro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10em;
    background: #66cc33;
    z-index: 2;
}

body.theme-metro .sidebar {
    width: 11.5em;
    background: #2299dd;
    border-right: none;
    box-shadow: none;
    padding-top: 10.8em;
    padding-left: 10px;
    padding-right: 10px;
    z-index: 3;
    overflow-y: auto;
    overflow-x: hidden;
}

body.theme-metro .sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 11.5em;
    height: 10em;
    background: #ff0000;
    z-index: 4;
    pointer-events: none;
}

body.theme-metro .sidebar h3 {
    color: #ffffff;
    letter-spacing: 0.12em;
    font-size: 11px;
    margin-top: 14px;
    margin-bottom: 6px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

body.theme-metro #toc-list {
    margin: 0 0 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    border-bottom: 1px solid rgba(0, 0, 0, 0.22);
    background: rgba(0, 0, 0, 0.08);
    padding: 4px 0;
    overflow-y: visible;
    overflow-x: hidden !important;
}

body.theme-metro .sidebar a {
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 0;
    padding: 8px 10px;
    margin: 2px 0;
    border-bottom: none;
    text-transform: uppercase;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.3;
}

body.theme-metro .sidebar a:hover,
body.theme-metro .sidebar a.active {
    background: rgba(0, 0, 0, 0.25);
    color: #ffe58b;
    border-left-color: #ffe58b;
}

body.theme-metro .sidebar .search-box {
    font-family: Arial, sans-serif;
    border: 2px solid #000000;
    border-radius: 0;
    background: #ffffff;
    color: #222222;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    padding: 8px;
    margin-bottom: 10px;
}

body.theme-metro .theme-button {
    font-family: Arial, sans-serif;
    border: 1px solid #333333;
    border-radius: 0;
    background: #ffcc44;
    color: #222222;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

body.theme-metro .theme-button:hover,
body.theme-metro .theme-button.active {
    background: #333333;
    color: #ffffff;
    border-color: #ffffff;
}

body.theme-metro .content {
    margin-left: 14em;
    max-width: 53em;
    padding: 2.2em 2em 2em;
    overflow-x: visible;
    width: auto;
}

body.theme-metro .main {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 2em;
    font-size: 85%;
    position: relative;
    z-index: auto;
}

body.theme-metro h1 {
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: normal;
    letter-spacing: 0.35em;
    border-bottom: none;
    margin: 0 0 0.7em;
    padding-bottom: 0;
    text-transform: uppercase;
}

body.theme-metro #content h1:first-of-type {
    position: relative;
    z-index: 5;
    max-width: none;
    margin: -1.75em -2em 0.5em -2.75em;
    padding: 1.5em 2em 0.5em 0;
    font-size: clamp(2.3rem, 7.1vw, 5.1rem);
    letter-spacing: 0.43em;
    line-height: 1;
    overflow: visible;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    width: auto;
    background: transparent;
}

body.theme-metro h2 {
    color: #333333;
    font-size: 200%;
    font-weight: normal;
    letter-spacing: 3px;
    border-top: none;
}

body.theme-metro h3 {
    color: #333333;
    font-size: 155%;
    font-weight: normal;
    letter-spacing: 1px;
}

body.theme-metro h4,
body.theme-metro h5,
body.theme-metro h6 {
    color: #322222;
    letter-spacing: 1px;
}

body.theme-metro a {
    color: #aa3300;
    font-weight: bold;
    border-bottom: none;
}

body.theme-metro a:hover {
    color: #ffffff;
    background: #aa3300;
}

body.theme-metro code {
    background: #ffe38f;
    color: #222222;
    border-radius: 0;
}

body.theme-metro pre {
    background: #111111 !important;
    color: #f5f5f5 !important;
    border-radius: 0;
    border: 2px solid #000000;
}

body.theme-metro pre code {
    background: transparent !important;
    color: #f5f5f5 !important;
    border: none !important;
    padding: 0 !important;
    display: block;
}

body.theme-metro .hljs-keyword { color: #00ebb4 !important; font-weight: bold; }
body.theme-metro .hljs-string { color: #f2c541 !important; }
body.theme-metro .hljs-comment { color: #55a8de !important; font-style: italic; }
body.theme-metro .hljs-number, body.theme-metro .hljs-literal { color: #ff6060 !important; }
body.theme-metro .hljs-title, body.theme-metro .hljs-function { color: #66cc33 !important; }

body.theme-metro th, body.theme-metro td { border: 2px solid #000000; }
body.theme-metro th {
    background: #66cc33;
    color: #ffffff;
    text-transform: uppercase;
}
body.theme-metro td { background: rgba(255, 255, 255, 0.6); }

body.theme-metro .sidebar::-webkit-scrollbar { width: 8px; }
body.theme-metro .sidebar::-webkit-scrollbar-track { background: #157cb6; }
body.theme-metro .sidebar::-webkit-scrollbar-thumb {
    background: #ffe58b;
    border: 1px solid #157cb6;
}

body.theme-metro mark.womble-highlight {
    background-color: #000000;
    color: #ffe58b;
    border-bottom: 2px solid #ff0000;
    border-radius: 0;
}

body.theme-metro .back-to-top {
    background: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    box-shadow: none;
}

body.theme-metro .back-to-top:hover {
    background: #66cc33;
    color: #ffffff;
    transform: none;
}

body.theme-metro .toc-toggle {
    background: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    text-transform: uppercase;
    font-weight: bold;
}

body.theme-metro .womble-modal {
    background: #ffcc44;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 8px 8px 0px #000000;
    font-family: Arial, sans-serif;
}

body.theme-metro .womble-modal-header {
    border-bottom: 2px solid #000000;
    background: #66cc33;
}

body.theme-metro .womble-modal-title {
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

body.theme-metro .womble-modal-btn {
    background: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    font-weight: bold;
}

body.theme-metro .womble-modal-btn:hover { background: #2299dd; }
body.theme-metro .womble-modal-close { color: #000000; font-weight: bold; }

/* ==========================================================================
   Plain theme
   ========================================================================== */
body.theme-plain {
    background: #ffffff;
    color: #111111;
    font-family: Georgia, 'Times New Roman', serif;
}

body.theme-plain .sidebar {
    width: 220px;
    background: #fafafa;
    border-right: 1px solid #c9d2da;
    box-shadow: none;
    padding: 15px;
}

body.theme-plain .sidebar h3 {
    color: #003049;
    font-family: Georgia, 'Times New Roman', serif;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    margin: 12px 0 6px 0;
}

body.theme-plain .sidebar a {
    color: #003049;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px;
    border-radius: 0;
    padding: 4px 6px;
    margin: 1px 0;
    border-bottom: 1px solid transparent;
}

body.theme-plain .sidebar a:hover,
body.theme-plain .sidebar a.active {
    background: transparent;
    color: #001d2f;
    border-bottom-color: #003049;
    font-weight: bold;
}

body.theme-plain .sidebar .search-box {
    border: 1px solid #c9d2da;
    background: #ffffff;
    color: #111111;
    border-radius: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    padding: 6px;
    margin-bottom: 8px;
}

body.theme-plain .theme-button {
    background: #ffffff;
    color: #003049;
    border: 1px solid #c9d2da;
    border-radius: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    padding: 6px 8px;
    font-size: 12px;
}

body.theme-plain .theme-button:hover,
body.theme-plain .theme-button.active {
    background: #f4f7fa;
    border-color: #003049;
    color: #001d2f;
}

body.theme-plain .content {
    margin-left: 220px;
    max-width: 760px;
    padding: 30px 25px;
    width: calc(100% - 220px);
}

body.theme-plain .main {
    background: #ffffff;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

body.theme-plain h1,
body.theme-plain h2,
body.theme-plain h3,
body.theme-plain h4,
body.theme-plain h5,
body.theme-plain h6 {
    color: #003049;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: 0;
    border-bottom: none;
    border-top: none;
}

body.theme-plain h1 { font-size: 2em; margin: 0 0 0.4em 0; }
body.theme-plain h2 { font-size: 1.4em; margin: 1.2em 0 0.5em; }
body.theme-plain h3 { font-size: 1.15em; margin: 1em 0 0.4em; }
body.theme-plain h4 { font-size: 1em; margin: 0.8em 0 0.3em; }
body.theme-plain h5 { font-size: 0.95em; margin: 0.7em 0 0.25em; }
body.theme-plain h6 { font-size: 0.9em; margin: 0.6em 0 0.2em; }

body.theme-plain p,
body.theme-plain li {
    line-height: 1.6;
    margin: 10px 0;
    font-size: 15px;
}

body.theme-plain a {
    color: #003049;
    border-bottom: 1px solid transparent;
}

body.theme-plain a:hover {
    color: #001d2f;
    border-bottom-color: #003049;
}

body.theme-plain code {
    background: #f3f5f7;
    color: #003049;
    border-radius: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
}

body.theme-plain pre {
    background: #f7f9fa !important;
    color: #24292e !important;
    border: 1px solid #d7dde3;
    border-radius: 0;
    font-size: 0.85em;
}

body.theme-plain pre code {
    background: transparent !important;
    color: #24292e !important;
    border: none !important;
    padding: 0 !important;
    font-size: 1em;
    display: block;
}

body.theme-plain .hljs-keyword { color: #d73a49 !important; font-weight: bold; }
body.theme-plain .hljs-string, body.theme-plain .hljs-attr { color: #032f62 !important; }
body.theme-plain .hljs-comment { color: #6a737d !important; font-style: italic; }
body.theme-plain .hljs-title, body.theme-plain .hljs-function { color: #6f42c1 !important; }
body.theme-plain .hljs-number, body.theme-plain .hljs-literal, body.theme-plain .hljs-built_in { color: #005cc5 !important; }
body.theme-plain .hljs-property,
body.theme-plain .hljs-variable,
body.theme-plain .hljs-params,
body.theme-plain .hljs-punctuation { color: #24292e !important; }

body.theme-plain th, body.theme-plain td { border: 1px solid #c9d2da; }
body.theme-plain th { background: #f4f7fa; color: #003049; }

body.theme-plain mark.womble-highlight {
    background-color: #d1ecf1;
    color: #0c5460;
    border-bottom: 1px solid #0c5460;
    border-radius: 0;
}

body.theme-plain .back-to-top {
    background: #003049;
    color: #ffffff;
    border-radius: 0;
    border: 1px solid #003049;
    box-shadow: none;
    width: 38px;
    height: 38px;
}

body.theme-plain .back-to-top:hover {
    background: #ffffff;
    color: #003049;
    transform: none;
}

body.theme-plain .toc-toggle {
    background: #003049;
    color: #ffffff;
    border-radius: 0;
    font-family: Georgia, serif;
}

body.theme-plain .womble-modal {
    background: #ffffff;
    border: 1px solid #c9d2da;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: Georgia, 'Times New Roman', serif;
}

body.theme-plain .womble-modal-header {
    border-bottom: 1px solid #c9d2da;
    background: #fafafa;
}

body.theme-plain .womble-modal-title { color: #003049; }

body.theme-plain .womble-modal-btn {
    background: #003049;
    color: #ffffff;
    border: 1px solid #003049;
    border-radius: 0;
    font-family: Georgia, serif;
}

body.theme-plain .womble-modal-btn:hover { background: #001d2f; }
body.theme-plain .womble-modal-close { color: #003049; }

/* ==========================================================================
   Scaruffi theme
   ========================================================================== */
body.theme-scaruffi {
    background: #ffffff url('https://www.scaruffi.com/music/back.jpg') repeat !important;
    color: #000000 !important;
    font-family: "Times New Roman", Times, serif !important;
}

body.theme-scaruffi .sidebar {
    background: #fedcba !important;
    border-right: 1px solid #000000 !important;
    box-shadow: none !important;
    width: 200px !important;
}

body.theme-scaruffi .sidebar::before {
    content: "womble";
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #0034ff;
    text-align: center;
    border-bottom: 2px solid #000000;
    margin-bottom: 10px;
}

body.theme-scaruffi .sidebar h3 {
    color: #0034ff !important;
    font-family: "Times New Roman", Times, serif !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 14px !important;
    border-bottom: 1px solid #000000 !important;
    margin-top: 10px !important;
    margin-bottom: 5px !important;
    padding-bottom: 2px !important;
}

body.theme-scaruffi #toc-list {
    list-style: none !important;
    padding: 0 !important;
}

body.theme-scaruffi #toc-list li {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
}

body.theme-scaruffi .sidebar a {
    color: #0000ff !important;
    text-decoration: underline !important;
    padding: 1px 2px !important;
    font-size: 12px !important;
    border-radius: 0 !important;
    display: inline !important;
}

body.theme-scaruffi .sidebar a:hover,
body.theme-scaruffi .sidebar a.active {
    background: #0034ff !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

body.theme-scaruffi .sidebar .search-box {
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    font-family: inherit !important;
    width: 100% !important;
    padding: 4px !important;
    margin-bottom: 10px !important;
}

body.theme-scaruffi .theme-list {
    display: block !important;
    margin-top: 20px !important;
}

body.theme-scaruffi .theme-button {
    border: 1px solid #000000 !important;
    background: #fedcba !important;
    color: #000000 !important;
    font-family: inherit !important;
    border-radius: 0 !important;
    padding: 2px 4px !important;
    margin-bottom: 1px !important;
    font-size: 11px !important;
    width: 100% !important;
    text-align: left !important;
}

body.theme-scaruffi .theme-button.active {
    background: #ffff00 !important;
    font-weight: bold !important;
}

body.theme-scaruffi .content {
    margin-left: 200px !important;
    padding: 0 15px 15px 15px !important;
    max-width: none !important;
    width: calc(100% - 200px) !important;
}

body.theme-scaruffi .content::before {
    content: "Home | Contact | Search | Support this site";
    display: block;
    border-bottom: 1px solid #000000;
    padding: 5px 0;
    margin-bottom: 10px;
    font-size: 12px;
    color: #000000;
    background: #fedcba;
}

body.theme-scaruffi .main {
    background: #fedcba !important;
    box-shadow: none !important;
    border: 1px solid #000000 !important;
    padding: 15px !important;
}

body.theme-scaruffi h1,
body.theme-scaruffi h2,
body.theme-scaruffi h3,
body.theme-scaruffi h4,
body.theme-scaruffi h5,
body.theme-scaruffi h6 {
    color: #0702b6 !important;
    font-family: "Times New Roman", Times, serif !important;
    border: none !important;
    margin: 0.8em 0 0.4em 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body.theme-scaruffi h1 { font-size: 2.5em !important; border-bottom: 1px solid #0034ff !important; }
body.theme-scaruffi h2 { font-size: 1.8em !important; }
body.theme-scaruffi h3 { font-size: 1.4em !important; }

body.theme-scaruffi p,
body.theme-scaruffi li {
    margin: 0.4em 0 !important;
    line-height: 1.3 !important;
    font-size: 16px !important;
}

body.theme-scaruffi a {
    color: #0000ff !important;
    text-decoration: underline !important;
}

body.theme-scaruffi a:hover { color: #0034ff !important; }

body.theme-scaruffi code {
    background: #f0f0f0 !important;
    color: #000000 !important;
    border: 1px solid #999999 !important;
    border-radius: 0 !important;
    padding: 0 4px !important;
    font-size: 0.9em !important;
}

body.theme-scaruffi pre {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
    padding: 5px !important;
    overflow-x: auto !important;
}

body.theme-scaruffi pre code {
    background: transparent !important;
    color: #000000 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 1em !important;
    display: block;
}

body.theme-scaruffi .hljs-keyword { text-decoration: underline; font-weight: bold; color: #0000ff !important; }
body.theme-scaruffi .hljs-string, body.theme-scaruffi .hljs-attr { font-style: italic; color: #006600 !important; }
body.theme-scaruffi .hljs-comment { color: #555555 !important; font-style: italic; }
body.theme-scaruffi .hljs-number, body.theme-scaruffi .hljs-literal, body.theme-scaruffi .hljs-built_in { color: #990000 !important; }
body.theme-scaruffi .hljs-title, body.theme-scaruffi .hljs-function { color: #0702b6 !important; font-weight: bold; }
body.theme-scaruffi .hljs-property,
body.theme-scaruffi .hljs-variable,
body.theme-scaruffi .hljs-params,
body.theme-scaruffi .hljs-punctuation { color: #000000 !important; }

body.theme-scaruffi th, body.theme-scaruffi td { border: 1px solid #000000 !important; }
body.theme-scaruffi th { background: #ffcc99 !important; color: #0034ff !important; }

body.theme-scaruffi mark.womble-highlight {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
    border-radius: 0;
}

body.theme-scaruffi .back-to-top {
    background: #fedcba !important;
    color: #0000ff !important;
    border: 1px solid #000000 !important;
    border-radius: 0;
    box-shadow: none;
}

body.theme-scaruffi .back-to-top:hover {
    background: #0000ff !important;
    color: #ffffff !important;
    transform: none;
}

body.theme-scaruffi .toc-toggle {
    background: #fedcba !important;
    color: #0000ff !important;
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
}

body.theme-scaruffi .womble-modal {
    background: #fedcba !important;
    border: 2px solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: "Times New Roman", Times, serif !important;
}

body.theme-scaruffi .womble-modal-header {
    border-bottom: 1px solid #000000 !important;
    background: #fedcba !important;
}

body.theme-scaruffi .womble-modal-title {
    color: #0702b6 !important;
    font-size: 16px !important;
}

body.theme-scaruffi .womble-modal-btn {
    background: #fedcba !important;
    color: #0000ff !important;
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
    text-decoration: underline !important;
    font-family: inherit !important;
}

body.theme-scaruffi .womble-modal-btn:hover {
    background: #0000ff !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

body.theme-scaruffi .womble-modal-close { color: #0000ff !important; }

/* ==========================================================================
   10. Responsive Breakpoints
   ========================================================================== */
@media screen and (max-width: 70em) {
    body.theme-metro { font-size: 110%; }
    body.theme-metro .content {
        margin-left: 12em;
        max-width: 42em;
    }
    body.theme-metro .main { padding: 1.5em; }
    body.theme-metro #content h1:first-of-type {
        letter-spacing: 0.25em;
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        width: 260px !important;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    }

    .sidebar.active {
        left: 0 !important;
    }

    .content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 12px !important;
    }

    .main {
        padding: 20px 14px !important;
        border-radius: 4px;
    }

    .toc-toggle { display: inline-flex; }

    h1 {
        font-size: 1.8em;
        margin: 10px 0 18px 0;
        padding-bottom: 8px;
    }

    h2 {
        font-size: 1.35em;
        margin: 24px 0 12px 0;
        padding-top: 8px;
    }

    h3 {
        font-size: 1.15em;
        margin: 16px 0 8px 0;
    }

    p, li {
        font-size: 15px;
        line-height: 1.6;
    }

    table {
        font-size: 13.5px;
        min-width: 580px;
    }

    th, td { padding: 8px 10px; }

    pre {
        padding: 12px;
        font-size: 0.85em;
        border-radius: 4px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .womble-modal-overlay { padding: 10px; }
    .womble-modal { max-height: 90vh; }
    .womble-modal-header { padding: 10px 14px; }
    .womble-modal-body { padding: 10px; }

    /* Metro mobile overrides */
    body.theme-metro::before { display: none; }
    body.theme-metro .sidebar { padding-top: 20px !important; }
    body.theme-metro .sidebar::before { display: none !important; }

    body.theme-metro #content h1:first-of-type {
        white-space: normal !important;
        font-size: 2rem !important;
        letter-spacing: 0.15em !important;
        margin: 0 0 0.5em 0 !important;
        padding: 0.35em 0.5em !important;
        background: #66cc33 !important;
        color: #ffffff !important;
    }

    body.theme-metro #content h1:first-of-type + * {
        margin-top: 1em !important;
    }

    /* Scaruffi mobile overrides */
    body.theme-scaruffi .sidebar {
        left: -220px !important;
        width: 210px !important;
    }

    body.theme-scaruffi .sidebar.active {
        left: 0 !important;
    }

    body.theme-scaruffi .content::before {
        font-size: 11px;
        padding: 4px 6px;
    }
}
