/* Web-App «Datei öffnen» (01.10.2026) — Startseite und Statuspille. Die eigentliche Oberfläche ist renderer.html. */
:root {
    --wl-bg: #f6f5fb; --wl-card: #ffffff; --wl-text: #111827; --wl-muted: #6b7280; --wl-line: #e5e7eb;
    --wl-accent: #8b5cf6; --wl-accent-strong: #7c3aed; --wl-accent-soft: rgba(139, 92, 246, .10); --wl-danger: #dc2626;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --wl-bg: #0b0b14; --wl-card: #151526; --wl-text: #f3f4f6; --wl-muted: #9ca3af; --wl-line: #2a2a40; --wl-accent-soft: rgba(139, 92, 246, .18); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--wl-bg); color: var(--wl-text); -webkit-font-smoothing: antialiased; }
.wl-start { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 24px; }
.wl-top { width: 100%; max-width: 520px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wl-top img { height: 34px; width: auto; }
.wl-lang { display: flex; gap: 4px; }
.wl-lang button { border: 1px solid var(--wl-line); background: transparent; color: var(--wl-muted); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.wl-lang button[aria-pressed="true"] { color: var(--wl-accent-strong); border-color: var(--wl-accent); background: var(--wl-accent-soft); }
.wl-card { width: 100%; max-width: 520px; margin-top: 24px; background: var(--wl-card); border: 1px solid var(--wl-line); border-radius: 18px; padding: 28px 24px; box-shadow: 0 10px 30px rgba(17, 24, 39, .06); }
.wl-card h1 { margin: 0 0 8px; font-size: 1.5rem; letter-spacing: -.01em; }
.wl-lead { margin: 0 0 22px; color: var(--wl-muted); line-height: 1.5; font-size: .95rem; }
.wl-step { margin: 18px 0 8px; font-weight: 600; font-size: .95rem; }
.wl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wl-file { color: var(--wl-muted); font-size: .9rem; word-break: break-all; }
.wl-btn { appearance: none; border: 1px solid var(--wl-line); background: var(--wl-card); color: var(--wl-text); border-radius: 10px; padding: 10px 14px; font: inherit; font-size: .95rem; cursor: pointer; min-height: 44px; }
.wl-btn:hover { border-color: var(--wl-accent); }
.wl-btn-primary { background: var(--wl-accent-strong); border-color: var(--wl-accent-strong); color: #fff; font-weight: 600; width: 100%; margin-top: 18px; }
.wl-btn-primary:hover { background: var(--wl-accent); }
.wl-btn-primary:disabled { opacity: .6; cursor: progress; }
.wl-btn-link { border: 0; background: none; padding: 6px 0; color: var(--wl-accent-strong); min-height: 0; text-align: left; }
.wl-input { width: 100%; border: 1px solid var(--wl-line); background: transparent; color: var(--wl-text); border-radius: 10px; padding: 11px 12px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; min-height: 44px; }
.wl-input:focus, .wl-btn:focus-visible { outline: 2px solid var(--wl-accent); outline-offset: 1px; }
.wl-hint { margin: 6px 0 0; color: var(--wl-muted); font-size: .85rem; line-height: 1.45; }
.wl-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; color: var(--wl-muted); }
.wl-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(220, 38, 38, .08); color: var(--wl-danger); font-size: .9rem; }
.wl-how { margin-top: 22px; border-top: 1px solid var(--wl-line); padding-top: 14px; }
.wl-how summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.wl-how p { color: var(--wl-muted); font-size: .88rem; line-height: 1.5; }
.wl-foot { margin-top: auto; padding-top: 24px; display: flex; gap: 16px; font-size: .82rem; }
.wl-foot a { color: var(--wl-muted); text-decoration: none; }
.wl-foot a:hover { color: var(--wl-accent-strong); }

/* Geöffnet: Oberfläche füllt das Fenster */
#wlApp { display: none; }
body.wl-open .wl-start { display: none; }
body.wl-open #wlApp { display: block; position: fixed; inset: 0; }
body.wl-open { background: #f3f4f6; }
body.wl-open.wl-dark { background: #111827; }
#wlApp iframe { border: 0; width: 1px; min-width: 100%; height: 100%; display: block; }   /* iPhone: iframe nicht auf Inhaltsbreite wachsen lassen */
body.wl-open { overflow: hidden; }

.wl-status { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px);
    background: rgba(17, 24, 39, .88); color: #f9fafb; border-radius: 999px; padding: 6px 6px 6px 14px; font-size: .8rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); backdrop-filter: blur(6px); }
.wl-status[hidden], .wl-btn[hidden] { display: none; }
.wl-status[data-state="dirty"] { background: rgba(124, 58, 237, .95); }
.wl-status[data-state="conflict"] { background: rgba(185, 28, 28, .95); border-radius: 14px; }
.wl-status-text { overflow: hidden; text-overflow: ellipsis; }
.wl-status button { appearance: none; border: 0; border-radius: 999px; padding: 5px 10px; font: inherit; font-size: .78rem; cursor: pointer; background: rgba(255, 255, 255, .16); color: inherit; white-space: nowrap; }
.wl-status button:hover { background: rgba(255, 255, 255, .28); }
@media (max-width: 600px) {
    .wl-start { padding-top: 20px; }
    .wl-card { padding: 22px 16px; border-radius: 14px; }
    .wl-status-text { max-width: 46vw; white-space: nowrap; }
}
/* Bis 900px hat die Oberfläche unten eine eigene Navigationsleiste — Pille darüber setzen */
@media (max-width: 900px) {
    .wl-status { bottom: calc(88px + env(safe-area-inset-bottom)); font-size: .75rem; padding: 4px 4px 4px 12px; }
}

/* 02.10.2026: Verbinden mit dem Mac (Briefkasten) oben, Datei als zweiter Weg */
.wl-row-fill { flex-wrap: nowrap; margin-top: 10px; }
.wl-row-fill .wl-input { flex: 1; min-width: 0; font-family: inherit; }
.wl-btn-inline { width: auto; margin-top: 0; white-space: nowrap; }
.wl-filebox { margin-top: 22px; border-top: 1px solid var(--wl-line); padding-top: 14px; }
.wl-filebox > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--wl-muted); }
.wl-status[data-live="on"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); flex: none; }
.wl-status[data-live="off"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }

/* 02.10.2026: ruhige Statusanzeige — im Normalfall nur ein Punkt, damit nichts überdeckt wird */
.wl-status.wl-compact { left: auto; right: 12px; transform: none; padding: 7px; gap: 0; cursor: pointer; }
.wl-status.wl-compact .wl-status-text, .wl-status.wl-compact button { display: none; }
@media (max-width: 900px) { .wl-status.wl-compact { right: auto; left: 10px; bottom: calc(96px + env(safe-area-inset-bottom)); }   /* rechts sitzt Phin */ }

/* 02.10.2026: Anmelden mit E-Mail und Passwort, darunter «oder» Link/QR-Code */
.wl-input-gap { margin-top: 8px; }
#wlLoginForm .wl-btn-primary { margin-top: 10px; width: 100%; }
.wl-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: var(--wl-muted); font-size: .85rem; }
.wl-or::before, .wl-or::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .3; }

/* 02.10.2026: iPhone-App (Capacitor) — Inhalt beginnt unter Uhrzeit und Dynamic Island; nur in der App */
html.wl-native .wl-start { padding-top: calc(env(safe-area-inset-top) + 16px); }
html.wl-native body.wl-open #wlApp { top: env(safe-area-inset-top); }
html.wl-native body.wl-open { background: #0a0a0a; }

/* 03.10.2026: «Mac nicht erreichbar · antippen» ist antippbar */
.wl-status[data-repair="1"] { cursor: pointer; }
