/* Kundenapp – Basis-Styles (eingebunden im Template "WebApp") */
:root {
    --accent: #8a1ff9;   /* wird vom Template überschrieben */
    --bg: #f5f6f8; --surface: #fff; --text: #1c1e21; --muted: #6b7280;
    --border: #e3e5e8; --error: #c62828; --ok: #2e7d32;
    --radius: 12px;
    --link: #6a0fd6;          /* Textlinks hell: kräftiges Lila (Kontrast > 7:1 auf Weiß) */
    --link-line: #841feb;
}
@media (prefers-color-scheme: dark) {
    :root { --bg:#121417; --surface:#1c1f24; --text:#e8eaed; --muted:#9aa0a6; --border:#2c3036;
            --link: #ffffff; --link-line: #b06bff; }   /* dunkel: weiß mit lila Unterstrich */
}

/* Textlinks in Inhalten und Formularen (nicht Buttons/Kacheln) */
.app-main a:not(.btn):not(.dash-tile) {
    color: var(--link); font-weight: 600;
    text-decoration: underline; text-decoration-color: var(--link-line);
    text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.app-main a:not(.btn):not(.dash-tile):hover,
.app-main a:not(.btn):not(.dash-tile):focus-visible { text-decoration-color: currentColor; }
.app-main .muted a:not(.btn) { color: var(--link); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100dvh; display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}
.app-header {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: calc(.75rem + env(safe-area-inset-top)) 1rem .75rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.app-header h1 { font-size: 1.1rem; margin: 0; }
.app-user { font-size: .875rem; color: var(--muted); display: flex; gap: .75rem; align-items: center; }
.app-user a { color: var(--accent); text-decoration: none; font-weight: 600; }
.app-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 1rem; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.card h2 { margin: 0 0 1rem; font-size: 1.15rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], textarea {
    width: 100%; padding: .7rem .8rem; font: inherit; color: inherit;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
    display: inline-block; margin-top: 1rem; padding: .7rem 1.2rem; border: 0;
    border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
    cursor: pointer; width: 100%;
}
.msg { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .95rem; }
.msg-error { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); }
.msg-ok    { background: color-mix(in srgb, var(--ok) 12%, transparent);    color: var(--ok); }
.entry { border-top: 1px solid var(--border); padding: .75rem 0; }
.entry:first-child { border-top: 0; }
.entry time { display: block; font-size: .8rem; color: var(--muted); }
.muted { color: var(--muted); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* YForm-Ausgabe angleichen */
.rex-yform .form-group { margin-bottom: .25rem; }
.rex-yform .alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; }
.rex-yform .alert-danger { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); }
.rex-yform button, .rex-yform input[type=submit] {
    margin-top: 1rem; padding: .7rem 1.2rem; border: 0; border-radius: 8px; width: 100%;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
