/*
 * VCMS Created with Devin and AI
 * Usage only by Mikado Model Helicopters allowed
 *
 * (C) 2026 Rainer Vetter - all rights reserved
 */
@import url("style-topmenu.css");

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, sans-serif;
    font-size: 12px;
    /* 160%, written without a unit so that headings and small text get the same ratio of their own size */
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* Container layout: the site uses the full viewport width on all screens */
.container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    width: 100vw;
    margin: 0;
    min-height: 100vh;
}

/* Top bar with logo and slogan (VStabi style), scrolls with the page */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 940;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: #d2e6f3;
    background-image: url(../img/vstabi/bg-navigation.png);
    background-repeat: repeat-x;
    background-position: 50% 100%;
    border-bottom: 1px solid #b4d7f0;
}

/* Inside .container the bar spans exactly the container's width (scrollbar-proof) */
.container .top-bar {
    left: 0;
    right: 0;
}

.top-brand {
    display: flex;
    align-items: baseline;
    gap: 30px;
    text-decoration: none;
    color: #33566e;
}

.top-brand img {
    height: 84px;
    width: auto;
}

.top-text {
    display: flex;
    align-items: baseline;
    gap: 30px;
}

/* Desktop only: centers the logo in the bar and lifts the texts so the descender of the slogan (y) ends at the bottom of the logo. Phones keep their own top bar below. */
@media (min-width: 769px) {
    .top-brand {
        padding-top: 20px;
    }

    .top-text {
        position: relative;
        top: -9px;
    }
}

.top-name {
    font-size: 3.6em;
    font-weight: bold;
}

.top-slogan {
    font-size: 2.9em;
    color: #2f6f9f;
}

/* The aside is only a wrapper: on desktop its children (the two menu bars) become
   flex items of .container directly, so display:contents removes the box itself.
   On mobile the media query below turns it back into the off-canvas box. */
.sidebar {
    display: contents;
}

/* Left menu bar (VStabi/Garland colors: light blue, blue links) */
.main-menu.menu-left {
    order: 0;
    width: 275px;
    margin-top: 120px;
    overflow-y: auto;
    background-color: #d2e6f3;
    background-image: url(../img/vstabi/bg-navigation.png);
    background-repeat: repeat-x;
    background-position: 50% 0;
    border-right: 1px solid #b4d7f0;
    padding: 30px 0 20px;
}

/* Menus and footer links use the same font size as the page text */
.main-menu,
.site-footer {
    font-size: 13px;
}

.main-menu ul {
    list-style: none;
}

/* Menu blocks: named groups with empty space between them */
.menu-block {
    margin-bottom: 24px;
}

.menu-block:last-child {
    margin-bottom: 0;
}

.menu-block-title {
    padding: 0 18px 6px;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2f6f9f;
    border-bottom: 1px solid #b4d7f0;
}

.menu-block > ul {
    padding-top: 6px;
}

.menu-block > ul > li {
    border-bottom: 1px solid #c4ddef;
}

.menu-block > ul > li:last-child {
    border-bottom: none;
}

.main-menu a {
    display: block;
    padding: 6.4px 18px;
    color: #33566e;
    text-decoration: none;
}

.main-menu a:hover {
    background-color: #e6f1f7;
    color: #1a5fb4;
}

/* Forum */
.forum-group {
    margin-bottom: 15px;
}

.forum-group h2 {
    margin: 12px 0 6px;
    font-size: 13.3px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 3px;
}

.forum-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.forum-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.forum-item-main {
    flex: 1;
    min-width: 0;
}

.forum-title {
    font-weight: bold;
    overflow-wrap: break-word;
}

.forum-desc {
    display: block;
    color: #666;
    font-size: 0.9em;
}

.forum-item-stats {
    text-align: right;
    white-space: nowrap;
    color: #666;
    font-size: 0.9em;
}

/* Thread list as a classic forum table: subject | views | posts | last post */
.forum-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.forum-table th,
.forum-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.forum-table th {
    color: #666;
    font-size: 0.9em;
}

.forum-table .ft-num {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

.forum-table .ft-last {
    width: 1%;
    white-space: nowrap;
    color: #666;
    font-size: 0.9em;
}

.forum-table .ft-subject {
    width: 72%;
}

.forum-table .forum-desc {
    margin-top: 1px;
}

/* Thread titles in the overview are plain links, not bold */
.forum-threads .forum-title {
    font-weight: normal;
}

/* ... unless the thread has posts the user has not seen yet */
.forum-title.forum-unread,
.forum-tr-badge {
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    color: #fff;
    background: #3498db;
    border-radius: 3px;
    padding: 1px 6px;
    margin-left: 6px;
    white-space: nowrap;
}

.forum-tr-note {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
}

.forum-tr-note a {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
}

.forum-tr-note a:hover {
    text-decoration: underline;
}

.forum-post-body .post-orig[hidden] {
    display: none;
}

/* Page switcher under/over the post list of a thread */
.forum-pages {
    margin: 10px 0;
    font-size: 14px;
}

.forum-pages a,
.forum-pages .forum-pages-cur {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 2px 4px 0;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    color: #2980b9;
    text-decoration: none;
}

.forum-pages a:hover {
    background: #eaf3fa;
}

.forum-pages .forum-pages-cur {
    background: #2980b9;
    border-color: #2980b9;
    color: #fff;
    font-weight: bold;
}

.forum-pages .forum-pages-gap {
    padding: 0 4px;
    color: #999;
}

.forum-post-new .forum-post-head {
    font-weight: bold;
}

/* Pinned threads: light highlight plus a small badge in front of the title */
.forum-table tr.forum-sticky {
    background: #f0f6fa;
}

.forum-pin-badge {
    display: inline-block;
    padding: 0 5px;
    margin-right: 5px;
    border: 1px solid #b8c9d6;
    border-radius: 3px;
    background: #dde9f1;
    color: #2f5873;
    font-size: 0.8em;
    vertical-align: 1px;
}

/* Closed threads / read-only forums: muted gray badge */
.forum-closed-badge {
    display: inline-block;
    padding: 0 5px;
    margin-right: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #eee;
    color: #666;
    font-size: 0.8em;
    vertical-align: 1px;
}

h1 .forum-closed-badge {
    font-size: 0.5em;
    vertical-align: 3px;
}

.forum-readonly-cb {
    white-space: nowrap;
    font-weight: normal;
}

/* "Mark all posts as read" sits inside group headings and below thread tables */
.forum-markread {
    display: inline;
    font-weight: normal;
    font-size: 0.85rem;
    margin-left: 10px;
}

form.forum-markread {
    margin-top: 8px;
}

h2 .forum-markread {
    font-size: 0.8rem;
}

/* Stat column labels only show on phones, where the table turns into stacked lines */
.forum-table .ft-label {
    display: none;
}

/* Phones: subject/title on a full line, stats + last poster on the last line */
@media (max-width: 768px) {
    .forum-table thead {
        display: none;
    }

    .forum-table,
    .forum-table tbody,
    .forum-table tr {
        display: block;
    }

    .forum-table tr {
        padding: 6px 8px;
        border-bottom: 1px solid #ddd;
    }

    .forum-table td {
        display: inline;
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .forum-table td.ft-subject {
        display: block;
        width: auto;
    }

    .forum-table td.ft-num,
    .forum-table td.ft-last {
        width: auto;
        text-align: left;
        color: #666;
        font-size: 0.9em;
    }

    .forum-table td.ft-num ~ td::before {
        content: " \00B7 ";
    }

    .forum-table td.ft-last br {
        display: none;
    }

    .forum-table .ft-label {
        display: inline;
    }

    /* File/import tables: cells of one row stack on a phone, each with its column label */
    .file-table.stackable thead {
        display: none;
    }

    .file-table.stackable tbody tr {
        display: block;
        border-bottom: 2px solid #bbb;
        padding: 6px 0;
    }

    .file-table.stackable td {
        display: block;
        border-bottom: none;
        padding: 3px 8px;
    }

    .file-table.stackable td[data-label]::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 110px;
        font-weight: bold;
        color: #666;
        font-size: 0.9em;
    }

    /* Long thread titles get cut after two lines instead of stretching the row */
    .forum-threads .forum-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Forum member profile: label/value rows in the account box */
.prof-table td {
    padding: 2px 12px 2px 0;
    vertical-align: top;
}

.prof-table td:first-child {
    color: #666;
    white-space: nowrap;
}

.prof-sig {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    color: #555;
    font-size: 0.9em;
}

/* Denser forum pages: tighter gaps under the page title and around paragraphs */
.forum-page h1 {
    font-size: 22px;
    margin-bottom: 12px;
    padding-bottom: 6px;
}

.forum-page > p {
    margin-bottom: 10px;
}

.forum-topics {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.forum-topic {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.forum-topic .file-info {
    display: block;
}

.forum-topic-title {
    margin: 14px 0 4px;
    font-size: 13.95px;
}

.forum-reply-box {
    margin-top: 8px;
}

/* Collapsible "New topic" / "Reply" forms */
.forum-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.forum-actions-row .forum-compose {
    margin-bottom: 0;
}

.forum-actions-row .forum-compose[open] {
    flex-basis: 100%;
}

.forum-admin-actions {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.forum-admin-actions .inline-form {
    display: inline;
}

.forum-compose {
    margin-bottom: 15px;
}

/* The reply/new-topic editor uses the whole column width — the 600px box looks tiny on a desktop */
.forum-compose .account-box {
    max-width: none;
}

/* A little air between the last topic row and the "New topic" button (only on the board page;
   the reply form on the thread page sits inside .forum-actions-row) */
.forum-page > .forum-compose {
    margin-top: 15px;
}

.forum-compose > summary {
    list-style: none;
    cursor: pointer;
    /* inline-flex (not inline-block) so the .btn centering applies to the label */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.forum-compose > summary::-webkit-details-marker {
    display: none;
}

.forum-compose[open] > summary {
    margin-bottom: 12px;
}

.forum-delete-form {
    display: inline;
}

/* Delete buttons look like normal links (same style as the Edit link) */
.forum-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #1a5fb4;
    cursor: pointer;
    font-size: inherit;
    text-decoration: none;
}

.forum-link-btn:hover {
    text-decoration: underline;
}

/* Moderation actions (pin/close/edit/delete): one row, link-styled, small icons */
.forum-actions {
    display: inline-flex;
    gap: .5em;
    align-items: baseline;
    vertical-align: baseline;
    flex-wrap: wrap;
    margin-left: .4em;
}
.forum-actions .inline-form {
    display: inline;
}
.forum-actions .forum-link-btn {
    white-space: nowrap;
}
svg.forum-icon {
    width: .85em;
    height: .85em;
    vertical-align: -0.12em;
    margin-right: .12em;
}

.forum-posts {
    margin-bottom: 15px;
}

.forum-post {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fafafa;
}

.forum-post-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.forum-post-body {
    white-space: normal;
    overflow-wrap: anywhere;
}

.forum-post-body pre {
    overflow-x: auto;
}

.forum-post-body ul,
.forum-post-body ol {
    margin: 0 0 10px 20px;
    padding: 0;
}

/* Authored page/news text keeps the look the editor shows: the global reset removes the
   default paragraph spacing and the list indentation, so they are set again here */
.page-content p,
.news-preview p,
.news-item p {
    margin: 0 0 10px;
}

.page-content ul,
.page-content ol,
.news-preview ul,
.news-preview ol,
.news-item ul,
.news-item ol {
    margin: 0 0 10px 20px;
    padding: 0 0 0 15px;
}

.forum-post-body a {
    color: #1a5fb4;
}

.forum-post-body hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 12px 0;
}

.forum-attachments {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.forum-attachment-img img {
    max-width: 180px;
    max-height: 180px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
}

.forum-attachment-file {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Attachment list on the post edit page: thumbnail/file + delete link */
.forum-edit-attachments {
    margin-bottom: 10px;
}

.forum-edit-att {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.forum-edit-att img {
    max-width: 80px;
    max-height: 80px;
    display: block;
}

/* Private messages: a thread renders as stacked message boxes; the own ones sit on the right */
.pm-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0 20px;
}

.pm-msg {
    max-width: 85%;
    padding: 8px 12px;
    border: 1px solid #dde9f1;
    border-radius: 10px;
    background: #fff;
    align-self: flex-start;
}

.pm-msg.pm-mine {
    background: #eaf3fa;
    border-color: #d2e6f3;
    align-self: flex-end;
}

.pm-msg-head {
    margin-bottom: 4px;
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.pm-staff-badge {
    padding: 0 6px;
    border-radius: 8px;
    background: #2980b9;
    color: #fff;
    font-size: 0.75em;
    text-transform: uppercase;
}

.pm-unread .forum-title {
    font-weight: bold;
}

.pm-dir {
    display: inline-block;
    width: 1.1em;
    font-weight: bold;
}

.pm-dir-in {
    color: #2980b9;
}

.pm-dir-out {
    color: #7f8c8d;
}

.pm-unread-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 9px;
    background: #e67e22;
    color: #fff;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
}

.pm-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-att {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.pm-att-image {
    padding: 0;
}

.pm-att-image img {
    max-width: 150px;
    max-height: 150px;
    display: block;
    border-radius: 4px;
}

@media (max-width: 700px) {
    .pm-msg {
        max-width: 100%;
    }
}

.forum-admin-row {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

/* One group per row: fields on top, save/delete buttons beneath */
.forum-admin-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 18px;
}

.forum-admin-fields {
    margin-bottom: 8px;
}

.forum-admin-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Manage forum needs more room than the default account box */
.forum-admin .account-box {
    max-width: 980px;
}

/* Breathing room between the forum-group sections */
.forum-admin .account-box h3 {
    margin-top: 22px;
}

.forum-admin .account-box h3:first-of-type {
    margin-top: 0;
}

.forum-admin-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.forum-order-input {
    width: 70px;
    flex: 0 0 auto;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input[type="text"] {
    flex: 1;
    min-width: 150px;
}

/* Two-factor setup: the QR code shown once */
.totp-qr {
    margin: 10px 0 15px;
}

.totp-qr svg {
    width: 220px;
    height: 220px;
    display: block;
}

/* Logout is a POST form (CSRF-protected); the button looks like a menu link */
.menu-logout form {
    margin: 0;
}

.menu-logout .menu-link {
    display: block;
    width: 100%;
    padding: 6.4px 18px;
    border: 0;
    background: none;
    color: #333;
    font: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.menu-logout .menu-link:hover {
    background-color: #e6f1f7;
    color: #1a5fb4;
}

/* Submenu styles: nested pages expand inline, indented under their parent */
.submenu {
    display: none;
    margin: 0 4px 4px 12px;
    padding: 0 0 0 6px;
}

.submenu.open {
    display: block;
}

.submenu a {
    padding: 3px 10px;
    color: #2f6f9f;
}

/* The page the visitor is looking at */
.main-menu a.current {
    font-weight: bold;
}

.submenu a:hover {
    color: #1a5fb4;
}

/* Items with children: the [+]/[−] box and the link share a flex row, so a long
   title wraps inside its own text and never breaks away from the box */
.main-menu li.has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.main-menu li.has-children > a {
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.main-menu li.has-children > .submenu {
    flex-basis: 100%;
}

/* The button is a transparent hit area (24x30) around the visible 16px box, so the
   toggle is easy to tap on touch screens without changing how it looks */
.submenu-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 30px;
    margin: -7px 0 -7px 0;
    padding: 0;
    background: none;
    border: none;
    color: #2f6f9f;
    cursor: pointer;
}

.submenu-toggle::before {
    content: '+';
    display: block;
    width: 16px;
    height: 16px;
    border: 1px solid #9ec3e0;
    border-radius: 2px;
    font-size: 13px;
    line-height: 14px;
    text-align: center;
}

.submenu-toggle.open::before {
    content: '\2212'; /* minus sign */
}

.submenu-toggle:hover::before {
    color: #1a5fb4;
    border-color: #1a5fb4;
}

/* Menu toggle (hamburger) - hidden on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #2f6f9f;
    font-size: 24px;
    padding: 10px 16px;
    cursor: pointer;
}

/* Main content area: white panel with the subtle top shading */
.content {
    order: 1;
    flex: 1;
    min-width: 0;
    /* The running text is one step larger than the surrounding UI; headings and
       menus keep their sizes */
    font-size: 13px;
    padding: 140px 40px 40px;
    background-color: #f0f7fc;
    /* Short pages still fill the window: the content area (and with it the menu bars,
       which stretch to the same row) reaches down to the footer at the bottom */
    min-height: calc(100vh - 56px);
}

/* The blocks that are placed in the right menu form a panel on the right side of the screen
   (it only exists when at least one visible block is placed there). On small screens it follows
   the left menu inside the hamburger menu. */
@media (min-width: 769px) {
    /* Right menu bar: a sticky flex item after the content, so it ends at the footer like the left bar */
    .main-menu.menu-right {
        order: 2;
        width: 242px;
        margin: 120px 0 0;
        padding: 30px 12px 20px;
        overflow-y: auto;
        background-color: #d2e6f3;
        border-left: 1px solid #b4d7f0;
    }

    /* No right-side blocks: no bar at all, the content uses the full width */
    .main-menu.menu-right.menu-right-empty {
        width: 0;
        padding: 0;
        border: none;
    }
}

/* Site footer: links to the footer-only pages (Imprint, Terms, Contact).
   Inside .container it is a flex item on its own row; on pages without the
   container (login) it keeps the standalone full-width layout. */
.site-footer {
    width: 100vw;
    margin: 0;
    border-top: 1px solid #b4d7f0;
    background-color: #d2e6f3;
    padding: 14px 20px;
}

.container .site-footer {
    order: 3;
    flex: 0 0 100%;
    width: auto;
    margin: 0;
}

/* The footer links span the full container width inside the site container */
.container .site-footer-inner {
    max-width: none;
}

.site-footer-inner {
    max-width: 100vw;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.site-footer a {
    color: #2f6f9f;
    text-decoration: none;
    font-size: 0.9em;
}

.site-footer a:hover {
    color: #1a5fb4;
    text-decoration: underline;
}

/* Language switcher (flag dropdown on the right side of the top bar) */
.lang-switcher {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 950;
}

/* Inside .container: align with the container's right edge */
.container .lang-switcher {
    right: 16px;
}

.lang-switcher-plain {
    right: 16px;
}

.lang-switch summary {
    list-style: none;
    cursor: pointer;
    font-size: 9.5px;
    line-height: 1;
    padding: 6px 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    user-select: none;
}

.lang-switch summary::-webkit-details-marker {
    display: none;
}

.lang-switch summary:hover {
    border-color: #3498db;
}

.lang-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    padding: 4px 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.lang-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: #2980b9;
    text-decoration: none;
    white-space: nowrap;
}

.lang-list a:hover {
    background-color: #f0f6fc;
}

.lang-list a.active {
    font-weight: bold;
    color: #27ae60;
}

.lang-flag {
    font-size: 20px;
    line-height: 1;
}

/* Flag badge: the two-letter country code in the language's colours */
.flag-badge {
    display: inline-block;
    min-width: 24px;
    padding: 2px 5px 3px;
    border-radius: 3px;
    background-color: #555;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.flag-en { background-color: #012169; }
.flag-de { background-color: #dd0000; }
.flag-es { background-color: #c60b1e; }
.flag-fr { background-color: #0055a4; }
.flag-it { background-color: #009246; }
.flag-pt { background-color: #046a38; }
.flag-nl { background-color: #ae1c28; }
.flag-pl { background-color: #dc143c; }

/* Real flag image (img/flags/<code>.svg) */
.flag-img {
    display: inline-block;
    width: 24px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.lang-switch summary .flag-img {
    width: 36px;
}

/* Account dropdown + layout toggle: sit in the top bar left of the language flags (both layouts) */
.account-switch {
    position: absolute;
    top: 10px;
    right: 118px;
    z-index: 960;
}

.container .account-switch {
    right: 118px;
}

.layout-toggle {
    position: absolute;
    top: 10px;
    right: 76px;
    z-index: 960;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 34px;
    padding: 6px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: #33566e;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    user-select: none;
}

.container .layout-toggle {
    right: 76px;
}

.layout-toggle:hover {
    border-color: #3498db;
}

.layout-toggle svg {
    display: block;
}

/* Top-right control cluster: search box, account, layout toggle and language flags.
   One flex row so the controls never overlap regardless of username length. */
.top-controls {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 960;
    display: flex;
    align-items: center;
    gap: 8px;
}

.container .top-controls {
    right: 16px;
}

.top-controls .lang-switcher,
.top-controls .account-switch,
.top-controls .layout-toggle {
    position: static;
}

/* The flag dropdown anchors to the details element */
.lang-switch {
    position: relative;
}

/* Search box in the top bar (shown to logged-in users only) */
.site-search {
    display: flex;
    align-items: center;
}

.site-search input {
    height: 32px;
    width: 150px;
    padding: 4px 8px;
    font-size: 9.5px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.site-search input:focus {
    outline: none;
    border-color: #3498db;
}

.site-search .search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 9px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 6px 6px 0;
    color: #33566e;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.site-search .search-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

/* Section filter of the quick search: a details dropdown between the field and the button */
/* The slider button of the quick search opens the full search form */
.search-scope-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 7px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    color: #33566e;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.search-scope-link:hover {
    border-color: #3498db;
    color: #3498db;
}

.account-drop {
    position: relative;
}

.account-drop summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 9.5px;
    line-height: 1;
    min-height: 32px;
    padding: 6px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: #33566e;
    user-select: none;
}

.account-drop summary::-webkit-details-marker {
    display: none;
}

.account-drop summary:hover {
    border-color: #3498db;
}

.account-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 170px;
    padding: 4px 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    z-index: 960;
}

.account-list a,
.account-list .account-link {
    display: block;
    width: 100%;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.account-list a:hover,
.account-list .account-link:hover {
    background-color: #f0f6fc;
}

/* Menu group headline translations (Manage pages) */
.group-langs {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.group-langs > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
}

.group-langs > summary::-webkit-details-marker {
    display: none;
}

.group-langs > summary:hover {
    border-color: #3498db;
}

.group-langs[open] > summary {
    margin-bottom: 6px;
}

.group-i18n-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 8px;
    background-color: #f7f9fc;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
}

/* Same expand/collapse as the menu group headlines, inside the topic table of Manage videos:
   the flags button sits on its own line below the title field */
details.group-langs.video-topic-details {
    display: block;
    margin: 8px 0 0;
}

/* Collapsible sections on the admin pages: the heading inside <summary> is the expand/collapse handle */
.admin-collapse {
    margin: 10px 0;
}

.admin-collapse > summary {
    cursor: pointer;
    margin-bottom: 8px;
}

.admin-collapse > summary h2,
.admin-collapse > summary h3 {
    display: inline;
    margin: 0;
}

/* Search field above the user table on Manage users */
.users-search {
    margin-bottom: 12px;
}

.users-search input[type="search"] {
    min-width: 220px;
}

.group-i18n-form label {
    font-size: 8.75px;
    font-weight: normal;
    white-space: nowrap;
}

.group-i18n-form input[type="text"] {
    width: 160px;
}

/* Warning inside the Administration dropdown while the maintenance mode is on */
.main-menu a.menu-maintenance {
    display: block;
    margin: 4px 10px;
    padding: 6px 10px;
    border-radius: 4px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    white-space: normal;
}

.main-menu a.menu-maintenance:hover {
    background-color: #c0392b;
    color: #fff;
}

/* Hint for Mikado ID users on the login page */
.login-info {
    margin: 20px 0;
    padding: 12px 15px;
    background-color: #ecf0f1;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    font-size: 0.9em;
}

.login-info p {
    margin-top: 5px;
}

/* News feed on the main page */
.news-feed {
    margin-top: 40px;
}

.news-item {
    margin-bottom: 25px;
    padding: 18px 20px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.news-item.news-top {
    border-left-color: #e67e22;
}

.news-item h3 {
    margin: 0 0 5px;
    font-weight: normal;
    font-size: 18px;
}

.news-item h3 a {
    text-decoration: none;
}

.news-date {
    margin-bottom: 10px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.news-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    background-color: #e67e22;
    color: #fff;
    font-size: 0.7em;
    font-weight: bold;
    vertical-align: middle;
    text-transform: uppercase;
}

.news-badge.badge-draft {
    background-color: #b7a60a;
}

/* Unpublished page or news entry: only admins ever see it, in light yellow instead of white */
main.content.unpublished,
.news-item.unpublished {
    background-color: #ffffe6;
}

.news-item.unpublished .news-preview {
    background-color: transparent;
}

tr.unpublished-row td {
    background-color: #ffffe6;
}

a.unpublished {
    background-color: #ffffe6;
    color: #7d7600;
}

.notice-draft {
    background-color: #b7a60a;
}

.news-more {
    margin: 10px 0 0;
}

/* Configuration page */
.config-box {
    max-width: 800px;
}

.config-box h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 13.3px;
}

.config-box .file-table th {
    width: 40%;
    font-weight: bold;
}

/* Typography */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

h1 {
    font-size: 31.5px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    font-size: 22.4px;
    margin-top: 30px;
}

h3 {
    font-size: 15.9px;
    margin-top: 20px;
}

p {
    margin-bottom: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.form-group textarea {
    resize: vertical;
}

/* Fields that cannot be edited: grey background */
.form-group input[readonly],
.form-group input:disabled,
.form-group textarea[readonly],
.form-group textarea:disabled,
.form-group select:disabled {
    background-color: #ececec;
    color: #666;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: 8px 20px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #219a52;
}

/* On/Off toggle in the languages table: same width for both states */
.lang-toggle {
    min-width: 64px;
}

/* "Default" marker of the standard language */
.lang-default-tag {
    color: #27ae60;
}

/* Cookie notice bar at the bottom of the page */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #fff;
    border-top: 1px solid #b8cfe0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cookie-banner p {
    margin: 0;
    max-width: 720px;
    font-size: 10.5px;
    color: #333;
}

/* Search results page */
.search-form {
    margin: 12px 0 20px;
    max-width: 640px;
}

/* First row of the search form: the text field with the button right beside it;
   the field fills the row so the option box below ends at the same right edge */
.search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: var(--control-height, 38px);
    padding: 6px 10px;
    font-size: 10.5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Section checkboxes below the search field on the search page */
.search-scope {
    display: flex;
    gap: 15px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Forum-only filters below the scope row: date range, language flags, original/translation */
.search-forum-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid #d5dde3;
    border-radius: 6px;
    font-size: 10.5px;
}

.search-forum-opts[hidden] {
    display: none;
}

.search-opts-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-forum-opts label {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.search-forum-opts input[type="date"] {
    height: var(--control-height, 30px);
    padding: 3px 6px;
    font-size: 10.5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.search-flag-opts,
.search-src-opts {
    gap: 10px;
}

/* Flag checkboxes: same size as the flag of the language switcher in the top bar */
.search-flag-opts .flag-img {
    width: 36px;
}

.search-flag-opts .flag-badge {
    min-width: 36px;
    font-size: 13px;
}

.search-opts-label {
    font-weight: 600;
}

/* Collapsible syntax help under the search form */
.search-guide {
    max-width: 640px;
    margin-top: -8px;
    font-size: 10.5px;
}

.search-guide > summary {
    cursor: pointer;
    color: #33566e;
    text-decoration: underline dotted;
    width: fit-content;
}

.search-guide ul {
    margin: 6px 0 4px;
    padding-left: 18px;
}

.search-guide li {
    margin-bottom: 3px;
}

.search-guide code {
    background: #eef2f5;
    padding: 1px 5px;
    border-radius: 3px;
}

.search-results {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

/* The searched words inside titles and snippets */
.search-results mark {
    background-color: #ffe066;
    padding: 0 1px;
    border-radius: 2px;
}

.search-results li {
    padding: 10px 0;
    border-bottom: 1px solid #e3ecf3;
}

.search-snippet {
    color: #555;
    font-size: 9.5px;
    margin-top: 4px;
}

.btn-small {
    padding: 8px 10px;
    font-size: 10.5px;
}

/* Breadcrumb (left) and the PDF button (right) share the line below the page title */
.page-head-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    flex-wrap: wrap;
    margin: 4px 0 10px;
}

.page-head-bar .pdf-bar {
    margin: 0;
}

.breadcrumb {
    font-size: 10.7px;
    color: #6a8aa0;
    text-align: left;
    min-width: 0;
}

.breadcrumb a {
    color: #2f6f9f;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1a5fb4;
    text-decoration: underline;
}

.breadcrumb .sep {
    color: #9ec3e0;
    margin: 0 6px;
}

.breadcrumb .current {
    color: #33566e;
}

/* PDF download button on content pages */
.pdf-bar {
    margin: 4px 0 10px;
    text-align: right;
}

.btn-pdf {
    background-color: #7f8c8d;
    font-size: 11.5px;
    padding: 6px 14px;
    min-height: 0;
}

.btn-pdf:hover {
    background-color: #5d6d7e;
}

/* One height for every input field, dropdown and button: the height of the "Save" button */
:root {
    --control-height: 38px;
}

/* Fields in .form-group (they have their own padding rule above) */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select {
    height: var(--control-height);
    padding: 0 10px;
    line-height: normal;
}

/* All other fields and dropdowns (inline forms, upload forms, login), without touching the editor's own controls */
:where(.content, .login-container) :where(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], input[type="url"], input[type="tel"], select):not([class*="tox"]) {
    height: var(--control-height);
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    line-height: normal;
    vertical-align: middle;
}

/* File choosers: the "choose file" button looks exactly like the other buttons (.btn) */
:where(.content, .login-container) input[type="file"] {
    height: var(--control-height);
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    font-family: inherit;
    font-size: 10.5px;
    vertical-align: middle;
}

:where(.content, .login-container) input[type="file"]::file-selector-button {
    height: var(--control-height);
    margin-right: 12px;
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.3s;
}

:where(.content, .login-container) input[type="file"]:hover::file-selector-button {
    background-color: #2980b9;
}

/* Check boxes in the colours of the buttons */
:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]) {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid #b8c2cc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.2s, border-color 0.2s;
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):hover {
    border-color: #3498db;
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):checked {
    background-color: #3498db;
    border-color: #3498db;
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):disabled {
    background-color: #ececec;
    border-color: #ccc;
    cursor: not-allowed;
}

:where(.content, .login-container) input[type="checkbox"]:not([class*="tox"]):checked:disabled {
    background-color: #9fb3c3;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

/* Page content */
.page-content {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Long links, file paths and other unbreakable text wrap instead of widening the page */
.page-content,
.news-preview,
.news-item {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.page-content code,
.news-preview code {
    white-space: pre-wrap;
}

.page-content pre,
.news-preview pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Content tables fill the text column (imported width attributes often carry narrow
   pixel values). A table whose cells need more room scrolls inside its .tbl-scroll
   wrapper instead of widening the page. */
.tbl-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.page-content table,
.news-preview table,
.news-item table,
.forum-post-body table {
    width: 100%;
}

.page-content iframe,
.page-content video,
.page-content embed,
.page-content object,
.news-preview iframe,
.news-preview video {
    max-width: 100%;
}

.page-owner {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Subpages */
.subpages {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.subpages ul {
    list-style: none;
    padding-left: 0;
}

.subpages li {
    margin-bottom: 10px;
}

.subpages a {
    color: #3498db;
    text-decoration: none;
}

.subpages a:hover {
    text-decoration: underline;
}

/* Files section */
.files-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.files-section ul {
    list-style: none;
    padding-left: 0;
}

.files-section li {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
}

.file-info {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Forum timestamps: full format by default, compact numeric format on phones */
.dt-short {
    display: none;
}

.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.sort-link:hover {
    text-decoration: underline;
}

.sort-arrow {
    font-size: 0.8em;
    color: #b0b8bf;
    margin-left: 2px;
}

.sort-arrow.active {
    color: #2c3e50;
}

.online-dot {
    color: #27ae60;
    font-size: 1.1em;
    margin-right: 4px;
}

.file-delete-form {
    display: inline;
    margin-left: 10px;
}

.account-box {
    max-width: 600px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: #7f8c8d;
}


.notice {
    background-color: #e67e22;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.edit-bar {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.download-check,
.form-group label.download-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    max-width: 100%;
    font-weight: normal;
    /* Long labels (e.g. in German) wrap instead of running out of the screen */
    white-space: normal;
    cursor: pointer;
}

.download-check input[type="checkbox"] {
    flex: 0 0 auto;
}

.file-manager {
    margin-top: 30px;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.file-table th,
.file-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.file-table td form {
    margin: 0;
}

.file-table .file-delete-form {
    margin-left: 0;
}

/* The parent dropdown in Manage pages carries long indented titles; the closed box is
   capped so the table stays in view — the opened list still shows the full titles */
.file-table select[name="parent_id"] {
    max-width: 300px;
}

/* The last column takes as little room as it can: when the row runs out of
   width the action buttons drop to a second line instead of being clipped */
.file-table td:last-child {
    width: 1%;
    min-width: 100px;
}

.file-table td:last-child .file-delete-form,
.file-table td:last-child > .btn {
    display: inline-block;
    margin: 1px 4px 1px 0;
    vertical-align: middle;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Admin actions */
.admin-actions {
    margin-top: 40px;
    padding: 30px;
    background-color: #ecf0f1;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.file-upload {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
}

.file-upload h2,
.file-upload h3,
.gallery-upload h2,
.gallery-upload h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* The controls of an upload form sit in one tidy row (they wrap on narrow screens) */
.file-upload form,
.gallery-upload form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.file-upload form input[type="file"],
.gallery-upload form input[type="file"] {
    flex: 1 1 300px;
    min-width: 0;
    max-width: 100%;
}

/* Order controls in the page editor: position select + per-child up/down rows */
.page-order select {
    max-width: 420px;
}

.order-children {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.order-children li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid #eee;
}

.order-children li:last-child {
    border-bottom: none;
}

.order-children .order-child-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload p {
    margin-top: 15px;
}

/* User pages list */
.user-pages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-page-item {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.user-page-item h3 {
    margin-bottom: 10px;
    color: #3498db;
}

/* Gallery */
.gallery-upload {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}



.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-link {
    display: block;
    margin-bottom: 10px;
}

.gallery-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
}

.gallery-caption {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.delete-form {
    margin-top: 10px;
}

.order-form {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.order-input,
.video-order-input {
    width: 70px;
    text-align: center;
}

/* WYSIWYG editor */
.wysiwyg-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.wysiwyg-toolbar button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10.5px;
    min-width: 30px;
}

.wysiwyg-toolbar button:hover {
    background: #e0e0e0;
}

.wysiwyg-separator {
    width: 1px;
    background: #ccc;
    margin: 0 4px;
}

.wysiwyg-area {
    min-height: 250px;
    padding: 12px;
    outline: none;
    overflow-y: auto;
}

.wysiwyg-area:focus {
    box-shadow: inset 0 0 0 2px #3498db;
    border-radius: 0 0 4px 4px;
}

/* Embedded content images (page content and news previews on the main page) */
.page-content img,
.news-preview img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
}

/* Thumbnails that open the full-size image in the lightbox */
.page-content img[data-full] {
    max-width: 340px;
    border: 1px solid #b4d7f0;
    border-radius: 4px;
    margin: 4px 8px 4px 0;
    vertical-align: top;
    background: #fff;
}

/* Text wrapping around images */
.page-content img.img-left,
.page-content img[style*="float: left"],
.page-content img[style*="float:left"],
.page-content figure.align-left,
.news-preview img.img-left,
.news-preview img[style*="float: left"],
.news-preview img[style*="float:left"],
.news-preview figure.align-left {
    float: left;
    margin: 0 15px 10px 0;
}

.page-content img.img-right,
.page-content img[style*="float: right"],
.page-content img[style*="float:right"],
.page-content figure.align-right,
.news-preview img.img-right,
.news-preview img[style*="float: right"],
.news-preview img[style*="float:right"],
.news-preview figure.align-right {
    float: right;
    margin: 0 0 10px 15px;
}

.page-content img.img-center,
.news-preview img.img-center {
    display: block;
    margin: 10px auto;
}

.page-content::after,
.news-preview::after {
    content: '';
    display: block;
    clear: both;
}

/* Image lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    z-index: 2001;
}

.lightbox-nav:hover {
    color: #ccc;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 10.5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Error and success messages */
.error {
    background-color: #e74c3c;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background-color: #27ae60;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive design - Mobile: the top bar becomes an off-canvas menu */
@media (max-width: 768px) {
    /* Standard text one step larger than desktop for small screens */
    .content {
        font-size: 15px;
        /* More width for text: thin side margins instead of the desktop 40px */
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Article boxes keep only a small inner margin on phones */
    .page-content,
    .news-item {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* Menus and footer links match the larger mobile text */
    .main-menu,
    .site-footer {
        font-size: 15px;
    }

    /* Phones: wider site block, top bar stays fixed with the menu button and flags */
    .container {
        width: 100vw;
        margin: 0;
    }

    /* Single-row mobile top bar: hamburger - logo - search - account - flag */
    .top-bar {
        position: fixed;
        left: 0;
        right: auto;
        width: 100vw;
        height: 84px;
        align-items: flex-start;
        padding: 17px 20px 0 52px;
    }

    .container .top-bar {
        left: 0;
        right: auto;
        width: 100vw;
    }

    .site-footer {
        width: 100vw;
        margin: 0;
    }

    /* The aside becomes the off-canvas box again and the menu bars stack inside it */
    .sidebar {
        display: block;
        position: fixed;
        left: -319px;
        width: 319px;
        max-width: 85vw;
        z-index: 1000;
        background-color: #d2e6f3;
        background-image: url(../img/vstabi/bg-navigation.png);
        background-repeat: repeat-x;
        background-position: 50% 0;
        border-right: 1px solid #b4d7f0;
        padding: 30px 10px 20px;
        overflow-y: auto;
        height: calc(100vh - 84px);
        top: 84px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-menu.menu-left,
    .main-menu.menu-right {
        position: static;
        order: 0;
        align-self: auto;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        border: none;
        padding: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 19px;
        left: 10px;
        right: auto;
        z-index: 1001;
        width: 45px;
        height: 47px;
        background: none;
        border: none;
        font-size: 30px;
        line-height: 1;
        padding: 0;
    }

    /* Logo only on phones: the name/slogan text stays on larger screens */
    .top-brand img {
        height: 50px;
    }

    /* Name + slogan as two compact rows between the logo and the top controls */
    .top-brand {
        align-items: center;
        gap: 6px;
        padding-left: 5px;
    }

    .top-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        /* Guests have no search icon, so the text may use more of the bar */
        max-width: calc(100vw - 230px);
        min-width: 0;
    }

    body.user-logged-in .top-text {
        max-width: calc(100vw - 250px);
    }

    .top-name {
        font-size: 1.32em;
        font-weight: bold;
    }

    .top-slogan {
        display: block;
        font-size: 0.88em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Square flag icon in the top row: same 32x32 size as the other icons */
    .lang-switch summary {
        width: 34px;
        height: 34px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .lang-switch summary .flag-img {
        width: 34px;
        height: 34px;
        /* The whole flag is squeezed into the square (not cropped to its middle), so e.g. the red stripes of the Spanish flag stay visible */
        object-fit: fill;
    }

    .lang-switch summary .flag-badge {
        min-width: 32px;
        height: 32px;
        padding: 0;
        font-size: 9px;
    }

    /* Dropdowns become a plain stacked list */
    .menu-block {
        display: block;
    }

    /* The right-side blocks follow the left menu inside the off-canvas menu */
    .main-menu.menu-right {
        margin-top: 30px;
    }

    .menu-block-title {
        display: block;
    }

    .menu-block > ul {
        position: static;
        display: block;
        min-width: 0;
        margin: 0;
        padding: 0 0 8px;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .submenu {
        position: static;
        min-width: 0;
        margin: 0;
        padding: 0 0 6px 14px;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .submenu a {
        padding-left: 14px;
    }

    /* Phones: the visible [+]/[−] box is 10% larger than on the desktop */
    .submenu-toggle::before {
        width: 18px;
        height: 18px;
        font-size: 14px;
        line-height: 16px;
    }

    .lang-switcher {
        position: fixed;
        left: auto;
        right: 10px;
        top: 10px;
    }

    .container .lang-switcher {
        position: fixed;
        right: 10px;
    }

    .layout-toggle {
        position: fixed;
        right: 70px;
    }

    .container .layout-toggle {
        position: fixed;
        right: 70px;
    }

    .account-switch {
        position: fixed;
        right: 110px;
    }

    .container .account-switch {
        position: fixed;
        right: 110px;
    }

    .lang-switcher-plain {
        left: auto;
        right: 10px;
    }

    .content {
        margin-left: 0;
        padding: 100px 20px 20px;
    }

    .user-pages-list {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    h1 {
        font-size: 25px;
    }

    .forum-page h1 {
        font-size: 20px;
    }

    .login-container {
        margin: 50px 20px;
        padding: 20px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-menu.menu-left {
        width: 200px;
    }

    .content {
        padding: 140px 30px 30px;
    }
}

/* Phones: the control cluster stays fixed in the top bar, narrower search box */
@media (max-width: 768px) {
    .top-controls {
        position: fixed;
        top: 25px;
        right: 10px;
    }

    .dt-full {
        display: none;
    }

    .dt-short {
        display: inline;
    }

    .top-controls .lang-switcher,
    .top-controls .account-switch,
    .top-controls .layout-toggle,
    .container .top-controls .lang-switcher,
    .container .top-controls .account-switch,
    .container .top-controls .layout-toggle {
        position: static;
    }

    .site-search input,
    .search-scope-link {
        display: none;
    }

    /* Icon-only search button on phones (opens the full search page) */
    .site-search .search-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }

    /* Icon-only account button on phones: leave room for the brand text */
    .account-name {
        display: none;
    }

    .account-drop summary::before {
        content: "\1F464";
        font-size: 18px;
    }

    /* Square login icon: same size as search and flag */
    .account-drop summary {
        width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
        justify-content: center;
    }

    /* The side/top menu choice only applies to the desktop layout; hide the toggle on phones */
    .top-controls .layout-toggle,
    .container .top-controls .layout-toggle {
        display: none;
    }

}

/* Desktop/tablet: contents sit a bit inside the screen edges. One variable controls the inset; every
   background (bars, menus, content, footer) still runs to the screen edge, only the contents move in. */
@media (min-width: 769px) {
    .container {
        --edge: clamp(16px, 2.5vw, 48px);
    }

    .container .top-bar {
        padding-left: calc(20px + var(--edge));
    }

    .container .top-controls {
        right: calc(16px + var(--edge));
    }

    .main-menu.menu-left {
        width: calc(275px + var(--edge));
        padding-left: var(--edge);
    }

    .main-menu.menu-right {
        width: calc(242px + var(--edge));
        padding-right: calc(12px + var(--edge));
    }

    /* Without a right menu the content carries the right inset itself */
    body:not(.layout-top):not(.has-right-menu) .content {
        padding-right: calc(40px + var(--edge));
    }

    body.layout-top .content {
        padding-left: calc(40px + var(--edge));
        padding-right: calc(40px + var(--edge));
    }

    .container .site-footer {
        padding-left: calc(20px + var(--edge));
        padding-right: calc(20px + var(--edge));
    }

    body.layout-top .sidebar {
        padding: 0 var(--edge, 0);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-menu.menu-left {
        width: calc(220px + var(--edge));
    }
}

/* Notice after login: online Mikado login / local fallback / local login */
.login-notice {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(560px, 92vw);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #b4d7f0;
    background: #e8f4fd;
    color: #1f4e6b;
    font-size: 10.5px;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.login-notice-shop {
    border-color: #a5d6b0;
    background: #e9f7ee;
    color: #1d5a31;
}

.login-notice-fallback {
    border-color: #f0c36d;
    background: #fff5dc;
    color: #7a5200;
}

.login-notice button {
    flex: 0 0 auto;
    border: none;
    background: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* Backup progress bar on the admin page */
.bk-progress {
    margin-top: 12px;
    height: 14px;
    border: 1px solid #b4d7f0;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
}

.bk-bar {
    height: 100%;
    width: 0;
    background: #4a9eda;
    transition: width 0.4s ease;
}

.bk-status {
    margin-top: 4px;
    font-size: 10.5px;
    color: #4a6785;
}

.bk-desc-form input[type="text"] {
    font-size: 10.5px;
    padding: 3px 6px;
}

/* Video render progress in the admin video list */
.video-progress {
    margin-top: 4px;
    height: 10px;
    border: 1px solid #b4d7f0;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
}

.video-progress-bar {
    height: 100%;
    width: 0;
    background: #4a9eda;
    transition: width 0.4s ease;
}

.video-upload-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vup-row {
    margin: 6px 0;
    font-size: 10.5px;
    color: #4a6785;
}

.vup-row .vup-pct {
    float: right;
}

/* Unread-PM toast: same box as the login notice, light yellow like draft content,
   the text itself is the inbox link */
.pm-notice {
    border-color: #e6dd80;
    background: #ffffe6;
    color: #6b6200;
}

.pm-notice a {
    color: inherit;
    font-weight: bold;
    text-decoration: underline;
}

/* Tables with a header row (admin lists, file manager). Long names wrap. On phones a table never widens the page:
   until the script has marked it as "stack-table" it scrolls on its own, afterwards every row is a small card
   (title = first cell, every other cell with its column title; script.js adds the data-label attributes) */
.file-table td a {
    /* Titles wrap between words (as many lines as needed); a word is only cut when it is longer than the whole line */
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
}

@media (max-width: 768px) {
    .content table.file-table:not(.stack-table) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    .stack-table,
    .stack-table tbody,
    .stack-table tr,
    .stack-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .stack-table tr:first-child {
        display: none;
    }

    .stack-table tr {
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
    }

    .stack-table td {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px 12px;
        border-bottom: 1px solid #eee;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .stack-table td:last-child {
        border-bottom: none;
    }

    .stack-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 0.85em;
        color: #7f8c8d;
    }

    /* The first cell is the title of the card */
    .stack-table td:first-child {
        display: block;
        font-weight: bold;
        background: #f4f8fb;
        border-radius: 6px 6px 0 0;
    }

    .stack-table td:first-child::before {
        display: block;
        font-weight: normal;
    }

    .stack-table td.file-actions {
        justify-content: flex-end;
    }

    /* Fields, dropdowns and forms inside a card never exceed the card */
    .stack-table td input:not([type="checkbox"]):not([type="radio"]),
    .stack-table td select,
    .stack-table td textarea {
        max-width: 100%;
        min-width: 0;
    }

    .stack-table td form {
        max-width: 100%;
    }
}
/* TinyMCE dialogs (image, link, table ...) never get wider than the phone screen */
@media (max-width: 768px) {
    .tox .tox-dialog {
        max-width: calc(100vw - 16px);
    }
}

/* Variant: from 580 px up to the desktop switch (768 px) the mobile theme keeps VStabi and the slogan in one row,
   bottom-aligned with the V like on desktop; below 580 px they stay in two rows (rules in the 768 px block above). */
@media (min-width: 580px) and (max-width: 768px) {
    .top-brand {
        align-items: baseline;
        gap: 11px;
    }

    .top-text {
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        position: relative;
        top: -7px;
    }

    .top-name {
        font-size: 1.76em;
        white-space: nowrap;
    }

    .top-slogan {
        font-size: 1.27em;
    }
}

/* Videos inserted by the editor (Administration > Manage videos): never wider than the text column */
.page-content video,
.news-preview video,
.content video.vcms-video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    background: #000;
}

/* Video gallery (php/video_gallery.php): topic list and the videos of one topic */
.video-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.video-topic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 15px;
    background: #f7fafc;
    border: 1px solid #d5e4ee;
    border-radius: 6px;
    text-decoration: none;
    color: #33566e;
}

.video-topic:hover {
    background: #e6f1f7;
}

.video-topic span {
    color: #7a8a96;
    font-size: 0.85em;
}

/* Download section (php/downloads.php, page type "downloads"): group cards and file rows */
.dl-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.dl-topic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 15px;
    background: #f7fafc;
    border: 1px solid #d5e4ee;
    border-radius: 6px;
    text-decoration: none;
    color: #33566e;
}

.dl-topic:hover {
    background: #e6f1f7;
}

.dl-topic-icon {
    color: #6d90a8;
}

.dl-topic-icon svg {
    width: 22px;
    height: 22px;
}

.dl-topic span {
    color: #7a8a96;
    font-size: 0.85em;
}

.dl-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dl-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f7fafc;
    border: 1px solid #d5e4ee;
    border-radius: 6px;
}

svg.file-type-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    margin-right: 0.25em;
    color: #6d90a8;
}

.dl-file-icon {
    color: #6d90a8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dl-file-icon svg {
    width: 22px;
    height: 22px;
}

.dl-file-icon:hover {
    color: #33566e;
}

.dl-file-info {
    flex: 1;
    min-width: 0;
}

.dl-file-name {
    font-weight: bold;
}

.dl-file-desc {
    color: #55606a;
    font-size: 0.85em;
    margin-top: 2px;
}

.dl-count {
    color: #7a8a96;
    font-size: 0.85em;
    min-width: 3em;
    text-align: right;
}

.dl-btn svg {
    width: 1em;
    height: 1em;
    vertical-align: -2px;
}

.dl-count-input {
    width: 5em;
}

/* Manage downloads: title and description get twice the default field width */
.dl-admin-table input[name="title"],
.dl-admin-table input[name="description"] {
    width: 26em;
    max-width: 100%;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
    gap: 20px;
}

.video-card {
    margin: 0;
}

.video-card video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-card figcaption {
    display: flex;
    flex-direction: column;
    padding-top: 6px;
}

.video-card figcaption span {
    color: #7a8a96;
    font-size: 0.85em;
}

.video-card figcaption small.video-desc {
    color: #55606a;
    font-size: 0.85em;
    font-weight: normal;
    margin-top: 2px;
}

.video-desc-input {
    width: 100%;
    margin-top: 4px;
    font-size: 0.85em;
    resize: vertical;
}

/* Wrapper the player script puts around every <video>: holds the quality menu and the enlarge
   button at the top right of the picture */
.video-wrap {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
}

/* in a gallery card the video fills the card, so the wrapper does too */
.video-card .video-wrap {
    width: auto;
}

.video-quality,
.video-zoombtn {
    position: absolute;
    top: 6px;
    z-index: 2;
    padding: 2px 5px;
    font-size: 0.8em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.video-quality {
    right: 38px;
}

.video-quality option {
    color: #000;
}

.video-zoombtn {
    right: 6px;
    cursor: pointer;
}

/* an enlarge button inside the enlarged view makes no sense (and must not stack overlays) */
.video-wrap.is-zoomed .video-zoombtn {
    display: none;
}

/* "Theater" overlay: a size between the inline player and real fullscreen */
.video-zoom {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}

.video-zoom-inner {
    max-width: 75vw;
    max-height: 80vh;
}

/* medium size when the overlay opens, .is-max = the largest size that fits on this device */
.video-zoom .video-wrap.is-zoomed video {
    width: auto;
    height: auto;
    max-width: 75vw;
    max-height: 80vh;
    aspect-ratio: auto;
    margin: 0;
}

.video-zoom.is-max .video-zoom-inner {
    max-width: 98vw;
    max-height: 95vh;
}

.video-zoom.is-max .video-wrap.is-zoomed video {
    max-width: 98vw;
    max-height: 95vh;
}

.video-zoom-close,
.video-zoom-size {
    position: absolute;
    top: 12px;
    padding: 0;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    background: none;
    border: 0;
    cursor: pointer;
}

.video-zoom-close {
    right: 18px;
}

.video-zoom-size {
    right: 58px;
    font-size: 26px;
}

/* Actions column of Manage videos: several buttons that may wrap; keep air between the wrapped rows */
.video-actions .btn,
.video-actions .inline-form {
    margin: 0 6px 6px 0;
}
.video-actions .inline-form {
    display: inline;
}

/* Translated titles of a video topic: one extra input per enabled language, flag in front */
.video-topic-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.video-topic-lang input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* Preview image on the topic cards of the video gallery overview */
.video-topic img {
    display: block;
    width: calc(100% + 30px);
    margin: -12px -15px 8px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
}
