/* OSP Ansicht v1 — Größenstufen und Rückmeldung. Gehört zu osp-ansicht.v1.js (Plan Grundregeln AP-7, UI-Standard §6).
   Größe ändert nur Schrift (13 · 14 · 16 px) und Zeilenhöhe; die Fläche bleibt: kein Zoom, kein html-font-size,
   keine Umrechnung von rem. Wirksam erst, wenn das Skript data-osp-stufe am <html> gesetzt hat (Angebot, G-2). */

:root {
    --osp-schrift: 14px;
    --osp-zeilenabstand: 1.4;
    --osp-zeilenhoehe: 32px;
    --osp-zelle-v: 4px;
}

html[data-osp-stufe="klein"]  { --osp-schrift: 13px; --osp-zeilenabstand: 1.35; --osp-zeilenhoehe: 28px; }
html[data-osp-stufe="mittel"] { --osp-schrift: 14px; --osp-zeilenabstand: 1.4;  --osp-zeilenhoehe: 32px; }
html[data-osp-stufe="gross"]  { --osp-schrift: 16px; --osp-zeilenabstand: 1.45; --osp-zeilenhoehe: 36px; }

html[data-osp-dichte="kompakt"] { --osp-zelle-v: 4px; }
html[data-osp-dichte="normal"]  { --osp-zelle-v: 8px; }

/* Nur Apps, die den Baustein eingebaut haben (Attribut am html-Element), bekommen die Stufen. */
html[data-osp-stufe] body {
    font-size: var(--osp-schrift);
    line-height: var(--osp-zeilenabstand);
}

/* Tabellen nach UI-Standard §4: Zeilenhöhe aus der Stufe, Zellen-Abstand aus der Dichte. */
html[data-osp-stufe] table.osp-tabelle tbody tr { height: var(--osp-zeilenhoehe); }
html[data-osp-stufe] table.osp-tabelle th,
html[data-osp-stufe] table.osp-tabelle td { padding-block: var(--osp-zelle-v); }

/* Rückmeldung unten links (rechts unten gehört der Glocke und dem Feedback). */
.osp-ansicht-status {
    position: fixed;
    inset-inline-start: 16px;
    inset-block-end: 16px;
    z-index: 8500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(480px, calc(100vw - 32px));
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border, #CBD5E1);
    border-inline-start-width: 4px;
    background: var(--color-card, #FFFFFF);
    color: var(--color-text, #1E293B);
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.osp-ansicht-status[hidden] { display: none; }
.osp-ansicht-status--ok       { border-inline-start-color: #1E7B34; }
.osp-ansicht-status--hinweis  { border-inline-start-color: #8A6A00; }
.osp-ansicht-status--konflikt { border-inline-start-color: #B53F0B; }

html.dark .osp-ansicht-status--ok       { border-inline-start-color: #4ADE80; }
html.dark .osp-ansicht-status--hinweis  { border-inline-start-color: #FBBF24; }
html.dark .osp-ansicht-status--konflikt { border-inline-start-color: #FB923C; }

.osp-ansicht-status__knopf {
    min-height: 28px;
    min-width: 28px;
    padding: 2px 12px;
    border: 1px solid var(--color-primary, #0080C9);
    border-radius: 8px;
    background: transparent;
    color: var(--color-primary-dark, #006699);
    font: inherit;
    cursor: pointer;
}
.osp-ansicht-status__knopf:hover { background: var(--color-bg-light, #F1F5F9); }
.osp-ansicht-status__knopf:focus-visible { outline: 3px solid var(--color-primary, #0080C9); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
    .osp-ansicht-status { animation: osp-ansicht-ein 0.15s ease-out; }
}
@keyframes osp-ansicht-ein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
