/* ==========================================================================
   Landingpage Morgen-Briefing – Vorführungen (agents/briefing/landing-view.php)
   Nur Variablen aus tokens.css und landing.css, Klassenpräfix lpr-.
   Ruhezustand = Endzustand; die Szenen in js/landing/briefing.js setzen
   Anfangsklassen und animieren dorthin zurück.
   ========================================================================== */

/* ---------- Bausteine: Widget und Kacheln ---------- */
.lpr-widget { position: relative; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.lpr-widget.is-anchor { border-color: var(--lp-a-line); box-shadow: 0 0 0 4px color-mix(in oklab, var(--lp-a) 7%, transparent), 0 18px 40px -28px var(--lp-glow); }
.lpr-widget-head { display: flex; align-items: center; gap: 7px; margin: 0 2px 9px; min-width: 0; }
.lpr-widget-head .icon { color: var(--lp-a); flex: none; }
.lpr-widget-head strong { font-size: var(--fs-sm); color: var(--text); white-space: nowrap; }
.lpr-widget-head span { margin-left: auto; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.lpr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.lpr-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.lpr-tile {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; padding: 8px 9px 7px;
    border-radius: 10px; background: var(--surface-2); border: 1px solid transparent;
    transition: opacity .45s ease, transform .55s cubic-bezier(.2, .9, .25, 1.2), background .35s ease, border-color .35s ease, filter .45s ease;
}
.lpr-tile-label { display: flex; gap: 5px; align-items: flex-start; font-size: 11px; line-height: 1.25; color: var(--text-2); min-height: 2.5em; }
.lpr-tile-label .icon { flex: none; margin-top: 1px; color: var(--lp-a); }
/* Im engen Vierer-Raster des Hero braucht die Beschriftung die ganze Breite */
.lpr-grid:not(.is-3) .lpr-tile-label .icon { display: none; }
.lpr-tile-label > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.lpr-tile-val { font-size: 21px; font-weight: 650; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); transition: color .35s ease; }
.lpr-tile.is-warning { background: var(--c-warning-soft); }
.lpr-tile.is-warning .lpr-tile-val { color: var(--c-warning); }
.lpr-tile.is-danger { background: var(--c-danger-soft); }
.lpr-tile.is-danger .lpr-tile-val { color: var(--c-danger); }
.lpr-tile.is-danger::after {
    content: ""; position: absolute; right: 8px; bottom: 11px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--c-danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-danger) 22%, transparent);
}
/* Zustände der Szenen */
.lpr-tile.is-out { opacity: 0; transform: translateY(18px) scale(.86); filter: blur(3px); }
.lpr-tile.is-hidden { opacity: 0; transform: scale(.8); }
.lpr-tile.is-pressed { transform: scale(.95); }
.lpr-tile.is-hot { border-color: var(--lp-a); box-shadow: 0 0 0 3px var(--lp-a-soft); }
.lpr-tile.is-flash { animation: lpr-flash .7s ease; }
@keyframes lpr-flash { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

.lpr-legend { list-style: none; margin: 10px 2px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--text-2); }
.lpr-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lpr-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--border-strong); flex: none; }
.lpr-legend i.is-danger { background: var(--c-danger); }
.lpr-legend i.is-warning { background: var(--c-warning); }

/* ---------- Hero ---------- */
.lpr-hero { position: relative; display: flex; flex-direction: column; gap: 11px; }
.lpr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lpr-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lpr-head-text strong { font-size: 18px; letter-spacing: -0.015em; color: var(--lp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lpr-head-text span { font-size: 11px; color: var(--text-2); }
.lpr-head-add { flex: none; height: 26px; font-size: 11px; }
.lpr-alex { display: flex; gap: 10px; align-items: flex-start; }
.lpr-alex-text {
    flex: 1; margin: 0; padding: 8px 12px; min-height: 2.9em; border-radius: 4px 14px 14px 14px;
    background: var(--lp-a-soft); border: 1px solid var(--lp-a-line); font-size: var(--fs-xs); line-height: 1.45; color: var(--text);
}
.lpr-ghosts { display: flex; gap: 7px; }
.lpr-ghosts span {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px;
    border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden;
}
.lpr-ghosts .icon { flex: none; }

/* ---------- Bühne der Erzählung ---------- */
.lpr-stage-win .lp-win-body { min-height: 350px; }
/* Die Grundszene liegt im Fluss; inset aus landing.css würde sie sonst um das Innenpolster verschieben */
.lpr-stage-win .lp-stage-scene.is-base { inset: 0; }
.lpr-s1, .lpr-s2, .lpr-s3, .lpr-s4 { display: flex; flex-direction: column; gap: 12px; }
.lpr-s1-head { display: flex; flex-direction: column; gap: 3px; }
.lpr-s1-head strong { font-size: 24px; letter-spacing: -0.02em; color: var(--lp-ink); }
.lpr-s1-head span { font-size: var(--fs-xs); color: var(--text-2); }
.lpr-s1-alex { display: flex; gap: 10px; align-items: flex-start; }
.lpr-s1-alex p { margin: 0; flex: 1; padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--lp-a-soft); border: 1px solid var(--lp-a-line); font-size: var(--fs-sm); line-height: 1.45; }
.lpr-skel { padding: 10px; border-radius: 14px; border: 1px solid var(--lp-a-line); background: var(--surface); }
.lpr-skel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.lpr-skel-grid i {
    display: block; height: 50px; border-radius: 10px;
    background: linear-gradient(90deg, var(--surface-2) 20%, color-mix(in oklab, var(--lp-a) 10%, var(--surface-2)) 50%, var(--surface-2) 80%);
    background-size: 220% 100%; animation: lpr-shimmer 1.6s linear infinite;
}
@keyframes lpr-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.lpr-s3-row { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 250px; }
.lpr-s3-tile { position: relative; width: 170px; flex: none; }
.lpr-s3-tile .lpr-tile { padding: 14px 14px 12px; box-shadow: 0 18px 40px -22px var(--lp-shadow); }
.lpr-s3-tile .lpr-tile-label { font-size: var(--fs-xs); }
.lpr-s3-tile .lpr-tile-val { font-size: 38px; }
.lpr-s3-pointer { position: absolute; right: 18px; bottom: -8px; width: 24px; height: 24px; z-index: 2; }
.lpr-s3-pointer svg { width: 24px; height: 24px; filter: drop-shadow(0 3px 4px color-mix(in oklab, var(--lp-ink) 30%, transparent)); }
.lpr-s3-pointer svg path { fill: var(--lp-ink); stroke: var(--bg); stroke-width: 1.5; }
.lpr-s3-arrow { color: var(--lp-a); display: grid; place-items: center; flex: none; }
.lpr-s3-dest { display: flex; flex-direction: column; gap: 5px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--lp-a-line); min-width: 0; max-width: 240px; box-shadow: 0 18px 40px -26px var(--lp-glow); }
.lpr-s3-dest > span { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lpr-s3-dest strong { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text); }
.lpr-s3-dest strong .icon { color: var(--lp-a); }
.lpr-s3-dest code { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); overflow-wrap: anywhere; }

.lpr-s4-head { display: flex; align-items: center; gap: 8px; }
.lpr-s4-head .icon { color: var(--lp-a); }
.lpr-s4-head strong { flex: 1; font-size: var(--fs-sm); }
.lpr-task { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.lpr-check { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; border: 2px solid var(--c-success); background: var(--c-success); color: var(--surface); }
.lpr-task-text {
    flex: 0 1 auto; min-width: 0; font-size: var(--fs-sm); color: var(--text-2);
    text-decoration: line-through 1.5px; text-decoration-color: currentColor;
}
.lpr-task-state { display: grid; justify-items: end; flex: none; margin-left: auto; }
.lpr-task-state > * { grid-area: 1 / 1; }
.lpr-task-due { opacity: 0; }
.lpr-s4-back { display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 14px; border: 1px dashed var(--lp-a-line); background: var(--lp-a-soft); }
.lpr-s4-back p { margin: 0; display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.lpr-s4-back p .icon { color: var(--lp-a); flex: none; }
.lpr-s4-back .lpr-grid { display: flex; gap: 7px; }
.lpr-s4-back .lpr-tile { flex: 1 1 0; overflow: hidden; }
.lpr-s4-back .lpr-tile[data-gone] { flex-grow: 0; opacity: 0; padding-inline: 0; margin-inline: -4px; border-width: 0; }

/* Einlauf je Schritt: startet neu, sobald die Szene aktiv wird */
@keyframes lpr-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lpr-pop { 0% { opacity: 0; transform: translateY(12px) scale(.88); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes lpr-point { 0% { opacity: 0; transform: translate(60px, 50px); } 60% { opacity: 1; transform: none; } 75% { transform: scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes lpr-press { 0%, 100% { transform: none; } 50% { transform: scale(.95); } }
@keyframes lpr-slide { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes lpr-tick { from { background: transparent; color: transparent; } to { background: var(--c-success); color: var(--surface); } }
@keyframes lpr-strike { from { text-decoration-color: transparent; color: var(--text); } to { text-decoration-color: var(--text-2); color: var(--text-2); } }
@keyframes lpr-swap-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes lpr-gone {
    from { flex-grow: 1; opacity: 1; padding-inline: 9px; margin-inline: 0; border-width: 1px; }
    60% { opacity: 0; }
    to { flex-grow: 0; opacity: 0; padding-inline: 0; margin-inline: -4px; border-width: 0; }
}
.lp-js [data-step="1"] .lpr-s1 > * { animation: lpr-in .5s both; animation-delay: calc(var(--d) * 380ms + 200ms); }
.lp-js [data-step="2"] .lpr-s2 .lpr-tile { animation: lpr-pop .5s both; animation-delay: calc(var(--d) * 170ms + 200ms); }
.lp-js [data-step="2"] .lpr-s2 .lpr-legend { animation: lpr-in .5s both 1.5s; }
.lp-js [data-step="3"] .lpr-s3 .lpr-s3-pointer { animation: lpr-point 1s both .3s; }
.lp-js [data-step="3"] .lpr-s3 .lpr-s3-tile .lpr-tile { animation: lpr-press .35s ease 1.1s; }
.lp-js [data-step="3"] .lpr-s3 .lpr-s3-arrow { animation: lpr-slide .4s both 1.4s; }
.lp-js [data-step="3"] .lpr-s3 .lpr-s3-dest { animation: lpr-slide .5s both 1.7s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-check { animation: lpr-tick .3s both .9s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-task-text { animation: lpr-strike .45s both 1.1s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-task-due { animation: lpr-swap-out .25s both 1.2s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-task-done { animation: lpr-in .4s both 1.3s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-s4-back { animation: lpr-in .5s both 1.9s; }
.lp-js [data-step="4"] .lpr-s4 .lpr-tile[data-gone] { animation: lpr-gone .8s both 2.9s; }

/* ---------- Farben nach Lage ---------- */
.lpr-states { display: flex; flex-direction: column; min-height: 230px; }
.lpr-states .lpr-tile-val { font-size: 26px; }

/* ---------- Wächst mit ---------- */
.lpr-grow { position: relative; display: flex; flex-direction: column; gap: 12px; }
.lpr-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lpr-cat { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.lpr-cat strong { font-size: var(--fs-xs); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lpr-cat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--lp-a-soft); color: var(--lp-a); }
.lpr-cat-btn { height: 24px; font-size: 11px; padding: 0 9px; border-style: dashed; border-color: var(--lp-a-line); color: var(--lp-a); background: var(--surface); transition: background .25s ease, color .25s ease, transform .15s ease; }
.lpr-cat-btn .icon { display: none; }
.lpr-cat-btn.is-on { border-style: solid; border-color: transparent; background: var(--c-success-soft); color: var(--c-success); }
.lpr-cat-btn.is-on .icon { display: inline; }
.lpr-grow .lpr-grid { transition: opacity .3s ease; }
.lpr-empty {
    position: absolute; inset: 38px 10px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    padding: 12px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface);
    opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
}
.lpr-empty p { margin: 0; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; max-width: 42ch; }
.lpr-grow.is-empty .lpr-empty { opacity: 1; visibility: visible; }

/* ---------- Team ---------- */
.lpr-team { display: flex; flex-direction: column; gap: 12px; }
.lpr-team-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lpr-team-tabs span {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; font-size: var(--fs-xs); font-weight: 600;
    color: var(--text-2); background: var(--surface-2); border: 1px solid transparent; transition: all .3s ease;
}
.lpr-team-tabs span.is-active { color: var(--lp-a); background: var(--lp-a-soft); border-color: var(--lp-a-line); }
.lpr-team-panes { display: grid; }
.lpr-team-pane { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease, visibility .35s; }
.lpr-team-pane.is-active { opacity: 1; visibility: visible; transform: none; }
.lpr-team-greet { margin: 0; font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.01em; color: var(--lp-ink); }
.lpr-team-shared { margin: 0; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-2); }
.lpr-team-shared .icon { color: var(--lp-a); flex: none; }

/* ---------- Mini-Demos im Raster ---------- */
.lpr-mini-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lpr-mini-layout span {
    display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 9px; min-width: 0; overflow: hidden; white-space: nowrap;
    font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
}
.lpr-mini-layout span.is-anchor { grid-column: 1 / -1; color: var(--lp-a); background: var(--lp-a-soft); border-color: var(--lp-a-line); }
.lpr-mini-greet { display: flex; flex-wrap: wrap; gap: 6px; }
.lpr-mini-alex .lp-alex-bubble { font-size: var(--fs-xs); }
.lpr-mini-alex .lp-alex-line { color: var(--text); }
.lpr-mini-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.lpr-mini-empty p { margin: 0; flex: 1 1 220px; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 640px) {
    .lpr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lpr-widget { padding: 8px; }
    .lpr-grid { gap: 5px; }
    .lpr-tile { padding: 7px 6px 6px; }
    .lpr-tile-label { font-size: 10px; letter-spacing: -0.02em; }
    .lpr-tile-label .icon { display: none; }
    .lpr-tile-val { font-size: 19px; }
    .lpr-states .lpr-tile-val { font-size: 22px; }
    .lpr-ghosts span:nth-child(3) { display: none; }
    .lpr-head-add { display: none; }
    .lpr-s3-row { gap: 8px; min-height: 200px; }
    .lpr-s3-tile { width: 112px; }
    .lpr-s3-tile .lpr-tile { padding: 10px; }
    .lpr-s3-tile .lpr-tile-val { font-size: 30px; }
    .lpr-s3-pointer { right: 10px; }
    .lpr-s3-dest { padding: 10px; flex: 1; }
    .lpr-s3-dest code { font-size: 10px; }
    .lpr-s1-head strong { font-size: 20px; }
    .lpr-cats { grid-template-columns: 1fr; gap: 6px; }
    .lpr-cat { flex-direction: row; align-items: center; padding: 7px 9px; }
    .lpr-cat strong { flex: 1; }
    .lpr-cat-icon { width: 26px; height: 26px; }
    .lpr-empty { inset: 36px 8px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .lpr-tile, .lpr-skel-grid i, .lpr-s1 > *, .lpr-s2 .lpr-legend, .lpr-s3-pointer, .lpr-s3-arrow, .lpr-s3-dest,
    .lpr-check, .lpr-task-text, .lpr-task-due, .lpr-task-done, .lpr-s4-back, .lpr-team-pane, .lpr-team-tabs span, .lpr-empty, .lpr-cat-btn {
        animation: none !important; transition: none !important;
    }
}
