/* Hülle der Telmiko-Demo: Startseite, Geräte-Rahmen, Führung. Farben wie Telmiko. */
:root {
    --basis: #205BE7;
    --basis-dunkel: #1745b3;
    --accent: #25ffc9;
    --text: #464555;
    --weiss: #F9F8FF;
    --erfolg: #008355;
    --grau: #e6e8f2;
    --flaeche: #eef1fb;
    --schatten: 0 10px 30px rgba(32, 50, 120, .14);
    --kopf-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: "adelphi-pe-variable", "demo-ersatzschrift", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 600px at 20% -10%, #dfe8ff 0%, transparent 60%), var(--flaeche);
    display: flex; flex-direction: column;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Kopf */
.kopf {
    height: var(--kopf-h); flex: 0 0 auto;
    display: flex; align-items: center; gap: 16px;
    padding: 0 20px;
    background: #fff; border-bottom: 1px solid var(--grau);
}
.kopf-marke { display: flex; align-items: center; gap: 10px; }
.kopf-logo { width: 30px; height: 30px; }
.kopf-titel { font-size: 1.2rem; font-weight: 700; color: var(--basis); letter-spacing: .01em; }
.kopf-demo { font-weight: 600; font-size: .8rem; color: var(--text); background: var(--accent); padding: 2px 8px; border-radius: 99px; margin-left: 4px; vertical-align: middle; }
.kopf-hinweis { margin: 0 auto 0 12px; font-size: .9rem; color: #5b5a6e; background: #fff8e1; border: 1px solid #f3e2a6; padding: 4px 12px; border-radius: 99px; white-space: nowrap; }
.kopf-hinweis i { color: #c28a00; margin-right: 4px; }
.kopf-aktionen { display: flex; gap: 8px; }

/* Knöpfe */
.knopf-haupt, .knopf-zweit, .knopf-leise {
    border: 0; border-radius: 12px; padding: 11px 20px; font-weight: 650; font-size: 1rem;
    display: inline-flex; align-items: center; gap: 8px; transition: transform .1s, background .2s, box-shadow .2s;
}
.knopf-haupt { background: var(--basis); color: #fff; }
.knopf-haupt:hover { background: var(--basis-dunkel); }
.knopf-haupt.lockt { box-shadow: 0 0 0 0 rgba(37, 255, 201, .9); animation: lockt 1.2s infinite; }
@keyframes lockt { 0% { box-shadow: 0 0 0 0 rgba(37, 255, 201, 1); } 70% { box-shadow: 0 0 0 16px rgba(37, 255, 201, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 255, 201, 0); } }
/* Schritt geschafft: Weiter-Knopf groß, leuchtend, zählt herunter */
.knopf-haupt.zaehlt { background: var(--erfolg); font-size: 1.15rem; padding: 13px 26px; outline: 3px solid var(--accent); outline-offset: 2px; }
.knopf-haupt.zaehlt:hover { background: #006a45; }
.knopf-zweit { background: #e3fff7; color: #00694a; border: 1.5px solid #8ff1d3; }
.knopf-zweit:hover { background: #c9fbec; }
.knopf-leise { background: transparent; color: var(--text); padding: 10px 14px; }
.knopf-leise:hover { background: var(--grau); }
.knopf-haupt:active, .knopf-zweit:active { transform: scale(.98); }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }

/* Startseite */
.start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px 48px; text-align: center; }
.start h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--basis); margin: 0 0 8px; }
.start-unter { font-size: 1.2rem; margin: 0 0 28px; }
.start-so { list-style: none; padding: 0; margin: 8px 0 24px; display: grid; gap: 10px; max-width: 560px; text-align: left; }
.start-so li { display: flex; gap: 12px; align-items: flex-start; font-size: 1.08rem; line-height: 1.4; background: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.start-so i { color: var(--basis); font-size: 1.2rem; width: 1.4rem; text-align: center; margin-top: 2px; flex: none; }
.start-wahl { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.rolle {
    width: 300px; padding: 28px 24px; border-radius: 20px; border: 2px solid transparent; background: #fff;
    box-shadow: var(--schatten); display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text);
    transition: transform .15s, border-color .15s;
}
.rolle:hover, .rolle:focus-visible { transform: translateY(-3px); border-color: var(--basis); }
.rolle i { font-size: 2.4rem; color: var(--basis); background: #e8efff; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.rolle strong { font-size: 1.25rem; color: #2b2a3a; }
.rolle span { font-size: .95rem; line-height: 1.4; }
.start-klein { margin-top: 28px; font-size: .95rem; color: #6a6980; }

/* Bühne */
.buehne {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); gap: 28px; align-items: stretch;
    padding: 18px 28px 8px;
}
.geraet { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; height: 100%; justify-content: center; transition: opacity .3s, filter .3s; }
.geraet.tritt-zurueck { opacity: .55; filter: saturate(.6); }
.geraet-name { font-weight: 700; font-size: 1.05rem; color: #5b5a6e; display: flex; gap: 8px; align-items: center; }
.geraet.ist-dran .geraet-name { color: var(--basis); }
.geraet-name { white-space: nowrap; }
/* Wer dran ist: das ganze Gerät leuchtet */
.geraet.ist-dran .computer, .geraet.ist-dran .handy { box-shadow: 0 0 0 4px var(--accent), 0 0 28px 6px rgba(37, 255, 201, .55), var(--schatten); }
.computer, .handy { transition: box-shadow .3s; }

.computer { background: #1e2233; border-radius: 16px; padding: 10px 10px 14px; box-shadow: var(--schatten); width: auto; max-width: 100%; }
.computer-leiste { display: flex; gap: 6px; padding: 2px 4px 8px; }
.computer-leiste span { width: 10px; height: 10px; border-radius: 50%; background: #444a63; }
.handy { background: #1e2233; border-radius: 44px; padding: 14px; box-shadow: var(--schatten); position: relative; }
.handy-kerbe { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: #1e2233; border-radius: 0 0 14px 14px; z-index: 2; }
.bildschirm { position: relative; overflow: hidden; background: #fff; }
.computer .bildschirm { border-radius: 6px; }
.handy .bildschirm { border-radius: 32px; }
.bildschirm iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.bildschirm .laedt { position: absolute; inset: 0; display: grid; place-items: center; color: #8a89a0; font-size: .95rem; background: #fff; z-index: 1; transition: opacity .3s; }

.umschalter { display: none; }

/* Führung */
.fuehrung {
    flex: 0 0 auto; margin: 6px auto 10px; width: min(1100px, calc(100% - 40px));
    background: #fff; border-radius: 18px; box-shadow: var(--schatten); padding: 14px 20px 14px;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "kopf kopf" "wer knoepfe" "text knoepfe" "danach knoepfe"; column-gap: 20px; align-items: center;
}
.fuehrung-kopf { grid-area: kopf; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.fuehrung-fortschritt { font-size: .85rem; font-weight: 650; color: #6a6980; white-space: nowrap; }
.fuehrung-balken { flex: 1; height: 5px; background: var(--grau); border-radius: 99px; overflow: hidden; }
.fuehrung-balken span { display: block; height: 100%; width: 0; background: var(--basis); border-radius: 99px; transition: width .4s; }
.fuehrung-wer { grid-area: wer; margin: 0; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--basis); }
.fuehrung-wer.patientin { color: #00805e; }
.fuehrung-wer:empty { display: none; }
.fuehrung-text { grid-area: text; margin: 2px 0; font-size: 1.3rem; line-height: 1.35; font-weight: 600; color: #26253a; }
.fuehrung-danach { grid-area: danach; margin: 6px 0 0; font-size: 1.05rem; color: var(--erfolg); font-weight: 600; display: flex; gap: 8px; align-items: center; animation: einblenden .35s; }
.fuehrung-danach::before { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
@keyframes einblenden { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fuehrung-knoepfe { grid-area: knoepfe; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fuehrung-abschluss { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.fuehrung-abschluss p { margin: 0 12px 0 0; font-size: 1rem; }
.fuehrung.ist-frei { grid-template-areas: "text knoepfe"; padding: 10px 18px; }
.fuehrung.ist-frei .fuehrung-kopf, .fuehrung.ist-frei .fuehrung-wer { display: none; }
.fuehrung.ist-frei .fuehrung-text { font-size: 1.05rem; font-weight: 500; }

/* Meldungen (erfundene Patienten handeln) */
.meldung {
    position: fixed; left: 24px; top: calc(var(--kopf-h) + 14px); z-index: 50; max-width: 360px;
    background: #fff; border-left: 5px solid var(--accent); border-radius: 12px; box-shadow: var(--schatten);
    padding: 12px 16px; font-size: .98rem; display: flex; gap: 10px; align-items: center;
    animation: hinein .35s ease-out;
}
.meldung i { color: var(--basis); font-size: 1.2rem; }
.meldung.weg { opacity: 0; transform: translateY(8px); transition: .4s; }
@keyframes hinein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Benachrichtigung am Handy (wie eine Push-Nachricht) */
.handy-nachricht {
    position: absolute; top: 46px; left: 24px; right: 24px; z-index: 3;
    display: flex; gap: 10px; align-items: flex-start; text-align: left;
    background: rgba(250, 250, 255, .97); color: #26253a; border: 0; border-radius: 18px; padding: 11px 13px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28); font-size: .9rem; line-height: 1.3;
    animation: nachricht-rein .45s cubic-bezier(.2, .9, .3, 1.2);
}
.handy-nachricht img { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.handy-nachricht strong { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: #6a6980; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.handy-nachricht strong small { text-transform: none; font-weight: 500; letter-spacing: 0; }
.handy-nachricht span { display: block; font-weight: 650; }
.handy-nachricht.weg { opacity: 0; transform: translateY(-14px); transition: .35s; }
@keyframes nachricht-rein { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

.fuss { text-align: center; font-size: .75rem; color: #8a89a0; padding: 0 0 8px; }

/* Schmaler Bildschirm (Besucher am Handy): ein Gerät auf einmal */
@media (max-width: 900px) {
    :root { --kopf-h: 50px; }
    .buehne { grid-template-rows: auto auto; flex: none; }
    .kopf { padding: 0 12px; gap: 8px; }
    .kopf-hinweis { margin: 0 0 0 auto; font-size: .72rem; white-space: normal; line-height: 1.2; padding: 3px 8px; border-radius: 8px; max-width: 190px; }
    .kopf-hinweis i { display: none; }
    .kopf-aktionen .knopf-leise { padding: 6px 8px; font-size: 0; }
    .kopf-aktionen .knopf-leise i { font-size: 1.1rem; }
    .kopf-titel { font-size: 1.05rem; }
    .buehne { grid-template-columns: 1fr; padding: 8px 10px 0; gap: 8px; align-items: start; }
    .umschalter { display: flex; gap: 6px; background: #fff; padding: 4px; border-radius: 12px; box-shadow: var(--schatten); }
    .umschalter button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 650; color: var(--text); font-size: .92rem; position: relative; }
    .umschalter button[aria-selected="true"] { background: var(--basis); color: #fff; }
    .umschalter button.ist-dran:not([aria-selected="true"])::after { content: ""; position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #ff5b5b; box-shadow: 0 0 0 3px #fff; }
    .geraet { display: none; height: auto; }
    .geraet.ist-sichtbar { display: flex; }
    .geraet.tritt-zurueck { opacity: 1; filter: none; }
    .geraet-name { display: none; }
    .computer { padding: 6px; border-radius: 10px; }
    .computer-leiste { display: none; }
    .handy { padding: 8px; border-radius: 30px; }
    .handy-kerbe { display: none; }
    .handy-nachricht { top: 14px; left: 14px; right: 14px; }
    .handy .bildschirm { border-radius: 22px; }
    .fuehrung { width: calc(100% - 16px); margin: 8px auto; padding: 12px 14px; grid-template-columns: 1fr; grid-template-areas: "kopf" "wer" "text" "danach" "knoepfe"; }
    .fuehrung-text { font-size: 1.1rem; }
    .fuehrung-knoepfe { justify-content: space-between; margin-top: 10px; flex-wrap: nowrap; gap: 6px; }
    .fuehrung-knoepfe button { padding: 10px 12px; font-size: .95rem; }
    #fuehrungZurueck { font-size: 0; padding: 10px; }
    #fuehrungZurueck i { font-size: 1.1rem; }
    .meldung { left: 10px; right: 10px; bottom: auto; top: 60px; max-width: none; }
    .rolle { width: 100%; max-width: 360px; padding: 20px; }
}
