/* Walsrode Events – Plakat scannen im Event-Formular */
.poster-ai {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 6px;
    border: 1px dashed #d5161d;
    border-radius: 12px;
    background: #fff6f5;
}

.poster-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.poster-ai-head strong {
    display: block;
    color: #111827;
    font-size: 15px;
}

.poster-ai-head span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.poster-ai-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.poster-ai-actions label.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

.poster-ai-actions .poster-ai-secondary {
    background: #fff;
    color: #111827;
    border: 1px solid #d5d9df;
}

.poster-ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #334155;
}

.poster-ai-status small {
    color: #64748b;
}

.poster-ai-status.is-ok {
    color: #15803d;
    font-weight: 600;
}

.poster-ai-status.is-error {
    color: #ad1117;
    font-weight: 600;
}

.poster-ai-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #f2c4c6;
    border-top-color: #d5161d;
    animation: poster-ai-spin .8s linear infinite;
}

@keyframes poster-ai-spin {
    to { transform: rotate(360deg); }
}

.poster-ai-missing {
    font-size: 13.5px;
    line-height: 1.5;
    color: #7c2d12;
    background: #fdf3e2;
    border-radius: 8px;
    padding: 8px 10px;
}

.poster-ai-dup {
    color: #ad1117;
}

.poster-ai-dup-link {
    display: inline-block;
    color: #111827;
    font-weight: 600;
    text-decoration: underline;
    margin: 2px 0;
}

.poster-ai-filled {
    background: #fffbea !important;
    border-color: #e9c46a !important;
}

.poster-ai-texts {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.poster-ai-texts-head {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.poster-ai-text {
    text-align: left;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
    background: #fff;
    border: 1px solid #d5d9df;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}

.poster-ai-text span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #d5161d;
    margin-bottom: 3px;
}

.poster-ai-text:hover,
.poster-ai-text.is-active {
    border-color: #d5161d;
    box-shadow: 0 0 0 3px #fdecec;
}

@media (prefers-reduced-motion: reduce) {
    .poster-ai-spinner {
        animation: none;
    }
}

/* Plakat zuschneiden (4 Ecken) */
html.pc-open, html.pc-open body { overflow: hidden; }
.pc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #0d0f14;
    color: #f3f4f6;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.pc-head { display: grid; gap: 2px; padding: 4px 4px 10px; }
.pc-head strong { font-size: 17px; }
.pc-head span { font-size: 13.5px; color: #b6bac4; }
.pc-stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; }
.pc-img, .pc-svg { position: absolute; }
.pc-svg { pointer-events: none; overflow: visible; }
.pc-svg polygon { fill: rgba(213, 22, 29, .18); stroke: #ff4d55; stroke-width: 2.5; }
.pc-handle {
    position: absolute;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: rgba(213, 22, 29, .85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
    touch-action: none;
    cursor: grab;
    padding: 0;
}
.pc-handle.is-drag { transform: scale(1.25); cursor: grabbing; }
.pc-loupe {
    position: absolute;
    z-index: 3;
    display: none;
    width: 144px;
    height: 144px;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .75), 0 0 0 2px #ff4d55;
    pointer-events: none;
    background: #20242c;
}
.pc-loupe.is-visible { display: block; }
.pc-loupe canvas { display: block; width: 100%; height: 100%; }
.pc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding-top: 12px; }
.pc-btn { border: 1px solid #3a3f4c; background: #1d2029; color: #fff; border-radius: 10px; padding: 11px 16px; font: 600 14px inherit; cursor: pointer; }
.pc-ok { background: #d5161d; border-color: #d5161d; }
.pc-btn:disabled { opacity: .6; }

/* Fortschrittsanzeige beim Lesen des Plakats */
.pa-prog {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    background: #fff;
    border: 1px solid #f2c4c6;
    border-radius: 12px;
    padding: 12px;
}
.pa-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.pa-top strong { color:#111827; font-size:16px; }
.pa-background { border:1px solid #d5d9df; border-radius:9px; padding:7px 10px; background:#fff; color:#334155; font:600 12px Inter,"Segoe UI",Arial,sans-serif; cursor:pointer; }
.pa-background:hover,.pa-background:focus-visible { border-color:#111827; }
body.poster-ai-progress-open::after { position:fixed; inset:0; z-index:100001; background:rgba(15,23,42,.58); content:""; }
.pa-prog.is-floating { position:fixed; top:50%; left:50%; z-index:100002; width:min(650px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); overflow:auto; transform:translate(-50%,-50%); padding:22px; border:1px solid #e5e7eb; border-radius:18px; box-shadow:0 28px 80px rgba(15,23,42,.35); }
@media (max-width:600px) { .pa-prog.is-floating { grid-template-columns:58px minmax(0,1fr); gap:10px; padding:16px 12px; } .pa-prog.is-floating .pa-prev { width:58px; height:78px; } .pa-top { align-items:flex-start; flex-direction:column; } }
.pa-prev {
    position: relative;
    width: 74px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f1f1;
    box-shadow: 0 2px 8px rgba(17, 24, 39, .15);
}
.pa-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 22%;
    top: -22%;
    background: linear-gradient(180deg, rgba(213, 22, 29, 0), rgba(213, 22, 29, .45) 85%, #ff4d55);
    animation: pa-scan 1.8s ease-in-out infinite alternate;
}
@keyframes pa-scan { to { top: 100%; } }
.pa-steps {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    color: #94a3b8;
}
.pa-steps li::before { content: "○ "; }
.pa-steps li.is-done { color: #15803d; }
.pa-steps li.is-done::before { content: "✓ "; }
.pa-steps li.is-now { color: #d5161d; font-weight: 700; }
.pa-steps li.is-now::before { content: "● "; }
.pa-bar { height: 8px; border-radius: 999px; background: #f1e3e3; overflow: hidden; }
.pa-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #d5161d, #ff6b6b, #d5161d);
    background-size: 200% 100%;
    animation: pa-shine 1.6s linear infinite;
    transition: width .9s ease;
}
@keyframes pa-shine { to { background-position: -200% 0; } }
.pa-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; }
.pa-meta b { color: #111827; }
.pa-meta small { color: #64748b; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
    .pa-scan, .pa-bar i { animation: none; }
}

/* "hidden" muss auch bei display:flex/grid greifen */
.poster-ai-status[hidden],
.poster-ai-missing[hidden],
.poster-ai-texts[hidden],
.pa-prog[hidden] { display: none !important; }
