/* ==============================================================
   Ordivion V0.9.5 – finale bereinigte style.css
   - keine historischen V0.9.5b/c/d/e/f-Override-Blöcke mehr
   - finale Galerie-Desktop-Geometrie aus Browser-Dump übernommen
   - Galerie-Mobile als eigener Modus ohne endlose Reiterleiste
   - identische Selektor-Deklarationen konsolidiert
   - kompakt formatiert, aber nicht minifiziert
============================================================== */

:root {
  --ord-color-bg: #f8f8f8;
  --ord-color-surface: #ffffff;
  --ord-color-panel: #f1f1f1;
  --ord-color-panel-soft: rgba(255, 255, 255, 0.55);
  --ord-color-text: #1a1a1a;
  --ord-color-muted: #555555;
  --ord-color-border: #d7d7d7;
  --ord-color-primary: #c00000;
  --ord-color-primary-hover: #a00000;
  --ord-color-dark: #1a1a1a;
  --ord-color-dark-hover: #333333;
  --ord-radius-sm: 4px;
  --ord-radius-md: 6px;
  --ord-radius-lg: 10px;
  --ord-radius-xl: 14px;
  --ord-radius-pill: 999px;
  --ord-shadow-soft: 0 0 12px rgba(0, 0, 0, 0.05);
  --ord-focus-ring: 0 0 0 2px rgba(192, 0, 0, 0.20);
  --ord-space-xs: 4px;
  --ord-space-sm: 8px;
  --ord-space-md: 12px;
  --ord-space-lg: 16px;
  --ord-space-xl: 20px;
  --ord-space-2xl: 24px;
  --ord-font-base: "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
}

.ord-page-shell {
  width: min(95%, 1280px);
  margin: 20px auto;
  padding: var(--ord-space-xl);
  background: var(--ord-color-surface);
  border: 1px solid #e0e0e0;
  border-radius: var(--ord-radius-lg);
  box-shadow: var(--ord-shadow-soft);
  box-sizing: border-box;
}

.ord-section {
  background: var(--ord-color-panel);
  border-left: 4px solid var(--ord-color-primary);
  border-radius: var(--ord-radius-md);
  padding: var(--ord-space-lg);
  margin-bottom: var(--ord-space-xl);
  box-sizing: border-box;
}

.ord-section-title { margin: 0 0 var(--ord-space-md) 0; color: var(--ord-color-primary); font-size: 18px; line-height: 1.25; }

.ord-panel {
  background: var(--ord-color-panel-soft);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--ord-radius-lg);
  padding: var(--ord-space-md);
  box-sizing: border-box;
}

.ord-scrollbox { max-height: min(58vh, 560px); overflow: auto; padding-right: var(--ord-space-xs); }

.ord-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ord-space-lg); }

.ord-form-field { display: grid; gap: 6px; min-width: 0; }

.ord-form-field label,
.ord-field-label {
  font-weight: 700;
}

.ord-input,
.ord-select,
.ord-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 1px solid #bfc3c7;
  border-radius: var(--ord-radius-sm);
  background: #ffffff;
  color: var(--ord-color-text);
  font: inherit;
}

.ord-input:focus,
.ord-select:focus,
.ord-textarea:focus {
  outline: none;
  border-color: var(--ord-color-primary);
  box-shadow: var(--ord-focus-ring);
}

.ord-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ord-space-md); }

.ord-action-row--end { justify-content: flex-end; }

.ord-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 7px 9px;
  border: none;
  border-radius: var(--ord-radius-sm);
  background: var(--ord-color-primary);
  color: #ffffff;
  text-decoration: none;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.ord-icon-button:hover { background: var(--ord-color-primary-hover); }

.ord-icon-button:active { transform: translateY(1px); }

.ord-icon-button--dark,
.ord-icon-button.is-active {
  background: var(--ord-color-dark);
}

.ord-icon-button--dark:hover,
.ord-icon-button.is-active:hover {
  background: var(--ord-color-dark-hover);
}

.ord-icon-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ord-chip-row { display: flex; flex-wrap: wrap; gap: 0; align-items: center; }

.ord-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border: none;
  border-radius: var(--ord-radius-pill);
  background: var(--ord-color-dark);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ord-chip:hover { background: var(--ord-color-primary); }

.ord-chip--active { background: var(--ord-color-primary); }

.ord-chip--active:hover { background: var(--ord-color-primary-hover); }

.ord-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--ord-color-border);
  border-radius: var(--ord-radius-md);
  background: #ffffff;
  box-sizing: border-box;
}

.ord-table { width: 100%; border-collapse: collapse; }

.ord-table th,
.ord-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e6e6e6;
  text-align: left;
  vertical-align: top;
}

.ord-table th { background: #f3f3f3; font-weight: 700; }

@media (max-width: 860px) {
  .ord-page-shell { width: calc(100% - 20px); margin: 10px auto; padding: var(--ord-space-md); }

  .ord-form-grid { grid-template-columns: 1fr; }

  .ord-action-row,
  .ord-action-row--end {
    align-items: stretch;
    justify-content: stretch;
  }

  .ord-action-row > .nav-button,
  .ord-action-row > .ord-icon-button,
  .ord-action-row > button,
  .ord-action-row > a {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .ord-section { padding: var(--ord-space-md); }

  .ord-icon-button { min-width: 42px; min-height: 42px; }
}

.edit-section { flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px; }

.edit-section label { font-weight: bold; margin-right: 4px; }

.edit-section input {
  height: 24px;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 220px;
  margin-right: 12px;
}

.saved-filters-fieldset { margin-bottom: 18px; }

.saved-filter-toolbar { display: flex; flex-direction: column; gap: 12px; }

.saved-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.saved-filter-row label { min-width: 210px; font-weight: 600; }

.saved-filter-row select,
.saved-filter-row input[type="text"] {
  min-width: 240px;
}

#saved_filter_scope { flex: 0 0 170px; min-width: 170px; }

#saved_filter_select { flex: 1 1 320px; min-width: 260px; }

#saved_filter_name { flex: 1 1 260px; }

#saved-filter-status { margin-top: 10px; }

.gallery-container {
  width: 95%;
  margin: 20px auto;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
}

.bulk-section {
  background-color: #f1f1f1;
  border-left: 4px solid #c00000;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.bulk-section h2 { margin-top: 0; color: #c00000; font-size: 18px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(256px, 1fr)); gap: 20px; margin-top: 20px; }

.gallery-item {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background-color 0.2s;
}

.gallery-item:hover { background-color: #e0e0e0; }

.gallery-item.fully-processed { background-color: #e6f5e6; border-color: #9ccc9c; }

.gallery-item.fully-processed:hover { background-color: #cceacc; }

.gallery-item.selected:hover { background-color: rgba(20,20,120,0.3); }

.gallery-image img { width: 256px; height: auto; border-radius: 4px; }

.gallery-thumb {
  width: 100%;
  max-width: 256px;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: rgba(0,0,0,0.04);
}

.gallery-info { display: flex; flex-wrap: wrap; margin-top: 10px; }

.gallery-view-toolbar { justify-content: flex-end; margin: 0 0 14px 0; }

.gallery-grid.tile-info-collapsed .gallery-info { display: none; }

.gallery-grid.tile-info-collapsed .gallery-item { justify-content: space-between; }

.gallery-grid.tile-info-collapsed .tile-info { margin-top: 10px; }

.gallery-grid.tile-info-collapsed .tile-actions { margin-top: 0; }

.info-row { display: flex; align-items: center; padding: 4px; width: 100%; }

.info-label { flex: 0 0 30%; font-weight: bold; }

.info-value { flex: 1; margin-left: 5px; word-break: break-word; }

.tile-thumb {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 160px;
  padding: 0 2px;
  box-sizing: border-box;
}

.gallery-item { position: relative; }

.gallery-item .bulk_checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.video-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 4px;
  background: rgba(0,0,0,.75);
  color: #fff;
  pointer-events: none;
}

.tile-thumb { position: relative; }

.tile-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.tile-actions > form { margin: 0; }

.tile-actions a.nav-button,
.tile-actions > .nav-button {
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.tile-flag-actions { display: flex; gap: 10px; margin: 12px 0 10px 0; }

.tile-flag-btn { flex: 1 1 0; padding: 6px 10px; }

@media (max-width: 700px) {
  .tile-flag-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  .tile-flag-btn { width: 100%; min-width: 0; text-align: center; }
}

@media (max-width: 700px) {
  .tile-actions > .nav-button,
  .tile-actions > form {
    flex: 1 1 0;
  }
}

.select-all-label { display: inline-flex; align-items: center; margin-bottom: 1rem; }

.select-all-label input { margin-right: 0.5rem; }

html,
body.edit-iframe-body {
  height: 100%;
}

.edit-iframe-body { margin: 0; padding: 0; background: transparent; }

.edit-shell {
  height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  background: #e5e5e5;
  border: 1px solid #d1d1d1;
  border-radius: 14px;
}

.edit-chrome { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.edit-nav-btn { min-width: 48px; padding: 8px 14px; font-weight: 700; }

.edit-page {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 26px;
  background: #fff;
  border-radius: 12px;
}

.edit-media-wrap { max-width: 768px; margin: 0 auto 18px; }

.edit-media {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #000;
}

.edit-form { max-width: 900px; margin: 0 auto; }

@media (max-width: 740px) {
  dialog#editDialog {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .edit-shell { min-height: 100%; padding: 10px; border-radius: 0; }

  .edit-page { padding: 14px; }

  .edit-chrome-bottom .nav-button { flex: 1 1 0; min-width: 0; }
}

.highscore-container {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
  margin-top: 20px;
}

.highscore-list { margin: 0; padding: 0; }

.highscore-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px 15px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.highscore-item:hover { background-color: #f1f1f1; }

.highscore-item .ranking { font-weight: bold; width: 40px; }

.highscore-item .username { flex: 1; margin-left: 10px; font-size: 16px; }

.highscore-item .score { font-weight: bold; font-size: 16px; color: #c00000; }

.workspace-stats-shell {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  height: 42vh;
  max-height: 42vh;
  min-height: 280px;
  overflow: hidden;
  padding: 0 0 14px 0;
  box-sizing: border-box;
  border-radius: 0 0 8px 8px;
}

.gallery-stats-subtabs { flex: 0 0 auto; margin-top: 0; margin-bottom: 12px; }

.gallery-stats-subpanel { display: none; min-height: 0; }

.gallery-stats-subpanel.is-active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.gallery-stats-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }

.gallery-stats-metric-card { background: rgba(255,255,255,0.45); }

.gallery-stats-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.gallery-stats-panel-box { background: rgba(255,255,255,0.40); min-height: 0; }

.gallery-stats-highlight-list,
.gallery-stats-quality-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-stats-highlight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
}

.gallery-stats-highlight-link,
.gallery-stats-quality-item {
  color: #1a1a1a;
  text-decoration: none;
}

.gallery-stats-inline-open-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gallery-stats-quality-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
}

.gallery-stats-quality-item:hover,
.gallery-stats-highlight-link:hover {
  color: #c00000;
}

.gallery-stats-chart-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.gallery-stats-toolbar-group { display: flex; flex-direction: column; gap: 6px; }

.gallery-stats-toolbar-group-right { align-items: flex-end; }

.gallery-stats-toolbar-label { margin: 0; }

.gallery-stats-distribution-select { min-width: 240px; }

.gallery-stats-chart-switcher { margin-bottom: 0; }

.gallery-stats-chart-block {
  display: none;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
}

.gallery-stats-chart-block.is-active { display: flex; }

.gallery-stats-block-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.gallery-stats-block-meta { font-size: 0.88em; opacity: 0.82; }

.gallery-stats-distribution-grid { flex: 1 1 auto; min-height: 0; padding-bottom: 6px; box-sizing: border-box; }

.gallery-stats-chart-view { display: none; min-height: 0; }

.gallery-stats-chart-view.is-active { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }

.gallery-stats-distributions-shell.gallery-stats-subpanel.is-active { overflow: hidden; padding: 0 6px 24px 0; box-sizing: border-box; }

.gallery-stats-distribution-content {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.gallery-stats-distribution-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  grid-column: 1;
  grid-row: 1;
}

.gallery-stats-scroll-pane {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  padding-bottom: 18px;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.gallery-stats-hover-card {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  grid-column: 2;
  grid-row: 1;
  box-sizing: border-box;
}

.gallery-stats-donut-layout { flex: 1 1 auto; height: 100%; min-height: 0; overflow: hidden; }

.gallery-stats-donut-legend-wrap {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  padding-bottom: 18px;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.gallery-stats-bar-list { display: flex; flex-direction: column; gap: 10px; }

.gallery-stats-bar-row {
  display: block;
  text-decoration: none;
  color: #1a1a1a;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.45);
}

.gallery-stats-bar-row:hover { background: rgba(255,255,255,0.65); }

.gallery-stats-bar-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }

.gallery-stats-bar-label { font-weight: 600; min-width: 0; word-break: break-word; }

.gallery-stats-bar-meta { white-space: nowrap; }

.gallery-stats-bar-track { height: 10px; border-radius: 999px; background: #e5e5e5; overflow: hidden; }

.gallery-stats-bar-fill { height: 100%; border-radius: 999px; background: #c00000; }

.gallery-stats-donut-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }

.gallery-stats-donut-wrap { display: flex; justify-content: center; align-items: center; }

.gallery-stats-donut-svg { width: 220px; height: 220px; display: block; }

.gallery-stats-donut-segment { cursor: default; transition: opacity 0.18s ease, transform 0.18s ease; transform-origin: 110px 110px; }

.gallery-stats-donut-segment.is-clickable { cursor: pointer; }

.gallery-stats-donut-segment:hover,
.gallery-stats-donut-segment:focus {
  opacity: 0.88;
  outline: none;
}

.gallery-stats-donut-center-value { font-size: 20px; font-weight: 700; fill: #1a1a1a; }

.gallery-stats-donut-center-label { font-size: 11px; fill: #555; }

.gallery-stats-donut-legend { display: flex; flex-direction: column; gap: 8px; }

.gallery-stats-donut-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.45);
  color: #1a1a1a;
  text-decoration: none;
}

.gallery-stats-donut-legend-item:hover { background: rgba(255,255,255,0.65); }

.gallery-stats-color-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.gallery-stats-donut-legend-label { min-width: 0; word-break: break-word; }

.gallery-stats-donut-legend-value { white-space: nowrap; }

.gallery-stats-hover-card { padding: 12px 14px 18px; border-radius: 10px; background: rgba(255,255,255,0.55); border: 1px solid rgba(0,0,0,0.08); }

.gallery-stats-hover-label { font-weight: 700; margin-bottom: 8px; }

.gallery-stats-hover-meta { margin-bottom: 4px; font-size: 0.95em; }

.gallery-stats-hover-examples { margin-top: 10px; font-size: 0.94em; opacity: 0.9; }

.gallery-stats-hover-link {
  display: inline-block;
  margin-top: 10px;
  color: #c00000;
  text-decoration: none;
  font-weight: 600;
}

.gallery-stats-hover-link:hover { text-decoration: underline; }

.gallery-stats-hover-link.is-hidden { display: none; }

.gallery-stats-detail-heading { font-weight: 700; margin-bottom: 12px; }

.gallery-stats-detail-toolbar-wrap { margin-bottom: 0; flex: 0 0 auto; }

.gallery-stats-detail-toolbar { display: flex; flex-direction: column; gap: 10px; }

.gallery-stats-details-shell.gallery-stats-subpanel.is-active { overflow: hidden; padding: 0 6px 24px 0; box-sizing: border-box; }

.gallery-stats-detail-panel-box {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.gallery-stats-detail-table-frame {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  box-sizing: border-box;
}

.gallery-stats-detail-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
}

.gallery-stats-detail-toolbar-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

.gallery-stats-detail-control { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }

.gallery-stats-detail-control label { font-size: 0.88em; opacity: 0.82; }

.gallery-stats-detail-control select { min-width: 170px; }

.gallery-stats-detail-summary { font-size: 0.93em; opacity: 0.86; }

.gallery-stats-detail-table { min-width: 1420px; width: max-content; margin: 0; }

.gallery-stats-detail-table th:nth-child(1),
.gallery-stats-detail-table td:nth-child(1) {
  min-width: 78px;
  width: 78px;
  white-space: nowrap;
}

.gallery-stats-detail-table th:nth-child(2),
.gallery-stats-detail-table td:nth-child(2) {
  min-width: 96px;
  width: 96px;
}

.gallery-stats-detail-table th:nth-child(3),
.gallery-stats-detail-table td:nth-child(3) {
  min-width: 320px;
  width: 320px;
}

.gallery-stats-detail-table th:nth-child(4),
.gallery-stats-detail-table td:nth-child(4) {
  min-width: 90px;
  width: 90px;
}

.gallery-stats-detail-table th:nth-child(5),
.gallery-stats-detail-table td:nth-child(5) {
  min-width: 90px;
  width: 90px;
}

.gallery-stats-detail-table th:nth-child(6),
.gallery-stats-detail-table td:nth-child(6),
.gallery-stats-detail-table th:nth-child(7),
.gallery-stats-detail-table td:nth-child(7) {
  min-width: 110px;
  width: 110px;
}

.gallery-stats-detail-table th:nth-child(8),
.gallery-stats-detail-table td:nth-child(8),
.gallery-stats-detail-table th:nth-child(9),
.gallery-stats-detail-table td:nth-child(9) {
  min-width: 230px;
  width: 230px;
}

.gallery-stats-detail-table th:nth-child(10),
.gallery-stats-detail-table td:nth-child(10) {
  min-width: 130px;
  width: 130px;
}

.gallery-stats-quality-shell.gallery-stats-subpanel.is-active { overflow-y: auto; }

.gallery-stats-quality-cockpit { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.gallery-stats-quality-card-grid { margin-bottom: 0; }

.gallery-stats-quality-summary-card {
  text-decoration: none;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-stats-quality-summary-card:hover { color: #c00000; }

.gallery-stats-quality-summary-hint { font-size: 0.84em; opacity: 0.78; }

.gallery-stats-quality-top-grid { align-items: stretch; }

.gallery-stats-quality-item.is-active { border: 1px solid rgba(192, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(192, 0, 0, 0.08); }

.gallery-stats-quality-combo-list { display: flex; flex-direction: column; gap: 10px; }

.gallery-stats-quality-combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
}

.gallery-stats-quality-combo-label { font-weight: 600; }

.gallery-stats-quality-combo-meta { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.gallery-stats-quality-combo-meta span { opacity: 0.76; }

.gallery-stats-quality-table-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.gallery-stats-quality-toolbar-shell {
  flex: 0 0 auto;
  padding: 12px 14px;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  background: #f8f8f8;
  box-sizing: border-box;
}

.gallery-stats-quality-toolbar { flex: 0 0 auto; }

.gallery-stats-quality-active-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

.gallery-stats-quality-active-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  font-size: 0.84em;
  line-height: 1.2;
}

.gallery-stats-quality-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.gallery-stats-quality-detail-btn { text-decoration: none; }

.gallery-stats-quality-combo-link { color: #1a1a1a; text-decoration: none; transition: background-color 0.18s ease, color 0.18s ease; }

.gallery-stats-quality-combo-link:hover { background: rgba(255,255,255,0.72); color: #c00000; }

.gallery-stats-quality-table-frame { flex: 1 1 auto; }

.gallery-stats-quality-table { min-width: 1320px; }

.gallery-stats-quality-table th:nth-child(1),
.gallery-stats-quality-table td:nth-child(1) {
  min-width: 78px;
  width: 78px;
}

.gallery-stats-quality-table th:nth-child(2),
.gallery-stats-quality-table td:nth-child(2) {
  min-width: 96px;
  width: 96px;
}

.gallery-stats-quality-table th:nth-child(3),
.gallery-stats-quality-table td:nth-child(3) {
  min-width: 320px;
  width: 320px;
}

.gallery-stats-quality-table th:nth-child(4),
.gallery-stats-quality-table td:nth-child(4),
.gallery-stats-quality-table th:nth-child(5),
.gallery-stats-quality-table td:nth-child(5) {
  min-width: 90px;
  width: 90px;
}

.gallery-stats-quality-table th:nth-child(6),
.gallery-stats-quality-table td:nth-child(6) {
  min-width: 120px;
  width: 120px;
}

.gallery-stats-quality-table th:nth-child(7),
.gallery-stats-quality-table td:nth-child(7) {
  min-width: 330px;
  width: 330px;
}

.gallery-stats-quality-table th:nth-child(8),
.gallery-stats-quality-table td:nth-child(8) {
  min-width: 130px;
  width: 130px;
}

.gallery-stats-quality-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
}

.gallery-stats-quality-priority-badge.priority-kritisch { background: rgba(192,0,0,0.14); color: #8f0000; }

.gallery-stats-quality-priority-badge.priority-mittel { background: rgba(217,95,2,0.14); color: #9a4700; }

.gallery-stats-quality-priority-badge.priority-leicht { background: rgba(27,158,119,0.14); color: #0d6a4d; }

.gallery-stats-quality-priority-badge.priority-sauber { background: rgba(102,166,30,0.14); color: #3e6b0c; }

.gallery-stats-quality-missing-list { display: flex; flex-wrap: wrap; gap: 6px; }

.gallery-stats-quality-missing-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(192,0,0,0.09);
  color: #7e0000;
  font-size: 0.82em;
  line-height: 1.2;
}

.gallery-stats-quality-missing-chip.is-complete { background: rgba(102,166,30,0.14); color: #3e6b0c; }

.gallery-stats-id-cell { white-space: nowrap; }

.gallery-stats-id-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #c00000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.gallery-stats-id-btn:hover { text-decoration: underline; }

.gallery-stats-thumb-open-btn { margin: 0; cursor: pointer; display: inline-flex; align-items: center; }

.gallery-stats-thumb-open-btn img { pointer-events: none; }

.gallery-stats-mini-thumb { display: block; }

.gallery-stats-edit-link { display: inline-block; text-decoration: none; text-align: center; }

@media (max-width: 1000px) {
  .gallery-stats-detail-toolbar-row { flex-direction: column; align-items: stretch; }

  .gallery-stats-detail-control,
  .gallery-stats-detail-control select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .gallery-stats-distribution-content { grid-template-columns: 1fr; }

  .gallery-stats-distribution-main,
  .gallery-stats-hover-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 1000px) {
  .workspace-stats-shell { height: auto; max-height: none; min-height: 0; overflow: visible; }

  .gallery-stats-subpanel.is-active,
  .gallery-stats-distributions-shell.gallery-stats-subpanel.is-active {
    overflow: visible;
    padding-right: 0;
  }

  .gallery-stats-two-col,
  .gallery-stats-distribution-content,
  .gallery-stats-donut-layout,
  .gallery-stats-quality-top-grid {
    grid-template-columns: 1fr;
  }

  .gallery-stats-distribution-main,
  .gallery-stats-hover-card {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-stats-donut-wrap { justify-content: flex-start; }

  .gallery-stats-scroll-pane,
  .gallery-stats-donut-legend-wrap,
  .gallery-stats-hover-card {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
  }

  .gallery-stats-toolbar-group-right { align-items: flex-start; }
}

.stats-switcher { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.stats-switcher-btn {
  display: inline-block;
  background-color: #f3f3f3;
  color: #1a1a1a;
  padding: 8px 14px;
  border: 1px solid #c8c8c8;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.stats-switcher-btn:hover { background-color: #e3e3e3; border-color: #a9a9a9; }

.stats-switcher-btn.is-active { background-color: #c00000; color: #ffffff; border-color: #990000; }

.highscore-section-title { font-size: 18px; font-weight: 700; color: #c00000; margin-bottom: 14px; }

.highscore-empty-note { padding: 16px 18px; border: 1px dashed #bdbdbd; border-radius: 8px; background: #fafafa; }

@media (max-width: 768px) {
  .meta-group, .edit-section { flex-direction: column; }

  .edit-section input { width: 100%; }

  .zoom-container, #zoom-frame, #tiny-img { width: 100%; max-width: 768px; }
}

dialog#editDialog {
  width: min(920px, 78vw);
  height: min(1080px, 94vh);
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
}

dialog#editDialog::backdrop { background: rgba(0,0,0,0.65); }

#editFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: transparent;
}

:root {
  --gallery-red: #c00000;
  --gallery-panel: #f1f1f1;
  --gallery-panel-light: #f6f6f6;
  --gallery-hover: #dfdfdf;
  --gallery-active: #d8d8d8;
  --gallery-border-dark: #8f8f8f;
}

.filter-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.per-page-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-weight: 600;
}

.filter-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: help;
  background: #444;
  color: #fff;
  vertical-align: middle;
}

.lazy-thumb { opacity: 0; transition: opacity 0.18s ease-in-out; }

.lazy-thumb.is-loaded { opacity: 1; }

img.gallery-thumb:not(.lazy-thumb) { opacity: 1; }

.gallery-empty {
  margin: 20px 0;
  padding: 20px;
  border: 1px dashed #bbb;
  border-radius: 8px;
  background: #fafafa;
  text-align: center;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  background: #f8f8f8;
}

.gallery-pagination-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.gallery-pagination button {
  min-width: 38px;
  padding: 6px 10px;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
  background: #f3f3f3;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gallery-pagination button:not([disabled]):hover { background: var(--gallery-hover); border-color: #9f9f9f; }

.gallery-pagination button[disabled] { opacity: 0.45; cursor: not-allowed; }

.gallery-pagination .page-current {
  min-width: 38px;
  padding: 6px 10px;
  border: 1px solid var(--gallery-border-dark);
  border-radius: 6px;
  background: var(--gallery-active);
  font-weight: 700;
  text-align: center;
}

.gallery-pagination-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.page-jump-input { width: 78px; padding: 6px 8px; }

.gallery-page-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); box-sizing: border-box; }

.filter-section,
.bulk-section {
  position: relative;
  z-index: 2;
}

.section-title-bar { display: block; margin: 0 0 10px 0; }

.section-title-bar h2 { margin: 0; }

.section-collapsible-body { overflow: hidden; }

.section-collapsible-body.is-collapsed { display: none; }

.section-toggle-row { display: flex; justify-content: center; margin: 10px 0 0 0; }

.workspace-toggle-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }

.workspace-toggle-row .section-toggle-btn { grid-column: 2; justify-self: center; }

.workspace-toggle-tools {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-per-page-control span { white-space: nowrap; }

.gallery-view-toolbar { display: none; }

.section-toggle-btn {
  min-width: 46px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #bcbcbc;
  border-radius: 6px;
  background: #f3f3f3;
  color: #1a1a1a;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.section-toggle-btn:hover { background: #dfdfdf; border-color: #9d9d9d; }

.section-toggle-btn:active { transform: none; box-shadow: none; }

.toggle-glyph { position: relative; display: inline-block; width: 18px; height: 10px; }

.toggle-glyph::before,
.toggle-glyph::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 10px;
  height: 2px;
  background: #4a4a4a;
  border-radius: 999px;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.toggle-glyph::before { left: 0; transform-origin: right center; transform: rotate(-28deg); }

.toggle-glyph::after { right: 0; transform-origin: left center; transform: rotate(28deg); }

.section-toggle-btn.is-collapsed .toggle-glyph::before { transform: rotate(28deg); }

.section-toggle-btn.is-collapsed .toggle-glyph::after { transform: rotate(-28deg); }

.section-toggle-btn:hover .toggle-glyph::before,
.section-toggle-btn:hover .toggle-glyph::after {
  background: #222;
}

.filter-field-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 0 24px; align-items: start; }

.filter-column { min-width: 0; }

.filter-form-block { margin-bottom: 18px; }

.filter-form-block label { display: inline-block; margin-bottom: 6px; }

.filter-select { min-width: 210px; max-width: 100%; }

.filter-chip-box { margin-top: 8px; min-height: 0; }

.filter-chip-box:empty { display: none; }

.filter-sub-option { margin-top: 8px; }

.project-sidebar {
  z-index: 130;
  align-self: start;
  padding: 12px;
  background-color: #f1f1f1;
  border-radius: 6px;
  overflow: hidden;
  box-sizing: border-box;
  transition: width 0.22s ease, min-width 0.22s ease, padding 0.22s ease;
}

.project-sidebar::before,
.project-sidebar::after {
  content: none !important;
}

.project-sidebar-inner { position: relative; z-index: 2; }

.project-sidebar.is-collapsed { min-height: 360px; }

.project-sidebar-collapsed-label { display: none; }

.project-sidebar-toggle {
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #f3f3f3;
  color: #1a1a1a;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.project-sidebar-toggle:hover { background: var(--gallery-hover); border-color: #9f9f9f; }

.project-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.project-entry {
  display: block;
  padding: 9px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a1a;
  background: #f3f3f3;
  border: 1px solid #c9c9c9;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-entry:hover { background: var(--gallery-hover); border-color: #a4a4a4; }

.project-entry.active { background: var(--gallery-active); border-color: var(--gallery-border-dark); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }

.project-entry-title { display: block; font-weight: 600; }

.project-entry.active .project-entry-title { font-weight: 700; }

.project-entry-meta { display: block; font-size: 0.85em; opacity: 0.82; margin-top: 4px; }

.project-empty-note,
.project-helper-text,
.project-meta-line {
  font-size: 0.92em;
  opacity: 0.86;
}

.project-empty-note { margin-top: 10px; }

.project-view-header {
  background-color: #f1f1f1;
  border-left: 4px solid #c00000;
  border-radius: 6px;
  padding: 15px;
  margin: 0 0 20px 0;
}

.project-notes-section { padding-bottom: 12px; }

.project-view-header::before,
.project-view-header::after {
  content: none !important;
}

.project-bulk-box { border-radius: 8px; margin: 12px 0; }

.project-inline-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.project-chip-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.project-hidden { display: none; }

.project-members summary { cursor: pointer; font-weight: 600; }

.project-members-list { margin-top: 10px; }

.workspace-shell {
  margin-top: 0;
  position: relative;
  z-index: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #d7d7d7;
  overflow: hidden;
}

.workspace-tabs { margin: 14px 0 12px 0; }

.workspace-body { min-width: 0; padding-bottom: 8px; box-sizing: border-box; }

.workspace-body .workspace-panel {
  display: none;
  background: transparent;
  border-left: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.workspace-body .workspace-panel.is-active { display: block; }

.workspace-body .workspace-panel.workspace-stats-shell.is-active { display: flex; }

.workspace-body .workspace-panel > .section-title-bar,
.workspace-body .workspace-panel > .section-toggle-row {
  display: none;
}

.workspace-body .workspace-panel > .section-collapsible-body { display: block !important; }

.workspace-body .project-workspace { margin-top: 0; }

.workspace-body .project-workspace > .section-title-bar,
.workspace-body .project-workspace > .project-tabs,
.workspace-body .project-workspace > .section-toggle-row {
  display: none;
}

.workspace-body .project-workspace > .section-collapsible-body { display: block !important; }

.project-workspace { margin-top: 16px; }

.project-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.project-tab-btn {
  border: 1px solid #c8c8c8;
  background: #f3f3f3;
  color: #1a1a1a;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.92em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.project-tab-btn:hover { background: #e6e6e6; border-color: #a6a6a6; }

.project-tab-btn.is-active { background: #c00000; color: #fff; border-color: #990000; }

.project-tab-panels { min-width: 0; }

.project-tab-panel { display: none; }

.project-tab-panel.is-active { display: block; }

.project-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }

.project-overview-card,
.project-panel-box {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  background: rgba(255,255,255,0.35);
  padding: 14px 16px;
}

.project-overview-label { font-size: 0.88em; opacity: 0.8; margin-bottom: 6px; }

.project-overview-value { font-size: 1.1em; font-weight: 700; }

.project-description-box { display: flex; flex-direction: column; gap: 10px; }

.project-description-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.project-notes-scroll-area { max-height: 720px; overflow-y: auto; padding-right: 6px; }

.project-notes-compose-box {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f1f1f1;
  padding: 0 0 14px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.project-notes-list { display: flex; flex-direction: column; gap: 14px; }

.project-note-card {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.35);
}

.project-note-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.project-note-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.project-note-author-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 8px;
}

.project-note-author {
  color: #c00000;
  font-weight: 800;
}

.project-note-date {
  color: #444444;
  font-size: 0.92em;
  font-weight: 400;
}

.project-note-title {
  font-weight: 700;
  margin: 0;
}

.project-note-title-empty {
  color: #666666;
  font-style: italic;
}

.project-note-divider {
  margin: 10px 0 12px;
  border-top: 1px solid rgba(0,0,0,0.12);
}

.project-note-text {
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.project-note-empty { padding-bottom: 4px; }

@media (max-width: 1100px) {
  .project-overview-grid { grid-template-columns: 1fr; }

  .project-notes-scroll-area { max-height: 60vh; }
}

@media (max-width: 700px) {
  .project-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 10px; }
}

.workspace-per-page-control { width: auto !important; margin-left: 0 !important; justify-content: flex-end !important; }

@media (max-width: 1100px) {
  .gallery-page-layout { grid-template-columns: 1fr; width: 95%; }

  .filter-field-columns { grid-template-columns: 1fr; }

  .gallery-sticky-controls,
  .project-sidebar {
    position: static;
  }

  .project-sidebar,
  .project-sidebar.is-collapsed {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 12px;
  }

  .project-sidebar.is-collapsed .project-sidebar-inner {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    height: auto;
    overflow: visible;
  }

  .project-sidebar.is-collapsed .project-sidebar-collapsed-label { display: none; }

  .project-sidebar-toggle { right: 6px; width: 22px; height: 22px; font-size: 14px; }

  .workspace-toggle-row { grid-template-columns: 1fr; gap: 10px; }

  .workspace-toggle-row .section-toggle-btn { grid-column: 1; justify-self: center; }

  .workspace-toggle-tools {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
  }
}

.gallery-page-layout {
  width: calc(100% + 20px) !important;
  margin: 20px 0 20px -20px !important;
  padding: 0 20px 0 0 !important;
  gap: 18px !important;
  align-items: start !important;
}

.gallery-page-layout > .gallery-container {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 20px !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 0 12px rgba(0,0,0,0.05) !important;
  position: relative;
  z-index: 2;
}

.gallery-sticky-controls {
  position: sticky !important;
  top: var(--gallery-sticky-top) !important;
  z-index: 220 !important;
  margin-top: -20px !important;
  padding-top: 20px !important;
  padding-bottom: 0 !important;
  background: #ffffff !important;
}

.gallery-sticky-controls::before,
.gallery-sticky-controls::after {
  content: none !important;
}

.sticky-section-card {
  margin: 0 0 20px 0 !important;
  padding: 0 !important;
  background: transparent !important;
  position: relative;
  z-index: 1;
}

.filter-section,
.bulk-section {
  background-color: #f1f1f1 !important;
  padding-left: 20px !important;
  padding-right: 15px !important;
}

.project-sidebar {
  position: sticky !important;
  top: var(--gallery-sticky-top) !important;
  left: 1px !important;
  margin-left: 7px !important;
  width: 240px !important;
  min-width: 240px !important;
}

.project-sidebar.is-collapsed { width: 20px !important; min-width: 20px !important; padding: 8px 0 !important; overflow: hidden !important; }

.project-sidebar.is-collapsed .project-sidebar-inner {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

.project-sidebar.is-collapsed .project-sidebar-collapsed-label {
  display: flex !important;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 34px auto 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #444;
  letter-spacing: 0.03em;
  user-select: none;
}

.gallery-grid,
.gallery-item,
.media-grid,
.media-card {
  position: relative;
  z-index: 1 !important;
}

@media (max-width: 700px) {
  .gallery-page-layout { grid-template-columns: 1fr !important; gap: 12px !important; align-items: start !important; }

  .gallery-sticky-controls { margin-top: 0 !important; padding-top: 0 !important; }

  .project-sidebar,
  .project-sidebar.is-collapsed {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .project-sidebar .project-sidebar-inner,
  .project-sidebar.is-collapsed .project-sidebar-inner {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  .project-sidebar-collapsed-label,
  .project-sidebar.is-collapsed .project-sidebar-collapsed-label {
    display: none !important;
  }

  .project-sidebar-toggle { display: none !important; }

  .project-list { gap: 6px !important; }

  .project-view-header,
  .filter-section,
  .bulk-section {
    margin: 0 0 14px 0 !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  .filter-section,
  .bulk-section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .workspace-tabs,
  .project-tabs {
    margin: 0 0 10px 0 !important;
    padding-bottom: 8px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .project-tab-btn { flex: 0 0 auto !important; white-space: nowrap !important; }

  .filter-field-columns { grid-template-columns: 1fr !important; gap: 0 !important; }

  .filter-column,
  .filter-form-block,
  fieldset {
    min-width: 0 !important;
  }

  .filter-select,
  #last_editor,
  #project-select,
  #project-member-select,
  #project-series-select,
  #status-select,
  #series-name,
  #project-name,
  #title,
  #dpi,
  #fps,
  #hoehe,
  #breite,
  #created_from,
  #created_to,
  #created_time_from,
  #created_time_to,
  #modified_from,
  #modified_to,
  #modified_time_from,
  #modified_time_to,
  .project-description-textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .filter-buttons { flex-direction: column !important; align-items: stretch !important; }

  .per-page-control { width: 100% !important; margin-left: 0 !important; justify-content: space-between !important; }

  .project-inline-row { flex-direction: column !important; align-items: stretch !important; }

  .project-chip-wrap { gap: 6px !important; }

  #rollback_key { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }

  .project-overview-grid { grid-template-columns: 1fr !important; }

  .project-notes-scroll-area { max-height: none !important; overflow: visible !important; padding-right: 0 !important; }

  .project-notes-compose-box { position: static !important; top: auto !important; border-bottom: 0 !important; padding-bottom: 10px !important; }

  .gallery-thumb,
  .gallery-image img {
    width: 100% !important;
    max-width: 256px !important;
    height: auto !important;
    margin: 0 auto !important;
  }

  .tile-thumb { justify-content: center !important; padding: 0 2px !important; }

  .tile-actions { flex-direction: column !important; }

  .gallery-grid.tile-info-collapsed .tile-actions { flex-direction: row !important; align-items: center !important; }

  .info-row { align-items: flex-start !important; }

  .info-label { flex: 0 0 34% !important; }

  .gallery-pagination-controls,
  .gallery-pagination-meta {
    width: 100% !important;
  }

  dialog#editDialog {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
}

.edit-section {
  display: block !important;
  background: #f3f3f3 !important;
  border-left: 4px solid #b00000 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  margin: 14px 0 16px !important;
}

.edit-section-title {
  margin: 0 0 10px !important;
  color: #b00000 !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  text-align: left !important;
}

.edit-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px 18px !important; }

.edit-row { display: grid !important; grid-template-columns: 180px 1fr !important; align-items: center !important; gap: 10px !important; }

.edit-row label { font-weight: 700 !important; text-align: left !important; white-space: nowrap !important; }

.edit-row input { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }

.edit-row-wide { grid-column: 1 / -1 !important; }

.edit-hint { margin-top: 10px !important; opacity: 0.85 !important; font-size: 0.95em !important; }

@media (max-width: 740px) {
  .edit-grid { grid-template-columns: 1fr !important; }

  .edit-row { grid-template-columns: 1fr !important; align-items: start !important; }

  .edit-row label { white-space: normal !important; }
}

@media (max-width: 700px) {
  .tile-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; align-items: stretch !important; gap: 8px !important; }

  .tile-actions > .nav-button,
  .tile-actions > form {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .tile-actions > .nav-button,
  .tile-actions > form .nav-button {
    width: 100% !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
}

.edit-history-table tbody tr:nth-child(even) { background: #fafafa; }

.edit-history-table tbody tr:hover { background: #f2f2f2; }

.edit-history-table th:nth-child(3),
.edit-history-table td:nth-child(3) {
  min-width: 320px;
  width: 320px;
}

.edit-history-table th:nth-child(4),
.edit-history-table td:nth-child(4) {
  min-width: 220px;
  width: 220px;
}

.edit-history-table th:nth-child(5),
.edit-history-table td:nth-child(5) {
  min-width: 120px;
  width: 120px;
}

.edit-history-table th:nth-child(6),
.edit-history-table td:nth-child(6) {
  min-width: 170px;
  width: 170px;
}

.edit-history-table th:nth-child(7),
.edit-history-table td:nth-child(7),
.edit-history-table th:nth-child(8),
.edit-history-table td:nth-child(8),
.edit-history-table th:nth-child(9),
.edit-history-table td:nth-child(9),
.edit-history-table th:nth-child(10),
.edit-history-table td:nth-child(10) {
  min-width: 260px;
  width: 260px;
}

.edit-history-table th:nth-child(11),
.edit-history-table td:nth-child(11),
.edit-history-table th:nth-child(12),
.edit-history-table td:nth-child(12),
.edit-history-table th:nth-child(13),
.edit-history-table td:nth-child(13),
.edit-history-table th:nth-child(14),
.edit-history-table td:nth-child(14),
.edit-history-table th:nth-child(15),
.edit-history-table td:nth-child(15),
.edit-history-table th:nth-child(16),
.edit-history-table td:nth-child(16) {
  min-width: 220px;
  width: 220px;
}

.tagmask-page-shell { border: 1px solid rgba(0, 0, 0, 0.08); box-sizing: border-box; overflow: visible; }

.tagmask-sticky-stage {
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.tagmask-sticky-stage .series-dropdown-container { margin: 1rem 0; }

.tagmask-sticky-stage .image-center { margin-bottom: 20px; }

.tagmask-sticky-stage .meta-row.bottom-line { margin-bottom: 15px; }

.tagmask-media-sticky {
  position: sticky;
  top: 68px;
  z-index: 40;
  background: #ffffff;
  padding: 0 0 12px 0;
  margin: 0 0 14px 0;
  border-bottom: 1px solid #e2e2e2;
}

.tagmask-media-sticky .image-center { margin-bottom: 0; }

.tagmask-media-sticky .zoom-container,
.tagmask-media-sticky #zoom-frame,
.tagmask-media-sticky #tiny-img,
.tagmask-media-sticky #video-frame,
.tagmask-media-sticky #video-player {
  width: 100%;
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.tagmask-media-sticky.is-stuck .zoom-container,
.tagmask-media-sticky.is-stuck #zoom-frame,
.tagmask-media-sticky.is-stuck #tiny-img,
.tagmask-media-sticky.is-stuck #video-frame,
.tagmask-media-sticky.is-stuck #video-player {
  max-width: min(768px, 50vw);
}

@media (max-width: 900px) {
  .tagmask-media-sticky {
    position: static;
    top: auto;
    z-index: auto;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
  }

  .tagmask-media-sticky.is-stuck .zoom-container,
  .tagmask-media-sticky.is-stuck #zoom-frame,
  .tagmask-media-sticky.is-stuck #tiny-img,
  .tagmask-media-sticky.is-stuck #video-frame,
  .tagmask-media-sticky.is-stuck #video-player {
    max-width: 100%;
  }
}

body {
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  background-color: #f8f8f8;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
  touch-action: pan-y;
}

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 20px 100px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

.image-center { text-align: center; margin-bottom: 20px; }

.image-center img { max-width: 100%; height: auto; border-radius: 5px; }

.tagmask-media {
  display: block;
  width: 768px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: none;
  outline: none;
  box-shadow: none;
}

#video-frame { display: flex; justify-content: center; }

.meta-group,
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.meta-group input,
.meta-row input {
  height: 24px;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

#dpi { width: 60px; }

.meta-double { gap: 40px; }

.meta-block { display: flex; flex-direction: column; gap: 6px; }

.meta-block.left-align > div { justify-content: flex-start; }

.meta-block.left-align strong { text-align: left; margin-right: 6px; }

.meta-block > div { display: flex; justify-content: flex-end; align-items: center; }

.meta-block > div strong { min-width: 90px; text-align: right; margin-right: 8px; }

.meta-block input { flex: 1; max-width: 240px; }

.meta-row.top-line > div { min-width: 180px; flex: 1; }

.meta-row.middle-line { display: flex; justify-content: space-between; gap: 40px; }

.meta-pair {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 300px;
  flex: 1;
}

.meta-row.bottom-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 20px;
  align-items: center;
  width: 100%;
}

.meta-row.bottom-line .left { grid-column: 1 / 4; white-space: nowrap; }

.meta-row.bottom-line .right { grid-column: 4 / 5; text-align: right; white-space: nowrap; }

.top-bar {
  background-color: #1a1a1a;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-button {
  background-color: #c00000;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.nav-button:hover { background-color: #a00000; }

select.nav-button.dropdown {
  appearance: none;
  background-color: #c00000;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.username, .score { font-weight: bold; }

.page-title { text-align: center; }

.page-title h1 { font-size: 28px; font-weight: bold; color: #333; margin: 0; }

.side-button {
  position: fixed;
  top: 80px;
  bottom: 30px;
  width: 80px;
  background-color: #c00000;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  z-index: 999;
  transition: background-color 0.3s ease;
}

.side-button.left { left: 0; border-radius: 0 8px 8px 0; }

.side-button.right { right: 0; border-radius: 8px 0 0 8px; }

.side-button:hover { background-color: #a00000; }

.series-dropdown-container { display: flex; justify-content: flex-start; align-items: flex-start; margin: 1rem 0; }

.series-dropdown-container label { margin-right: 0.5rem; }

.series-dropdown-container .nav-button.dropdown { max-width: 200px; }

.filter-section,
#top_tags_section,
#top_categories_section,
#category_tags_section,
#assigned_tags_section {
  background-color: #f1f1f1;
  border-left: 4px solid #c00000;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.filter-section h2,
#top_tags_section h2,
#top_categories_section h2,
#category_tags_section h2,
#assigned_tags_section h2 {
  margin-top: 0;
  color: #c00000;
  font-size: 18px;
}

#top_tags_section a,
#top_categories_section a,
#category_tags_section a {
  display: inline-block;
  background-color: #1a1a1a;
  color: white;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

#top_tags_section a:hover,
#top_categories_section a:hover,
#category_tags_section a:hover {
  background-color: #c00000;
}

.assigned-tag {
  display: inline-block;
  background-color: #c00000;
  color: white;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border-radius: 20px;
  font-size: 14px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.assigned-tag:hover {
  background-color: #8f0000;
  color: #ffffff;
}

.assigned-tag-button { border: none; font: inherit; line-height: inherit; text-align: left; }

.assigned-tag.newly-added:hover { background-color: #a00000; }

.zoom-container {
  width: 768px;
  margin: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.zoom-container video { width: 100%; max-width: 768px; height: auto; display: block; }

#zoom-frame { width: 768px; position: relative; overflow: hidden; }

#tiny-img { width: 768px; display: block; position: relative; z-index: 1; }

#original-img {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  cursor: grab;
}

#zoom-lens {
  position: absolute;
  border: 2px solid #c00000;
  width: 100px;
  height: 100px;
  pointer-events: none;
  display: none;
}

#zoom-result {
  overflow: hidden;
  width: 400px;
  height: 400px;
  border: 1px solid #ccc;
  position: relative;
}

#zoom-result img { position: absolute; top: 0; left: 0; }

@media (max-width: 768px) {
  .container { padding: 20px; }

  .nav-button { padding: 10px; font-size: 14px; }

  .score, .username { font-size: 14px; }

  .meta-group { flex-direction: column; }

  .side-button { display: none; }

  .zoom-container,
  #zoom-frame,
  #tiny-img {
    width: 100%;
    max-width: 768px;
  }
}

body { padding-bottom: 1px; box-sizing: border-box; }

.container { border: 1px solid #e0e0e0; }

.gallery-container,
.gallery-page-layout > .gallery-container {
  border: 1px solid #e0e0e0;
  box-sizing: border-box;
}

.gallery-stats-relations-shell.gallery-stats-subpanel.is-active { overflow-y: auto; }

.gallery-stats-relations-cockpit { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.gallery-stats-relations-card-grid { margin-bottom: 0; }

.gallery-stats-relation-summary-card { display: flex; flex-direction: column; gap: 6px; }

.gallery-stats-relation-summary-hint { font-size: 0.84em; opacity: 0.78; line-height: 1.35; }

.gallery-stats-relations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; align-items: start; }

.gallery-stats-relation-block { display: flex; flex-direction: column; gap: 12px; }

.gallery-stats-relation-list { display: flex; flex-direction: column; gap: 10px; }

.gallery-stats-relation-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  color: #1a1a1a;
  text-decoration: none;
}

.gallery-stats-relation-item:hover { color: #c00000; background: rgba(255,255,255,0.74); }

.gallery-stats-relation-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.gallery-stats-relation-arrow { flex: 0 0 auto; opacity: 0.62; }

.gallery-stats-relation-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.88em;
  opacity: 0.82;
}

@media (max-width: 900px) {
  .gallery-stats-relations-grid { grid-template-columns: 1fr; }
}

.gallery-stats-quality-deep-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin: 14px 0;
}

.gallery-stats-quality-deep-card { display: flex; flex-direction: column; gap: 12px; }

.gallery-stats-quality-status-list,
.gallery-stats-quality-field-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-stats-quality-status-row,
.gallery-stats-quality-field-type-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
}

.gallery-stats-quality-status-title { font-weight: 700; color: #1a1a1a; text-decoration: none; }

.gallery-stats-quality-status-title:hover { color: #c00000; }

.gallery-stats-quality-status-metrics { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 0.86em; }

.gallery-stats-quality-status-metrics a { color: #1a1a1a; text-decoration: none; }

.gallery-stats-quality-status-metrics a:hover { color: #c00000; }

.gallery-stats-quality-status-bars {
  display: flex;
  gap: 4px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0,0,0,0.09);
}

.gallery-stats-quality-status-bar { display: block; min-width: 2px; }

.gallery-stats-quality-status-bar.is-missing { background: rgba(192, 0, 0, 0.42); }

.gallery-stats-quality-status-bar.is-critical { background: rgba(192, 0, 0, 0.72); }

.gallery-stats-quality-status-bar.is-complete { background: rgba(40, 120, 60, 0.45); }

.gallery-stats-quality-field-type-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9em; }

.gallery-stats-quality-field-type-head span { opacity: 0.72; }

.gallery-stats-quality-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }

.gallery-stats-quality-field-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  padding: 8px 9px;
  border-radius: 8px;
  color: #1a1a1a;
  text-decoration: none;
  background: rgba(255,255,255,0.62);
}

.gallery-stats-quality-field-chip:hover { color: #c00000; background: rgba(255,255,255,0.78); }

.gallery-stats-quality-field-chip em { grid-column: 1 / -1; font-style: normal; font-size: 0.82em; opacity: 0.68; }

@media (max-width: 1000px) {
  .gallery-stats-quality-deep-grid { grid-template-columns: 1fr; }
}

.workspace-context-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.42);
  border: 1px solid rgba(0,0,0,0.08);
  margin: 10px 0 12px;
}

.workspace-context-main,
.workspace-active-filter-strip,
.workspace-active-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-pill,
.workspace-active-filter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  color: #1a1a1a;
  font-size: 0.86em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workspace-context-pill { font-weight: 700; }

.workspace-active-filter-strip.is-empty { opacity: 0.76; }

.workspace-active-filter-label { font-size: 0.86em; font-weight: 700; }

.workspace-filter-reset-link {
  margin-left: auto;
  color: #c00000;
  font-size: 0.86em;
  font-weight: 700;
  text-decoration: none;
}

.workspace-filter-reset-link:hover { text-decoration: underline; }

.workspace-control-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }

.workspace-control-card { background: rgba(255,255,255,0.48); border: 1px solid rgba(0,0,0,0.08); }

.workspace-control-head h3 { margin: 0; }

.workspace-control-head p { font-size: 0.84em; opacity: 0.74; }

.workspace-compact-toolbar,
.workspace-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.workspace-compact-toolbar { flex-direction: column; align-items: stretch; }

.workspace-compact-row label { font-weight: 600; }

.workspace-grow-field { flex: 1 1 220px; min-width: 180px; }

.workspace-filter-details { margin: 12px 0; border-radius: 10px; background: rgba(255,255,255,0.36); border: 1px solid rgba(0,0,0,0.08); }

.workspace-filter-details summary { cursor: pointer; padding: 10px 12px; font-weight: 700; user-select: none; }

.workspace-filter-technical-grid { display: grid; grid-template-columns: max-content minmax(120px, 1fr) max-content minmax(120px, 1fr); gap: 8px 10px; align-items: center; }

.workspace-filter-date-grid { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 1000px) {
  .workspace-control-grid { grid-template-columns: 1fr; }

  .workspace-filter-reset-link { margin-left: 0; }
}

@media (max-width: 760px) {
  .workspace-filter-technical-grid { grid-template-columns: 1fr; }
}

#filter_form { width: 100%; }

.workspace-context-strip,
.workspace-form-card,
.workspace-control-grid {
  width: 100%;
  box-sizing: border-box;
}

.workspace-control-details-body { padding-top: 0; }

.workspace-form-card { margin-left: 0; margin-right: 0; }

.workspace-filter-details.workspace-form-card[open] { background: rgba(255,255,255,0.48); }

.workspace-filter-text-card { display: flex; flex-direction: column; gap: 8px; }

.workspace-filter-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.workspace-filter-inline label { font-weight: 600; }

.workspace-filter-inline input[type="text"] { min-width: 240px; max-width: 420px; }

.workspace-dropdown-details .filter-field-columns { margin-top: 0; }

.workspace-dropdown-details .filter-form-block { padding: 8px 0; }

.workspace-dropdown-details .filter-chip-box { margin-top: 8px; }

.workspace-control-card { min-width: 0; }

.workspace-control-grid { margin-bottom: 0; }

@media (max-width: 760px) {
  .workspace-filter-inline { align-items: stretch; }

  .workspace-filter-inline input[type="text"] { width: 100%; min-width: 0; max-width: none; }
}

.workspace-body .filter-section,
.workspace-body .bulk-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.workspace-body .filter-section > .section-collapsible-body,
.workspace-body .bulk-section > .section-collapsible-body {
  width: 100%;
  box-sizing: border-box;
}

.workspace-body .workspace-form-card,
.workspace-body .workspace-control-grid,
.workspace-body .bulk-controls,
.workspace-body .bulk-options,
.workspace-body #rollback_form {
  width: 100%;
  box-sizing: border-box;
}

.workspace-quick-filter-details .workspace-filter-details-body { padding-top: 0; }

.workspace-quick-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 10px 14px; align-items: start; }

.workspace-quick-filter-field { display: grid; grid-template-columns: 1fr; gap: 5px; min-width: 0; }

.workspace-quick-filter-field label { font-size: 0.88em; font-weight: 700; line-height: 1.2; }

.workspace-quick-filter-field input[type="text"],
.workspace-quick-filter-field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.workspace-quick-filter-title { grid-column: span 2; }

.workspace-quick-chip-box { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 5px; }

.workspace-quick-chip-box:empty { display: none; }

.workspace-quick-filter-field .assigned-tag { margin: 0; padding: 5px 8px; font-size: 0.82em; line-height: 1.15; }

.workspace-quick-checkbox { margin-top: 2px; font-size: 0.82em !important; font-weight: 500 !important; }

.workspace-quick-checkbox input { margin: 0; }

.workspace-dropdown-details { display: none; }

@media (max-width: 1300px) {
  .workspace-quick-filter-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }

  .workspace-quick-filter-title { grid-column: span 3; }
}

@media (max-width: 900px) {
  .workspace-quick-filter-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }

  .workspace-quick-filter-title { grid-column: span 2; }
}

@media (max-width: 620px) {
  .workspace-quick-filter-grid { grid-template-columns: 1fr; }

  .workspace-quick-filter-title { grid-column: span 1; }
}

.workspace-context-strip-compact { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }

.workspace-context-strip-compact .workspace-context-main { flex: 0 0 auto; }

.workspace-context-strip-compact .workspace-active-filter-strip { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }

.workspace-context-strip-compact .workspace-active-filter-chips { justify-content: flex-end; min-width: 0; }

.workspace-context-strip-compact .workspace-filter-reset-link { margin-left: 6px; }

.workspace-active-filter-chip { gap: 4px; }

.workspace-advanced-filter-grid { padding-top: 0; }

.workspace-inner-filter-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 9px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(0,0,0,0.07);
}

.workspace-inner-filter-card h3 { margin: 0; font-size: 0.96em; }

.workspace-filter-technical-grid-compact { grid-template-columns: max-content minmax(90px, 1fr) max-content minmax(90px, 1fr); gap: 7px 9px; }

.workspace-date-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.workspace-date-mini-card { grid-template-columns: max-content minmax(120px, 1fr); align-items: center; min-width: 0; }

.workspace-date-mini-card strong { grid-column: 1 / -1; }

.workspace-date-mini-card input { width: 100%; min-width: 0; box-sizing: border-box; }

.project-bulk-details { margin: 10px 0 12px; }

.project-bulk-details-body { display: flex; flex-direction: column; gap: 10px; }

.project-option-toggle { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }

.project-bulk-details .project-inline-row { margin-top: 8px !important; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .workspace-context-strip-compact { flex-direction: column; align-items: stretch; }

  .workspace-context-strip-compact .workspace-active-filter-strip,
  .workspace-context-strip-compact .workspace-active-filter-chips {
    justify-content: flex-start;
  }

  .workspace-advanced-filter-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .workspace-filter-technical-grid-compact,
  .workspace-date-mini-card {
    grid-template-columns: 1fr;
  }

  .workspace-date-card-grid { grid-template-columns: 1fr; }
}

.workspace-context-strip-compact { padding: 5px 9px; margin: 6px 0 8px; min-height: 0; }

.workspace-context-strip-compact .workspace-pill,
.workspace-context-strip-compact .workspace-active-filter-chip {
  padding: 2px 7px;
  font-size: 0.82em;
}

.workspace-filter-details.workspace-form-card { border-radius: 9px; background: rgba(255,255,255,0.46); border: 1px solid rgba(0,0,0,0.08); margin: 8px 0; }

.workspace-filter-details.workspace-form-card > summary { font-size: 0.96em; line-height: 1.2; }

.workspace-control-grid { gap: 10px; }

.workspace-control-card { padding: 10px; border-radius: 9px; }

.workspace-control-head h3 { font-size: 0.96em; }

.workspace-control-head p { margin: 2px 0 7px; line-height: 1.25; }

.workspace-compact-toolbar { gap: 7px; }

.workspace-compact-row { gap: 7px; }

.workspace-control-status { margin-top: 6px; }

.workspace-basic-filter-main,
.workspace-basic-filter-side {
  min-height: 0;
}

.workspace-basic-title-row,
.workspace-basic-wide-field,
.workspace-basic-side-field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-width: 0;
}

.workspace-wide-chip-box { min-height: 0; }

.workspace-wide-chip-box .assigned-tag { margin: 0; }

.workspace-date-card-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.workspace-date-mini-card { display: flex; flex-direction: column; gap: 7px; }

.project-bulk-details-body { padding-top: 0; }

.workspace-project-filter-layout { display: grid; grid-template-columns: minmax(360px, 0.82fr) minmax(460px, 1.18fr); gap: 10px; align-items: start; }

.workspace-project-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; align-items: start; }

.workspace-project-field { display: grid; grid-template-columns: 1fr; gap: 5px; min-width: 0; }

.workspace-project-field select,
.workspace-project-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.project-bulk-details .project-helper-text { margin-top: 8px !important; }

.project-bulk-details .project-chip-wrap { margin-top: 2px; }

.project-bulk-box { background: transparent; border: 0; padding: 0; }

@media (max-width: 1200px) {
  .workspace-basic-filter-layout,
  .workspace-advanced-filter-grid,
  .workspace-project-filter-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .workspace-basic-side-grid,
  .workspace-date-card-grid-compact,
  .workspace-project-grid {
    grid-template-columns: 1fr;
  }

  .workspace-tech-compact-grid,
  .workspace-date-line {
    grid-template-columns: 1fr;
  }
}

.workspace-basic-filter-main,
.workspace-basic-filter-side,
.workspace-tech-card,
.workspace-date-card {
  min-width: 0;
}

.workspace-basic-title-row { display: grid !important; grid-template-columns: 1fr !important; gap: 5px !important; margin-bottom: 9px; }

.workspace-basic-wide-field,
.workspace-basic-side-field {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 5px !important;
  min-width: 0;
}

.workspace-basic-title-row input,
.workspace-basic-wide-field select,
.workspace-basic-side-field select,
.workspace-basic-side-field input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.workspace-wide-chip-box,
.workspace-quick-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
}

.workspace-wide-chip-box:empty,
.workspace-quick-chip-box:empty {
  display: none;
}

.workspace-wide-chip-box .assigned-tag,
.workspace-quick-chip-box .assigned-tag {
  margin: 0;
  padding: 5px 8px;
  font-size: 0.82em;
  line-height: 1.15;
}

.workspace-basic-side-grid { display: grid !important; grid-template-columns: repeat(2, minmax(180px, 1fr)) !important; gap: 10px !important; align-items: start !important; }

.workspace-quick-checkbox {
  justify-self: start;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  line-height: 1.15 !important;
}

.workspace-filter-details.workspace-form-card > summary { padding: 7px 10px !important; }

.workspace-filter-details-body { padding: 0 10px 9px !important; }

.workspace-inner-filter-card { padding: 9px 10px !important; gap: 8px !important; }

@media (max-width: 900px) {
  .workspace-tech-compact-grid,
  .workspace-date-line {
    grid-template-columns: 1fr !important;
  }
}

.workspace-body .filter-section.is-active > .section-collapsible-body,
.workspace-body .bulk-section.is-active > .section-collapsible-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.workspace-body .filter-section.is-active > .section-toggle-row,
.workspace-body .bulk-section.is-active > .section-toggle-row {
  flex: 0 0 auto;
}

.workspace-basic-filter-layout { display: grid !important; grid-template-columns: minmax(620px, 1.22fr) minmax(380px, 0.78fr) !important; gap: 10px !important; align-items: start !important; }

.workspace-main-filter-grid { display: grid !important; grid-template-columns: repeat(2, minmax(260px, 1fr)) !important; gap: 10px !important; align-items: start !important; }

.workspace-urheber-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.workspace-urheber-row select { width: 100%; min-width: 0; box-sizing: border-box; }

.workspace-urheber-or-checkbox { white-space: nowrap; min-width: 0; margin: 0 !important; align-self: center; }

.workspace-advanced-filter-grid { display: grid !important; grid-template-columns: minmax(360px, 0.55fr) minmax(640px, 1.45fr) !important; gap: 10px !important; align-items: start !important; }

.workspace-date-card { gap: 7px !important; }

.workspace-date-columns { display: grid !important; grid-template-columns: repeat(2, minmax(280px, 1fr)) !important; gap: 12px !important; align-items: start !important; }

.workspace-date-group { display: flex !important; flex-direction: column !important; gap: 7px !important; min-width: 0 !important; }

.workspace-date-group strong { display: block; font-weight: 700; margin-bottom: 1px; }

.workspace-date-line { display: grid !important; grid-template-columns: max-content minmax(145px, 1fr) minmax(88px, 0.55fr) !important; gap: 7px !important; align-items: center !important; }

.workspace-date-line input { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }

.workspace-tech-compact-grid {
  display: grid !important;
  grid-template-columns: max-content minmax(110px, 1fr) max-content minmax(110px, 1fr) !important;
  gap: 7px 9px !important;
  align-items: center !important;
}

.workspace-tech-compact-grid input { width: 100% !important; min-width: 0 !important; max-width: none !important; box-sizing: border-box !important; }

.gallery-stats-details-shell .gallery-stats-detail-table-frame { display: flex; flex-direction: column; }

.gallery-stats-details-shell .gallery-stats-detail-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; box-sizing: border-box; }

@media (max-width: 1250px) {
  .workspace-basic-filter-layout,
  .workspace-advanced-filter-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .workspace-main-filter-grid,
  .workspace-basic-side-grid,
  .workspace-date-columns {
    grid-template-columns: 1fr !important;
  }

  .workspace-tech-compact-grid,
  .workspace-date-line,
  .workspace-urheber-row {
    grid-template-columns: 1fr !important;
  }
}

.workspace-body .filter-section.is-active,
.workspace-body .bulk-section.is-active {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  max-height: 41vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.workspace-body .filter-section.is-active > #filter-body,
.workspace-body .bulk-section.is-active > #batch-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#filter_form {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  max-height: calc(41vh - 8px) !important;
  box-sizing: border-box !important;
}

#filter_form .filter-scroll-area { flex: 1 1 auto !important; min-height: 0 !important; }

#filter_form .filter-buttons { flex: 0 0 auto !important; background: #f1f1f1 !important; }

#filter_form .filter-scroll-area:has(details:not([open])) { min-height: 0 !important; }

.workspace-body .bulk-section.is-active > #batch-body { overflow-y: auto !important; overflow-x: hidden !important; padding-right: 6px !important; scrollbar-gutter: stable; }

.workspace-body .workspace-panel.is-active { margin-bottom: 0 !important; }

.workspace-body .filter-section.is-active { padding-bottom: 8px !important; }

.workspace-toggle-row { margin-top: 0 !important; }

.section-toggle-row.workspace-toggle-row { margin-top: 0 !important; }

:root { --filter-fixed-footer-space: 51px; }

.workspace-body .filter-section.is-active { height: auto !important; max-height: var(--workspace-panel-max-height) !important; min-height: 0 !important; overflow: hidden !important; }

.workspace-body .filter-section.is-active > #filter-body,
#filter_form {
  height: auto !important;
  max-height: var(--workspace-panel-max-height) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#filter_form .filter-scroll-area {
  max-height: calc(var(--workspace-panel-max-height) - var(--filter-fixed-footer-space)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 6px !important;
  scrollbar-gutter: stable;
  box-sizing: border-box !important;
}

#filter_form .filter-buttons { margin-top: 5px !important; padding-top: 3px !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }

.section-toggle-row.workspace-toggle-row,
.workspace-toggle-row {
  margin-top: 0 !important;
}

.gallery-view-settings-panel {
  background: transparent;
  border-left: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.gallery-view-settings-grid { display: grid; }

.gallery-view-settings-card { min-width: 0; }

.gallery-view-settings-card h3 { margin: 0; font-size: 0.98em; }

.gallery-view-settings-wide-card { grid-column: 1 / -1; }

.gallery-view-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 8px 12px; margin-top: 10px; }

.gallery-view-checkbox-grid label,
.gallery-view-radio-list label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
}

.gallery-view-radio-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.tile-compact-info { display: none; }

.gallery-grid.tile-info-collapsed .tile-compact-info { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }

.tile-compact-row {
  display: none;
  align-items: baseline;
  gap: 6px;
  font-size: 0.9em;
  line-height: 1.25;
  word-break: break-word;
}

.tile-compact-row strong { flex: 0 0 auto; }

.tile-compact-row span { min-width: 0; }

.gallery-grid.tile-info-collapsed.view-compact-title .tile-compact-row[data-compact-field="title"],
.gallery-grid.tile-info-collapsed.view-compact-status .tile-compact-row[data-compact-field="status"],
.gallery-grid.tile-info-collapsed.view-compact-tags .tile-compact-row[data-compact-field="tags"],
.gallery-grid.tile-info-collapsed.view-compact-categories .tile-compact-row[data-compact-field="categories"],
.gallery-grid.tile-info-collapsed.view-compact-freigaben .tile-compact-row[data-compact-field="freigaben"],
.gallery-grid.tile-info-collapsed.view-compact-urheber .tile-compact-row[data-compact-field="urheber"],
.gallery-grid.tile-info-collapsed.view-compact-series .tile-compact-row[data-compact-field="series"],
.gallery-grid.tile-info-collapsed.view-compact-last_editor .tile-compact-row[data-compact-field="last_editor"] {
  display: flex;
}

.gallery-grid[data-thumbnail-action="select"] .tile-thumb-link { cursor: pointer; }

.gallery-grid[data-thumbnail-action="edit"] .tile-thumb-link { cursor: zoom-in; }

@media (max-width: 900px) {
  .gallery-view-settings-grid,
  .gallery-view-checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-thumb,
.tile-thumb,
.tile-thumb-link {
  background: transparent !important;
}

.gallery-grid[data-thumbnail-action="edit"] .tile-thumb-link,
.gallery-grid[data-thumbnail-action="select"] .tile-thumb-link,
.gallery-grid[data-thumbnail-action="original"] .tile-thumb-link {
  cursor: pointer !important;
}

.gallery-grid.tile-info-collapsed.view-compact-bearbeitungsstand .tile-compact-row[data-compact-field="bearbeitungsstand"],
.gallery-grid.tile-info-collapsed.view-compact-size .tile-compact-row[data-compact-field="size"],
.gallery-grid.tile-info-collapsed.view-compact-dimensions .tile-compact-row[data-compact-field="dimensions"],
.gallery-grid.tile-info-collapsed.view-compact-dpi_fps .tile-compact-row[data-compact-field="dpi_fps"],
.gallery-grid.tile-info-collapsed.view-compact-created .tile-compact-row[data-compact-field="created"],
.gallery-grid.tile-info-collapsed.view-compact-modified .tile-compact-row[data-compact-field="modified"],
.gallery-grid.tile-info-collapsed.view-compact-copyright .tile-compact-row[data-compact-field="copyright"] {
  display: flex;
}

.gallery-grid.tile-info-collapsed.view-compact-status .tile-compact-row[data-compact-field="bearbeitungsstand"] { display: flex; }

.gallery-stats-details-shell .gallery-stats-detail-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px 12px !important;
  align-items: end !important;
}

.gallery-stats-details-shell .gallery-stats-detail-toolbar-row { grid-column: 1 !important; grid-row: 1 !important; }

.gallery-stats-details-shell .gallery-stats-detail-summary { grid-column: 1 / -1 !important; grid-row: 2 !important; }

.gallery-stats-details-shell .gallery-pagination {
  grid-column: 2 !important;
  grid-row: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  align-self: end !important;
}

.gallery-stats-details-shell .gallery-pagination-meta { display: none !important; }

.gallery-stats-details-shell .gallery-pagination-controls { justify-content: flex-end !important; }

.gallery-stats-details-shell .gallery-stats-detail-table-wrap { padding-bottom: 12px !important; }

@media (max-width: 1100px) {
  .gallery-stats-details-shell .gallery-stats-detail-toolbar { display: flex !important; flex-direction: column !important; align-items: stretch !important; }

  .gallery-stats-details-shell .gallery-pagination { align-self: stretch !important; }

  .gallery-stats-details-shell .gallery-pagination-controls { justify-content: flex-start !important; }
}

.gallery-view-layout-options { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.10); }

.gallery-view-layout-options h3 { margin: 0 0 8px; font-size: 0.96em; }

.gallery-grid.tile-compact-layout-inline .tile-compact-row { gap: 5px; }

.gallery-grid.tile-compact-layout-inline .tile-compact-row strong { flex: 0 0 auto; min-width: 0; }

.gallery-grid.tile-compact-layout-aligned .tile-compact-row { display: grid !important; grid-template-columns: minmax(92px, 0.44fr) minmax(0, 1fr); gap: 8px; align-items: baseline; }

.gallery-grid.tile-compact-layout-aligned .tile-compact-row strong,
.gallery-grid.tile-compact-layout-aligned .tile-compact-row span {
  min-width: 0;
}

.project-note-action-row { gap: 12px; }

.project-note-action-hint { justify-self: start; }

.project-notes-list.is-collapsed { display: none !important; }

.gallery-item.selected { background-color: rgba(20,20,120,0.20); }

@media (max-width: 760px) {
  .project-note-action-row { grid-template-columns: 1fr; }

  .project-notes-list-toggle,
  .project-note-action-row #save-project-note-btn,
  .project-note-action-hint {
    justify-self: start;
  }
}

.gallery-grid.tile-info-collapsed .tile-compact-row { display: none !important; }

.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-title .tile-compact-row[data-compact-field="title"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-bearbeitungsstand .tile-compact-row[data-compact-field="bearbeitungsstand"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-tags .tile-compact-row[data-compact-field="tags"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-categories .tile-compact-row[data-compact-field="categories"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-freigaben .tile-compact-row[data-compact-field="freigaben"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-urheber .tile-compact-row[data-compact-field="urheber"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-series .tile-compact-row[data-compact-field="series"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-last_editor .tile-compact-row[data-compact-field="last_editor"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-size .tile-compact-row[data-compact-field="size"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-dimensions .tile-compact-row[data-compact-field="dimensions"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-dpi_fps .tile-compact-row[data-compact-field="dpi_fps"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-created .tile-compact-row[data-compact-field="created"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-modified .tile-compact-row[data-compact-field="modified"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-inline.view-compact-copyright .tile-compact-row[data-compact-field="copyright"] {
  display: flex !important;
}

.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-title .tile-compact-row[data-compact-field="title"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-bearbeitungsstand .tile-compact-row[data-compact-field="bearbeitungsstand"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-tags .tile-compact-row[data-compact-field="tags"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-categories .tile-compact-row[data-compact-field="categories"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-freigaben .tile-compact-row[data-compact-field="freigaben"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-urheber .tile-compact-row[data-compact-field="urheber"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-series .tile-compact-row[data-compact-field="series"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-last_editor .tile-compact-row[data-compact-field="last_editor"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-size .tile-compact-row[data-compact-field="size"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-dimensions .tile-compact-row[data-compact-field="dimensions"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-dpi_fps .tile-compact-row[data-compact-field="dpi_fps"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-created .tile-compact-row[data-compact-field="created"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-modified .tile-compact-row[data-compact-field="modified"],
.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-copyright .tile-compact-row[data-compact-field="copyright"] {
  display: grid !important;
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.tile-thumb-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 160px;
  padding: 6px;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  background: transparent !important;
  cursor: pointer !important;
}

.tile-thumb-link:hover { border-color: rgba(192,0,0,0.38); }

.tile-thumb-link .gallery-thumb,
.gallery-thumb {
  background: transparent !important;
}

.project-note-action-row {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  width: 100% !important;
  max-width: none !important;
  align-items: center !important;
}

.project-note-action-row #save-project-note-btn { justify-self: start !important; }

.project-notes-list-toggle { justify-self: center !important; }

.project-note-action-hint { display: none !important; }

.gallery-view-settings-panel.is-active {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  max-height: var(--workspace-panel-max-height, 42vh) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.gallery-view-settings-panel.is-active .gallery-view-settings-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 6px;
  box-sizing: border-box;
}

.gallery-view-settings-grid { grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr) !important; gap: 10px !important; align-items: start !important; }

.gallery-view-click-card { display: flex; flex-direction: column; gap: 10px; }

.gallery-view-inline-hint { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.10); }

.gallery-view-inline-hint h3 { margin: 0 0 6px; font-size: 0.96em; }

.gallery-view-inline-hint .project-helper-text { margin-bottom: 8px; }

.gallery-view-settings-wide-card { display: none !important; }

@media (max-width: 900px) {
  .gallery-view-settings-grid { grid-template-columns: 1fr !important; }

  .gallery-view-settings-panel.is-active { max-height: none !important; overflow: visible !important; }

  .gallery-view-settings-panel.is-active .gallery-view-settings-grid { overflow: visible; padding-right: 0; }
}

.project-notes-list-toggle { transform: translateX(3px) !important; }

.saved-filter-compact-card .saved-filter-toolbar,
.saved-filter-compact-card .workspace-compact-toolbar {
  gap: 3px !important;
}

.saved-filter-compact-card .saved-filter-row,
.saved-filter-compact-card .workspace-compact-row {
  margin: 0 !important;
  row-gap: 4px !important;
  column-gap: 7px !important;
}

.saved-filter-compact-card .workspace-control-status { margin-top: 5px !important; }

.saved-filter-compact-card .saved-filter-toolbar.workspace-compact-toolbar { gap: 4px !important; }

.saved-filter-compact-card .saved-filter-row.workspace-compact-row {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 6px !important;
  align-items: center !important;
}

.saved-filter-compact-card .saved-filter-row.workspace-compact-row + .saved-filter-row.workspace-compact-row { margin-top: -30px !important; }

.saved-filter-compact-card .saved-filter-row label { line-height: 1.15 !important; }

.saved-filter-compact-card .workspace-control-head p { margin-bottom: 4px !important; }

.saved-filter-compact-card #saved-filter-status { margin-top: 4px !important; }

.edit-history-section { max-width: none !important; }

.edit-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.edit-history-subline { font-size: 0.9em; opacity: 0.78; line-height: 1.35; }

.edit-history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.9em;
}

.edit-history-toggle input { width: auto !important; margin: 0 !important; }

.edit-history-table-wrap {
  max-height: 380px !important;
  overflow: auto !important;
  border: 1px solid #d6d6d6 !important;
  border-radius: 10px !important;
  background: #fff !important;
}

.edit-history-table { border-collapse: separate !important; border-spacing: 0 !important; font-size: 0.9rem !important; }

.edit-history-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
  background: #ececec !important;
  color: #1a1a1a !important;
  text-align: left !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #cfcfcf !important;
  white-space: nowrap !important;
}

.edit-history-table tbody td {
  padding: 8px 10px !important;
  border-bottom: 1px solid #ececec !important;
  vertical-align: top !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  background: #fff;
}

.edit-history-table tbody tr:nth-child(even) td { background: #fafafa; }

.edit-history-table tbody tr:hover td { background: #f2f2f2; }

.edit-history-table .hist-col-date { position: sticky !important; z-index: 3 !important; }

.edit-history-table .hist-col-user { position: sticky !important; z-index: 3 !important; }

.edit-history-table thead .hist-col-date,
.edit-history-table thead .hist-col-user {
  z-index: 5 !important;
}

@media (max-width: 900px) {
  .edit-history-head { flex-direction: column; align-items: stretch; }

  .edit-history-toggle { white-space: normal; }

  .edit-history-table-wrap { max-height: 300px !important; }
}

.edit-history-table { width: max-content !important; min-width: 100% !important; table-layout: auto !important; }

.edit-history-table thead th,
.edit-history-table tbody td {
  white-space: normal !important;
}

.edit-history-table .hist-col-date { left: 0 !important; white-space: nowrap !important; }

.edit-history-table .hist-col-title {
  width: 430px !important;
  min-width: 360px !important;
  max-width: 560px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.edit-history-table .hist-col-dpi { width: 105px !important; min-width: 95px !important; max-width: 125px !important; white-space: nowrap !important; }

.edit-history-table .hist-col-status { width: 125px !important; min-width: 115px !important; max-width: 145px !important; white-space: nowrap !important; }

.edit-history-table .hist-col-copyright {
  width: auto !important;
  min-width: 180px !important;
  max-width: 360px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.edit-history-table .hist-col-tags,
.edit-history-table .hist-col-categories {
  width: 300px !important;
  min-width: 220px !important;
  max-width: 340px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.edit-history-table .hist-col-people,
.edit-history-table .hist-col-release,
.edit-history-table .hist-col-series {
  width: auto !important;
  min-width: 170px !important;
  max-width: 320px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.edit-history-table thead .hist-col-date,
.edit-history-table thead .hist-col-user {
  background: #e3e3e3 !important;
}

.edit-history-table tbody .hist-col-date,
.edit-history-table tbody .hist-col-user {
  background: #fff !important;
}

.edit-history-table tbody tr:nth-child(even) .hist-col-date,
.edit-history-table tbody tr:nth-child(even) .hist-col-user {
  background: #f4f4f4 !important;
}

.edit-history-table tbody tr:hover .hist-col-date,
.edit-history-table tbody tr:hover .hist-col-user {
  background: #eeeeee !important;
}

.edit-history-table .hist-col-user {
  width: var(--history-user-col-width, 92px) !important;
  min-width: var(--history-user-col-width, 92px) !important;
  max-width: var(--history-user-col-width, 92px) !important;
  left: var(--history-date-col-width, 152px) !important;
  white-space: nowrap !important;
}

.edit-history-table .hist-col-date,
.edit-history-table .hist-col-user {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.edit-history-table .hist-col-date {
  width: var(--history-date-col-width, 152px) !important;
  min-width: var(--history-date-col-width, 152px) !important;
  max-width: var(--history-date-col-width, 152px) !important;
}

.gallery-stats-counts-shell.gallery-stats-subpanel.is-active { padding-right: 6px; }

.gallery-stats-counts-cockpit { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.gallery-stats-counts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }

.gallery-stats-count-block { display: flex; flex-direction: column; gap: 12px; }

.gallery-stats-count-list { display: flex; flex-direction: column; gap: 9px; }

.gallery-stats-count-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  color: #1a1a1a;
  text-decoration: none;
}

.gallery-stats-count-row:hover { background: rgba(255,255,255,0.75); color: #c00000; }

.gallery-stats-count-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }

.gallery-stats-count-row-head span { opacity: 0.78; white-space: nowrap; }

.gallery-stats-count-matrix-card { display: flex; flex-direction: column; gap: 12px; }

.gallery-stats-count-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }

.gallery-stats-count-matrix-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  color: #1a1a1a;
  text-decoration: none;
}

.gallery-stats-count-matrix-cell:hover { background: rgba(255,255,255,0.75); color: #c00000; }

.gallery-stats-count-matrix-cell span { font-weight: 600; }

.gallery-stats-count-matrix-cell strong { font-size: 1.08em; }

.gallery-stats-mini-thumb {
  width: 58px !important;
  height: 42px !important;
  max-height: 42px !important;
  object-fit: contain !important;
  border-radius: 4px !important;
  background: transparent !important;
}

.gallery-stats-thumb-open-btn { border: 1px solid rgba(0,0,0,0.12) !important; background: rgba(255,255,255,0.55) !important; border-radius: 5px !important; padding: 3px !important; }

.gallery-stats-thumb-open-btn:hover { border-color: rgba(192,0,0,0.42) !important; }

.gallery-stats-thumb-preview {
  position: fixed;
  z-index: 99999;
  display: none;
  width: 280px;
  max-width: 34vw;
  max-height: 280px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.22);
  background: #f8f8f8;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
  pointer-events: none;
  box-sizing: border-box;
}

.gallery-stats-thumb-preview.is-visible { display: flex; align-items: center; justify-content: center; }

.gallery-stats-thumb-preview img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .gallery-stats-counts-grid,
  .gallery-stats-count-matrix {
    grid-template-columns: 1fr;
  }

  .gallery-stats-thumb-preview { display: none !important; }
}

.gallery-stats-counts-shell.gallery-stats-subpanel.is-active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 6px 74px 0 !important;
  box-sizing: border-box !important;
  scrollbar-gutter: stable;
}

.gallery-stats-counts-cockpit { padding-bottom: 18px !important; }

.gallery-stats-count-matrix-card { margin-bottom: 42px !important; }

.gallery-stats-count-matrix { align-content: start !important; padding-bottom: 18px !important; }

.gallery-stats-count-matrix-cell { min-height: 72px !important; box-sizing: border-box !important; }

.gallery-stats-count-combo-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 56px !important; }

.gallery-stats-count-combo-form { display: block; }

.gallery-stats-count-combo-controls { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)) auto; gap: 9px; align-items: end; }

.gallery-stats-count-combo-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-weight: 700;
  font-size: 0.9em;
}

.gallery-stats-count-combo-controls select { width: 100%; min-width: 0; box-sizing: border-box; }

.gallery-stats-count-combo-submit { white-space: nowrap; align-self: end; }

.gallery-stats-count-combo-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; align-items: start; }

.gallery-stats-count-combo-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 72px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  color: #1a1a1a;
  text-decoration: none;
  box-sizing: border-box;
}

.gallery-stats-count-combo-row:hover { background: rgba(255,255,255,0.75); color: #c00000; }

.gallery-stats-count-combo-row span { font-weight: 700; line-height: 1.25; }

.gallery-stats-count-combo-row strong { font-size: 1.08em; }

@media (max-width: 1350px) {
  .gallery-stats-count-combo-controls { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}

@media (max-width: 900px) {
  .gallery-stats-count-combo-controls,
  .gallery-stats-count-combo-results {
    grid-template-columns: 1fr;
  }

  .gallery-stats-count-combo-submit { justify-self: start; }
}

.gallery-stats-count-combo-surface {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 14px 16px 18px !important;
  margin: 0 0 82px 0 !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,0.46) !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.gallery-stats-count-combo-surface .gallery-stats-count-combo-title,
.gallery-stats-count-combo-surface .project-overview-label {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.gallery-stats-count-combo-head { padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; }

.gallery-stats-count-combo-surface .gallery-stats-count-combo-form {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.gallery-stats-count-combo-surface .gallery-stats-count-combo-controls { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }

.gallery-stats-count-combo-surface .gallery-stats-count-combo-results {
  width: 100% !important;
  min-width: 0 !important;
  margin-top: 2px !important;
  padding-bottom: 12px !important;
  box-sizing: border-box !important;
}

.gallery-stats-count-combo-surface .gallery-stats-count-combo-row { background: rgba(255,255,255,0.68) !important; border: 1px solid rgba(0,0,0,0.05) !important; }

.gallery-stats-count-combo-surface .gallery-stats-count-combo-row:hover { background: rgba(255,255,255,0.88) !important; border-color: rgba(192,0,0,0.24) !important; }

.gallery-stats-count-matrix-card:has(.gallery-stats-count-combo-controls),
.gallery-stats-count-combo-card:has(.gallery-stats-count-combo-controls) {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.project-note-reply-btn { flex: 0 0 auto; white-space: nowrap; }

.project-note-replies {
  margin-top: 12px;
  padding-left: 18px;
  border-left: 3px solid rgba(192,0,0,0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-note-reply-card { background: rgba(255,255,255,0.58) !important; border-color: rgba(0,0,0,0.08) !important; }

.project-note-reply-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  max-width: 680px;
  padding: 9px 10px;
  border: 1px solid rgba(192,0,0,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.70);
}

.project-note-reply-context[hidden] { display: none !important; }

.project-note-reply-cancel { padding: 6px 10px !important; }

.project-note-focus-highlight { outline: 3px solid rgba(192,0,0,0.45); box-shadow: 0 0 0 5px rgba(192,0,0,0.12); }

.user-info { display: flex; align-items: center; gap: 12px; }

.project-notification-box { position: relative; display: inline-flex; align-items: center; }

.project-notification-button {
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  background: #c00000;
  color: #fff;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.project-notification-button .project-notification-count-badge,
.project-notification-button #project-notification-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #c00000;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
}

.project-notification-button .orv-icon-wrap {
  margin-left: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  clip-path: none;
}

.project-notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 92vw);
  z-index: 9999;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  background: #f7f7f7;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  color: #1a1a1a;
}

.project-notification-menu[hidden] { display: none !important; }

.project-notification-menu-title { font-weight: 700; margin-bottom: 8px; }

.project-notification-list { display: flex; flex-direction: column; gap: 7px; }

.project-notification-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  text-decoration: none;
}

.project-notification-item:hover { color: #c00000; background: #fff7f7; }

.project-notification-item span,
.project-notification-item small,
.project-notification-item em {
  font-size: 0.9em;
  line-height: 1.25;
}

.project-notification-item em { font-style: normal; font-weight: 700; }

.project-notification-empty { padding: 8px; opacity: 0.75; }

@media (max-width: 760px) {
  .project-note-card-head { flex-direction: column; }

  .project-note-replies { padding-left: 10px; }

  .user-info { gap: 8px; }
}

.media-upload-container { max-width: 960px; }

.media-upload-form { display: grid; gap: 18px; }

.media-upload-card.filter-section {
  margin-bottom: 0;
  background-color: #f1f1f1 !important;
  border-left: 4px solid #c00000 !important;
  border-radius: 6px !important;
  box-shadow: inset 0 0 0 1px #d7d7d7;
}

.media-upload-card h2 { margin-top: 0; margin-bottom: 12px; color: #c00000; font-size: 18px; }

.media-upload-card p { line-height: 1.35; }

.upload-inner-panel,
.upload-mode-panel {
  background: rgba(255,255,255,0.48) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  box-sizing: border-box;
}

.upload-mode-panel h3 { margin: 0 0 10px 0; color: #c00000; font-size: 16px; }

.media-upload-file-grid,
.media-upload-mode-grid,
.upload-user-search-row,
.upload-access-grid {
  display: grid;
  gap: 14px;
}

.media-upload-file-grid,
.media-upload-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-access-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 14px; }

.upload-user-search-row { grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.8fr); align-items: start; }

.upload-field-label { display: block; margin: 9px 0 6px 0; font-weight: 700; }

.upload-input-file,
.upload-text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 1px solid #bfc3c7;
  border-radius: 3px;
  background-color: #fff;
  font: inherit;
}

.upload-input-file:focus,
.upload-text-input:focus {
  outline: 2px solid rgba(192, 0, 0, 0.2);
  border-color: #c00000;
}

.upload-select.nav-button.dropdown {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background-color: #c00000;
  color: #fff;
}

.upload-radio-tile {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(255,255,255,0.48);
  border: 1px solid rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.upload-radio-tile:has(input:checked) { border-color: rgba(192,0,0,0.60); box-shadow: inset 0 0 0 1px rgba(192,0,0,0.22); background: rgba(255,255,255,0.68); }

.upload-radio-tile strong,
.upload-radio-tile small {
  display: block;
}

.upload-radio-tile small { margin-top: 3px; color: #555; line-height: 1.25; }

.upload-restricted-panel { margin-top: 14px; }

.upload-restricted-panel.is-hidden,
.upload-mode-panel.is-hidden {
  display: none;
}

.upload-suggestion-list {
  display: grid;
  gap: 0;
  margin-top: 5px;
  border-radius: 4px;
  background-color: #1a1a1a;
  overflow: hidden;
}

.upload-suggestion-list:empty { display: none; }

.upload-suggestion-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #333;
  border-radius: 0;
  background-color: #1a1a1a;
  color: #fff;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.upload-suggestion-item:last-child { border-bottom: none; }

.upload-suggestion-item:hover { background-color: #c00000; color: #fff; }

.upload-favorite-list { display: flex; flex-wrap: wrap; gap: 0; }

.upload-favorite-button {
  display: inline-block;
  border: none;
  border-radius: 20px;
  background-color: #1a1a1a;
  color: #fff;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.15;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.upload-favorite-button:hover { background-color: #c00000; color: #fff; }

.upload-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-height: 32px;
  margin-top: 10px;
  align-items: center;
}

.upload-user-chip.assigned-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  font: inherit;
  line-height: 1.15;
  text-align: left;
}

.upload-user-chip.assigned-tag.newly-added:hover { background-color: #a00000; color: #fff; }

.upload-user-chip.assigned-tag.newly-added.is-favorite-hover,
.upload-user-chip.assigned-tag.newly-added.is-favorite-hover:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.upload-chip-name { pointer-events: none; }

.upload-chip-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.upload-chip-star:hover { transform: scale(1.08); }

.upload-project-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }

.upload-project-add-row .upload-field-label { grid-column: 1 / -1; margin-bottom: -4px; }

.upload-project-list { display: grid; gap: 7px; margin-top: 10px; }

.upload-project-row {
  display: grid;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  border: none;
  box-sizing: border-box;
}

.upload-project-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }

.upload-project-remove {
  border: none;
  border-radius: 4px;
  background-color: #c00000;
  color: #fff;
  cursor: pointer;
  padding: 5px 8px;
  font: inherit;
}

.upload-project-remove:hover { background-color: #a00000; }

.media-upload-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.upload-flash-list { display: grid; gap: 8px; margin-bottom: 16px; }

.upload-flash { padding: 10px 12px; border-radius: 6px; border: 1px solid #d4d4d4; background-color: #fff; }

.upload-flash-success { border-color: rgba(0,120,0,0.35); background-color: #f2fff2; }

.upload-flash-warning { border-color: rgba(190,130,0,0.4); background-color: #fff9e8; }

.upload-flash-danger { border-color: rgba(190,0,0,0.4); background-color: #fff1f1; }

@media (max-width: 860px) {
  .media-upload-file-grid,
  .media-upload-mode-grid,
  .upload-access-grid,
  .upload-user-search-row,
  .upload-project-add-row,
  .upload-project-row {
    grid-template-columns: 1fr;
  }

  .upload-project-attach { white-space: normal; }

  .media-upload-actions { flex-direction: column; }

  .media-upload-actions .nav-button { width: 100%; text-align: center; }
}

.tagmask-body .tagmask-container { max-width: 1120px; margin: 32px auto; padding: 24px clamp(24px, 7vw, 96px); box-sizing: border-box; }

.tagmask-container > .image-center { margin-bottom: 18px; }

.tagmask-meta-card {
  background: #f3f3f3;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 auto 22px auto;
  box-sizing: border-box;
  max-width: 960px;
}

.tagmask-meta-card h2 { display: none; }

.tagmask-meta-card .meta-row {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.tagmask-meta-card .meta-row.top-line { display: grid; grid-template-columns: minmax(220px, 1.2fr) auto auto auto; gap: 18px; align-items: center; }

.tagmask-meta-card .meta-row.meta-double { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

.tagmask-meta-card .meta-row.bottom-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  font-size: 14px;
}

.tagmask-meta-card input { max-width: 220px; }

.tagmask-meta-card .meta-row:last-child { margin-bottom: 0; }

.tagmask-meta-card .meta-row input {
  background: #ffffff;
  border: 1px solid #bfc3c7;
  border-radius: 4px;
  min-height: 28px;
  box-sizing: border-box;
}

.tagmask-meta-card .meta-row input:focus { outline: none; border-color: #c00000; box-shadow: 0 0 0 2px rgba(192, 0, 0, 0.18); }

.tagmask-container .tagmask-section,
.tagmask-container .filter-section.tagmask-section,
.tagmask-container #top_tags_section,
.tagmask-container #top_categories_section,
.tagmask-container #category_tags_section,
.tagmask-container #assigned_tags_section {
  background: #f1f1f1;
  border: 1px solid #d7d7d7;
  border-left: 4px solid #c00000;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.tagmask-container .tagmask-section h2,
.tagmask-container #top_tags_section h2,
.tagmask-container #top_categories_section h2,
.tagmask-container #category_tags_section h2,
.tagmask-container #assigned_tags_section h2 {
  margin: 0 0 12px 0;
  color: #c00000;
  font-size: 18px;
  line-height: 1.25;
}

.tagmask-container #top_tags_section:empty { display: none; }

.tagmask-container .series-dropdown-container.tagmask-section { display: block; align-items: initial; justify-content: initial; }

.tagmask-series-card form { margin: 0; }

.tagmask-inline-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.tagmask-inline-control label { margin: 0; }

.tagmask-inline-control select { max-width: min(100%, 320px); }

.tagmask-container .tag-input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 10px 0;
}

.tagmask-container .tag-input-group input {
  flex: 1 1 240px;
  min-width: 180px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #bfc3c7;
  border-radius: 4px;
  box-sizing: border-box;
  font: inherit;
}

.tagmask-container .tag-input-group input:focus { outline: none; border-color: #c00000; box-shadow: 0 0 0 2px rgba(192, 0, 0, 0.18); }

.tagmask-container .tagmask-section a,
.tagmask-container #top_tags_section a,
.tagmask-container #top_categories_section a,
.tagmask-container #category_tags_section a,
.tagmask-container .assigned-tag {
  margin-top: 6px;
  margin-bottom: 6px;
}

@media (max-width: 1100px) {
  .tagmask-body .tagmask-container { max-width: calc(100% - 28px); padding: 22px 64px; }
}

@media (max-width: 860px) {
  .tagmask-body .tagmask-container { width: calc(100% - 20px); max-width: none; margin: 18px auto; padding: 16px; }

  .tagmask-meta-card,
  .tagmask-container .tagmask-section,
  .tagmask-container .filter-section.tagmask-section,
  .tagmask-container #top_tags_section,
  .tagmask-container #top_categories_section,
  .tagmask-container #category_tags_section,
  .tagmask-container #assigned_tags_section {
    padding: 14px;
    margin-bottom: 16px;
  }

  .tagmask-meta-card .meta-row,
  .tagmask-meta-card .meta-row.top-line,
  .tagmask-meta-card .meta-row.meta-double {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tagmask-meta-card .meta-block { width: 100%; }

  .tagmask-meta-card .meta-block > div,
  .tagmask-meta-card .meta-block.left-align > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    justify-content: initial;
  }

  .tagmask-meta-card .meta-block > div strong,
  .tagmask-meta-card .meta-block.left-align strong {
    min-width: 0;
    margin-right: 0;
    text-align: left;
  }

  .tagmask-meta-card .meta-block input { max-width: none; width: 100%; }

  .tagmask-meta-card .meta-row.bottom-line { display: grid; grid-template-columns: 1fr; row-gap: 8px; }

  .tagmask-meta-card .meta-row.bottom-line .left,
  .tagmask-meta-card .meta-row.bottom-line .right {
    grid-column: auto;
    white-space: normal;
    text-align: left;
  }

  .tagmask-inline-control { align-items: stretch; }

  .tagmask-inline-control label { width: 100%; }

  .tagmask-inline-control select { width: 100%; max-width: none; }

  .tagmask-container .tag-input-group { align-items: stretch; }

  .tagmask-container .tag-input-group input,
  .tagmask-container .tag-input-group .nav-button {
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 520px) {
  .tagmask-body .tagmask-container { padding: 12px; }

  .tagmask-meta-card .meta-block > div,
  .tagmask-meta-card .meta-block.left-align > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tagmask-meta-card h2,
  .tagmask-container .tagmask-section h2,
  .tagmask-container #top_tags_section h2,
  .tagmask-container #top_categories_section h2,
  .tagmask-container #category_tags_section h2,
  .tagmask-container #assigned_tags_section h2 {
    font-size: 17px;
  }
}

.orv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.orv-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.orv-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.nav-button.orv-icon-btn,
button.orv-icon-btn,
a.orv-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 38px;
  min-height: 36px;
  padding: 7px 10px;
  line-height: 1;
  white-space: nowrap;
}

.nav-button.orv-icon-btn-only,
button.orv-icon-btn-only,
a.orv-icon-btn-only {
  width: 40px;
  min-width: 40px;
  height: 38px;
  min-height: 38px;
  padding: 7px;
}

.nav-button.orv-icon-btn-large,
button.orv-icon-btn-large,
a.orv-icon-btn-large {
  min-width: 52px;
  min-height: 48px;
  padding: 10px 12px;
}

.nav-button.orv-icon-btn .orv-icon-wrap,
button.orv-icon-btn .orv-icon-wrap,
a.orv-icon-btn .orv-icon-wrap {
  width: 22px;
  height: 22px;
}

.nav-button.orv-icon-btn-large .orv-icon-wrap,
button.orv-icon-btn-large .orv-icon-wrap,
a.orv-icon-btn-large .orv-icon-wrap {
  width: 28px;
  height: 28px;
}

.top-bar .nav-left { display: flex; align-items: center; gap: 8px; }

.project-notification-button.orv-icon-btn { gap: 8px; }

.project-notification-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ffffff;
  color: #c00000;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.orv-main-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 8px 0;
}

.orv-main-menu .nav-button {
  width: 64px;
  height: 58px;
  min-width: 64px;
  min-height: 58px;
  padding: 10px;
  box-sizing: border-box;
}

.orv-main-menu .orv-icon-wrap { width: 32px; height: 32px; }

@media (max-width: 700px) {
  .top-bar .nav-left { gap: 6px; }

  .nav-button.orv-icon-btn-only,
  button.orv-icon-btn-only,
  a.orv-icon-btn-only {
    width: 42px;
    min-width: 42px;
    height: 40px;
    min-height: 40px;
  }

  .orv-main-menu {
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .orv-main-menu .nav-button {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    padding: 9px;
  }

  .orv-main-menu .orv-icon-wrap { width: 26px; height: 26px; }
}

@media (max-width: 380px) {
  .orv-main-menu { gap: 6px; }

  .orv-main-menu .nav-button {
    width: 44px;
    height: 46px;
    min-width: 44px;
    min-height: 46px;
    padding: 8px;
  }

  .orv-main-menu .orv-icon-wrap { width: 24px; height: 24px; }
}

.project-sidebar { border: 1px solid #d7d7d7 !important; border-left: 4px solid #c00000 !important; background: #f1f1f1 !important; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) !important; }

.project-sidebar-title-icon { display: inline-flex; width: 22px; height: 22px; }

.orv-tab-icon-row { display: flex; flex-wrap: wrap; gap: 8px; }

.orv-tab-icon-row .project-tab-btn.orv-icon-btn { min-width: 42px; min-height: 38px; padding: 8px 10px; }

.orv-tab-icon-row .project-tab-btn.orv-icon-btn .orv-icon-wrap { width: 22px; height: 22px; }

.gallery-stats-chart-mode-btn,
.stats-switcher-btn {
  cursor: pointer;
}

.gallery-stats-chart-mode-btn:disabled,
.stats-switcher-btn:disabled {
  cursor: not-allowed;
}

.tile-flag-actions,
.tile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tile-flag-actions .orv-icon-btn-only,
.tile-actions .orv-icon-btn-only {
  width: 40px;
  min-width: 40px;
  height: 38px;
  min-height: 38px;
  padding: 7px;
}

.tile-flag-actions .orv-icon-wrap,
.tile-actions .orv-icon-wrap {
  width: 22px;
  height: 22px;
}

.tile-flag-btn.is-active { background-color: #c00000; color: #ffffff; }

.tile-flag-btn.is-active:hover { background-color: #8f0000; }

.gallery-pagination-controls .orv-icon-btn-only {
  width: 38px;
  min-width: 38px;
  height: 34px;
  min-height: 34px;
  padding: 6px;
}

.gallery-pagination-controls .orv-icon-wrap { width: 18px; height: 18px; }

@media (max-width: 700px) {
  .orv-tab-icon-row .project-tab-btn.orv-icon-btn { min-width: 44px; min-height: 42px; }

  .tile-flag-actions .orv-icon-btn-only,
  .tile-actions .orv-icon-btn-only {
    width: 42px;
    min-width: 42px;
    height: 40px;
    min-height: 40px;
  }
}

:root { --orv-topbar-height: 50px; --gallery-sticky-top: var(--orv-topbar-height); --workspace-panel-max-height: 42vh; }

html { box-sizing: border-box; min-width: 0; }

*, *::before, *::after { box-sizing: inherit; }

body { width: 100%; min-width: 0; overflow-x: hidden; }

img, video, iframe, svg { max-width: 100%; }

button, input, select, textarea { font: inherit; max-width: 100%; box-sizing: border-box; }

.page-title { width: min(calc(100% - 32px), 1280px); margin: 12px auto 10px auto !important; }

.page-title h1 { line-height: 1.2; overflow-wrap: anywhere; }

.container, .media-upload-container, .highscore-container, .tagmask-body .tagmask-container, .tagmask-container { box-sizing: border-box; }

@media (min-width: 901px) {
  .container, .media-upload-container, .highscore-container, .tagmask-body .tagmask-container, .tagmask-container {
    width: min(calc(100% - 64px), 1120px) !important;
    max-width: 1120px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .container, .media-upload-container, .highscore-container { padding-left: clamp(32px, 5vw, 96px) !important; padding-right: clamp(32px, 5vw, 96px) !important; }

  body:not(.tagmask-body) > .container, .media-upload-container, .highscore-container { margin-top: 16px !important; }

  body:not(.tagmask-body) > .container.orv-info-card { margin-top: 32px !important; }
}

.top-bar {
  width: 100%;
  min-width: 0;
  min-height: var(--orv-topbar-height) !important;
  padding: 7px 20px !important;
  box-sizing: border-box !important;
}

.top-bar .nav-left, .top-bar .user-info { min-width: 0; }

.top-bar .user-info { justify-content: flex-end; }

.top-bar .username, .top-bar .score { white-space: nowrap; }

.top-bar .nav-button.orv-icon-btn-only, .top-bar button.orv-icon-btn-only, .top-bar a.orv-icon-btn-only {
  width: 38px !important;
  min-width: 38px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 7px !important;
  box-sizing: border-box !important;
}

.top-bar .orv-icon-wrap { width: 20px !important; height: 20px !important; }

.top-bar .project-notification-button.orv-icon-btn { height: 36px !important; min-height: 36px !important; padding: 7px 10px !important; gap: 8px !important; }

.top-bar .project-notification-button .orv-icon-wrap { width: 24px !important; min-width: 24px !important; height: 24px !important; }

.top-bar .project-notification-button .orv-icon { width: 24px !important; height: 24px !important; }

.top-bar .project-notification-count-badge { min-width: 22px !important; height: 20px !important; padding: 0 7px !important; line-height: 20px !important; }

.orv-icon-wrap { flex: 0 0 auto; }

.nav-button, button.nav-button, a.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  text-align: center;
  vertical-align: middle;
}

.nav-button.orv-icon-btn-only, button.orv-icon-btn-only, a.orv-icon-btn-only { flex: 0 0 auto; }

/* Standard: rote Aktionsbuttons behalten weiße Icons */
.nav-button.orv-icon-btn .orv-icon,
.nav-button.orv-icon-btn-only .orv-icon,
.tile-icon-actions .nav-button .orv-icon,
.project-tab-btn.orv-icon-btn.is-active .orv-icon,
.stats-switcher-btn.orv-icon-btn.is-active .orv-icon,
.orv-tab-icon-row .project-tab-btn.orv-icon-btn.is-active .orv-icon,
.highscore-icon-switcher .stats-switcher-btn.orv-icon-btn.is-active .orv-icon {
  filter: none !important;
}

/* Helle/neutralgraue UI-Flächen brauchen schwarze Icons */
.project-tab-btn.orv-icon-btn:not(.is-active) .orv-icon,
.stats-switcher-btn.orv-icon-btn:not(.is-active) .orv-icon,
.orv-tab-icon-row .project-tab-btn.orv-icon-btn:not(.is-active) .orv-icon,
.highscore-icon-switcher .stats-switcher-btn.orv-icon-btn:not(.is-active) .orv-icon,
.project-sidebar-title-icon .orv-icon,
.gallery-pagination .nav-button.orv-icon-btn .orv-icon,
.gallery-pagination .nav-button.orv-icon-btn-only .orv-icon,
.gallery-pagination button.orv-icon-btn .orv-icon,
.gallery-pagination button.orv-icon-btn-only .orv-icon,
.gallery-pagination-controls button .orv-icon,
.gallery-pagination-controls .orv-icon-btn .orv-icon,
.gallery-pagination-controls .orv-icon-btn-only .orv-icon {
  filter: invert(1) !important;
}

/* Deaktivierte helle Pagination-Buttons bleiben schwarz, nur abgeschwächt */
.gallery-pagination button[disabled] .orv-icon,
.gallery-pagination .orv-icon-btn[disabled] .orv-icon,
.gallery-pagination .orv-icon-btn-only[disabled] .orv-icon {
  filter: invert(1) !important;
  opacity: 0.38 !important;
}

.orv-info-card h2 { margin-top: 0 !important; color: #c00000 !important; }

.orv-info-card h3 { margin-top: 20px !important; margin-bottom: 8px !important; }

.orv-info-card p { line-height: 1.45 !important; }

.orv-info-note { margin-top: 24px !important; padding-top: 14px !important; border-top: 1px solid rgba(0,0,0,.10) !important; font-style: italic !important; }

@media (min-width: 901px) {
  .login-container { padding-left: clamp(28px, 4vw, 72px) !important; padding-right: clamp(28px, 4vw, 72px) !important; }

  .login-form {
    display: grid !important;
    grid-template-columns: auto minmax(180px, 1fr) auto minmax(180px, 1fr) auto !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 980px !important;
    margin: 0 auto !important;
  }

  .login-form br { display: none !important; }

  .login-form label {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .login-form label[for="Name"] { grid-column: 1 !important; grid-row: 1 !important; }

  .login-form #Name { grid-column: 2 !important; grid-row: 1 !important; }

  .login-form label[for="Pass_hash"] { grid-column: 3 !important; grid-row: 1 !important; }

  .login-form #Pass_hash { grid-column: 4 !important; grid-row: 1 !important; }

  .login-form input { width: 100% !important; min-width: 0 !important; height: 30px !important; }

  .login-form button, .login-form .nav-button {
    grid-column: 5 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    margin: 0 !important;
  }
}

@media (max-width: 900px) {
  .login-form { display: grid !important; grid-template-columns: 1fr !important; gap: 9px !important; }

  .login-form input { width: 100% !important; }

  .login-form button, .login-form .nav-button { justify-self: start !important; }
}

.media-upload-card .upload-inner-panel, .media-upload-card .upload-mode-panel {
  background: #f8f8f8 !important;
  border: 1px solid #d7d7d7 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.upload-project-row {
  grid-template-columns: minmax(0,1fr) 34px 42px !important;
  gap: 8px !important;
  align-items: center !important;
  min-width: 0;
  overflow-wrap: anywhere;
}

.upload-project-attach {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  min-width: 34px !important;
  gap: 0 !important;
  white-space: nowrap !important;
}

.upload-project-attach input { margin: 0 !important; }

.upload-project-attach span:not(.orv-sr-only) { display: none !important; }

.upload-project-remove.orv-icon-btn-only {
  width: 38px !important;
  min-width: 38px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 6px !important;
}

.upload-project-remove .orv-icon-wrap { width: 20px !important; height: 20px !important; }

.media-upload-project-hint { margin: 0 0 10px 0 !important; line-height: 1.35 !important; }

@media (min-width: 901px) {
  .media-upload-file-grid, .media-upload-mode-grid, .upload-access-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  .upload-user-search-row { grid-template-columns: minmax(0,1.2fr) minmax(160px,.8fr) !important; }

  .upload-project-add-row { grid-template-columns: minmax(0,1fr) auto !important; }
}

.highscore-icon-switcher, .highscore-container .stats-switcher.highscore-icon-switcher {
  justify-content: center !important;
  align-items: center !important;
  width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

.highscore-icon-switcher .stats-switcher-btn.orv-icon-btn { flex: 0 0 auto; min-width: 42px; min-height: 38px; padding: 8px 10px; }

@media (min-width: 1101px) {
  .gallery-page-layout {
    width: calc(100% + 20px) !important;
    max-width: none !important;
    margin: 20px 0 20px -20px !important;
    padding: 0 20px 0 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    box-sizing: border-box !important;
  }

  .project-sidebar {
    position: sticky !important;
    top: var(--gallery-sticky-top) !important;
    left: 1px !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: none !important;
    margin: 0 0 0 7px !important;
    padding: 12px !important;
    background: #f1f1f1 !important;
    border-width: 1px 1px 1px 4px !important;
    border-style: solid !important;
    border-color: #d7d7d7 #d7d7d7 #d7d7d7 #c00000 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 0 rgba(0,0,0,.03) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    z-index: 130 !important;
  }

  .gallery-page-layout > .gallery-container {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 20px !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 12px rgba(0,0,0,.05) !important;
    position: relative !important;
    box-sizing: border-box !important;
    z-index: 2 !important;
  }

  .gallery-sticky-controls {
    position: sticky !important;
    top: var(--gallery-sticky-top) !important;
    z-index: 220 !important;
    margin: -20px 0 0 0 !important;
    padding: 20px 0 0 0 !important;
    background: #fff !important;
    box-sizing: content-box !important;
  }

  .gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(256px,1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
    padding: 0 !important;
    box-sizing: content-box !important;
  }

  .gallery-item {
    background-color: #f9f9f9 !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-width: auto !important;
    overflow: visible !important;
    box-sizing: content-box !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
  }

  .gallery-item:hover {
    background-color: #e0e0e0 !important;
  }

  .gallery-item.fully-processed {
    background-color: #e6f5e6 !important;
    border-color: #9ccc9c !important;
  }

  .gallery-item.fully-processed:hover {
    background-color: #cceacc !important;
    border-color: #78b978 !important;
  }

  .gallery-item.selected,
  .gallery-item.fully-processed.selected {
    background-color: rgba(20, 20, 120, 0.20) !important;
    border-color: rgba(20, 20, 120, 0.55) !important;
    box-shadow: 0 0 0 2px rgba(20, 20, 120, 0.18) inset !important;
  }

  .gallery-item.selected:hover,
  .gallery-item.fully-processed.selected:hover {
    background-color: rgba(20, 20, 120, 0.30) !important;
    border-color: rgba(20, 20, 120, 0.72) !important;
    box-shadow: 0 0 0 2px rgba(20, 20, 120, 0.25) inset !important;
  }

  .tile-thumb {
    width: 100% !important;
    min-height: 160px !important;
    padding: 0 2px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  .tile-thumb-link {
    width: 100% !important;
    min-height: 160px !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(0,0,0,.12) !important;
    border-radius: 6px !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  .gallery-thumb {
    width: 100% !important;
    max-width: 256px !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 4px !important;
    background: transparent !important;
  }

  .tile-icon-actions {
    display: grid !important;
    grid-template-columns: repeat(4,minmax(0,1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: center !important;
    box-sizing: content-box !important;
  }

  .tile-icon-actions > .tile-icon-action-form > .nav-button, .tile-icon-actions > .nav-button { height: 38px !important; min-height: 38px !important; padding: 7px !important; }

  .tile-icon-actions .orv-icon-wrap { width: 22px !important; height: 22px !important; }

  .gallery-pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin: 16px 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 8px !important;
    background: #f8f8f8 !important;
    box-sizing: content-box !important;
  }
}

.project-sidebar-title-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  margin-bottom: 10px !important;
  padding-right: 22px !important;
  color: #c00000 !important;
  box-sizing: border-box !important;
}

.project-sidebar-title-row strong { margin-left: 0 !important; margin-right: auto !important; white-space: nowrap !important; }

.project-sidebar-toggle {
  position: absolute !important;
  top: 6px !important;
  right: 2px !important;
  width: 16px !important;
  height: 22px !important;
  padding: 0 !important;
  z-index: 5 !important;
}

@media (max-width: 700px) {
  :root { --gallery-sticky-top: 0px; --workspace-panel-max-height: none; }

  .top-bar { min-height: 54px !important; padding: 7px 12px !important; gap: 8px !important; }

  .top-bar .user-info { gap: 8px !important; min-width: 0; }

  .top-bar .username { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }

  .top-bar .score { font-size: 14px; }

  .page-title { width: calc(100% - 20px); margin-top: 12px !important; margin-bottom: 10px !important; }

  .page-title h1 { font-size: 23px !important; }

  .container, .media-upload-container, .highscore-container, .tagmask-body .tagmask-container, .tagmask-container {
    width: calc(100% - 20px) !important;
    margin-top: 14px !important;
    margin-bottom: 14px !important;
    padding: 14px !important;
  }

  .gallery-page-layout {
    width: calc(100% - 16px) !important;
    max-width: none !important;
    margin: 10px auto 18px auto !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  .gallery-page-layout > .gallery-container {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 10px 0 0 0 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  .project-sidebar, .project-sidebar.is-collapsed {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: 42vh !important;
    margin: 0 0 12px 0 !important;
    padding: 10px 10px 12px 10px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .project-sidebar .project-sidebar-inner, .project-sidebar.is-collapsed .project-sidebar-inner {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  .project-sidebar-collapsed-label, .project-sidebar.is-collapsed .project-sidebar-collapsed-label, .project-sidebar-toggle { display: none !important; }

  .project-sidebar-title-row { justify-content: flex-start !important; gap: 7px !important; padding-right: 0 !important; }

  .gallery-sticky-controls {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .workspace-tabs,
  .gallery-stats-subtabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 0 10px 0 !important;
    padding: 6px 0 10px 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .workspace-tabs .project-tab-btn,
  .gallery-stats-subtabs .project-tab-btn,
  .orv-tab-icon-row .project-tab-btn.orv-icon-btn {
    flex: 0 0 auto !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 10px !important;
    border-radius: 999px !important;
  }

  .workspace-tabs .orv-icon-wrap,
  .gallery-stats-subtabs .orv-icon-wrap,
  .orv-tab-icon-row .orv-icon-wrap { width: 26px !important; height: 26px !important; }

  .workspace-body {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .workspace-body .workspace-panel {
    display: none !important;
  }

  .workspace-body .workspace-panel.is-active,
  .workspace-body .filter-section.is-active,
  .workspace-body .bulk-section.is-active,
  .workspace-body .gallery-view-settings-panel.is-active,
  .workspace-body .workspace-stats-shell.is-active {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .filter-section, .bulk-section, .project-view-header { margin: 0 0 12px 0 !important; padding: 12px !important; border-radius: 10px !important; box-sizing: border-box !important; }

  .filter-scroll-area, #filter_form, #filter-body, #batch-body, .section-collapsible-body, .gallery-view-settings-grid {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .workspace-control-grid, .workspace-basic-filter-layout, .workspace-main-filter-grid, .workspace-basic-side-grid, .workspace-advanced-filter-grid, .workspace-project-filter-layout, .gallery-view-settings-grid, .gallery-stats-two-col, .gallery-stats-card-grid, .gallery-stats-distribution-content, .gallery-stats-donut-layout, .gallery-stats-counts-grid, .gallery-stats-count-matrix, .gallery-stats-count-combo-controls, .gallery-stats-count-combo-results {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .workspace-control-card, .workspace-inner-filter-card, .workspace-form-card, .gallery-stats-panel-box, .gallery-stats-metric-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .workspace-filter-details { margin: 8px 0 !important; width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }

  .workspace-filter-details > summary { padding: 9px 10px !important; line-height: 1.25 !important; }

  .workspace-filter-details-body { padding: 0 8px 10px 8px !important; }

  .workspace-grow-field, .filter-select, .nav-button.dropdown, select.nav-button.dropdown, .workspace-compact-row select, .workspace-list-row select, .saved-filter-row select, .saved-filter-row input {
    flex: 0 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px !important;
    height: 40px !important;
    box-sizing: border-box !important;
  }

  .workspace-compact-row, .workspace-list-row, .saved-filter-row, .workspace-date-line, .workspace-urheber-row, .workspace-tech-compact-grid, .project-inline-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #filter_form .filter-buttons, .filter-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 6px !important;
  }

  #filter_form .filter-buttons .nav-button, .filter-buttons .nav-button {
    width: 46px !important;
    min-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 8px !important;
    flex: 0 0 auto !important;
  }

  .workspace-toggle-row { display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; margin-top: 8px !important; }

  .workspace-toggle-row .section-toggle-btn { justify-self: center !important; }

  .workspace-toggle-tools {
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) auto !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
  }

  #toggle-tile-info-btn {
    width: 46px !important;
    min-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 8px !important;
    grid-column: 1 !important;
  }

  .workspace-per-page-control {
    grid-column: 2 / 4 !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 76px !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .workspace-per-page-control span { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }

  .workspace-per-page-control select {
    width: 76px !important;
    min-width: 76px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 8px !important;
  }

  .gallery-pagination {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin: 10px 0 12px 0 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .gallery-pagination-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
  }

  .gallery-pagination-controls button, .gallery-pagination-controls .page-current { flex: 0 0 auto !important; min-width: 40px !important; height: 38px !important; padding: 6px 9px !important; }

  .gallery-pagination-meta {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 7px !important;
    font-size: .9em !important;
  }

  .page-jump-input { width: 76px !important; height: 36px !important; }

  .gallery-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 14px !important; margin-top: 12px !important; }

  .gallery-item { width: 100% !important; min-width: 0 !important; padding: 10px !important; box-sizing: border-box !important; }

  .tile-thumb, .tile-thumb-link { width: 100% !important; min-height: 160px !important; box-sizing: border-box !important; }

  .gallery-thumb, .gallery-image img { width: 100% !important; max-width: 256px !important; height: auto !important; margin: 0 auto !important; }

  .gallery-grid.tile-info-collapsed .tile-compact-info { margin-bottom: 10px !important; }

  .gallery-grid.tile-info-collapsed.tile-compact-layout-aligned .tile-compact-row { grid-template-columns: 92px minmax(0,1fr) !important; }

  .tile-icon-actions, .tile-actions.tile-icon-actions {
    display: grid !important;
    grid-template-columns: repeat(4,minmax(0,1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    margin-top: 8px !important;
  }

  .tile-icon-actions > .nav-button, .tile-icon-actions > .tile-icon-action-form, .tile-icon-actions > .tile-icon-action-form > .nav-button {
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 380px) {
  .tile-icon-actions, .tile-actions.tile-icon-actions { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  .workspace-per-page-control { grid-template-columns: 1fr 70px !important; }
}


/* ==============================================================
   V0.9.5.5 – Galerie Mobile: gespeicherte Filter korrigieren
   - kein negativer Abstand mehr
   - Buttons laufen nicht mehr in "Speichern als"
   - gespeicherte Filter bekommen auf Mobile ein eigenes Raster
============================================================== */

@media (max-width: 700px) {
  .saved-filter-compact-card .saved-filter-row.workspace-compact-row,
  .saved-filter-compact-card .workspace-compact-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px 48px !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .saved-filter-compact-card .saved-filter-row.workspace-compact-row + .saved-filter-row.workspace-compact-row {
    margin-top: 14px !important;
  }

  .saved-filter-compact-card .saved-filter-row label {
    grid-column: 1 / -1 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }

  .saved-filter-compact-card #saved_filter_scope,
  .saved-filter-compact-card #saved_filter_select {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
  }

  .saved-filter-compact-card #load-saved-filter-btn,
  .saved-filter-compact-card #delete-saved-filter-btn {
    width: 48px !important;
    min-width: 48px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
    margin: 0 !important;
    justify-self: start !important;
  }

  .saved-filter-compact-card #load-saved-filter-btn {
    grid-column: 1 !important;
  }

  .saved-filter-compact-card #delete-saved-filter-btn {
    grid-column: 2 !important;
  }

  .saved-filter-compact-card #saved_filter_name {
    grid-column: 1 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
  }

  .saved-filter-compact-card #save-saved-filter-btn {
    grid-column: 3 !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
    margin: 0 !important;
    justify-self: end !important;
  }

  .saved-filter-compact-card .workspace-control-status {
    margin-top: 12px !important;
    line-height: 1.3 !important;
  }

  .workspace-list-card .workspace-list-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .workspace-list-card #list_filter {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
  }
}

@media (max-width: 380px) {
  .saved-filter-compact-card .saved-filter-row.workspace-compact-row,
  .saved-filter-compact-card .workspace-compact-row {
    grid-template-columns: minmax(0, 1fr) 46px 46px !important;
  }

  .saved-filter-compact-card #saved_filter_name {
    grid-column: 1 / -1 !important;
  }

  .saved-filter-compact-card #save-saved-filter-btn {
    grid-column: 1 !important;
    justify-self: start !important;
  }
}
