html, body {
  min-height: 100%;
  margin: 0;
}

html {
  font-size: clamp(14px, 1vw + 0.5rem, 18px);
}
body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--surface-page, #ffffff);
  color: var(--text-body, #111827);
}

a {
  color: var(--brand-primary, #1e87f0);
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading, var(--text-body, #111827));
}

body:not(.marketing-page) .uk-offcanvas-content {
  min-height: 100vh;
  background: var(--surface-page, #ffffff);
}

body:not(.marketing-page) .uk-button-primary {
  background-color: var(--brand-primary, #1e87f0);
  border-color: var(--brand-primary, #1e87f0);
}

.about-section {
  background-color: var(--surface-subtle, #0f172a);
  color: var(--text-on-primary, #fff);
}

.about-section .uk-text-lead,
.uk-light .uk-text-lead {
  color: var(--text-on-primary, #fff);
}


body.uk-padding {
  padding-top: 0;
  padding-left: calc(var(--section-gap, 2.25rem) / 3);
  padding-right: calc(var(--section-gap, 2.25rem) / 3);
}

.index-page {
  padding-top: 0;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
}

.site-footer {
  background-color: var(--surface-section, #ffffff);
  color: var(--text-body, #111827);
  padding: calc(var(--section-gap, 2.25rem) / 1.25) calc(var(--section-gap, 2.25rem) / 2);
  border-top: 1px solid var(--border-muted, #dfe3eb);
  text-align: left;
}

.site-footer .footer-columns {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: calc(var(--section-gap, 2.25rem) / 1.5);
}

@media (min-width: 640px) {
  .site-footer .footer-columns {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: start;
  }
}

.site-footer .footer-section strong {
  display: block;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted, #4b5563);
  margin-bottom: 0.75rem;
}

.site-footer .footer-section p {
  margin: 0;
  color: var(--text-muted, #4b5563);
}

.site-footer .footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer .footer-section a {
  color: var(--text-body, #111827);
  text-decoration: none;
}

.site-footer .footer-section a:hover,
.site-footer .footer-section a:focus {
  color: var(--brand-primary, #1e87f0);
  text-decoration: underline;
}

.footer-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-menu a {
  color: var(--text-body, #111827);
  text-decoration: none;
}


.sortable-list li,
.terms li,
.dropzone,
.mc-option {
  cursor: grab;
  background: var(--qr-row);
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: var(--card-radius, 8px);
  padding: calc(var(--section-gap, 2.25rem) / 2);
  margin-bottom: calc(var(--section-gap, 2.25rem) / 3);
  font-size: clamp(0.875rem, 1rem + 0.5vw, 1.25rem);
}

.mc-option {
  display: block;
}

.mc-option input {
  transform: scale(1.2);
  margin-right: 8px;
}

@media (prefers-color-scheme: light) {
  .sortable-list li:nth-child(2n),
  .terms li:nth-child(2n) {
    background: var(--surface-muted, #f5f5f5);
  }

  .sortable-list li,
  .terms li,
  .mc-option {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
}

.sortable-list li:focus {
  outline: 2px solid var(--brand-primary);
}
.dropzone {
  min-height: 3.5em;
  background: var(--qr-row);
  border: 1.5px dashed var(--border-muted, #dfe3eb);
  border-radius: var(--card-radius, 8px);
  margin-bottom: calc(var(--section-gap, 2.25rem) / 3);
  display: flex;
  align-items: center;
  padding: calc(var(--section-gap, 2.25rem) / 4) calc(var(--section-gap, 2.25rem) / 3);
  white-space: normal;
}

.dropzone.over {
  border-color: var(--brand-primary);
  background: var(--surface-muted, #f5f5f5);
}

.dropzone:focus {
  border-color: var(--brand-primary);
  outline: none;
}

.question {
  animation: fadeIn 0.3s ease;
  margin-top: 1em;
}

.question-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary, #1e87f0) 12%, transparent);
  color: var(--brand-primary, #1e87f0);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
}

.question-timer__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.question-timer__value {
  font-size: 1rem;
}

.question-timer--expired {
  background: rgba(217, 44, 44, 0.12);
  color: var(--danger-500, #d92c2c);
}

.question--timeout {
  opacity: 0.82;
}

.question-feedback {
  font-weight: 500;
}

.question-feedback--timeout {
  color: var(--danger-500, #d92c2c);
}

#results-slideshow {
  position: relative;
  min-height: 2.5em;
}

.qr-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
body:not(.marketing-page) .uk-text-truncate {
  max-width: 36ch;
  display: inline-block;
  vertical-align: middle;
  line-height: 44px;
}
.uk-iconnav > li > a {
  padding: 4px;
}

body:not(.marketing-page) .uk-icon-button {
  width: 44px;
  height: 44px;
}


.dragzone {
  position: absolute;
  border: 1px dashed color-mix(in srgb, var(--brand-primary, #1e87f0) 60%, #0b1018);
  background: color-mix(in srgb, var(--brand-primary, #1e87f0) 8%, transparent);
  cursor: move;
  z-index: 10;
  outline: none;
}

.dragzone:focus-within,
.dragzone:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary, #1e87f0) 50%, transparent) inset;
}

.drag-handle {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text-on-primary, #ffffff) 82%, transparent);
  border-radius: calc(var(--card-radius, 8px) / 2);
  cursor: move;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-right: 3px solid color-mix(in srgb, var(--brand-primary, #1e87f0) 70%, #0b1018);
  border-bottom: 3px solid color-mix(in srgb, var(--brand-primary, #1e87f0) 70%, #0b1018);
  cursor: se-resize;
  background: color-mix(in srgb, var(--text-on-primary, #ffffff) 88%, transparent);
}

/* allow resizing on square dragzones (e.g., QR) */
.dragzone--square .resize-handle {
  display: block;
}

.preview-text {
  pointer-events: none;
  white-space: pre-wrap;
  padding: 24px 8px 8px 8px;
  font-family: system-ui, sans-serif;
  line-height: 1.3;
  color: var(--text-body, #000);
}

#qrPreview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Ensure dropdown menus appear above table rows */
.uk-dropdown {
  z-index: 1200;
}

.result-slide {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

.topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--topbar-height, 48px);
  padding: 0 0.5rem;
  background: var(--topbar-bg, var(--surface-card, #fff));
  box-sizing: border-box;
  z-index: 1000;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.topbar .uk-navbar-left,
.topbar .uk-navbar-right {
  display: flex;
  align-items: center;
}

.topbar .uk-navbar-right {
  margin-left: auto;
}

.topbar .uk-navbar-right > * {
  flex-shrink: 0;
}

body:not(.marketing-page) .uk-icon-button {
  border-radius: 6px;
  border: 1px solid var(--topbar-btn-border, var(--border-muted, #ddd));
}

.topbar .uk-navbar-item,
.topbar .uk-navbar-nav > li > a,
.topbar .uk-navbar-toggle {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--topbar-text, var(--text-body));
}

.topbar .uk-navbar-item,
.topbar .uk-navbar-nav > li > a,
.topbar .uk-navbar-toggle:not(.git-btn) {
  height: var(--topbar-height, 48px);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0;
  padding-bottom: 0;
}

[data-theme="dark"] .topbar .uk-navbar-item,
[data-theme="dark"] .topbar .uk-navbar-nav > li > a,
[data-theme="dark"] .topbar .uk-navbar-toggle {
  color: var(--topbar-text, var(--text-body));
}

.topbar .uk-navbar-toggle.git-btn {
  width: var(--topbar-height, 48px);
  height: var(--topbar-height, 48px);
  padding: 0;
}

.uk-navbar-toggle.git-btn {
  width: var(--topbar-height, 48px);
  height: var(--topbar-height, 48px);
  padding: 0;
}
.topbar .uk-navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.topbar .uk-navbar-center .uk-navbar-item {
  width: 100%;
  justify-content: center;
}

@media (max-width: 640px) {
  .topbar .uk-navbar-center {
    flex: 0 1 auto;
    width: auto;
  }
}

/* Admin sidebar navigation */
.qr-sidebar { min-height: calc(100vh - var(--topbar-height, 48px)); }
.qr-sidebar-card { height: 100%; overflow-y: auto; }
.admin-page.sidebar-collapsed #adminSidebar {
  display: none !important;
}
.admin-page.sidebar-collapsed .qr-sidebar-card {
  display: none;
}
.qr-nav-text { margin-left: 0; }
.qr-sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.qr-sidebar-nav > .uk-nav {
  margin-left: 0;
  padding-left: 0;
}
.qr-nav-link > [uk-icon],
.qr-nav-accordion-title > [uk-icon]:not(.qr-nav-accordion-chevron) {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  flex-shrink: 0;
}
.qr-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
}
.qr-nav-sub {
  margin-left: 0;
  padding-left: 10px;
}
.qr-nav-sub-link {
  padding: 6px;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--text-muted, #4b5563);
}
.qr-nav-sub-link:hover {
  color: var(--brand-primary, #1e87f0);
}
.qr-nav-accordion { margin-top: 4px; }
.qr-nav-accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.qr-nav-accordion-title::before {
  display: none;
  content: none;
  padding: 0;
  margin: 0;
}
.qr-nav-accordion-label { font-size: 0.8125rem; }
.qr-nav-accordion-chevron { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.qr-nav-accordion .uk-accordion-content { padding: 2px 0 10px 0; }
.qr-nav-accordion-item.uk-open .qr-nav-accordion-chevron { transform: rotate(180deg); }
.uk-nav-default > li.uk-active > a {
  background: color-mix(in srgb, var(--brand-primary, #1e87f0) 8%, transparent);
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-body, #222);
  border-left: 3px solid var(--brand-primary, #1e87f0);
  padding-left: 9px;
}
/* Separator between accordion groups */
.qr-nav-accordion-item + .qr-nav-accordion-item {
  border-top: 1px solid var(--border-muted, #dfe3eb);
  padding-top: 4px;
  margin-top: 4px;
}
/* Touch feedback for nav links */
.qr-nav-link,
.qr-nav-sub-link,
.qr-nav-accordion-title {
  transition: background-color 0.15s ease, color 0.15s ease;
}
.qr-nav-link:active,
.qr-nav-sub-link:active,
.qr-nav-accordion-title:active {
  background-color: color-mix(in srgb, var(--brand-primary, #1e87f0) 12%, transparent);
}
/* Hide the topbar generic offcanvas toggle on admin pages */
.admin-page #offcanvas-toggle {
  display: none !important;
}

/* ── Mobile-optimized offcanvas nav ── */
@media (max-width: 959px) {
  #qr-offcanvas .qr-nav-link {
    padding: 12px 10px;
    min-height: 44px;
    box-sizing: border-box;
  }
  #qr-offcanvas .qr-nav-sub-link {
    padding: 10px 10px;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 0.9375rem;
  }
  #qr-offcanvas .qr-nav-accordion-title {
    padding: 12px 10px;
    min-height: 44px;
    box-sizing: border-box;
  }
  #qr-offcanvas .uk-select {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 1rem;
  }
  #qr-offcanvas .qr-sidebar-nav {
    gap: 14px;
  }
  #qr-offcanvas .qr-nav-accordion {
    margin-top: 8px;
  }
  #qr-offcanvas .qr-nav-accordion .uk-accordion-content {
    padding: 4px 0 14px 0;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Link-Größe an Fließtext anpassen */
a.uk-accordion-title {
  font-size: clamp(0.9rem, 1rem + 0.3vw, 1.2rem);
}

@media (min-width: 640px) {
  .sortable-list li,
  .terms li,
  .dropzone,
  .mc-option {
    font-size: clamp(1.1rem, 1.3rem + 0.4vw, 1.4rem);
  }
}

@media (min-width: 960px) {
  .sortable-list li,
  .terms li,
  .dropzone,
  .mc-option {
    font-size: clamp(1.3rem, 1.5rem + 0.4vw, 1.6rem);
  }
  .mc-option input {
    transform: scale(1.3);
  }
}

body:not(.marketing-page) .uk-container,
body:not(.marketing-page) .legal-container {
  padding-left: 8px;
  padding-right: 8px;
}

@media (min-width: 640px) {
  body:not(.marketing-page) .uk-container,
  body:not(.marketing-page) .legal-container {
    padding-left: 15px;
    padding-right: 15px;
  }
  body.uk-padding {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Fester Bedienbereich im Admin-Editor */
.sticky-actions {
  position: sticky;
  bottom: calc(var(--topbar-height, 48px) + 1rem);
  z-index: 900;
  background: color-mix(in srgb, var(--surface-card, #ffffff) 95%, transparent);
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Vorschau innerhalb der Fragekarte */
.question-preview {
  min-height: 100px;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: var(--card-radius, 8px);
  margin-top: 8px;
}

/* Einheitlicher Kartenrahmen fuer Admin-Tabs */
.tab-card {
  margin-top: 16px;
}

/* Kartenlayout fuer Export- und Zusammenfassungsseiten */
.card-grid > div {
  break-inside: avoid;
}

.export-card {
  border: 1px solid var(--border-muted, #dfe3eb);
  padding: calc(var(--section-gap, 2.25rem) / 1.2);
  text-align: center;
  page-break-inside: avoid;
  position: relative;
  border-radius: var(--card-radius, 8px);
}

.qr-print-btn {
  position: absolute;
  top: 4px;
  right: 4px;
}
@media print {
  .topbar,
  .sticky-tabs,
  #adminTabs,
  .site-footer,
  .footer-menu,
  .uk-footer,
  .uk-navbar-container,
  .uk-navbar,
  button,
  .uk-button,
  .uk-icon-button,
  .uk-tooltip {
    display: none !important;
  }
}

.logo-placeholder {
  width: 160px;
  height: 240px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  max-height: 100%;
}

.logo-frame {
  width: 160px;
  height: 240px;
  border: 1px solid var(--border-muted, #dfe3eb);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 8px;
  background-color: #fff;
}

.proof-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.js-upload {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 960px) {
  .js-upload {
    min-height: 240px;
  }
}

.quiz-letter {
  font-size: clamp(4rem, 8vw, 6rem);
  font-weight: bold;
}

/* Puzzle word input and feedback button */
#cfgPuzzleWordWrap .uk-input,
#cfgPuzzleWordWrap .uk-button {
  height: 44px;
  line-height: 44px;
  box-sizing: border-box;
}

/* Stacked layout for file upload fields */
.stacked-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stacked-upload input[type="text"],
.stacked-upload button {
  width: 100%;
}

.stacked-upload button {
  margin-top: 8px;
}

/* Start buttons layout */
.login-buttons button {
  width: 100%;
}

/* Stylized info card for catalog comments */
.modern-info-card {
  border-radius: 1.5rem;
  box-shadow: 0 6px 30px rgba(0,0,0,0.08);
  border: 1.5px solid var(--border-muted, #dfe3eb);
  padding: 1.1rem 0.7rem;
  margin: 1.5rem auto;
  max-width: 98vw;
}

@media (min-width: 601px) {
  .modern-info-card {
    padding: 2rem 1.5rem;
    max-width: 700px;
  }
}

@media (min-width: 960px) {
  .modern-info-card {
    max-width: 900px;
  }
}

@media (min-width: 1200px) {
  .modern-info-card {
    max-width: 1100px;
  }
}

.modern-info-card .uk-card-title {
  font-size: clamp(1.1rem, 1.2rem + 0.5vw, 1.5rem);
  margin-bottom: 1rem;
  color: var(--text-body, #1e293b);
}

.modern-info-card p {
  font-size: calc(1rem + 0.3vw);
  line-height: 1.8;
  color: var(--text-muted, #212529);
}

.uk-text-danger.uk-text-italic {
  color: var(--danger-500) !important;
  font-style: italic;
}

body .uk-alert-danger {
  background-color: var(--danger-600);
  color: var(--text-on-primary, #fff);
}

.uk-form-danger {
  border-color: var(--danger-600) !important;
}

/* Modern style for onboarding steps */
.onboarding-step {
  border-radius: 1rem;
  box-shadow: 0 6px 30px rgba(0,0,0,0.08);
  border: 1px solid var(--border-muted, #dfe3eb);
  background: linear-gradient(135deg, var(--surface-card, #ffffff) 0%, color-mix(in srgb, var(--surface-card, #fafafa) 90%, #fafafa) 100%);
}

/* Timeline for onboarding steps */
.onboarding-timeline {
  list-style: none;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0;
}

.onboarding-timeline .timeline-step {
  padding: calc(var(--section-gap, 2.25rem) / 5) calc(var(--section-gap, 2.25rem) / 2.25);
  margin: 0 0.5rem;
  border-bottom: 3px solid color-mix(in srgb, var(--text-on-primary, #ffffff) 30%, transparent);
  cursor: pointer;
  color: color-mix(in srgb, var(--text-on-primary, #ffffff) 70%, transparent);
}

.onboarding-timeline .timeline-step.inactive {
  cursor: not-allowed;
  color: color-mix(in srgb, var(--text-on-primary, #ffffff) 40%, transparent);
}

.onboarding-timeline .timeline-step.active,
.onboarding-timeline .timeline-step.completed {
  border-color: var(--text-on-primary, #fff);
  color: var(--text-on-primary, #fff);
  font-weight: 600;
}


/* Wrapper for thumbnails with rotate button */
.photo-wrapper {
  position: relative;
  display: inline-block;
}

.lightbox-rotate-btn {
  position: absolute;
  right: 40px;
  bottom: 15px;
  z-index: 1100;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.lightbox-rotate-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* Flip card for "Hätten Sie es gewusst?" */
.flip-card { perspective: 800px; position: relative; }
.flip-card-inner { position: relative; width: 100%; min-height: 150px; transition: transform 0.6s; transform-style: preserve-3d; }
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; border-radius: var(--card-radius, 8px); background: var(--surface-card, #fff); backface-visibility: hidden; box-shadow: 0 2px 6px color-mix(in srgb, #000 20%, transparent); }
.flip-card-back { transform: rotateY(180deg); }

#adminTabs {
  display: none;
}

body.admin-page {
  padding-top: 0;
}

/* Admin layout profiles: wide (tables), standard (default), narrow (focused forms) */
.admin-shell {
  --admin-content-max-width: 1200px;
}

.admin-shell[data-admin-layout="standard"] {
  --admin-content-max-width: 1200px;
}

.admin-shell[data-admin-layout="wide"] {
  --admin-content-max-width: 1440px;
}

.admin-shell[data-admin-layout="narrow"] {
  --admin-content-max-width: 800px;
}

.admin-shell .admin-main-container,
.admin-shell .admin-section,
.admin-shell .uk-container {
  width: 100%;
  max-width: var(--admin-content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.admin-shell .uk-container {
  padding-left: 0;
  padding-right: 0;
}

.admin-page .admin-table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
}

.admin-page .admin-table-wrapper.uk-overflow-auto {
  /* Allow dropdown menus to escape the scroll container while preserving horizontal scrolling */
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Ensure action dropdowns inside admin tables are not clipped by card or background layers */
.admin-page .uk-card,
.admin-page .uk-card > :first-child {
  overflow: visible;
}

.admin-page [uk-dropdown] {
  z-index: 1200;
}

.admin-page .topbar {
  height: auto;
  flex-wrap: nowrap;
}

.admin-page .topbar .uk-navbar-left {
  order: 1;
}

.admin-page .topbar .uk-navbar-center {
  order: 2;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  position: static;
  transform: none;
}

.admin-page .topbar .uk-navbar-center .uk-breadcrumb {
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-page .topbar .namespace-label {
  display: none;
}

.admin-page .topbar .namespace-label + li::before {
  display: none;
}

@media (min-width: 640px) {
  .admin-page .topbar .namespace-label {
    display: contents;
  }
  .admin-page .topbar .namespace-label + li::before {
    display: inline;
  }
}

.admin-page .topbar .uk-navbar-right {
  order: 3;
  z-index: 1;
  padding-top: 0;
  padding-bottom: 0;
  align-self: stretch;
  flex-shrink: 0;
}

.admin-page {
  color: var(--text-body);
}

.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page h4,
.admin-page h5,
.admin-page h6,
.admin-page .uk-card-title {
  color: var(--text-heading);
}

.admin-page .uk-text-meta,
.admin-page .uk-text-muted {
  color: var(--text-muted);
}

.admin-page .uk-card {
  background: var(--surface-card);
  border: 1px solid var(--border-muted);
  color: var(--text-body);
}

.admin-page .uk-card .uk-text-meta {
  color: var(--text-muted);
}

.admin-page .uk-card .uk-form-label,
.admin-page .uk-form-label {
  color: var(--text-heading);
}

.admin-page .page-tree {
  color: var(--text-body);
  filter: none;
  opacity: 1;
}

.admin-page .page-tree .uk-text-meta {
  color: var(--text-muted);
}

.admin-page .page-tree .uk-text-bold {
  color: var(--text-heading);
}

.admin-page .page-tree-select.uk-button-text {
  color: var(--brand-primary);
  font-weight: 600;
}

.admin-page .page-tree-select.uk-button-text:hover,
.admin-page .page-tree-select.uk-button-text:focus {
  color: var(--brand-secondary);
  text-decoration: none;
}

.admin-page .page-tree-action.uk-button-default {
  font-weight: 600;
}

[data-theme="dark"] .admin-page .page-tree-action.uk-button-default,
[data-theme="dark"] .admin-page .uk-button-default {
  background-color: var(--surface-muted);
  border-color: var(--border-muted);
  color: var(--text-body);
}

[data-theme="dark"] .admin-page .page-tree-action.uk-button-default:hover,
[data-theme="dark"] .admin-page .uk-button-default:hover {
  background-color: var(--surface-subtle);
  color: var(--text-heading);
}

.admin-page .uk-button-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

@media (min-width: 640px) {
  #adminTabs {
    display: flex;
  }
  body.admin-page {
    padding-top: 0;
  }
  .admin-page .topbar {
    height: var(--topbar-height, 48px);
  }
  .admin-page .topbar .uk-navbar-left,
  .admin-page .topbar .uk-navbar-right,
  .admin-page .topbar .uk-navbar-center {
    order: 0;
  }
  .admin-page .topbar .uk-navbar-center {
    width: auto;
  }
}

/* Floating action buttons */
.fab {
  position: fixed;
  bottom: calc(4rem + env(safe-area-inset-bottom));
  right: 1rem;
  width: 56px;
  height: 56px;
  line-height: 56px;
  font-size: clamp(20px, 1.5vw + 16px, 24px);
  z-index: 1100;
  border-radius: 6px;
  border: 1px solid var(--topbar-btn-border, #ddd);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fab-save {
  bottom: calc(8rem + env(safe-area-inset-bottom));
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 22px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 6px;
  border: 1px solid var(--topbar-btn-border, #ddd);
}
.switch input:checked + .slider {
  background-color: var(--brand-primary);
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* Team list enhancements */
#teamsList td {
  padding: 8px 4px;
}

#teamsList td.team-name {
  cursor: pointer;
}

#teamsList td.team-name .uk-text-truncate {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

#teamsTable {
  width: 100%;
  max-width: 100%;
}

/* Responsive team list */
#teamsTable thead {
  display: none;
}
#teamsList,
#teamsList tr,
#teamsList td {
  display: block;
}
#teamsList tr {
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  background: var(--qr-row);
  position: relative;
}
#teamsList tr:nth-child(even) {
  background: var(--surface-muted, #f5f5f5);
}
#teamsList td {
  padding: 4px 0;
}
#teamsList td:first-child {
  position: absolute;
  top: 4px;
  right: 4px;
  display: block;
}

@media (min-width: 640px) {
  #teamsTable thead {
    display: table-header-group;
  }
  #teamsList {
    display: table-row-group;
  }
  #teamsList tr {
    display: table-row;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    position: static;
  }
  #teamsList td {
    display: table-cell;
    padding: 8px 4px;
    vertical-align: middle;
    line-height: 44px;
  }
  #teamsList td:first-child {
    position: static;
    top: auto;
    right: auto;
    display: table-cell;
  }
  /* no text inputs in team list */
}

/* Page editor styles */
.page-editor {
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 4px;
  padding: 10px;
  background: var(--surface-card, #fff);
  color: var(--text-body, inherit);
}

.page-editor .tiptap-editor:focus {
  outline: none;
}

.page-editor-toolbar .uk-button:focus-visible,
.preview-link:focus-visible {
  outline: 2px solid var(--brand-primary, #1e87f0);
  outline-offset: 3px;
}

.page-editor.landing-editor {
  background: var(--surface-card, #fff);
  color: var(--text-body, #111827);
  border-color: var(--border-muted, #dfe3eb);
}

.page-editor.landing-editor a {
  color: var(--brand-primary, #1e87f0);
}

/* Prevent huge heights from UIkit's height-viewport plugin inside the editor */
.page-editor [uk-height-viewport] {
  min-height: auto !important;
  height: auto !important;
}

/* Also neutralize CSS-based viewport heights (e.g. 80 vh) in the editor */
.page-editor .section[data-viewport-height] {
  min-height: auto !important;
  height: auto !important;
}

/* Page editor layout */
.page-editor [data-editor-root="true"] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.page-editor .content-editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.page-editor .content-editor-body > * {
  min-width: 0;
  box-sizing: border-box;
}

.page-editor [data-block-list="true"] {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  border-right: none;
  border-bottom: 1px solid var(--border-muted, #e5e7eb);
  padding-bottom: 10px;
}

.page-editor [data-block-list="true"] ul {
  display: grid;
  gap: 10px;
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.page-editor [data-block-editor="true"] {
  width: 100%;
  border: 1px solid var(--border-muted, #e5e7eb);
  background: var(--surface-card, #fff);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 14px;
  box-sizing: border-box;
}

.content-editor-body--edit {
  gap: 12px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-heading__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.section-heading__meta {
  font-size: 0.925rem;
  color: var(--text-muted, #4b5563);
}

.page-editor [data-block-editor="true"] > * {
  min-width: 0;
}

.page-editor [data-editor-controls="true"] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-editor [data-template-chooser="true"] {
  border: 1px solid var(--border-muted, #e5e7eb);
  background: var(--surface-card, #fff);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
}

@media (min-width: 768px) {
  .template-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .template-picker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.template-picker-grid .layout-style-card {
  min-height: 180px;
}

.template-picker-grid .layout-style-card__description {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted, #6b7280);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.page-editor .field-label {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--text-heading, #0b1728);
}

.page-editor [data-field-label="true"],
.page-editor .field-wrapper,
.page-editor .field-label + .field-helper-text {
  display: grid;
  gap: 6px;
}

.page-editor input,
.page-editor textarea,
.page-editor select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Input field contrast – visible background + stronger border ── */
.page-editor .uk-input,
.page-editor .uk-textarea,
.page-editor .uk-select {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-strong, #c4cdd8);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9375rem;
  color: var(--text-body, #111827);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-editor .uk-input:focus,
.page-editor .uk-textarea:focus,
.page-editor .uk-select:focus {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #1e87f0) 15%, transparent);
  background: var(--surface-card, #fff);
  outline: none;
}

/* ── Rich text editor (TipTap/ProseMirror) – same input look ── */
.page-editor [data-richtext="true"] {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-strong, #c4cdd8);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 2.5em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-editor [data-richtext="true"]:focus-within {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #1e87f0) 15%, transparent);
  background: var(--surface-card, #fff);
}

.page-editor select {
  max-width: 20rem;
}

.block-form-fields {
  display: grid;
  gap: 16px;
}

.block-form-section {
  border: 1px solid var(--border-muted, #e5e7eb);
  background: var(--surface-card, #fff);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 14px;
  box-sizing: border-box;
}

.block-form-section__title {
  font-weight: 700;
  color: var(--text-body, #0f172a);
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-form-section__hint,
.page-editor .field-helper-text {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted, #4b5563);
}

.block-form-section[data-optional-section="true"] {
  padding: 0;
  overflow: hidden;
}

.block-form-section[data-optional-section="true"] > summary {
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.block-form-section[data-optional-section="true"] > summary::marker {
  display: none;
}

.block-form-section[data-optional-section="true"][open] > summary {
  border-bottom: 1px solid var(--border-muted, #e5e7eb);
}

.block-form-section[data-optional-section="true"] .block-form-section__hint {
  padding: 0 16px 4px;
}

/* Content fields directly inside optional sections (no .optional-section__body wrapper) */
.block-form-section[data-optional-section="true"] > :not(summary):not(.block-form-section__hint):not(.optional-section__body) {
  margin-left: 16px;
  margin-right: 16px;
}

.block-form-section[data-optional-section="true"] > :last-child:not(summary):not(.block-form-section__hint) {
  margin-bottom: 16px;
}

/* ── Optional section body (inside <details>) ── */
.optional-section__body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

/* ── Optional field card ── */
.optional-field-card {
  border: 1px solid var(--border-muted, #e5e7eb);
  background: var(--surface-subtle, #f8fafc);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

/* ── Toggle label (checkbox + text) ── */
.optional-field-card__toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-body, #111827);
}

.optional-field-card__toggle--secondary {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted, #4b5563);
}

.optional-field-card > .field-helper-text {
  margin-top: -4px;
}

.block-repeater-card {
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-card, #fff);
  overflow: hidden;
}

.block-repeater-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.block-repeater-card > summary::marker {
  display: none;
}

.block-repeater-card[open] > summary {
  border-bottom: 1px solid var(--border-muted, #e5e7eb);
}

.block-repeater-card__title {
  font-weight: 700;
  color: var(--text-body, #0f172a);
  min-width: 0;
  flex: 1;
}

.block-repeater-card__meta {
  color: var(--text-muted, #6b7280);
  font-size: 13px;
}

.block-repeater-card__body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.block-repeater-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.collection-list__add {
  align-self: flex-start;
}

.collection-list--nested {
  padding: 4px 4px 0;
  border-left: 2px solid var(--border-muted, #e5e7eb);
}

.collection-item {
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-card, #fff);
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.collection-list--nested .collection-item {
  background: var(--surface-subtle, #f9fbff);
}

.collection-item__header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.collection-item__title {
  font-weight: 700;
  color: var(--text-body, #0f172a);
}

.collection-item__meta {
  color: var(--text-muted, #6b7280);
  font-size: 13px;
}

.collection-item__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.collection-item__body {
  display: grid;
  gap: 10px;
}

/* ── String list (buildStringList) ── */
.string-list {
  display: grid;
  gap: 8px;
}

.string-list__label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-heading, #0b1728);
}

.string-list__add {
  justify-self: start;
}

.string-list__entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.string-list__entry input {
  min-width: 0;
}

.string-list__controls {
  display: flex;
  gap: 4px;
}

/* ── Inline toggle (checkbox + label) ── */
.field-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.field-toggle__label {
  font-size: 0.9rem;
}

.qr-img {
  border-radius: 8px;
  image-rendering: pixelated;
}

/* Dashboard calendar */
#calendar table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 0.8rem + 0.2vw, 0.875rem);
}

#calendar td {
  padding: 4px;
  height: 80px;
  vertical-align: top;
  position: relative;
}

#calendar .cal-events {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

#calendar .cal-event {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: block;
}

/* Spacing for consecutive event action buttons */
.event-action + .event-action {
  margin-left: 0.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.uk-progress.uk-progress-warning::-webkit-progress-value { background-color: #faa05a; }
.uk-progress.uk-progress-warning::-moz-progress-bar { background-color: #faa05a; }
.uk-progress.uk-progress-danger::-webkit-progress-value { background-color: #f0506e; }
.uk-progress.uk-progress-danger::-moz-progress-bar { background-color: #f0506e; }

.dashboard-container #badge-upcoming {
  background-color: #fff;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
}

.dashboard-tile {
  min-width: 0;
}

.dashboard-tile > .uk-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  margin: 0;
}

.dashboard-tile > .uk-card .uk-heading-bullet {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.dashboard-tile .uk-table th,
.dashboard-tile .uk-table td {
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
}

.dashboard-tile > .uk-card > *:last-child {
  margin-bottom: 0;
}

.container-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.container-metrics__row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (min-width: 640px) {
  .container-metrics__row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
}

.container-metrics__label {
  font-size: 0.85rem;
  color: #555;
}

.container-metrics__value {
  font-weight: 600;
}

.container-metrics__bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="dark"] .container-metrics__bar {
  background: #1f1f1f;
}

.container-metrics__bar-fill {
  height: 100%;
  width: 0;
  background: var(--dashboard-accent, #1e87f0);
  transition: width 0.2s ease;
}

.container-metrics__status {
  margin: 0;
}

.dashboard-leader {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-leader__summary {
  border-left: 4px solid var(--dashboard-accent);
  padding-left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-leader__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}

.dashboard-leader__name {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.dashboard-leader__points {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--dashboard-accent);
}

.dashboard-leader__meta {
  font-size: 0.8125rem;
  color: #555;
}

.dashboard-leader__list {
  margin: 0;
}

.dashboard-leader__list li {
  padding: 0.35rem 0;
}

.dashboard-leader__delta {
  margin-top: 0.15rem;
}

@media (min-width: 1024px) {
  .dashboard-tile--wide {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .dashboard-tile--full {
    grid-column: 1 / -1;
  }
}

/* Dashboard grid spacing for mobile */
@media (max-width: 640px) {
  .dashboard-container {
    padding-left: 8px;
    padding-right: 8px;
  }
  .dashboard-grid {
    margin-left: -8px;
  }
  .dashboard-grid > * {
    padding-left: 8px;
  }
}

/* Standardsektionen neutralisieren und selbst einfärben */

.uk-card,
.qr-card,
.uk-panel {
  background: var(--qr-card);
  color: inherit;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 12px;
}

.section--muted {
  background: var(--surface-muted, #f5f5f5);
}

.section--transparent {
  background: transparent;
}

/* Swipe card layout */
.swipe-container {
  position: relative;
  height: 300px;
  user-select: none;
  touch-action: none;
}

.swipe-card {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2rem;
  right: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: transform 0.3s;
}

.help-icon {
  color: #999;
}

/* Prevent truncation of long team names in rankings */
.ranking-team {
  overflow: visible;
  white-space: normal;
}

/* Media manager */
.media-tab .media-dropzone {
  border: 2px dashed rgba(30, 135, 240, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.media-tab .media-dropzone.is-dragover {
  border-color: rgba(30, 135, 240, 0.8);
  background: rgba(30, 135, 240, 0.12);
}

.media-tab .media-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.media-tab .media-dropzone button {
  font-weight: 600;
}

.media-preview-frame {
  position: relative;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-frame img {
  max-width: 100%;
  height: auto;
  display: block;
}

.media-preview-placeholder {
  color: #666;
  padding: 1rem;
  text-align: center;
}

.media-table tr.is-active {
  background: rgba(30, 135, 240, 0.1);
}

.media-table .media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.media-upload-form .uk-progress[hidden] {
  display: none;
}

.media-upload-form .uk-progress {
  margin-bottom: 0.25rem;
}

@media (min-width: 960px) {
  .media-refresh-container {
    flex-direction: column;
    align-items: flex-end;
  }

  .media-refresh-container [data-media-refresh] {
    margin-top: auto;
  }
}



.player-name-highlight {
  font-weight: 600;
  color: var(--brand-primary, #1e87f0);
}

.ranking-consent-checkbox {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  flex: 0 0 2rem;
  background-size: 1.2rem;
}

.player-ranking-card {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(30, 135, 240, 0.08), rgba(30, 135, 240, 0.02));
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-ranking-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16);
}

.player-ranking-card--highlight {
  background: linear-gradient(135deg, rgba(255, 214, 0, 0.18), rgba(255, 248, 192, 0.35));
  border: 1px solid rgba(255, 214, 0, 0.35);
}

.player-ranking-card__heading-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
}

.player-ranking-card__icon {
  color: var(--brand-primary, #1e87f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.player-ranking-card__label {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.player-ranking-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.player-ranking-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  min-width: 0;
}

.player-ranking-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.player-ranking-card__actions .uk-text-meta {
  margin: 0;
  text-align: right;
}

@media (max-width: 640px) {
  .player-ranking-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .player-ranking-card__actions {
    width: 100%;
    align-items: stretch;
  }

  .player-ranking-card__actions .uk-button {
    width: 100%;
  }
}

.player-ranking-name-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}

.player-ranking-card__header > .player-ranking-name-actions {
  margin-top: 0;
}

.player-ranking-name-actions .uk-text-meta {
  margin: 0;
}

.player-ranking-card--highlight .player-ranking-card__icon {
  color: #ffb400;
}


.player-ranking-card__place {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.player-ranking-card__meta {
  margin: 0;
  color: #4b5563;
}

[data-theme='dark'] .player-ranking-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.15));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
}

[data-theme='dark'] .player-ranking-card__label {
  color: #d1d5db;
}

[data-theme='dark'] .player-ranking-card__place {
  color: #e5e7eb;
}

[data-theme='dark'] .player-ranking-card__meta {
  color: #9ca3af;
}

.player-toplist-card {
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

[data-theme='dark'] .player-toplist-card {
  background: #111827;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

.player-toplist-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.player-toplist-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-toplist-card__item {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
}

.player-toplist-card__item.is-active {
  background: rgba(30, 135, 240, 0.12);
  font-weight: 600;
}

[data-theme='dark'] .player-toplist-card__item.is-active {
  background: rgba(37, 99, 235, 0.35);
}

.player-toplist-card__rank {
  font-weight: 700;
  color: var(--brand-primary, #1e87f0);
}

.player-toplist-card__value {
  font-size: 0.9rem;
  color: #6b7280;
}

[data-theme='dark'] .player-toplist-card__value {
  color: #d1d5db;
}

.menu-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Menu tree card items (harmonized with footer block-cards) ── */
.menu-tree__item {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  position: relative;
  background: #fff;
  margin-left: calc(var(--menu-depth, 0) * 20px);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.menu-tree__item:hover {
  border-color: #1e87f0;
  box-shadow: 0 2px 8px rgba(30,135,240,0.1);
}
.menu-tree__item--inactive {
  opacity: 0.5;
}
.menu-tree__item--editing {
  border-color: #1e87f0;
  box-shadow: 0 2px 12px rgba(30,135,240,0.15);
}

[data-theme="dark"] .menu-tree__item {
  border-color: #333;
  background: #1a1a1a;
}

/* hide action buttons until hover — overrides card-row default */
.menu-tree .card-row__actions {
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}
.menu-tree__item:hover .card-row__actions,
.menu-tree__item:focus-within .card-row__actions {
  opacity: 1;
}

/* Status badges */
.menu-tree__status-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.menu-tree__status-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
}
.menu-tree__status-badge--startpage { background: #d4edda; color: #155724; }
.menu-tree__status-badge--external { background: #fff3cd; color: #856404; }

/* Edit area (inline editing, hidden by default) */
.menu-tree__edit-area {
  border-top: 1px solid #e9ecef;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 0 0 6px 6px;
  display: grid;
  gap: 6px;
}
.menu-tree__edit-area .uk-form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #495057;
}
.menu-tree__edit-area .uk-input,
.menu-tree__edit-area .uk-textarea,
.menu-tree__edit-area .uk-select {
  font-size: 0.8125rem;
}
[data-theme="dark"] .menu-tree__edit-area {
  background: #222;
  border-color: #333;
}
[data-theme="dark"] .menu-tree__edit-area .uk-form-label {
  color: #e5e7eb;
}

/* Advanced fields */
.menu-tree__advanced {
  border-top: 1px dashed #e5e5e5;
  margin-top: 8px;
  padding-top: 8px;
}
[data-theme="dark"] .menu-tree__advanced {
  border-color: #333;
}

/* Branch (children container) */
.menu-tree__branch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.menu-tree__toggle {
  cursor: pointer;
}


/* Layout style picker */
.layout-style-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.appearance-style-picker,
.section-style-panel,
.background-style-panel {
  margin: 0;
}

.section-background-config {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 10px;
  background: var(--surface-card, #ffffff);
}

.section-background-config__hint {
  color: var(--text-muted, #4b5563);
  margin-top: -4px;
}

.color-token-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.color-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-subtle, #f8fafc);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  text-align: left;
}

.color-token-chip:hover {
  border-color: var(--border-strong, #cbd2d9);
  background: var(--surface-card-hover, #f3f4f6);
}

.color-token-chip:focus-visible {
  outline: 2px solid var(--brand-primary, #1e87f0);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--brand-primary, #1e87f0) 25%, transparent);
}

.color-token-chip[data-selected="true"] {
  border-color: var(--brand-primary, #1e87f0);
  background: var(--surface-accent-primary-soft, #f0f7ff);
  box-shadow: 0 8px 18px
    color-mix(in srgb, var(--brand-primary, #1e87f0) 18%, transparent);
}

.color-token-chip__swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--surface-card, #ffffff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-body, #111827) 8%, transparent);
  flex-shrink: 0;
}

.color-token-chip__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.color-token-chip__label {
  font-weight: 600;
  color: var(--text-body, #111827);
}

.color-token-chip__hint {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}

.background-image-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout-style-picker__label {
  font-weight: 600;
  color: var(--text-body, #111827);
}

.layout-style-picker__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.layout-style-card {
  border: 1px solid var(--border-muted, #dfe3eb);
  background: var(--surface-card, #ffffff);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  text-align: left;
  width: 100%;
  appearance: none;
  color: inherit;
  overflow: hidden;
}

.layout-style-card:hover {
  border-color: var(--border-strong, #cbd2d9);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.layout-style-card:focus-visible {
  outline: 2px solid var(--brand-primary, #1e87f0);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--brand-primary, #1e87f0) 25%, transparent);
}

.layout-style-card[data-selected="true"] {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 8px 18px
    color-mix(in srgb, var(--brand-primary, #1e87f0) 18%, transparent);
  background: var(--surface-accent-primary-soft, #f0f7ff);
}

.layout-style-card__title {
  font-weight: 600;
  color: var(--text-body, #111827);
}

.layout-style-card__description {
  color: var(--text-muted, #4b5563);
  font-size: 0.95rem;
  line-height: 1.45;
}

.layout-style-card[data-selected="true"] .layout-style-card__description {
  color: var(--text-body, #111827);
}

.layout-style-card__preview {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--preview-outline, #e5e7eb);
  border-radius: 8px;
  padding: 8px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.layout-style-card__preview img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.layout-preview {
  width: 100%;
  height: 88px;
  display: flex;
  gap: 8px;
}

.layout-preview--stacked {
  flex-direction: column;
}

.layout-preview--columns {
  display: grid;
  grid-template-columns: repeat(var(--layout-preview-columns, 2), 1fr);
  gap: 8px;
  align-items: start;
}

.layout-preview--list {
  flex-direction: column;
}

.layout-preview--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.layout-preview--centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-preview--steps-horizontal {
  display: flex;
  gap: 10px;
  align-items: center;
}

.layout-preview--steps-vertical {
  flex-direction: column;
}

.layout-preview--toggle {
  display: grid;
  gap: 8px;
}

.layout-preview__card {
  border: 1px solid var(--preview-card-border);
  background: var(--preview-card-bg);
  border-radius: 6px;
  padding: 6px;
  display: grid;
  gap: 4px;
  align-items: flex-start;
}

.layout-preview__card--centered {
  align-items: center;
  text-align: center;
}

.layout-preview__column {
  display: grid;
  gap: 5px;
  align-items: start;
}

.layout-preview__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-preview__line {
  height: 6px;
  border-radius: 999px;
  background: var(--preview-line);
}

.layout-preview__line[data-accent="true"] {
  background: var(--preview-line-accent);
}

.layout-preview__media {
  background: linear-gradient(
    135deg,
    var(--preview-media-start),
    var(--preview-media-end)
  );
  border: 1px solid var(--preview-media-border);
  border-radius: 8px;
  min-height: 52px;
}

.layout-preview__media[data-wide="true"] {
  min-height: 64px;
}

.layout-preview__media[data-compact="true"] {
  min-height: 34px;
}

.layout-preview__icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--preview-icon-bg);
}

.layout-preview__icon-tile {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--preview-icon-tile-border);
  background: var(--preview-icon-tile-bg);
}

.layout-preview__badge {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--preview-badge-bg);
  color: var(--preview-badge-text);
  font-weight: 700;
  font-size: 12px;
}

.layout-preview__pill {
  width: 58px;
  height: 10px;
  border-radius: 999px;
  background: var(--preview-pill-bg);
}

.layout-style-picker--appearance {
  position: static;
  z-index: 2;
  gap: 10px;
}

.layout-style-picker__options--appearance {
  position: static;
  z-index: 1;
  min-height: 0;
  gap: 8px;
}

.page-editor .content-editor-body,
.page-editor [data-block-editor="true"] {
  min-height: 0;
}

.layout-preview__accordion {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--preview-accordion-bg);
  border: 1px dashed var(--preview-accordion-border);
}

.layout-preview__toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.layout-preview__toggle-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.layout-preview__metric {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed var(--preview-metric-border);
  background: var(--preview-metric-bg);
}


/* Block editor live preview */
.page-editor-preview-layout [data-block-list="true"] {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-block-row="true"] {
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-card, #fff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

[data-block-row="true"][data-block-hover="true"] {
  border-color: var(--border-muted, #cbd2d9);
  background-color: var(--surface-subtle, #f8fafc);
}

[data-block-row="true"][aria-selected="true"] {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 6px 18px rgba(30, 135, 240, 0.08);
  background-color: var(--surface-accent-soft, #f0f7ff);
}


.page-editor-preview-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.page-editor-mode-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.page-editor-mode-switch__label {
  font-weight: 600;
  color: var(--text-muted, #4b5563);
}

.page-editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.page-editor-tab {
  width: 100%;
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-card, #fff);
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text-body, #111827);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.page-editor-tab.is-active {
  border-color: var(--brand-primary, #1e87f0);
  background: var(--surface-accent-soft, #f0f7ff);
  color: var(--brand-primary, #1e87f0);
  box-shadow: 0 4px 12px rgba(30, 135, 240, 0.08);
}

.page-editor-preview-toggle {
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-card, #fff);
  padding: 6px 12px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted, #4b5563);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.page-editor-preview-toggle:hover {
  border-color: var(--brand-primary, #1e87f0);
  color: var(--brand-primary, #1e87f0);
}

.page-editor-workspace {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.page-editor-workspace [data-editor-pane="true"],
.page-editor-workspace .page-preview-pane {
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

.page-editor-workspace[data-mode="preview"] [data-editor-pane="true"] {
  display: none;
}

.page-editor-workspace[data-mode="structure"] .page-preview-pane {
  display: none;
}

.page-editor-workspace[data-mode="preview"] .page-preview-pane {
  display: block;
}

/* Edit-mode: stacked preview below editor on narrow screens */
@media (max-width: 1023px) {
  .page-editor-workspace[data-mode="edit"] .page-preview-pane {
    margin-top: 16px;
  }
}

/* Side-by-side editor + live preview in edit mode (wide screens) */
@media (min-width: 1024px) {
  .page-editor-workspace[data-mode="edit"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  .page-editor-workspace[data-mode="edit"] [data-editor-pane="true"] {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .page-editor-workspace[data-mode="edit"] .page-preview-pane {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

/* Hide preview actions (device mode, fullwidth) in edit mode – not applicable to split view */
.page-editor-workspace[data-mode="edit"] .page-preview-pane .page-preview-actions {
  display: none;
}

/* Collapse toggle: hide preview in edit mode when user closes it */
.page-editor-workspace[data-mode="edit"].is-edit-preview-collapsed .page-preview-pane {
  display: none;
}

@media (min-width: 1024px) {
  .page-editor-workspace[data-mode="edit"].is-edit-preview-collapsed {
    grid-template-columns: 1fr;
  }
}

/* Edit-mode preview: remove the 80vh cap (pane itself is height-constrained) */
.page-editor-workspace[data-mode="edit"] .page-preview-canvas {
  max-height: none;
}

/* Compact preview header in edit-mode split view */
.page-editor-workspace[data-mode="edit"] .page-preview-pane .page-preview-header {
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-muted, #e5e7eb);
}

.page-preview-pane {
  background: var(--surface-muted, #f7f9fb);
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.page-preview-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-body, #1f2933);
}

.page-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.page-preview-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-muted, #dfe3eb);
  background: var(--surface-card, #fff);
  border-radius: 6px;
  padding: 4px 8px;
  line-height: 1;
  font-weight: 700;
  color: var(--text-body, #111827);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-preview-close:hover {
  border-color: var(--border-muted, #cbd5e0);
}

.page-preview-mode-toggle {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.page-preview-mode-toggle__btn {
  border-radius: 8px;
  border: 1px solid var(--border-muted, #dfe3eb);
  background: var(--surface-card, #fff);
  color: var(--text-body, #111827);
  padding: 6px 10px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.page-preview-mode-toggle__btn:hover {
  border-color: var(--border-muted, #cbd5e0);
}

.page-preview-mode-toggle__btn.is-active {
  border-color: var(--brand-primary, #1e87f0);
  color: var(--brand-primary, #1e87f0);
  background: var(--surface-accent-soft, #eef5ff);
  box-shadow: 0 6px 14px rgba(30, 135, 240, 0.12);
}

.page-preview-fullwidth-toggle {
  border-radius: 8px;
  border: 1px solid var(--border-muted, #dfe3eb);
  background: var(--surface-card, #fff);
  color: var(--text-body, #111827);
  padding: 6px 10px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.page-preview-fullwidth-toggle:hover {
  border-color: var(--border-muted, #cbd5e0);
}

.page-preview-fullwidth-toggle.is-active {
  border-color: var(--brand-primary, #1e87f0);
  color: var(--brand-primary, #1e87f0);
  background: var(--surface-accent-soft, #eef5ff);
  box-shadow: 0 6px 14px rgba(30, 135, 240, 0.12);
}

.page-preview-mode-hint {
  display: none;
  font-size: 12px;
  color: var(--text-muted, #4b5563);
  margin-bottom: 6px;
  font-weight: 600;
}

.page-preview-viewport {
  display: flex;
  justify-content: center;
  padding: 4px;
  width: 100%;
  box-sizing: border-box;
}

.page-preview-canvas {
  background: var(--surface-section, #fff);
  border: 1px solid var(--border-muted, #e5e7eb);
  border-radius: 8px;
  padding: 0;
  max-height: 80vh;
  overflow: auto;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  pointer-events: auto;
}

.page-preview-iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 120px;
}

.page-preview-pane[data-preview-mode="tablet"] .page-preview-canvas {
  max-width: 768px;
  border-color: var(--border-muted, #d7dde6);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.page-preview-pane[data-preview-mode="mobile"] .page-preview-canvas {
  max-width: 375px;
  border-color: var(--border-muted, #d7dde6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.page-preview-pane[data-preview-mode="mobile"] .page-preview-mode-hint,
.page-preview-pane[data-preview-mode="tablet"] .page-preview-mode-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-editor-preview-layout.is-preview-expanded {
  flex-wrap: nowrap;
}

.page-editor-preview-layout.is-preview-expanded [data-editor-pane="true"] {
  display: none;
}

.page-preview-pane.is-preview-expanded {
  flex: 1 1 100%;
  max-width: none;
  width: 100%;
}

.page-preview-pane.is-preview-expanded .page-preview-viewport {
  padding: 0;
  justify-content: center;
}

.page-preview-pane.is-preview-expanded .page-preview-canvas {
  max-width: none;
}

.page-preview-pane.is-preview-expanded[data-preview-mode="tablet"] .page-preview-canvas {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

.page-preview-pane.is-preview-expanded[data-preview-mode="mobile"] .page-preview-canvas {
  max-width: 375px;
}

/* Block selection, hover, editable and preview-intent styles for the
   preview surface are injected as inline <style> inside the preview iframe
   so that they cascade correctly within the iframe document context. */

/* Stat strip block */
.stat-strip__grid {
  align-items: stretch;
}

.stat-strip__card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stat-strip__label {
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stat-strip__meta {
  margin-top: 8px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-strip__meta-item {
  margin: 0;
  line-height: 1.4;
}

.stat-strip__meta-placeholder {
  display: block;
  height: 1.4em;
  visibility: hidden;
}

/* ==========================================================================
   ADMIN MOBILE COMPACT OVERRIDES
   Scope: .admin-page at max-width: 639px
   Purpose: Reduce wasted space on mobile admin views for an edge-to-edge,
   compact feel. Desktop layout is completely untouched.
   ========================================================================== */

@media (max-width: 639px) {

  /* ── 1. Body padding ──
     The body carries uk-padding (UIKit: 30px). On admin pages we want
     near-zero horizontal padding so cards can fill the viewport width. */
  body.admin-page.uk-padding {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 8px;
  }

  /* ── 2. Main content area ──
     UIKit's uk-padding gives 30px on all sides. Override to tight values. */
  .admin-page main.uk-padding,
  .admin-page main.uk-width-expand {
    padding: 8px 4px !important;
  }

  /* ── 3. Container constraints ──
     Remove horizontal padding and let content fill the screen. */
  .admin-page .uk-container,
  .admin-page .uk-container-large {
    padding-left: 4px;
    padding-right: 4px;
    max-width: 100%;
  }

  /* ── 4. Admin shell max-width ──
     Remove max-width constraint on mobile. */
  .admin-shell .admin-main-container,
  .admin-shell .admin-section,
  .admin-shell .uk-container {
    max-width: 100%;
  }

  /* ── 5. Card border-radius ──
     12px radius + side margins = visible unused gaps.
     6px keeps softness without wasting space. */
  .admin-page .uk-card,
  .admin-page .qr-card,
  .admin-page .uk-panel {
    border-radius: 6px;
  }

  /* ── 6. Card body padding ──
     20px is generous on a 375px screen. 12px is compact. */
  .admin-page .uk-card-body {
    padding: 12px;
  }

  /* ── 7. Dashboard grid ──
     Lower minimum column width and tighten gap. */
  .admin-page .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
  }

  /* ── 8. Dashboard container ── */
  .admin-page .dashboard-container {
    padding-left: 4px;
    padding-right: 4px;
  }

  .admin-page .dashboard-grid {
    margin-left: -4px;
  }

  .admin-page .dashboard-grid > * {
    padding-left: 4px;
  }

  /* ── 9. Dashboard tile card padding ── */
  .admin-page .dashboard-tile > .uk-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  /* ── 10. UIKit grid-large override ──
     Grid-large adds ~50px gap; reduce for mobile stacked layout.
     UIKit uses padding-left on children for gutters, so reset both. */
  .admin-page .uk-grid-large {
    margin-left: 0;
  }

  .admin-page .uk-grid-large > * {
    margin-left: 0;
    padding-left: 0;
  }

  .admin-page .uk-grid-large > .uk-grid-margin {
    margin-top: 12px;
  }

  /* ── 11. Margin overrides ── */
  .admin-page .uk-margin-large-top {
    margin-top: 16px !important;
  }

  .admin-page .uk-margin-top {
    margin-top: 12px !important;
  }

  /* ── 12. Section headings compaction ── */
  .admin-page h1.uk-heading-bullet {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  /* ── 13. Switcher (tab panels) margin ── */
  .admin-page .uk-switcher.uk-margin {
    margin-top: 8px;
  }

  /* ── 14. Form field spacing ── */
  .admin-page .uk-form-stacked .uk-margin {
    margin-bottom: 12px;
  }

  /* ── 15. Alert compaction ── */
  .admin-page .uk-alert {
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  /* ── 16. Sticky section in event config ── */
  .admin-page .uk-section.uk-padding-small {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .admin-page .uk-section-xsmall {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* ── 17. Tab bar compaction ── */
  .admin-page [uk-tab] > li > a {
    padding: 6px 8px;
    font-size: 0.8125rem;
  }

  /* ── 18. Page editor – structure view block rows ──
     On small screens, let the card-row__summary wrap so action buttons
     can flow below the label when space is tight. */
  [data-block-row="true"] .card-row__summary {
    flex-wrap: wrap;
  }

  /* ── 19. Template picker grid – single column on small screens ── */
  .template-picker-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .template-picker-grid .layout-style-card {
    min-height: 140px;
  }

  .page-editor [data-template-chooser="true"] {
    padding: 12px;
    gap: 10px;
  }

  /* ── 20. Layout style picker – smaller cards on mobile ── */
  .layout-style-picker__options {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .layout-style-card {
    padding: 10px;
    gap: 8px;
  }

  .layout-style-card__preview {
    min-height: 64px;
    padding: 6px;
  }

  /* ── 21. Page editor tabs – compact on mobile ── */
  .page-editor-tabs {
    gap: 4px;
  }

  .page-editor-tab {
    padding: 8px 6px;
    font-size: 0.8125rem;
  }

  .page-editor-mode-switch {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* ── 22. Block form sections – tighter padding ── */
  .block-form-section {
    padding: 10px;
    gap: 8px;
    border-radius: 8px;
  }

  .optional-section__body {
    padding: 10px;
    gap: 8px;
  }

  .block-form-section[data-optional-section="true"] > summary {
    padding: 10px;
  }

  .block-form-section[data-optional-section="true"] > :not(summary):not(.block-form-section__hint):not(.optional-section__body) {
    margin-left: 10px;
    margin-right: 10px;
  }

  .block-form-section[data-optional-section="true"] > :last-child:not(summary):not(.block-form-section__hint) {
    margin-bottom: 10px;
  }

  .block-form-section[data-optional-section="true"] .block-form-section__hint {
    padding: 0 10px 2px;
  }

  .block-form-fields {
    gap: 10px;
  }

  .optional-field-card {
    padding: 8px 10px;
    gap: 6px;
    border-radius: 6px;
  }

  .page-editor [data-block-editor="true"] {
    padding: 10px;
    gap: 10px;
    border-radius: 8px;
  }

  /* ── 23. Editor body spacing ── */
  .page-editor .content-editor-body {
    gap: 10px;
  }

  .page-editor [data-block-list="true"] {
    gap: 6px;
    padding-bottom: 8px;
  }

  .page-editor [data-block-list="true"] ul {
    gap: 6px;
  }

  /* ── 24. Section heading compact ── */
  .section-heading__title {
    font-size: 1rem;
  }

  .section-heading__meta {
    font-size: 0.8125rem;
  }

  /* ── 25. Preview pane compact ── */
  .page-preview-pane {
    padding: 8px;
  }

  .page-preview-actions {
    gap: 4px;
  }

  .page-preview-mode-toggle {
    gap: 4px;
  }

  .page-preview-mode-toggle__btn {
    padding: 4px 8px;
    font-size: 0.8125rem;
  }

  /* ── 26. Block repeater cards ── */
  .block-repeater-card {
    border-radius: 8px;
  }

  /* ── 27. Editor actions row ── */
  .page-editor [data-editor-actions="true"] {
    flex-wrap: wrap;
  }

  .page-editor [data-editor-actions="true"] .uk-button {
    font-size: 0.8125rem;
    padding: 6px 12px;
  }

  /* ── 28. Page tree compaction ── */
  .page-tree [data-page-tree-info="true"] {
    flex: 1 1 100%;
    min-width: 0;
  }

  .page-tree [data-page-tree-info="true"] .uk-text-meta {
    display: none;
  }

  .page-tree .page-tree-select {
    font-size: 0.8125rem;
  }

  .page-tree .page-tree-action {
    font-size: 0.75rem;
    padding: 2px 8px;
  }

  .page-tree-action-toggle {
    width: 44px;
    height: 44px;
  }

  .page-tree-actions {
    margin-left: 8px;
  }

  /* ── 29. Accordion inside content page ── */
  .admin-page .uk-accordion-title {
    font-size: 0.875rem;
  }

  .admin-page .uk-accordion-content {
    padding: 8px 0;
  }
}

/* ── 30. Subscription / Customer Portal ── */

.pricing-plan-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-plan-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-heading, var(--text-body));
  margin-top: 0.25rem;
}

.pricing-plan-price .uk-text-meta {
  font-size: 0.875rem;
  font-weight: 400;
}

.pricing-plan-card .uk-list {
  flex: 1;
}

.pricing-plan-card .plan-select {
  margin-top: auto;
}

.pricing-plan-card--active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.pricing-plan-card--active .plan-select {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Icon picker ────────────────────────────────────────────────── */

.icon-picker__input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-picker__preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 6px;
  background: var(--surface-subtle, #f8fafc);
  color: var(--text-body, #111827);
}

.icon-picker__text-input {
  flex: 1;
  min-width: 0;
}

.icon-picker__toggle {
  flex-shrink: 0;
  padding: 0 8px;
  height: 34px;
}

[data-field-label] {
  position: relative;
}

.icon-picker__dropdown {
  position: absolute;
  z-index: 1010;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-muted, #dfe3eb);
  border-radius: 10px;
  background: var(--surface-card, #ffffff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
}

.icon-picker__search-row {
  position: sticky;
  top: -8px;
  z-index: 1;
  background: var(--surface-card, #ffffff);
  padding-bottom: 8px;
}

.icon-picker__search {
  width: 100%;
}

.icon-picker__group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
  padding: 8px 4px 4px;
}

.icon-picker__group-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.icon-picker__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text-body, #111827);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  padding: 0;
}

.icon-picker__icon-btn:hover {
  background: var(--surface-subtle, #f3f4f6);
  border-color: var(--border-muted, #dfe3eb);
}

.icon-picker__icon-btn:focus-visible {
  outline: 2px solid var(--brand-primary, #1e87f0);
  outline-offset: -1px;
}

.icon-picker__icon-btn--active {
  background: var(--surface-accent-primary-soft, #f0f7ff);
  border-color: var(--brand-primary, #1e87f0);
}

/* ── Assign: gefüllte Dropzone ── */
.dropzone.is-filled {
  border-color: var(--brand-primary, #1e87f0);
  border-style: solid;
  background: color-mix(in srgb, var(--brand-primary, #1e87f0) 8%, transparent);
}

/* ── MC: korrekte / falsche Optionen nach Check ── */
.mc-option.is-correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: #16a34a;
}
.mc-option.is-wrong {
  background: rgba(220, 38, 38, 0.12);
  border-color: #dc2626;
}
.mc-option.is-correct .uk-checkbox,
.mc-option.is-wrong .uk-checkbox {
  pointer-events: none;
}

/* ── Flip: Hinweistext unter der Karte ── */
.flip-hint {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.5rem;
  transition: opacity 0.3s;
}
.flip-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Admin: Question Block Cards (shared with footer block editor) ── */
.question-block-card {
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-muted, #dee2e6);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.question-block-card:hover {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 2px 8px rgba(30, 135, 240, 0.1);
}
.question-block-card__number {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted, #868e96);
  min-width: 1.2em;
  text-align: center;
}
.question-block-card__actions .btn-edit.is-active {
  background: color-mix(in srgb, var(--brand-primary, #1e87f0) 12%, transparent);
  color: var(--brand-primary, #1e87f0);
}
.question-block-card__edit-area {
  border-top: 1px solid var(--border-muted, #dee2e6);
  padding: 0.75rem;
  background: var(--surface-muted, #f8f9fa);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
  max-height: 3000px;
  opacity: 1;
}
.question-block-card__edit-area.is-collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
}
/* Question type selector grid */
.question-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.question-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.25rem;
  border: 2px solid var(--border-muted, #dee2e6);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  background: var(--surface-card, #fff);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted, #868e96);
  user-select: none;
}
.question-type-option:hover {
  border-color: var(--brand-primary, #1e87f0);
  background: #f0f7ff;
  color: var(--text-body, #212529);
}
.question-type-option.is-active {
  border-color: var(--brand-primary, #1e87f0);
  background: #f0f7ff;
  color: var(--brand-primary, #1e87f0);
}
.question-type-option__badge {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1px;
}
/* Admin question card block layout edit-area preview */
.question-block-card__preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #868e96);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
.question-block-card__edit-area .question-preview {
  margin-top: 0;
}
.question-block-card__actions .btn-duplicate:hover {
  background: #f0f7ff;
  color: var(--brand-primary, #1e87f0);
}
.question-block-card__collapse-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.35rem;
  background: none;
  border: 1px dashed var(--border-muted, #dee2e6);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted, #868e96);
  text-align: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.question-block-card__collapse-btn:hover {
  color: var(--brand-primary, #1e87f0);
  border-color: var(--brand-primary, #1e87f0);
}
/* Admin swipe correct column header */
.swipe-card-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #868e96);
  padding: 0 0 0.25rem;
  border-bottom: 1px solid var(--border-muted, #dee2e6);
  margin-bottom: 0.25rem;
}
.swipe-card-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.swipe-card-row__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
/* Assign column headers */
.assign-column-header {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #868e96);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-muted, #dee2e6);
}

/* ── News content editor (Tiptap) ────────────────────────────────────────── */

.news-content-editor {
  border: 1px solid var(--border-strong, #c4cdd8);
  border-radius: 4px;
  background: var(--surface-card, #fff);
  overflow: hidden;
}

.news-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: var(--surface-subtle, #f8fafc);
  border-bottom: 1px solid var(--border-muted, #dee2e6);
}

.news-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-body, #111827);
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.news-editor-btn:hover {
  background: var(--surface-hover, #e9ecef);
  border-color: var(--border-muted, #dee2e6);
}

.news-editor-btn.is-active {
  background: var(--brand-primary, #1e87f0);
  border-color: var(--brand-primary, #1e87f0);
  color: #fff;
}

.news-editor-btn-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border-muted, #dee2e6);
  margin: 0 4px;
}

.news-editor-area {
  min-height: 220px;
}

.news-editor-richtext {
  outline: none;
  padding: 10px 12px;
  min-height: 220px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-body, #111827);
}

.news-editor-richtext:focus-within,
.news-content-editor:focus-within {
  border-color: var(--brand-primary, #1e87f0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #1e87f0) 15%, transparent);
}

.news-content-editor:focus-within {
  border-radius: 4px;
}

/* Heading sizes inside the editor */
.news-editor-richtext h1 { font-size: 1.6rem; font-weight: 700; margin: 0.5em 0 0.25em; }
.news-editor-richtext h2 { font-size: 1.35rem; font-weight: 700; margin: 0.5em 0 0.25em; }
.news-editor-richtext h3 { font-size: 1.15rem; font-weight: 600; margin: 0.5em 0 0.25em; }
.news-editor-richtext h4 { font-size: 1rem; font-weight: 600; margin: 0.5em 0 0.25em; }
.news-editor-richtext h5 { font-size: 0.9rem; font-weight: 600; margin: 0.5em 0 0.25em; }

.news-editor-richtext ul,
.news-editor-richtext ol {
  padding-left: 1.5em;
  margin: 0.25em 0;
}

.news-editor-richtext p {
  margin: 0.25em 0;
}

.news-editor-richtext a {
  color: var(--brand-primary, #1e87f0);
  text-decoration: underline;
  cursor: pointer;
}

.news-editor-richtext img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5em 0;
  display: block;
}
