:root {
    --orange: #f07800;
    --orange-dark: #c86200;
    --orange-soft: #fff1e3;
    --white: #ffffff;
    --bg: #f7f7f8;
    --panel: #ffffff;
    --border: #e8e8eb;
    --text: #1f2937;
    --muted: #6b7280;
    --danger: #dc2626;
    --success: #15803d;
    --navy: #0e2244;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #fafafa;
    color: var(--text);
}

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

.screen.active {
    display: flex;
}

.main-header {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-logo-image {
    width: auto;
    height: 64px;
    object-fit: contain;
}

.start-main,
.admin-main,
.preview-main {
    width: 100%;
    flex: 1;
    padding: 28px 20px 40px;
}

.start-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.simple-layout {
    display: flex;
    justify-content: center;
}

.panel {
    width: 100%;
    max-width: 720px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 3px solid var(--orange);
    border-radius: 18px;
    padding: 28px;
}

.panel-toolbar,
.preview-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-panel {
    max-width: 440px;
}

.panel h2 {
    font-size: 1.45rem;
    margin-bottom: 8px;
    color: var(--navy);
}

.panel-text {
    color: var(--muted);
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 15px;
    font-size: 1rem;
    color: var(--text);
    background: var(--white);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--orange);
}

.form-group textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.6;
}

.settings-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fcfcfd;
}

.section-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 10px;
}

.textarea-title {
    min-height: 110px !important;
}

.textarea-body {
    min-height: 170px !important;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fcfcfc;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 600;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
}

.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--orange);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--orange-dark);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
}

.btn-secondary:hover {
    background: #eaecef;
}

.btn-danger {
    background: #fff1f2;
    color: var(--danger);
}

.btn-small {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.preview-entry {
    min-width: 240px;
}

.hint-text {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
}

.image-upload-status {
    margin-top: 0;
    margin-bottom: 12px;
    min-height: 1.2em;
    text-align: left;
}

.image-upload-status.error {
    color: var(--danger);
}

.image-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
}

.image-preview-thumb {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    border: 1px solid var(--border);
}

.slider-value {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.error-msg {
    display: none;
    margin-bottom: 14px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: var(--danger);
    border-radius: 10px;
    padding: 12px 14px;
}

.db-banner {
    margin-bottom: 16px;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.db-banner.connected {
    background: #f0fdf4;
    color: var(--success);
    border-color: #86efac;
}

.simple-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.poster-preview-stage {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    isolation: isolate;
    justify-content: flex-start;
}

.poster-motion {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    filter: blur(10px);
}

.city-gradient {
    position: absolute;
    inset: -6% -8%;
    background:
        radial-gradient(78% 44% at 12% 88%, rgba(236, 97, 32, 0.35), transparent 72%),
        radial-gradient(64% 42% at 82% 12%, rgba(46, 125, 180, 0.22), transparent 74%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 247, 250, 0.95) 40%, rgba(255, 239, 220, 0.9) 100%);
}

.city-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(32, 45, 65, 0.05) 1px, transparent 1px),
        linear-gradient(to top, rgba(32, 45, 65, 0.05) 1px, transparent 1px);
    background-size: 78px 78px;
    transform: perspective(560px) rotateX(63deg) translateY(18%);
    transform-origin: bottom;
    opacity: 0.55;
    animation: city-grid-shift 12s linear infinite;
}

.ecg-layer {
    position: absolute;
    inset: 58% 2% 8% 0;
    transform: rotate(0deg);
    transform-origin: left center;
    opacity: 0.94;
}

.ecg-svg {
    width: 100%;
    height: 100%;
}

.ecg-track,
.ecg-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ecg-track {
    stroke: rgba(14, 34, 68, 0.12);
    stroke-width: 5;
}

.ecg-line {
    stroke: rgba(240, 120, 0, 0.86);
    stroke-width: 7;
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: ecg-sweep 3.4s linear infinite;
}

.ecg-line-glow {
    stroke: rgba(240, 120, 0, 0.3);
    stroke-width: 15;
    filter: blur(2px);
    animation: ecg-sweep 3.4s linear infinite;
}

@keyframes city-grid-shift {
    from { background-position: 0 0, 0 0; }
    to { background-position: -78px 0, 0 -78px; }
}

@keyframes ecg-sweep {
    0% {
        stroke-dashoffset: 1800;
        opacity: 0.1;
    }
    8% {
        opacity: 1;
    }
    92% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.1;
    }
}

.preview-topbar {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    z-index: 2;
    height: auto;
    min-height: 86px;
    background: transparent;
}

.preview-logo-left {
    height: 64px !important;
    width: auto;
}

.preview-logo-button {
    cursor: pointer;
}

.preview-info-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding-top: 0;
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.display-board {
    width: min(1100px, 100%);
    min-height: 70vh;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.poster-display-board {
    width: min(96vw, 650px);
    aspect-ratio: 500 / 777;
    min-height: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.poster-display-inner {
    position: relative;
    width: 100%;
    flex: 0 0 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 8px 16px 0;
    box-shadow: none;
    overflow: visible;
}

.poster-image-layer {
    position: absolute;
    inset: 18px 24px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.poster-preview-image {
    width: auto;
    max-width: 48%;
    max-height: 52%;
    object-fit: contain;
    filter: drop-shadow(0 12px 30px rgba(17, 24, 39, 0.14));
}

.image-scale-sm {
    max-width: 28%;
    max-height: 28%;
}

.image-scale-md {
    max-width: 42%;
    max-height: 42%;
}

.image-scale-lg {
    max-width: 56%;
    max-height: 56%;
}

.image-scale-xl {
    max-width: 72%;
    max-height: 72%;
}

.image-position-top {
    align-self: flex-start;
    margin-top: 8%;
}

.image-position-center {
    align-self: center;
    margin-top: 0;
}

.image-position-bottom {
    align-self: flex-end;
    margin-bottom: 8%;
}

.poster-text-layer {
    position: absolute;
    inset: 30px 24px 22px;
    display: flex;
    pointer-events: none;
    z-index: 1;
}

.layer-valign-top {
    align-items: flex-start;
}

#titleLayer.layer-valign-top {
    inset: calc(100% + 2px) 14px auto;
    z-index: 4;
}

.layer-valign-middle {
    align-items: center;
}

.layer-valign-bottom {
    align-items: flex-end;
}

.layer-align-left {
    justify-content: flex-start;
}

.layer-align-center {
    justify-content: center;
}

.layer-align-right {
    justify-content: flex-end;
}

.display-widgets {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    min-height: 54px;
}

.widget-box {
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #111111;
    border: none;
    font-weight: 800;
    text-align: left;
    box-shadow: none;
    line-height: 1.15;
    font-size: clamp(1.05rem, 2.7vw, 1.6rem);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.preview-clock-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-end;
    width: 100%;
    gap: 0.4em;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.clock-date-sep {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 400;
    opacity: 0.45;
    line-height: 1;
}

#previewTimeBox {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
}

#previewDateBox {
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
}

#previewWeatherBox {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
}

.clock-colon {
    opacity: 1;
    transition: opacity 0.15s;
    margin: 0 1px;
}

.clock-colon.invisible {
    opacity: 0;
}

.hidden {
    display: none;
}

.display-text {
    flex: 1 1 auto;
    display: block;
    text-align: left;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.35;
    color: var(--navy);
    font-weight: 800;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    padding: 6px 8px;
    width: 100%;
}

.poster-display-text {
    flex: 0 1 auto;
    min-height: 2.2em;
    max-height: 48%;
    padding: 0;
    font-size: clamp(2.1rem, 5.2vw, 3.2rem);
    line-height: 1.15;
    color: #111111;
    text-align: left;
    transform: translateX(0);
    margin-bottom: 0;
    max-width: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    will-change: transform, text-shadow, filter;
    animation: text-float-loop 4.8s ease-in-out infinite;
    animation-play-state: running;
}

.title-text {
    font-weight: 900;
    letter-spacing: 0.01em;
    animation: title-loop 2.8s ease-in-out infinite;
    animation-play-state: running;
}

.body-text {
    font-weight: 700;
    animation: body-loop 3.8s ease-in-out infinite;
    animation-play-state: running;
}

#previewTitle {
    animation: preview-title-pop 3s ease-in-out infinite !important;
    text-shadow: none !important;
}

#previewText {
    animation: preview-body-wave 3.8s ease-in-out infinite !important;
    text-shadow: none !important;
}

@keyframes text-float-loop {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes title-loop {
    0% {
        filter: brightness(1);
        text-shadow: 0 0 0 rgba(240, 120, 0, 0), 0 1px 0 rgba(255, 255, 255, 0.28);
    }
    50% {
        filter: brightness(1.16);
        text-shadow: 0 0 14px rgba(240, 120, 0, 0.52), 0 0 28px rgba(240, 120, 0, 0.24), 0 1px 0 rgba(255, 255, 255, 0.44);
    }
    100% {
        filter: brightness(1);
        text-shadow: 0 0 0 rgba(240, 120, 0, 0), 0 1px 0 rgba(255, 255, 255, 0.28);
    }
}

@keyframes body-loop {
    0% {
        filter: brightness(1);
        text-shadow: 0 0 0 rgba(14, 34, 68, 0);
    }
    50% {
        filter: brightness(1.1);
        text-shadow: 0 0 10px rgba(14, 34, 68, 0.24);
    }
    100% {
        filter: brightness(1);
        text-shadow: 0 0 0 rgba(14, 34, 68, 0);
    }
}

@keyframes preview-title-pop {
    0% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.015);
    }
    100% {
        transform: translateY(0px) scale(1);
    }
}

@keyframes preview-body-wave {
    0% {
        transform: translateY(0px);
        opacity: 0.97;
    }
    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
    100% {
        transform: translateY(0px);
        opacity: 0.97;
    }
}

@media (prefers-reduced-motion: reduce) {
    .poster-display-text {
        animation-duration: 7s;
    }

    .title-text,
    .body-text {
        animation-duration: 5s;
    }
}

.poster-display-text.size-xxs {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    line-height: 1.34;
}

.poster-display-text.size-xs {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    line-height: 1.28;
}

.poster-display-text.size-sm {
    font-size: clamp(1.25rem, 2.8vw, 1.75rem);
    line-height: 1.24;
}

.poster-display-text.size-md {
    font-size: clamp(1.6rem, 3.8vw, 2.45rem);
    line-height: 1.18;
}

.poster-display-text.size-lg {
    font-size: clamp(2.1rem, 5.2vw, 3.2rem);
    line-height: 1.15;
}

.poster-display-text.size-xl {
    font-size: clamp(2.5rem, 6.3vw, 3.9rem);
    line-height: 1.1;
}

.poster-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.poster-footer-label {
    color: rgba(0,0,0,0.3);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.poster-display-text::-webkit-scrollbar {
    width: 8px;
}

.poster-display-text::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 14px;
    }

    .header-logo-image {
        height: 50px;
    }

    .panel {
        padding: 20px;
    }

    .editor-actions,
    .panel-toolbar,
    .preview-toolbar {
        flex-wrap: wrap;
    }

    .display-board {
        min-height: 60vh;
        padding: 18px;
    }

    .display-widgets {
        justify-content: center;
        flex-wrap: wrap;
    }

    .poster-motion {
        inset: 0;
    }

    .city-grid {
        background-size: 62px 62px;
    }

    .ecg-layer {
        inset: 62% 0 8% 0;
        transform: rotate(0deg);
    }

    .poster-display-board {
        width: calc(100% - 56px);
        max-width: 560px;
        margin-top: 0;
    }

    .poster-display-inner {
        flex: 0 0 10%;
        padding: 8px 10px 2px;
        border-radius: 0;
        border-width: 0;
    }

    .poster-image-layer {
        inset: 16px 14px;
    }

    .poster-text-layer {
        inset: 18px 14px;
    }

    #titleLayer.layer-valign-top {
        inset: calc(100% + 2px) 10px auto;
        z-index: 4;
    }

    .image-preview-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .image-preview-thumb {
        width: 100%;
        max-width: 180px;
    }

    .image-scale-sm {
        max-width: 34%;
        max-height: 34%;
    }

    .image-scale-md {
        max-width: 48%;
        max-height: 48%;
    }

    .image-scale-lg {
        max-width: 64%;
        max-height: 64%;
    }

    .image-scale-xl {
        max-width: 78%;
        max-height: 78%;
    }

    .poster-display-text {
        font-size: clamp(1.8rem, 8.8vw, 2.8rem);
        text-align: left;
        transform: translateX(0);
        line-height: 1.24;
        max-height: 100%;
        animation: none !important;
        will-change: auto;
    }

    #previewTitle,
    #previewText,
    .title-text,
    .body-text {
        animation: none !important;
    }

    .poster-display-text.size-xxs {
        font-size: clamp(0.84rem, 3.5vw, 1.1rem);
        line-height: 1.36;
    }

    .poster-display-text.size-xs {
        font-size: clamp(0.92rem, 3.8vw, 1.2rem);
        line-height: 1.32;
    }

    .poster-display-text.size-sm {
        font-size: clamp(1.08rem, 4.7vw, 1.45rem);
        line-height: 1.28;
    }

    .poster-display-text.size-md {
        font-size: clamp(1.3rem, 5.8vw, 1.9rem);
        line-height: 1.2;
    }

    .poster-display-text.size-lg {
        font-size: clamp(1.8rem, 8.8vw, 2.8rem);
        line-height: 1.15;
    }

    .poster-display-text.size-xl {
        font-size: clamp(2.05rem, 10.4vw, 3.2rem);
        line-height: 1.08;
    }

    .preview-logo-left {
        height: 56px;
    }

    .preview-info-stack {
        gap: 0;
        padding-top: 0;
    }

    #previewDateBox {
        font-size: clamp(1.2rem, 3.6vw, 1.8rem);
    }

    #previewWeatherBox {
        font-size: clamp(1.3rem, 4.1vw, 2rem);
    }

    .widget-box {
        min-width: 0;
        font-size: clamp(0.95rem, 4.5vw, 1.35rem);
        padding: 4px 10px;
    }
}

/* ── Großer Bildschirm (z. B. großes Desktop-Display, ≥ 1280 px) ── */
@media (min-width: 1280px) {
    .poster-display-board {
        width: min(66vw, 820px);
        margin-top: 0;
    }

    .preview-logo-left {
        height: 120px !important;
    }

    .preview-topbar {
        min-height: 140px;
        padding: 16px 32px;
    }

    .widget-box {
        font-size: clamp(1.4rem, 2.2vw, 2.2rem);
    }

    #previewTimeBox {
        font-size: clamp(1.6rem, 2.4vw, 2.6rem);
    }

    #previewDateBox {
        font-size: clamp(2rem, 3vw, 3.2rem);
    }

    #previewWeatherBox {
        font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    }

    .poster-display-text.size-xxs { font-size: clamp(1rem,   1.4vw, 1.6rem); }
    .poster-display-text.size-xs  { font-size: clamp(1.3rem, 1.7vw, 2rem);   }
    .poster-display-text.size-sm  { font-size: clamp(1.6rem, 2.2vw, 2.8rem); }
    .poster-display-text.size-md  { font-size: clamp(2.2rem, 3vw,   3.8rem); }
    .poster-display-text.size-lg  { font-size: clamp(3rem,   4.2vw, 5.4rem); }
    .poster-display-text.size-xl  { font-size: clamp(3.8rem, 5.3vw, 6.8rem); }
}

/* ── TV / Full-HD-Display (≥ 1920 px) ── */
@media (min-width: 1920px) {
    .poster-display-board {
        width: min(78vh, 1160px);
        margin-top: 0;
    }

    .poster-display-inner {
        flex: 0 0 10%;
        padding: 10px 18px 4px;
    }

    .poster-photo-grid {
        padding: 2px 8px 8px;
    }

    .preview-logo-left {
        height: 160px !important;
    }

    .preview-topbar {
        min-height: 190px;
        padding: 20px 48px;
    }

    /* TV performance profile: reduce expensive blur effects and keep motion clean */
    .poster-motion {
        filter: none;
        -webkit-filter: none;
    }

    .city-grid {
        transform: perspective(560px) rotateX(63deg) translateY(20%);
        animation: none;
        opacity: 0.26;
    }

    .ecg-layer {
        inset: 58% 1% 8% 0;
    }

    .ecg-track {
        stroke-width: 4;
    }

    .ecg-line {
        stroke-width: 6;
        animation-duration: 4.6s;
    }

    .ecg-line-glow {
        display: none;
    }

    .ecg-svg {
        shape-rendering: geometricPrecision;
    }

    .poster-display-text,
    #previewTitle,
    #previewText,
    .title-text,
    .body-text {
        animation: none !important;
    }

    .widget-box {
        font-size: clamp(2rem, 2.8vw, 3.2rem);
    }

    #previewTimeBox {
        font-size: clamp(2.2rem, 3.4vw, 4rem);
    }

    #previewDateBox {
        font-size: clamp(1.9rem, 2.8vw, 3.3rem);
    }

    #previewWeatherBox {
        font-size: clamp(2.2rem, 3.3vw, 3.8rem);
    }

    .poster-display-text.size-xxs { font-size: clamp(1.2rem, 1.2vw, 2rem);   }
    .poster-display-text.size-xs  { font-size: clamp(1.5rem, 1.6vw, 2.6rem); }
    .poster-display-text.size-sm  { font-size: clamp(2rem,   2.2vw, 3.2rem); }
    .poster-display-text.size-md  { font-size: clamp(3rem,   3.5vw, 5rem);   }
    .poster-display-text.size-lg  { font-size: clamp(4.2rem, 5vw,   7rem);   }
    .poster-display-text.size-xl  { font-size: clamp(5.5rem, 6.5vw, 9.5rem); }
}

/* ── Foto-Grid (Poster-Vorschau) ── */
.poster-photo-grid {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    padding: 0px 2px 2px;
}

.poster-photo-grid.hidden {
    display: none;
}

.poster-photo-grid.grid-gap-sm { gap: 3px; padding: 0px 2px 2px; }
.poster-photo-grid.grid-gap-md { gap: 10px; padding: 0px 6px 6px; }
.poster-photo-grid.grid-gap-lg { gap: 20px; padding: 0px 12px 12px; }

.photo-grid-img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    padding: 0;
    background: transparent;
    box-sizing: border-box;
}

.grid-fit-cover  { object-fit: contain !important; padding: 0 !important; }
.grid-fit-contain { object-fit: contain !important; padding: 0 !important; }

.photo-grid-img.empty {
    opacity: 0;
    background: transparent;
    border-radius: 8px;
}

#previewTitle {
    margin-top: 28px;
}

/* ── Foto-Grid (Admin-Bereich) ── */
.photo-grid-admin {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.grid-slot-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.grid-slot-num {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.grid-slot-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: #f3f4f6;
}

.grid-slot-file {
    width: 100%;
    font-size: 0.76rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 6px;
    background: var(--white);
    cursor: pointer;
}

@media (max-width: 540px) {
    .photo-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }

    .city-grid {
        opacity: 0.38;
        transform: perspective(460px) rotateX(64deg) translateY(26%);
    }

    .ecg-layer {
        inset: 66% 0 8% 0;
        opacity: 0.72;
    }
}
