/* ===================================================================
   App-Shell: Design-System der Seiten ausserhalb des Editors
   (Projekte, Konto, Login, Fehlerseiten). Der Editor bleibt dunkel
   und nutzt builder.css.
   =================================================================== */

:root {
    --bg:          #f6f7fb;
    --bg-soft:     #eef1f8;
    --surface:     #ffffff;
    --border:      #e4e8f0;
    --border-soft: #eef1f6;

    --text:        #131a2b;
    --text-soft:   #5b6577;
    --text-faint:  #8b94a7;

    --primary:     #4f46e5;
    --primary-h:   #4338ca;
    --primary-soft:#eef0fe;
    --on-primary:  #ffffff;

    --danger:      #dc2626;
    --danger-soft: #fef2f2;
    --success:     #059669;
    --success-soft:#ecfdf5;
    --warning:     #b45309;
    --warning-soft:#fffbeb;

    /* Eine Hoehe fuer alle Controls: Inputs, Selects und Buttons stehen
       in Toolbars nebeneinander und muessen exakt fluchten. */
    --control-h:   2.625rem;
    --radius:      12px;
    --radius-lg:   18px;

    --shadow-sm:   0 1px 2px rgba(19, 26, 43, .05);
    --shadow:      0 1px 3px rgba(19, 26, 43, .06), 0 8px 24px -12px rgba(19, 26, 43, .12);
    --shadow-lg:   0 4px 12px rgba(19, 26, 43, .07), 0 24px 48px -24px rgba(19, 26, 43, .22);
    --ring:        0 0 0 3px rgba(79, 70, 229, .16);
}

body.app-shell {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* --- Seitenraster -----------------------------------------------
   Kopfleiste und Inhalt teilen denselben Container. Nur so sitzen
   Logo und Seitentitel auf jeder Seite auf derselben Linie; vorher
   gab jede View ihre eigene Breite vor.
   --------------------------------------------------------------- */

.app-container {
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
    padding-inline: 1.5rem;
}
.app-main { padding-block: 2.5rem; }

/* Lesebreite fuer Formularseiten: Eingabefelder sollen nicht ueber
   die volle Containerbreite laufen, der linke Rand bleibt aber. */
.app-col { max-width: 46rem; }

/* --- Flaechen --------------------------------------------------- */

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.app-card--pad { padding: 1.5rem; }
.app-card--active { border-color: var(--primary); box-shadow: var(--ring); }

/* Projektkarten: Thumbnail rundet oben, Menue darf aus der Karte ragen. */
.project-card { overflow: visible; }
.project-card.is-menu-open { z-index: 30; }
.project-card > a:first-child {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

/* Skeleton: Vorschaubild lädt, Karte arbeitet (Duplizieren, Löschen, Öffnen). */
.app-skeleton,
.project-thumb.is-loading {
    background: linear-gradient(90deg, var(--bg-soft) 0%, #f7f9fc 45%, var(--bg-soft) 90%) 0 0 / 200% 100%;
    animation: app-shimmer 1.3s linear infinite;
}
.project-thumb img { transition: opacity .25s ease; }
.project-thumb.is-loading img { opacity: 0; }
.app-skeleton { border-radius: 6px; }
.app-skeleton--line { height: .75rem; }
@keyframes app-shimmer { to { background-position: -200% 0; } }

.app-loader {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
    border-top-color: var(--primary);
    animation: app-spin .7s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

.project-card-busy {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    border-radius: inherit;
    background: color-mix(in srgb, var(--surface, #fff) 82%, transparent);
    backdrop-filter: blur(2px);
    color: var(--text-soft);
    font-size: .8125rem;
    font-weight: 600;
}
.project-card.is-busy { pointer-events: none; }
.project-card.is-archived .project-thumb > img,
.project-card.is-archived .project-thumb > div:not(.project-archived-lock) { filter: grayscale(1); opacity: .45; }
.project-archived-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    color: var(--text-soft);
    font-size: .8125rem;
    font-weight: 600;
}
.project-archived-lock .bx { font-size: 1.125rem; }
.project-grid.is-opening .project-card:not(.is-busy) { opacity: .55; transition: opacity .2s ease; }

@media (prefers-reduced-motion: reduce) {
    .app-skeleton, .project-thumb.is-loading, .app-loader { animation: none; }
}
.app-menu--up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: .375rem;
}

.app-features { display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; color: var(--text-soft); }
.app-features li { display: flex; align-items: flex-start; gap: .5rem; }
.app-features .bx { color: var(--success); font-size: 1.0625rem; flex-shrink: 0; }
.app-features .is-off { color: var(--text-faint); }
.app-features .is-off .bx { color: var(--text-faint); }

.app-nav {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.app-nav-link {
    color: var(--text-soft);
    font-size: .875rem;
    border-radius: 8px;
    padding: .375rem .625rem;
    transition: color .12s, background .12s;
}
.app-nav-link:hover { color: var(--text); background: var(--bg-soft); }
.app-nav-link.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 550; }
.app-nav-link .bx { font-size: 1.05rem; vertical-align: -2px; }
@media (max-width: 639px) { .app-nav-link--wide { display: none; } }

.app-nav-sep {
    width: 1px;
    height: 1.25rem;
    background: var(--border);
    margin: 0 .25rem;
}
.app-nav-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem;
    font-size: .875rem;
    color: var(--text-soft);
}
.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-h);
    font-size: .75rem;
    font-weight: 650;
}

/* --- Typografie ------------------------------------------------- */

.app-h1 { font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.app-h2 { font-size: 1.0625rem; font-weight: 650; color: var(--text); }
.app-lead  { font-size: .875rem; color: var(--text-soft); }
.app-section-gap { margin-top: 2.5rem; }
.app-hint  { font-size: .8125rem; color: var(--text-faint); }
.app-label {
    display: block;
    font-size: .8125rem;
    font-weight: 550;
    color: var(--text);
    margin-bottom: .375rem;
}

/* --- Controls ---------------------------------------------------
   Alle drei Typen teilen Hoehe, Radius und Fokusring. Das native
   Select bekommt appearance:none, weil es sonst auf macOS eine
   eigene, niedrigere Hoehe rendert und neben Input/Button verrutscht.
   --------------------------------------------------------------- */

.app-input,
.app-select,
.app-btn {
    height: var(--control-h);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: inherit;
    line-height: 1.2;
    transition: border-color .12s, box-shadow .12s, background .12s, color .12s;
}

.app-input,
.app-select {
    width: 100%;
    padding: 0 .875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
}
.app-input::placeholder { color: var(--text-faint); }
.app-input:focus,
.app-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}
.app-input:disabled,
.app-select:disabled { background: var(--bg-soft); color: var(--text-faint); cursor: not-allowed; }

/* Eigene Formularprüfung (form-validate.js) statt Browser-Blasen */
.app-input[aria-invalid="true"],
.app-select[aria-invalid="true"] { border-color: var(--danger); }
.app-input[aria-invalid="true"]:focus,
.app-select[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .16); }
.app-field-error {
    display: flex; align-items: flex-start; gap: .375rem;
    margin-top: .375rem;
    font-size: .8125rem; line-height: 1.35; color: var(--danger);
    animation: app-field-error-in .16s ease-out;
}
.app-field-error .bx { flex-shrink: 0; font-size: 1rem; line-height: 1.1rem; }
@keyframes app-field-error-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-field-error { animation: none; } }
.auth-challenge { min-height: 65px; }
.auth-challenge.is-invalid .cf-turnstile { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--danger); }

/* Chevron als Hintergrundbild, da appearance:none das native entfernt. */
.app-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1.05rem;
    cursor: pointer;
}

.app-input--icon { padding-left: 2.5rem; }

/* Einmalcodes: breit laufend und mittig, damit die Ziffern zaehlbar sind. */
.app-input--code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.25rem;
    letter-spacing: .35em;
    text-align: center;
    padding-right: .5rem;
    padding-left: .85rem;
}
.app-field { position: relative; }
.app-field-icon {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 1.05rem;
    pointer-events: none;
    line-height: 1;
}

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 0 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
}
.app-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.app-btn .bx { font-size: 1.125rem; }
.app-btn:disabled { opacity: .55; cursor: not-allowed; }
.app-btn--block { width: 100%; }
.app-btn--sm { height: 2.25rem; font-size: .8125rem; padding: 0 .875rem; }

.app-btn--primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-sm);
}
.app-btn--primary:hover:not(:disabled) { background: var(--primary-h); }

.app-btn--secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.app-btn--secondary:hover:not(:disabled) { background: var(--bg-soft); border-color: #d4dae6; }

.app-btn--ghost { background: transparent; color: var(--text-soft); }
.app-btn--ghost:hover:not(:disabled) { background: var(--bg-soft); color: var(--text); }

.app-btn--danger { background: var(--danger); color: #fff; }
.app-btn--danger:hover:not(:disabled) { background: #b91c1c; }

.app-btn--danger-soft { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.app-btn--danger-soft:hover:not(:disabled) { background: #fee2e2; }

.app-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.375rem;
}
.app-addon { display: flex; align-items: flex-start; gap: .875rem; }
.app-addon > .app-tile { margin-top: -.125rem; }
.app-addon-body { flex: 1; min-width: 0; }
.app-tile--success { background: var(--success-soft); color: var(--success); }
.app-tile--warning { background: var(--warning-soft); color: var(--warning); }
.app-tile--danger  { background: var(--danger-soft);  color: var(--danger); }

.app-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    margin: -.25rem -.375rem 0 0;
    border-radius: 8px;
    color: var(--text-faint);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.app-icon-btn:hover { background: var(--bg-soft); color: var(--text); }

.app-link { color: var(--primary); font-weight: 550; }
.app-link:hover { color: var(--primary-h); text-decoration: underline; }

.app-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 2.25rem;
    margin-left: -.75rem;
    padding: 0 .875rem;
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.app-back i { font-size: 1.125rem; }
.app-back:hover { background: var(--bg-soft); color: var(--text); }
.app-back:focus-visible { outline: none; box-shadow: var(--ring); }

/* --- Feedback --------------------------------------------------- */

.app-alert {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: 1rem;
    border-radius: .5rem;
    border: 1px solid transparent;
    font-size: .875rem;
}
.app-alert[hidden] { display: none !important; }
.app-alert > .bx {
    font-size: 1rem;
    line-height: 1;
    margin-top: .125rem;
    flex-shrink: 0;
}
.app-alert--success { background: #f0fdfa; border-color: #99f6e4; color: #115e59; }
.app-alert--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.app-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.app-alert--info    { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }

/* Bleibende Hinweise im Inhalt (kein Schließen, keine Zeitsteuerung). */
.app-notice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.app-notice-icon { font-size: 1rem; line-height: 1; margin-top: .125rem; flex-shrink: 0; }
.app-notice-text { margin: 0; font-size: .875rem; line-height: 1.45; color: var(--text); }
.app-notice--success .app-notice-icon { color: #14b8a6; }
.app-notice--error   .app-notice-icon { color: #ef4444; }
.app-notice--warning .app-notice-icon { color: #f59e0b; }
.app-notice--info    .app-notice-icon { color: var(--primary); }

/* Toasts: Bestätigungen und Fehler, oben rechts gestapelt. */
.app-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    width: calc(100% - 2rem);
    max-width: 20rem;
    pointer-events: none;
}
.app-toast {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .75rem;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(1.25rem);
    transition: transform .3s ease, opacity .3s ease;
}
.app-toast.is-in { opacity: 1; transform: none; }
.app-toast.is-leaving { opacity: 0; transform: translateX(1.25rem); }
.app-toast:focus { outline: none; }
.app-toast-row { display: flex; gap: .75rem; padding: 1rem; }
.app-toast-icon { flex-shrink: 0; font-size: 1rem; line-height: 1; margin-top: .125rem; }
.app-toast-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--text);
}
.app-toast-close {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--text);
    opacity: .5;
    cursor: pointer;
}
.app-toast-close .bx { font-size: 1rem; }
.app-toast-close:hover,
.app-toast-close:focus-visible { opacity: 1; outline: none; }
.app-toast--success .app-toast-icon { color: #14b8a6; }
.app-toast--error   .app-toast-icon { color: #ef4444; }
.app-toast--warning .app-toast-icon { color: #f59e0b; }
.app-toast--info    .app-toast-icon { color: var(--primary); }
@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast.is-leaving { transition: none; transform: none; }
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1875rem .5rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
}
.app-badge--neutral { background: var(--bg-soft); color: var(--text-soft); }
.app-badge--success { background: var(--success-soft); color: #047857; }
.app-badge--info    { background: var(--primary-soft); color: #4338ca; }
.app-badge--warning { background: var(--warning-soft); color: var(--warning); }

/* --- Menues ----------------------------------------------------- */

.app-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: .375rem;
    min-width: 11rem;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}
.app-menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .625rem;
    border-radius: 8px;
    font-size: .8125rem;
    color: var(--text);
    text-align: left;
    transition: background .1s;
}
.app-menu-item .bx { font-size: 1rem; color: var(--text-faint); }
.app-menu-item:hover { background: var(--bg-soft); }
.app-menu-item--danger { color: var(--danger); }
.app-menu-item--danger .bx { color: var(--danger); }
.app-menu-item--danger:hover { background: var(--danger-soft); }

/* --- Sonstiges -------------------------------------------------- */

.app-divider { height: 1px; background: var(--border-soft); border: 0; }

/* --- Zwei-Faktor-Einrichtung ------------------------------------ */

.app-steps { display: flex; flex-direction: column; gap: 1.75rem; }
.app-steps > li { display: flex; gap: 1rem; align-items: flex-start; }
.app-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: .8125rem;
    font-weight: 650;
}

/* Weisser Rahmen um den QR-Code: Scanner brauchen die Ruhezone. */
.app-qr {
    padding: .5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    line-height: 0;
    flex-shrink: 0;
}
.app-qr svg { width: 11rem; height: 11rem; display: block; }

.app-secret {
    display: block;
    padding: .625rem .75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
    letter-spacing: .05em;
    color: var(--text);
    word-break: break-all;
}

.app-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .5rem;
}
.app-codes code {
    padding: .5rem .625rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .875rem;
    text-align: center;
    color: var(--text);
}

.app-progress {
    height: .5rem;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
}
.app-progress > div {
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width .3s;
}

/* Sichtbarer Tastatur-Fokus auf allen interaktiven Elementen. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --- Projekt → WordPress ---------------------------------------- */

.wp-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.wp-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) {
    .wp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wp-card { display: flex; flex-direction: column; gap: 1.25rem; }
.wp-card-body { display: flex; flex-direction: column; gap: .75rem; }
.wp-head { display: flex; align-items: center; gap: .875rem; flex-wrap: wrap; }
.wp-head-text { flex: 1; min-width: 12rem; }
.wp-head-text .app-hint { margin-top: .125rem; }
.wp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: auto; }
.wp-h3 { font-size: .875rem; font-weight: 650; color: var(--text); }

.wp-dl { display: flex; flex-direction: column; font-size: .875rem; }
.wp-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .625rem 0;
    border-top: 1px solid var(--border-soft);
}
.wp-dl dt { color: var(--text-soft); }
.wp-dl dd { font-weight: 600; text-align: right; }

.wp-section { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem; }
.wp-section + .wp-section { border-top: 1px solid var(--border); }
.wp-inline { display: flex; flex-wrap: wrap; gap: .75rem; }
.wp-inline > .app-input,
.wp-inline > .app-secret { flex: 1 1 16rem; width: auto; min-width: 0; }
.wp-inline--center { align-items: center; }
.wp-notes { display: flex; flex-direction: column; gap: .5rem; }
.wp-notes:empty { display: none; }

.wp-key {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .875rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .875rem;
    letter-spacing: .08em;
    color: var(--text);
}
.wp-key .bx { color: var(--text-faint); font-size: 1.125rem; }

.wp-list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.wp-list-tools { display: flex; align-items: center; gap: .75rem; }
.wp-revs { display: flex; flex-direction: column; margin: -.25rem -1.5rem -1.5rem; }
.wp-rev {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .75rem 1.5rem;
    border-top: 1px solid var(--border-soft);
}
.wp-revs > li:first-child > .wp-rev,
.wp-revs > .wp-rev:first-child { border-top: 0; }
.wp-revs:has(+ .wp-revs-toggle:not([hidden])) { margin-bottom: 0; }
.wp-revs--older { margin-top: 0; }
.wp-revs--older[hidden] { display: none; }
.wp-revs--older > .wp-rev:first-child { border-top: 1px solid var(--border-soft); }
.wp-revs-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: calc(100% + 3rem);
    margin: 0 -1.5rem;
    padding: .625rem 1.5rem;
    border: 0;
    border-top: 1px solid var(--border-soft);
    background: transparent;
    font: inherit;
    font-size: .8125rem;
    font-weight: 550;
    color: var(--text-soft);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.wp-revs-toggle[hidden] { display: none; }
.wp-revs-toggle:hover { background: var(--bg); color: var(--text); }
.wp-revs-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.wp-revs-toggle .bx { font-size: 1.125rem; transition: transform .18s; }
.wp-revs-toggle.is-open .bx { transform: rotate(180deg); }
.wp-revs-toggle:not(:has(+ .wp-revs--older:not([hidden]))) { margin-bottom: -1.5rem; }
.wp-rev--older { transition: background .12s; }
.wp-rev--older:hover, .wp-rev--older:focus-within { background: var(--bg); }
.wp-rev-del { flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.wp-rev--older:hover .wp-rev-del,
.wp-rev--older:focus-within .wp-rev-del { opacity: 1; }
@media (hover: none) { .wp-rev-del { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wp-revs-toggle .bx, .wp-rev-del { transition: none; } }
.wp-rev-no { min-width: 4.5rem; justify-content: center; flex-shrink: 0; }
.wp-rev-body { flex: 1; min-width: 0; }
.wp-rev-title {
    font-size: .875rem;
    font-weight: 550;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-steps { display: grid; gap: .75rem; }
@media (min-width: 768px) {
    .wp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.wp-steps > li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-soft);
}
.wp-steps > li p { margin-top: .125rem; }

/* --- Admin ------------------------------------------------------ */

.app-subnav {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.app-subnav a {
    padding: .4rem .75rem;
    border-radius: 8px;
    font-size: .8125rem;
    font-weight: 550;
    color: var(--text-soft);
}
.app-subnav a:hover { background: var(--bg-soft); color: var(--text); }
.app-subnav a.is-active { background: var(--primary-soft); color: var(--primary); }

.app-stat {
    display: flex;
    align-items: center;
    gap: .875rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .12s, box-shadow .12s;
}
.app-stat:hover { border-color: var(--primary); box-shadow: var(--ring); }
.app-stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.app-table th {
    text-align: left;
    font-size: .75rem;
    font-weight: 650;
    color: var(--text-faint);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.invite-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.invite-card-text { flex: 1; min-width: 0; }
@media (max-width: 640px) { .invite-card { flex-wrap: wrap; } .invite-card .app-row-actions { width: 100%; } }
.app-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.app-table td {
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.app-table tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: var(--bg); }

.app-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .16s ease;
}
.app-modal-overlay.is-open { opacity: 1; }
.app-modal-overlay.hidden { display: none !important; }
.app-modal {
    width: 100%;
    max-width: 26rem;
    max-height: min(85vh, 820px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(8px) scale(.985);
    transition: transform .16s ease;
}
.app-modal-overlay.is-open .app-modal { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .app-modal-overlay, .app-modal { transition: none; }
}
.app-modal--sm { max-width: 26rem; }
.app-modal--md { max-width: 32rem; }
.app-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.25rem 1.25rem 0;
}
.app-modal-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9375rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--text);
}
.app-modal-title .bx { font-size: 1.25rem; color: var(--primary); }
.app-modal-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
}
.app-modal-x:hover { color: var(--text); background: var(--bg-soft); }
.app-modal-x .bx { font-size: 1.25rem; }
.app-modal-body { padding: .625rem 1.25rem 0; }
/* Formular über Body und Fuß: der Body scrollt, der Fuß bleibt mit Innenabstand unten. */
.app-modal-form { display: flex; flex-direction: column; min-height: 0; }
.app-modal-form > .app-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: .25rem; }
.app-modal-form > .app-modal-foot { padding-top: 1.25rem; }
.app-modal-lead {
    margin: 0;
    font-size: .875rem;
    line-height: 1.55;
    color: var(--text-soft);
    white-space: pre-line;
}
.app-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: 1rem 1.25rem 1.25rem;
}
.app-dialog-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: var(--control-h);
    margin-top: .75rem;
    padding: 0 .875rem;
}
.app-dialog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 .875rem;
    border-radius: 9px;
    font-size: .8125rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}
.app-dialog-btn:focus-visible { outline: 2px solid rgba(79, 70, 229, .55); outline-offset: 2px; }
.app-dialog-btn:disabled { opacity: .45; cursor: not-allowed; }
.app-dialog-msg { white-space: pre-line; }
.app-dialog-link { margin-right: auto; text-decoration: none; }
.app-dialog-choices {
    margin: .875rem 0 0;
    padding: 0;
    list-style: none;
    max-height: min(46vh, 22rem);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.app-dialog-choices li + li { border-top: 1px solid var(--border); }
.app-dialog-choice {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .875rem;
    cursor: pointer;
}
.app-dialog-choice:hover { background: var(--bg-soft); }
.app-dialog-choice input { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: var(--primary); }
.app-dialog-choice span { display: flex; flex-direction: column; min-width: 0; }
.app-dialog-choice strong { font-size: .875rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-dialog-choice small { font-size: .75rem; color: var(--text-faint); }
.app-dialog-counter { margin: .5rem 0 0; font-size: .8125rem; color: var(--text-soft); }
.app-dialog-counter.is-done { color: var(--success, #059669); font-weight: 600; }
.app-dialog-btn-cancel { background: #fff; border-color: var(--border); color: var(--text); }
.app-dialog-btn-cancel:hover { background: var(--bg-soft); }
.app-dialog-btn-ok { background: var(--primary); color: #fff; }
.app-dialog-btn-ok:hover { background: var(--primary-h); }
.app-dialog-btn-danger { background: var(--danger); color: #fff; }
.app-dialog-btn-danger:hover { background: #b91c1c; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* --- Auth: geteiltes Layout --------------------------------------
   Links das Formular auf hellem Grund, rechts dieselbe Shader-Fläche
   wie in der Hero der Landingpage (hero-bg.js). Unter 1024px bleibt
   nur die Formularspalte.
   --------------------------------------------------------------- */

body.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    background: var(--surface);
}
.auth-split-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.75rem 1.5rem;
}
.auth-split-head { display: flex; align-items: center; }
.auth-split-logo { display: inline-flex; border-radius: 8px; }
.auth-split-logo:focus-visible { outline: none; box-shadow: var(--ring); }
.auth-split-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 25rem;
    margin-inline: auto;
    padding-block: 2.5rem;
}
.auth-split-h1 {
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}
.auth-split-sub { margin-top: .5rem; color: var(--text-soft); }
.auth-split-intro { margin-bottom: 1.75rem; }
.auth-split-alt {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-soft);
    font-size: .9375rem;
}
.auth-split-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .8125rem;
    color: var(--text-faint);
}
.auth-split-email {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: var(--control-h);
    padding: 0 .875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-soft);
    font-size: .9375rem;
    overflow-wrap: anywhere;
}

.auth-split-side { display: none; }

@media (min-width: 1024px) {
    body.auth-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-split-main { padding: 2rem 3rem; }
    .auth-split-side {
        position: sticky;
        top: 0;
        display: flex;
        align-items: flex-end;
        margin: .75rem .75rem .75rem 0;
        height: calc(100vh - 1.5rem);
        border-radius: 24px;
        overflow: hidden;
        isolation: isolate;
        background: #07061a;
        color: #f4f3ff;
    }
}

/* Ohne WebGL bleibt dieser Verlauf stehen. */
.auth-split-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(45% 40% at 50% 25%, rgba(99, 102, 241, .45), transparent 70%),
        radial-gradient(35% 35% at 20% 45%, rgba(139, 92, 246, .28), transparent 70%),
        radial-gradient(35% 35% at 80% 40%, rgba(34, 211, 238, .16), transparent 70%);
}
.auth-split-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(7, 6, 26, .15) 0%, rgba(7, 6, 26, .25) 45%, rgba(7, 6, 26, .82) 100%);
}
.auth-split-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
}
.auth-split-canvas.is-on { opacity: .72; }

.auth-split-side-in { padding: 3rem; max-width: 34rem; }
.auth-split-title {
    font-size: clamp(1.875rem, 2.6vw, 2.5rem);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.025em;
}
.auth-split-lead { margin-top: 1rem; color: rgba(244, 243, 255, .72); line-height: 1.6; }
.auth-split-kicker {
    margin-bottom: 1rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #c7d2fe;
}
.auth-split-manifesto .auth-split-lead + .auth-split-lead { margin-top: .75rem; }
.auth-split-sign {
    margin-top: 1.75rem;
    font-weight: 600;
    font-style: italic;
    color: #f4f3ff;
}
.auth-split-points { margin-top: 1.75rem; display: grid; gap: .75rem; }
.auth-split-points li { display: flex; align-items: center; gap: .75rem; font-weight: 500; }
.auth-split-points .bx {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 1.05rem;
    color: #c7d2fe;
}

/* ---------------------------------------------------------------- Neues Projekt: Website oder Onlineshop */
.new-project-wrap { max-width: 38rem; }
.new-kind { margin: 0; padding: 0; border: 0; min-width: 0; }
.new-kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.new-kind-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.new-kind-card:hover { border-color: #a5b4fc; }
.new-kind-card:has(.new-kind-input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.new-kind-card:has(.new-kind-input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.new-kind-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.new-kind-name { display: flex; align-items: center; gap: .375rem; margin-top: .25rem; font-size: .875rem; font-weight: 600; color: var(--text); }
.new-kind-name > .bx:first-child { font-size: 1.0625rem; color: var(--primary); }
.new-kind-check { margin-left: auto; font-size: 1.125rem; color: var(--primary); opacity: 0; transition: opacity .15s ease; }
.new-kind-card:has(.new-kind-input:checked) .new-kind-check { opacity: 1; }
.new-kind-text { font-size: .78rem; line-height: 1.5; color: var(--text-soft); }

.kind-art {
    position: relative;
    display: block;
    height: 150px;
    padding: 14px 14px 0;
    border-radius: 10px;
    background: linear-gradient(150deg, #eef2ff 0%, #f5f3ff 55%, #fdf2f8 100%);
    overflow: hidden;
}
.kind-art .ka-win {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 0 10px 10px;
    border: 1px solid #e0e7ff;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #fff;
    box-shadow: 0 10px 24px -14px rgba(79, 70, 229, .5);
    transition: transform .25s ease;
}
.kind-art .ka-chrome { display: flex; align-items: center; gap: 4px; height: 18px; margin: 0 -10px; padding: 0 8px; border-bottom: 1px solid #f1f5f9; }
.kind-art .ka-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: #e2e8f0; }
.kind-art .ka-url { display: block; flex: 1; height: 6px; margin-left: 8px; max-width: 45%; border-radius: 3px; background: #f1f5f9; }
.kind-art .ka-nav { display: flex; align-items: center; gap: 10px; height: 12px; }
.kind-art .ka-logo { display: block; width: 18px; height: 8px; border-radius: 3px; background: #6366f1; }
.kind-art .ka-links { display: flex; gap: 6px; margin-left: auto; }
.kind-art .ka-links > span { display: block; width: 16px; height: 4px; border-radius: 2px; background: #cbd5e1; }
.kind-art .ka-line { display: block; height: 4px; width: 100%; border-radius: 2px; background: #e2e8f0; }
.kind-art .ka-line--title { height: 7px; background: #334155; }
.kind-art .ka-line--short { width: 60%; }
.kind-art .ka-btn { display: block; width: 34px; height: 10px; margin-top: 2px; border-radius: 5px; background: #6366f1; }
.kind-art .ka-btn--full { width: 100%; height: 9px; }
.kind-art .ka-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; align-items: center; }
.kind-art .ka-hero-text { display: flex; flex-direction: column; gap: 4px; }
.kind-art .ka-hero-img { display: block; height: 42px; border-radius: 5px; background: linear-gradient(135deg, #c7d2fe, #e9d5ff); }
.kind-art .ka-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; }
.kind-art .ka-card { display: block; border-radius: 5px; background: #f8fafc; border: 1px solid #f1f5f9; }

.kind-art .ka-cart { position: relative; display: flex; align-items: center; margin-left: 4px; color: #4f46e5; font-size: 12px; line-height: 1; }
.kind-art .ka-cart .bx, .kind-art .ka-cart svg { width: 12px; height: 12px; font-size: 12px; }
.kind-art .ka-count { position: absolute; top: -5px; right: -7px; min-width: 10px; height: 10px; padding: 0 2px; border-radius: 5px; background: #f43f5e; color: #fff; font: 700 7px/10px ui-sans-serif, system-ui, sans-serif; text-align: center; }
.kind-art .ka-products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; }
.kind-art .ka-prod { display: flex; flex-direction: column; gap: 4px; }
.kind-art .ka-img { display: block; flex: 1; min-height: 30px; border-radius: 5px; background: linear-gradient(135deg, #c7d2fe, #ddd6fe); }
.kind-art .ka-img--b { background: linear-gradient(135deg, #fbcfe8, #fde68a); }
.kind-art .ka-img--c { background: linear-gradient(135deg, #a5f3fc, #c7d2fe); }
.kind-art .ka-price { display: block; width: 45%; height: 5px; border-radius: 3px; background: #6366f1; }
.kind-art .ka-minicart {
    position: absolute;
    right: 10px;
    top: 48px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 38%;
    padding: 7px;
    border: 1px solid #e0e7ff;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 12px 26px -12px rgba(15, 23, 42, .35);
    transition: transform .25s ease;
}
.kind-art .ka-mc-row { display: flex; align-items: center; gap: 5px; }
.kind-art .ka-mc-thumb { display: block; flex: none; width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, #c7d2fe, #ddd6fe); }
.kind-art .ka-mc-lines { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.kind-art .ka-mc-lines .ka-line { height: 3px; }
.new-kind-card:hover .ka-win { transform: translateY(-3px); }
.new-kind-card:hover .ka-minicart { transform: translate(-2px, -6px); }
@media (prefers-reduced-motion: no-preference) {
    .new-kind-card:hover .ka-count { animation: ka-pop .5s ease; }
}
@keyframes ka-pop { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) {
    .new-kind-card, .kind-art .ka-win, .kind-art .ka-minicart, .new-kind-check { transition: none; }
    .new-kind-card:hover .ka-win, .new-kind-card:hover .ka-minicart { transform: none; }
}
@media (max-width: 560px) {
    .new-kind-grid { grid-template-columns: 1fr; }
}
