/* ==========================================================================
   1. VARIABLES & CONFIGURATION
   ========================================================================== */

:root {
    --black: #000;
    --white: #fff;
    --blue: #0F172A;
    --gray: #f2f2f2;
    --border: #ddd;

    --stripe-red: #E52521;
    --stripe-orange: #FF6A00;
    --stripe-yellow: #FFC400;

    --fs-h1: 4rem;
    --fs-h2: 2.5rem;
    --fs-h3: 1.5rem;
    --fs-h4: 1.2rem;
    --fs-body: 1.1rem;
    --fs-small: .9rem;
    --fs-xsmall: .7rem;

    --sp-xs: .5rem;
    --sp-s: 1rem;
    --sp-m: 2rem;
    --sp-l: 4rem;
    --sp-xl: 8rem;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   2. BASE & TYPOGRAPHIE
   ========================================================================== */

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    margin: 0;
    height: 100%;
    line-height: 1.2;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

body.modal-open {
    overflow: hidden;
    padding-right: 15px;
}

a {
    color: #000;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

h1 {
    font-size: var(--fs-h1);
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: var(--sp-l);
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: var(--sp-m) 0;
}

.section-title {
    text-transform: uppercase;
    font-size: var(--fs-h2);
    padding-bottom: var(--sp-m);
    margin: 0;
}

.small-text {
    font-size: var(--fs-small);
    color: #444;
    font-style: italic;
}

.footer {
    text-align: center;
    margin-top: var(--sp-s);
}

.footer p {
    font-weight: bold;
    text-transform: uppercase;
    font-size: var(--fs-small);
    margin-bottom: var(--sp-m)
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

textarea {
    resize: none;
}

/* ==========================================================================
   3. NAVIGATION & LAYOUT
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    width: 100%;
    flex: 1;
    padding: 0;
    padding-inline: clamp(1rem, 4vw, 2rem);
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
}

.navbar {
    /** border-top: 2px solid var(--blue);
    border-bottom: 2px solid var(--blue);
    overflow: hidden; **/
    position: relative;
    background: white;
    z-index: 1000;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: black;
    padding: 5px;
    z-index: 1001;
}

.nav-container {
    height: 70px;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    position: relative;
    z-index: 2;
}

.logo-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.logo {
    font-weight: 900;
    text-decoration: none;
    color: black;
    font-size: 1.5rem;
    position: relative;
    z-index: 5;
}

.logo img {
    display: block;
    height: 50px;
    width: auto;
    /*filter: grayscale(100%);*/
    transition: filter 0.2s ease;
}

.logo-mobile {
    display: none !important;
}

@media (max-width: 1140px) {
    .logo-desktop {
        display: none !important;
    }

    .logo-mobile {
        display: block !important;
    }

    .logo img {
        height: 40px !important;
    }
}

.logo:hover img {
    filter: grayscale(0%);
}

.nav-stripes {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
    pointer-events: none;
}

.stripe {
    position: absolute;
    left: calc(-1 * ((100vw - min(1280px, 100vw)) / 2 + clamp(1rem, 4vw, 2rem) + 40px));
    border: 2px solid var(--blue);
    border-left: none;
    box-sizing: border-box;
    display: block;
    transform: skewX(-20deg);
    transform-origin: top left;
    width: calc((100vw - min(1280px, 100vw)) / 2 + clamp(1rem, 4vw, 2rem) + 40px + 100% + var(--stripe-logo-offset, 0px));
}

.stripe-red {
    top: -2px;
    bottom: -2px;
    height: calc(100% + 4px);
    background-color: var(--stripe-red);
    border-radius: 0 0 35px 0;
    --stripe-logo-offset: 160px;
    z-index: 1;
}

.stripe-orange {
    top: -2px;
    height: 48px;
    background-color: var(--stripe-orange);
    border-radius: 0 0 25px 0;
    --stripe-logo-offset: 100px;
    z-index: 2;
}

.stripe-yellow {
    top: -2px;
    height: 28px;
    background-color: var(--stripe-yellow);
    border-radius: 0 0 15px 0;
    --stripe-logo-offset: 40px;
    z-index: 3;
}

@media (max-width: 800px) {
    .stripe-red {
        --stripe-logo-offset: 160px;
    }

    .stripe-orange {
        --stripe-logo-offset: 100px;
    }

    .stripe-yellow {
        --stripe-logo-offset: 40px;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: black;
    font-size: var(--fs-small);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb-nav {
    margin-top: var(--sp-m);
    margin-bottom: var(--sp-m);
    padding: 10px 0;
}

.breadcrumb-container {
    font-size: var(--fs-xsmall);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888;
}

.breadcrumb-container a {
    text-decoration: none;
    color: #888;
    transition: color 0.2s;
}

.breadcrumb-container a:hover {
    color: #000;
    text-decoration: underline;
}

.breadcrumb-container span {
    color: #000;
}

.breadcrumb-container a::after {
    content: "/";
    margin: 0 10px;
    color: #ddd;
    display: inline-block;
}

.logged-bar {
    font-size: var(--fs-small);
    height: 20px;
    background: var(--blue);
    padding: .5rem 1rem .5rem .5rem;
    text-align: end;
}

.user-status {
    padding: 0 5px 0 0px;
}

.user-status,
.user-status a {
    color: white;
}

.admin-link {
    background: black;
    color: white !important;
    padding: 8px 15px;
    border: 1px solid black;
}

.admin-link:hover {
    background: white;
    color: black !important;
    text-decoration: none !important;
}

.login-btn,
.logout-btn {
    border: 1px solid #ddd;
    padding: 8px 15px;
    font-size: var(--fs-small) !important;
    transform: rotate(0.000001deg);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    background-color: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #333;
    transform: translateY(-5px);
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.1);
}

.back-to-top:active {
    transform: translateY(0);
}

@media print {
    .back-to-top {
        display: none !important;
    }
}

/* ==========================================================================
   4. RECHERCHE & AUTOCOMPLETE
   ========================================================================== */

.search-section {
    margin-bottom: 50px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#main-search,
.ghost-text {
    flex: 1;
    padding: 15px;
    font-family: 'Helvetica', sans-serif;
    font-size: var(--fs-body);
    border: 1px solid var(--black);
    background: transparent;
    box-sizing: border-box;
    outline: none;
}

#main-search {
    color: black;
    position: relative;
    z-index: 2;
}

.ghost-text {
    position: absolute;
    z-index: 1;
    color: #ccc;
    border-color: transparent;
    white-space: pre;
    pointer-events: none;
}

.autocomplete-box {
    position: absolute;
    background: white;
    width: 100%;
    border: 1px solid var(--black);
    border-top: none;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray);
}

.suggestion-item:hover {
    background: var(--gray);
}

.suggestion-item small {
    color: #888;
    text-transform: uppercase;
    font-size: var(--fs-small);
}

/* ==========================================================================
   5. TABLEAUX & COMPOSANTS DE DONNÉES
   ========================================================================== */
.swiss-table {
    margin-bottom: 100px;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    overflow: hidden;
}

.swiss-table th {
    text-align: left;
    text-transform: uppercase;
    font-size: var(--fs-small);
    padding-bottom: 15px;
    border-bottom: 2px solid black;
}

.swiss-table tr th:last-child,
.swiss-table td:last-child {
    text-align: right;
}

.swiss-table th:last-child,
.swiss-table td:last-child {
    width: 150px;
}

.swiss-table td {
    padding: 15px 5px;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-small);
    vertical-align: middle;
    height: 50px;
}

.swiss-table tr:last-child td {
    border-bottom: none;
}

.swiss-table a:hover {
    color: #000;
}

.swiss-table-tags {
    padding: 10px 5px !important;
}

.swiss-table-tags-container {
    max-height: 50px;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
}

.model-section {
    margin-bottom: 100px;
}

.model-section .swiss-table {
    margin-bottom: var(--sp-m);
}

.model-section .model-row[hidden],
.model-section .show-more-btn[hidden] {
    display: none;
}

.show-more-btn {
    display: block;
    margin: 30px auto 0;
    width: 200px;
    background: var(--white);
    color: var(--black);
    cursor: pointer;
}

.surface-filters {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--sp-m);
}

.surface-filter {
    font-family: inherit;
}

.surface-filter.is-active,
.surface-filter.is-active:hover {
    background: var(--black);
    color: var(--white);
}

.surface-filter.tag-composition.is-active,
.surface-filter.tag-composition.is-active:hover {
    background: #ff6b00;
}

.type-badge {
    font-size: var(--fs-xsmall);
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid black;
    padding: 2px 5px;
}

.type-badge.clickable-type {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.type-badge.clickable-type:hover {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.view-btn {
    display: inline-block;
    padding: 6px 15px;
    background-color: var(--black);
    color: white;
    text-decoration: none;
    font-size: var(--fs-small);
    text-transform: uppercase;
    font-weight: bold;
    border: 1px solid var(--black);
    transition: all 0.2s;
    transform: rotate(0.000001deg);
    width: fit-content;
}

.view-btn:hover {
    background-color: white;
    color: var(--black);
}

.save-style {
    background: #000;
    color: #fff;
    border-color: #000;
    margin-top: 5px;
}

.save-style:hover {
    background: #fff;
    color: #000;
}

.cancel-style {
    background: #fff;
    color: #ff4d4f;
    border-color: #ff4d4f;
    width: 100%;
    margin-top: 5px;
    font-size: var(--fs-small);
}

.cancel-style:hover {
    background: #ff4d4f;
    color: #fff;
}

.delete-style {
    color: var(--white);
    background-color: #CA0B00;
    border: 1px solid #CA0B00;
    margin-top: 5px;
}

.delete-style:hover {
    background-color: var(--white);
    color: #CA0B00;
}

.admin-btn {
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--black);
    cursor: pointer;
    padding: 6px 15px;
    font-size: var(--fs-small);
    text-transform: uppercase;
    transition: all 0.2s;
    margin-right: 5px;
    margin-bottom: 5px;
    transform: rotate(0.000001deg);
}

.table-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: solid 1px white;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    padding: 0;
    color: white;
}

.table-btn:hover {
    border: solid 1px black;
    color: black;
    background-color: white;

}

.view-small {
    background-color: #333;
}

.edit-small {
    background-color: #0e589c;
}

.delete-small {
    background-color: #CA0B00;
}


.download-style {
    width: stretch;
    text-align: center;
    padding: 12px;
    font-size: var(--fs-small);
    transition: background 0.2s;
}

.download-style:hover {
    text-decoration: none;
}

.download-style svg {
    margin-top: -3px;
}

.results-counter {
    padding: 20px 0;
    margin-bottom: var(--sp-m);
    font-weight: bold;
    text-transform: uppercase;
    font-size: var(--fs-small);
    letter-spacing: 0.05em;
}

/* ==========================================================================
   6. TAGS & PILLS
   ========================================================================== */

.tag,
.tag-pill {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 8px 3px 5px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: var(--fs-xsmall);
    text-transform: uppercase;
    cursor: pointer;
    background-color: var(--white);
    border: 1px solid var(--black);
    border-left: solid 10px var(--black);
    border-radius: 10px;
    color: var(--black);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag:hover,
.tag-pill:hover {
    background: #00000015;
}

.tag-admin {
    border-color: #df0cbc;
    color: #3d0135;
}

.tag-category {
    border-color: #27ae60;
    color: #19693a;
}

.tag-motor {
    border-color: #dfd215;
    color: #707b10;
}

.tag-composition {
    border-color: #ff6b00;
    color: #853801;
}

.tag-environment {
    border-color: #e74c3c;
    color: #7a2920;
}

.tag-traction {
    border-color: #8e44ad;
    color: #562969;
}

.tag-surface {
    border-color: #0055ff;
    color: #022b7e;
}

.tag-uncategorized {
    border-color: #666;
    color: #1b1b1b;
}

.tag-admin:hover {
    background: #df0cbc2f;
}

.tag-category:hover {
    background: #27ae602f;
}

.tag-motor:hover {
    background: #dbcd0c2f;
}

.tag-composition:hover {
    background: #ff6b002f;
}

.tag-environment:hover {
    background: #e74c3c2f;
}

.tag-traction:hover {
    background: #8e44ad2f;
}

.tag-surface:hover {
    background: #0055ff2f;
}

.tag-uncategorized:hover {
    background: #6666662f;
}

.tag-pill.category {
    text-transform: uppercase;
    font-weight: bold;
    border-color: #bbb;
}

.tag-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag-suggestions-container {
    margin-top: 10px;
    padding: 10px;
}

.tag-suggestions-container small {
    display: block;
    font-size: var(--fs-small);
    color: #888;
    margin-bottom: 5px;
    letter-spacing: 0.05em;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    max-height: 3.2em;
    position: relative;
    margin-top: -5px;
    margin-bottom: 5px;
}

.tag-group-block {
    margin-bottom: 15px;
}

.tag-category-label {
    display: block;
    font-size: var(--fs-small);
    font-weight: 900;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.tag-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--sp-s);
}

/* ==========================================================================
   7. FORMULAIRES & ÉDITION
   ========================================================================== */

.contribute-container {
    margin: 0 auto;
}

.swiss-form .form-group,
.car-selection-group {
    margin-top: 20px;
}

.swiss-form label {
    display: block;
    text-transform: uppercase;
    font-size: var(--fs-small);
    font-weight: bold;
    margin-bottom: 5px;
}

.swiss-form input[type="text"],
.swiss-form input[type="password"],
.swiss-form input[type="url"],
.swiss-form input[type="date"],
.swiss-form select,
.swiss-form textarea,
.edit-field {
    width: 100%;
    padding: 10px;
    font-family: inherit;
    font-size: var(--fs-small);
    box-sizing: border-box;
    margin-bottom: 10px;
    border: 1px solid #ccc;
}

.edit-warning {
    color: red;
    font-size: var(--fs-xsmall);
}

.swiss-form input:focus {
    outline: none;
    background-color: #f9f9f9;
}

.required {
    color: #ff4d4f;
    font-weight: bold;
}

.download-section {
    margin-bottom: var(--sp-m);
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* Responsive YouTube Video */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Icons for the new editor buttons */
.fa-paragraph:before {
    content: "¶";
    font-family: sans-serif;
    font-weight: bold;
}

/* Image placeholder style in editor */
.EasyMDEContainer .cm-s-easymde .cm-image-marker {
    color: #0055ff;
    font-weight: bold;
}

/* ============================================================
   CONTRIBUTE REPORT - SHEET ROW STYLES
   ============================================================ */

/* Le conteneur blanc de chaque fiche */
.contribute-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: var(--sp-m);
}

.sheet-row {
    background-color: #fff;
    border: 1px solid #000;
    /* Bordure noire franche */
    padding: 25px;
    margin-bottom: 40px;
    position: relative;
    transition: all 0.2s ease;
}

/* Titre "NEW SETUP SHEET" */
.sheet-row h4 {
    margin: 0 0 15px 0;
    font-size: var(--fs-small);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    color: #000;
}

.sheet-row h5 {
    margin: 0 0 10px 0;
    font-size: var(--fs-xsmall);
    font-weight: 900;
}

.sheet-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ff4d4f;
    font-size: var(--fs-h3);
    font-weight: bold;
    cursor: pointer;
    line-height: 0.5;
    padding: 5px;
    transition: color 0.2s;
}

.sheet-remove-btn:hover {
    color: #000;
}

.sheet-form-grid {
    display: grid;
    gap: 20px;
    align-items: end;
}

.car-selection-group {
    display: flex;
    gap: 10px;
}

.car-selection-group>div {
    flex: 1;
    min-width: 0;
}

.sheet-row label {
    display: block;
    font-size: var(--fs-small);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: #666;
    letter-spacing: 0.02em;
}

.sheet-row select,
.sheet-row input[type="text"],
.sheet-row input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-family: inherit;
    font-size: var(--fs-small);
    height: 38px;
    box-sizing: border-box;
    border-radius: 0;
    margin-bottom: 10px;
}

.sheet-row input[type="file"] {
    padding: 7px;
    font-size: var(--fs-small);
}

/* États interactifs */
.sheet-row select:focus,
.sheet-row input:focus {
    border-color: #0055ff;
    outline: none;
    background-color: #f0f7ff;
}

.sheet-row select:disabled {
    background-color: #f9f9f9;
    color: #aaa;
    cursor: not-allowed;
    border-color: #eee;
}

.batch-table .sheet-row {
    border-style: dashed;
    background: #fafafa;
}

@media (max-width: 768px) {
    .sheet-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .car-selection-group {
        flex-direction: column;
    }

    .sheet-row {
        padding: 15px;
    }
}

/* ==========================================================================
   8. WIKI & GUIDES
   ========================================================================== */

.wiki-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    grid-template-areas: "content sidebar";
    gap: 40px;
}

.wiki-sidebar {
    grid-area: sidebar;
    background: #fff;
    padding: 0 20px 20px;
    border: 1px solid #000;
    height: fit-content;
    position: relative;
}

.wiki-sidebar h1 {
    font-size: var(--fs-h2);
    margin-top: var(--sp-s);
    margin-bottom: var(--sp-s);
    overflow: hidden;
}

.wiki-sidebar h2 {
    font-size: var(--fs-h3);
    margin-bottom: var(--sp-m);
    font-weight: 300;
    color: #666;
    text-transform: uppercase;
    overflow: hidden;
}

.wiki-sidebar h3 {
    font-size: var(--fs-h4);
    font-weight: 300;
    color: #333;
    overflow: hidden;
}

.brand-url-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--sp-s);
    font-size: var(--fs-small);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
}

.brand-url-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-url-link i {
    flex-shrink: 0;
    font-size: 0.65rem;
    opacity: 0.7;
}

.brand-url-link:hover {
    text-decoration: underline;
}

.wiki-sidebar label {
    display: block;
    font-size: var(--fs-small);
    font-weight: bold;
    text-transform: uppercase;
    color: #888;
    margin-top: 20px;
}

.wiki-sidebar p {
    margin-top: var(--sp-s);
    font-size: var(--fs-small);
    line-height: 1.6;
    text-align: justify;
    color: #222;
}

#display-description p::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f10d";
    margin-right: var(--sp-xs);
    font-size: 0.6rem;
    vertical-align: middle;
}

.wiki-content {
    grid-area: content;
    max-width: 850px;
    transition: max-width 0.4s ease;
}

.wiki-header .button-group {
    text-align: right;
    margin-bottom: var(--sp-xs);
    height: 45px;
    margin-top: -45px;
}

.wiki-header h1 {
    font-size: var(--fs-h1);
}

.wiki-header h2 {
    font-size: var(--fs-h2);
    font-weight: 300;
    color: #666;
    text-transform: uppercase;
}

.wiki-header p {
    color: #666;
    font-size: var(--fs-body);
    margin-top: -10px;
    margin-bottom: var(--sp-m);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wiki-tag {
    position: relative;
    top: -12px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 3px 10px;
    font-size: var(--fs-xsmall);
    font-weight: bold;
    text-transform: uppercase;
}

.wiki-tag i {
    margin-right: var(--sp-xs);
}

.grouped-tags-container {
    margin-top: 10px;
}

.guide-info-box {
    text-align: center;
    margin-top: var(--sp-m);
    padding: 20px 0;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
    color: #555;
    font-size: var(--fs-xsmall);
    border-top: 1px solid #eee;
}

.admin-panel {
    margin-top: 10px;
}

.main-content {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-top: 0;
    margin-bottom: var(--sp-m);
}

.markdown-render h1,
.markdown-render h2,
.markdown-render h3 {
    font-family: var(--font-main);
    font-weight: 800;
    color: #000;
    margin-top: 60px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.markdown-render h1 {
    font-size: var(--fs-h2);
    text-transform: uppercase;
    padding-bottom: 10px;
}

.markdown-render h2 {
    font-size: var(--fs-h3);
    text-transform: uppercase;
    padding-bottom: 8px;
}

.markdown-render h3 {
    font-size: var(--fs-h4);
    text-transform: none;
    color: #333;
}

.markdown-render p,
.markdown-render li {
    font-size: var(--fs-body);
    line-height: 1.8;
    color: #222;
}

.markdown-render p {
    margin-top: var(--sp-s);
    margin-bottom: var(--sp-m);
}

.markdown-render li {
    margin-bottom: var(--sp-xs);
}

.markdown-render a {
    font-weight: 700;
    border-bottom: 1px solid #000;
}

.markdown-render a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.markdown-render blockquote {
    margin: 20px 0;
    padding: 10px 20px;
    background: #f9f9f9;
    border-left: 5px solid black;
    font-style: italic;
}

.markdown-render code {
    background: #f0f0f0;
    padding: 2px 5px;
    font-family: 'Courier New', monospace;
    font-size: var(--fs-body)
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.toc-item {
    margin-bottom: 8px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: baseline;
}

.toc-item::after {
    content: "";
    flex: 1 1 0%;
    border-bottom: 1.5px dotted #666;
    margin: 0 8px;
    min-width: 0;
}

.toc-item a {
    text-decoration: none;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.toc-item a:hover {
    color: #000;
    text-decoration: underline;
}

.toc-h1 {
    font-weight: bold;
}

.toc-h2 {
    margin-left: 10px;
}

.toc-h3 {
    margin-left: 20px;
}

h1[id],
h2[id],
h3[id] {
    scroll-margin-top: 100px;
}

.jump-link {
    color: #000;
    text-decoration: underline;
    font-size: var(--fs-small);
    font-weight: 600;
    cursor: pointer;
}

#section-linked-sheets {
    scroll-margin-top: 120px;
}

/* ==========================================================================
   9. ABOUT PAGE
   ========================================================================== */

/* --- FILTER GRID --- */

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: var(--sp-m);
}

.filter-card {
    border: 1px solid #000;
    padding: 25px;
    position: relative;
    background: #fff;
}

.filter-tag {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #000;
    color: #fff;
    padding: 3px 10px;
    font-size: var(--fs-xsmall);
    font-weight: bold;
    text-transform: uppercase;
}

.filter-card h3 {
    margin-top: 5px;
    text-transform: uppercase;
    font-size: var(--fs-h3);
}

.example-code {
    display: block;
    background: #f4f4f4;
    padding: 10px;
    font-family: monospace;
    font-size: var(--fs-small);
    margin-top: 15px;
    border-left: 3px solid var(--stripe-orange);
}

.filter-list {
    list-style: none;
    padding: 0;
    font-size: var(--fs-small);
}

.filter-list li {
    margin-bottom: 5px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
}

kbd {
    background: #000;
    color: #fff;
    padding: 10px 15px;
    font-family: inherit;
    font-weight: 900;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.ui-element {
    border: 1px solid #000;
    padding: 10px;
    font-size: var(--fs-small);
    font-weight: bold;
    text-transform: uppercase;
    background: #fff;
}

@media (max-width: 800px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.sheets-grid {
    columns: 3;
    gap: 20px;
    margin-top: 20px;
}

.sheet-card-visual {
    border: 1px solid #000;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: fit-content;
    break-inside: avoid;
    margin-bottom: 15px;
}

.sheet-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sheet-thumb {
    overflow: hidden;
    border-bottom: 1px solid #000;
    background-color: #f4f4f4;
    position: relative;
}

.sheet-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    border: none;
}

.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: var(--fs-small);
    font-weight: bold;
}

/* INFOS */
.sheet-info {
    padding: 12px;
    text-align: center;
}

.sheet-model {
    font-weight: 900;
    font-size: var(--fs-h4);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 4px;
    color: #000;
}

.sheet-brand {
    font-size: var(--fs-small);
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
}

.sheet-date {
    margin-top: 8px;
    font-size: var(--fs-body);
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

/* ==========================================================================
   10. IMAGES & ÉDITEUR
   ========================================================================== */

.image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-logo-container {
    width: 100%;
    background: #fff;
    position: relative;
    display: inline-block;
}

.brand-logo-container img {
    width: 100%;
    height: auto;
    clip-path: inset(4px);
}

.no-image {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    color: #999;
    text-transform: uppercase;
    font-weight: bold;
}

.remove-img-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #ff4d4f;
    color: white;
    border: 2px solid #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s;
}

.remove-img-btn:hover {
    transform: scale(1.1);
    background: #000;
}

.upload-zone {
    background: #fffbe6;
    border: 2px dashed #ffe58f;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.upload-zone label {
    display: block;
    font-weight: bold;
    font-size: var(--fs-small);
    margin-bottom: 10px;
}

.EasyMDEContainer {
    width: 100%;
    margin-top: 10px;
    background: white;
    border-radius: 0 !important;
}

.editor-toolbar {
    border-radius: 0 !important;
}

.CodeMirror {
    height: 500px !important;
    min-height: 500px !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    border-radius: 0 !important;
    border: 1px solid #ccc !important;
}

.CodeMirror-scroll {
    max-height: 500px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.editor-preview-side {
    height: 500px !important;
    position: absolute !important;
}

.editor-toolbar {
    border: 1px solid #ccc !important;
    border-bottom: none !important;
    background: #fff !important;
    opacity: 1 !important;
}

.editor-preview img,
.markdown-render img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    display: block;
}

.manual-viewer {
    background-color: #fff;
}

.manual-goto {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: var(--sp-s);
}

.manual-goto label {
    font-size: var(--fs-small);
    font-weight: bold;
    text-transform: uppercase;
}

.goto-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-small);
    font-weight: bold;
}

#page-input {
    width: 50px;
    text-align: center;
    padding: 3px 5px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: var(--fs-small);
    font-weight: bold;
}

/* Remove default spin buttons from numeric input */
#page-input::-webkit-outer-spin-button,
#page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#page-input[type=number] {
    -moz-appearance: textfield;
}

.control-select {
    padding: 4px 8px;
    border: 1px solid #000;
    background: #fff;
    font-family: inherit;
    font-size: var(--fs-small);
    cursor: pointer;
}

.page-number {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 20px;
    transform: translateY(-10px);
    position: absolute;
    background: #000;
    color: #fff;
    padding: 3px 10px;
    font-size: var(--fs-xsmall);
    font-weight: bold;
    text-transform: uppercase;
}

.page-nav-arrow {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
    font-size: 1.1em;
    line-height: 1;
    transition: opacity 0.2s;
}

.page-nav-arrow:hover {
    opacity: 0.7;
}

.page-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.414;
    background: #f9f9f9;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.page-container.landscape {
    aspect-ratio: 1.414 / 1;
}

.no-document {
    padding: 100px 0;
    text-align: center;
    border: 2px dashed #ddd;
    color: #999;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.full-screen-view {
    display: block;
    cursor: zoom-in;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

@media (max-width: 800px) {
    .image-gallery {
        gap: 30px;
    }
}

@media print {

    .navbar,
    .wiki-sidebar,
    .viewer-controls,
    .breadcrumb-nav,
    .admin-panel {
        display: none !important;
    }

    .container,
    .wiki-grid,
    .wiki-content,
    .manual-viewer {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    .page-container {
        page-break-after: always;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .page-container img {
        border: none !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   11. FLASH MESSAGES & NOTIFICATIONS
   ========================================================================== */

#flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    z-index: 11000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.flash-message {
    pointer-events: auto;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    margin-bottom: 5px;
    border: 2px solid #000;
    font-weight: 800;
    font-size: var(--fs-small);
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.flash-message.error {
    background: #ff4d4f;
    border-color: #ff4d4f;
}

.flash-message.success {
    background: #000;
}

.flash-close {
    background: none;
    border: none;
    color: #fff;
    font-size: var(--fs-small);
    cursor: pointer;
    margin-left: 15px;
    line-height: 1;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.progress-wrapper {
    display: none;
    margin: 20px 0;
    padding: 15px;
    background: #f4f4f4;
    border: 1px solid #000;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-small);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #ddd;
    position: relative;
}

#upload-progress-bar {
    width: 0%;
    height: 100%;
    background: #000;
    transition: width 0.1s linear;
}

.processing-status {
    display: none;
    font-size: var(--fs-small);
    color: #0055ff;
    font-weight: bold;
    animation: blink 1s infinite;
    margin-top: 10px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ============================================================
   13. USER LOGIN, ADMIN AND ERRORS
   ============================================================ */

.userauth-container {
    margin: 0 auto;
    max-width: 700px;
}

.userauth-container h1 {
    border-bottom: 2px solid black;
    padding-bottom: 10px;
}

.userauth-container .view-btn {
    width: 100%;
    height: 50px;
    margin-top: 10px;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-code {
    font-size: 10rem;
    font-weight: 900;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.05em;
    display: inline-block;
}

.error-details {
    margin-top: 40px;
    max-width: 500px;
}

.error-details h2 {
    font-size: var(--fs-h2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.error-details p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 40px;
}

@media (max-width: 800px) {
    .error-code {
        font-size: 6rem;
    }
}

.status-badge {
    font-size: var(--fs-small);
    font-weight: 800;
    padding: 2px 8px;
    border: 1px solid black;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background-color: #000;
    color: #fff;
}

.status-badge.pending {
    background-color: #fff;
    color: #888;
    border-color: #ddd;
}

/* Selecteur Admin */
.admin-select {
    font-family: inherit;
    font-size: var(--fs-small);
    padding: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

.admin-select:focus {
    border-color: #000;
    outline: none;
}

.admin-container .swiss-table td {
    vertical-align: middle;
}

.admin-search-wrapper {
    margin: 30px 0;
}

.admin-search-wrapper form {
    display: flex;
    gap: 10px;
}

.admin-search-wrapper .view-btn {
    margin-bottom: 0;
}

.admin-search-wrapper form input {
    flex: 1;
    border: 1px solid var(--black);
    font-family: 'Helvetica', sans-serif;
    font-size: var(--fs-small);
    box-sizing: border-box;
    margin: 0;
}

.admin-search-input {
    width: 50%;
    padding: 15px;
    border: 1px solid var(--black);
    font-family: 'Helvetica', sans-serif;
    font-size: var(--fs-body);
    box-sizing: border-box;
}

.action-cell {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.action-btn-container {
    display: inline-flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.admin-btn {
    margin: 0;
}

.edit-mode-cell {
    padding: 5px !important;
}

.count-link {
    text-decoration: none;
    color: #0055ff;
    border-bottom: 1px solid transparent;
}

.count-link:hover {
    border-bottom: 1px solid #0055ff;
}

.is-uncategorized {
    background-color: #fff9f9;
}

.status-badge {
    font-size: var(--fs-xsmall);
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid black;
    padding: 2px 5px;
}

.hidden-row {
    display: none !important;
}

.input-email {
    height: 50px;
    width: 100%;
    padding: 10px;
    border: 2px solid black;
    font-family: inherit;
    font-size: var(--fs-body);
    box-sizing: border-box;
}

.admin-select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    border-color: #eee;
    color: #999;
}

.swiss-tabs {
    border-bottom: 2px solid #000;
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
}

.tab-link {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    color: #999;
}

.tab-link.active {
    color: #000;
    border-bottom: 4px solid #000;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.role-card {
    border: 1px solid #000;
    padding: 25px;
}

.perm-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: var(--fs-body);
    cursor: pointer;
}

.perm-label {
    line-height: 1.2;
}

.perm-label small {
    color: #666;
    display: inline;
    line-height: 1.1;
    margin: 10px 25px 0;
}

.role-card.locked {
    background-color: #fff;
    border: 1px solid #0055ff;
}

.perm-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.perms-list {
    margin-top: var(--sp-s);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-actions {
    display: none;
}

.circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: solid 1px white;
    background-color: #333;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    box-sizing: border-box;
}

.circle-btn:hover {
    border: 1px solid #000;
    background: white;
    color: black;
}

/* ============================================================
   13. MOBILE RESPONSIVE - SWISS STYLE
   ============================================================ */

@media (max-width: 800px) {
    html {
        overflow-y: auto;
    }

    .menu-toggle {
        display: block;
    }

    .nav-container {
        position: relative;
        height: 70px;
        gap: 15px;
    }

    .nav-overlay {
        position: fixed;
        top: 108px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 108px);
        height: calc(100dvh - 108px);
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        width: 280px;
        max-width: 85vw;
        height: calc(100vh - 108px);
        height: calc(100dvh - 108px);
        background: white;
        position: fixed;
        top: 108px;
        right: 0;
        left: auto;
        border-left: 3px solid var(--blue);
        border-right: none;
        border-top: none;
        border-bottom: none;
        gap: 0;
        z-index: 1000;
        box-sizing: border-box;
        box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
        padding-top: 0;
        padding-bottom: 30px;
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }

    .nav-links a {
        font-size: var(--fs-small);
        width: 100%;
        padding: 16px clamp(1rem, 4vw, 2rem);
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
        box-sizing: border-box;
        transition: background-color 0.2s ease, padding-left 0.2s ease;
    }

    .nav-links a:hover {
        background: #f8f8f8;
        padding-left: calc(clamp(1rem, 4vw, 2rem) + 4px);
        text-decoration: none;
    }

    .nav-links .admin-link,
    .nav-links .login-btn,
    .nav-links .logout-btn {
        margin: 20px clamp(1rem, 4vw, 2rem) 5px clamp(1rem, 4vw, 2rem);
        width: calc(100% - 2 * clamp(1rem, 4vw, 2rem));
        text-align: center;
        display: block;
        box-sizing: border-box;
    }

    .nav-links .admin-link:hover,
    .nav-links .login-btn:hover,
    .nav-links .logout-btn:hover {
        padding-left: 15px;
    }

    .type-nav-link {
        display: block;
    }

    .user-status {
        display: inline-block;
    }

    h1 {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3,
    .section-title {
        font-size: 1.4rem;
    }

    #main-search,
    .ghost-text {
        padding: 12px;
        flex: 1;
    }

    .swiss-table thead {
        display: none;
    }

    .swiss-table,
    .swiss-table tbody,
    .swiss-table tr,
    .swiss-table td {
        display: block;
        width: 100%;
        margin-top: 0;
        border-top: solid 1px black;
    }

    .swiss-table tr {
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
        position: relative;
        padding-right: 140px;
        box-sizing: border-box;
    }

    .swiss-table td {
        padding: 4px 0;
        border: none;
        text-align: left;
        height: auto;
        box-sizing: border-box;
    }

    .swiss-table td:first-child {
        margin-bottom: 2px;
        border-top: none;
    }

    .swiss-table td:last-child {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 0;
        width: 130px;
        text-align: right;
        margin-top: 0;
        border-top: none;
        display: inline-flex;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        padding: 0;
    }

    .view-btn {
        margin: 0;
    }

    .admin-panel .view-btn {
        margin-bottom: 10px;
    }

    .admin-btn {
        margin: 0;
    }

    .wiki-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "content";
        gap: 30px;
    }

    .wiki-content {
        grid-area: content;
    }

    .wiki-sidebar {
        grid-area: sidebar;
        padding-bottom: var(--sp-m);
        margin-bottom: var(--sp-m);
        position: relative;
    }

    .wiki-sidebar:has(.meta-section.open) {
        padding-bottom: 0;
    }

    .wiki-sidebar h1 {
        max-width: calc(100% - 100px);
    }

    .wiki-sidebar h2 {
        margin-bottom: 0;
    }

    .sidebar-actions {
        position: absolute;
        bottom: 20px;
        right: 20px;
        display: flex;
        gap: 6px;
        z-index: 10;
    }

    .download-style,
    .download-section {
        display: none !important;
    }

    .meta-section {
        display: none;
        margin-top: 15px;
    }

    .meta-section.open {
        display: block;
    }

    .guide-info-box {
        border-top: 1px solid var(--border);
        padding-top: 15px;
        margin-top: 15px;
        text-align: left;
        padding-right: 100px;
        /* Prevent text overlap with buttons */
        display: flex;
        flex-direction: column;
        gap: 4px;
        height: auto;
        min-height: 40px;
        justify-content: center;
    }

    .wiki-header h1 {
        font-size: 2.2rem;
    }

    .wiki-header .button-group {
        margin-top: 0;
        height: auto;
        text-align: right;
        margin-bottom: 15px;
    }

    .page-container {
        margin-bottom: var(--sp-m);
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .breadcrumb-container {
        font-size: var(--fs-xsmall);
        line-height: 1.5;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 5px;
    }

    .breadcrumb-container::-webkit-scrollbar {
        display: none;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    .editor-toolbar {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }

    #flash-container {
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        max-width: 500px;
    }
}