/*
 * EMAG Modern design tokens and Bootstrap Wrapper presentation.
 * Defaults remain here; style-settings.css supplies saved/preview overrides.
 * This browser-ready stylesheet is served without DokuWiki's LESS compiler.
 */
:root {
    /* Shared with the installer and responsive JS; keep these literal values. */
    --emag-default-accent: #315b9a;
    --emag-default-site-width: 1500px;
    --emag-default-sidebar-width: 20rem;
    --emag-default-phone-width: 767px;
    --emag-default-tablet-width: 800px;
    --emag-accent: var(--emag-setting-accent, var(--emag-default-accent));
    --emag-on-accent: #fff;
    --emag-background: var(--emag-setting-background, #fff);
    --emag-background-alt: var(--emag-setting-background-alt, #eee);
    --emag-border: var(--emag-setting-border, #ccc);
    --emag-text: var(--emag-setting-text, #333);
    --emag-text-alt: var(--emag-setting-text-alt, #999);
    --emag-text-neutral: var(--emag-setting-text-neutral, #666);
    --emag-site-width: var(--emag-setting-site-width, var(--emag-default-site-width));
    --emag-sidebar-width: var(--emag-setting-sidebar-width, var(--emag-default-sidebar-width));
    --emag-success: #2e7d32;
    --emag-danger: #b3261e;
    --emag-warning: #8a5a00;
    --emag-sticky-header-height: 0px;
    --emag-accent-strong: var(--emag-accent);
    --emag-accent-soft: var(--emag-background-alt);
    --emag-accent-border: var(--emag-border);
    --emag-surface-faint: var(--emag-background);
    --emag-surface-border: var(--emag-border);
    --emag-accent-strong: color-mix(in srgb, var(--emag-accent) 78%, black);
    --emag-accent-soft: color-mix(in srgb, var(--emag-accent) 10%, var(--emag-background));
    --emag-accent-border: color-mix(in srgb, var(--emag-accent) 28%, var(--emag-border));
    --emag-surface-faint: color-mix(in srgb, var(--emag-accent) 4%, var(--emag-background));
    --emag-surface-border: color-mix(in srgb, var(--emag-accent) 16%, var(--emag-border));
}

#dokuwiki__site > .site {
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.65rem;
    background: var(--emag-background);
    box-shadow: 0 0.8rem 2.5rem rgba(0, 0, 0, 0.08);
}

#dokuwiki__header {
    border-bottom: 3px solid var(--emag-accent);
}

#dokuwiki__header .headings a,
#dokuwiki__header .headings a:visited {
    color: var(--emag-accent-strong);
}

#dokuwiki__header .headings .logo {
    margin: 0;
    padding: 0;
    font-size: 1.5em;
    font-weight: normal;
    line-height: 1.2;
}

#dokuwiki__header .headings .logo img {
    float: left;
    margin: 0 0.5em 0 0;
}

#dokuwiki__header .headings .logo span {
    display: block;
    padding-top: 10px;
}

#dokuwiki__aside {
    border-right: 1px solid var(--emag-accent-border);
    background: var(--emag-accent-soft);
}

/* Native article equivalent of the stock DokuWiki div.page surface. */
.dokuwiki article.page {
    clear: both;
    min-height: 14.5rem;
    height: auto;
    margin-bottom: 0.5em;
    padding: 1.556em 2em 2em;
    overflow: clip visible;
    overflow-wrap: break-word;
    border: 1px solid var(--emag-border);
    border-radius: 2px;
    background: var(--emag-background);
    color: inherit;
    box-shadow: 0 0 0.5em var(--emag-text-neutral);
}

.mode_media article.page {
    overflow: auto;
}

#dokuwiki__content .page {
    line-height: 1.7;
}

#dokuwiki__content h1,
#dokuwiki__content h2 {
    border-color: var(--emag-accent-border);
}

#dokuwiki__content h1 {
    color: var(--emag-accent-strong);
}

#dokuwiki__content h2 {
    padding-left: 0.55rem;
    border-left: 0.25rem solid var(--emag-accent);
}

#dokuwiki__content article.page :is(h1, h2, h3, h4, h5)[id] {
    position: relative;
}

#dokuwiki__content .emag-heading-anchor {
    margin-left: 0.35em;
    color: var(--emag-text-alt);
    font-size: 0.75em;
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
}

#dokuwiki__content :is(h1, h2, h3, h4, h5):hover > .emag-heading-anchor,
#dokuwiki__content .emag-heading-anchor:focus-visible {
    opacity: 1;
}

#dokuwiki__content .emag-tags-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem 0.5rem;
    margin: -0.25rem 0 1rem;
    color: var(--emag-text-neutral);
    font-size: 0.9rem;
}

#dokuwiki__content .emag-tags-top > span {
    display: contents;
}

#dokuwiki__content .emag-heading-anchor:focus-visible {
    border-radius: 0.15rem;
    outline: 2px solid var(--emag-accent);
    outline-offset: 2px;
}

@media (hover: none) {
    #dokuwiki__content .emag-heading-anchor {
        opacity: 0.55;
    }
}

#dokuwiki__content table.inline th {
    border-color: var(--emag-accent-border);
    color: var(--emag-accent-strong);
}

/* Let Cell Background own explicitly colored cells, including its hover effect. */
#dokuwiki__content table.inline th:not([style*="--plugin-cellbg"]) {
    background: var(--emag-accent-soft);
}

#dokuwiki__content table.inline td {
    border-color: var(--emag-accent-border);
}

/* Preserve Bootstrap3's compact, full-width treatment for ordinary wiki tables. */
.mode_show #dokuwiki__content article.page > .table,
.mode_show #dokuwiki__content article.page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

.mode_show #dokuwiki__content article.page table.inline {
    width: 100%;
}

.mode_show #dokuwiki__content article.page table.inline :is(th, td) {
    padding: 0.4rem 0.55rem;
    vertical-align: top;
}

.mode_show #dokuwiki__content article.page table.inline tbody tr:nth-child(even) > td:not([style*="--plugin-cellbg"]) {
    background: var(--emag-surface-faint);
}

.mode_show #dokuwiki__content article.page table.inline tbody tr:hover > td:not([style*="--plugin-cellbg"]) {
    background: var(--emag-accent-soft);
}

#dokuwiki__content a:hover,
#dokuwiki__content a:focus-visible {
    color: var(--emag-accent-strong);
}

/* Keep DokuWiki account and editing forms visually consistent without changing their markup. */
#dokuwiki__content form:not(#dw__configform) fieldset,
#config__manager fieldset {
    min-width: 0;
    border: 1px solid var(--emag-surface-border);
    border-radius: 0.55rem;
    background: var(--emag-background);
    box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.05);
}

#dokuwiki__content form:not(#dw__configform) fieldset {
    margin: 0 0 1.25rem;
    padding: 1rem;
}

#dokuwiki__content form:not(#dw__configform) fieldset > legend {
    padding: 0 0.45rem;
    color: var(--emag-accent-strong);
    font-weight: 700;
}

#dokuwiki__content form:not(#dw__configform) label {
    font-weight: 600;
}

#dokuwiki__content form:not(#dw__configform) :is(
    input[type='text'],
    input[type='email'],
    input[type='password'],
    input[type='search'],
    select,
    textarea
) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-background);
    color: var(--emag-text);
}

#dokuwiki__content form:not(#dw__configform) textarea {
    width: 100%;
}

#dokuwiki__content form:not(#dw__configform) :is(
    input[type='text'],
    input[type='email'],
    input[type='password'],
    input[type='search'],
    select,
    textarea
):focus-visible,
#config__manager table.inline td.value :is(input, select, textarea):focus-visible,
#edittable__editor + #wiki__editbar #edit__summary:focus-visible {
    border-color: var(--emag-accent);
    outline: 3px solid var(--emag-accent-soft);
    outline-offset: 1px;
}

#dokuwiki__content form:not(#dw__configform) :is(button, input[type='submit'], input[type='button'], input[type='reset']) {
    min-height: 2.5rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-surface-faint);
    color: var(--emag-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

#dokuwiki__content form:not(#dw__configform) :is(button, input[type='submit'], input[type='button'], input[type='reset']):is(:hover, :focus-visible) {
    border-color: var(--emag-accent);
    background: var(--emag-accent-soft);
    color: var(--emag-accent-strong);
}

#dokuwiki__content form:is(#dw__login, #dw__register, #dw__resendpwd, #dw__profile, #dw__subscribe) :is(button[type='submit'], input[type='submit']),
#dokuwiki__content form:not(#dw__configform) :is(#edbtn__save, [name='do[save]']) {
    border-color: var(--emag-accent);
    background: var(--emag-accent);
    color: var(--emag-on-accent);
}

#dokuwiki__content form#dw__profiledelete :is(button[type='submit'], input[type='submit']) {
    border-color: var(--emag-danger);
    background: var(--emag-danger);
    color: #fff;
}

/* Section actions are compact controls, not full-size form submissions. */
#dokuwiki__content .secedit form:not(#dw__configform) :is(button, input.button) {
    min-height: 0;
    height: auto;
    margin-left: 0;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* EditTable and the stock edit stylesheet must agree for guests and editors. */
#dokuwiki__content div.secedit.editbutton_table,
#dokuwiki__content div.secedit.editbutton_table form,
#dokuwiki__content div.secedit.editbutton_table form :is(button, input.button) {
    float: none;
    margin-left: 0;
    text-align: left;
}

.dokuwiki :is(div.info, div.success, div.notify, div.error) {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--emag-surface-border);
    border-left: 0.3rem solid var(--emag-accent);
    border-radius: 0.35rem;
    background: var(--emag-surface-faint);
}

.dokuwiki div.success {
    border-left-color: var(--emag-success);
}

.dokuwiki div.notify {
    border-left-color: var(--emag-warning);
}

.dokuwiki div.error {
    border-left-color: var(--emag-danger);
}

.dokuwiki .sizechange:is(.positive, .negative) {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
}

.dokuwiki .sizechange.positive {
    background: var(--emag-success);
}

.dokuwiki .sizechange.negative {
    background: var(--emag-danger);
}

/* Keep configuration forms readable without changing ordinary wiki tables. */
#config__manager fieldset {
    margin: 0 0 1.5rem;
    padding: 0.85rem;
}

#config__manager fieldset > legend {
    max-width: calc(100% - 1rem);
    margin-left: 0.25rem;
    padding: 0.35rem 0.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--emag-accent);
    color: var(--emag-on-accent);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

#config__manager fieldset > .table {
    width: 100%;
    overflow: visible;
}

#config__manager table.inline {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    border-spacing: 0;
    border-collapse: separate;
    border: 1px solid var(--emag-surface-border);
    border-radius: 0.4rem;
    background: var(--emag-background);
}

#config__manager table.inline tr > td {
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    border: 0;
    border-top: 1px solid var(--emag-surface-border);
    background: transparent;
}

#config__manager table.inline tr:first-child > td {
    border-top: 0;
}

#config__manager table.inline td.label {
    width: 58%;
}

#config__manager table.inline td.value {
    width: 42%;
    background: var(--emag-surface-faint);
}

#config__manager table.inline tr:not(.default) > td:first-child {
    box-shadow: inset 0.2rem 0 var(--emag-accent);
}

#config__manager table.inline td.label > label {
    display: block;
    line-height: 1.45;
}

#config__manager table.inline .outkey {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--emag-text-neutral);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#config__manager table.inline .outkey a {
    color: inherit;
}

#config__manager table.inline td.label > img {
    float: right;
    margin: 0.1rem 0 0.25rem 0.5rem;
}

#config__manager table.inline td.value > .input {
    box-sizing: border-box;
    width: 100%;
}

#config__manager table.inline td.value :is(
    input:not([type='checkbox']):not([type='radio']),
    select,
    textarea
) {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-background);
    color: var(--emag-text);
}

#config__manager table.inline td.value textarea {
    min-height: 5rem;
    resize: vertical;
}

#config__manager table.inline td.value .selection {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
}

#config__manager table.inline td.value .selection label {
    flex: 1 1 auto;
}

#config__manager table.inline td.value :is(input[type='checkbox'], input[type='radio']) {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--emag-accent);
}

/* Polish the dedicated EditTable screen without changing its calculated grid geometry. */
body:has(#edittable__editor) #dokuwiki__content .toolbar {
    margin: 0.85rem 0;
}

body:has(#edittable__editor) #tool__bar {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--emag-surface-border);
    border-radius: 0.5rem;
    background: var(--emag-surface-faint);
    box-shadow: 0 0.2rem 0.65rem rgba(0, 0, 0, 0.05);
}

body:has(#edittable__editor) #tool__bar > button.toolbutton {
    display: grid;
    flex: 0 0 2.35rem;
    place-items: center;
    box-sizing: border-box;
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    background: transparent;
}

body:has(#edittable__editor) #tool__bar > button.toolbutton:is(:hover, :focus-visible) {
    border-color: var(--emag-accent-border);
    background: var(--emag-accent-soft);
    outline: 2px solid var(--emag-accent);
    outline-offset: -2px;
}

body:has(#edittable__editor) #tool__bar > button.toolbutton > img {
    width: 1.15rem;
    height: 1.15rem;
}

#edittable__editor {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-top: 0.75rem;
    border-radius: 0.55rem;
    background: var(--emag-surface-faint);
    box-shadow:
        inset 0 0 0 1px var(--emag-surface-border),
        0 0.3rem 1rem rgba(0, 0, 0, 0.06);
}

#edittable__editor .wtHolder {
    scrollbar-color: var(--emag-accent-border) var(--emag-surface-faint);
}

#edittable__editor .handsontable :is(th, td) {
    border-color: var(--emag-surface-border) !important;
}

#edittable__editor .handsontable th {
    background: var(--emag-accent-soft) !important;
    color: var(--emag-accent-strong) !important;
    font-weight: 600;
}

#edittable__editor .handsontable td {
    background: var(--emag-background);
    color: var(--emag-text);
}

#edittable__editor .handsontable .htCore tbody tr:nth-child(even) > td:not(.current, .area) {
    background: var(--emag-surface-faint);
}

#edittable__editor .handsontable td.header {
    background: var(--emag-accent-soft);
    color: var(--emag-accent-strong);
    font-weight: 700;
}

#edittable__editor .handsontable :is(td.current, td.area) {
    background: var(--emag-accent-soft);
}

#edittable__editor .handsontableInput {
    box-sizing: border-box;
    padding: 0.25rem 0.4rem;
    border: 0;
    background: var(--emag-background);
    color: var(--emag-text);
    outline: 0;
}

#edittable__editor .wtBorder.current {
    background-color: var(--emag-accent) !important;
}

#edittable__editor .wtBorder.area {
    background-color: var(--emag-accent-border) !important;
}

#edittable__editor + #wiki__editbar {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem 1rem;
    width: 100%;
    min-height: 0;
    margin-top: 0.85rem;
    padding: 0.75rem;
    overflow: visible;
    border: 1px solid var(--emag-surface-border);
    border-radius: 0.5rem;
    background: var(--emag-surface-faint);
}

#edittable__editor + #wiki__editbar #size__ctl:empty {
    display: none;
}

#edittable__editor + #wiki__editbar :is(.editButtons, .summary) {
    float: none;
    width: auto;
    margin: 0;
}

#edittable__editor + #wiki__editbar .editButtons {
    display: flex;
    gap: 0.4rem;
}

#edittable__editor + #wiki__editbar button {
    box-sizing: border-box;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-background);
    color: var(--emag-text);
    font: inherit;
    font-weight: 600;
}

#edittable__editor + #wiki__editbar #edbtn__save {
    border-color: var(--emag-accent);
    background: var(--emag-accent);
    color: var(--emag-on-accent);
}

#edittable__editor + #wiki__editbar button:is(:hover, :focus-visible) {
    border-color: var(--emag-accent);
    background: var(--emag-accent-soft);
    color: var(--emag-accent-strong);
    outline: 3px solid var(--emag-accent-soft);
    outline-offset: 1px;
}

#edittable__editor + #wiki__editbar .summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 0;
}

#edittable__editor + #wiki__editbar .summary label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

#edittable__editor + #wiki__editbar .summary label[for='edit__summary'] {
    flex: 1 1 auto;
}

#edittable__editor + #wiki__editbar #edit__summary {
    box-sizing: border-box;
    flex: 1 1 auto;
    width: auto;
    min-width: 8rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-background);
    color: var(--emag-text);
}

#edittable__editor + #wiki__editbar #edit__minoredit {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: var(--emag-accent);
}

.bs-wrap.panel-group {
    margin: 0 0 1rem;
}

.bs-wrap .panel {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--emag-accent-border);
    border-radius: 0.35rem;
    background: var(--emag-background);
}

.bs-wrap .panel + .panel {
    margin-top: 0.5rem;
}

.bs-wrap .panel-heading {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--emag-accent-border);
    background: var(--emag-accent-soft);
}

.bs-wrap .panel-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.bs-wrap .panel-heading a {
    position: relative;
    display: block;
    padding: 0.65rem 2rem 0.65rem 0.8rem;
    color: var(--emag-accent-strong);
    text-decoration: none;
}

.bs-wrap .panel-heading a::after {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: '';
    transform: translateY(-65%) rotate(45deg);
}

.bs-wrap .panel-heading a.collapsed::after {
    transform: translateY(-35%) rotate(-45deg);
}

.bs-wrap .panel-heading a:focus-visible {
    outline: 3px solid var(--emag-accent);
    outline-offset: -3px;
}

.bs-wrap .panel-body {
    padding: 0.8rem;
}

.bs-wrap .panel-body > :first-child {
    margin-top: 0;
}

.bs-wrap .panel-body > :last-child {
    margin-bottom: 0;
}

.bs-wrap .panel-collapse.collapse {
    display: none;
}

.bs-wrap .panel-collapse.collapse.in {
    display: block;
}

.bs-wrap .table-responsive,
.bs-wrap .panel-body > .table {
    max-width: 100%;
    overflow-x: auto;
}

.bs-wrap-modal:not(.in),
.bs-wrap-nav .tab-pane[hidden],
.bs-wrap-modal[hidden],
.bs-wrap .panel-collapse[hidden] {
    display: none !important;
}

.bs-wrap-modal.in {
    position: fixed;
    /* Above mobile navigation (10020) and share notices (10030). */
    z-index: 10040;
    inset: 5vh 5vw;
    display: block;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--emag-border);
    border-radius: 0.4rem;
    background: var(--emag-background);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25), 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}

html.emagmodern-modal-open {
    overflow: hidden;
}

.emag-desktop-toolbar {
    display: none;
}

.emag-share-notice {
    position: fixed;
    z-index: 10030;
    right: 1rem;
    bottom: calc(5rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: min(26rem, calc(100% - 2rem));
    padding: 1rem;
    border: 1px solid var(--emag-border);
    border-radius: 0.4rem;
    background: var(--emag-background);
    color: var(--emag-text);
    box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.15);
}

.emag-share-notice p { margin: 0 0 0.5rem; }
.emag-share-notice input { box-sizing: border-box; width: 100%; margin-bottom: 0.5rem; }
.emag-share-notice :is(input, button) {
    min-height: 2.75rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--emag-border);
    border-radius: 0.25rem;
    background: var(--emag-background);
    color: var(--emag-text);
    font: inherit;
}
.emag-share-notice :is(input, button):focus-visible { outline: 2px solid var(--emag-accent); outline-offset: 2px; }

@media (min-width: 768px) {
    :root { --emag-responsive-rule: desktop; }

    /* Paint the viewport canvas, not the 1500px content container. */
    html:has(#emag-background) {
        background-image: var(--emag-background-image);
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }

    html:has(#emag-background) body {
        background-color: transparent;
        background-image: none;
    }

    /* Tint only the surrounding canvas; keep reading/navigation surfaces opaque. */
    html:has(#emag-background) #dokuwiki__site > .site {
        background-color: color-mix(in srgb, var(--emag-background) 92%, transparent);
    }

    #dokuwiki__header {
        position: sticky;
        z-index: 1000;
        top: 0;
        padding: 0;
        background: var(--emag-background);
        box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.08);
    }

    #dokuwiki__content article.page :is(h1, h2, h3, h4, h5)[id] {
        scroll-margin-top: calc(var(--emag-sticky-header-height) + 1rem);
    }

    #dokuwiki__site {
        box-sizing: border-box;
        width: 100%;
        max-width: var(--emag-site-width);
        margin: 0 auto;
    }

    #dokuwiki__site > .site {
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 0;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #dokuwiki__site > .site > .wrapper {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: minmax(0, var(--emag-sidebar-width)) minmax(0, 1fr);
        align-items: start;
        gap: 1.5rem;
        width: 100%;
    }

    #dokuwiki__site > .site > .wrapper > #dokuwiki__aside,
    #dokuwiki__site > .site > .wrapper > #dokuwiki__content {
        box-sizing: border-box;
        position: static;
        float: none;
        width: auto;
        min-width: 0;
        margin: 0;
    }

    #dokuwiki__site > .site > .wrapper > #dokuwiki__aside {
        grid-column: 1;
        padding: 1rem;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.5rem;
        background: var(--emag-surface-faint);
        box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.05);
    }

    #dokuwiki__site > .site > .wrapper > #dokuwiki__content {
        grid-column: 2;
    }

    #dokuwiki__site > .site > .wrapper > #dokuwiki__aside > .pad,
    #dokuwiki__site > .site > .wrapper > #dokuwiki__content > .pad {
        margin: 0;
    }

    #dokuwiki__content .page {
        border-color: var(--emag-surface-border);
        border-radius: 0.5rem;
        box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.07);
    }

    #dokuwiki__content #dw__toc {
        position: sticky;
        top: calc(var(--emag-sticky-header-height) + 1rem);
        z-index: 10;
        max-height: calc(100vh - var(--emag-sticky-header-height) - 2rem);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.4rem;
        background: var(--emag-surface-faint);
        scrollbar-width: thin;
    }

    #dokuwiki__content #dw__toc > h3 {
        position: sticky;
        z-index: 1;
        top: 0;
        background: var(--emag-surface-faint);
    }

    #dokuwiki__content #dw__toc ul.toc,
    #dokuwiki__content #dw__toc ul.toc :is(ul, li) {
        list-style: none;
    }

    #dokuwiki__content #dw__toc ul.toc a {
        display: block;
        box-sizing: border-box;
        border-left: 0.2rem solid transparent;
        padding-left: 0.45rem;
    }

    #dokuwiki__content #dw__toc ul.toc a.emag-toc-current {
        border-left-color: var(--emag-accent);
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
        font-weight: 700;
    }

    #dokuwiki__aside .bs-wrap .panel {
        border-color: var(--emag-surface-border);
        border-radius: 0.4rem;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0 1rem;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad::before,
    body.emag-desktop-toolbar-active #dokuwiki__header > .pad::after {
        display: none;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad > .headings {
        flex: 1 1 auto;
        box-sizing: border-box;
        float: none;
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 10px 15px;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad > .breadcrumbs {
        flex: 1 0 100%;
        box-sizing: border-box;
        width: 100%;
        margin: 0.25rem 0 0;
        padding: 0.2rem 0 0.25rem;
        border-top: 0;
        border-bottom: 0;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad > .breadcrumbs > div:last-child {
        border-bottom: 0;
    }

    body.emag-desktop-toolbar-active #dokuwiki__header > .pad > .tools {
        display: none;
    }

    .emag-desktop-toolbar {
        position: relative;
        z-index: 100;
        clear: none;
        display: flex;
        align-items: stretch;
        flex: 1 1 43rem;
        gap: 0.55rem;
        box-sizing: border-box;
        width: auto;
        max-width: 44rem;
        min-width: 43rem;
        margin: 0 0 0 auto;
        padding: 0.4rem;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.4rem;
        background: var(--emag-surface-faint);
        box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.05);
    }

    .emag-desktop-search {
        flex: 1 1 14rem;
        max-width: 18rem;
        min-width: 8rem;
    }

    .emag-desktop-search #dw__search,
    .emag-desktop-search #dw__search > .no {
        position: static;
        display: flex;
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        margin: 0;
    }

    .emag-desktop-search #dw__search input:is([type="text"], [type="search"]) {
        flex: 1 1 auto;
        box-sizing: border-box;
        min-width: 0;
        height: 2.75rem;
        padding: 0.55rem 0.75rem;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.35rem 0 0 0.35rem;
        background: var(--emag-background);
        color: var(--emag-text);
        font: inherit;
    }

    .emag-desktop-search #dw__search button {
        flex: 0 0 auto;
        box-sizing: border-box;
        min-width: 3rem;
        height: 2.75rem;
        margin: 0;
        border: 1px solid var(--emag-surface-border);
        border-left: 0;
        border-radius: 0 0.35rem 0.35rem 0;
        background: var(--emag-background);
        color: var(--emag-text);
        font-size: 0;
        text-indent: 0;
    }

    .emag-desktop-search #dw__search button::before {
        display: block;
        content: '\1f50d';
        font-size: 1.15rem;
        line-height: 1;
    }

    .emag-desktop-tools {
        position: relative;
        flex: 0 0 auto;
    }

    .emag-desktop-tools-button,
    .emag-desktop-language-button,
    .emag-desktop-account-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        box-sizing: border-box;
        min-height: 2.75rem;
        margin: 0;
        padding: 0.5rem 0.8rem;
        border: 1px solid transparent;
        border-radius: 0.35rem;
        background: transparent;
        color: var(--emag-text);
        font: inherit;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
    }

    :is(.emag-desktop-tools-button, .emag-desktop-language-button, .emag-desktop-account-button):is(:hover, :focus-visible, .active) {
        border-color: var(--emag-surface-border);
        background: var(--emag-background);
        color: var(--emag-accent-strong);
    }

    .emag-desktop-tools-button svg,
    .emag-desktop-language-button svg,
    .emag-desktop-account-button svg {
        width: 1.35rem;
        height: 1.35rem;
        fill: currentColor;
    }

    .emag-desktop-language-button svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
    }

    .emag-desktop-chevron {
        width: 0;
        height: 0;
        border-top: 0.35rem solid currentColor;
        border-right: 0.3rem solid transparent;
        border-left: 0.3rem solid transparent;
    }

    /* Shared dropdown surface; only widths differ between tools/language/account. */
    .emag-desktop-tools-menu,
    .emag-desktop-language-menu,
    .emag-desktop-account-menu {
        position: absolute;
        z-index: 1000;
        top: calc(100% + 0.45rem);
        right: 0;
        box-sizing: border-box;
        width: max-content;
        min-width: 12rem;
        overflow: hidden;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.4rem;
        background: var(--emag-background);
        box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.14);
    }

    .emag-desktop-tools-menu {
        min-width: 20rem;
        max-width: 28rem;
    }

    .emag-desktop-account-menu {
        min-width: 16rem;
    }

    .emag-desktop-tools-menu[hidden],
    .emag-desktop-language-menu[hidden],
    .emag-desktop-account-menu[hidden] {
        display: none;
    }

    .emag-desktop-tool-group {
        margin: 0;
        padding: 0.65rem 0;
    }

    .emag-desktop-tool-group + .emag-desktop-tool-group {
        border-top: 1px solid var(--emag-surface-border);
    }

    .emag-desktop-tool-group > h3 {
        margin: 0;
        padding: 0.2rem 0.9rem 0.4rem;
        color: var(--emag-text-alt);
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.04em;
    }

    .emag-desktop-tool-group ul {
        position: static;
        display: block;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        list-style: none;
        text-align: left;
    }

    .emag-desktop-tool-group li {
        position: static;
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .emag-desktop-tool-group li > a {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-height: 2.65rem;
        padding: 0.55rem 0.9rem;
        color: var(--emag-text);
        font-size: 0.95rem;
        line-height: 1.3;
        text-align: left;
        text-decoration: none;
        white-space: normal;
    }

    .emag-desktop-tool-group li > a:hover,
    .emag-desktop-tool-group li > a:focus-visible {
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
    }

    .emag-desktop-tool-group li > a span {
        position: static;
        display: inline;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        overflow: visible;
    }

    .emag-desktop-tool-group li > a svg,
    .emag-desktop-tool-group li > a img {
        position: static;
        flex: 0 0 auto;
        order: -1;
        display: block;
        width: 1.25rem;
        height: 1.25rem;
        margin: 0;
        fill: currentColor;
    }

    .emag-desktop-site-tools li > a::before {
        flex: 0 0 1.25rem;
        width: 1.25rem;
        color: var(--emag-text-alt);
        font-size: 1rem;
        line-height: 1;
        text-align: center;
    }

    .emag-desktop-site-tools li.recent > a::before {
        content: '\21bb';
    }

    .emag-desktop-site-tools li.media > a::before {
        content: '\25a3';
    }

    .emag-desktop-site-tools li.index > a::before {
        content: '\2637';
    }

    .emag-desktop-page-tools #dokuwiki__pagetools,
    .emag-desktop-page-tools #dokuwiki__pagetools .tools {
        position: static;
        display: block;
        float: none;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
    }

    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul {
        position: static !important;
        right: auto !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-align: left !important;
    }

    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul li {
        position: static !important;
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul li a {
        display: flex !important;
        align-items: center;
        gap: 0.65rem;
        box-sizing: border-box;
        width: 100% !important;
        height: auto !important;
        min-height: 2.65rem;
        padding: 0.55rem 0.9rem !important;
        line-height: 1.3 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul li a span {
        position: static !important;
        display: inline !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        clip: auto !important;
        overflow: visible !important;
    }

    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul li a svg,
    .emag-desktop-page-tools #dokuwiki__pagetools div.tools ul li a img {
        position: static !important;
        flex: 0 0 auto;
        order: -1 !important;
        width: 1.25rem !important;
        height: 1.25rem !important;
        margin: 0 !important;
        fill: currentColor;
    }

    .emag-desktop-language,
    .emag-desktop-user {
        flex: 0 0 auto;
    }

    .emag-desktop-user #dokuwiki__usertools,
    .emag-desktop-user #dokuwiki__usertools ul {
        position: static;
        display: flex;
        align-items: stretch;
        float: none;
        width: auto;
        height: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        text-align: left;
    }

    .emag-desktop-user li {
        display: flex;
        float: none;
        margin: 0 0 0 0.45rem;
        padding: 0;
    }

    .emag-desktop-user li > a {
        display: inline-flex;
        align-items: center;
        flex-direction: row;
        justify-content: center;
        gap: 0.45rem;
        box-sizing: border-box;
        min-height: 2.75rem;
        padding: 0.5rem 0.8rem;
        border: 1px solid var(--emag-surface-border);
        border-radius: 0.35rem;
        background: var(--emag-background);
        color: var(--emag-text);
        font-weight: 600;
        line-height: 1.2;
        text-align: left;
        text-decoration: none;
        white-space: nowrap;
    }

    .emag-desktop-user li.register > a {
        border-color: var(--emag-accent);
        background: var(--emag-accent);
        color: var(--emag-on-accent);
    }

    .emag-desktop-user li > a:hover,
    .emag-desktop-user li > a:focus-visible {
        border-color: var(--emag-accent);
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
    }

    .emag-desktop-user li > a > span {
        position: static;
        display: inline;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        overflow: visible;
    }

    .emag-desktop-user li > a svg,
    .emag-desktop-user li > a img {
        position: static;
        order: -1;
        width: 1.15rem;
        height: 1.15rem;
        margin: 0;
        fill: currentColor;
    }

    .emag-desktop-language,
    .emag-desktop-account {
        position: relative;
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation,
    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul,
    .emag-desktop-account-menu #dokuwiki__usertools,
    .emag-desktop-account-menu #dokuwiki__usertools ul {
        position: static;
        display: block;
        float: none;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0.45rem 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        list-style: none;
        text-align: left;
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation,
    .emag-desktop-account-menu #dokuwiki__usertools {
        padding: 0;
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li,
    .emag-desktop-account-menu #dokuwiki__usertools li {
        display: block;
        float: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .emag-desktop-account-menu #dokuwiki__usertools li.user {
        display: none;
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li > a,
    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li > span,
    .emag-desktop-account-menu #dokuwiki__usertools li > a {
        display: flex;
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.65rem;
        box-sizing: border-box;
        width: 100%;
        min-height: 2.65rem;
        padding: 0.55rem 0.9rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--emag-text);
        line-height: 1.3;
        text-align: left;
        white-space: normal;
    }

    .emag-desktop-account-menu #dokuwiki__usertools li > a:hover,
    .emag-desktop-account-menu #dokuwiki__usertools li > a:focus-visible,
    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li > a:hover,
    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li > a:focus-visible {
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation > .title {
        display: none;
    }

    #dokuwiki__header .emag-desktop-language-menu div.plugin_translation ul li > span {
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
        font-weight: 700;
    }
}

.emag-mobile-shell {
    display: none;
}

@media only screen and (max-width: 800px) {
    :root { --emag-responsive-rule: tablet; }

    .dokuwiki article.page {
        padding: 1em;
    }
}

@media (max-width: 767px) {
    :root { --emag-responsive-rule: phone; }

    #config__manager fieldset {
        margin-bottom: 1.1rem;
        padding: 0.55rem;
    }

    #config__manager fieldset > legend {
        margin-left: 0.15rem;
    }

    #config__manager fieldset > .table,
    #config__manager table.inline,
    #config__manager table.inline > tbody {
        display: block;
    }

    #config__manager table.inline tr {
        display: flex;
        flex-direction: column;
        padding: 0.7rem;
        border-top: 1px solid var(--emag-surface-border);
    }

    #config__manager table.inline tr:first-child {
        border-top: 0;
    }

    #config__manager table.inline tr > td,
    #config__manager table.inline td.label,
    #config__manager table.inline td.value {
        display: block;
        align-self: stretch;
        box-sizing: border-box;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0;
        border: 0;
        background: transparent;
    }

    #config__manager table.inline td.value {
        margin-top: 0.55rem;
    }

    #config__manager table.inline tr:not(.default) > td:first-child {
        margin-left: -0.7rem;
        padding-left: 0.7rem;
    }

    body:has(#edittable__editor) #tool__bar {
        width: 100%;
    }

    #edittable__editor + #wiki__editbar {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.65rem;
    }

    #edittable__editor + #wiki__editbar .editButtons > button {
        flex: 1 1 0;
        padding-right: 0.35rem;
        padding-left: 0.35rem;
    }

    #edittable__editor + #wiki__editbar .summary {
        align-items: stretch;
        flex-direction: column;
    }

    #edittable__editor + #wiki__editbar .summary label[for='edit__summary'] {
        align-items: stretch;
        flex-direction: column;
    }

    #edittable__editor + #wiki__editbar #edit__summary {
        width: 100%;
    }

    #dokuwiki__site,
    #dokuwiki__site > .site,
    #dokuwiki__content {
        box-sizing: border-box;
        float: none;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    #dokuwiki__content > .pad {
        margin-left: 0;
    }

    #dokuwiki__site > .site {
        padding-inline: 0;
    }

    #dokuwiki__header,
    #dokuwiki__footer {
        box-sizing: border-box;
        padding-inline: 0.5em;
    }

    .dokuwiki article.page {
        padding: 0.5em;
    }

    body.emag-mobile-nav-active {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    }

    html.emag-mobile-drawer-open,
    html.emag-mobile-drawer-open body {
        overflow: hidden;
    }

    .emag-mobile-shell {
        display: block;
    }

    .emag-mobile-nav {
        box-sizing: border-box;
        position: fixed;
        z-index: 10020;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: var(--emag-mobile-columns);
        min-height: 4rem;
        height: calc(4rem + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid var(--emag-accent-border);
        background: var(--emag-background);
        box-shadow: 0 -0.35rem 1.25rem rgba(0, 0, 0, 0.12);
    }

    .emag-mobile-nav-button {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        min-height: 4rem;
        margin: 0;
        padding: 0.35rem 0.15rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--emag-text);
        font: inherit;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.15;
        text-decoration: none;
    }

    .emag-mobile-nav-button.active {
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
    }

    .emag-mobile-nav-button:focus-visible {
        outline: 3px solid var(--emag-accent);
        outline-offset: -3px;
    }

    .emag-mobile-nav-icon {
        display: block;
        width: 1.5rem;
        height: 1.5rem;
    }

    .emag-mobile-nav-icon svg {
        display: block;
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .emag-mobile-drawer {
        position: fixed;
        z-index: 10010;
        inset: 0 0 calc(4rem + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .emag-mobile-drawer[hidden],
    .emag-mobile-panel[hidden] {
        display: none !important;
    }

    .emag-mobile-panel {
        position: absolute;
        inset: 0;
        overflow: auto;
        padding: 1rem;
        border: 0;
        border-radius: 0;
        background: var(--emag-background);
        box-shadow: none;
        overscroll-behavior: contain;
    }

    .emag-mobile-panel[data-emag-mobile-panel="language"] div.plugin_translation > .title {
        display: none;
    }

    .emag-mobile-panel:focus {
        outline: 0;
    }

    .emag-mobile-panel #dokuwiki__aside,
    .emag-mobile-panel #dw__toc,
    .emag-mobile-panel #dokuwiki__pagetools {
        position: static;
        display: block;
        float: none;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .emag-mobile-panel #dokuwiki__aside > .pad,
    .emag-mobile-panel #dw__toc > div {
        margin: 0;
    }

    .emag-mobile-panel #dokuwiki__aside h3.toggle {
        display: none !important;
    }

    /* Unfold stock sidebar/TOC containers without adding another panel wrapper. */
    .emag-mobile-panel[data-emag-mobile-panel="sidebar"] #dokuwiki__aside > .pad,
    .emag-mobile-panel[data-emag-mobile-panel="sidebar"] #dokuwiki__aside div.content,
    .emag-mobile-panel[data-emag-mobile-panel="sidebar"] #dokuwiki__aside div.content > nav > .group,
    .emag-mobile-panel[data-emag-mobile-panel="contents"] #dw__toc > div {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="sidebar"] #dokuwiki__aside > .pad {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .emag-mobile-panel[data-emag-mobile-panel="contents"] #dw__toc > h3 {
        display: none !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="contents"] #dw__toc > div {
        margin: 0 !important;
        padding: 0 !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools,
    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__usertools,
    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools > ul,
    .emag-mobile-panel[data-emag-mobile-panel="menu"] .plugin_translation {
        position: static;
        display: block !important;
        float: none !important;
        width: 100% !important;
        margin: 0 0 0.75rem;
        text-align: left !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools .mobileTools {
        display: none !important;
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools > ul,
        #dokuwiki__usertools > ul,
        .plugin_translation ul,
        #dokuwiki__pagetools div.tools ul
    ) {
        box-sizing: border-box;
        position: static !important;
        right: auto !important;
        float: none !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
        width: 100% !important;
        height: auto !important;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent !important;
        box-shadow: none !important;
        list-style: none;
        text-align: left !important;
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools,
        #dokuwiki__usertools,
        .plugin_translation,
        #dokuwiki__pagetools
    ) li {
        position: static !important;
        float: none !important;
        clear: both;
        display: block !important;
        width: 100% !important;
        margin: 0;
        padding: 0;
        text-align: left !important;
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools,
        #dokuwiki__usertools,
        .plugin_translation,
        #dokuwiki__pagetools
    ) li > a,
    .emag-mobile-panel .plugin_translation li > span {
        box-sizing: border-box;
        float: none !important;
        display: flex !important;
        align-items: center;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 0.65rem;
        width: 100%;
        height: auto !important;
        min-height: 3.25rem;
        margin: 0;
        padding: 0.7rem 0.85rem;
        border: 0 !important;
        border-radius: 0.55rem;
        background: var(--emag-background);
        box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.08);
        color: var(--emag-text);
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.35 !important;
        text-align: left !important;
        text-decoration: none;
        text-indent: 0;
        white-space: normal !important;
        overflow: visible !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="language"] div.plugin_translation ul li > a,
    .emag-mobile-panel[data-emag-mobile-panel="language"] div.plugin_translation ul li > span {
        padding: 0.7rem 0.85rem !important;
        background: var(--emag-background) !important;
        color: var(--emag-text) !important;
    }

    .emag-mobile-panel[data-emag-mobile-panel="language"] div.plugin_translation ul li > span {
        background: var(--emag-accent-soft) !important;
        color: var(--emag-accent-strong) !important;
        font-weight: 700;
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools,
        #dokuwiki__usertools,
        #dokuwiki__pagetools
    ) li > a > span {
        position: static !important;
        display: inline !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        clip: auto !important;
        overflow: visible !important;
        color: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        text-align: left !important;
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools,
        #dokuwiki__usertools,
        .plugin_translation,
        #dokuwiki__pagetools
    ) li :is(svg, img) {
        position: static !important;
        flex: 0 0 auto;
        order: -1 !important;
        box-sizing: border-box;
        display: block !important;
        width: 2rem !important;
        height: 2rem !important;
        margin: 0 !important;
        padding: 0.35rem;
        border-radius: 0.4rem;
        background: var(--emag-accent);
        color: var(--emag-on-accent);
        fill: var(--emag-on-accent);
        vertical-align: middle;
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools li > a::before {
        box-sizing: border-box;
        flex: 0 0 2rem;
        order: -1;
        display: inline-grid;
        place-items: center;
        width: 2rem;
        height: 2rem;
        border-radius: 0.4rem;
        background: var(--emag-accent);
        color: var(--emag-on-accent);
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1;
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools li.recent > a::before {
        content: '\21bb';
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools li.media > a::before {
        content: '\25a3';
    }

    .emag-mobile-panel[data-emag-mobile-panel="menu"] #dokuwiki__sitetools li.index > a::before {
        content: '\2637';
    }

    .emag-mobile-panel :is(
        #dokuwiki__sitetools,
        #dokuwiki__usertools,
        .plugin_translation,
        #dokuwiki__pagetools
    ) li > a:is(:hover, :focus-visible) {
        background: var(--emag-accent-soft);
        color: var(--emag-accent-strong);
    }

    .emag-mobile-panel form.search {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }

    .emag-mobile-panel form.search input:is([type="text"], [type="search"]) {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.65rem;
        border: 1px solid var(--emag-accent-border);
        border-radius: 0.35rem;
        font-size: 1rem;
    }

    .emag-mobile-panel form.search button {
        flex: 0 0 auto;
    }

    .emag-mobile-panel #dokuwiki__usertools,
    .emag-mobile-panel #dokuwiki__pagetools .tools {
        position: static;
        display: block;
        float: none;
        width: auto;
        height: auto;
        margin: 0 0 1rem;
    }

    .emag-mobile-nav-active #dokuwiki__header .tools {
        display: none;
    }

    #dokuwiki__site > .site {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #dokuwiki__aside {
        border-right: 0;
    }

    .bs-wrap .panel-heading a,
    .bs-wrap .panel-body {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }
}

@media (forced-colors: active) {
    .bs-wrap .panel,
    .emag-desktop-toolbar,
    .emag-desktop-tools-menu,
    .emag-desktop-language-menu,
    .emag-desktop-account-menu,
    .emag-mobile-nav,
    .emag-mobile-panel,
    body:has(#edittable__editor) #tool__bar,
    #edittable__editor,
    #edittable__editor + #wiki__editbar {
        border-color: CanvasText;
        box-shadow: none;
    }

    .emag-desktop-tools-button.active,
    .emag-desktop-language-button.active,
    .emag-desktop-account-button.active,
    .emag-mobile-nav-button.active {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }

    #edittable__editor {
        outline: 1px solid CanvasText;
    }

    #dokuwiki__content #dw__toc ul.toc a.emag-toc-current {
        border-left-color: Highlight;
    }
}

@media print {
    .emag-share-notice { display: none !important; }
    html:has(#emag-background) {
        background-image: none !important;
    }

    html:has(#emag-background) #dokuwiki__site > .site {
        background-color: var(--emag-background);
    }

    #dokuwiki__header {
        position: static !important;
        box-shadow: none !important;
    }

    .emag-desktop-toolbar,
    .emag-mobile-shell {
        display: none !important;
    }

    body.emag-mobile-nav-active {
        padding-bottom: 0 !important;
    }

    html.emag-mobile-drawer-open,
    html.emag-mobile-drawer-open body {
        overflow: visible !important;
    }
}
