/*
 * The MIT License
 * Copyright (c) 2012 Matias Meno <m@tias.me>
 */
@-webkit-keyframes passing-through {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30%,
  70% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }

  100% {
    opacity: 0;
    -webkit-transform: translateY(-40px);
    -moz-transform: translateY(-40px);
    -ms-transform: translateY(-40px);
    -o-transform: translateY(-40px);
    transform: translateY(-40px);
  }
}

@-moz-keyframes passing-through {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30%,
  70% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }

  100% {
    opacity: 0;
    -webkit-transform: translateY(-40px);
    -moz-transform: translateY(-40px);
    -ms-transform: translateY(-40px);
    -o-transform: translateY(-40px);
    transform: translateY(-40px);
  }
}

@keyframes passing-through {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30%,
  70% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }

  100% {
    opacity: 0;
    -webkit-transform: translateY(-40px);
    -moz-transform: translateY(-40px);
    -ms-transform: translateY(-40px);
    -o-transform: translateY(-40px);
    transform: translateY(-40px);
  }
}

@-webkit-keyframes slide-in {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }
}

@-moz-keyframes slide-in {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }
}

@keyframes slide-in {
  0% {
    opacity: 0;
    -webkit-transform: translateY(40px);
    -moz-transform: translateY(40px);
    -ms-transform: translateY(40px);
    -o-transform: translateY(40px);
    transform: translateY(40px);
  }

  30% {
    opacity: 1;
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    transform: translateY(0px);
  }
}

@-webkit-keyframes pulse {
  0% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }

  10% {
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
  }

  20% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }
}

@-moz-keyframes pulse {
  0% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }

  10% {
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
  }

  20% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }

  10% {
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
  }

  20% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
  }
}

.dropzone,
.dropzone * {
  box-sizing: border-box;
}


@media (min-width: 576px) { 
  .dropzone {
    min-height: 128px;
    min-width: 128px;
  }
}

@media (min-width: 768px) {
  .dropzone {
    min-height: 384px;
    min-width: 384px;
  }
}

.dropzone {
  color: rgb(29, 29, 29);
  border: 10px dashed rgb(39, 39, 39);
  background-color: rgba(37, 37, 38, 0.33);
  padding: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone.dz-clickable {
  cursor: pointer;
}

.dropzone.dz-clickable * {
  cursor: default;
}

.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message * {
  cursor: pointer;
}

.dropzone.dz-started .dz-message {
  display: none;
}

.dropzone.dz-drag-hover {
  border-style: solid;
}

.dropzone.dz-drag-hover .dz-message {
  opacity: 0.5;
}

.dropzone .dz-message {
  font-weight: 600;
  margin: 2em 0;
}

.dropzone .dz-message .dz-flexitem {
  text-align: center;
  padding: 14px;
  border-radius: 24px;
}

.dropzone .dz-preview {
  position: relative;
  display: inline-block;
  vertical-align: top;
  margin: 16px;
  min-height: 100px;
}

.dropzone .dz-preview:hover {
  z-index: 1000;
}

.dropzone .dz-preview:hover .dz-details {
  opacity: 1;
}

.dropzone .dz-preview.dz-file-preview .dz-image {
  border-radius: 20px;
  background: #252526;
  background: linear-gradient(to bottom, #252526, #1f1f1f);
}

.dropzone .dz-preview.dz-file-preview .dz-details {
  opacity: 1;
}

.dropzone .dz-preview.dz-image-preview {
  background: 252526;
}

.dropzone .dz-preview.dz-image-preview .dz-details {
  -webkit-transition: opacity 0.2s linear;
  -moz-transition: opacity 0.2s linear;
  -ms-transition: opacity 0.2s linear;
  -o-transition: opacity 0.2s linear;
  transition: opacity 0.2s linear;
}

.dropzone .dz-preview .dz-remove {
  font-size: 14px;
  text-align: center;
  display: block;
  cursor: pointer;
  border: none;
}

.dropzone .dz-preview .dz-remove:hover {
  text-decoration: underline;
}

.dropzone .dz-preview:hover .dz-details {
  opacity: 1;
}

.dropzone .dz-preview .dz-details {
  z-index: 20;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  font-size: 13px;
  min-width: 100%;
  max-width: 100%;
  padding: 2em 1em;
  text-align: center;
  color: #b4b4b4;
  line-height: 150%;
}

.dropzone .dz-preview .dz-details .dz-size {
  margin-bottom: 1em;
  font-size: 16px;
}

.dropzone .dz-preview .dz-details .dz-filename {
  white-space: nowrap;
}

.dropzone .dz-preview .dz-details .dz-filename:hover span {
  border: 1px solid #34e6a1;
  background-color: rgba(53, 53, 53, 0.8);
}

.dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
  border: 1px solid transparent;
}

.dropzone .dz-preview .dz-details .dz-filename span,
.dropzone .dz-preview .dz-details .dz-size span {
  background-color: rgba(66, 66, 66, 0.4);
  padding: 0 0.4em;
  border-radius: 3px;
}

.dropzone .dz-preview:hover .dz-image img {
  -webkit-transform: scale(1.05, 1.05);
  -moz-transform: scale(1.05, 1.05);
  -ms-transform: scale(1.05, 1.05);
  -o-transform: scale(1.05, 1.05);
  transform: scale(1.05, 1.05);
  -webkit-filter: blur(8px);
  filter: blur(8px);
}

.dropzone .dz-preview .dz-image {
  border-radius: 20px;
  overflow: hidden;
  width: 120px;
  height: 120px;
  position: relative;
  display: block;
  z-index: 10;
}

.dropzone .dz-preview .dz-image img {
  display: block;
}

.dropzone .dz-preview.dz-success .dz-success-mark {
  -webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
  -moz-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
  -ms-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
  -o-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
  animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
}

.dropzone .dz-preview.dz-error .dz-error-mark {
  opacity: 1;
  -webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
  -moz-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
  -ms-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
  -o-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
  animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
}

.dropzone .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark {
  pointer-events: none;
  opacity: 0;
  z-index: 500;
  position: absolute;
  display: block;
  top: 50%;
  left: 50%;
  margin-left: -27px;
  margin-top: -27px;
}

.dropzone .dz-preview .dz-success-mark svg,
.dropzone .dz-preview .dz-error-mark svg {
  display: block;
  width: 54px;
  height: 54px;
}

.dropzone .dz-preview.dz-processing .dz-progress {
  opacity: 1;
  -webkit-transition: all 0.2s linear;
  -moz-transition: all 0.2s linear;
  -ms-transition: all 0.2s linear;
  -o-transition: all 0.2s linear;
  transition: all 0.2s linear;
}

.dropzone .dz-preview.dz-complete .dz-progress {
  opacity: 0;
  -webkit-transition: opacity 0.4s ease-in;
  -moz-transition: opacity 0.4s ease-in;
  -ms-transition: opacity 0.4s ease-in;
  -o-transition: opacity 0.4s ease-in;
  transition: opacity 0.4s ease-in;
}

.dropzone .dz-preview:not(.dz-processing) .dz-progress {
  -webkit-animation: pulse 6s ease infinite;
  -moz-animation: pulse 6s ease infinite;
  -ms-animation: pulse 6s ease infinite;
  -o-animation: pulse 6s ease infinite;
  animation: pulse 6s ease infinite;
}

.dropzone .dz-preview .dz-progress {
  opacity: 1;
  z-index: 1000;
  pointer-events: none;
  position: absolute;
  height: 16px;
  left: 50%;
  top: 50%;
  margin-top: -8px;
  width: 80px;
  margin-left: -40px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-transform: scale(1);
  border-radius: 8px;
  overflow: hidden;
}

.dropzone .dz-preview .dz-progress .dz-upload {
  background: #333;
  background: linear-gradient(to bottom, #666, #444);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  -webkit-transition: width 300ms ease-in-out;
  -moz-transition: width 300ms ease-in-out;
  -ms-transition: width 300ms ease-in-out;
  -o-transition: width 300ms ease-in-out;
  transition: width 300ms ease-in-out;
}

.dropzone .dz-preview.dz-error .dz-error-message {
  display: block;
}

.dropzone .dz-preview.dz-error:hover .dz-error-message {
  opacity: 1;
  pointer-events: auto;
}

.dropzone .dz-preview .dz-error-message {
  pointer-events: none;
  z-index: 1000;
  position: absolute;
  display: block;
  display: none;
  opacity: 0;
  -webkit-transition: opacity 0.3s ease;
  -moz-transition: opacity 0.3s ease;
  -ms-transition: opacity 0.3s ease;
  -o-transition: opacity 0.3s ease;
  transition: opacity 0.3s ease;
  border-radius: 8px;
  font-size: 13px;
  top: 130px;
  left: -10px;
  width: 140px;
  background: #be2626;
  background: linear-gradient(to bottom, #be2626, #a92222);
  padding: 0.5em 1.2em;
  color: #b4b4b4;
}

.dropzone .dz-preview .dz-error-message:after {
  content: '';
  position: absolute;
  top: -6px;
  left: 64px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #be2626;
}
/*
 * The MIT License
 * Copyright (c) 2012 Matias Meno <m@tias.me>
 */
.dropzone, .dropzone * {
    box-sizing: border-box;
}

.dropzone {
    position: relative;
}

.dropzone .dz-preview {
    position: relative;
    display: inline-block;
    width: 120px;
    margin: 0.5em;
}

.dropzone .dz-preview .dz-progress {
    display: block;
    height: 15px;
    border: 1px solid #aaa;
}

.dropzone .dz-preview .dz-progress .dz-upload {
    display: block;
    height: 100%;
    width: 0;
    background: green;
}

.dropzone .dz-preview .dz-error-message {
    color: red;
    display: none;
}

.dropzone .dz-preview.dz-error .dz-error-message, .dropzone .dz-preview.dz-error .dz-error-mark {
    display: block;
}

.dropzone .dz-preview.dz-success .dz-success-mark {
    display: block;
}

.dropzone .dz-preview .dz-error-mark, .dropzone .dz-preview .dz-success-mark {
    position: absolute;
    display: none;
    left: 30px;
    top: 30px;
    width: 54px;
    height: 58px;
    left: 50%;
    margin-left: -27px;
}

body {
    background: #1f1f1f;
    color: #b4b4b4;
    position: relative;
}



@media (min-width: 576px) {
    .app {
        min-height: 300px;
    }
}

@media (min-width: 768px) {
    .app {
        min-height: 900px;
    }
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    z-index: 9999;
    background: #1f1f1f;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
}

body.sidebar-open #sidebar {
    transform: none;
}

#sidebarBackdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

body.sidebar-open #sidebarBackdrop {
    opacity: 1;
    pointer-events: auto;
}

.profile-sidebar .nav-label-short {
    display: none;
}

/* Content clears the sheet's rounded corners on every manage/admin page. */
.manage-content {
    padding-top: 16px;
    padding-bottom: 16px;
}

@media (min-width: 768px) {
    .profile-sidebar {
        padding-top: 16px;
    }
}

/* Gallery toolbar: "Library / N items", then refresh, the sort menu (or the desktop button group) and Select. */
.gallery-title-main {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
}

.gallery-title-sub {
    font-size: .8rem;
    color: #9a9a9a;
}

.gallery-toolbar .btn.is-active,
.gallery-toolbar .dropdown-item.active {
    color: #34e6a1;
}

.gallery-toolbar .dropdown-menu {
    background: #1f1f1f;
    border: 1px solid #3d3d3d;
    --bs-dropdown-link-color: #e6e6e6;
    --bs-dropdown-link-hover-color: #fff;
    --bs-dropdown-link-hover-bg: #2a2a2a;
    --bs-dropdown-link-active-color: #34e6a1;
    --bs-dropdown-link-active-bg: transparent;
    --bs-dropdown-header-color: #9a9a9a;
    --bs-dropdown-divider-bg: #3d3d3d;
}

/* The toggles draw their own chevron: Bootstrap's caret lives on ::after, which the glass theme
   uses as a full-size sheen layer, so its border would read as an embossed top edge. */
.gallery-toolbar .dropdown-toggle::after {
    border: 0;
    margin: 0;
}

.toggle-chevron {
    margin-left: .5rem;
    font-size: .7em;
    opacity: .75;
}

/* Choice rows keep a check glyph slot; only the active one shows it. */
.gallery-toolbar .dropdown-item .fa-check {
    visibility: hidden;
}

.gallery-toolbar .dropdown-item.active .fa-check {
    visibility: visible;
}

.gallery-menu {
    min-width: 220px;
}

.order-direction {
    padding: .25rem .5rem;
}

.icon-lines-decrease {
    display: block;
}

/* Group headers span the whole tile grid. */
.gallery-group-header {
    grid-column: 1 / -1;
    padding: 18px 12px 6px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9a9a9a;
}

/* Desktop: the months column folds away behind the Months button. */
@media (min-width: 768px) {
    body.months-collapsed #calendarPanel {
        display: none;
    }

    body.months-collapsed .gallery-files {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* The title gives way before the buttons do: it may shrink and ellipsise, they never wrap. */
.gallery-toolbar .gallery-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.gallery-toolbar .gallery-title > div {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop button group plus refresh, search and Select only just fit between 1400 and 1500 px. */
@media (min-width: 1400px) and (max-width: 1499.98px) {
    .gallery-toolbar .btn {
        padding-left: .55rem;
        padding-right: .55rem;
    }
}

/* Search field: hidden until the magnifier opens it, then it takes the title's slot. */
.gallery-search {
    display: none;
    flex: 1 1 160px;
    max-width: 420px;
    min-width: 120px;
}

.gallery-toolbar.is-searching .gallery-search {
    display: flex;
}

.gallery-toolbar.is-searching .gallery-title {
    display: none;
}

.gallery-search .form-control {
    min-width: 0;
}

/* Our own × button clears; drop WebKit's built-in one. */
.gallery-search input::-webkit-search-cancel-button,
.gallery-search input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Phones: the gallery page runs flush, tiles edge to edge; only the toolbar keeps a small inset. */
@media (max-width: 767.98px) {
    body:has(.gallery-toolbar) .app.p-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body:has(.gallery-toolbar) #mainblock,
    body:has(.gallery-toolbar) .block-app,
    body:has(.gallery-toolbar) .manage-content,
    body:has(.gallery-toolbar) .gallery-files {
        padding-left: 0;
        padding-right: 0;
    }

    body:has(.gallery-toolbar) .block-app {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    body:has(.gallery-toolbar) .gallery-row,
    body:has(.gallery-toolbar) .block-app > .row {
        margin-left: 0;
        margin-right: 0;
    }

    .gallery-toolbar {
        margin-left: 8px;
        margin-right: 8px;
    }
}

/* Phones: tighter toolbar so Library, refresh, menu and Select fit on one line. */
@media (max-width: 575.98px) {
    .gallery-toolbar {
        gap: 6px;
    }

    .gallery-toolbar .btn {
        padding-left: .6rem;
        padding-right: .6rem;
    }

    .gallery-title-main {
        font-size: 1.05rem;
    }

    #selectionBar {
        padding-left: 12px;
    }

    #selectionBar .btn-group .btn {
        padding-left: .45rem;
        padding-right: .45rem;
    }
}

/* "Done" only matters once Select was pressed; touch layouts select implicitly and just clear. */
#selectionBar [data-selection-action="done"] {
    display: none;
}

body.selection-mode #selectionBar [data-selection-action="done"] {
    display: inline-block;
}

/* Select button: checkboxes and the action bar on every layout, not only touch. */
body.selection-mode .itembox-select {
    display: block;
}

body.selection-mode .itembox:hover .itembox-hover {
    display: none;
}

body.selection-mode #selectionBar {
    display: flex;
}

/* Phones: the calendar column becomes a drawer sliding in from the right, opened by a floating button. */
#calendarShowBtn {
    position: fixed;
    right: 12px;
    bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    z-index: 1031;
    width: 52px;
    height: 52px;
    padding: 0;
    font-size: 1.25rem;
    border-radius: 50%;
}

#calendarBackdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

body.calendar-open #calendarBackdrop {
    opacity: 1;
    pointer-events: auto;
}

body.calendar-open #calendarShowBtn {
    opacity: 0;
    pointer-events: none;
}

#calendarShowBtn {
    transition: opacity .2s ease;
}

.calendar-drawer-head {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #3d3d3d;
}

@media (max-width: 767.98px) {
    #calendarPanel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82vw, 320px);
        z-index: 9999;
        background: #1f1f1f;
        border-right: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .35s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .35s;
    }

    body.calendar-open #calendarPanel {
        transform: none;
        visibility: visible;
        transition-delay: 0s;
    }

}

/* Phones: the manage sidebar becomes a fixed bottom tab bar, icon above label. */
@media (max-width: 767.98px) {
    .profile-sidebar {
        position: fixed;
        left: 12px;
        right: auto;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 1030;
        width: calc(100% - 24px);
        max-width: none;
        padding: 0 !important;
        border-right: 0;
    }

    #profile strong {
        word-break: break-all;
    }

    /* More tabs than fit scroll sideways; each tab keeps a tappable minimum width. */
    .profile-sidebar .list-group {
        flex-direction: row;
        justify-content: flex-start;
        background-color: #1f1f1f;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .profile-sidebar .list-group::-webkit-scrollbar {
        display: none;
    }

    .profile-sidebar .list-group a {
        flex: 1 0 4.4rem;
        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 2px;
        font-size: .68rem;
        line-height: 1.15;
        text-align: center;
        min-width: 0;
    }

    .profile-sidebar .list-group a > i,
    .profile-sidebar .list-group a > svg {
        display: block;
        margin: 0 !important;
        font-size: 1.15rem;
        width: 1.25em;
        height: 1em;
    }

    .profile-sidebar .list-group a.active {
        border-right: 0;
        border-top: solid 2px #34e6a1;
    }

    .profile-sidebar .nav-label-full {
        display: none;
    }

    .profile-sidebar .nav-label-short {
        display: inline;
    }

    /* Leave room under the content for the bar. */
    .app {
        padding-bottom: 104px !important;
    }
}

.app {
    background: #17221d;
    padding-bottom: 16px;
}

a,
a:visited {
    color: #34e6a1;
}

/* Links styled as buttons take the button's text color, not the link accent. */
a.btn,
a.btn:visited {
    color: var(--bs-btn-color);
}

a.btn:hover,
a.btn:focus {
    color: var(--bs-btn-hover-color);
}

a.btn:active,
a.btn.active {
    color: var(--bs-btn-active-color);
}

a.btn.disabled,
a.btn:disabled {
    color: var(--bs-btn-disabled-color);
}

.border-miu {
    border: 1px solid #3d3d3d;
}

.border-right-miu {
    border-right: 1px solid #3d3d3d;
}

/* Bootstrap 5 list-group items set their own text color, so dark backgrounds need a light one. */
.bg-miu {
    background: #1f1f1f;
    color: #b4b4b4;
}

.bg-secondary-miu {
    background: #353535;
    color: #b4b4b4;
}

.hover-miu:hover {
    background: #5a5a5a;
    color: #ffffff;
}

.block-app {
    background-color: #1f1f1f;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
}

.footer {
    border-top: solid 1px #3d3d3d;
    background-color: #1f1f1f;
    padding: 16px;
}


.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: #b4b4b4;
    cursor: inherit;
    display: block;
}

#upload-box {
    position: relative;
}

#upload-box::before {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(/build/images/miu_bg.9813c6c5.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

#upload-box-inner {
    position: relative;
}

.dropzone-border {
    /* border: 1px solid #34e6a1; */
    padding: 32px;
    border-radius: 8px;
}


#mirrorfile {
    background-color: #252526;
    color: #b4b4b4;
    border: solid 1px #3d3d3d;
}

#upload-box {
    border-bottom: #3d3d3d solid 1px;
}

#mirror-box {
    text-align: center;
}

/* Disabled-uploads home page: the artwork half stays, the dark half carries the message. */
.upload-box-empty {
    min-height: 280px;
}

.uploads-disabled p {
    color: #b4b4b4;
}

#mirror-box span {
    display: inline-block;
    width: 64px;
    height: 14pt;
    border-bottom: solid 1px #313131;
    margin: 0 10px 4px 10px;
}

.mirror-form {
    /* border: 1px solid #34e6a1; */
    padding: 8px 16px 16px 16px;
    border-radius: 8px;
}

/* Primary buttons use the app accent instead of Bootstrap blue (Bootstrap 5 button CSS variables). */
.btn-primary {
    --bs-btn-color: #313131;
    --bs-btn-bg: #34e6a1;
    --bs-btn-border-color: #34e6a1;
    --bs-btn-hover-color: #313131;
    --bs-btn-hover-bg: #1fcf8a;
    --bs-btn-hover-border-color: #1fcf8a;
    --bs-btn-focus-shadow-rgb: 52, 230, 161;
    --bs-btn-active-color: #313131;
    --bs-btn-active-bg: #1bbd7e;
    --bs-btn-active-border-color: #1bbd7e;
    --bs-btn-disabled-color: #313131;
    --bs-btn-disabled-bg: #34e6a1;
    --bs-btn-disabled-border-color: #34e6a1;
}

.btn-outline-primary {
    --bs-btn-color: #34e6a1;
    --bs-btn-border-color: #34e6a1;
    --bs-btn-hover-color: #313131;
    --bs-btn-hover-bg: #34e6a1;
    --bs-btn-hover-border-color: #34e6a1;
    --bs-btn-focus-shadow-rgb: 52, 230, 161;
    --bs-btn-active-color: #313131;
    --bs-btn-active-bg: #34e6a1;
    --bs-btn-active-border-color: #34e6a1;
    --bs-btn-disabled-color: #34e6a1;
    --bs-btn-disabled-border-color: #34e6a1;
}

.btn-outline-miu {
    border-color: #34e6a1;
    color: #34e6a1;
}

.btn-outline-miu:hover {
    background-color: #34e6a1;
    border-color: #34e6a1;
}

.clipbutton {
    background-color: #34e6a1;
    color: #313131;
}

/* The drawer toggles sit above Bootstrap's modal layer; hide them while a modal is open. */
body.modal-open #sidebarShowBtn,
body.modal-open #calendarShowBtn {
    visibility: hidden;
}

#sidebarShowBtn {
    position: absolute;
    top: 0;
    left: 0;
    padding: 16px;
    font-size: 24px;
    cursor: pointer;
    z-index: 9998;
}

#hamburger-userheader li>* {
    position: relative;
    width: 100%;
    display: inline-block;
    padding: 16px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    color: #b4b4b4;
}

/* Drawer close: pinned to the bottom-right corner of the sidebar, clear of the menu list. */
#sidebarCloseBtn {
    position: absolute;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
}

#sidebar {
    padding-bottom: 88px;
}

/* Logo links push back when pressed. */
.brand-link {
    display: inline-block;
    line-height: 0;
    border-radius: 12px;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1), filter .2s ease;
}

.brand-link:hover {
    transform: scale(1.04);
}

.brand-link:active {
    transform: scale(.9);
    filter: brightness(1.2);
    transition-duration: .08s;
}

.brand-link:focus-visible {
    outline: 3px solid rgba(52, 230, 161, .55);
    outline-offset: 4px;
}

.sidebar-brand {
    text-align: center;
    padding: 12px 0 !important;
}

#hamburger-userheader li {
    padding: 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #3d3d3d;
    background-color: #1f1f1f;
    margin-right: 0;
    margin-right: 0;
    border-radius: 0;
}

#hamburger-userheader li:hover {
    background-color: #3a3a3a;
    cursor: pointer;
}

#userheader {
    display: inline-block;
    border-radius: 10px;
    padding: 4px 0;
}

#userheader li {
    border: #3d3d3d 1px solid;
    background-color: #1f1f1f;
    margin-right: 0;
    margin-right: 0;
}

#userheader li:not(:first-child) {
    border-left: 0;
}

#userheader li:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

#userheader li:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

#profilebox li:not(:first-child) {
    cursor: pointer;
}

#profilebox li {
    padding: 8px 16px;
}


#profilebox li:hover {
    background-color: #3a3a3a;
}

#profilebox a,
#profilebox a:hover {
    text-decoration: none;
    color: #b4b4b4;
}

.header {
    padding: 16px;
    color: #b4b4b4;
}

.header a {
    color: #ffa800;
}

#managebuttons {
    padding: 20px;
}

/* Order/page-size controls stay pinned at the top of the scrolling file column. */
#navpanel {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px;
    background-color: #1f1f1f;
    border-bottom: 1px solid #3d3d3d;
}

.displayimage img {
    width: 250px;
}

.itembox {
    background: #b4b4b4;
    color: #b4b4b4;
    border: 1px solid #3d3d3d;
    background-color: #252526;
    position: relative;
    min-width: 224px;
    min-height: 240px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.itembox:hover {
    border: solid #34e6a1 4px;
}

/* Non-thumbnailable files: a large type icon with the extension underneath. */
.itembox-icon {
    position: absolute;
    inset: 0 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #34e6a1;
    pointer-events: none;
}

.itembox-icon > i,
.itembox-icon > svg {
    font-size: 4rem;
    width: 1em;
    height: 1em;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
}

.itembox-ext {
    padding: .1em .7em;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #e6e6e6;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.itembox-icon.is-hidden-file {
    color: #8f948f;
}

.view-ext-label {
    margin-top: 6px;
    font-size: .72rem;
    letter-spacing: .08em;
}

.view-ext > i,
.view-ext > svg {
    color: #34e6a1;
}

.dz-file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    color: #34e6a1;
}

.dz-file-icon > i,
.dz-file-icon > svg {
    font-size: 2.6rem;
    width: 1em;
    height: 1em;
}

.dz-file-icon > span {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #e6e6e6;
}

.itembox:hover .itembox-hover {
    display: block;
}

.itembox-hover {
    display: none;
}

.itembox-text {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, .45);
    backdrop-filter: blur(5px);
    overflow: hidden;
    padding: 8px;
}

.itembox-text p {
    color: rgb(24, 22, 22);
    margin: 0;
}

.itembox-controls {
    margin-left: 20px;
    font-weight: 600;
    font-size: 40px;
}

/* Gallery: the page grows with the tiles; no inner scrollers, no horizontal overflow. */
#file-container.row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin: 0;
    transform-origin: 50% var(--pinch-origin-y, 50%);
}

/* Pinch to zoom (touch) / ctrl+wheel (trackpad): the grid relays out to whole columns and a
   transform carries the fractional remainder, which eases away on release. */
#file-container.is-pinching {
    will-change: transform;
}

#file-container.is-snapping {
    transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.gallery-files {
    touch-action: pan-y;
}

/* Zoomed-out tiles: square first, then label-less, then icon only. */
body.tiles-zoomed .itembox {
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
}

body.tiles-zoomed .itembox-icon > i,
body.tiles-zoomed .itembox-icon > svg {
    font-size: 2.6rem;
}

body.tiles-compact .itembox-text,
body.tiles-compact .itembox-hover,
body.tiles-tiny .itembox-ext {
    display: none !important;
}

/* Too small for the hover buttons: a click focuses a tile and the fixed bar carries its
   actions, so moving to the next tile stays one click. */
body.tiles-compact .itembox {
    cursor: pointer;
}

body.tiles-compact.has-selection #selectionBar {
    display: flex;
}

body.tiles-compact .itembox-icon {
    inset: 0;
    gap: 6px;
}

body.tiles-compact .itembox-icon > i,
body.tiles-compact .itembox-icon > svg {
    font-size: 2rem;
}

body.tiles-tiny .itembox-icon > i,
body.tiles-tiny .itembox-icon > svg {
    font-size: 1.1rem;
    filter: none;
}

body.tiles-tiny .itembox-select {
    width: 26px;
    height: 26px;
}

body.tiles-tiny .itembox-check-mark {
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-width: 1.5px;
    font-size: 8px;
}

body.tiles-compact .gallery-group-header {
    padding: 10px 8px 4px;
}

/* New cards (next page, zoom-out fill) fade in instead of popping. */
#file-container > .col.is-new .itembox {
    animation: tile-in 220ms ease-out both;
}

@keyframes tile-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

#file-container > .col {
    min-width: 0;
    padding: 0;
}

.itembox {
    min-width: 0;
}

/* The pager wrapper is the click target; the button must not move or shrink inside it. */
.gallery-pager {
    cursor: pointer;
}

.gallery-pager .btn {
    transform: none !important;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.gallery-pager:has(.btn:disabled) {
    cursor: default;
}

@media (min-width: 768px) {
    .calendar-column {
        position: sticky;
        top: 8px;
        align-self: flex-start;
        max-height: calc(100vh - 16px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
}

/* Only the months scroll; the range bar is a fixed header of the panel.
   min-height keeps the flex item from refusing to shrink below its content. */
.calendar-column > .list-group {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* Keyboard cursor: arrows move it, Space opens the preview. */
.itembox:focus {
    outline: none;
}

.itembox.is-cursor,
.itembox:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -3px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .5) inset;
}

.preview-content,
.glass-modal-content {
    background: #1f1f1f;
    color: #e6e6e6;
    border: 1px solid #3d3d3d;
}

/* Small dark dialogs (date range): native date inputs follow the dark scheme too. */
.glass-modal-content .modal-header,
.glass-modal-content .modal-footer {
    border-color: #3d3d3d;
}

.glass-modal-content .form-control {
    background: #131715;
    color: #e6e6e6;
    border-color: #3d3d3d;
    color-scheme: dark;
}

/* Title grows so the counter and close button sit at the top right. */
.preview-content .modal-title {
    flex: 1 1 auto;
    min-width: 0;
}

.preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    max-height: 76vh;
    padding: 0;
    background: rgba(0, 0, 0, .35);
    overflow: hidden;
}

/* The dialog fits its content: never smaller than a thumbnail, grows when the full image arrives. */
.preview-dialog {
    width: fit-content;
    min-width: min(22rem, 95vw);
    max-width: min(1140px, 95vw);
}

.preview-body {
    min-width: min(350px, 88vw);
    min-height: 240px;
}

.preview-body img,
.preview-body video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1140px, 95vw);
    max-height: 76vh;
}

.preview-body img.preview-thumb {
    min-width: min(350px, 88vw);
    filter: blur(1px) brightness(.85);
}

.preview-body audio {
    width: min(100%, 32rem);
    margin: 3rem 1rem;
}

.preview-player {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-player video {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 76vh;
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

.preview-player.is-audio {
    padding: 2.5rem 1rem 4.5rem;
}

.player-artwork {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: #3d3d3d;
    color: #34e6a1;
    font-size: 3rem;
}

.player-artwork svg,
.player-artwork i {
    width: 1em;
    height: 1em;
}

.player-controls {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(20, 22, 21, .85);
    border: 1px solid #3d3d3d;
    color: #e6e6e6;
    transition: opacity .25s ease;
}

.preview-player.is-video:not(.is-paused):not(:hover) .player-controls {
    opacity: 0;
}

.player-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #e6e6e6;
    font-size: 1rem;
    cursor: pointer;
}

.player-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.player-btn svg,
.player-btn i {
    width: 1em;
    height: 1em;
}

.player-btn[data-player="toggle"] {
    background: #34e6a1;
    color: #313131;
}

.player-time {
    flex: 0 0 auto;
    min-width: 2.6rem;
    text-align: center;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}

.player-seek {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #34e6a1;
    height: 4px;
    cursor: pointer;
}

/* Mute button + slider; the slider unfolds on hover/focus so the bar stays compact. */
.player-volume {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.player-volume-slider {
    width: 0;
    opacity: 0;
    margin: 0;
    accent-color: #34e6a1;
    height: 4px;
    cursor: pointer;
    transition: width .2s ease, opacity .2s ease, margin .2s ease;
}

.player-volume:hover .player-volume-slider,
.player-volume:focus-within .player-volume-slider {
    width: 80px;
    opacity: 1;
    margin: 0 6px 0 2px;
}

@media (max-width: 575.98px) {
    .player-controls {
        left: 8px;
        right: 8px;
        bottom: 8px;
        gap: 4px;
        padding: 4px 8px;
    }

    .player-time[data-player="duration"] {
        display: none;
    }

    .player-time {
        min-width: 2.2rem;
        font-size: .75rem;
    }

    .player-btn {
        width: 32px;
        height: 32px;
    }

    /* No hover on touch: keep the slider hidden and let the mute button toggle instead. */
    .player-volume-slider {
        display: none;
    }
}

/* /v/ page: the asset, its caption and a group of three actions, on the home page sheet. */
.view-sheet {
    padding: 24px 16px 20px;
    text-align: center;
}

.view-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 240px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(0, 0, 0, .35);
}

.view-media {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 72vh;
    border-radius: 12px;
}

.view-stage-video .view-media {
    width: 100%;
    background: #000;
}

.view-player {
    width: 100%;
}

.view-player .preview-player video {
    max-height: 72vh;
    border-radius: 12px;
}

.view-audio {
    width: min(100%, 32rem);
}

.view-ext {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    margin: 24px 0;
    border-radius: 28px;
    background: #3d3d3d;
    color: #e6e6e6;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.view-ext svg,
.view-ext i {
    width: 1em;
    height: 1em;
    font-size: 2.6rem;
}

.view-ext-hidden {
    color: #ffb4bc;
}

.view-note {
    color: #8f948f;
    margin: 0 0 16px;
}

.view-caption {
    padding: 20px 8px 8px;
}

.view-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    overflow-wrap: anywhere;
    margin: 0 0 8px;
}

.view-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 14px;
    color: #8f948f;
    font-size: .9rem;
}

.view-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

@media (max-width: 575.98px) {
    .view-actions .btn-group {
        display: flex;
        width: 100%;
    }

    .view-actions .btn-group .btn {
        flex: 1 1 0;
        white-space: nowrap;
        font-size: .9rem;
        --bs-btn-padding-x: .5rem;
    }
}

/* Inline text preview: its own scroller, monospace, wrapped long lines. */
.preview-text,
.view-text {
    display: block;
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .82rem;
    line-height: 1.5;
    color: #e6e6e6;
    background: rgba(0, 0, 0, .35);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow: auto;
    tab-size: 4;
}

.preview-text {
    max-height: 76vh;
    min-width: min(720px, 90vw);
}

.view-text {
    max-height: 72vh;
    border-radius: 12px;
}

.preview-text-note {
    padding: 6px 12px;
    color: #8f948f;
    font-size: .8rem;
}

.view-stage-text {
    padding: 0;
    background: transparent;
}

@media (max-width: 767.98px) {
    .preview-text {
        max-height: 60vh;
        min-width: 0;
    }
}

.preview-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #8f948f;
}

.preview-placeholder i,
.preview-placeholder svg {
    font-size: 3.5rem;
    display: block;
    margin: 0 auto .75rem;
    width: 1em;
    height: 1em;
}

.preview-meta,
.preview-counter {
    color: #8f948f;
    font-size: .875rem;
}

/* Phones: the previewer is full screen; a thin prev/next strip sits above the media and the actions form one toolbar. */
.preview-nav-strip {
    display: none;
}

@media (max-width: 767.98px) {
    .preview-dialog {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
    }

    .preview-dialog .preview-content {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        border-radius: 0;
    }

    .preview-content .modal-header {
        padding: 10px 14px;
    }

    .preview-nav-strip {
        display: flex;
        gap: 6px;
        padding: 6px 8px 0;
    }

    .preview-nav-strip .btn {
        flex: 1 1 0;
        padding: 4px 0;
        line-height: 1;
        font-size: .9rem;
        border-radius: 8px;
    }

    .preview-body {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        max-height: none;
        margin: 6px 8px;
        border-radius: 12px;
    }

    .preview-body img,
    .preview-body video,
    .preview-player video {
        max-width: 100%;
        max-height: calc(100dvh - 200px);
    }

    .preview-text {
        max-height: calc(100dvh - 200px);
    }

    .preview-content .modal-footer {
        flex-wrap: nowrap;
        justify-content: stretch;
        gap: 6px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .preview-content .modal-footer .preview-meta {
        display: none;
    }

    .preview-content .modal-footer > .btn {
        flex: 1 1 0;
        margin: 0;
        padding: .6rem .25rem;
        min-width: 0;
    }

    .preview-content .modal-footer .btn-label {
        display: none;
    }

    .preview-content .modal-footer .btn > i,
    .preview-content .modal-footer .btn > svg {
        margin: 0 !important;
        font-size: 1.1rem;
    }
}

/* Touch layouts: tiles get a round checkbox and a fixed action bar instead of hover controls. */
.itembox-select {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: 48px;
    height: 48px;
    margin: 0;
    cursor: pointer;
}

.itembox-select input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
}

.itembox-check-mark {
    position: absolute;
    top: 10px;
    left: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .9);
    background: rgba(0, 0, 0, .4);
    color: transparent;
    font-size: 14px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.itembox-check:checked + .itembox-check-mark {
    background: #34e6a1;
    border-color: #34e6a1;
    color: #313131;
}

.itembox-check:focus-visible + .itembox-check-mark {
    box-shadow: 0 0 0 3px rgba(52, 230, 161, .55);
}

.itembox.is-selected {
    outline: 3px solid #34e6a1;
    outline-offset: -3px;
}

/* The label carries a filename when one file is in play, so it ellipsises rather than
   pushing the actions off the bar. */
.selection-count {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#selectionBar .btn-group {
    flex: none;
}

#selectionBar {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: var(--selection-bar-bottom, 12px);
    z-index: 1031;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px 8px 16px;
    background: #1f1f1f;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    color: #e6e6e6;
}

@media (max-width: 767.98px), (hover: none) {
    .itembox:hover .itembox-hover {
        display: none;
    }

    body.has-selection #selectionBar {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    #selectionBar {
        --selection-bar-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    }

    body.has-selection .app {
        padding-bottom: 172px !important;
    }

    body.has-selection #calendarShowBtn {
        opacity: 0;
        pointer-events: none;
    }
}

.error-image {
    max-width: 90%;
}

.buttontext {
    font-size: 25px;
}

#header-home {
    padding: 16px;
}

.app-brand {
    width: 72px;
}

/* Token / result fields live in an input group; never let the button wrap under the field. */
.input-group:has(#uploadResult) {
    flex-wrap: nowrap;
}

button[data-toggle-user] {
    min-width: 5.75rem;
}

/* Admin lists: one flex row per user/file instead of a table. */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 12px 16px;
    background: #252526;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    color: #b4b4b4;
}

.admin-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #34e6a1;
    color: #313131;
    font-weight: 700;
    font-size: 1.15rem;
    text-transform: uppercase;
}

.admin-avatar.is-anon {
    background: #3d3d3d;
    color: #b4b4b4;
}

.admin-avatar-sm {
    display: inline-grid;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    font-size: .7rem;
    vertical-align: middle;
}

.admin-ext {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #3d3d3d;
    color: #e6e6e6;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.admin-thumb {
    flex: 0 0 auto;
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: #3d3d3d;
}

.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-row.is-marked .admin-thumb img,
.admin-row.is-marked .admin-ext {
    opacity: .45;
}

.admin-row.is-marked .admin-title {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, .5);
}

.admin-chip.admin-marked {
    background: rgba(220, 53, 69, .2);
    color: #ffb4bc;
}

.admin-identity {
    flex: 1 1 220px;
    min-width: 0;
}

.admin-title {
    font-weight: 600;
    color: #fff;
    overflow-wrap: anywhere;
}

.admin-file-link {
    color: #fff;
    text-decoration: none;
}

.admin-file-link:hover {
    color: #34e6a1;
    text-decoration: underline;
}

.admin-sub {
    color: #8f948f;
    font-size: .875rem;
    overflow-wrap: anywhere;
}

.admin-meta {
    flex: 1 1 280px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
}

.admin-stat {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.admin-stat-label {
    font-size: .68rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #8f948f;
}

.admin-stat-value {
    font-size: .9rem;
    color: #e6e6e6;
}

.admin-owner {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 6px;
}

.admin-chip {
    display: inline-block;
    padding: .1em .6em;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 500;
    vertical-align: middle;
    background: rgba(255, 255, 255, .08);
    color: #c9c9c9;
}

.admin-chip.role-admin {
    background: rgba(255, 181, 71, .18);
    color: #ffb547;
}

.admin-chip.role-user {
    background: rgba(52, 230, 161, .14);
    color: #34e6a1;
}

.admin-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.admin-password-result {
    text-align: right;
    overflow-wrap: anywhere;
}

/* Tablet and up: fixed column widths per list so every row lines up. */
.admin-list-users {
    --admin-meta-cols: 10.5rem 4.5rem 5.5rem;
    --admin-meta-w: calc(20.5rem + 44px);
    --admin-actions-w: 24rem;
}

.admin-list-devices {
    --admin-meta-cols: 8.5rem 8.5rem;
    --admin-meta-w: calc(17rem + 22px);
    --admin-actions-w: 7rem;
}

.admin-list-files {
    --admin-meta-cols: 6.5rem 17rem;
    --admin-meta-w: calc(23.5rem + 22px);
    --admin-actions-w: 8.5rem;
}

@media (min-width: 768px) {
    .admin-row {
        display: grid;
        column-gap: 18px;
        row-gap: 8px;
    }

    .admin-avatar,
    .admin-thumb,
    .admin-ext {
        grid-area: icon;
        justify-self: center;
    }

    .admin-identity {
        grid-area: identity;
    }

    .admin-meta {
        grid-area: meta;
        display: grid;
        grid-template-columns: var(--admin-meta-cols);
        column-gap: 22px;
        width: var(--admin-meta-w);
        flex: none;
    }

    .admin-actions {
        grid-area: actions;
        justify-self: end;
        margin-left: 0;
    }
}

/* Tablet: meta drops under the identity, actions stay on the right. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .admin-row {
        grid-template-columns: 48px minmax(0, 1fr) var(--admin-actions-w, auto);
        grid-template-areas:
            "icon identity actions"
            "icon meta actions";
    }

    .admin-avatar,
    .admin-thumb,
    .admin-ext {
        align-self: start;
    }
}

/* Desktop: one line. */
@media (min-width: 1200px) {
    .admin-row {
        grid-template-columns: 48px minmax(0, 1fr) var(--admin-meta-w, auto) var(--admin-actions-w, auto);
        grid-template-areas: "icon identity meta actions";
    }
}

@media (max-width: 767.98px) {
    .admin-identity {
        flex: 1 1 0;
    }

    .admin-meta,
    .admin-actions {
        flex-basis: 100%;
    }

    .admin-actions {
        align-items: stretch;
        margin-left: 0;
    }

    .admin-actions .btn-group {
        display: flex;
    }

    .admin-actions .btn-group .btn {
        flex: 1 1 0;
        white-space: nowrap;
    }

    /* Four labelled user actions do not fit one row on a phone: two by two. */
    .admin-list-users .admin-actions .btn-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-password-result {
        text-align: left;
    }
}

.admin-menu>li.active {
    background-color: #34e6a1;
}

.admin-menu li.active>a {
    color: #ffa800;
}

.admin-menu a {
    color: black;
}

.calendar-range-bar {
    padding: 8px;
    border-bottom: 1px solid #3d3d3d;
}

.calendar-range-label {
    font-size: .85rem;
    min-width: 0;
}

.calendar-highlight,
.calendar-highlight:hover {
    background-color: #34e6a1;
    color: #ffa800;
}

.calendar-element {
    position: relative;
    user-select: none;
}

/* Range hint floats above the month instead of growing the row. */
.calendar-hint {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: .25rem .6rem;
    border-radius: 6px;
    background: #101311;
    color: #e6e6e6;
    font-size: .75rem;
    line-height: 1.2;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
    pointer-events: none;
    z-index: 5;
}

.calendar-hint::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #101311;
}

/* First click of a range: darker primary shade until the end month is chosen. */
.calendar-range-start,
.calendar-range-start:hover {
    background-color: #1bbd7e;
    color: #313131;
}

.calendar-element :hover {
    cursor: pointer;
}

.profile-sidebar {
    padding: 8px 0;
    margin: 0;
    border-right: #3d3d3d solid 1px;
}


.profile-sidebar .list-group a {
    border-radius: 0;
    border: 0;
    background-color: #1f1f1f;
    color: #b4b4b4;
}

.profile-sidebar .list-group .active {
    border: 0;
    border-right: solid 1px #34e6a1;
    background-color: #252526;
    color: #b4b4b4;
}

#profile {
    padding: 0;
}
/*
 * Liquid Glass theme for MIU, minimal edition: translucent fills, rim light, sheen and grain.
 *
 * Scope contract: every selector starts with `body.glass-ui`; remove that class from <body>
 * and this file is inert. assets/js/liquid-glass.js only adds the pointer glow.
 *
 * What is kept from the material language:
 *  - a thin, nearly clear material that shows the content behind it undistorted
 *  - no hairline borders: the edge is defined by light (inset rim highlights, brightest top-left)
 *  - capsules and concentric rounded shapes, continuous where the browser can (corner-shape)
 *  - the material illuminates from under the pointer and compresses on press with a spring
 *  - glass only on the navigation layer: header pill, sticky toolbar, admin menu, mobile sidebar,
 *    the hovered tile's control pill. Everything else is content and stays opaque.
 */

/* ------------------------------------------------------------------ */
/* 1. Tokens                                                           */
/* ------------------------------------------------------------------ */
body.glass-ui {
    color-scheme: dark;

    --g-accent: #34e6a1;
    --g-accent-hover: #4dedb0;
    --g-accent-active: #1fcf8a;
    --g-on-accent: #0f1d17;
    --g-warm: #ffb547;
    --g-text: #c9c9c9;
    --g-text-strong: #f2f2f2;
    --g-text-dim: #8f948f;

    /* material: thin, neutral glass that takes its colour from what is behind it */
    --g-fill: rgba(22, 26, 24, .55);
    --g-fill-hover: rgba(40, 46, 42, .62);
    --g-fill-strong: rgba(14, 17, 16, .84);
    --g-fill-clear: rgba(18, 22, 20, .45);
    --g-sheen: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015) 55%, rgba(255, 255, 255, .03));
    --g-noise: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%27.9%27 numOctaves=%272%27 stitchTiles=%27stitch%27/%3E%3CfeColorMatrix values=%270 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .07 0%27/%3E%3C/filter%3E%3Crect width=%27100%25%27 height=%27100%25%27 filter=%27url%28%23n%29%27/%3E%3C/svg%3E");

    /* edge light instead of borders */
    --g-rim:
        inset 0 0 0 .6px rgba(255, 255, 255, .16),
        inset 1.5px 1.5px 1.5px -1px rgba(255, 255, 255, .45),
        inset 0 -1px 2px rgba(0, 0, 0, .18),
        inset -1px -1px 1.5px -1px rgba(255, 255, 255, .08);
    --g-rim-soft:
        inset 0 0 0 .6px rgba(255, 255, 255, .10),
        inset 1px 1px 1px -.5px rgba(255, 255, 255, .22);
    --g-drop: 0 14px 34px -10px rgba(0, 0, 0, .55), 0 2px 6px -2px rgba(0, 0, 0, .35);
    --g-drop-lift: 0 22px 44px -12px rgba(0, 0, 0, .6), 0 4px 10px -3px rgba(0, 0, 0, .35);

    /* content sheet: opaque layer under the glass */
    --g-sheet: rgba(16, 20, 18, .58);
    --g-flat: rgba(255, 255, 255, .06);
    --g-flat-hover: rgba(255, 255, 255, .11);
    --g-flat-active: rgba(255, 255, 255, .15);
    --g-divider: rgba(255, 255, 255, .07);
    --g-dim: linear-gradient(180deg, rgba(0, 0, 0, .30), rgba(0, 0, 0, .50));

    /* shapes: capsules for controls, concentric rounded rects for containers */
    --g-r-sheet: 28px;
    --g-r-panel: 22px;
    --g-r-item: 14px;
    --g-r-capsule: 999px;

    /* tint: only the primary action */
    --g-accent-solid: rgba(52, 230, 161, .92);
    --g-accent-tint: rgba(52, 230, 161, .14);
    --g-accent-tint-strong: rgba(52, 230, 161, .28);
    --g-selected: rgba(255, 255, 255, .13);
    --g-selected-bar: inset 3px 0 0 var(--g-accent);
    --g-focus: rgba(52, 230, 161, .55);
    --g-danger-rgb: 255, 99, 112;
    --g-warning-rgb: 255, 181, 71;
    --g-success-rgb: 52, 230, 161;

    /* motion: a short spring */
    --g-dur: 320ms;
    --g-spring: linear(0, .01, .06 3.8%, .25 9%, .55 15.6%, .78 21.6%, .93 27.4%, 1.02 33.4%, 1.05 40%, 1.04 48%, 1.01 60%, 1);
    --g-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ------------------------------------------------------------------ */
/* 2. World behind the glass                                           */
/* ------------------------------------------------------------------ */
body.glass-ui {
    background: #0f1311;
    color: var(--g-text);
}

body.glass-ui::before {
    content: "";
    position: fixed;
    inset: -10%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(36vw 32vh at 16% 10%, rgba(52, 230, 161, .20), rgba(52, 230, 161, 0) 70%),
        radial-gradient(32vw 32vh at 84% 22%, rgba(255, 181, 71, .16), rgba(255, 181, 71, 0) 70%),
        radial-gradient(40vw 36vh at 30% 70%, rgba(120, 140, 255, .14), rgba(120, 140, 255, 0) 70%),
        radial-gradient(46vw 38vh at 70% 100%, rgba(255, 110, 150, .10), rgba(255, 110, 150, 0) 70%),
        linear-gradient(180deg, #12171a 0%, #0f1312 55%, #0b0d0c 100%);
    animation: lg-drift 70s ease-in-out infinite alternate;
}

@keyframes lg-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
    to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

body.glass-ui .app {
    background: transparent;
}

/* ------------------------------------------------------------------ */
/* 3. The material                                                     */
/* ------------------------------------------------------------------ */

/* Regular glass: header pill, sticky toolbar, admin menu, mobile sidebar, tile control pill. */
body.glass-ui .glass,
body.glass-ui #userheader,
body.glass-ui #navpanel,
body.glass-ui .admin-menu,
body.glass-ui .profile-sidebar .list-group,
body.glass-ui #sidebar,
body.glass-ui .itembox-controls {
    position: relative;
    isolation: isolate;
    background: var(--g-noise), var(--g-sheen), var(--g-fill);
    background-blend-mode: overlay, normal, normal;
    border: 0;
    border-radius: var(--g-r-panel);
    box-shadow: var(--g-rim), var(--g-drop);
    color: var(--g-text-strong);
    transition:
        background-color var(--g-dur) var(--g-ease),
        box-shadow var(--g-dur) var(--g-ease),
        transform var(--g-dur) var(--g-spring);
}

/* Illumination from within: a glow that starts under the pointer (position set by liquid-glass.js). */
body.glass-ui .glass::after,
body.glass-ui #userheader::after,
body.glass-ui #navpanel::after,
body.glass-ui .admin-menu::after,
body.glass-ui .profile-sidebar .list-group::after,
body.glass-ui #sidebar::after,
body.glass-ui .itembox-controls::after,
body.glass-ui .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(140px 140px at var(--lg-x, 50%) var(--lg-y, 0%), rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 260ms var(--g-ease);
}

body.glass-ui :is(.glass, #userheader, #navpanel, .admin-menu, .profile-sidebar .list-group, #sidebar, .itembox-controls, .btn):hover::after {
    opacity: 1;
}

body.glass-ui .lg-pressed::after {
    opacity: 1;
    background: radial-gradient(180px 180px at var(--lg-x, 50%) var(--lg-y, 50%), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 72%);
}

/* Capsules: the header nav and the toolbar read as floating pills. */
body.glass-ui #userheader,
body.glass-ui #navpanel,
body.glass-ui .itembox-controls {
    border-radius: var(--g-r-capsule);
}

/* Continuous corners where the browser has them. */
@supports (corner-shape: squircle) {
    body.glass-ui .admin-menu,
    body.glass-ui .block-app,
    body.glass-ui .profile-sidebar .list-group,
    body.glass-ui .alert,
    body.glass-ui .form-control,
    body.glass-ui .form-select {
        corner-shape: squircle;
    }
}

/* Clear variant: only over media, always with a dimming layer under it. */
body.glass-ui .itembox-controls {
    background: var(--g-noise), var(--g-sheen), var(--g-fill-clear);
    box-shadow:
        inset 0 0 0 .6px rgba(255, 255, 255, .28),
        inset 2px 2px 2px -1px rgba(255, 255, 255, .6),
        inset 0 -1px 2px rgba(0, 0, 0, .25),
        0 18px 30px -10px rgba(0, 0, 0, .65);
}

/* Strong variant: the mobile overlay needs more body behind its list. */
body.glass-ui #sidebar {
    background: var(--g-noise), var(--g-sheen), var(--g-fill-strong);
}

/* ------------------------------------------------------------------ */
/* 4. Content layer                                                    */
/* ------------------------------------------------------------------ */
body.glass-ui .block-app {
    background: var(--g-noise), var(--g-sheet);
    background-blend-mode: overlay, normal;
    border: 0;
    border-radius: var(--g-r-sheet);
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .05), 0 30px 60px -30px rgba(0, 0, 0, .6);
}

body.glass-ui #upload-box::before {
    border-radius: var(--g-r-sheet) var(--g-r-sheet) 0 0;
}

body.glass-ui #upload-box {
    border-bottom-color: var(--g-divider);
}

/* Calendar column: no hairlines between years or months, the capsules and spacing do the grouping. */
body.glass-ui .border-miu,
body.glass-ui #calendarPanel .list-group-item {
    border: 0;
}

body.glass-ui .border-right-miu {
    border-right: 0;
}

/* The tile grid is content inside the sheet: rounded concentrically and clipped. */
body.glass-ui #file-container {
    border-radius: var(--g-r-panel);
    overflow: hidden;
    margin: 0 10px;
}

/* Drop target: a glass panel floating on the artwork, with a quiet inner dashed ring for affordance. */
body.glass-ui .dropzone {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 240px;
    padding: 16px;
    border: 0;
    border-radius: var(--g-r-panel);
    background: var(--g-noise), var(--g-sheen), rgba(14, 17, 16, .66);
    background-blend-mode: overlay, normal, normal;
    box-shadow: var(--g-rim), var(--g-drop);
    color: var(--g-text-strong);
    text-shadow: none;
    transition:
        background-color var(--g-dur) var(--g-ease),
        box-shadow var(--g-dur) var(--g-ease),
        transform var(--g-dur) var(--g-spring);
}

body.glass-ui .dropzone::before {
    content: "";
    position: absolute;
    inset: 10px;
    pointer-events: none;
    border: 1px dashed rgba(255, 255, 255, .18);
    border-radius: calc(var(--g-r-panel) - 10px);
    transition: border-color var(--g-dur) var(--g-ease);
}

body.glass-ui .dropzone.dz-clickable:hover {
    background: var(--g-noise), var(--g-sheen), rgba(24, 30, 27, .70);
}

body.glass-ui .dropzone.dz-clickable:hover::before {
    border-color: rgba(255, 255, 255, .30);
}

body.glass-ui .dropzone.dz-drag-hover {
    border-style: none;
    transform: scale(1.01);
    background: var(--g-noise), var(--g-sheen), rgba(52, 230, 161, .16);
    box-shadow: inset 0 0 0 1.5px var(--g-accent), 0 0 32px rgba(52, 230, 161, .28), var(--g-drop);
}

body.glass-ui .dropzone.dz-drag-hover::before {
    border-color: rgba(52, 230, 161, .55);
}

body.glass-ui .dropzone.dz-drag-hover .dz-message {
    opacity: 1;
}

/* Empty state: icon in a round well, title, hint (markup from home.js dictDefaultMessage). */
body.glass-ui .dropzone .dz-message {
    margin: 0;
    flex: 1 1 100%;
}

body.glass-ui .dropzone .dz-message .dz-flexitem {
    padding: 8px;
}

body.glass-ui .dropzone .dz-message .dz-flexitem > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

body.glass-ui .dz-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 18px;
    margin-bottom: 8px;
    border-radius: 24px;
    background: var(--g-flat-hover);
    box-shadow: var(--g-rim-soft);
    color: var(--g-accent);
    font-size: 1.9rem;
    line-height: 1;
    transition: transform var(--g-dur) var(--g-spring), background-color var(--g-dur) var(--g-ease);
}

@supports (corner-shape: squircle) {
    body.glass-ui .dz-icon {
        corner-shape: squircle;
        border-radius: 30px;
    }
}

body.glass-ui .dz-icon svg {
    width: 1em;
    height: 1em;
}

body.glass-ui .dropzone.dz-clickable:hover .dz-icon,
body.glass-ui .dropzone.dz-drag-hover .dz-icon {
    transform: translateY(-3px) scale(1.06);
    background: var(--g-accent-tint-strong);
}

body.glass-ui .dz-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--g-text-strong);
}

body.glass-ui .dz-hint {
    font-size: .85rem;
    font-weight: 400;
    color: var(--g-text);
}

/* Preview cards: small flat wells holding the thumbnail, chips and the copy button. */
body.glass-ui .dropzone .dz-preview {
    width: auto;
    margin: 6px;
    padding: 6px;
    min-height: 0;
    border-radius: var(--g-r-item);
    background: var(--g-flat);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .dropzone .dz-preview .dz-image {
    width: 120px;
    height: 120px;
    border-radius: calc(var(--g-r-item) - 4px);
}

body.glass-ui .dropzone .dz-preview.dz-file-preview .dz-image {
    background:
        url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23ffffff%27 stroke-opacity=%27.35%27 stroke-width=%271.2%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M7 3h7l5 5v13H7z%27/%3E%3Cpath d=%27M14 3v5h5%27/%3E%3C/svg%3E") center 14px / 44px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}

body.glass-ui .dropzone .dz-preview .dz-details {
    padding: 1.4em .6em;
    color: var(--g-text-strong);
}

/* Non-image files: glyph on top, chips underneath instead of on top of it. */
body.glass-ui .dropzone .dz-preview.dz-file-preview .dz-details {
    top: 6px;
    padding: 62px .5em 0;
}

body.glass-ui .dropzone .dz-preview .dz-details .dz-filename {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Centre the result mark on the 120px thumbnail rather than on the taller card. */
body.glass-ui .dropzone .dz-preview .dz-success-mark,
body.glass-ui .dropzone .dz-preview .dz-error-mark {
    top: 39px;
    margin-top: 0;
}

body.glass-ui .dropzone .dz-preview .dz-details .dz-size {
    margin-bottom: .6em;
    font-size: 14px;
}

body.glass-ui .dropzone .dz-preview .dz-details .dz-filename span,
body.glass-ui .dropzone .dz-preview .dz-details .dz-size span {
    padding: .1em .6em;
    border-radius: var(--g-r-capsule);
    background: rgba(14, 17, 16, .72);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .dropzone .dz-preview .dz-details .dz-filename:hover span {
    border: 0;
    background: rgba(14, 17, 16, .9);
    box-shadow: inset 0 0 0 1px var(--g-accent);
}

body.glass-ui .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
    border: 0;
}

body.glass-ui .dropzone .dz-preview .dz-progress {
    height: 8px;
    width: 88px;
    margin-left: -44px;
    margin-top: -4px;
    border-radius: var(--g-r-capsule);
    background: rgba(255, 255, 255, .22);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .dropzone .dz-preview .dz-progress .dz-upload {
    background: linear-gradient(180deg, #5df0b9, var(--g-accent));
}

body.glass-ui .dropzone .dz-preview .dz-success-mark svg,
body.glass-ui .dropzone .dz-preview .dz-error-mark svg {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}

body.glass-ui .dropzone .dz-preview .dz-error-message {
    top: 136px;
    left: 0;
    width: 132px;
    border-radius: var(--g-r-item);
    background: rgba(220, 53, 69, .92);
    color: #fff;
    box-shadow: var(--g-drop);
}

body.glass-ui .dropzone .dz-preview .dz-error-message::after {
    border-bottom-color: rgba(220, 53, 69, .92);
}

body.glass-ui .dropzone .dz-preview .dz-actions {
    display: flex;
    width: 100%;
    margin-top: 6px;
}

body.glass-ui .dropzone .dz-preview .dz-actions .btn {
    --bs-btn-padding-y: .3rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .8rem;
}

body.glass-ui .dropzone .dz-preview .dz-actions .clipbutton {
    flex: 1 1 auto;
}

body.glass-ui .dropzone-border {
    padding: 28px;
}

@media (max-width: 767.98px) {
    body.glass-ui .dropzone-border {
        padding: 14px;
    }

    body.glass-ui .dropzone {
        min-height: 200px;
        padding: 12px;
    }
}

/* Footer is content, not glass: quiet text on the world. */
body.glass-ui .footer {
    background: transparent;
    border: 0;
    color: var(--g-text-dim);
}

/* ------------------------------------------------------------------ */
/* 5. Navigation surfaces                                              */
/* ------------------------------------------------------------------ */

/* Header pill */
body.glass-ui #userheader,
body.glass-ui #profilebox {
    margin-bottom: 0;
}

body.glass-ui #userheader li {
    background: transparent;
    border: 0;
    border-radius: var(--g-r-capsule);
    padding: 6px 14px;
    transition: background-color 200ms var(--g-ease);
}

body.glass-ui #profilebox li:hover {
    background: var(--g-flat-hover);
}

body.glass-ui #profilebox a,
body.glass-ui #profilebox a:hover,
body.glass-ui .header a {
    color: var(--g-text-strong);
}

/* Sticky order toolbar: floats over the scrolling tiles, the one place lensing really shows. */
body.glass-ui #navpanel {
    position: sticky;
    top: 10px;
    z-index: 10;
    margin: 10px 10px 14px;
    padding: 6px 8px 6px 18px;
    border-bottom: 0;
    contain: paint;
    /* Sits over busy thumbnails: a touch more body keeps its labels legible. */
    background: var(--g-noise), var(--g-sheen), var(--g-fill-strong);
}

/* The toolbar opens dropdown menus, which paint containment would clip. */
body.glass-ui #navpanel.gallery-toolbar {
    contain: none;
}

@media (max-width: 767.98px) {
    body.glass-ui #navpanel.gallery-toolbar {
        margin: 8px 8px 10px;
        padding-left: 12px;
        padding-right: 6px;
    }

    body.glass-ui:has(.gallery-toolbar) .block-app {
        border-radius: 0;
    }
}

body.glass-ui #navpanel label,
body.glass-ui #navpanel .gallery-title-main {
    color: var(--g-text-strong);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}

body.glass-ui .gallery-toolbar .dropdown-menu {
    background: var(--g-noise), var(--g-sheen), var(--g-fill-strong);
    border-color: rgba(255, 255, 255, .12);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

/* Admin menu: a concentric rounded card of flat rows. */
body.glass-ui .admin-menu {
    padding: 6px;
    overflow: hidden;
    --bs-list-group-bg: transparent;
    --bs-list-group-color: var(--g-text);
    --bs-list-group-border-color: transparent;
    --bs-list-group-active-border-color: transparent;
    --bs-list-group-disabled-bg: transparent;
    --bs-list-group-disabled-color: var(--g-text-strong);
}

body.glass-ui .admin-menu > li {
    border: 0;
    border-radius: var(--g-r-item);
    transition: background-color 200ms var(--g-ease);
}

body.glass-ui .admin-menu a {
    color: var(--g-text);
    text-decoration: none;
    display: block;
}

body.glass-ui .admin-menu > li:not(.active):hover {
    background: var(--g-flat-hover);
}

body.glass-ui .admin-menu > li.active {
    background: var(--g-selected);
    box-shadow: var(--g-selected-bar);
}

body.glass-ui .admin-menu li.active > a {
    color: var(--g-accent);
}

/* Mobile sidebar */
body.glass-ui #sidebar {
    position: fixed;
    border-radius: 0 var(--g-r-sheet) var(--g-r-sheet) 0;
    box-shadow: var(--g-rim), 0 24px 60px rgba(0, 0, 0, .55);
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
}

@media (max-width: 767.98px) {
    body.glass-ui .profile-sidebar .list-group {
        background: var(--g-noise), var(--g-sheen), var(--g-fill-strong);
        border-radius: var(--g-r-panel);
        padding: 6px;
        /* Fade hints that the bar continues past its edges. */
        mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent);
    }

    body.glass-ui .profile-sidebar .list-group a {
        border-radius: var(--g-r-item);
    }

    body.glass-ui .profile-sidebar .list-group a.active {
        border-top: 0;
        box-shadow: inset 0 3px 0 var(--g-accent);
    }
}

/* Calendar drawer (phones): strong glass from the right, mirroring the main sidebar. */
@media (max-width: 767.98px) {
    /* Drawers overlay busy tiles: near-opaque so the form and calendar stay legible. */
    body.glass-ui #calendarPanel,
    body.glass-ui #sidebar {
        background: var(--g-noise), var(--g-sheen), rgba(14, 17, 16, .95);
        background-blend-mode: overlay, normal, normal;
    }

    body.glass-ui #calendarPanel {
        border-radius: var(--g-r-sheet) 0 0 var(--g-r-sheet);
        box-shadow: var(--g-rim), 0 24px 60px rgba(0, 0, 0, .55);
        padding-bottom: 12px;
    }

    body.glass-ui .calendar-drawer-head {
        border-bottom-color: var(--g-divider);
        color: var(--g-text-strong);
    }

    body.glass-ui #calendarShowBtn {
        --bs-btn-border-radius: 50%;
        box-shadow: var(--g-rim), 0 10px 24px rgba(0, 0, 0, .45), 0 0 18px rgba(52, 230, 161, .35);
    }

    body.glass-ui #calendarPanel #navpanel {
        position: static;
        margin: 10px 10px 4px;
        padding: 12px;
        border-radius: var(--g-r-item);
        background: var(--g-flat);
        box-shadow: none;
        contain: none;
    }

    body.glass-ui #calendarPanel #navpanel label {
        text-shadow: none;
        color: var(--g-text);
    }
}

body.glass-ui #hamburger-profilebox {
    --bs-list-group-bg: transparent;
    --bs-list-group-border-color: var(--g-divider);
    margin-bottom: 0;
}

body.glass-ui #hamburger-userheader li {
    background: transparent;
    border-bottom-color: var(--g-divider);
}

body.glass-ui #hamburger-userheader li:not(.sidebar-brand):hover {
    background: var(--g-flat-hover);
}

body.glass-ui .brand-link {
    transition: transform var(--g-dur) var(--g-spring), filter 200ms var(--g-ease);
}

body.glass-ui .brand-link:active {
    transition-duration: 80ms;
}

body.glass-ui #sidebarCloseBtn {
    box-shadow: var(--g-rim), var(--g-drop);
}

/* Profile sidebar: flat rows inside the content sheet (no glass on the sheet). */
body.glass-ui .profile-sidebar {
    border-right: 0;
    padding: 10px;
}

body.glass-ui .profile-sidebar .list-group {
    border-radius: var(--g-r-panel);
    padding: 6px;
    gap: 2px;
    overflow: hidden;
}

/* Phones: the same list is the bottom tab bar and must scroll sideways (declared after the clip above). */
@media (max-width: 767.98px) {
    body.glass-ui .profile-sidebar .list-group {
        overflow-x: auto;
        overflow-y: hidden;
    }
}

body.glass-ui .profile-sidebar .list-group a {
    background: transparent;
    color: var(--g-text);
    border: 0;
    border-radius: var(--g-r-item);
    transition: background-color 200ms var(--g-ease), color 200ms var(--g-ease);
}

body.glass-ui .profile-sidebar .list-group a:hover {
    background: var(--g-flat-hover);
    color: var(--g-text-strong);
}

body.glass-ui .profile-sidebar .list-group .active {
    background: var(--g-selected);
    border: 0;
    box-shadow: var(--g-selected-bar);
    color: var(--g-text-strong);
}

/* ------------------------------------------------------------------ */
/* 6. Controls: capsules, flat tints, one accent                       */
/* ------------------------------------------------------------------ */
body.glass-ui .btn {
    position: relative;
    isolation: isolate;
    --bs-btn-border-radius: var(--g-r-capsule);
    --bs-btn-border-width: 0;
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-focus-shadow-rgb: 52, 230, 161;
    box-shadow: var(--g-rim-soft);
    transition:
        background-color 200ms var(--g-ease),
        color 200ms var(--g-ease),
        box-shadow var(--g-dur) var(--g-ease),
        transform var(--g-dur) var(--g-spring);
}

body.glass-ui .btn-sm,
body.glass-ui .btn-group-sm > .btn {
    --bs-btn-padding-x: .7rem;
    --bs-btn-padding-y: .25rem;
    --bs-btn-font-size: .875rem;
}

/* Input groups keep their joined edges; the capsule radius applies to the group as a whole. */
body.glass-ui .input-group {
    border-radius: var(--g-r-capsule);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .input-group > .form-control,
body.glass-ui .input-group > .btn {
    box-shadow: none;
}

body.glass-ui .input-group > .form-control {
    border-radius: var(--g-r-capsule) 0 0 var(--g-r-capsule);
}

body.glass-ui .input-group > .btn:last-child {
    border-radius: 0 var(--g-r-capsule) var(--g-r-capsule) 0;
    --bs-btn-border-radius: 0 var(--g-r-capsule) var(--g-r-capsule) 0;
}

body.glass-ui .input-group > .btn:hover {
    transform: none;
}

body.glass-ui .btn-secondary,
body.glass-ui .btn-info,
body.glass-ui .btn-default,
body.glass-ui .btn-outline-secondary {
    --bs-btn-color: var(--g-text-strong);
    --bs-btn-bg: var(--g-flat);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--g-flat-hover);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--g-flat-active);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: var(--g-text);
    --bs-btn-disabled-bg: var(--g-flat);
    --bs-btn-disabled-border-color: transparent;
}

body.glass-ui .btn-primary,
body.glass-ui .btn-outline-primary,
body.glass-ui .btn-outline-miu {
    --bs-btn-color: var(--g-on-accent);
    --bs-btn-bg: var(--g-accent-solid);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--g-on-accent);
    --bs-btn-hover-bg: var(--g-accent-hover);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--g-on-accent);
    --bs-btn-active-bg: var(--g-accent-active);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: var(--g-on-accent);
    --bs-btn-disabled-bg: rgba(52, 230, 161, .5);
    --bs-btn-disabled-border-color: transparent;
    box-shadow:
        inset 0 0 0 .6px rgba(255, 255, 255, .25),
        inset 1.5px 1.5px 1.5px -1px rgba(255, 255, 255, .6),
        0 8px 20px -8px rgba(52, 230, 161, .6);
    font-weight: 600;
}

/* app.css paints .btn-outline-miu text mint directly; on the tinted capsule it must be dark. */
body.glass-ui .btn-outline-miu,
body.glass-ui .btn-outline-miu:hover {
    color: var(--g-on-accent);
    border-color: transparent;
}

body.glass-ui .btn-outline-miu:hover {
    background-color: var(--g-accent-hover);
}

body.glass-ui .btn-danger {
    --bs-btn-color: #ffc4ca;
    --bs-btn-bg: rgba(var(--g-danger-rgb), .16);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(var(--g-danger-rgb), .34);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(var(--g-danger-rgb), .46);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
}

body.glass-ui .btn-warning {
    --bs-btn-color: #ffd89a;
    --bs-btn-bg: rgba(var(--g-warning-rgb), .16);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(var(--g-warning-rgb), .34);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(var(--g-warning-rgb), .46);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
}

body.glass-ui .btn-success {
    --bs-btn-color: #a4f5d4;
    --bs-btn-bg: rgba(var(--g-success-rgb), .16);
    --bs-btn-hover-color: var(--g-on-accent);
    --bs-btn-hover-bg: rgba(var(--g-success-rgb), .6);
    --bs-btn-active-color: var(--g-on-accent);
    --bs-btn-active-bg: rgba(var(--g-success-rgb), .75);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
}

body.glass-ui .clipbutton {
    background-color: var(--g-accent-solid);
    color: var(--g-on-accent);
    border: 0;
    border-radius: var(--g-r-capsule);
}

/* Press: the material compresses, then springs back. */
body.glass-ui .btn:not(:disabled):not(.disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--g-rim-soft), 0 8px 18px -8px rgba(0, 0, 0, .5);
}

body.glass-ui .btn:not(:disabled):not(.disabled):active,
body.glass-ui .btn.lg-pressed {
    transform: scale(.95);
    transition-duration: 90ms;
}

body.glass-ui :is(#userheader, #navpanel, .admin-menu, #sidebar).lg-pressed {
    transform: scale(.985);
}

/* Grouped and full-width buttons keep shared edges and do not lift. */
body.glass-ui .btn-group {
    border-radius: var(--g-r-capsule);
    box-shadow: var(--g-rim-soft);
    overflow: hidden;
}

body.glass-ui .btn-group .btn {
    box-shadow: none;
    --bs-btn-border-radius: 0;
}

/* The gallery controls nest dropdown groups: the wrappers stay plain, nothing clips the menus,
   and only the two outer edges carry the capsule radius. */
body.glass-ui .gallery-controls,
body.glass-ui .gallery-controls > .btn-group {
    overflow: visible;
}

body.glass-ui .gallery-controls > .btn-group {
    border-radius: 0;
    box-shadow: none;
}

body.glass-ui .gallery-controls > :first-child,
body.glass-ui .gallery-controls > :first-child > .btn {
    border-radius: var(--g-r-capsule) 0 0 var(--g-r-capsule);
    --bs-btn-border-radius: var(--g-r-capsule) 0 0 var(--g-r-capsule);
}

body.glass-ui .gallery-controls > :last-child,
body.glass-ui .gallery-controls > :last-child > .btn {
    border-radius: 0 var(--g-r-capsule) var(--g-r-capsule) 0;
    --bs-btn-border-radius: 0 var(--g-r-capsule) var(--g-r-capsule) 0;
}

/* Open or focused dropdown toggles: same quiet tint as hover, no border or focus ring (which read
   as an embossed edge next to the plain Months / Calendar buttons). */
body.glass-ui .gallery-controls .btn.show,
body.glass-ui .gallery-controls .btn:focus,
body.glass-ui .gallery-controls .btn:focus-visible,
body.glass-ui .gallery-controls .btn:active {
    color: var(--bs-btn-hover-color);
    background-color: var(--bs-btn-hover-bg);
    border-color: transparent;
    box-shadow: none;
    outline: 0;
}

body.glass-ui .gallery-controls .btn + .btn,
body.glass-ui .gallery-controls .btn-group + .btn,
body.glass-ui .gallery-controls .btn + .btn-group,
body.glass-ui .gallery-controls .btn-group + .btn-group {
    border-left: 1px solid rgba(255, 255, 255, .1);
}

body.glass-ui .btn-group .btn:hover,
body.glass-ui .btn.w-100:hover {
    transform: none;
}

body.glass-ui .btn.w-100 {
    --bs-btn-border-radius: var(--g-r-panel);
}

/* The pager wrapper is the click target, so its hover state paints the button. */
body.glass-ui .gallery-pager:hover .btn:not(:disabled) {
    color: var(--bs-btn-hover-color);
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
}

body.glass-ui .gallery-pager:hover .btn:not(:disabled)::after {
    opacity: 1;
}

/* Inputs: quiet flat wells, capsule for single-line fields, accent ring on focus. */
body.glass-ui .form-control,
body.glass-ui .form-select,
body.glass-ui #mirrorfile {
    background-color: var(--g-flat);
    color: var(--g-text-strong);
    border: 0;
    border-radius: var(--g-r-item);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 .6px rgba(255, 255, 255, .08);
    transition: background-color 200ms var(--g-ease), box-shadow 200ms var(--g-ease);
}

body.glass-ui .form-control::placeholder {
    color: var(--g-text-dim);
}

body.glass-ui :is(.form-control, .form-select, #mirrorfile):hover {
    background-color: var(--g-flat-hover);
}

body.glass-ui :is(.form-control, .form-select, #mirrorfile):focus {
    background-color: var(--g-flat-hover);
    color: #fff;
    outline: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px var(--g-focus);
}

body.glass-ui .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3e%3cpath fill=%27none%27 stroke=%27%23e6e6e6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27m2 5 6 6 6-6%27/%3e%3c/svg%3e");
}

body.glass-ui .form-select.w-auto {
    border-radius: var(--g-r-capsule);
    padding-left: 1rem;
}

body.glass-ui .form-select option {
    background: #1b201d;
    color: var(--g-text);
}

body.glass-ui .form-check-input {
    background-color: var(--g-flat);
    border: 0;
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .25);
}

body.glass-ui .form-check-input:checked {
    background-color: var(--g-accent);
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3e%3cpath fill=%27none%27 stroke=%27%230f1d17%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%273%27 d=%27m6 10 3 3 6-6%27/%3e%3c/svg%3e");
}

body.glass-ui .form-check-input:focus {
    box-shadow: 0 0 0 3px var(--g-focus);
}

/* Badges, alerts, spinner */
body.glass-ui .badge {
    border: 0;
    border-radius: var(--g-r-capsule);
    font-weight: 600;
    padding: .35em .7em;
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .12);
}

body.glass-ui .badge.bg-success {
    --bs-success-rgb: 52, 230, 161;
    --bs-bg-opacity: .2;
    color: #a4f5d4;
}

body.glass-ui .badge.bg-secondary {
    --bs-secondary-rgb: 200, 200, 200;
    --bs-bg-opacity: .14;
    color: var(--g-text);
}

body.glass-ui .alert {
    border: 0;
    border-radius: var(--g-r-panel);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .alert-danger {
    --bs-alert-color: #ffc4ca;
    --bs-alert-bg: rgba(var(--g-danger-rgb), .14);
    --bs-alert-link-color: #ffd0d5;
}

body.glass-ui .alert-success {
    --bs-alert-color: #a4f5d4;
    --bs-alert-bg: var(--g-accent-tint);
}

body.glass-ui .alert-info {
    --bs-alert-color: var(--g-text-strong);
    --bs-alert-bg: var(--g-flat);
}

body.glass-ui .spinner-grow {
    color: var(--g-accent);
}

/* ------------------------------------------------------------------ */
/* 7. Gallery content: calendar, tiles, tables                         */
/* ------------------------------------------------------------------ */
body.glass-ui .bg-miu {
    background: transparent;
    color: var(--g-text-strong);
}

body.glass-ui .bg-secondary-miu {
    background: transparent;
    color: var(--g-text);
}

body.glass-ui .calendar-range-bar {
    border-bottom-color: var(--g-divider);
}

body.glass-ui .calendar-element {
    border-radius: var(--g-r-capsule);
    margin: 2px 8px;
    transition: background-color 200ms var(--g-ease), color 200ms var(--g-ease);
}

body.glass-ui .hover-miu:hover {
    background: var(--g-flat-hover);
    color: var(--g-text-strong);
}

body.glass-ui .calendar-highlight,
body.glass-ui .calendar-highlight:hover {
    background: var(--g-selected);
    color: var(--g-accent);
}

body.glass-ui .calendar-range-start,
body.glass-ui .calendar-range-start:hover {
    background: var(--g-accent-solid);
    color: var(--g-on-accent);
}

body.glass-ui .calendar-element .btn-secondary.disabled {
    opacity: 1;
    padding: 0 .6em;
    min-width: 2em;
    box-shadow: none;
    --bs-btn-disabled-bg: var(--g-flat-hover);
    --bs-btn-disabled-color: var(--g-text-strong);
}

body.glass-ui .calendar-range-start .btn-secondary.disabled {
    --bs-btn-disabled-bg: rgba(15, 29, 23, .25);
    --bs-btn-disabled-color: var(--g-on-accent);
}

/* Tiles are content: the thumbnail stays; hover dims and floats a clear capsule of controls. */
body.glass-ui .itembox {
    border-color: transparent;
}

body.glass-ui .itembox:hover {
    border: 1px solid transparent;
    outline: 2px solid rgba(52, 230, 161, .9);
    outline-offset: -2px;
}

body.glass-ui .itembox-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--g-dim);
}

body.glass-ui .itembox:hover .itembox-hover {
    display: flex;
}

body.glass-ui .itembox-controls {
    margin: 0;
    display: flex;
    gap: 6px;
    padding: 5px;
}

body.glass-ui .itembox-controls .btn {
    box-shadow: none;
}

@media (max-width: 767.98px), (hover: none) {
    body.glass-ui .itembox:hover .itembox-hover {
        display: none;
    }
}

body.glass-ui .itembox.is-selected {
    outline: 3px solid var(--g-accent);
    outline-offset: -3px;
}

body.glass-ui .itembox-check-mark {
    background: rgba(14, 17, 16, .55);
    border-color: rgba(255, 255, 255, .85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

body.glass-ui .itembox-check:checked + .itembox-check-mark {
    background: var(--g-accent);
    border-color: var(--g-accent);
    color: var(--g-on-accent);
}

/* Selection action bar: a capsule of glass floating above the tab bar. */
body.glass-ui #selectionBar {
    border: 0;
    border-radius: var(--g-r-capsule);
    background: var(--g-noise), var(--g-sheen), rgba(14, 17, 16, .95);
    background-blend-mode: overlay, normal, normal;
    box-shadow: var(--g-rim), var(--g-drop-lift);
    color: var(--g-text-strong);
    font-size: .9rem;
}

body.glass-ui #selectionBar .btn-group .btn {
    box-shadow: none;
    --bs-btn-padding-x: .9rem;
}

body.glass-ui .itembox-text {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: linear-gradient(to top, rgba(8, 10, 9, .88), rgba(8, 10, 9, .5));
}

body.glass-ui .itembox-text p {
    color: var(--g-text-strong);
}

/* Preview modal: a sheet of strong glass over a darkened world. */
body.glass-ui .modal-backdrop {
    --bs-backdrop-bg: #05070680;
    --bs-backdrop-opacity: 1;
    background: rgba(5, 7, 6, .78);
}

body.glass-ui .preview-content,
body.glass-ui .glass-modal-content {
    border: 0;
    border-radius: var(--g-r-sheet);
    background: var(--g-noise), var(--g-sheen), rgba(14, 17, 16, .96);
    background-blend-mode: overlay, normal, normal;
    box-shadow: var(--g-rim), 0 40px 90px -20px rgba(0, 0, 0, .8);
    color: var(--g-text-strong);
    overflow: hidden;
}

body.glass-ui .preview-content .modal-header,
body.glass-ui .preview-content .modal-footer,
body.glass-ui .glass-modal-content .modal-header,
body.glass-ui .glass-modal-content .modal-footer {
    border-color: var(--g-divider);
}

body.glass-ui .preview-body {
    background: rgba(0, 0, 0, .45);
}

body.glass-ui .preview-nav-strip .btn {
    box-shadow: none;
    background: var(--g-flat);
}

@media (max-width: 767.98px) {
    body.glass-ui .preview-dialog .preview-content {
        border-radius: 0;
    }

    body.glass-ui .preview-content .modal-footer .btn {
        --bs-btn-border-radius: 14px;
    }
}

body.glass-ui .preview-meta,
body.glass-ui .preview-counter,
body.glass-ui .preview-placeholder {
    color: var(--g-text-dim);
}

body.glass-ui .itembox.is-cursor,
body.glass-ui .itembox:focus-visible {
    border: 1px solid transparent;
    outline: 3px solid rgba(255, 255, 255, .92);
    outline-offset: -3px;
    box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .45);
}

body.glass-ui .itembox.is-cursor.is-selected {
    outline-color: var(--g-accent);
    box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .9);
}

body.glass-ui .player-controls {
    border: 0;
    background: var(--g-noise), var(--g-sheen), rgba(14, 17, 16, .82);
    background-blend-mode: overlay, normal, normal;
    box-shadow: var(--g-rim), var(--g-drop);
    color: var(--g-text-strong);
}

body.glass-ui .player-btn[data-player="toggle"] {
    background: var(--g-accent-solid);
    color: var(--g-on-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

body.glass-ui .player-btn:not([data-player="toggle"]):hover {
    background: var(--g-flat-hover);
}

body.glass-ui .player-artwork {
    background: var(--g-flat-hover);
    box-shadow: var(--g-rim-soft);
    color: var(--g-accent);
}

body.glass-ui .player-time {
    color: var(--g-text);
}

/* Remote Upload page: API reference */
body.glass-ui .api-doc {
    max-width: 52rem;
    color: var(--g-text);
}

body.glass-ui .api-base {
    font-size: .875rem;
    color: var(--g-text-dim);
}

body.glass-ui .api-doc code {
    padding: .1em .45em;
    border-radius: 6px;
    background: var(--g-flat-hover);
    color: var(--g-accent);
    font-size: .875em;
    overflow-wrap: anywhere;
}

body.glass-ui .api-endpoint {
    margin-bottom: 14px;
    border-radius: var(--g-r-item);
    background: var(--g-flat);
    box-shadow: var(--g-rim-soft);
    overflow: hidden;
}

body.glass-ui .api-endpoint-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .03);
    border-bottom: 1px solid var(--g-divider);
}

body.glass-ui .api-method {
    display: inline-block;
    min-width: 3.6rem;
    padding: .2em .6em;
    border-radius: var(--g-r-capsule);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
}

body.glass-ui .api-method-post {
    background: var(--g-accent-tint-strong);
    color: var(--g-accent);
}

body.glass-ui .api-method-delete {
    background: rgba(220, 53, 69, .2);
    color: #ffb4bc;
}

body.glass-ui .api-group {
    color: var(--g-text-strong);
    font-size: 1rem;
}

body.glass-ui .api-method-get {
    background: rgba(120, 170, 255, .2);
    color: #9dc1ff;
}

body.glass-ui .api-path {
    font-size: 1rem;
    background: transparent;
    padding: 0;
    color: var(--g-text-strong);
}

body.glass-ui .api-summary {
    margin-left: auto;
    color: var(--g-text-dim);
    font-size: .9rem;
}

/* Accordion: each endpoint is a <details>; the header is its <summary>. */
body.glass-ui .api-endpoint > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

body.glass-ui .api-endpoint > summary::-webkit-details-marker {
    display: none;
}

body.glass-ui .api-endpoint > summary::after {
    content: "";
    flex: 0 0 auto;
    width: .55em;
    height: .55em;
    margin-left: 6px;
    border-right: 1.5px solid var(--g-text-dim);
    border-bottom: 1.5px solid var(--g-text-dim);
    transform: rotate(45deg);
    transition: transform 200ms var(--g-ease);
}

body.glass-ui .api-endpoint[open] > summary::after {
    transform: rotate(225deg);
}

body.glass-ui .api-endpoint:not([open]) > summary {
    border-bottom: 0;
}

body.glass-ui .api-endpoint > summary:hover {
    background: rgba(255, 255, 255, .06);
}

body.glass-ui .api-endpoint > summary:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px var(--g-focus);
}

body.glass-ui .api-endpoint-body {
    padding: 14px 16px 16px;
}

body.glass-ui .api-lead {
    margin-bottom: 12px;
}

body.glass-ui .api-h {
    margin: 14px 0 8px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--g-text-dim);
}

body.glass-ui .api-table {
    width: 100%;
    margin: 0;
    font-size: .9rem;
    border-collapse: collapse;
}

body.glass-ui .api-table th,
body.glass-ui .api-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--g-divider);
}

body.glass-ui .api-table thead th {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--g-text-dim);
}

body.glass-ui .api-table tbody th {
    font-weight: 500;
    color: var(--g-text-strong);
    white-space: nowrap;
    width: 11rem;
}

/* Names never break mid-word; the wrapper scrolls sideways on narrow screens instead. */
body.glass-ui .api-table td:first-child code {
    white-space: nowrap;
}

body.glass-ui .api-table td:last-child {
    min-width: 16rem;
}

body.glass-ui .api-table tr:last-child td,
body.glass-ui .api-table tr:last-child th {
    border-bottom: 0;
}

body.glass-ui .api-req,
body.glass-ui .api-opt {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

body.glass-ui .api-req {
    color: var(--g-warm);
}

body.glass-ui .api-opt {
    color: var(--g-text-dim);
}

body.glass-ui .api-response {
    margin-bottom: 12px;
}

body.glass-ui .api-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    font-size: .875rem;
}

body.glass-ui .api-code-ok,
body.glass-ui .api-code-err {
    padding: .1em .55em;
    border-radius: var(--g-r-capsule);
    font-weight: 700;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}

body.glass-ui .api-code-ok {
    background: var(--g-accent-tint);
    color: var(--g-accent);
}

body.glass-ui .api-code-err {
    background: rgba(220, 53, 69, .2);
    color: #ffb4bc;
}

body.glass-ui .api-dim {
    color: var(--g-text-dim);
}

body.glass-ui .api-pre {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .45);
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .06);
    font-size: .82rem;
    line-height: 1.5;
    color: var(--g-text-strong);
    overflow-x: auto;
}

body.glass-ui .api-pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    overflow-wrap: normal;
}

body.glass-ui .api-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 14px;
    margin: 10px 0 0;
    font-size: .9rem;
}

body.glass-ui .api-fields dd {
    margin: 0;
}

@media (max-width: 575.98px) {
    body.glass-ui .api-fields {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    body.glass-ui .api-fields dd {
        margin-bottom: 8px;
        color: var(--g-text-dim);
    }

    body.glass-ui .api-summary {
        flex-basis: 100%;
        margin-left: 0;
    }

    body.glass-ui .api-table tbody th {
        width: auto;
        white-space: normal;
    }
}

/* Settings page */
body.glass-ui .settings-row {
    align-items: center;
}

body.glass-ui .settings-key {
    padding: .1em .45em;
    border-radius: 6px;
    background: var(--g-flat-hover);
    color: var(--g-accent);
    font-size: .8rem;
}

body.glass-ui .settings-switch .form-check {
    margin: 0;
    padding: 0;
}

body.glass-ui .settings-switch .form-check-input {
    width: 3.2em;
    height: 1.7em;
    margin: 0;
    cursor: pointer;
    background-color: var(--g-flat-active);
    border: 0;
    box-shadow: var(--g-rim-soft);
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27%23e6e6e6%27/%3e%3c/svg%3e");
}

body.glass-ui .settings-switch .form-check-input:checked {
    background-color: var(--g-accent-solid);
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27%230f1d17%27/%3e%3c/svg%3e");
}

body.glass-ui .settings-switch .form-check-input:focus-visible {
    box-shadow: 0 0 0 3px var(--g-focus);
}

@media (min-width: 768px) {
    body.glass-ui .settings-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "identity actions";
    }
}

/* /v/ page */
body.glass-ui .view-sheet {
    max-width: 1100px;
    margin-top: 8px;
}

body.glass-ui .view-stage {
    border-radius: var(--g-r-panel);
    background: rgba(0, 0, 0, .4);
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .06);
}

body.glass-ui .view-media {
    border-radius: var(--g-r-item);
}

body.glass-ui .view-ext {
    background: var(--g-flat-hover);
    color: var(--g-text-strong);
    box-shadow: var(--g-rim-soft);
}

@supports (corner-shape: squircle) {
    body.glass-ui .view-ext {
        corner-shape: squircle;
        border-radius: 40px;
    }
}

body.glass-ui .view-title {
    color: var(--g-text-strong);
}

body.glass-ui .view-meta,
body.glass-ui .view-note {
    color: var(--g-text-dim);
}

body.glass-ui .view-actions .btn-group .btn {
    --bs-btn-padding-x: 1.1rem;
}

body.glass-ui .preview-text,
body.glass-ui .view-text {
    color: var(--g-text-strong);
    background: rgba(0, 0, 0, .45);
    box-shadow: inset 0 0 0 .6px rgba(255, 255, 255, .06);
    scrollbar-width: thin;
}

body.glass-ui .preview-text-note {
    color: var(--g-text-dim);
}

/* Admin lists: flat wells in a stack, concentric with the chips and buttons inside. */
body.glass-ui .admin-row {
    border: 0;
    border-radius: var(--g-r-item);
    background: var(--g-flat);
    box-shadow: var(--g-rim-soft);
    color: var(--g-text);
    transition: background-color 200ms var(--g-ease);
}

body.glass-ui .admin-row:hover {
    background: var(--g-flat-hover);
}

body.glass-ui .admin-avatar {
    background: var(--g-accent-solid);
    color: var(--g-on-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

body.glass-ui .admin-avatar.is-anon {
    background: var(--g-flat-active);
    color: var(--g-text);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .admin-ext {
    background: var(--g-flat-hover);
    color: var(--g-accent);
    box-shadow: var(--g-rim-soft);
    border-radius: 14px;
    font-size: 1.35rem;
}

body.glass-ui .admin-ext > i,
body.glass-ui .admin-ext > svg {
    width: 1em;
    height: 1em;
}

body.glass-ui .itembox-icon {
    color: var(--g-accent);
}

body.glass-ui .itembox-ext {
    background: rgba(14, 17, 16, .72);
    color: var(--g-text-strong);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .view-ext {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    line-height: 1;
    overflow: hidden;
}

body.glass-ui .view-ext > i,
body.glass-ui .view-ext > svg {
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    color: var(--g-accent);
    font-size: 2.75rem;
}

body.glass-ui .view-ext-label {
    margin-top: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.glass-ui .view-ext-hidden > i,
body.glass-ui .view-ext-hidden > svg {
    color: #ffb4bc;
}

body.glass-ui .view-ext-label {
    color: var(--g-text);
}

body.glass-ui .preview-placeholder > i,
body.glass-ui .preview-placeholder > svg {
    color: var(--g-accent);
}

@supports (corner-shape: squircle) {
    body.glass-ui .admin-ext {
        corner-shape: squircle;
        border-radius: 18px;
    }
}

body.glass-ui .admin-thumb {
    border-radius: 14px;
    box-shadow: var(--g-rim-soft);
    background: var(--g-flat-hover);
}

@supports (corner-shape: squircle) {
    body.glass-ui .admin-thumb {
        corner-shape: squircle;
        border-radius: 18px;
    }
}

body.glass-ui .admin-chip.admin-marked {
    background: rgba(220, 53, 69, .2);
    color: #ffb4bc;
}

body.glass-ui .admin-title,
body.glass-ui .admin-file-link,
body.glass-ui .admin-stat-value {
    color: var(--g-text-strong);
}

body.glass-ui .admin-file-link:hover {
    color: var(--g-accent);
}

body.glass-ui .admin-sub,
body.glass-ui .admin-stat-label {
    color: var(--g-text-dim);
}

body.glass-ui .admin-chip {
    background: var(--g-flat-hover);
    color: var(--g-text);
    box-shadow: var(--g-rim-soft);
}

body.glass-ui .admin-chip.role-admin {
    background: rgba(255, 181, 71, .16);
    color: var(--g-warm);
}

body.glass-ui .admin-chip.role-user {
    background: var(--g-accent-tint);
    color: var(--g-accent);
}

body.glass-ui .admin-list-head h4 {
    color: var(--g-text-strong);
}

body.glass-ui .table-dark {
    --bs-table-color: var(--g-text);
    --bs-table-bg: rgba(22, 26, 24, .82);
    --bs-table-border-color: var(--g-divider);
    --bs-table-striped-bg: rgba(255, 255, 255, .03);
    --bs-table-striped-color: var(--g-text-strong);
    --bs-table-hover-bg: rgba(255, 255, 255, .06);
    --bs-table-hover-color: #fff;
    border-radius: var(--g-r-panel);
    overflow: hidden;
}

body.glass-ui .table-dark thead th {
    background-color: rgba(22, 26, 24, .95);
    border-bottom: 1px solid var(--g-divider);
    color: var(--g-text-strong);
}

/* ------------------------------------------------------------------ */
/* 8. Focus                                                            */
/* ------------------------------------------------------------------ */
body.glass-ui :is(.list-group-item-action, #profilebox a, .admin-menu a, .calendar-element):focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--g-focus);
}

/* ------------------------------------------------------------------ */
/* 9. Fallbacks                                                        */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-transparency: reduce) {
    body.glass-ui {
        --g-noise: none;
        --g-sheen: none;
        --g-fill: #23272a;
        --g-fill-hover: #2c3033;
        --g-fill-strong: #23272a;
        --g-fill-clear: rgba(20, 22, 21, .9);
        --g-sheet: #181c1a;
        --g-flat: #2a2e2c;
        --g-flat-hover: #353936;
        --g-flat-active: #3d413e;
    }

    body.glass-ui::before {
        background: linear-gradient(180deg, #131a16, #0b0e0c);
        animation: none;
    }
}

@media (prefers-contrast: more) {
    body.glass-ui {
        --g-noise: none;
        --g-sheen: none;
        --g-selected: #3a3e3c;
        --g-fill: #23272a;
        --g-fill-hover: #2c3033;
        --g-fill-strong: #23272a;
        --g-fill-clear: #141614;
        --g-sheet: #181c1a;
        --g-flat: #2a2e2c;
        --g-flat-hover: #353936;
        --g-flat-active: #3d413e;
        --g-rim: inset 0 0 0 1px #9a9a9a;
        --g-rim-soft: inset 0 0 0 1px #9a9a9a;
        --g-drop: 0 0 #0000;
        --g-drop-lift: 0 0 #0000;
        --g-text: #e0e0e0;
        --g-accent-tint: rgba(52, 230, 161, .35);
        --g-accent-tint-strong: rgba(52, 230, 161, .55);
        --g-focus: #34e6a1;
    }

    body.glass-ui::before {
        background: #121212;
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.glass-ui {
        --g-dur: 0ms;
    }

    body.glass-ui::before {
        animation: none;
    }

    body.glass-ui .btn:hover,
    body.glass-ui .btn:active,
    body.glass-ui .lg-pressed {
        transform: none;
    }
}

