/*
    Seiten-Feedback - Reiter am Seitenrand.
    Alles unter .rswf, damit nichts aus dem Theme hineinblutet oder herausleckt.
    Farben lassen sich im Child-Theme ueber die Variablen an .rswf setzen.
*/
.rswf {
    --rswf-bg: #1f2937;
    --rswf-fg: #ffffff;
    --rswf-card: #ffffff;
    --rswf-ink: #1f2937;
    --rswf-mut: #4b5563;
    --rswf-line: #d1d5db;
    --rswf-good: #15803d;
    --rswf-mid: #b45309;
    --rswf-bad: #b91c1c;
    --rswf-focus: #2563eb;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--rswf-ink);
}
.rswf[hidden], .rswf [hidden] { display: none !important; }
.rswf *, .rswf *::before, .rswf *::after { box-sizing: border-box; }

/* ---- Reiter ---- */
.rswf__tab {
    position: fixed;
    top: 50%;
    z-index: 1040;
    transform: translateY(-50%);
    margin: 0;
    padding: 14px 9px;
    border: 0;
    background: var(--rswf-bg);
    color: var(--rswf-fg);
    font: inherit;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    writing-mode: vertical-rl;
}
.rswf--right .rswf__tab { right: 0; border-radius: 10px 0 0 10px; }
.rswf--left  .rswf__tab { left: 0;  border-radius: 0 10px 10px 0; transform: translateY(-50%) rotate(180deg); }
.rswf--right .rswf__tab { transform: translateY(-50%) rotate(180deg); }
.rswf__tab:hover { filter: brightness(1.15); }
.rswf__tab[aria-expanded="true"] { filter: brightness(1.15); }

/* ---- Fenster ---- */
.rswf__panel {
    position: fixed;
    top: 50%;
    z-index: 1041;
    width: 330px;
    max-width: calc(100vw - 70px);
    padding: 18px 18px 16px;
    border: 1px solid var(--rswf-line);
    border-radius: 14px;
    background: var(--rswf-card);
    color: var(--rswf-ink);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
    transform: translateY(-50%);
    animation: rswf-in .18s ease-out;
}
.rswf--right .rswf__panel { right: 52px; }
.rswf--left  .rswf__panel { left: 52px; }
@keyframes rswf-in { from { opacity: 0; transform: translateY(-46%); } to { opacity: 1; transform: translateY(-50%); } }

.rswf__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rswf-mut);
    cursor: pointer;
}
.rswf__close:hover { background: #f3f4f6; color: var(--rswf-ink); }

.rswf__title {
    margin: 0 30px 14px 0;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--rswf-ink);
}

/* ---- Gesichter ---- */
.rswf__faces { display: flex; gap: 10px; justify-content: space-between; }
.rswf__face {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 10px 4px 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    font: inherit;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, transform .12s;
}
.rswf__face svg { display: block; }
.rswf__face--good { color: var(--rswf-good); }
.rswf__face--mid  { color: var(--rswf-mid); }
.rswf__face--bad  { color: var(--rswf-bad); }
.rswf__facetext { font-size: .78em; font-weight: 600; color: var(--rswf-ink); text-align: center; }
.rswf__face:hover:not(:disabled) { background: #f3f4f6; transform: translateY(-2px); }
.rswf__face[aria-checked="true"] { border-color: currentColor; background: #f9fafb; }
.rswf__face:disabled { cursor: default; }
.rswf__face:disabled[aria-checked="false"] { opacity: .4; }

/* ---- Kommentar ---- */
.rswf__more { margin-top: 14px; }
.rswf__ask { display: block; margin: 0 0 6px; font-weight: 600; }
.rswf__opt { font-weight: 400; color: var(--rswf-mut); }
.rswf__text {
    display: block;
    width: 100%;
    min-height: 74px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    background: #fff;
    color: var(--rswf-ink);
    font: inherit;
    resize: vertical;
}
.rswf__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.rswf__count { font-size: .8em; color: var(--rswf-mut); }
.rswf__send {
    margin: 0 0 0 auto;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--rswf-bg);
    color: var(--rswf-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.rswf__send:hover:not(:disabled) { filter: brightness(1.2); }
.rswf__send:disabled { opacity: .55; cursor: default; }

.rswf__thanks { margin: 14px 0 0; font-weight: 600; color: var(--rswf-good); outline: 0; }
.rswf__thanks.rswf__thanks--err { color: var(--rswf-bad); }

/* Koederfeld: aus dem Sichtfeld, aber nicht display:none (manche Skripte fuellen dann nicht). */
.rswf__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.rswf__tab:focus-visible, .rswf__close:focus-visible, .rswf__face:focus-visible,
.rswf__text:focus-visible, .rswf__send:focus-visible {
    outline: 3px solid var(--rswf-focus);
    outline-offset: 2px;
}

/* ---- Schmale Bildschirme: Fenster als Leiste unten ---- */
@media (max-width: 575.98px) {
    .rswf__tab { padding: 10px 7px; font-size: .9em; }
    .rswf--right .rswf__panel, .rswf--left .rswf__panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        border-radius: 16px 16px 0 0;
        transform: none;
        animation: rswf-up .2s ease-out;
    }
    .rswf__face svg { width: 44px; height: 44px; }
}
@keyframes rswf-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .rswf__panel { animation: none; }
    .rswf__face { transition: none; }
}
@media print { .rswf { display: none !important; } }
